Compare commits

..

53 Commits

Author SHA1 Message Date
just-another-jxliu
99d89b124f Drop FW Fixes for massdrop alt, ctrl, rocketeer & shift keyboards (#8)
- In config.h of each, added '#define BOOTKEY_HOLD_MS  2000' to define hold time required to active Boot key (was 500ms hardcode)
- Updated all active keymap.c files to use this define
- Added line in quantum.c in MAGIC_TOGGLE_NKRO case to clear_keyboard() before toggling nkro state to fix stuck key issues when switching NKRO.
2019-08-15 00:51:54 -07:00
just-another-jxliu
8b5e4959a0 Update SHIFT and Rocketeer config_led.c (#7) 2019-08-05 07:01:08 -07:00
just-another-jxliu
3cb242b47d Change debounce methodology to shift debounce window until row is settled (#5) 2019-08-02 16:44:19 -07:00
jonathan.liu
9b80ceca52 Rocketeer: LED positions for bottom LEDs, update mac_md keymap 2019-07-16 08:47:51 -07:00
jonathan.liu
9fdfae83d1 Misc including Rocketeer config_led.c 2019-07-12 03:05:12 -07:00
jonathan.liu
9075995ea3 Merge remote-tracking branch 'upstream/master' 2019-07-12 03:04:30 -07:00
jonathan.liu
c529972416 Merge remote-tracking branch 'origin/md_1800_qmk' 2019-07-12 00:49:08 -07:00
jonathan.liu
4c6b0f0291 Merge commit 'd0fb7005d51be7c876e63e87778d080c8a733a13' 2019-07-12 00:47:55 -07:00
jonathan.liu
9352fbee07 Merge commit '5fcd744ddba591829a129560992b2e43fb615d4d' 2019-07-11 23:47:27 -07:00
jonathan.liu
441b212c86 Upstream merge up to 02d44beb44 2019-07-11 23:21:18 -07:00
skullydazed
37d2f6dc2a Switch version incrementing to the command put together by @noroadsleft. (#6310)
* Switch version incrementing to the command put together by @noroadsleft.

* Update util/travis_compiled_push.sh

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
2019-07-11 22:33:25 -07:00
Cody Bender
475d2c0c30 [Keyboard] Adding KeyHive Maypad (#6287)
* added files for KeyHive Maypad

* updated maypad files and moved honeycomb inside keyhive dir

* fixed file paths, incorporated changes with fauxpark's suggestions, undid honeycomb move

* updated with fixes from PR

* added new lines to end of honeycomb files to fix compiling

* Updated info.json to match the macro name from maypad.h

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* reordered layout in info.json

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* removed KEYMAP from maypad.h

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* removed extraneous keymap files

* pulled qmk/master for honeycomb

* added ortho_5x4 and keymap cleanup

* matched identities in maypad.h

* added bootmagic functionality to maypad

* changed bootmagic to lite
2019-07-11 13:01:17 -07:00
omkbd
2121de9192 [Keyboard] [runner3680] Fix the number of keys (#6302)
* Fix the number of keys

* add RGBLIGHT_LIMIT_VAL

* fix RGBLED_NUM and COLS
2019-07-11 12:27:13 -07:00
fauxpark
901edea927 [Keyboard] Fix XD96 info.json (#6309)
* Fix XD96 info.json

* Comma

* Another comma

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
2019-07-11 12:09:48 -07:00
fauxpark
8e348c427d Display firmware size percentage (#6307) 2019-07-11 12:05:13 -07:00
fauxpark
2bbbfc6154 [Keyboard] Update Felix keyboard (#6306) 2019-07-11 12:04:22 -07:00
fauxpark
ecf0612cc8 [Docs] Clarify the rules.mk setup for Unicode (#6286)
* Clarify the rules.mk setup for Unicode

* code point

Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com>

* Remove "your"

Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com>

* Undo a line change

Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com>

* dot the comma

Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com>

* Update docs/feature_unicode.md

Co-Authored-By: Konstantin Đorđević <vomindoraan@gmail.com>
2019-07-11 11:33:55 -07:00
yttyx
676633e1f3 [Keymap] Balance Twelve / Steno Keymap for Planck (#6283)
* New keymap. Cursor layer does not work.

* Refinements to layout over months of use.

* Changes following review.

* Changes following review.
2019-07-11 11:32:47 -07:00
Napoleon Wulkan
e6420f0bd8 [Keyboard] Add handwired Wulkan keyboard (#6282)
* added handwired keyboard wulkan

* added info.json for qmk configurator

* fixed spelling

* enum dont need to be assigned to zero

* removed cflag from readme

* updated rules.mk

* removed unneeded rows from config

* moved unicode to keymap conf

* fix adjust layer and comments for keymap
2019-07-11 11:31:36 -07:00
XScorpion2
3ee062222a Fixing effects to respect user sat and val levels (#6275) 2019-07-11 11:29:19 -07:00
Stevan Milic
3dd2905b7b Add personal KBD67 keymap (#6292)
* Add kbdfans/kbd67/hotswap:stevanmilic keymap

* Change Fn+H, Fn+L to Ctrl+Left, Ctrl+Right

* Add keymap comments
2019-07-11 07:37:16 -07:00
zjp
607f6f5c16 Fix typo in Gentoo docstring (#6303) 2019-07-10 21:22:23 -07:00
noroadsleft
ffff0f03cb Fix bug in Mechllama G35 info.json (#6294) 2019-07-10 16:25:54 -07:00
noroadsleft
721b3546f6 QMK Configurator support for NEK Type A (#6295)
* QMK Configurator support for NEK Type A

* Update labels to match default keymap
2019-07-10 16:21:38 -07:00
Drashna Jaelre
05a97482e6 [Keyboard] Enable LTO on Handwired/Promethium to reduce compiled size (#6227) 2019-07-09 12:59:05 -07:00
Konstantin Đorđević
c69060465e Fix parentheses in macros, and in general clean up quantum.h (#5021)
* Fix up GPIO macros

* Fix up send string macros

`string` arguments must not be parenthesized

* Fix up miscellaneous macros

* Make indentation uniform (4 spaces)

* Make #ifdef vs #if defined usage consistent

* Reorder standard includes

* Revert indentation changes as per review comments

* Revert #if defined(__AVR__) → #ifdef __AVR__ change

* Change 2 space indent to 4 spaces on a couple of lines

* Replace include guard with #pragma once
2019-07-09 11:16:24 -07:00
Drashna Jaelre
37be1cb513 Fix debouncing issue for eager algorithms (#6081)
* Fix debouncing issue for eager algos

* Fix up typo issue
2019-07-09 11:09:54 -07:00
Kaylyn Bogle
207e50c534 Add G35 keyboard (#6263) 2019-07-09 08:01:11 -07:00
Drashna Jaelre
6cccc22be9 Use QUANTUM_LIB_SRC for i2c_master.c inclusion (#5617)
Using QUANTUM_LIB_SRC prevents the warning when multiple sources add the i2c_master.c file. Boards such as the Ergodox EZ Glow see this warning every time they compile because the board uses the file in general, and because the RGB LED Matrix requires it, as well.
2019-07-09 07:57:14 -07:00
noroadsleft
3184303037 [Keyboard] Espectro: add LAYOUT_split_bs_joined_right data to QMK Configurator (#6289) 2019-07-09 07:17:37 -07:00
noroadsleft
d780c2729b [Keyboard] Omnikeyish: fix LAYOUT_101 macro (#6285)
* Fix LAYOUT_101 macro

* Add default_101 keymap to prove the LAYOUT_101 macro works
2019-07-09 07:06:30 -07:00
Konstantin Đorđević
220873dfeb [Keymap] Add personal Wasdat keymap, update other keymaps (#6290)
* Add wasdat:konstantin keymap

TODO: Move it to layouts/

* Use HHKB arrow arrangement for mouse keys on KBD6X

* Move KC_APP from Ctrl to M on all boards

* Use RCT_RSF on Melody96

* Set TAP_HOLD_CAPS_DELAY to 50 in userspace

* Use RSF_RCT instead of RCT_RSF
2019-07-09 06:52:23 -07:00
fauxpark
8b1cdd1e3d Add copyright year placeholders to new keyboard script (#6280)
* Add copyright year placeholders to new keyboard script

* More copyright header tweaks
2019-07-08 14:07:35 -07:00
Jason Krasavage
dfebfecd48 [Keymap] Added my own keymap folder (#6261)
* added iris rev 3 keymap

* stuff

* Update config.h

* Removed personal mapping folder so that I can branch it

* Added personal Iris keymap folder

* added enums, removed break after return, and removed line 3 of keymap.c

* removed process record function
2019-07-08 12:58:12 -07:00
vxid
95b2364e5a [Keymap] Add crkbd/vxid keymap (#6281) 2019-07-08 11:15:59 -07:00
XScorpion2
6e6d079dd2 Updated OLED Docs with notes about screen timeout. (#6276)
* Updated OLED Docs with notes about screen timeout.

* Update docs/feature_oled_driver.md

Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>
2019-07-08 06:28:31 -07:00
Matthew Lyon
06ba968759 mattly's userspace and iris (#6279) 2019-07-08 06:27:30 -07:00
skullydazed
7579518613 Fix chibios so the dfu-suffix is only applied once. (#6270) 2019-07-07 09:08:49 -07:00
XScorpion2
d16db69367 Added mod carry over from press to release. (#5866)
Update docs/feature_space_cadet.md

Co-Authored-By: fauxpark <fauxpark@gmail.com>
2019-07-06 21:00:05 -07:00
GreenShadowMaker
a07da6e245 keymap for idobo (#6250)
* greenshadowmaker keymap for idobo xd75 massdrop

* remove uneeded config.h

* corrected format to match convention instead of xd75 where I accidentally started from

* fixed errors and added arrows bottom right to match my other layouts

* updated readme

* right arrow fix

* Update keyboards/idobo/keymaps/greenshadowmaker/keymap.c

removing unnecessary part, copied from different keymap

Co-Authored-By: fauxpark <fauxpark@gmail.com>

* added suggested changes

* removed unneded elements
2019-07-06 20:56:23 -07:00
fauxpark
dd1790c1b3 Noxary 268.2 update (#6254)
* Fix Noxary 268.2 layout macros & info.json

* Update Noxary 268.2 to current QMK code style
2019-07-06 20:55:25 -07:00
Sid Carter
44f3c614c2 My personal keymap for the Iris Rev3 (#6271)
* updates to my iris keymap

* some rational updates to the keymap - let's see how this works

* updates to my iris keymap

* some rational updates to the keymap - let's see how this works

* add mouse keys and remove unused keys and some cleanup

* a little bit more cleanup

* actually enable mousekeys

* fix markdown lint complaints

* fix capitalization

* changes made per suggestions
2019-07-06 20:53:56 -07:00
Michel Gotta
853f5231d3 [Keymap] Adding new Gherkin keymap and configuration with RGB strip (#6252) 2019-07-05 23:20:17 -07:00
patrickmt
413a8938f1 190528 updates to get it compiling
Updates to get the package compiling and working for the most part
Bug with reactive lighting for QMK code and keeping caps/num lock lit when on
2019-06-03 10:30:35 -04:00
patrickmt
082c835c26 Merge remote-tracking branch 'upstream/master' into md_1800_qmk 2019-04-16 09:26:22 -04:00
patrickmt
0500497612 ctrl alt working but not fully tested 2019-04-16 09:24:38 -04:00
jonathan.liu
a0fac849eb Merge remote-tracking branch 'upstream/master' 2018-12-06 23:35:20 -08:00
jonathan.liu
e0e57110e0 Add LED instructions to ALT default/mac, CTRL mac 2018-10-17 11:43:40 -07:00
jonathan.liu
02d6be34d7 Merge remote-tracking branch 'upstream/master' 2018-10-15 17:42:39 -07:00
jonathan.liu
151feb4723 Change back to LED IDs starting at 1 2018-09-28 17:54:08 -07:00
jonathan.liu
ca618bcf6c CTRL: LED loop perf improvement from patrickmt 2018-09-20 19:02:39 -07:00
jonathan.liu
d8936f3435 Use highest active layer only for LEDs 2018-09-14 15:47:47 -07:00
just-another-jxliu
5fb9b45481 CTRL (arm_atsam) support user-defined LED instructions (#2)
* CTRL (arm_atsam) support user-defined LED instructions

* ok, layer matching works now

* Bitwise LED ID to reduce number of instructions (performance)

* Use 32-bit ints to be more compatible with generation in JS

* TYpo
2018-09-14 14:23:36 -07:00
222 changed files with 9863 additions and 1494 deletions

View File

@@ -133,7 +133,7 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
OPT_DEFS += -DIS31FL3731
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3731-simple.c
SRC += i2c_master.c
QUANTUM_LIB_SRC += i2c_master.c
endif
RGB_MATRIX_ENABLE ?= no
@@ -157,21 +157,21 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3731.c
SRC += i2c_master.c
QUANTUM_LIB_SRC += i2c_master.c
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3733.c
SRC += i2c_master.c
QUANTUM_LIB_SRC += i2c_master.c
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3737.c
SRC += i2c_master.c
QUANTUM_LIB_SRC += i2c_master.c
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
@@ -271,7 +271,7 @@ ifeq ($(strip $(HAPTIC_ENABLE)), DRV2605L)
COMMON_VPATH += $(DRIVER_PATH)/haptic
SRC += haptic.c
SRC += DRV2605L.c
SRC += i2c_master.c
QUANTUM_LIB_SRC += i2c_master.c
OPT_DEFS += -DHAPTIC_ENABLE
OPT_DEFS += -DDRV2605L
endif

View File

@@ -14,7 +14,7 @@ Tested combinations:
Hardware configurations using ARM-based microcontrollers or different sizes of OLED modules may be compatible, but are untested.
!> Warning: This OLED Driver currently uses the new i2c_master driver from split common code. If your split keyboard uses i2c to communication between sides this driver could cause an address conflict (serial is fine). Please contact your keyboard vendor and ask them to migrate to the latest split common code to fix this.
!> Warning: This OLED Driver currently uses the new i2c_master driver from split common code. If your split keyboard uses I2C to communicate between sides, this driver could cause an address conflict (serial is fine). Please contact your keyboard vendor and ask them to migrate to the latest split common code to fix this. In addition, the display timeout system to reduce OLED burn-in also uses split common to detect keypresses, so you will need to implement custom timeout logic for non-split common keyboards.
## Usage

View File

@@ -43,6 +43,7 @@ By default Space Cadet assumes a US ANSI layout, but if your layout uses differe
|`LAPO_KEYS` |`KC_LALT, KC_LSFT, KC_9` |Send `KC_LALT` when held, the mod `KC_LSFT` with the key `KC_9` when tapped. |
|`RAPC_KEYS` |`KC_RALT, KC_RSFT, KC_0` |Send `KC_RALT` when held, the mod `KC_RSFT` with the key `KC_0` when tapped. |
|`SFTENT_KEYS` |`KC_RSFT, KC_TRNS, SFTENT_KEY` |Send `KC_RSFT` when held, no mod with the key `SFTENT_KEY` when tapped. |
|`SPACE_CADET_MODIFIER_CARRYOVER` |*Not defined* |Store current modifiers before the hold mod is pressed and use them with the tap mod and keycode. Useful for when you frequently release a modifier before triggering Space Cadet. |
## Obsolete Configuration

View File

@@ -1,28 +1,44 @@
# Unicode Support
There are three Unicode keymap definition methods available in QMK:
Unicode characters can be input straight from your keyboard! There are some limitations, however.
## `UNICODE_ENABLE`
QMK has three different methods for enabling Unicode input and defining keycodes:
Supports Unicode up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji. The keycode function is `UC(c)` in the keymap, where _c_ is the code point's number (preferably hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`.
## Basic Unicode
## `UNICODEMAP_ENABLE`
This method supports Unicode code points up to `0x7FFF`. This covers characters for most modern languages, as well as symbols, but it doesn't cover emoji.
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(i)`, where _i_ is an array index into the mapping table. The table may contain at most 16384 entries.
Add the following to your `rules.mk`:
You may want to have an enum to make referencing easier. So, you could add something like this to your keymap file:
```make
UNICODE_ENABLE = yes
```
Then add `UC(c)` keycodes to your keymap, where _c_ is the code point (preferably in hexadecimal, up to 4 digits long). For example: `UC(0x45B)`, `UC(0x30C4)`.
## Unicode Map
This method supports all possible code points (up to `0x10FFFF`); however, you need to maintain a separate mapping table in your keymap file, which may contain at most 16384 entries.
Add the following to your `rules.mk`:
```make
UNICODEMAP_ENABLE = yes
```
Then add `X(i)` keycodes to your keymap, where _i_ is an array index into the mapping table:
```c
enum unicode_names {
BANG,
IRONY,
SNEK,
BANG,
IRONY,
SNEK
};
const uint32_t PROGMEM unicode_map[] = {
[BANG] = 0x203D, // ‽
[IRONY] = 0x2E2E, // ⸮
[SNEK] = 0x1F40D, // 🐍
[BANG] = 0x203D, // ‽
[IRONY] = 0x2E2E, // ⸮
[SNEK] = 0x1F40D, // 🐍
};
```
@@ -30,27 +46,33 @@ Then you can use `X(BANG)`, `X(SNEK)` etc. in your keymap.
### Lower and Upper Case
Characters often come in lower and upper case pairs, for example: å, Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear.
Characters often come in lower and upper case pairs, such as å and Å. To make inputting these characters easier, you can use `XP(i, j)` in your keymap, where _i_ and _j_ are the mapping table indices of the lower and upper case character, respectively. If you're holding down Shift or have Caps Lock turned on when you press the key, the second (upper case) character will be inserted; otherwise, the first (lower case) version will appear.
This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP`. This blends Unicode keys in with regular alphas.
This is most useful when creating a keymap for an international layout with special characters. Instead of having to put the lower and upper case versions of a character on separate keys, you can have them both on the same key by using `XP()`. This helps blend Unicode keys in with regular alphas.
Due to keycode size constraints, _i_ and _j_ can each only refer to one of the first 128 characters in your `unicode_map`. In other words, 0 ≤ _i_ ≤ 127 and 0 ≤ _j_ ≤ 127. This is enough for most use cases, but if you'd like to customize the index calculation, you can override the [`unicodemap_index()`](https://github.com/qmk/qmk_firmware/blob/71f640d47ee12c862c798e1f56392853c7b1c1a8/quantum/process_keycode/process_unicodemap.c#L40) function. This also allows you to, say, check Ctrl instead of Shift/Caps.
## `UCIS_ENABLE`
## UCIS
Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to add a keycode or function that calls `qk_ucis_start()`. Once this function has been called, you can type the corresponding 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 character inserted.
This method also supports all possible code points. As with the Unicode Map method, you need to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you have to create a custom keycode or function that invokes this functionality.
For instance, you could define a table like this in your keymap file:
Add the following to your `rules.mk`:
```make
UCIS_ENABLE = yes
```
Then define a table like this in your keymap file:
```c
const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE(
UCIS_SYM("poop", 0x1F4A9), // 💩
UCIS_SYM("rofl", 0x1F923), // 🤣
UCIS_SYM("kiss", 0x1F619) // 😙
UCIS_SYM("poop", 0x1F4A9), // 💩
UCIS_SYM("rofl", 0x1F923), // 🤣
UCIS_SYM("kiss", 0x1F619) // 😙
);
```
To use it, call `qk_ucis_start()`, then type "rofl" and hit Enter. QMK should erase the "rofl" text and insert the laughing emoji.
To use it, call `qk_ucis_start()`. Then, type the mnemonic for the character (such as "rofl"), and hit Space or Enter. QMK should erase the "rofl" text and insert the laughing emoji.
### Customization
@@ -68,7 +90,7 @@ Unicode input in QMK works by inputting a sequence of characters to the OS, sort
The following input modes are available:
* **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`).
* **`UC_OSX`**: macOS built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with Unicode Map).
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`) for Unicode input, but this can be changed by defining [`UNICODE_KEY_OSX`](#input-key-configuration) with another keycode.
@@ -112,7 +134,7 @@ You can also switch the input mode by calling `set_unicode_input_mode(x)` in you
```c
void eeconfig_init_user(void) {
set_unicode_input_mode(UC_LNX);
set_unicode_input_mode(UC_LNX);
}
```

View File

@@ -2,9 +2,7 @@ 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
QUANTUM_LIB_SRC += i2c_master.c
endif
ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),)

View File

@@ -0,0 +1,13 @@
#pragma once
#undef RGB_DI_PIN
#undef RGBLED_NUM
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 10
/* Make layout upside down = USB port on left side */
#undef MATRIX_ROW_PINS
#undef MATRIX_COL_PINS
#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 }
#define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 }

View File

@@ -0,0 +1,8 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = 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, LT(1, KC_ENT), LSFT_T(KC_Z), LALT_T(KC_X), LGUI_T(KC_C), KC_V, KC_BSPC, KC_SPC, RGUI_T(KC_B), LT(3, KC_N), LT(2, KC_M), KC_RSFT),
[1] = LAYOUT_ortho_3x10(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, 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_COMM, KC_DOT, KC_SLSH, KC_RSFT),
[2] = LAYOUT_ortho_3x10(KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_NO, KC_SCLN, KC_NO, KC_QUOT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_RSFT),
[3] = LAYOUT_ortho_3x10(KC_TAB, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, 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_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO)
};

View File

@@ -0,0 +1,3 @@
BACKLIGHT_ENABLE = no
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = yes

View File

@@ -0,0 +1,3 @@
# Vxid crkbd layout
Inspired by sdothum's wide planck layout.

View File

@@ -0,0 +1,44 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//#define USE_MATRIX_I2C
/* 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

View File

@@ -0,0 +1,85 @@
#include QMK_KEYBOARD_H
#include "bootloader.h"
#ifdef PROTOCOL_LUFA
#include "lufa.h"
#include "split_util.h"
#endif
extern keymap_config_t keymap_config;
extern uint8_t is_master;
#define _QWERTY 0
#define _LOWER 1
#define _RAISE 2
enum custom_keycodes {
QWERTY = SAFE_RANGE,
LOWER,
RAISE
};
#define KC______ KC_TRNS
#define KC_XXXXX KC_NO
#define KC_LOWER LOWER
#define KC_RAISE RAISE
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_kc( \
//,-----------------------------------------. ,-----------------------------------------.
Q, W, E, R, T, ESC, DEL, Y, U, I, O, P,\
//|------+------+------+------+------+------| |------+------+------+------+------+------|
A, S, D, F, G, SPC, BSPC, H, J, K, L, SCLN,\
//|------+------+------+------+------+------| |------+------+------+------+------+------|
Z, X, C, V, B, TAB, ENT, N, M, COMM, DOT, SLSH,\
//|------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
LALT, LGUI, LCTL, LSFT, RAISE, LOWER \
//`--------------------' `--------------------'
),
[_LOWER] = LAYOUT_kc( \
//,-----------------------------------------. ,------------------------------------------.
1, 2, 3, 4, 5, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\
//|------+------+------+------+------+------| |-------+------+------+------+------+------|
6, 7, 8, 9, 0, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\
//|------+------+------+------+------+------| |-------+------+------+------+------+------|
EQL, PLUS, MINS, SLSH, ASTR, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\
//|------+------+------+------+------+------+------| |------+-------+------+------+------+------+------|
LALT, LGUI, LCTL, LSFT, RAISE, LOWER \
//`--------------------' `--------------------'
),
[_RAISE] = LAYOUT_kc( \
//,-----------------------------------------. ,------------------------------------------.
EXLM, AT, HASH, DLR, PERC, LPRN, RPRN, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\
//|------+------+------+------+------+------| |-------+------+------+------+------+------|
CIRC, AMPR, ASTR, QUOT, DQUO, LCBR, RCBR, LEFT, DOWN, UP, RIGHT, XXXXX,\
//|------+------+------+------+------+------| |-------+------+------+------+------+------|
BSLS, TILD, GRV, UNDS, PIPE, LBRC, RBRC, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\
//|------+------+------+------+------+------+------| |------+-------+------+------+------+------+------|
LALT, LGUI, LCTL, LSFT, RAISE, LOWER \
//`--------------------' `--------------------'
)
};
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;
}
return true;
}

View File

@@ -0,0 +1,31 @@
# 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.
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/glcdfont.c \
./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 \

View File

@@ -16,6 +16,7 @@
# # project specific files
SRC += matrix.c
QUANTUM_LIB_SRC += i2c_master.c
# MCU name
MCU = atmega32u4
@@ -85,9 +86,4 @@ RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no # enable later
DEBOUNCE_TYPE = eager_pr
ifeq ($(strip $(RGB_MATRIX_ENABLE)), no)
SRC += i2c_master.c
endif
LAYOUTS = ergodox

View File

@@ -117,6 +117,117 @@
]
},
"LAYOUT_split_bs_joined_right": {
"key_count": 100,
"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": "K60", "x": 5, "y": 0},
{"label": "K61", "x": 6, "y": 0},
{"label": "K62", "x": 7, "y": 0},
{"label": "K63", "x": 8, "y": 0},
{"label": "K05", "x": 9, "y": 0},
{"label": "K06", "x": 10, "y": 0},
{"label": "K07", "x": 11, "y": 0},
{"label": "K08", "x": 12, "y": 0},
{"label": "K72", "x": 13, "y": 0},
{"label": "K09", "x": 14, "y": 0},
{"label": "K0A", "x": 15, "y": 0},
{"label": "K0B", "x": 16, "y": 0},
{"label": "K0C", "x": 17, "y": 0},
{"label": "K7C", "x": 18, "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": "K64", "x": 5, "y": 1},
{"label": "K65", "x": 6, "y": 1},
{"label": "K66", "x": 7, "y": 1},
{"label": "K67", "x": 8, "y": 1},
{"label": "K15", "x": 9, "y": 1},
{"label": "K16", "x": 10, "y": 1},
{"label": "K17", "x": 11, "y": 1},
{"label": "K18", "x": 12, "y": 1},
{"label": "K70", "x": 13, "y": 1},
{"label": "K71", "x": 14, "y": 1},
{"label": "K19", "x": 15, "y": 1},
{"label": "K1A", "x": 16, "y": 1},
{"label": "K1B", "x": 17, "y": 1},
{"label": "K1C", "x": 18, "y": 1},
{"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": "K68", "x": 5.5, "y": 2},
{"label": "K69", "x": 6.5, "y": 2},
{"label": "K6A", "x": 7.5, "y": 2},
{"label": "K6B", "x": 8.5, "y": 2},
{"label": "K25", "x": 9.5, "y": 2},
{"label": "K26", "x": 10.5, "y": 2},
{"label": "K27", "x": 11.5, "y": 2},
{"label": "K28", "x": 12.5, "y": 2},
{"label": "K73", "x": 13.5, "y": 2, "w": 1.5},
{"label": "K29", "x": 15, "y": 2},
{"label": "K2A", "x": 16, "y": 2},
{"label": "K2B", "x": 17, "y": 2},
{"label": "K2C", "x": 18, "y": 2, "h": 2},
{"label": "K30", "x": 0, "y": 3, "w": 1.75},
{"label": "K31", "x": 1.75, "y": 3},
{"label": "K32", "x": 2.75, "y": 3},
{"label": "K33", "x": 3.75, "y": 3},
{"label": "K34", "x": 4.75, "y": 3},
{"label": "K6C", "x": 5.75, "y": 3},
{"label": "K75", "x": 6.75, "y": 3},
{"label": "K76", "x": 7.75, "y": 3},
{"label": "K77", "x": 8.75, "y": 3},
{"label": "K35", "x": 9.75, "y": 3},
{"label": "K36", "x": 10.75, "y": 3},
{"label": "K37", "x": 11.75, "y": 3},
{"label": "K38", "x": 12.75, "y": 3, "w": 2.25},
{"label": "K39", "x": 15, "y": 3},
{"label": "K3A", "x": 16, "y": 3},
{"label": "K3B", "x": 17, "y": 3},
{"label": "K40", "x": 0, "y": 4, "w": 2.25},
{"label": "K42", "x": 2.25, "y": 4},
{"label": "K43", "x": 3.25, "y": 4},
{"label": "K44", "x": 4.25, "y": 4},
{"label": "K78", "x": 5.25, "y": 4},
{"label": "K79", "x": 6.25, "y": 4},
{"label": "K7A", "x": 7.25, "y": 4},
{"label": "K7B", "x": 8.25, "y": 4},
{"label": "K45", "x": 9.25, "y": 4},
{"label": "K46", "x": 10.25, "y": 4},
{"label": "K47", "x": 11.25, "y": 4},
{"label": "K48", "x": 12.25, "y": 4, "w": 1.75},
{"label": "K74", "x": 14, "y": 4},
{"label": "K49", "x": 15, "y": 4},
{"label": "K4A", "x": 16, "y": 4},
{"label": "K4B", "x": 17, "y": 4},
{"label": "K4C", "x": 18, "y": 4, "h": 2},
{"label": "K50", "x": 0, "y": 5, "w": 1.25},
{"label": "K51", "x": 1.25, "y": 5, "w": 1.25},
{"label": "K52", "x": 2.5, "y": 5, "w": 1.25},
{"label": "K59", "x": 3.75, "y": 5, "w": 6.25},
{"label": "K55", "x": 10, "y": 5, "w": 1.5},
{"label": "K57", "x": 11.5, "y": 5, "w": 1.5},
{"label": "K58", "x": 13, "y": 5},
{"label": "K53", "x": 14, "y": 5},
{"label": "K54", "x": 15, "y": 5},
{"label": "K5A", "x": 16, "y": 5},
{"label": "K5B", "x": 17, "y": 5}
]
},
"LAYOUT_split_shift_and_bs": {
"key_count": 104,
"layout": [

View File

@@ -1,5 +1,4 @@
#ifndef CONFIG_H
#define CONFIG_H
#pragma once
#include "config_common.h"
@@ -9,40 +8,225 @@
#define DEVICE_VER 0x0001
#define MANUFACTURER Unikeyboard
#define PRODUCT Felix
#define DESCRIPTION 4x5 number/macropad.
#define DESCRIPTION 4x5 number/macropad
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 4
/* key matrix pins */
/*
* 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, B3, B1, F7, F6 }
#define MATRIX_COL_PINS { B5, B4, E6, D7 }
#define UNUSED_PINS
/* COL2ROW or ROW2COL */
/* COL2ROW, ROW2COL */
#define DIODE_DIRECTION ROW2COL
/* number of backlight levels */
/* Not sure what pin controls the backlighting, need help for this. */
#define BACKLIGHT_PIN
#define BACKLIGHT_LEVELS 5
/*
* 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
/* Set 0 if debouncing isn't needed */
#define BACKLIGHT_PIN C6
#define BACKLIGHT_LEVELS 5
//#define BACKLIGHT_BREATHING
// #define RGB_DI_PIN E2
// #ifdef RGB_DI_PIN
// #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
// /*== customize breathing effect ==*/
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
// /*==== use exp() and sin() ====*/
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
// #endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 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
/* there is no rgb underglow by default. */
#define 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
/* 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 */
/* defined by default; to change, uncomment and set to the combination you want */
// #define IS_COMMAND() (get_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_HELP H
//#define MAGIC_KEY_HELP_ALT 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 0
//#define MAGIC_KEY_LAYER0_ALT GRAVE
//#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 B
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
//#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

View File

@@ -1,5 +1,4 @@
#ifndef FELIX_H
#define FELIX_H
#pragma once
#include "quantum.h"
@@ -18,5 +17,3 @@
}
#define LAYOUT LAYOUT_ortho_5x4
#endif

View File

@@ -6,7 +6,28 @@
"height": 5,
"layouts": {
"LAYOUT_ortho_5x4": {
"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":"K100", "x":0, "y":1}, {"label":"K101", "x":1, "y":1}, {"label":"K102", "x":2, "y":1}, {"label":"K103", "x":3, "y":1}, {"label":"K200", "x":0, "y":2}, {"label":"K201", "x":1, "y":2}, {"label":"K202", "x":2, "y":2}, {"label":"K203", "x":3, "y":2}, {"label":"K300", "x":0, "y":3}, {"label":"K301", "x":1, "y":3}, {"label":"K302", "x":2, "y":3}, {"label":"K303", "x":3, "y":3}, {"label":"K400", "x":0, "y":4}, {"label":"K401", "x":1, "y":4}, {"label":"K402", "x":2, "y":4}, {"label":"K403", "x":3, "y":4}]
"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":"K100", "x":0, "y":1},
{"label":"K101", "x":1, "y":1},
{"label":"K102", "x":2, "y":1},
{"label":"K103", "x":3, "y":1},
{"label":"K200", "x":0, "y":2},
{"label":"K201", "x":1, "y":2},
{"label":"K202", "x":2, "y":2},
{"label":"K203", "x":3, "y":2},
{"label":"K300", "x":0, "y":3},
{"label":"K301", "x":1, "y":3},
{"label":"K302", "x":2, "y":3},
{"label":"K303", "x":3, "y":3},
{"label":"K400", "x":0, "y":4},
{"label":"K401", "x":1, "y":4},
{"label":"K402", "x":2, "y":4},
{"label":"K403", "x":3, "y":4}
]
}
}
}

View File

@@ -1,22 +1,11 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT(
KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_P4, KC_P5, KC_P6, KC_HOME,
KC_P1, KC_P2, KC_P3, KC_END,
KC_P0, KC_PEQL, KC_PDOT, KC_PENT
),
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_HOME,
KC_P1, KC_P2, KC_P3, KC_END,
KC_P0, KC_PEQL, KC_PDOT, KC_PENT
)
};
void persistant_default_layer_set(uint16_t default_layer) {
}
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
}
return true;
}

View File

@@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment):
make felix: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).

View File

@@ -37,22 +37,34 @@ F_USB = $(F_CPU)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
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
# Build Options
# comment out to disable the 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 = 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
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
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
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
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_5x4

View File

@@ -0,0 +1,216 @@
/*
* Good on you for modifying your layout, this is the most nonQMK layout you will come across
* There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer
*
* Don't modify the steno layer directly, instead add chords using the keycodes and macros
* from sten.h to the layout you want to modify.
*
* Observe the comment above processQWERTY!
*
* http://docs.gboards.ca
*/
#include QMK_KEYBOARD_H
#include "sten.h"
#include "keymap_steno.h"
#define IGNORE_MOD_TAP_INTERRUPT
int getKeymapCount(void);
// Proper Layers
#define FUNCT (LSD | LK | LP | LH)
#define MEDIA (LSD | LK | LW | LR)
#define MOVE (ST1 | ST2)
/* Keyboard Layout
* ,---------------------------------. ,------------------------------.
* | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD |
* |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----|
* | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RG | RB | RS | RZ |
* `---------------------------------' `------------------------------'
* ,---------------, .---------------.
* | NUM | LA | LO | | RE | RU | NUM |
* `---------------' `---------------'
*/
// YOU MUST ORDER THIS!
// P Will return from processing on the first match it finds. Therefore
// PJ Will run the requested action, remove the matched chord and continue
//
// First any chords that would conflict with PJs need to be checked, then PJs, lastly Ps.
// For all chords should be ordered by length in their section!
//
// http://docs.gboards.ca
bool processQwerty(void) {
// Place P's that would be trashed by PJ's here
P( RT | RS | RD | RZ | NUM, SEND_STRING(VERSION); SEND_STRING(__DATE__));
P( NUM | LA | LO | RE | RU, SEND(KC_MPLY));
P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC));
// Thumb Chords
P( LA | LO | RE | RU, SEND(KC_CAPS));
P( LA | RU, SEND(KC_ESC));
PJ( LO | RE, SEND(KC_LCTL));
PJ( NUM | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
PJ( NUM | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
// Mods
PJ( RT | RD | RS | RZ, SEND(KC_LGUI));
PJ( RT | RD, SEND(KC_LCTL));
PJ( RS | RZ, SEND(KC_LALT));
PJ( LA | NUM, SEND(KC_LCTL));
PJ( LA | LO, SEND(KC_LALT));
PJ( LO, SEND(KC_LSFT));
// Function Layer
P( FUNCT | RF | RR, SEND(KC_F5));
P( FUNCT | RP | RB, SEND(KC_F6));
P( FUNCT | RL | RG, SEND(KC_F7));
P( FUNCT | RT | RS, SEND(KC_F8));
P( FUNCT | RF, SEND(KC_F1));
P( FUNCT | RP, SEND(KC_F2));
P( FUNCT | RL, SEND(KC_F3));
P( FUNCT | RT, SEND(KC_F4));
P( FUNCT | RR, SEND(KC_F9));
P( FUNCT | RG, SEND(KC_F10));
P( FUNCT | RB, SEND(KC_F11));
P( FUNCT | RS, SEND(KC_F12));
// Movement Layer
P( MOVE | RF, SEND(KC_LEFT));
P( MOVE | RP, SEND(KC_DOWN));
P( MOVE | RL, SEND(KC_UP));
P( MOVE | RT, SEND(KC_RIGHT));
P( MOVE | ST3, SEND(KC_PGUP));
P( MOVE | ST4, SEND(KC_PGDN));
// Media Layer
P( MEDIA | RF, SEND(KC_MPRV));
P( MEDIA | RP, SEND(KC_MPLY));
P( MEDIA | RL, SEND(KC_MPLY));
P( MEDIA | RT, SEND(KC_MNXT));
P( MEDIA | RD, SEND(KC_VOLU));
P( MEDIA | RZ, SEND(KC_VOLD));
P( MEDIA | RS, SEND(KC_MUTE));
// Mouse Keys
P( LP | LH, clickMouse(KC_MS_BTN1));
P( LW | LR, clickMouse(KC_MS_BTN2));
// Number Row
P( NUM | LSU, SEND(KC_1));
P( NUM | LFT, SEND(KC_2));
P( NUM | LP, SEND(KC_3));
P( NUM | LH, SEND(KC_4));
P( NUM | ST1, SEND(KC_5));
P( NUM | ST3, SEND(KC_6));
P( NUM | RF, SEND(KC_7));
P( NUM | RP, SEND(KC_8));
P( NUM | RL, SEND(KC_9));
P( NUM | RT, SEND(KC_0));
P( NUM | LA, SEND(KC_5));
P( NUM | RT, SEND(KC_0));
// Specials
P( LA | NUM, SEND(KC_ESC));
P( RU | NUM, SEND(KC_TAB));
P( RE | RU, SEND(KC_BSPC));
P( RD | RZ, SEND(KC_ENT));
P( RE, SEND(KC_ENT));
P( RD, SEND(KC_BSPC));
P( NUM, SEND(KC_BSPC));
P( LA, SEND(KC_SPC));
P( RU, SEND(KC_SPC));
P( RZ, SEND(KC_ESC));
// Letters
P( LSU | LSD, SEND(KC_A));
P( LFT | LK, SEND(KC_S));
P( LP | LW, SEND(KC_D));
P( LH | LR, SEND(KC_F));
P( ST1 | ST2, SEND(KC_G));
P( ST3 | ST4, SEND(KC_H));
P( RF | RR, SEND(KC_J));
P( RT | RS, SEND(KC_SCLN))
P( RG | RL, SEND(KC_L));
P( RP | RB, SEND(KC_K));
P( LSU, SEND(KC_Q));
P( LSD, SEND(KC_Z));
P( LFT, SEND(KC_W));
P( LK, SEND(KC_X));
P( LP, SEND(KC_E));
P( LW, SEND(KC_C));
P( LH, SEND(KC_R));
P( LR, SEND(KC_V));
P( ST1, SEND(KC_T));
P( ST2, SEND(KC_B));
P( ST3, SEND(KC_Y));
P( ST4, SEND(KC_N));
P( RF, SEND(KC_U));
P( RR, SEND(KC_M));
P( RP, SEND(KC_I));
P( RB, SEND(KC_COMM));
P( RL, SEND(KC_O));
P( RG, SEND(KC_DOT));
P( RT, SEND(KC_P));
P( RS, SEND(KC_SLSH));
// Symbols and Numbers
P( PWR | RE | RU, SEND(KC_ENT));
P( PWR | LA | LO, SEND(KC_SPC));
P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
P( PWR | ST1 | ST2, SEND(KC_GRV)); // `
P( PWR | RD | RZ, SEND(KC_ESC));
P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // #
P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
P( PWR | LW, SEND(KC_LBRC));
P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
P( PWR | LR, SEND(KC_RBRC));
P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
P( PWR | ST3, SEND(KC_QUOT));
P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // "
P( PWR | RF, SEND(KC_KP_PLUS));
P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // &
P( PWR | RP, SEND(KC_MINS));
P( PWR | RB, SEND(KC_EQL));
P( PWR | RL, SEND(KC_SLSH));
P( PWR | RG, SEND(KC_COMM));
P( PWR | RT, SEND(KC_PAST));
P( PWR | RS, SEND(KC_DOT));
P( PWR | RD, SEND(KC_TAB));
P( PWR | LA, SEND(KC_SCLN));
P( PWR | LO, SEND(KC_SLSH));
P( PWR | RE, SEND(KC_SCLN));
P( PWR | RU, SEND(KC_SLSH));
// If we make here, send as a steno chord
// If plover is running we can hook that host side
return false;
}
#define STENO_LAYER 0
// "Layers"
// Steno layer should be first in your map.
// When PWR | FN | RR | RG | RB | RS is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
// If you have only a single layer, you must set SINGLELAYER = yes in your rules.mk, otherwise you may experince undefined behaviour
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Main layer, everything goes through here
[STENO_LAYER] = LAYOUT_georgi(
STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
STN_PWR, 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_A, STN_O, STN_E, STN_U, STN_N1)
};
int getKeymapCount(void) {
return sizeof(keymaps)/sizeof(keymaps[0]);
}

View File

@@ -0,0 +1,6 @@
# Georgi QWERTY/Steno firmware
This is a blank template configured with 5K of free space for your onboard dictionary!
Read the docs over at [gBoards](http://docs.gboards.ca)
Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR!

View File

@@ -0,0 +1,27 @@
#----------------------------------------------------------------------------
# make georgi:extrakey:dfu
# Make sure you have dfu-programmer installed!
#----------------------------------------------------------------------------
#Debug options
VERBOSE = yes
CONSOLE_ENABLE = yes
DEBUG_MATRIX_SCAN_RATE = no
DEBUG_MATRIX = no
KEYBOARD_SHARED_EP = yes
CUSTOM_MATRIX = yes
MOUSEKEY_ENABLE = no
SINGLE_LAYER = no
# A bunch of stuff that you shouldn't touch unless you
# know what you're doing.
#
# No touchy, capiche?
SRC += matrix.c i2c_master.c
ifeq ($(strip $(DEBUG_MATRIX)), yes)
OPT_DEFS += -DDEBUG_MATRIX
endif
ifeq ($(strip $(SINGLE_LAYER)), yes)
OPT_DEFS += -DSINGLE_LAYER
endif

View File

@@ -47,7 +47,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
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)
@@ -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.
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
PS2_MOUSE_ENABLE = yes
PS2_USE_INT = yes
API_SYSEX_ENABLE = no
@@ -76,3 +76,5 @@ SRC += ws2812.c
SRC += rgbsps.c
SRC += analog.c
SRC += matrix.c
LINK_TIME_OPTIMIZATION_ENABLE = yes

View File

@@ -0,0 +1,14 @@
# wulkan
Handwired 40% keyboard build with Proton C.
Keyboard Maintainer: [Napoleon Wulkan](https://github.com/wulkan)
Hardware Supported: Proton C
Hardware Availability: [OLKB.com](https://olkb.com)
Make example for this keyboard (after setting up your build environment):
make handwired/wulkan:default:dfu-util
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).

View File

@@ -0,0 +1,23 @@
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER Wulkan
#define PRODUCT Handwired48Keys
#define DESCRIPTION A compact ortholinear handwired keyboard
/* key matrix size */
#define MATRIX_ROWS 4
#define MATRIX_COLS 12
#define MATRIX_ROW_PINS { B8, A0, A1, A2 }
#define MATRIX_COL_PINS { B13, B14, B15, B9, B7, B6, B5, B4, B3, B2, B1, B0 }
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
#define FORCE_NKRO

View File

@@ -0,0 +1,13 @@
{
"keyboard_name": "wulkan",
"url": "",
"maintainer": "Napoleon Wulkan",
"width": 12,
"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":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}]
}
}
}

View File

@@ -0,0 +1,111 @@
#include QMK_KEYBOARD_H
enum layers {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST,
};
enum unicode_names {
SE_AA_HIGH,
SE_AE_HIGH,
SE_OE_HIGH,
SE_AA_LOW,
SE_AE_LOW,
SE_OE_LOW,
};
const uint32_t PROGMEM unicode_map[] = {
[SE_AA_HIGH] = 0x00C5,
[SE_AE_HIGH] = 0x00C4,
[SE_OE_HIGH] = 0x00D6,
[SE_AA_LOW] = 0x00E5,
[SE_AE_LOW] = 0x00E4,
[SE_OE_LOW] = 0x00F6,
};
#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 | , | . | / |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | Ctrl | Alt | GUI |Lower |Enter |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_RSFT,
_______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_ENT, 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_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 | 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 |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | | | | | | | | Ö | Ä | |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_ortho_4x12(
_______, RESET, _______, _______, KC_WH_U, _______, _______, KC_MS_U, _______, _______, XP(SE_AA_LOW, SE_AA_HIGH), KC_DEL,
_______, _______, _______, _______, KC_WH_D, _______, KC_MS_L, KC_MS_D, KC_MS_R, XP(SE_OE_LOW, SE_OE_HIGH), XP(SE_AE_LOW, SE_AE_HIGH), _______,
_______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, KC_BTN1, _______, KC_BTN2, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)
};
uint32_t layer_state_set_user(uint32_t state) {
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
}
void eeconfig_init_user(void) {
set_unicode_input_mode(UC_LNX);
}

View File

@@ -0,0 +1 @@
UNICODEMAP_ENABLE = yes

View File

@@ -0,0 +1,22 @@
MCU = STM32F303
# 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
AUDIO_ENABLE = no
RGBLIGHT_ENABLE = no
LAYOUTS = ortho_4x12
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_SUSPEND_POWER_DOWN = yes
UNICODEMAP_ENABLE = no

View File

@@ -0,0 +1,6 @@
#include "wulkan.h"
void matrix_init_kb(void) {
matrix_init_user();
}

View File

@@ -0,0 +1,21 @@
#pragma once
#include "quantum.h"
#define ___ KC_NO
#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 LAYOUT_ortho_4x12

View File

@@ -101,7 +101,7 @@
},
"",
"UP",
"",
"PrtScr",
"H",
"J",
"K",
@@ -182,9 +182,9 @@
"c": "#cccccc",
"t": "#000000"
},
"",
"",
"",
"PrtScr"
"Left",
"Down",
"Up",
"Right"
]
]

View File

@@ -1,40 +1,38 @@
#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,
LOWER = SAFE_RANGE,
RAISE,
ADJUST,
};
enum layer_names {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST,
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* QWERTY
* .--------------------------------------------------------------------------------------------------------------------------------------.
* | ESC | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | BACKSP |
* | ESC | 1 | 2 | 3 | 4 | 5 | = | | - | 6 | 7 | 8 | 9 | 0 | BACKSP |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------|
* | TAB | Q | W | E | R | T | | | [ | Y | U | I | O | P | ] |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------|
* | RAISE | A | S | D | F | G | | UP | | H | J | K | L | ; | ' |
* | RAISE | A | S | D | F | G | | UP | PrtScr | H | J | K | L | ; | ' |
* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------|
* | LSHIFT | Z | X | C | V | B | LEFT | DOWN | RIGHT | N | M | , | . | / | RSHIFT |
* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------|
* | ` | \ | LALT | LCTRL | LOWER | SPACE | LGUI | DEL | ENTER | SPACE | RAISE | | | | PrtScr |
* | ` | \ | LALT | LCTRL | LOWER | SPACE | LGUI | DEL | ENTER | SPACE | RAISE | LEFT | DOWN | UP | RIGHT |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT_ortho_5x15( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, XXXXXXX, 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, XXXXXXX, XXXXXXX, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC, \
RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_UP, XXXXXXX, 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_LEFT, KC_DOWN, KC_RGHT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
KC_GRAVE, KC_GRAVE, KC_LALT, KC_LCTL, LOWER, KC_SPC, KC_LGUI, KC_DEL, KC_ENT, KC_SPC, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR \
[_QWERTY] = LAYOUT_ortho_5x15(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, XXXXXXX, KC_MINS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, XXXXXXX, XXXXXXX, KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_RBRC,
RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, XXXXXXX, KC_UP, KC_PSCR, 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_LEFT, KC_DOWN, KC_RGHT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
KC_GRAVE, KC_BSLS, KC_LALT, KC_LCTL, LOWER, KC_SPC, KC_LGUI, KC_DEL, KC_ENT, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
@@ -51,12 +49,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | LOWER | | APP | | | | RAISE | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT_ortho_5x15( \
XXXXXXX, KC_F1, KC_F2, KC_F3, XXXXXXX, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, \
XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
RAISE, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
[_LOWER] = LAYOUT_ortho_5x15(
XXXXXXX, KC_F1, KC_F2, KC_F3, XXXXXXX, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX,
XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RAISE, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
/* RAISE
@@ -72,12 +70,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | LOWER | | | | | | RAISE | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_ortho_5x15( \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
RAISE, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
[_RAISE] = LAYOUT_ortho_5x15(
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RAISE, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
@@ -94,12 +92,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | LOWER | | | | | | RAISE | | | | |
* '--------------------------------------------------------------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT_ortho_5x15( \
RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_P, RGB_M_T, RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
RAISE, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
EEP_RST, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
[_ADJUST] = LAYOUT_ortho_5x15(
RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_M_P, RGB_M_T, RGB_MOD, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
RAISE, XXXXXXX, RGB_HUI, RGB_SAI, RGB_VAI, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
EEP_RST, XXXXXXX, RGB_HUD, RGB_SAD, RGB_VAD, BL_DEC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LOWER, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RAISE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
),
@@ -116,7 +114,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
update_tri_layer(_LOWER, _RAISE, _ADJUST);
}
return false;
break;
case RAISE:
if (record->event.pressed) {
layer_on(_RAISE);
@@ -126,15 +123,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
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;
}

View File

@@ -1,3 +1,5 @@
# GreenShadowMaker keymap for idobo
make idobo:greenshadowmaker:dfu
Note: keyboard-layout-editor-gsm-idobo.json shoudl be the matching layout for http://www.keyboard-layout-editor.com

View File

@@ -2,7 +2,7 @@
"keyboard_name": "kbd4x",
"url": "",
"maintainer": "qmk",
"width": 12,
"width": 14,
"height": 4,
"layouts": {
"LAYOUT_planck_mit": {

View File

@@ -0,0 +1,19 @@
#pragma once
#define FORCE_NKRO
#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 NO_ACTION_ONESHOT
#define PERMISSIVE_HOLD
#define TAPPING_TERM 200
#define TAPPING_TOGGLE 2
#define TAP_HOLD_CAPS_DELAY 50

View File

@@ -0,0 +1,79 @@
#include QMK_KEYBOARD_H
#define FN MO(L_FN)
#define FN_CAPS LT(L_FN, KC_CAPS)
#define FN_ESC LT(L_FN, KC_ESC)
#define FN_FNLK TT(L_FN)
#define MV_UP LCTL(KC_UP)
#define MV_DOWN LCTL(KC_DOWN)
#define MV_LEFT LCTL(KC_LEFT)
#define MV_RGHT LCTL(KC_RGHT)
#define TOP LCTL(KC_HOME)
#define BOTTOM LCTL(KC_END)
enum keycodes {
CLEAR = SAFE_RANGE,
};
enum layers {
L_BASE,
L_FN,
};
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;
default:
return true;
}
}
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Base layer
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤
* │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
* │FnEsc │ 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│FnLk│ │ ← │ ↓ │ → │
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
[L_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_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_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_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_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \
),
/* Function layer
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│NLk│SLk│Pau│
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤
* │ │M2 │M↑ │M1 │M3 │ │ │ │ │Stp│Ply│Prv│Nxt│Clear│Ins│
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤
* │ │M← │M↓ │M→ │MW↑│ │ │Mv←│ ↓ │ ↑ │Mv→│ │ │Top│
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤
* │ │MA0│MA2│MW←│MW→│ │ │App│Vo-│Vo+│Mut│ │PgU│Btm│
* ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤
* │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│
* └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘
*/
[L_FN] = 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_NLCK, KC_SLCK, KC_PAUS, \
_______, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, _______, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \
_______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, MV_LEFT, KC_DOWN, KC_UP, MV_RGHT, _______, _______, _______, TOP, \
_______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, KC_APP, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, BOTTOM, \
_______, _______, _______, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \
),
};

View File

@@ -0,0 +1,6 @@
BOOTMAGIC_ENABLE = no
COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes
EXTRAKEY_ENABLE = yes
MOUSEKEY_ENABLE = yes
NKRO_ENABLE = yes

View File

@@ -56,20 +56,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤
* │ │Hom│ ↑ │End│PgU│ │ │ │ │M1 │M↑ │M3 │M2 │ Del │
* │ │Hom│ ↑ │End│PgU│ │ │ │ │M3 │M1 │M↑ │M2 │ Del │
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
* │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M↓ │M→ │ │
* │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M→ │ │
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤
* │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │
* │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│App│MW←│MW→│M │ │ │
* └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘
* │ │ │ MW↓ │MAcl2│ │
* └───┴─────┴───────────────────────────┴─────┴───┘
*/
[L_FN] = 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_INS,
_______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN3, KC_BTN2, KC_DEL,
_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______,
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______,
_______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, KC_DEL,
_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_R, _______,
_______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_APP, KC_WH_L, KC_WH_R, KC_MS_D, _______, _______,
XXXXXXX, _______, _______, KC_WH_D, KC_ACL2, _______, XXXXXXX
),
@@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤
* │ │Mv←│Mv↓│Mv→│TNx│ │ │ │ │ │ │ │ │
* ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤
* │ │RTg│RV-│RV+│ │ │ │ │ │ │ │ │
* │ │RTg│RV-│RV+│ │ │ │ │M4 │M5 │ │ │ │
* └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘
* │DPR│DstNA│ │ │ │
* └───┴─────┴───────────────────────────┴─────┴───┘
@@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR,
_______, TOP, MV_UP, BOTTOM, TAB_PRV, _______, _______, _______, _______, _______, _______, _______, _______, DEL_NXT,
_______, MV_LEFT, MV_DOWN, MV_RGHT, TAB_NXT, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, KC_BTN4, KC_BTN5, _______, _______, _______,
XXXXXXX, DST_P_R, DST_N_A, _______, _______, _______, XXXXXXX
),
};

View File

@@ -2,8 +2,8 @@
"keyboard_name": "Iris",
"url": "https://keeb.io",
"maintainer": "Keebio",
"width": 15,
"height": 5.75,
"width": 14.5,
"height": 5,
"layouts": {
"LAYOUT": {
"layout": [

View File

@@ -0,0 +1,25 @@
/*
Copyright 2017 Danny Nguyen <danny@keeb.io>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// #define USE_I2C
#define EE_HANDS
#undef RGBLED_NUM
#define RGBLED_NUM 12

View File

@@ -0,0 +1,44 @@
#include QMK_KEYBOARD_H
enum layer_names {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
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,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRACKET, KC_RBRACKET, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
KC_LALT, KC_LGUI, KC_ENT, MO(_LOWER), KC_SPC, KC_RALT
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
),
[_LOWER] = LAYOUT(
//┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
_______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______,
//├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
_______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______,
//├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
_______, _______, _______, _______, _______, KC_LPRN, _______, _______, KC_RPRN, _______, _______, _______, _______, _______,
//└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
_______, _______, _______, _______, _______, _______
// └────────┴────────┴────────┘ └────────┴────────┴────────┘
)
};

View File

@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes

View File

@@ -0,0 +1,28 @@
/*
Copyright 2017 Danny Nguyen <danny@keeb.io>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// #define USE_I2C
#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

View File

@@ -0,0 +1,50 @@
#include QMK_KEYBOARD_H
#include "mattly.h"
// extern keymap_config_t keymap_config;
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_SCLN,
KC_CAPS, A_CTRL, S_ALT, D_GUI, F_SHFT, KC_G, KC_H, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT,
XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, SPC_SFT, BSP_NUM, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
ESC_HYP, BSP_NUM, ENT_SFT, SPC_SFT, TAB_SYM, DEL_WRP
),
[_SYMBOL] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, 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_UNDS, _______,
RESET, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, _______, _______, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, KC_QUES, _______,
_______, _______, _______, _______, _______, _______
),
[_NAVNUM] = LAYOUT(
XNOTIFY, XXXXXXX, XPRVSPC, NWIN, XNXTSPC, XXXXXXX, XXXXXXX, KC_SLSH, KC_ASTR, KC_MINS, KC_PLUS, XXXXXXX,
XALLWIN, NAVFWD, BWORD, KC_UP, FWORD, KC_PGUP, KC_DLR, KC_P7, KC_P8, KC_P9, KC_DOT, XXXXXXX,
XDESKTP, NAVBACK, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_PERC, KC_P4, KC_P5, KC_P6, KC_EQL, XXXXXXX,
RESET, PTAB, KC_HOME, PWIN, KC_END, NTAB, _______, _______, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_ENT, XXXXXXX,
_______, _______, _______, _______, _______, KC_P0
),
[_FUNCT] = 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,
RESET, XALLWIN, XPRVSPC, NWIN, XNXTSPC, XDESKTP, XXXXXXX, RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_K, RESET,
DEBUG, XNOTIFY, PTAB, PWIN, NTAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, KC_MPLY, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
_______, _______, _______, _______, _______, _______
)
};
void encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
if (clockwise) {
tap_code(KC_MS_WH_UP);
} else {
tap_code(KC_MS_WH_DOWN);
}
}
}

View File

@@ -0,0 +1 @@
See my readme in [users/mattly](../../../../../users/mattly/readme.md)

View File

@@ -0,0 +1,33 @@
/*
Copyright 2019 Khader Syed
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#define USE_I2C
#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
// #undef PERMISSIVE_HOLD
//#define TAPPING_FORCE_HOLD
//#define RETRO_TAPPING
#define PERMISSIVE_HOLD

View File

@@ -0,0 +1,116 @@
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
enum layer_names {
_QWERTY,
_LOWER,
_RAISE,
_ADJUST
};
enum custom_keycodes {
LOWER = SAFE_RANGE,
RAISE,
};
#define KC_ KC_TRNS
#define KC_LOWR LOWER
#define KC_RASE RAISE
#define KC_RST RESET
#define KC_BL_S BL_STEP
// left control as a left key too - makes perfect sense
#define KC_LECL LCTL_T(KC_LEFT)
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 ,BSLS,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
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,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
LGUI,LOWR,ENT , SPC ,RASE,RALT
// `----+----+----' `----+----+----'
),
[_LOWER] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, , UP , , , , , ,BTN1, , , ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,LEFT,DOWN,RGHT, , , MS_L,MS_D,MS_U,MS_R, , ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
),
[_RAISE] = LAYOUT_kc(
//,----+----+----+----+----+----. ,----+----+----+----+----+----.
F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
, ,VOLU, , ,LBRC, RBRC,UNDS,PLUS, , ,MUTE,
//|----+----+----+----+----+----| |----+----+----+----+----+----|
,MPLY,VOLD,MNXT, ,LPRN, RPRN,MINS,EQL , , , ,
//|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----|
, , , , , , , , , , , , , ,
//`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----'
, , , , ,
// `----+----+----' `----+----+----'
),
[_ADJUST] = LAYOUT(
//,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------.
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------|
RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______,
//|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------|
BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
//`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------'
_______, _______, _______, _______, _______, _______
// `--------+--------+--------' `--------+--------+--------'
)
};
#ifdef AUDIO_ENABLE
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
#endif
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;
}

View File

@@ -0,0 +1,9 @@
# My Iris Layout
![My Iris Rev3](https://i.imgur.com/7oXacel.jpg)
- mouse keys enabled
- WASD as arrow keys, and same ones for media
- keys that I need, while removing keys that I don't
See keymap.c for layouts

View File

@@ -0,0 +1,3 @@
RGBLIGHT_ENABLE = yes
BACKLIGHT_ENABLE = yes
MOUSEKEY_ENABLE = yes

View File

@@ -0,0 +1,246 @@
/*
Copyright 2019 codybender
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x6060
#define DEVICE_VER 0x0001
#define MANUFACTURER KeyHive
#define PRODUCT maypad
#define DESCRIPTION Budget-friendly numpad
/* key matrix size */
#define MATRIX_ROWS 5
#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 { C6, D7, E6, B4, B5 }
#define MATRIX_COL_PINS { F6, F7, B1, B3 }
#define UNUSED_PINS
/* COL2ROW, ROW2COL*/
#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
// #define RGB_DI_PIN E2
// #ifdef RGB_DI_PIN
// #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
// /*== customize breathing effect ==*/
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
// /*==== use exp() and sin() ====*/
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
// #endif
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 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 */
/* defined by default; to change, uncomment and set to the combination you want */
// #define IS_COMMAND() (get_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_HELP H
//#define MAGIC_KEY_HELP_ALT 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 0
//#define MAGIC_KEY_LAYER0_ALT GRAVE
//#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 B
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
//#define MAGIC_KEY_LOCK CAPS
//#define MAGIC_KEY_EEPROM E
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
//#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

View File

@@ -0,0 +1,16 @@
{
"keyboard_name": "maypad",
"url": "https://keyhive.xyz/shop/may-pad",
"maintainer": "codybender",
"width": 4,
"height": 5,
"layouts": {
"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}]
},
"LAYOUT_ortho_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":"+", "x":3, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "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}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}]
}
}
}

View File

@@ -0,0 +1,19 @@
/* Copyright 2019 codybender
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
// place overrides here

View File

@@ -0,0 +1,40 @@
/* Copyright 2019 codybender
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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) {
}
void led_set_user(uint8_t usb_led) {
}

View File

@@ -0,0 +1 @@
# The default keymap for maypad

View File

@@ -0,0 +1,51 @@
/* Copyright 2019 codybender
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "maypad.h"
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
/*
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);
}
*/

View File

@@ -0,0 +1,61 @@
/* Copyright 2019 codybender
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
/* maypad numpad layout
* .-------------------.
* |NLCK| /| *| -|
* |-------------------|
* | 7| 8| 9| |
* |--------------| |
* | 4| 5| 6| +|
* |-------------------|
* | 1| 2| 3| |
* |--------------| |
* | 0| .| Ent|
* '-------------------'
*/
// The first section contains all of the arguments
// The second converts the arguments into a two-dimensional array
#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 } \
}
#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 } \
}

View File

@@ -0,0 +1,13 @@
# KeyHive Maypad
![Maypad Layout](https://i.imgur.com/B7WXcfy.png)
A budget-friendly, exposed-component numpad from [KeyHive](https://www.keyhive.xyz)
Keyboard Maintainer: [Cody Bender](https://github.com/codybender)
Make example for this keyboard (after setting up your build environment):
make keyhive/maypad: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).

View File

@@ -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 = 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 = 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_5x4 numpad_5x4

View File

@@ -54,7 +54,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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
#define SR_EXP_SERCOM_NUM 2
/* 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
@@ -94,6 +94,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */

View File

@@ -0,0 +1,81 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//ADC configuration table column indices
#define ADC_PORT 0
#define ADC_PIN 1
#define ADC_MUX 2
#define ADC_INDEX 3
#define ADC_MUXPOS 4
#define ADC_REFSEL 5
#define ADC_SAMPLENUM 6
#define ADC_SAMPLEN 7
//ADC configuration table row indices
#define ADC_5V 0 //5V bus voltage
#define ADC_C1A5 1 //Connector 1 A5 CC voltage
#define ADC_C1B5 2 //Connector 1 B5 CC voltage
#define ADC_C2A5 3 //Connector 2 A5 CC voltage
#define ADC_C2B5 4 //Connector 2 B5 CC voltage
#define ADC_C1I 5 //Connector 1 current
#define ADC_C2I 6 //Connector 2 current
//ADC_PORT: PORT of the PIN on the MCU (Ex: 0 = PA, 1 = PB, ...)
// Set ADC_PORT to ADC_NA if it is not available for use
//ADC_PIN: PIN on the MCU (Ex: 0 = 00, 1 = 01, 12 = 12, ...)
//ADC_MUX: PMUX setting for the MCU PIN (Ex: 0 = A, 1 = B, 2 = C, ...)
//ADC_INDEX: ADC to use (Ex: 0 = ADC0, 1 = ADC1, ...)
//ADC_MUXPOS: MUXPOS setting to read on the ADC (Use macros from Atmel library adc.h ADC_INPUTCTRL_MUXPOS_AIN*_Val)
//ADC_REFSEL: Reference the ADC is to use (Use macros from Atmel library adc.h ADC_REFCTRL_REFSEL_*_Val)
//ADC_SAMPLENUM: Number of samples to average for output (Use macros from Atmel library adc.h ADC_AVGCTRL_SAMPLENUM_*_Val)
//ADC_SAMPLEN: Sampling time for each sample in units of CLK_ADC cycles depending on the ADC clock frequency
// ADC_PORT ADC_MUX
// | ADC_PIN | ADC_INDEX
// | | | | ADC_MUXPOS ADC_REFSEL ADC_SAMPLENUM ADC_SAMPLEN
#define ADC_CONFIG_5V 1, 0, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN12_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 45
#define ADC_CONFIG_C1A5 1, 2, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN14_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_16_Val, 63
#define ADC_CONFIG_C1B5 ADC_NA, 0, 0, 0, 0, 0, 0, 0
#define ADC_CONFIG_C2A5 1, 1, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN13_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_16_Val, 63
#define ADC_CONFIG_C2B5 ADC_NA, 0, 0, 0, 0, 0, 0, 0
#define ADC_CONFIG_C1I ADC_NA, 0, 0, 0, 0, 0, 0, 0
#define ADC_CONFIG_C2I ADC_NA, 0, 0, 0, 0, 0, 0, 0
//Conversion values dependant upon the circuitry
#define ADC_5V_VOLTS_PER_COUNT 0.001904297f
#define ADC_5V_VOLTS_OFFSET 0.0f
#define ADC_5V_NOMINAL 5.0f
#define ADC_5V_NOMINAL_COUNTS (ADC_5V_NOMINAL / ADC_5V_VOLTS_PER_COUNT)
//Conversion macros
#define ADC_5V_C2V(icounts) ((float)icounts * ADC_5V_VOLTS_PER_COUNT + ADC_5V_VOLTS_OFFSET) //Converts 5V Bus counts to volts
#define ADC_5V_V2C(v) (((float)v - ADC_5V_VOLTS_OFFSET) / ADC_5V_VOLTS_PER_COUNT) //Converts 5V Bus volts to counts
#define ADC_CC_5VCOR(v5counts, cc) ((float)v5counts == 0 ? 0 : ADC_5V_NOMINAL_COUNTS / (float)v5counts * (float)cc) //Corrects CC counts to nominal 5V value
#define ADC_USBC_EXTRA_NOMINAL 850 //Nominal ADC value for detection of connected device
#define ADC_USBC_EXTRA_NOMINAL_P1 1250 //Nominal ADC value for detection of connected device
//Note: Due to assembly error, USBC-1 J2 CC readings are wrong so we must check for special cases
#define USBC_IS_SINK(a5, b5) (USB_HOST_IS_2(g_usb_host_port) ? \
(a5 < ADC_USBC_EXTRA_NOMINAL_P1 || b5 < ADC_USBC_EXTRA_NOMINAL_P1) \
: \
(a5 < ADC_USBC_EXTRA_NOMINAL || b5 < ADC_USBC_EXTRA_NOMINAL) \
)
#define POWER_CHECK_INTERVAL 1 //How often to check power usage for adjustment and safety (ms)
#define V_5V_AVGS 50 //Number of 5V readings to average for algorithms wanting stable readings rather than instantaneous

View File

@@ -8,10 +8,14 @@
// This table can be almost-automatically derived from ISSI3733_LED_MAP that is
// defined in config_led.h
// scan in the following equations refers to the scan variable of ISSI3733_LED_MAP
// col = (uint8_t)(scan / 8)
// row = (uint8_t)(scan % 8)
//
// You can calculate the (0-244, 0-64) x/y values from the x/y values defined in
// ISSI3733_LED_MAP with the following formula:
// uint8_t rgb_x = ((ISSI3733_LED_MAP[i].x - MIN_X) / (MAX_X - MIN_X)) * 224;
// uint8_t rgb_y = ((ISSI3733_LED_MAP[i].y - MIN_Y) / (MAX_Y - MIN_Y)) * 64;
// uint8_t rgb_y = ((ISSI3733_LED_MAP[i].y - MIN_Y) / (MAX_Y - MIN_Y)) * 64; //TODO: 64 - this?
// Where the min/max vars are the minimum and maximum "bounds" of x/y values
// present in ISSI3733_LED_MAP
//

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 Massdrop Inc.
Copyright 2019 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
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
//Define number of ISSI3733 drivers being used (1...16)
//Define number of IS31FL3733 drivers being used (1...16)
#define ISSI3733_DRIVER_COUNT 2
#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT
//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic)
//Hardware address of each driver (Refer to IS31FL3733 pdf "Table 1 Slave Address" and keyboard schematic)
#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE }
//LED I2C bus speed
@@ -45,9 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ISSI3733_GCR_DEFAULT LED_GCR_MAX
//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 V5_HIGH 2494 //5V high level (After low power detect, point at which LEDs are allowed to use more power )
#define V5_LOW 2434 //5V low level (LED power rolled back to stay above this limit)
#define V5_CAT 2206 //5V catastrophic level (Host USB port potential to shut down)
//LED Mapping - More practically generated from a spreadsheet program
//id: ID of the LED (Sync with PCB callouts)
@@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//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
//scan: Associated key matrix scancode (set 255 if none or 254 for LED to turn off in alternating mode)
//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 }, \
@@ -129,46 +129,45 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ .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 = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .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 = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .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 = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .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 = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .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 = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .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 = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
{ .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 = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .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 = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .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 }, \
{ .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
};
#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

View File

@@ -0,0 +1,42 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
/* 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 */
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 IS31FL3733 CHIPS WHEN 0, RUN WHEN 1 */
uint16_t IRST:1; /*!< bit: 5 RESET IS31FL3733 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 */
} sr_exp_t;

View File

@@ -0,0 +1,28 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//Macros to Enable, Disable, and Update USB 5V bus connections
#define USBC_CFG_5V1_VAR sr_exp_data.bit.E_VBUS_1 //Variable storing USBC-1 5V Bus state
#define USBC_CFG_5V1_ENA 1 //Value to enable USBC-1 5V Bus
#define USBC_CFG_5V1_DIS 0 //Value to disable USBC-1 5V Bus
#define USBC_CFG_5V1_UPDATE SR_EXP_WriteData() //Command to run to update value
#define USBC_CFG_5V2_VAR sr_exp_data.bit.E_VBUS_2 //Variable storing USBC-2 5V Bus state
#define USBC_CFG_5V2_ENA 1 //Value to enable USBC-1 5V Bus
#define USBC_CFG_5V2_DIS 0 //Value to disable USBC-1 5V Bus
#define USBC_CFG_5V2_UPDATE SR_EXP_WriteData() //Command to run to update value

View File

@@ -1,8 +1,7 @@
#include QMK_KEYBOARD_H
enum alt_keycodes {
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
U_T_AGCR, //USB Toggle Automatic GCR control
U_T_AGCR = SAFE_RANGE, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
@@ -24,7 +23,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_MUTE, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \
@@ -56,11 +55,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
switch (keycode) {
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");

View File

@@ -1,8 +1,7 @@
#include QMK_KEYBOARD_H
enum alt_keycodes {
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
U_T_AGCR, //USB Toggle Automatic GCR control
U_T_AGCR = SAFE_RANGE, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
@@ -24,7 +23,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_MUTE, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \
@@ -56,11 +55,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
switch (keycode) {
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");
@@ -90,7 +84,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
@@ -125,3 +119,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; //Process all other keycodes normally
}
}
led_instruction_t led_instructions[] = {
{ .end = 1 }
};

View File

@@ -1,24 +1,28 @@
#include QMK_KEYBOARD_H
enum alt_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
L_BRD, //LED Brightness Decrease //Working
L_PTN, //LED Pattern Select Next //Working
L_PTP, //LED Pattern Select Previous //Working
L_PSI, //LED Pattern Speed Increase //Working
L_PSD, //LED Pattern Speed Decrease //Working
L_T_MD, //LED Toggle Mode //Working
L_T_ONF, //LED Toggle On / Off //Broken
L_ON, //LED On //Broken
L_OFF, //LED Off //Broken
L_T_BR, //LED Toggle Breath Effect //Working
L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working
U_T_AGCR, //USB Toggle Automatic GCR control //Working
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 //Working
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
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 and effect
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
DBG_FAC, //DEBUG Factory light testing (All on white)
MD_BOOT //Restart into bootloader after hold timeout
};
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
@@ -35,10 +39,10 @@ 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_MUTE, \
L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, DBG_FAC, _______, _______, KC_HOME, KC_PGDN, KC_END \
),
/*
[X] = LAYOUT(
@@ -59,12 +63,13 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
};
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
switch (keycode) {
case L_BRI:
@@ -81,6 +86,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
return false;
case L_PTN:
if (record->event.pressed) {
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -112,20 +137,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -140,7 +162,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_PTD:
if (record->event.pressed) {
led_animation_direction = !led_animation_direction;
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
return false;
case U_T_AGCR:
@@ -148,6 +196,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
}
return false;
case DBG_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
@@ -172,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}

View File

@@ -1,8 +1,7 @@
#include QMK_KEYBOARD_H
enum alt_keycodes {
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
U_T_AGCR, //USB Toggle Automatic GCR control
U_T_AGCR = SAFE_RANGE, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
@@ -24,7 +23,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_MUTE, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, DBG_TOG, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \
@@ -56,11 +55,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
switch (keycode) {
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");
@@ -90,7 +84,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
@@ -125,3 +119,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; //Process all other keycodes normally
}
}
led_instruction_t led_instructions[] = {
{ .end = 1 }
};

View File

@@ -1,24 +1,28 @@
#include QMK_KEYBOARD_H
enum alt_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
L_BRD, //LED Brightness Decrease //Working
L_PTN, //LED Pattern Select Next //Working
L_PTP, //LED Pattern Select Previous //Working
L_PSI, //LED Pattern Speed Increase //Working
L_PSD, //LED Pattern Speed Decrease //Working
L_T_MD, //LED Toggle Mode //Working
L_T_ONF, //LED Toggle On / Off //Broken
L_ON, //LED On //Broken
L_OFF, //LED Off //Broken
L_T_BR, //LED Toggle Breath Effect //Working
L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working
U_T_AGCR, //USB Toggle Automatic GCR control //Working
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 //Working
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
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 and effect
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
DBG_FAC, //DEBUG Factory light testing (All on white)
MD_BOOT //Restart into bootloader after hold timeout
};
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
@@ -35,10 +39,10 @@ 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_MUTE, \
L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_PGUP, KC_VOLD, \
_______, _______, _______, DBG_FAC, _______, _______, KC_HOME, KC_PGDN, KC_END \
),
/*
[X] = LAYOUT(
@@ -59,12 +63,13 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
};
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
switch (keycode) {
case L_BRI:
@@ -81,6 +86,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
return false;
case L_PTN:
if (record->event.pressed) {
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -112,20 +137,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -140,7 +162,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_PTD:
if (record->event.pressed) {
led_animation_direction = !led_animation_direction;
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
return false;
case U_T_AGCR:
@@ -148,6 +196,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
}
return false;
case DBG_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
@@ -172,7 +231,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}

View File

@@ -14,7 +14,6 @@ enum alt_keycodes {
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
@@ -38,7 +37,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_MUTE, \
_______, _______, _______, KC_UP, _______, _______, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \
_______, _______, _______, KC_UP, _______, _______, _______, _______, 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 \
@@ -146,11 +145,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
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");

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 Massdrop Inc.
Copyright 2019 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
@@ -22,6 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "clks.h"
#include <string.h>
#define MCU_PORTS_USED 2 //PA, PB
matrix_row_t mlatest[MATRIX_ROWS];
matrix_row_t mlast[MATRIX_ROWS];
matrix_row_t mdebounced[MATRIX_ROWS];
@@ -30,7 +32,7 @@ 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
uint32_t row_masks[MCU_PORTS_USED]; //Array size must match number of unique MCU ports used for reads (PA, PB, PC, etc)
__attribute__ ((weak))
void matrix_init_kb(void) {
@@ -56,9 +58,9 @@ void matrix_init(void)
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;
memset(row_masks, 0, sizeof(row_masks));
//Inputs
uint8_t row;
for (row = 0; row < MATRIX_ROWS; row++)
{
@@ -69,6 +71,7 @@ void matrix_init(void)
row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask
}
//Outputs
uint8_t col;
for (col = 0; col < MATRIX_COLS; col++)
{
@@ -80,27 +83,29 @@ void matrix_init(void)
}
uint64_t mdebouncing = 0;
bool debouncing = false;
uint8_t matrix_scan(void)
{
uint8_t mchanged;
uint64_t timer;
uint8_t row;
uint8_t col;
uint32_t scans[2]; //PA PB
if (timer_read64() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active
uint32_t scans[MCU_PORTS_USED]; //Array size must match number of unique MCU ports used for reads (PA, PB, PC, etc)
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
//Set output
PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output
wait_us(1); //Delay for output
wait_us(1); //Delay for output
//Read input (add unique ports as needed, PA, PB, PC, etc)
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 PA row pins data
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
//Clear output
PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output
for (row = 0; row < MATRIX_ROWS; row++)
{
@@ -110,25 +115,26 @@ uint8_t matrix_scan(void)
}
}
mchanged = 0; //Default to no matrix change since last
timer = timer_read64();
for (row = 0; row < MATRIX_ROWS; row++)
{
if (mlast[row] != mlatest[row])
mchanged = 1;
if (mlast[row] != mlatest[row]) {
debouncing = true;
mdebouncing = timer + DEBOUNCE;
}
mlast[row] = mlatest[row];
}
if (!mchanged)
if (debouncing && timer >= mdebouncing)
{
for (row = 0; row < MATRIX_ROWS; row++)
for (row = 0; row < MATRIX_ROWS; row++) {
mdebounced[row] = mlatest[row];
}
mdebouncing = 0;
}
else
{
//Begin or extend debounce on change
mdebouncing = timer_read64() + DEBOUNCE;
debouncing = false;
}
matrix_scan_quantum();

View File

@@ -1,6 +1,8 @@
# project specific files
SRC = matrix.c
SRC += config_led.c
SRC += spi.c
SRC += usb.c
#For platform and packs
ARM_ATSAM = SAMD51J18A

View File

@@ -0,0 +1,57 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#include "arm_atsam_protocol.h"
void SR_EXP_Init_kb(void) {
/* 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_EXP_SYNC_ENABLING); }
/* Set default shift register values */
sr_exp_data.reg = 0; //Clear data register
sr_exp_data.bit.HUB_CONNECT = 0; //USB Hub disconnected
sr_exp_data.bit.HUB_RESET_N = 0; //USB Hub in reset state
sr_exp_data.bit.SRC_1 = 1; //Set CON1 CC A5/B5 as Rd 5.1k
sr_exp_data.bit.SRC_2 = 1; //Set CON2 CC A5/B5 as Rd 5.1k
sr_exp_data.bit.S_UP = 0; //Default USB data to CON1
sr_exp_data.bit.E_UP_N = 1; //Disable HOST
sr_exp_data.bit.S_DN1 = 1; //Default EXTRA port to CON2
sr_exp_data.bit.E_DN1_N = 1; //Disable EXTRA
sr_exp_data.bit.E_VBUS_1 = 0; //Disable CON1 5V
sr_exp_data.bit.E_VBUS_2 = 0; //Disable CON2 5V
sr_exp_data.bit.IRST = 1; //LED drivers I2C in reset
sr_exp_data.bit.SDB_N = 0; //LED drivers in shutdown
/* Write shift register data */
SR_EXP_WriteData();
/* Enable shift register output */
SR_EXP_OE_N_ENA;
}

View File

@@ -0,0 +1,83 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#include "arm_atsam_protocol.h"
//Note: rp_best_index not used
void usb_set_host_kb(uint8_t con, uint8_t rp_best_index) {
if (con == 1) {
sr_exp_data.bit.S_UP = 0; //HOST to USBC-1
sr_exp_data.bit.S_DN1 = 1; //EXTRA to USBC-2
g_usb_host_port = USB_HOST_PORT_1; //Save host port
sr_exp_data.bit.E_VBUS_1 = 1; //Enable CON1 5V
SR_EXP_WriteData(); //Update port configuration
} else if (con == 2) {
sr_exp_data.bit.S_DN1 = 0; //HOST to USBC-2
sr_exp_data.bit.S_UP = 1; //EXTRA to USBC-1
g_usb_host_port = USB_HOST_PORT_2; //Save host port
sr_exp_data.bit.E_VBUS_2 = 1; //Enable CON2 5V
SR_EXP_WriteData(); //Update port configuration
}
}
void usb_set_extra_kb(uint8_t con) {
if (con == 1) {
sr_exp_data.bit.SRC_1 = 0; //Set CON1 CC A5/B5 as Rp 56k
sr_exp_data.bit.E_VBUS_1 = 0; //Disable CON1 5V
SR_EXP_WriteData(); //Update port configuration
} else if (con == 2) {
sr_exp_data.bit.SRC_2 = 0; //Set CON2 CC A5/B5 as Rp 56k
sr_exp_data.bit.E_VBUS_2 = 0; //Disable CON2 5V
SR_EXP_WriteData(); //Update port configuration
}
}
void usb_init_host_detection_kb(void) {
//Disable 5V
sr_exp_data.bit.E_VBUS_1 = 0; //Disable CON1 5V
sr_exp_data.bit.E_VBUS_2 = 0; //Disable CON2 5V
//Configure default paths
sr_exp_data.bit.S_UP = 0; //HOST to USBC-1
sr_exp_data.bit.S_DN1 = 1; //EXTRA to USBC-2
//Configure CC lines
sr_exp_data.bit.SRC_1 = 1; //Set CON1 CC A5/B5 as Rd 5.1k
sr_exp_data.bit.SRC_2 = 1; //Set CON2 CC A5/B5 as Rd 5.1k
//Enable ports
sr_exp_data.bit.E_UP_N = 0; //Enable HOST for use
sr_exp_data.bit.E_DN1_N = 0; //Enable EXTRA for use
SR_EXP_WriteData(); //Update port configuration
}
//Return 1 if configuration successful
//Return 0 otherwise
uint8_t usb_attach_port_configure_kb(uint8_t g_usb_host_port, uint16_t usbc_cc_a5_v, uint16_t usbc_cc_b5_v) {
if (USB_HOST_IS_1(g_usb_host_port)) { //If host is port 1
//Set up port 2
usb_set_extra_kb(2);
return 1;
} else if (USB_HOST_IS_2(g_usb_host_port)) { //If host is on port 2
//Set up port 1
usb_set_extra_kb(1);
return 1;
}
return 0;
}

View File

@@ -54,7 +54,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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
#define SR_EXP_SERCOM_NUM 2
/* 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
@@ -94,6 +94,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5
// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
//#define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */

View File

@@ -0,0 +1,75 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//ADC configuration table column indices
#define ADC_PORT 0
#define ADC_PIN 1
#define ADC_MUX 2
#define ADC_INDEX 3
#define ADC_MUXPOS 4
#define ADC_REFSEL 5
#define ADC_SAMPLENUM 6
#define ADC_SAMPLEN 7
//ADC configuration table row indices
#define ADC_5V 0 //5V bus voltage
#define ADC_C1A5 1 //Connector 1 A5 CC voltage
#define ADC_C1B5 2 //Connector 1 B5 CC voltage
#define ADC_C2A5 3 //Connector 2 A5 CC voltage
#define ADC_C2B5 4 //Connector 2 B5 CC voltage
#define ADC_C1I 5 //Connector 1 current
#define ADC_C2I 6 //Connector 2 current
//ADC_PORT: PORT of the PIN on the MCU (Ex: 0 = PA, 1 = PB, ...)
// Set ADC_PORT to ADC_NA if it is not available for use
//ADC_PIN: PIN on the MCU (Ex: 0 = 00, 1 = 01, 12 = 12, ...)
//ADC_MUX: PMUX setting for the MCU PIN (Ex: 0 = A, 1 = B, 2 = C, ...)
//ADC_INDEX: ADC to use (Ex: 0 = ADC0, 1 = ADC1, ...)
//ADC_MUXPOS: MUXPOS setting to read on the ADC (Use macros from Atmel library adc.h ADC_INPUTCTRL_MUXPOS_AIN*_Val)
//ADC_REFSEL: Reference the ADC is to use (Use macros from Atmel library adc.h ADC_REFCTRL_REFSEL_*_Val)
//ADC_SAMPLENUM: Number of samples to average for output (Use macros from Atmel library adc.h ADC_AVGCTRL_SAMPLENUM_*_Val)
//ADC_SAMPLEN: Sampling time for each sample in units of CLK_ADC cycles depending on the ADC clock frequency
// ADC_PORT ADC_MUX
// | ADC_PIN | ADC_INDEX
// | | | | ADC_MUXPOS ADC_REFSEL ADC_SAMPLENUM ADC_SAMPLEN
#define ADC_CONFIG_5V 1, 0, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN12_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 45
#define ADC_CONFIG_C1A5 1, 2, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN14_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_16_Val, 63
#define ADC_CONFIG_C1B5 ADC_NA, 0, 0, 0, 0, 0, 0, 0
#define ADC_CONFIG_C2A5 1, 1, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN13_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_16_Val, 63
#define ADC_CONFIG_C2B5 ADC_NA, 0, 0, 0, 0, 0, 0, 0
#define ADC_CONFIG_C1I ADC_NA, 0, 0, 0, 0, 0, 0, 0
#define ADC_CONFIG_C2I ADC_NA, 0, 0, 0, 0, 0, 0, 0
//Conversion values dependant upon the circuitry
#define ADC_5V_VOLTS_PER_COUNT 0.001904297f
#define ADC_5V_VOLTS_OFFSET 0.0f
#define ADC_5V_NOMINAL 5.0f
#define ADC_5V_NOMINAL_COUNTS (ADC_5V_NOMINAL / ADC_5V_VOLTS_PER_COUNT)
//Conversion macros
#define ADC_5V_C2V(icounts) ((float)icounts * ADC_5V_VOLTS_PER_COUNT + ADC_5V_VOLTS_OFFSET) //Converts 5V Bus counts to volts
#define ADC_5V_V2C(v) (((float)v - ADC_5V_VOLTS_OFFSET) / ADC_5V_VOLTS_PER_COUNT) //Converts 5V Bus volts to counts
#define ADC_CC_5VCOR(v5counts, cc) ((float)v5counts == 0 ? 0 : ADC_5V_NOMINAL_COUNTS / (float)v5counts * (float)cc) //Corrects CC counts to nominal 5V value
#define ADC_USBC_EXTRA_NOMINAL 850 //Nominal ADC value for detection of connected device
#define USBC_IS_SINK(a5, b5) (a5 < ADC_USBC_EXTRA_NOMINAL || b5 < ADC_USBC_EXTRA_NOMINAL)
#define POWER_CHECK_INTERVAL 1 //How often to check power usage for adjustment and safety (ms)
#define V_5V_AVGS 50 //Number of 5V readings to average for algorithms wanting stable readings rather than instantaneous

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 Massdrop Inc.
Copyright 2019 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
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once
//Define number of ISSI3733 drivers being used (1...16)
//Define number of IS31FL3733 drivers being used (1...16)
#define ISSI3733_DRIVER_COUNT 2
#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT
//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic)
//Hardware address of each driver (Refer to IS31FL3733 pdf "Table 1 Slave Address" and keyboard schematic)
#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE }
//LED I2C bus speed
@@ -45,9 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ISSI3733_GCR_DEFAULT LED_GCR_MAX
//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 V5_HIGH 2494 //5V high level (After low power detect, point at which LEDs are allowed to use more power )
#define V5_LOW 2434 //5V low level (LED power rolled back to stay above this limit)
#define V5_CAT 2206 //5V catastrophic level (Host USB port potential to shut down)
//LED Mapping - More practically generated from a spreadsheet program
//id: ID of the LED (Sync with PCB callouts)
@@ -58,7 +58,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
//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
//scan: Associated key matrix scancode (set 255 if none or 254 for LED to turn off in alternating mode)
//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 }, \
@@ -149,37 +149,37 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
{ .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 = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 91, .x = 9.995, .y = -4.535, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 93, .x = 7.705, .y = -4.535, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 95, .x = 5.415, .y = -4.535, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 97, .x = 3.125, .y = -4.535, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 99, .x = 0.835, .y = -4.535, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 101, .x = -0.41, .y = -3.245, .adr = { .drv = 2, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
{ .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 = 103, .x = -0.41, .y = -0.875, .adr = { .drv = 2, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .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 = 105, .x = 0.835, .y = 0.415, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 107, .x = 3.125, .y = 0.415, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 109, .x = 5.415, .y = 0.415, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 111, .x = 7.705, .y = 0.415, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 113, .x = 9.995, .y = 0.415, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 115, .x = 12.285, .y = 0.415, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .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 = 117, .x = 13.535, .y = -0.875, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .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 }, \
{ .id = 119, .x = 13.535, .y = -3.245, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
};
#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality

View File

@@ -0,0 +1,42 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
/* 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 */
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 IS31FL3733 CHIPS WHEN 0, RUN WHEN 1 */
uint16_t IRST:1; /*!< bit: 5 RESET IS31FL3733 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 */
} sr_exp_t;

View File

@@ -0,0 +1,28 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//Macros to Enable, Disable, and Update USB 5V bus connections
#define USBC_CFG_5V1_VAR sr_exp_data.bit.E_VBUS_1 //Variable storing USBC-1 5V Bus state
#define USBC_CFG_5V1_ENA 1 //Value to enable USBC-1 5V Bus
#define USBC_CFG_5V1_DIS 0 //Value to disable USBC-1 5V Bus
#define USBC_CFG_5V1_UPDATE SR_EXP_WriteData() //Command to run to update value
#define USBC_CFG_5V2_VAR sr_exp_data.bit.E_VBUS_2 //Variable storing USBC-2 5V Bus state
#define USBC_CFG_5V2_ENA 1 //Value to enable USBC-1 5V Bus
#define USBC_CFG_5V2_DIS 0 //Value to disable USBC-1 5V Bus
#define USBC_CFG_5V2_UPDATE SR_EXP_WriteData() //Command to run to update value

View File

@@ -1,8 +1,7 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
U_T_AGCR, //USB Toggle Automatic GCR control
U_T_AGCR = SAFE_RANGE, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
@@ -26,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \
_______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
@@ -37,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
*/
@@ -59,11 +58,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
switch (keycode) {
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");
@@ -93,7 +87,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
@@ -128,3 +122,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; //Process all other keycodes normally
}
}
led_instruction_t led_instructions[] = {
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 10, .id1 = 9, .r = 255, .g = 0, .b = 0 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_PATTERN, .id0 = 4, .id1 = 0, .pattern_id = 8 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 8, .id1 = 0, .r = 0, .g = 255, .b = 0 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_PATTERN, .id = 16, .id1 = 0, .pattern_id = 9 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 32, .id1 = 0, .r = 0, .g = 0, .b = 255 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 64, .id1 = 0},
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 262144, .id1 = 0, .layer = 0 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_ROTATE_PATTERN, .id = 16777216, .id1 = 0, .layer = 1 },
{ .end = 1 }
};

View File

@@ -1,24 +1,28 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
L_BRD, //LED Brightness Decrease //Working
L_PTN, //LED Pattern Select Next //Working
L_PTP, //LED Pattern Select Previous //Working
L_PSI, //LED Pattern Speed Increase //Working
L_PSD, //LED Pattern Speed Decrease //Working
L_T_MD, //LED Toggle Mode //Working
L_T_ONF, //LED Toggle On / Off //Broken
L_ON, //LED On //Broken
L_OFF, //LED Off //Broken
L_T_BR, //LED Toggle Breath Effect //Working
L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working
U_T_AGCR, //USB Toggle Automatic GCR control //Working
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 //Working
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
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 and effect
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
DBG_FAC, //DEBUG Factory light testing (All on white)
MD_BOOT //Restart into bootloader after hold timeout
};
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
@@ -30,26 +34,26 @@ 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_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_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_MUTE, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, DBG_FAC, _______, _______, _______, _______, _______, _______, _______ \
),
/*
[X] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
*/
};
@@ -62,12 +66,13 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
};
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
switch (keycode) {
case L_BRI:
@@ -84,6 +89,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
return false;
case L_PTN:
if (record->event.pressed) {
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -115,20 +140,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -143,7 +165,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_PTD:
if (record->event.pressed) {
led_animation_direction = !led_animation_direction;
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
return false;
case U_T_AGCR:
@@ -151,6 +199,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
}
return false;
case DBG_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
@@ -175,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}

View File

@@ -1,8 +1,7 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
U_T_AUTO = SAFE_RANGE, //USB Extra Port Toggle Auto Detect / Always Active
U_T_AGCR, //USB Toggle Automatic GCR control
U_T_AGCR = SAFE_RANGE, //USB Toggle Automatic GCR control
DBG_TOG, //DEBUG Toggle On / Off
DBG_MTRX, //DEBUG Toggle Matrix Prints
DBG_KBD, //DEBUG Toggle Keyboard Prints
@@ -26,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, U_T_AUTO,U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
_______, RGB_SPD, RGB_VAI, RGB_SPI, RGB_HUI, RGB_SAI, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
_______, RGB_RMOD,RGB_VAD, RGB_MOD, RGB_HUD, RGB_SAD, _______, _______, _______, _______, _______, _______, _______, \
_______, RGB_TOG, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
@@ -37,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
*/
@@ -59,11 +58,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
switch (keycode) {
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");
@@ -93,7 +87,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
@@ -128,3 +122,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; //Process all other keycodes normally
}
}
led_instruction_t led_instructions[] = {
{ .end = 1 }
};

View File

@@ -1,24 +1,28 @@
#include QMK_KEYBOARD_H
enum ctrl_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase //Working
L_BRD, //LED Brightness Decrease //Working
L_PTN, //LED Pattern Select Next //Working
L_PTP, //LED Pattern Select Previous //Working
L_PSI, //LED Pattern Speed Increase //Working
L_PSD, //LED Pattern Speed Decrease //Working
L_T_MD, //LED Toggle Mode //Working
L_T_ONF, //LED Toggle On / Off //Broken
L_ON, //LED On //Broken
L_OFF, //LED Off //Broken
L_T_BR, //LED Toggle Breath Effect //Working
L_T_PTD, //LED Toggle Scrolling Pattern Direction //Working
U_T_AGCR, //USB Toggle Automatic GCR control //Working
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 //Working
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
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 and effect
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
DBG_FAC, //DEBUG Factory light testing (All on white)
MD_BOOT //Restart into bootloader after hold timeout
};
#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode
@@ -30,26 +34,26 @@ 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_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_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_MUTE, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, _______, _______, U_T_AGCR,_______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, DBG_FAC, _______, _______, _______, _______, _______, _______, _______ \
),
/*
[X] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
),
*/
};
@@ -62,12 +66,13 @@ void matrix_init_user(void) {
void matrix_scan_user(void) {
};
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
#define MODS_SHIFT (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
switch (keycode) {
case L_BRI:
@@ -84,6 +89,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (led_animation_breathing) gcr_breathe = gcr_desired;
}
return false;
case L_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
return false;
case L_PTN:
if (record->event.pressed) {
if (led_animation_id == led_setups_count - 1) led_animation_id = 0;
@@ -115,20 +140,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_ONF:
if (record->event.pressed) {
led_enabled = !led_enabled;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
led_enabled = 1;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
led_enabled = 0;
I2C3733_Control_Set(led_enabled);
I2C3733_Control_Set(0);
}
return false;
case L_T_BR:
@@ -143,7 +165,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
case L_T_PTD:
if (record->event.pressed) {
led_animation_direction = !led_animation_direction;
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
return false;
case U_T_AGCR:
@@ -151,6 +199,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode");
}
return false;
case DBG_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
return false;
case DBG_TOG:
if (record->event.pressed) {
TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode");
@@ -175,7 +234,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
key_timer = timer_read32();
} else {
if (timer_elapsed32(key_timer) >= 500) {
if (timer_elapsed32(key_timer) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}

View File

@@ -29,7 +29,6 @@ enum ctrl_keycodes {
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
@@ -67,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_VOLU, \
L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, U_T_AUTO,U_T_AGCR,_______, MO(2), _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, U_T_AGCR,_______, MO(2), _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, \
L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, L_T_MD, L_T_ONF, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
@@ -777,11 +776,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
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");

View File

@@ -1,5 +1,5 @@
/*
Copyright 2018 Massdrop Inc.
Copyright 2019 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
@@ -22,6 +22,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "clks.h"
#include <string.h>
#define MCU_PORTS_USED 2 //PA, PB
matrix_row_t mlatest[MATRIX_ROWS];
matrix_row_t mlast[MATRIX_ROWS];
matrix_row_t mdebounced[MATRIX_ROWS];
@@ -30,7 +32,7 @@ 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
uint32_t row_masks[MCU_PORTS_USED]; //Array size must match number of unique MCU ports used for reads (PA, PB, PC, etc)
__attribute__ ((weak))
void matrix_init_kb(void) {
@@ -56,9 +58,9 @@ void matrix_init(void)
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;
memset(row_masks, 0, sizeof(row_masks));
//Inputs
uint8_t row;
for (row = 0; row < MATRIX_ROWS; row++)
{
@@ -69,6 +71,7 @@ void matrix_init(void)
row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask
}
//Outputs
uint8_t col;
for (col = 0; col < MATRIX_COLS; col++)
{
@@ -80,27 +83,29 @@ void matrix_init(void)
}
uint64_t mdebouncing = 0;
bool debouncing = false;
uint8_t matrix_scan(void)
{
uint8_t mchanged;
uint64_t timer;
uint8_t row;
uint8_t col;
uint32_t scans[2]; //PA PB
if (timer_read64() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active
uint32_t scans[MCU_PORTS_USED]; //Array size must match number of unique MCU ports used for reads (PA, PB, PC, etc)
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
//Set output
PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output
wait_us(1); //Delay for output
wait_us(1); //Delay for output
//Read input (add unique ports as needed, PA, PB, PC, etc)
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 PA row pins data
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
//Clear output
PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output
for (row = 0; row < MATRIX_ROWS; row++)
{
@@ -110,25 +115,26 @@ uint8_t matrix_scan(void)
}
}
mchanged = 0; //Default to no matrix change since last
timer = timer_read64();
for (row = 0; row < MATRIX_ROWS; row++)
{
if (mlast[row] != mlatest[row])
mchanged = 1;
if (mlast[row] != mlatest[row]) {
debouncing = true;
mdebouncing = timer + DEBOUNCE;
}
mlast[row] = mlatest[row];
}
if (!mchanged)
if (debouncing && timer >= mdebouncing)
{
for (row = 0; row < MATRIX_ROWS; row++)
for (row = 0; row < MATRIX_ROWS; row++) {
mdebounced[row] = mlatest[row];
}
mdebouncing = 0;
}
else
{
//Begin or extend debounce on change
mdebouncing = timer_read64() + DEBOUNCE;
debouncing = false;
}
matrix_scan_quantum();

View File

@@ -1,6 +1,8 @@
# project specific files
SRC = matrix.c
SRC += config_led.c
SRC += spi.c
SRC += usb.c
#For platform and packs
ARM_ATSAM = SAMD51J18A

View File

@@ -0,0 +1,57 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#include "arm_atsam_protocol.h"
void SR_EXP_Init_kb(void) {
/* 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_EXP_SYNC_ENABLING); }
/* Set default shift register values */
sr_exp_data.reg = 0; //Clear data register
sr_exp_data.bit.HUB_CONNECT = 0; //USB Hub disconnected
sr_exp_data.bit.HUB_RESET_N = 0; //USB Hub in reset state
sr_exp_data.bit.SRC_1 = 1; //Set CON1 CC A5/B5 as Rd 5.1k
sr_exp_data.bit.SRC_2 = 1; //Set CON2 CC A5/B5 as Rd 5.1k
sr_exp_data.bit.S_UP = 0; //Default USB data to CON1
sr_exp_data.bit.E_UP_N = 1; //Disable HOST
sr_exp_data.bit.S_DN1 = 1; //Default EXTRA port to CON2
sr_exp_data.bit.E_DN1_N = 1; //Disable EXTRA
sr_exp_data.bit.E_VBUS_1 = 0; //Disable CON1 5V
sr_exp_data.bit.E_VBUS_2 = 0; //Disable CON2 5V
sr_exp_data.bit.IRST = 1; //LED drivers I2C in reset
sr_exp_data.bit.SDB_N = 0; //LED drivers in shutdown
/* Write shift register data */
SR_EXP_WriteData();
/* Enable shift register output */
SR_EXP_OE_N_ENA;
}

View File

@@ -0,0 +1,83 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#include "arm_atsam_protocol.h"
//Note: rp_best_index not used
void usb_set_host_kb(uint8_t con, uint8_t rp_best_index) {
if (con == 1) {
sr_exp_data.bit.S_UP = 0; //HOST to USBC-1
sr_exp_data.bit.S_DN1 = 1; //EXTRA to USBC-2
g_usb_host_port = USB_HOST_PORT_1; //Save host port
sr_exp_data.bit.E_VBUS_1 = 1; //Enable CON1 5V
SR_EXP_WriteData(); //Update port configuration
} else if (con == 2) {
sr_exp_data.bit.S_DN1 = 0; //HOST to USBC-2
sr_exp_data.bit.S_UP = 1; //EXTRA to USBC-1
g_usb_host_port = USB_HOST_PORT_2; //Save host port
sr_exp_data.bit.E_VBUS_2 = 1; //Enable CON2 5V
SR_EXP_WriteData(); //Update port configuration
}
}
void usb_set_extra_kb(uint8_t con) {
if (con == 1) {
sr_exp_data.bit.SRC_1 = 0; //Set CON1 CC A5/B5 as Rp 56k
sr_exp_data.bit.E_VBUS_1 = 0; //Disable CON1 5V
SR_EXP_WriteData(); //Update port configuration
} else if (con == 2) {
sr_exp_data.bit.SRC_2 = 0; //Set CON2 CC A5/B5 as Rp 56k
sr_exp_data.bit.E_VBUS_2 = 0; //Disable CON2 5V
SR_EXP_WriteData(); //Update port configuration
}
}
void usb_init_host_detection_kb(void) {
//Disable 5V
sr_exp_data.bit.E_VBUS_1 = 0; //Disable CON1 5V
sr_exp_data.bit.E_VBUS_2 = 0; //Disable CON2 5V
//Configure default paths
sr_exp_data.bit.S_UP = 0; //HOST to USBC-1
sr_exp_data.bit.S_DN1 = 1; //EXTRA to USBC-2
//Configure CC lines
sr_exp_data.bit.SRC_1 = 1; //Set CON1 CC A5/B5 as Rd 5.1k
sr_exp_data.bit.SRC_2 = 1; //Set CON2 CC A5/B5 as Rd 5.1k
//Enable ports
sr_exp_data.bit.E_UP_N = 0; //Enable HOST for use
sr_exp_data.bit.E_DN1_N = 0; //Enable EXTRA for use
SR_EXP_WriteData(); //Update port configuration
}
//Return 1 if configuration successful
//Return 0 otherwise
uint8_t usb_attach_port_configure_kb(uint8_t g_usb_host_port, uint16_t usbc_cc_a5_v, uint16_t usbc_cc_b5_v) {
if (USB_HOST_IS_1(g_usb_host_port)) { //If host is port 1
//Set up port 2
usb_set_extra_kb(2);
return 1;
} else if (USB_HOST_IS_2(g_usb_host_port)) { //If host is on port 2
//Set up port 1
usb_set_extra_kb(1);
return 1;
}
return 0;
}

View File

@@ -0,0 +1,132 @@
/*
Copyright 2015 Jun Wako <wakojun@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "config_common.h"
/* USB Device descriptor parameter */
#define VENDOR_ID 0x04D8
#define PRODUCT_ID 0xEE66
#define DEVICE_VER 0x0100
#define MANUFACTURER "Massdrop Inc."
#define PRODUCT "Massdrop x Zslane Mercury Rocketeer Keyboard"
#define SERIAL_NUM "Unavailable"
/* key matrix size */
#define MATRIX_ROWS 5
#define MATRIX_COLS 14
/* 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, PA
#define MATRIX_ROW_PINS 6, 7, 8, 9, 4
/* Port and Pin definition of key column hardware configuration */
#define MATRIX_COL_PORTS PB, PA, PA, PA, PA, PB, PB, PA, PA, PA, PB, PB, PB, PB
#define MATRIX_COL_PINS 3, 0, 1, 2, 3, 30, 31, 5, 6, 7, 10, 11, 12, 13
/* 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_NUM 2
/* 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) */
/* PCB D94 */
#define DEBUG_LED_ENABLE 1
#define DEBUG_LED_PORT PA
#define DEBUG_LED_PIN 27
/* Additional debugging ports */
/* PCB M25 */
#define DEBUG_PORT1_ENABLE 1
#define DEBUG_PORT1_PORT PA
#define DEBUG_PORT1_PIN 20
/* PCB M26 */
#define DEBUG_PORT2_ENABLE 1
#define DEBUG_PORT2_PORT PA
#define DEBUG_PORT2_PIN 21
/* PCB M23 */
#define DEBUG_PORT3_ENABLE 1
#define DEBUG_PORT3_PORT PB
#define DEBUG_PORT3_PIN 17
/* 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 DEBOUNCE 5
// Required BOOT key hold time (in ms) for restarting to bootloader -PS081419
#define BOOTKEY_HOLD_MS 2000
/* 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 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
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_LED_PROCESS_LIMIT 15
#define RGB_MATRIX_LED_FLUSH_LIMIT 10
#define RGB_MATRIX_EXTRA_TOG
#include "config_led.h"

View File

@@ -0,0 +1,118 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//ADC configuration table column indices
#define ADC_PORT 0
#define ADC_PIN 1
#define ADC_MUX 2
#define ADC_INDEX 3
#define ADC_MUXPOS 4
#define ADC_REFSEL 5
#define ADC_SAMPLENUM 6
#define ADC_SAMPLEN 7
//ADC configuration table row indices
#define ADC_5V 0 //5V bus voltage
#define ADC_C1A5 1 //Connector 1 A5 CC voltage
#define ADC_C1B5 2 //Connector 1 B5 CC voltage
#define ADC_C2A5 3 //Connector 2 A5 CC voltage
#define ADC_C2B5 4 //Connector 2 B5 CC voltage
#define ADC_C1I 5 //Connector 1 current
#define ADC_C2I 6 //Connector 2 current
//ADC_PORT: PORT of the PIN on the MCU (Ex: 0 = PA, 1 = PB, ...)
// Set ADC_PORT to ADC_NA if it is not available for use
//ADC_PIN: PIN on the MCU (Ex: 0 = 00, 1 = 01, 12 = 12, ...)
//ADC_MUX: PMUX setting for the MCU PIN (Ex: 0 = A, 1 = B, 2 = C, ...)
//ADC_INDEX: ADC to use (Ex: 0 = ADC0, 1 = ADC1, ...)
//ADC_MUXPOS: MUXPOS setting to read on the ADC (Use macros from Atmel library adc.h ADC_INPUTCTRL_MUXPOS_AIN*_Val)
//ADC_REFSEL: Reference the ADC is to use (Use macros from Atmel library adc.h ADC_REFCTRL_REFSEL_*_Val)
//ADC_SAMPLENUM: Number of samples to average for output (Use macros from Atmel library adc.h ADC_AVGCTRL_SAMPLENUM_*_Val)
//ADC_SAMPLEN: Sampling time for each sample in units of CLK_ADC cycles depending on the ADC clock frequency
// ADC_PORT ADC_MUX
// | ADC_PIN | ADC_INDEX
// | | | | ADC_MUXPOS ADC_REFSEL ADC_SAMPLENUM ADC_SAMPLEN
#define ADC_CONFIG_5V 1, 0, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN12_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 45
#define ADC_CONFIG_C1A5 1, 2, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN14_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 63
#define ADC_CONFIG_C1B5 1, 4, 1, 1, ADC_INPUTCTRL_MUXPOS_AIN6_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 63
#define ADC_CONFIG_C2A5 1, 1, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN13_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 63
#define ADC_CONFIG_C2B5 1, 5, 1, 1, ADC_INPUTCTRL_MUXPOS_AIN7_Val, ADC_REFCTRL_REFSEL_INTREF_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 63
#define ADC_CONFIG_C1I 0, 10, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN10_Val, ADC_REFCTRL_REFSEL_INTVCC1_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 45
#define ADC_CONFIG_C2I 0, 11, 1, 0, ADC_INPUTCTRL_MUXPOS_AIN11_Val, ADC_REFCTRL_REFSEL_INTVCC1_Val, ADC_AVGCTRL_SAMPLENUM_4_Val, 45
//Conversion values dependant upon the circuitry
#define ADC_I_MILLIAMPS_PER_COUNT -0.000980472f
#define ADC_I_MILLIAMPS_OFFSET 1.979711769f
#define ADC_5V_VOLTS_PER_COUNT 0.001904297f
#define ADC_5V_VOLTS_OFFSET 0.0f
#define ADC_5V_NOMINAL 5.0f
#define ADC_5V_NOMINAL_COUNTS (ADC_5V_NOMINAL / ADC_5V_VOLTS_PER_COUNT)
//Conversion macros
#define ADC_CI_C2I(macounts) ((float)macounts * ADC_I_MILLIAMPS_PER_COUNT + ADC_I_MILLIAMPS_OFFSET) //Converts connector current counts to milliamps
#define ADC_CI_I2C(ma) (uint16_t)((((float)ma - ADC_I_MILLIAMPS_OFFSET) / ADC_I_MILLIAMPS_PER_COUNT)) //Converts milliamps to connector current counts
#define ADC_5V_C2V(icounts) ((float)icounts * ADC_5V_VOLTS_PER_COUNT + ADC_5V_VOLTS_OFFSET) //Converts 5V Bus counts to volts
#define ADC_5V_V2C(v) (uint16_t)((((float)v - ADC_5V_VOLTS_OFFSET) / ADC_5V_VOLTS_PER_COUNT)) //Converts 5V Bus volts to counts
#define ADC_CC_5VCOR(v5counts, cc) ((float)v5counts == 0 ? 0 : (uint16_t)(ADC_5V_NOMINAL_COUNTS / (float)v5counts * (float)cc)) //Corrects CC counts to nominal 5V value
//Note: The extra port's onboard/external range is not reliable for onboard/external detection due to varying device implementations,
// so instead the extra port will follow the host port connection of onboard or external. We will still use
// a nominal value for device detection with a wider range though.
#define ADC_USBC_ONBOARD 951 //ADC value indicating the USB-C Connector is on main PCB
#define ADC_USBC_EXTERNAL 881 //ADC value indicating the USB-C Connector is on external PCB
#define ADC_USBC_RANGE ((ADC_USBC_ONBOARD - ADC_USBC_EXTERNAL) / 2) //Range of detection for extra port Rd
#define ADC_USBC_EXTRA_NOMINAL ((ADC_USBC_ONBOARD + ADC_USBC_EXTERNAL) / 2) //Nominal ADC value for detection of connected device
#define ADC_USBC_EXTRA_TOLERANCE (0.20f) //Tolerance for Rd
#define ADC_USBC_EXTRA_ADC_MAX ((float)ADC_USBC_EXTRA_NOMINAL + ((float)ADC_USBC_EXTRA_NOMINAL * ADC_USBC_EXTRA_TOLERANCE)) //Rd ADC max counts
#define ADC_USBC_EXTRA_ADC_MIN ((float)ADC_USBC_EXTRA_NOMINAL - ((float)ADC_USBC_EXTRA_NOMINAL * ADC_USBC_EXTRA_TOLERANCE)) //Rd ADC min counts
#define USBC_IS_SINK(a5, b5) ((a5 > ADC_USBC_EXTRA_ADC_MIN && a5 < ADC_USBC_EXTRA_ADC_MAX) || \
(b5 > ADC_USBC_EXTRA_ADC_MIN && b5 < ADC_USBC_EXTRA_ADC_MAX))
#define ADC_USBC_RP_DELTA_MAX 400 //Amount of noise to tolerate for Rp detection (this can be very generous as long as ranges do not overlap)
#define ADC_USBC_RP_TYPES 3 //56k, 22k, 10k
#define ADC_USBC_CON_TYPES 2 //Onboard, External
#define ADC_USBC_TYPES (ADC_USBC_RP_TYPES * ADC_USBC_CON_TYPES)
//These are the indices for ADC_USBC_RP_NOM
//xxK is a ADC_USBC_RP_TYPES
//ONB is for the onboard USB-C Connector and must have an even index number
//EXT is for the external USB-C Connector and must have an odd index number
#define ADC_USBC_56K_ONB 0
#define ADC_USBC_56K_EXT 1
#define ADC_USBC_22K_ONB 2
#define ADC_USBC_22K_EXT 3
#define ADC_USBC_10K_ONB 4
#define ADC_USBC_10K_EXT 5
#define ADC_USBC_IS_ONB(a) (a % 2 == 0) //Given a ADC_USBC_RP_NOM index, return true if the index refers to an onboard connector
#define ADC_USBC_IS_EXT(a) (a % 2 == 1) //Given a ADC_USBC_RP_NOM index, return true if the index refers to an external connector
//These values are for detecting whether or not the host is connected through the onboard USB or external USB
//The counts are calculated from a nominal 5V bus, then scaled depending on the measured 5V bus
//External connectors are detected through addition of a resistor to slightly drop readings while remaining within USB-C CC tolerances
//Set a value to -1 if it is not supported
//Source Rp 56k-Onb 56k-Ext 22k-Onb 22k-Ext 10k-Onb 10k-Ext
#define ADC_USBC_RP_NOM 999, 852, 2232, 1940, 3955, 3528
extern uint16_t adc_usbc_rp_nominal[ADC_USBC_TYPES];
#define POWER_CHECK_INTERVAL 1 //How often to check power usage for adjustment and safety (ms)
#define V_5V_AVGS 20 //Number of 5V readings to average for algorithms wanting stable readings rather than instantaneous

View File

@@ -0,0 +1,139 @@
#ifdef RGB_MATRIX_ENABLE
#include "rocketeer.h"
#include "led_matrix.h"
#include "rgb_matrix.h"
#include "config_led.h"
led_config_t g_led_config = {
{
{ 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, NO_LED, 40 },
{ 41, NO_LED, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, NO_LED, 52 },
{ 53, 54, 55, NO_LED, NO_LED, NO_LED, 56, NO_LED, NO_LED, NO_LED, 57, 58, 59, 60 }
},
{
{ 8, 56 },
{ 22, 56 },
{ 35, 56 },
{ 49, 56 },
{ 63, 56 },
{ 77, 56 },
{ 91, 56 },
{ 105, 56 },
{ 118, 56 },
{ 132, 56 },
{ 146, 56 },
{ 160, 56 },
{ 174, 56 },
{ 195, 56 },
{ 11, 44 },
{ 28, 44 },
{ 42, 44 },
{ 56, 44 },
{ 70, 44 },
{ 84, 44 },
{ 98, 44 },
{ 112, 44 },
{ 125, 44 },
{ 139, 44 },
{ 153, 44 },
{ 167, 44 },
{ 181, 44 },
{ 198, 44 },
{ 13, 32 },
{ 32, 32 },
{ 46, 32 },
{ 60, 32 },
{ 73, 32 },
{ 87, 32 },
{ 101, 32 },
{ 115, 32 },
{ 129, 32 },
{ 143, 32 },
{ 156, 32 },
{ 170, 32 },
// ___
{ 193, 32 },
{ 16, 19 },
{ 39, 19 },
{ 53, 19 },
{ 67, 19 },
{ 80, 19 },
{ 94, 19 },
{ 108, 19 },
{ 122, 19 },
{ 136, 19 },
{ 150, 19 },
{ 163, 19 },
// ___
{ 182, 19 },
{ 9, 7 },
{ 27, 7 },
{ 44, 7 },
// ___
// ___
// ___
{ 96, 7 },
// ___
// ___
// ___
{ 148, 7 },
{ 165, 7 },
{ 188, 7 },
{ 201, 7 },
// Underglow
{ 15, 49 },
{ 35, 49 },
{ 53, 49 },
{ 70, 49 },
{ 88, 49 },
{ 106, 49 },
{ 124, 49 },
{ 142, 49 },
{ 161, 49 },
{ 179, 49 },
{ 197, 49 },
{ 15, 12 },
{ 35, 12 },
{ 53, 12 },
{ 70, 12 },
{ 88, 12 },
{ 106, 12 },
{ 124, 12 },
{ 142, 12 },
{ 161, 12 },
{ 176, 12 },
{ 194, 12 },
{ 15, 37 },
{ 15, 25 },
{ 197, 37 },
{ 197, 25 }
},
{
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
1, 1, 1, 4, 1, 1, 1, 1,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2
}
};
#ifdef USB_LED_INDICATOR_ENABLE
void rgb_matrix_indicators_kb(void)
{
led_matrix_indicators();
}
#endif // USB_LED_INDICATOR_ENABLE
#endif

View File

@@ -0,0 +1,160 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//Define number of IS31FL3733 drivers being used (1...16)
#define ISSI3733_DRIVER_COUNT 2
#define DRIVER_LED_TOTAL ISSI3733_LED_COUNT
//Hardware address of each driver (Refer to IS31FL3733 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 87
#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
#ifdef USE_MASSDROP_CONFIGURATOR
#define ANIMATION_SPEED_STEP 1
#define BREATHE_STEP 1
#define BREATHE_MIN_STEP 0
#define BREATHE_MAX_STEP 255
#endif
//Default Global Current Register value (Default brightness 0 - 255)
#define ISSI3733_GCR_DEFAULT LED_GCR_MAX
//Automatic power rollback and recovery
#define V5_HIGH 2494 //5V high level (After low power detect, point at which LEDs are allowed to use more power )
#define V5_LOW 2434 //5V low level (LED power rolled back to stay above this limit)
#define V5_CAT 2206 //5V catastrophic level (Host USB port potential to shut down)
//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 matrix scancode (set 255 if none or 254 for LED to turn off in alternating mode)
//Note: Origin 0,0 may be located anywhere as the software will do the final layout
#define ISSI3733_LED_MAP { \
{ .id = 1, .x = 0.36, .y = 3.362, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \
{ .id = 2, .x = 1.11, .y = 3.362, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 1 }, \
{ .id = 3, .x = 1.86, .y = 3.362, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \
{ .id = 4, .x = 2.61, .y = 3.362, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 3 }, \
{ .id = 5, .x = 3.36, .y = 3.362, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 4 }, \
{ .id = 6, .x = 4.11, .y = 3.362, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \
{ .id = 7, .x = 4.86, .y = 3.362, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 6 }, \
{ .id = 8, .x = 5.61, .y = 3.362, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 7 }, \
{ .id = 9, .x = 6.36, .y = 3.362, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 8 }, \
{ .id = 10, .x = 7.11, .y = 3.362, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 9 }, \
{ .id = 11, .x = 7.86, .y = 3.362, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 10 }, \
{ .id = 12, .x = 8.61, .y = 3.362, .adr = { .drv = 1, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 11 }, \
{ .id = 13, .x = 9.36, .y = 3.362, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 12 }, \
{ .id = 14, .x = 10.485, .y = 3.362, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 13 }, \
{ .id = 15, .x = 0.548, .y = 2.612, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 14 }, \
{ .id = 16, .x = 1.485, .y = 2.612, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 15 }, \
{ .id = 17, .x = 2.235, .y = 2.612, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \
{ .id = 18, .x = 2.985, .y = 2.612, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 17 }, \
{ .id = 19, .x = 3.735, .y = 2.612, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 18 }, \
{ .id = 20, .x = 4.485, .y = 2.612, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 19 }, \
{ .id = 21, .x = 5.235, .y = 2.612, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 20 }, \
{ .id = 22, .x = 5.985, .y = 2.612, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \
{ .id = 23, .x = 6.735, .y = 2.612, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \
{ .id = 24, .x = 7.485, .y = 2.612, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 23 }, \
{ .id = 25, .x = 8.235, .y = 2.612, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 24 }, \
{ .id = 26, .x = 8.985, .y = 2.612, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 25 }, \
{ .id = 27, .x = 9.735, .y = 2.612, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 26 }, \
{ .id = 28, .x = 10.673, .y = 2.612, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 27 }, \
{ .id = 29, .x = 0.641, .y = 1.862, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 28 }, \
{ .id = 30, .x = 1.673, .y = 1.862, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 29 }, \
{ .id = 31, .x = 2.423, .y = 1.862, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 30 }, \
{ .id = 32, .x = 3.173, .y = 1.862, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 31 }, \
{ .id = 33, .x = 3.923, .y = 1.862, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 32 }, \
{ .id = 34, .x = 4.673, .y = 1.862, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 33 }, \
{ .id = 35, .x = 5.423, .y = 1.862, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \
{ .id = 36, .x = 6.173, .y = 1.862, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \
{ .id = 37, .x = 6.923, .y = 1.862, .adr = { .drv = 1, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \
{ .id = 38, .x = 7.673, .y = 1.862, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \
{ .id = 39, .x = 8.423, .y = 1.862, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 38 }, \
{ .id = 40, .x = 9.173, .y = 1.862, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 39 }, \
{ .id = 41, .x = 10.391, .y = 1.862, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 41 }, \
{ .id = 42, .x = 0.829, .y = 1.112, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 42 }, \
{ .id = 43, .x = 2.048, .y = 1.112, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 44 }, \
{ .id = 44, .x = 2.798, .y = 1.112, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 45 }, \
{ .id = 45, .x = 3.548, .y = 1.112, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 46 }, \
{ .id = 46, .x = 4.298, .y = 1.112, .adr = { .drv = 2, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 47 }, \
{ .id = 47, .x = 5.048, .y = 1.112, .adr = { .drv = 2, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 48 }, \
{ .id = 48, .x = 5.798, .y = 1.112, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \
{ .id = 49, .x = 6.548, .y = 1.112, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 50 }, \
{ .id = 50, .x = 7.298, .y = 1.112, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 51 }, \
{ .id = 51, .x = 8.048, .y = 1.112, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \
{ .id = 52, .x = 8.798, .y = 1.112, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 53 }, \
{ .id = 53, .x = 10.204, .y = 1.112, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 55 }, \
{ .id = 54, .x = 0.454, .y = 0.362, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 56 }, \
{ .id = 55, .x = 1.391, .y = 0.362, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 57 }, \
{ .id = 56, .x = 2.329, .y = 0.362, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 58 }, \
{ .id = 57, .x = 5.141, .y = 0.362, .adr = { .drv = 2, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 62 }, \
{ .id = 58, .x = 7.954, .y = 0.362, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 66 }, \
{ .id = 59, .x = 8.891, .y = 0.362, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 67 }, \
{ .id = 60, .x = 9.829, .y = 0.362, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 68 }, \
{ .id = 61, .x = 10.766, .y = 0.362, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 69 }, \
{ .id = 62, .x = 0.74, .y = 3, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 63, .x = 1.714, .y = 3, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .id = 64, .x = 2.688, .y = 3, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 65, .x = 3.662, .y = 3, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .id = 66, .x = 4.636, .y = 3, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \
{ .id = 67, .x = 5.61, .y = 3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .id = 68, .x = 6.584, .y = 3, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 69, .x = 7.558, .y = 3, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .id = 70, .x = 8.532, .y = 3, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 71, .x = 9.506, .y = 3, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .id = 72, .x = 10.48, .y = 3, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 73, .x = 0.74, .y = 0.74, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 74, .x = 1.714, .y = 0.74, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .id = 75, .x = 2.688, .y = 0.74, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 76, .x = 3.662, .y = 0.74, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .id = 77, .x = 4.636, .y = 0.74, .adr = { .drv = 2, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 78, .x = 5.61, .y = 0.74, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 254 }, \
{ .id = 79, .x = 6.584, .y = 0.74, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 80, .x = 7.558, .y = 0.74, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 254 }, \
{ .id = 81, .x = 8.532, .y = 0.74, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 82, .x = 9.506, .y = 0.74, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .id = 83, .x = 10.48, .y = 0.74, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \
{ .id = 84, .x = 0.74, .y = 2.25, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
{ .id = 85, .x = 0.74, .y = 1.5, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
{ .id = 86, .x = 10.48, .y = 2.25, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 254 }, \
{ .id = 87, .x = 10.48, .y = 1.5, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 254 }, \
};
#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 28
#define USB_LED_SCROLL_LOCK_SCANCODE 21
#define USB_LED_COMPOSE_SCANCODE 255
#define USB_LED_KANA_SCANCODE 255
#endif //USB_LED_INDICATOR_ENABLE

View File

@@ -0,0 +1,42 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
/* 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 */
uint16_t SRC_2_B5:1; /*!< bit: 1 USBC-2 CC B5 UFP Rd 5.1k WHEN 1, DFP Rp 56k WHEN 0 */
uint16_t SRC_1_B5:1; /*!< bit: 2 USBC-1 CC B5 UFP Rd 5.1k WHEN 1, DFP Rp 56k WHEN 0 */
uint16_t S_B_EXT:1; /*!< bit: 3 B TO EX-1 WHEN 0, B TO USBC-1 WHEN 1 */
uint16_t SDB_N:1; /*!< bit: 4 SHUTDOWN IS31FL3733 CHIPS WHEN 0, RUN WHEN 1 */
uint16_t IRST:1; /*!< bit: 5 RESET IS31FL3733 I2C WHEN 1, RUN WHEN 0 */
uint16_t SRC_2_A5:1; /*!< bit: 6 USBC-2 CC A5 UFP Rd 5.1k WHEN 1, DFP Rp 56k WHEN 0 */
uint16_t SRC_1_A5:1; /*!< bit: 7 USBC-1 CC A5 UFP Rd 5.1k WHEN 1, DFP Rp 56k WHEN 0 */
uint16_t E_VBUS_2:1; /*!< bit: 8 ENABLE 5V TO USBC-2/EX-2 WHEN 1, DISABLE WHEN 0 */
uint16_t E_VBUS_1:1; /*!< bit: 9 ENABLE 5V TO USBC-1/EX-1 WHEN 1, DISABLE WHEN 0 */
uint16_t ENB:1; /*!< bit: 10 ENABLE CHANNEL B USBC-1/EX-1 WHEN 1, DISABLE WHEN 0 */
uint16_t S_A_EXT:1; /*!< bit: 11 A TO USBC-2 WHEN 0, A TO EX-2 WHEN 1 */
uint16_t ENA:1; /*!< bit: 12 ENABLE CHANNEL A USBC-2/EX-2 WHEN 1, DISABLE WHEN 0 */
uint16_t S_A_UP:1; /*!< bit: 13 DN1 TO A & UP TO B WHEN 1, DN1 TO B & UP TO A WHEN 0 */
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 */
} sr_exp_t;

View File

@@ -0,0 +1,28 @@
/*
Copyright 2019 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 <http://www.gnu.org/licenses/>.
*/
#pragma once
//Macros to Enable, Disable, and Update USB 5V bus connections
#define USBC_CFG_5V1_VAR sr_exp_data.bit.E_VBUS_1 //Variable storing USBC-1 5V Bus state
#define USBC_CFG_5V1_ENA 1 //Value to enable USBC-1 5V Bus
#define USBC_CFG_5V1_DIS 0 //Value to disable USBC-1 5V Bus
#define USBC_CFG_5V1_UPDATE SR_EXP_WriteData() //Command to run to update value
#define USBC_CFG_5V2_VAR sr_exp_data.bit.E_VBUS_2 //Variable storing USBC-2 5V Bus state
#define USBC_CFG_5V2_ENA 1 //Value to enable USBC-1 5V Bus
#define USBC_CFG_5V2_DIS 0 //Value to disable USBC-1 5V Bus
#define USBC_CFG_5V2_UPDATE SR_EXP_WriteData() //Command to run to update value

View File

@@ -0,0 +1,286 @@
#include QMK_KEYBOARD_H
enum rocketeer_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
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 and effect
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
DBG_FAC, //DEBUG Factory light testing (All on white)
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_TAB, KC_Q, 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_RGUI, KC_RCTL \
),
[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, \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_UP, _______, _______, U_T_AGCR,\
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, KC_INS, KC_HOME, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, KC_END, KC_PGDN, KC_VOLD, KC_VOLU, _______, \
_______, _______, _______, DBG_FAC, KC_MUTE, _______, KC_APP, _______ \
),
/*
[X] = LAYOUT(
_______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______ \
),
*/
};
// 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 (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
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_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
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) {
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(0);
}
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) {
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
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_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
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) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
return false;
default:
return true; //Process all other keycodes normally
}
}
void rgb_matrix_init_user(void) {
led_lighting_mode = LED_MODE_INDICATORS_ONLY; //Start Rocketeer with only indicator lights
}
led_instruction_t led_instructions[] = {
//LEDs are normally inactive, no processing is performed on them
//Flags are used in matching criteria for an LED to be active and indicate how to color it
//Flags can be found in tmk_core/protocol/arm_atsam/led_matrix.h (prefixed with LED_FLAG_)
//LED IDs can be found in config_led.h in the keyboard's directory
//Examples are below
//All LEDs use the user's selected pattern (this is the factory default)
{ .flags = LED_FLAG_USE_ROTATE_PATTERN },
//Specific LEDs use the user's selected pattern while all others are off
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN, .id0 = 0xFFFFFFFF, .id1 = 0xAAAAAAAA, .id2 = 0x55555555, .id3 = 0x11111111 },
//Specific LEDs use specified RGB values while all others are off
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFF, .id1 = 0x00FF, .id2 = 0x0000FF00, .id3 = 0xFF000000, .r = 75, .g = 150, .b = 225 },
//All LEDs use the user's selected pattern
//On layer 1, all key LEDs (except the top row which keeps active pattern) are red while all edge LEDs are green
//When layer 1 is active, key LEDs use red (id0 32 - 17: 1111 1111 1111 1111 0000 0000 0000 0000 = 0xFFFF0000) (except top row 16 - 1)
//When layer 1 is active, key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//When layer 1 is active, key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF)
//When layer 1 is active, edge LEDs use green (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000)
//When layer 1 is active, edge LEDs use green (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF)
// { .flags = LED_FLAG_USE_ROTATE_PATTERN },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id0 = 0xFFFF0000, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255, .layer = 1 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_MATCH_LAYER | LED_FLAG_USE_RGB, .id2 = 0xFF800000, .id3 = 0x00FFFFFF, .g = 127, .layer = 1 },
//All key LEDs use red while edge LEDs use the active pattern
//All key LEDs use red (id0 32 - 1: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//All key LEDs use red (id1 64 - 33: 1111 1111 1111 1111 1111 1111 1111 1111 = 0xFFFFFFFF)
//All key LEDs use red (id2 87 - 65: 0000 0000 0111 1111 1111 1111 1111 1111 = 0x007FFFFF)
//Edge uses active pattern (id2 95 - 88: 1111 1111 1000 0000 0000 0000 0000 0000 = 0xFF800000)
//Edge uses active pattern (id3 119 - 96: 0000 0000 1111 1111 1111 1111 1111 1111 = 0x00FFFFFF)
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_RGB, .id0 = 0xFFFFFFFF, .id1 = 0xFFFFFFFF, .id2 = 0x007FFFFF, .r = 255 },
// { .flags = LED_FLAG_MATCH_ID | LED_FLAG_USE_ROTATE_PATTERN , .id2 = 0xFF800000, .id3 = 0x00FFFFFF },
//end must be set to 1 to indicate end of instruction set
{ .end = 1 }
};

View File

@@ -0,0 +1,2 @@
# This keymap requires Massdrop Configurator support
OPT_DEFS += -DUSE_MASSDROP_CONFIGURATOR

View File

@@ -0,0 +1,256 @@
#include QMK_KEYBOARD_H
enum rocketeer_keycodes {
L_BRI = SAFE_RANGE, //LED Brightness Increase
L_BRD, //LED Brightness Decrease
L_EDG_I, //LED Edge Brightness Increase
L_EDG_D, //LED Edge Brightness Decrease
L_EDG_M, //LED Edge lighting mode
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 and effect
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
DBG_FAC, //DEBUG Factory light testing (All on white)
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_TAB, KC_Q, 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_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL \
),
[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, \
L_T_BR, L_PSD, L_BRI, L_PSI, L_EDG_I, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_UP, _______, _______, U_T_AGCR,\
L_T_PTD, L_PTP, L_BRD, L_PTN, L_EDG_D, _______, KC_INS, KC_HOME, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, \
_______, L_T_MD, L_T_ONF, _______, L_EDG_M, MD_BOOT, TG_NKRO, KC_END, KC_PGDN, KC_VOLD, KC_VOLU, _______, \
_______, _______, _______, DBG_FAC, KC_MUTE, _______, _______, _______ \
),
/*
[X] = LAYOUT(
_______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______ \
),
*/
};
// 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 (get_mods() & MOD_BIT(KC_LSHIFT) || get_mods() & MOD_BIT(KC_RSHIFT))
#define MODS_CTRL (get_mods() & MOD_BIT(KC_LCTL) || get_mods() & MOD_BIT(KC_RCTRL))
#define MODS_ALT (get_mods() & MOD_BIT(KC_LALT) || get_mods() & MOD_BIT(KC_RALT))
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
static uint32_t key_timer;
static uint8_t scroll_effect = 0;
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_EDG_M:
if (record->event.pressed) {
led_edge_mode++;
if (led_edge_mode > LED_EDGE_MODE_MAX) {
led_edge_mode = LED_EDGE_MODE_ALL;
}
}
return false;
case L_EDG_I:
if (record->event.pressed) {
led_edge_brightness += 0.1;
if (led_edge_brightness > 1) { led_edge_brightness = 1; }
}
return false;
case L_EDG_D:
if (record->event.pressed) {
led_edge_brightness -= 0.1;
if (led_edge_brightness < 0) { led_edge_brightness = 0; }
}
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) {
I2C3733_Control_Set(!I2C3733_Control_Get());
}
return false;
case L_ON:
if (record->event.pressed) {
I2C3733_Control_Set(1);
}
return false;
case L_OFF:
if (record->event.pressed) {
I2C3733_Control_Set(0);
}
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) {
scroll_effect++;
if (scroll_effect == 1) { //Patterns with scroll move horizontal (Right to left)
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 0;
} else if (scroll_effect == 2) { //Patterns with scroll move vertical (Top to bottom)
led_animation_direction = 1;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 3) { //Patterns with scroll move vertical (Bottom to top)
led_animation_direction = 0;
led_animation_orientation = 1;
led_animation_circular = 0;
} else if (scroll_effect == 4) { //Patterns with scroll explode from center
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 1;
} else if (scroll_effect == 5) { //Patterns with scroll implode on center
led_animation_direction = 1;
led_animation_orientation = 0;
led_animation_circular = 1;
} else { //Patterns with scroll move horizontal (Left to right)
scroll_effect = 0;
led_animation_direction = 0;
led_animation_orientation = 0;
led_animation_circular = 0;
}
}
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_FAC:
if (record->event.pressed && MODS_SHIFT && MODS_CTRL) {
led_lighting_mode = LED_MODE_NORMAL;
led_edge_brightness = 1;
led_edge_mode = LED_EDGE_MODE_ALL;
led_animation_breathing = 0;
led_animation_id = 7; //led_programs.c led_setups leds_white index
gcr_desired = LED_GCR_MAX;
I2C3733_Control_Set(1);
}
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) >= BOOTKEY_HOLD_MS) {
reset_keyboard();
}
}
return false;
default:
return true; //Process all other keycodes normally
}
}
void rgb_matrix_init_user(void) {
led_lighting_mode = LED_MODE_INDICATORS_ONLY; //Start Rocketeer with only indicator lights
}
led_instruction_t led_instructions[] = {
//Please see ../default_md/keymap.c for examples
//All LEDs use the user's selected pattern (this is the factory default)
{ .flags = LED_FLAG_USE_ROTATE_PATTERN },
//end must be set to 1 to indicate end of instruction set
{ .end = 1 }
};

Some files were not shown because too many files have changed in this diff Show More