Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ebafcee8 | ||
|
|
595f3cbe5b | ||
|
|
f1513c3ad2 | ||
|
|
bd874b9577 | ||
|
|
9fc7bb1f6a | ||
|
|
573e1c09e7 | ||
|
|
4deb5de438 | ||
|
|
b6c5c4cf52 | ||
|
|
e0d467dbab | ||
|
|
449736c06d | ||
|
|
07e0558e9a | ||
|
|
f2bf5a9a74 | ||
|
|
7a8c139d07 | ||
|
|
49892272a0 | ||
|
|
723d338c62 | ||
|
|
0fa192091c | ||
|
|
4b5dcda126 | ||
|
|
c531dfb6a7 | ||
|
|
4ac48a61a6 | ||
|
|
4df6b7ba19 | ||
|
|
56ed2d495d | ||
|
|
c14e297ad5 | ||
|
|
9ce35e823b | ||
|
|
1225120b92 | ||
|
|
f2bc70a264 | ||
|
|
4e41812a67 | ||
|
|
7e8d4be8ac | ||
|
|
b5d9bee969 | ||
|
|
1775a3075e | ||
|
|
095b28e006 | ||
|
|
8a27703ef4 | ||
|
|
006abbfd6f | ||
|
|
95e7e10061 | ||
|
|
87dc2efda8 | ||
|
|
ed99581161 | ||
|
|
83d33caf63 | ||
|
|
6834febece | ||
|
|
8def9bc642 | ||
|
|
3fc5a05d66 | ||
|
|
1147fc24ad | ||
|
|
d4056a11d3 | ||
|
|
1572375bfb | ||
|
|
0284431ad9 | ||
|
|
8e86e22187 | ||
|
|
9c4b9bbccc | ||
|
|
0537a59920 | ||
|
|
d21b287e7d | ||
|
|
c50e80e13b | ||
|
|
738a9fc16c | ||
|
|
b89cec9ebc | ||
|
|
38299ff2ef | ||
|
|
61c53ad75e | ||
|
|
9234f9c964 | ||
|
|
2869d51ba8 | ||
|
|
bc7fe1223d | ||
|
|
f804bd3d2d | ||
|
|
72fd49b146 | ||
|
|
7e9a7af672 | ||
|
|
11773a5546 | ||
|
|
b2175e1849 | ||
|
|
ffc2ae057b | ||
|
|
a012113d63 | ||
|
|
c691396ae5 | ||
|
|
860f6d65b8 | ||
|
|
85d2d4fee5 | ||
|
|
a57c9648e9 | ||
|
|
e9755521ab | ||
|
|
bbecd276d2 | ||
|
|
4d4b845cf5 | ||
|
|
0fab3bbde3 | ||
|
|
b2877470ce | ||
|
|
e0c9cfad86 | ||
|
|
5a34ec7565 | ||
|
|
237da3ac8d |
No files matched your search
@@ -67,7 +67,7 @@ $(eval $(call NEXT_PATH_ELEMENT))
|
|||||||
# It's really a very simple if else chain, if you squint enough,
|
# It's really a very simple if else chain, if you squint enough,
|
||||||
# but the makefile syntax makes it very verbose.
|
# but the makefile syntax makes it very verbose.
|
||||||
# If we are in a subfolder of keyboards
|
# If we are in a subfolder of keyboards
|
||||||
#
|
#
|
||||||
# *** No longer needed **
|
# *** No longer needed **
|
||||||
#
|
#
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
|
# ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
|
||||||
@@ -307,11 +307,6 @@ define PARSE_KEYBOARD
|
|||||||
KEYBOARD_FOLDER_PATH_3 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_2)))
|
KEYBOARD_FOLDER_PATH_3 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_2)))
|
||||||
KEYBOARD_FOLDER_PATH_4 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_3)))
|
KEYBOARD_FOLDER_PATH_4 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_3)))
|
||||||
KEYBOARD_FOLDER_PATH_5 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_4)))
|
KEYBOARD_FOLDER_PATH_5 := $$(patsubst %/,%,$$(dir $$(KEYBOARD_FOLDER_PATH_4)))
|
||||||
KEYBOARD_FOLDER_1 := $$(notdir $$(KEYBOARD_FOLDER_PATH_1))
|
|
||||||
KEYBOARD_FOLDER_2 := $$(notdir $$(KEYBOARD_FOLDER_PATH_2))
|
|
||||||
KEYBOARD_FOLDER_3 := $$(notdir $$(KEYBOARD_FOLDER_PATH_3))
|
|
||||||
KEYBOARD_FOLDER_4 := $$(notdir $$(KEYBOARD_FOLDER_PATH_4))
|
|
||||||
KEYBOARD_FOLDER_5 := $$(notdir $$(KEYBOARD_FOLDER_PATH_5))
|
|
||||||
|
|
||||||
KEYMAPS :=
|
KEYMAPS :=
|
||||||
# get a list of all keymaps
|
# get a list of all keymaps
|
||||||
@@ -325,35 +320,35 @@ define PARSE_KEYBOARD
|
|||||||
$$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS)))
|
$$(KEYBOARD_FOLDER_3) $$(KEYBOARD_FOLDER_4) $$(KEYBOARD_FOLDER_5), $$(KEYMAPS)))
|
||||||
|
|
||||||
KEYBOARD_LAYOUTS :=
|
KEYBOARD_LAYOUTS :=
|
||||||
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_5)/rules.mk)","")
|
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)","")
|
||||||
LAYOUTS :=
|
LAYOUTS :=
|
||||||
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_5)/rules.mk)
|
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_5)/rules.mk)
|
||||||
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
||||||
endif
|
endif
|
||||||
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_4)/rules.mk)","")
|
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)","")
|
||||||
LAYOUTS :=
|
LAYOUTS :=
|
||||||
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_4)/rules.mk)
|
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_4)/rules.mk)
|
||||||
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
||||||
endif
|
endif
|
||||||
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_3)/rules.mk)","")
|
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)","")
|
||||||
LAYOUTS :=
|
LAYOUTS :=
|
||||||
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_3)/rules.mk)
|
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_3)/rules.mk)
|
||||||
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
||||||
endif
|
endif
|
||||||
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_2)/rules.mk)","")
|
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)","")
|
||||||
LAYOUTS :=
|
LAYOUTS :=
|
||||||
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_2)/rules.mk)
|
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_2)/rules.mk)
|
||||||
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
||||||
endif
|
endif
|
||||||
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_1)/rules.mk)","")
|
ifneq ("$$(wildcard $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)","")
|
||||||
LAYOUTS :=
|
LAYOUTS :=
|
||||||
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_1)/rules.mk)
|
$$(eval include $(ROOT_DIR)/keyboards/$$(KEYBOARD_FOLDER_PATH_1)/rules.mk)
|
||||||
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
KEYBOARD_LAYOUTS := $$(sort $$(LAYOUTS) $$(KEYBOARD_LAYOUTS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
LAYOUT_KEYMAPS :=
|
LAYOUT_KEYMAPS :=
|
||||||
$$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.)))))
|
$$(foreach LAYOUT,$$(KEYBOARD_LAYOUTS),$$(eval LAYOUT_KEYMAPS += $$(notdir $$(patsubst %/.,%,$$(wildcard $(ROOT_DIR)/layouts/*/$$(LAYOUT)/*/.)))))
|
||||||
|
|
||||||
KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS))
|
KEYMAPS := $$(sort $$(KEYMAPS) $$(LAYOUT_KEYMAPS))
|
||||||
|
|
||||||
# if the rule after removing the start of it is empty (we haven't specified a kemap or target)
|
# if the rule after removing the start of it is empty (we haven't specified a kemap or target)
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
|
|||||||
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
||||||
COMMON_VPATH += $(QUANTUM_PATH)/api
|
COMMON_VPATH += $(QUANTUM_PATH)/api
|
||||||
|
COMMON_VPATH += $(QUANTUM_PATH)/split_common
|
||||||
COMMON_VPATH += $(DRIVER_PATH)
|
COMMON_VPATH += $(DRIVER_PATH)
|
||||||
+13
-1
@@ -210,5 +210,17 @@ QUANTUM_SRC:= \
|
|||||||
$(QUANTUM_DIR)/process_keycode/process_leader.c
|
$(QUANTUM_DIR)/process_keycode/process_leader.c
|
||||||
|
|
||||||
ifndef CUSTOM_MATRIX
|
ifndef CUSTOM_MATRIX
|
||||||
QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
|
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
|
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
|
||||||
|
else
|
||||||
|
QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
|
OPT_DEFS += -DSPLIT_KEYBOARD
|
||||||
|
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \
|
||||||
|
$(QUANTUM_DIR)/split_common/split_util.c \
|
||||||
|
$(QUANTUM_DIR)/split_common/i2c.c \
|
||||||
|
$(QUANTUM_DIR)/split_common/serial.c
|
||||||
endif
|
endif
|
||||||
+6
-2
@@ -55,18 +55,22 @@
|
|||||||
* [Userspace](feature_userspace.md)
|
* [Userspace](feature_userspace.md)
|
||||||
|
|
||||||
* [Keycodes](keycodes.md)
|
* [Keycodes](keycodes.md)
|
||||||
* [Backlight](feature_backlight.md#backlight-keycodes)
|
|
||||||
* [Basic](keycodes_basic.md)
|
* [Basic](keycodes_basic.md)
|
||||||
|
* [Quantum](quantum_keycodes.md)
|
||||||
|
* [Audio](feature_audio.md#audio-keycodes)
|
||||||
|
* [Backlight](feature_backlight.md#backlight-keycodes)
|
||||||
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
||||||
* [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
|
* [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
|
||||||
* [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
* [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
||||||
* [Mod+Key](feature_advanced_keycodes.md#modifier-keys)
|
* [Mod+Key](feature_advanced_keycodes.md#modifier-keys)
|
||||||
* [Mod Tap](feature_advanced_keycodes.md#mod-tap)
|
* [Mod Tap](feature_advanced_keycodes.md#mod-tap)
|
||||||
|
* [Mouse Keys](feature_mouse_keys.md#mapping-mouse-actions-to-keyboard-keys)
|
||||||
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys)
|
||||||
* [Quantum](quantum_keycodes.md)
|
|
||||||
* [RGB Light](feature_rgblight.md#rgblight-keycodes)
|
* [RGB Light](feature_rgblight.md#rgblight-keycodes)
|
||||||
|
* [RGB Matrix](feature_rgb_matrix.md#keycodes)
|
||||||
* [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes)
|
* [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes)
|
||||||
* [Stenography](feature_stenography.md#keycode-reference)
|
* [Stenography](feature_stenography.md#keycode-reference)
|
||||||
|
* [Swap Hands](feature_swap_hands.md#swap-keycodes)
|
||||||
* [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes)
|
* [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes)
|
||||||
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -43,7 +43,9 @@
|
|||||||
* [Pointing Device](feature_pointing_device.md)
|
* [Pointing Device](feature_pointing_device.md)
|
||||||
* [PS/2 Mouse](feature_ps2_mouse.md)
|
* [PS/2 Mouse](feature_ps2_mouse.md)
|
||||||
* [RGB Lighting](feature_rgblight.md)
|
* [RGB Lighting](feature_rgblight.md)
|
||||||
* [Space Cadet](feature_space_cadet.md)
|
* [RGB Matrix](feature_rgb_matrix.md)
|
||||||
|
* [Space Cadet Shift](feature_space_cadet.md)
|
||||||
|
* [Space Cadet Shift Enter](feature_space_shift_cadet.md)
|
||||||
* [Stenography](feature_stenography.md)
|
* [Stenography](feature_stenography.md)
|
||||||
* [Swap Hands](feature_swap_hands.md)
|
* [Swap Hands](feature_swap_hands.md)
|
||||||
* [Tap Dance](feature_tap_dance.md)
|
* [Tap Dance](feature_tap_dance.md)
|
||||||
@@ -57,8 +59,8 @@
|
|||||||
* [Quantum](quantum_keycodes.md)
|
* [Quantum](quantum_keycodes.md)
|
||||||
* [Audio](feature_audio.md#audio-keycodes)
|
* [Audio](feature_audio.md#audio-keycodes)
|
||||||
* [Backlight](feature_backlight.md#backlight-keycodes)
|
* [Backlight](feature_backlight.md#backlight-keycodes)
|
||||||
* [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
|
|
||||||
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
* [Bluetooth](feature_bluetooth.md#bluetooth-keycodes)
|
||||||
|
* [Bootmagic](feature_bootmagic.md#bootmagic-keycodes)
|
||||||
* [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
* [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
||||||
* [Mod+Key](feature_advanced_keycodes.md#modifier-keys)
|
* [Mod+Key](feature_advanced_keycodes.md#modifier-keys)
|
||||||
* [Mod Tap](feature_advanced_keycodes.md#mod-tap)
|
* [Mod Tap](feature_advanced_keycodes.md#mod-tap)
|
||||||
|
|||||||
@@ -91,6 +91,8 @@ This is a C header file that is one of the first things included, and will persi
|
|||||||
* key combination that allows the use of magic commands (useful for debugging)
|
* key combination that allows the use of magic commands (useful for debugging)
|
||||||
* `#define USB_MAX_POWER_CONSUMPTION`
|
* `#define USB_MAX_POWER_CONSUMPTION`
|
||||||
* sets the maximum power (in mA) over USB for the device (default: 500)
|
* sets the maximum power (in mA) over USB for the device (default: 500)
|
||||||
|
* `#define SCL_CLOCK 100000L`
|
||||||
|
* sets the SCL_CLOCK speed for split keyboards. The default is `100000L` but some boards can be set to `400000L`.
|
||||||
|
|
||||||
## Features That Can Be Disabled
|
## Features That Can Be Disabled
|
||||||
|
|
||||||
@@ -179,6 +181,16 @@ If you define these options you will enable the associated feature, which may in
|
|||||||
* `#define MOUSEKEY_MAX_SPEED 7`
|
* `#define MOUSEKEY_MAX_SPEED 7`
|
||||||
* `#define MOUSEKEY_WHEEL_DELAY 0`
|
* `#define MOUSEKEY_WHEEL_DELAY 0`
|
||||||
|
|
||||||
|
## Split Keyboard Options
|
||||||
|
|
||||||
|
Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk
|
||||||
|
|
||||||
|
* `#define SPLIT_HAND_PIN B7`
|
||||||
|
* For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses.
|
||||||
|
|
||||||
|
* `#define USE_I2C`
|
||||||
|
* For using I2C instead of Serial (defaults to serial)
|
||||||
|
|
||||||
# The `rules.mk` File
|
# The `rules.mk` File
|
||||||
|
|
||||||
This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features.
|
This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features.
|
||||||
@@ -232,3 +244,5 @@ Use these to enable or disable building certain features. The more you have enab
|
|||||||
* Unicode
|
* Unicode
|
||||||
* `BLUETOOTH_ENABLE`
|
* `BLUETOOTH_ENABLE`
|
||||||
* Enable Bluetooth with the Adafruit EZ-Key HID
|
* Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
* `SPLIT_KEYBOARD`
|
||||||
|
* Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common
|
||||||
@@ -133,7 +133,7 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac
|
|||||||
|
|
||||||
?> Due to the way that keycodes are structured, any modifiers specified as part of `kc`, such as `LCTL()` or `KC_LPRN`, will only activate when held instead of tapped.
|
?> Due to the way that keycodes are structured, any modifiers specified as part of `kc`, such as `LCTL()` or `KC_LPRN`, will only activate when held instead of tapped.
|
||||||
|
|
||||||
?> Additionally, if there is at least one right modifier, any other modifiers will turn into their right equivalents, so it is not possible to "mix and match" the two.
|
?> Additionally, if there is at least one right-handed modifier, any other modifiers in a chain of functions will turn into their right-handed equivalents, so it is not possible to "mix and match" the two.
|
||||||
|
|
||||||
# One Shot Keys
|
# One Shot Keys
|
||||||
|
|
||||||
|
|||||||
+86
-75
@@ -1,89 +1,100 @@
|
|||||||
# Bootmagic and Magic Keycodes
|
# Bootmagic
|
||||||
|
|
||||||
There are 3 separate but related features that allow you to change the behavior of your keyboard without reflashing. While each of them have similar functionality you access that functionality in different ways depending on how your keyboard is configured.
|
There are three separate but related features that allow you to change the behavior of your keyboard without reflashing. While each of them have similar functionality, it is accessed in different ways depending on how your keyboard is configured.
|
||||||
|
|
||||||
Bootmagic is a system for configuring your keyboard while it initializes. To trigger a Bootmagic command you hold down the bootmagic key (`KC_SPACE` on most keyboards) and one or more command keys.
|
**Bootmagic** is a system for configuring your keyboard while it initializes. To trigger a Bootmagic command, hold down the Bootmagic key and one or more command keys.
|
||||||
|
|
||||||
Bootmagic Keycodes allow you to access the Bootmagic functionality after your keyboard has initialized. To use Bootmagic Keycodes you assign keycodes starting with `MAGIC_`, much in the same way you define any other key.
|
**Bootmagic Keycodes** are prefixed with `MAGIC_`, and allow you to access the Bootmagic functionality *after* your keyboard has initialized. To use the keycodes, assign them to your keymap as you would any other keycode.
|
||||||
|
|
||||||
Command is a feature that allows you to control different aspects of your keyboard. Command used to be called Magic. Command is typically accessed by holding Left and Right Shift at the same time, although that can be customized. While it shares some functionality with Bootmagic it also allows you to access functionality that Bootmagic does not. For more information see the [Command](feature_command.md) documentation page.
|
**Command**, formerly known as **Magic**, is another feature that allows you to control different aspects of your keyboard. While it shares some functionality with Bootmagic, it also allows you to do things that Bootmagic does not, such as printing version information to the console. For more information, see [Command](feature_command.md).
|
||||||
|
|
||||||
## Enabling Bootmagic
|
On some keyboards Bootmagic is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with:
|
||||||
|
|
||||||
Bootmagic is disabled by default. To use Bootmagic you need to enable it in your `rules.mk` file:
|
```make
|
||||||
|
BOOTMAGIC_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
BOOTMAGIC_ENABLE = yes
|
## Hotkeys
|
||||||
|
|
||||||
## Bootmagic Hotkeys and Keycodes
|
Hold down the Bootmagic key (Space by default) and the desired hotkey while plugging in your keyboard. For example, holding Space+`B` should cause it to enter the bootloader.
|
||||||
|
|
||||||
This table describes the default Hotkeys for Bootmagic and the Keycodes for Magic. These may be overriden at the Keyboard or Keymap level. Some functionality is not available in both methods.
|
|Hotkey |Description |
|
||||||
|
|------------------|---------------------------------------------|
|
||||||
|
|Escape |Ignore Bootmagic configuration in EEPROM |
|
||||||
|
|`B` |Enter the bootloader |
|
||||||
|
|`D` |Toggle debugging over serial |
|
||||||
|
|`X` |Toggle key matrix debugging |
|
||||||
|
|`K` |Toggle keyboard debugging |
|
||||||
|
|`M` |Toggle mouse debugging |
|
||||||
|
|Backspace |Clear the EEPROM |
|
||||||
|
|Caps Lock |Toggle treating Caps Lock as Left Control |
|
||||||
|
|Left Control |Toggle swapping Caps Lock and Left Control |
|
||||||
|
|Left Alt |Toggle swapping Left Alt and Left GUI |
|
||||||
|
|Right Alt |Toggle swapping Right Alt and Right GUI |
|
||||||
|
|Left GUI |Toggle the GUI keys (useful when gaming) |
|
||||||
|
|<code>`</code>|Toggle swapping <code>`</code> and Escape|
|
||||||
|
|`\` |Toggle swapping `\` and Backspace |
|
||||||
|
|`N` |Toggle N-Key Rollover (NKRO) |
|
||||||
|
|`0` |Make layer 0 the default layer |
|
||||||
|
|`1` |Make layer 1 the default layer |
|
||||||
|
|`2` |Make layer 2 the default layer |
|
||||||
|
|`3` |Make layer 3 the default layer |
|
||||||
|
|`4` |Make layer 4 the default layer |
|
||||||
|
|`5` |Make layer 5 the default layer |
|
||||||
|
|`6` |Make layer 6 the default layer |
|
||||||
|
|`7` |Make layer 7 the default layer |
|
||||||
|
|
||||||
To use the Hotkey hold down `BOOTMAGIC_KEY_SALT` (`KC_SPACE` by default) and the Hotkey while plugging in your keyboard. To use the Keycode assign that keycode to a layer. For example, if you hold down Space+B while plugging in most keyboards, you will enter bootloader mode.
|
## Keycodes
|
||||||
|
|
||||||
|Hotkey |Keycode |Description |
|
|Keycode |Aliases |Description |
|
||||||
|-----------|----------------------------------|--------------------------------------------------------|
|
|----------------------------------|---------|------------------------------------------|
|
||||||
|`ESC` | |Skip bootmagic and saved eeprom configuration |
|
|`MAGIC_CAPSLOCK_TO_CONTROL` | |Treat Caps Lock as Left Control |
|
||||||
|`B` |`RESET` |Enter bootloader instead of firmware |
|
|`MAGIC_UNCAPSLOCK_TO_CONTROL` | |Stop treating Caps Lock as Left Control |
|
||||||
|`D` |`DEBUG` |Enable debugging (writes messages to serial) |
|
|`MAGIC_HOST_NKRO` | |Force N-Key Rollover (NKRO) on |
|
||||||
|`X` | |Enable matrix debugging |
|
|`MAGIC_UNHOST_NKRO` | |Force NKRO off |
|
||||||
|`K` | |Enable keyboard debugging |
|
|`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off |
|
||||||
|`M` | |Enable mouse debugging |
|
|`MAGIC_NO_GUI` | |Disable the GUI keys (useful when gaming) |
|
||||||
|`BACKSPACE`| |Clear the saved settings from flash |
|
|`MAGIC_UNNO_GUI` | |Enable the GUI keys |
|
||||||
|`CAPSLOCK` |`MAGIC_CAPSLOCK_TO_CONTROL` |Treat `Capslock` as `Control` |
|
|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)|
|
||||||
| |`MAGIC_UNCAPSLOCK_TO_CONTROL` |Stop treating CapsLock as Control |
|
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI |
|
||||||
|`LCTRL` |`MAGIC_SWAP_CONTROL_CAPSLOCK` |Swap `Control` and `Capslock` |
|
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace |
|
||||||
| |`MAGIC_UNSWAP_CONTROL_CAPSLOCK` |Unswap Left Control and Caps Lock |
|
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|
||||||
| |`MAGIC_SWAP_ALT_GUI` |Swap Alt and GUI on both sides |
|
|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock |
|
||||||
| |`MAGIC_UNSWAP_ALT_GUI` |Unswap Left Alt and GUI |
|
|`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Left Control and Caps Lock |
|
||||||
|`LALT` |`MAGIC_SWAP_LALT_LGUI` |Swap Left `Alt` and `GUI`, e.g. for OSX Opt and Cmd |
|
|`MAGIC_SWAP_GRAVE_ESC` | |Swap <code>`</code> and Escape |
|
||||||
| |`MAGIC_UNSWAP_LALT_LGUI` |Unswap Left Alt and GUI |
|
|`MAGIC_UNSWAP_GRAVE_ESC` | |Unswap <code>`</code> and Escape |
|
||||||
|`RALT` |`MAGIC_SWAP_RALT_RGUI` |Swap Right `Alt` and `GUI` |
|
|`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and Left GUI |
|
||||||
| |`MAGIC_UNSWAP_RALT_RGUI` |Unswap Right Alt and GUI |
|
|`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and Left GUI |
|
||||||
|`LGUI` |`MAGIC_NO_GUI` |Disable GUI key - e.g. disable Windows key during gaming|
|
|`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and Right GUI |
|
||||||
| |`MAGIC_UNNO_GUI` |Enable the GUI key |
|
|`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and Right GUI |
|
||||||
|`GRAVE` |`MAGIC_SWAP_GRAVE_ESC` |Swap `\`~` and `ESC` |
|
|
||||||
| |`MAGIC_UNSWAP_GRAVE_ESC` |Unswap `\`~` and Escape |
|
|
||||||
|`BACKSLASH`|`MAGIC_SWAP_BACKSLASH_BACKSPACE` |Swap Blackslash and Backspace |
|
|
||||||
| |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`|Unswap Backslash and Backspace |
|
|
||||||
|`N` |`MAGIC_HOST_NKRO` |Force N-Key Rollover (NKRO) on |
|
|
||||||
| |`MAGIC_UNHOST_NKRO` |Force NKRO off |
|
|
||||||
| |`MAGIC_TOGGLE_NKRO` |Toggle NKRO on or off |
|
|
||||||
|`0` |`DF(0)` |Make Layer 0 the default layer at bootup |
|
|
||||||
|`1` |`DF(1)` |Make Layer 1 the default layer at bootup |
|
|
||||||
|`2` |`DF(2)` |Make Layer 2 the default layer at bootup |
|
|
||||||
|`3` |`DF(3)` |Make Layer 3 the default layer at bootup |
|
|
||||||
|`4` |`DF(4)` |Make Layer 4 the default layer at bootup |
|
|
||||||
|`5` |`DF(5)` |Make Layer 5 the default layer at bootup |
|
|
||||||
|`6` |`DF(6)` |Make Layer 6 the default layer at bootup |
|
|
||||||
|`7` |`DF(7)` |Make Layer 7 the default layer at bootup |
|
|
||||||
|
|
||||||
## Bootmagic Configuration
|
## Configuration
|
||||||
|
|
||||||
When setting up your keyboard and/or keymap there are a number of `#define`s that control the behavior of Bootmagic. To use these put them in your `config.h`, either at the keyboard or keymap level.
|
If you would like to change the hotkey assignments for Bootmagic, `#define` these in your `config.h` at either the keyboard or keymap level.
|
||||||
|
|
||||||
|Define |Default|Description |
|
|Define |Default |Description |
|
||||||
|-------|-------|------------|
|
|----------------------------------------|-------------|---------------------------------------------------|
|
||||||
|`BOOTMAGIC_KEY_SALT`|`KC_SPACE`|The key to hold down to trigger Bootmagic during initialization.|
|
|`BOOTMAGIC_KEY_SALT` |`KC_SPACE` |The Bootmagic key |
|
||||||
|`BOOTMAGIC_KEY_SKIP`|`KC_ESC`|The Hotkey to ignore saved eeprom configuration.|
|
|`BOOTMAGIC_KEY_SKIP` |`KC_ESC` |Ignore Bootmagic configuration in EEPROM |
|
||||||
|`BOOTMAGIC_KEY_EEPROM_CLEAR`|`KC_BSPACE`|The hotkey to clear the saved eeprom configuration.|
|
|`BOOTMAGIC_KEY_EEPROM_CLEAR` |`KC_BSPACE` |Clear the EEPROM configuration |
|
||||||
|`BOOTMAGIC_KEY_BOOTLOADER`|`KC_B`|The hotkey to enter the bootloader.|
|
|`BOOTMAGIC_KEY_BOOTLOADER` |`KC_B` |Enter the bootloader |
|
||||||
|`BOOTMAGIC_KEY_DEBUG_ENABLE`|`KC_D`|The hotkey to enable debug mode.|
|
|`BOOTMAGIC_KEY_DEBUG_ENABLE` |`KC_D` |Toggle debugging over serial |
|
||||||
|`BOOTMAGIC_KEY_DEBUG_MATRIX`|`KC_X`|The hotkey to enable matrix debugging mode.|
|
|`BOOTMAGIC_KEY_DEBUG_MATRIX` |`KC_X` |Toggle matrix debugging |
|
||||||
|`BOOTMAGIC_KEY_DEBUG_KEYBOARD`|`KC_K`|The hotkey to enable keyboard debugging mode.|
|
|`BOOTMAGIC_KEY_DEBUG_KEYBOARD` |`KC_K` |Toggle keyboard debugging |
|
||||||
|`BOOTMAGIC_KEY_DEBUG_MOUSE`|`KC_M`|The hotkey to enable mouse debugging mode.|
|
|`BOOTMAGIC_KEY_DEBUG_MOUSE` |`KC_M` |Toggle mouse debugging |
|
||||||
|`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK`|`KC_LCTRL`||
|
|`BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK` |`KC_LCTRL` |Swap Left Control and Caps Lock |
|
||||||
|`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL`|`KC_CAPSLOCK`||
|
|`BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL` |`KC_CAPSLOCK`|Toggle treating Caps Lock as Left Control |
|
||||||
|`BOOTMAGIC_KEY_SWAP_LALT_LGUI`|`KC_LALT`||
|
|`BOOTMAGIC_KEY_SWAP_LALT_LGUI` |`KC_LALT` |Toggle swapping Left Alt and Left GUI (for macOS) |
|
||||||
|`BOOTMAGIC_KEY_SWAP_RALT_RGUI`|`KC_RALT`||
|
|`BOOTMAGIC_KEY_SWAP_RALT_RGUI` |`KC_RALT` |Toggle swapping Right Alt and Right GUI (for macOS)|
|
||||||
|`BOOTMAGIC_KEY_NO_GUI`|`KC_LGUI`||
|
|`BOOTMAGIC_KEY_NO_GUI` |`KC_LGUI` |Toggle the GUI keys (useful when gaming) |
|
||||||
|`BOOTMAGIC_KEY_SWAP_GRAVE_ESC`|`KC_GRAVE`||
|
|`BOOTMAGIC_KEY_SWAP_GRAVE_ESC` |`KC_GRAVE` |Toggle swapping <code>`</code> and Escape |
|
||||||
|`BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE`|`KC_BSLASH`||
|
|`BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE`|`KC_BSLASH` |Toggle swapping `\` and Backspace |
|
||||||
|`BOOTMAGIC_HOST_NKRO`|`KC_N`||
|
|`BOOTMAGIC_HOST_NKRO` |`KC_N` |Toggle N-Key Rollover (NKRO) |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_0`|`KC_0`|Hotkey to set Layer 0 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_0` |`KC_0` |Make layer 0 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_1`|`KC_1`|Hotkey to set Layer 1 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_1` |`KC_1` |Make layer 1 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_2`|`KC_2`|Hotkey to set Layer 2 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_2` |`KC_2` |Make layer 2 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_3`|`KC_3`|Hotkey to set Layer 3 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_3` |`KC_3` |Make layer 3 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_4`|`KC_4`|Hotkey to set Layer 4 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_4` |`KC_4` |Make layer 4 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_5`|`KC_5`|Hotkey to set Layer 5 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_5` |`KC_5` |Make layer 5 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_6`|`KC_6`|Hotkey to set Layer 6 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_6` |`KC_6` |Make layer 6 the default layer |
|
||||||
|`BOOTMAGIC_KEY_DEFAULT_LAYER_7`|`KC_7`|Hotkey to set Layer 7 as the default layer|
|
|`BOOTMAGIC_KEY_DEFAULT_LAYER_7` |`KC_7` |Make layer 7 the default layer |
|
||||||
+40
-42
@@ -1,52 +1,50 @@
|
|||||||
# Command (Formerly known as Magic)
|
# Command
|
||||||
|
|
||||||
Command is a way to change your keyboard's behavior without having to flash or unplug it to use [Bootmagic](feature_bootmagic.md). There is a lot of overlap between this functionality and the [Bootmagic Keycodes](feature_bootmagic.md). Whenever possible we encourage you to use that functionality instead of Command.
|
Command, formerly known as Magic, is a way to change your keyboard's behavior without having to flash or unplug it to use [Bootmagic](feature_bootmagic.md). There is a lot of overlap between this functionality and the [Bootmagic Keycodes](feature_bootmagic.md#keycodes). Wherever possible we encourage you to use that feature instead of Command.
|
||||||
|
|
||||||
## Enabling Command
|
On some keyboards Command is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk`:
|
||||||
|
|
||||||
By default Command is disabled. You can enable it in your `rules.mk` file:
|
```make
|
||||||
|
COMMAND_ENABLE = yes
|
||||||
COMMAND_ENABLE = yes
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
To use Command you hold down the key combination defined by `IS_COMMAND`. By default that combination is both shift keys. While holding the key combination press the key corresponding to the command you want.
|
To use Command, hold down the key combination defined by the `IS_COMMAND()` macro. By default this is Left Shift+Right Shift. Then, press the key corresponding to the command you want. For example, to output the current QMK version to the QMK Toolbox console, press Left Shift+Right Shift+`V`.
|
||||||
|
|
||||||
For example, to write the current QMK version to the QMK Toolbox console, you can press `Left Shift`+`Right Shift`+`V`.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The following values can be defined in `config.h` to control the behavior of Command.
|
If you would like to change the key assignments for Command, `#define` these in your `config.h` at either the keyboard or keymap level. All keycode assignments here must omit the `KC_` prefix.
|
||||||
|
|
||||||
|Define |Default | Description |
|
|Define |Default |Description |
|
||||||
|-------|--------|-------------|
|
|------------------------------------|----------------------------------------------------------------------------------------|------------------------------------------------|
|
||||||
|`IS_COMMAND()` |`(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))`|Key combination to activate Command|
|
|`IS_COMMAND()` |`(keyboard_report->mods == (MOD_BIT(KC_LSHIFT) <code>|</code> MOD_BIT(KC_RSHIFT)))`|The key combination to activate Command |
|
||||||
|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Do layer switching with Function row|
|
|`MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` |`true` |Set default layer with the Function row |
|
||||||
|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Do layer switching with number keys.|
|
|`MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` |`true` |Set default layer with the number keys |
|
||||||
|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Do layer switching with custom keys (`MAGIC_KEY_LAYER0..9` below.)|
|
|`MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM`|`false` |Set default layer with `MAGIC_KEY_LAYER0..9` |
|
||||||
|`MAGIC_KEY_HELP1` |`H` |Show help.|
|
|`MAGIC_KEY_DEBUG` |`D` |Toggle debugging over serial |
|
||||||
|`MAGIC_KEY_HELP2` |`SLASH` |Show help.|
|
|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Toggle key matrix debugging |
|
||||||
|`MAGIC_KEY_DEBUG` |`D` |Turn on debug mode.|
|
|`MAGIC_KEY_DEBUG_KBD` |`K` |Toggle keyboard debugging |
|
||||||
|`MAGIC_KEY_DEBUG_MATRIX` |`X` |Turn on matrix debugging.|
|
|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Toggle mouse debugging |
|
||||||
|`MAGIC_KEY_DEBUG_KBD` |`K` |Turn on keyboard debugging.|
|
|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command console |
|
||||||
|`MAGIC_KEY_DEBUG_MOUSE` |`M` |Turn on mouse debugging.|
|
|`MAGIC_KEY_VERSION` |`V` |Print the running QMK version to the console |
|
||||||
|`MAGIC_KEY_VERSION` |`V` |Write the QMK version to the console|
|
|`MAGIC_KEY_STATUS` |`S` |Print the current keyboard status to the console|
|
||||||
|`MAGIC_KEY_STATUS` |`S` |Show the current keyboard status|
|
|`MAGIC_KEY_HELP1` |`H` |Print Command help to the console |
|
||||||
|`MAGIC_KEY_CONSOLE` |`C` |Enable the Command Console|
|
|`MAGIC_KEY_HELP2` |`SLASH` |Print Command help to the console (alternate) |
|
||||||
|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Alternate access to layer 0|
|
|`MAGIC_KEY_LAYER0` |`0` |Make layer 0 the default layer |
|
||||||
|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Alternate access to layer 0|
|
|`MAGIC_KEY_LAYER1` |`1` |Make layer 1 the default layer |
|
||||||
|`MAGIC_KEY_LAYER0` |`0` |Change default layer to 0|
|
|`MAGIC_KEY_LAYER2` |`2` |Make layer 2 the default layer |
|
||||||
|`MAGIC_KEY_LAYER1` |`1` |Change default layer to 1|
|
|`MAGIC_KEY_LAYER3` |`3` |Make layer 3 the default layer |
|
||||||
|`MAGIC_KEY_LAYER2` |`2` |Change default layer to 2|
|
|`MAGIC_KEY_LAYER4` |`4` |Make layer 4 the default layer |
|
||||||
|`MAGIC_KEY_LAYER3` |`3` |Change default layer to 3|
|
|`MAGIC_KEY_LAYER5` |`5` |Make layer 5 the default layer |
|
||||||
|`MAGIC_KEY_LAYER4` |`4` |Change default layer to 4|
|
|`MAGIC_KEY_LAYER6` |`6` |Make layer 6 the default layer |
|
||||||
|`MAGIC_KEY_LAYER5` |`5` |Change default layer to 5|
|
|`MAGIC_KEY_LAYER7` |`7` |Make layer 7 the default layer |
|
||||||
|`MAGIC_KEY_LAYER6` |`6` |Change default layer to 6|
|
|`MAGIC_KEY_LAYER8` |`8` |Make layer 8 the default layer |
|
||||||
|`MAGIC_KEY_LAYER7` |`7` |Change default layer to 7|
|
|`MAGIC_KEY_LAYER9` |`9` |Make layer 9 the default layer |
|
||||||
|`MAGIC_KEY_LAYER8` |`8` |Change default layer to 8|
|
|`MAGIC_KEY_LAYER0_ALT1` |`ESC` |Make layer 0 the default layer (alternate) |
|
||||||
|`MAGIC_KEY_LAYER9` |`9` |Change default layer to 9|
|
|`MAGIC_KEY_LAYER0_ALT2` |`GRAVE` |Make layer 0 the default layer (alternate) |
|
||||||
|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Exit keyboard and enter bootloader|
|
|`MAGIC_KEY_BOOTLOADER` |`PAUSE` |Enter the bootloader |
|
||||||
|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed|
|
|`MAGIC_KEY_LOCK` |`CAPS` |Lock the keyboard so nothing can be typed |
|
||||||
|`MAGIC_KEY_EEPROM` |`E` |Erase EEPROM settings|
|
|`MAGIC_KEY_EEPROM` |`E` |Clear the EEPROM |
|
||||||
|`MAGIC_KEY_NKRO` |`N` |Toggle NKRO on/off|
|
|`MAGIC_KEY_NKRO` |`N` |Toggle N-Key Rollover (NKRO) |
|
||||||
|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping on/off|
|
|`MAGIC_KEY_SLEEP_LED` |`Z` |Toggle LED when computer is sleeping |
|
||||||
@@ -31,6 +31,20 @@ The reason for this, is that `<name>.h` won't be added in time to add settings (
|
|||||||
|
|
||||||
So you should use the `config.h` for QMK settings, and the `<name>.h` file for user or keymap specific settings.
|
So you should use the `config.h` for QMK settings, and the `<name>.h` file for user or keymap specific settings.
|
||||||
|
|
||||||
|
`/users/<name>/rules.mk` will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can `define RGB_ENABLE` in your keymap `rules.mk` and then check for the variable in your userspace `rules.mk` like this:
|
||||||
|
```make
|
||||||
|
ifdef RGB_ENABLE
|
||||||
|
# Include my fancy rgb functions source here
|
||||||
|
endif
|
||||||
|
```
|
||||||
|
Because of this, any time you turn on QMK features in your `users/<name>/rules.mk`, you should conditionally enable them only if the flag isn't already defined, like this:
|
||||||
|
```make
|
||||||
|
ifndef TAP_DANCE_ENABLE
|
||||||
|
TAP_DANCE_ENABLE = yes
|
||||||
|
endif
|
||||||
|
```
|
||||||
|
This will ensure that you can explicitly turn off features for an individual keymap.
|
||||||
|
|
||||||
## Readme
|
## Readme
|
||||||
|
|
||||||
Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses).
|
Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses).
|
||||||
@@ -122,4 +136,4 @@ By default the userspace used will be the same as the keymap name. In some situa
|
|||||||
|
|
||||||
```
|
```
|
||||||
USER_NAME := mylayout
|
USER_NAME := mylayout
|
||||||
```
|
```
|
||||||
@@ -133,6 +133,10 @@ This consumes about 5390 bytes.
|
|||||||
|
|
||||||
This enables [key lock](feature_key_lock.md). This consumes an additional 260 bytes.
|
This enables [key lock](feature_key_lock.md). This consumes an additional 260 bytes.
|
||||||
|
|
||||||
|
`SPLIT_KEYBOARD`
|
||||||
|
|
||||||
|
This enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common
|
||||||
|
|
||||||
## Customizing Makefile Options on a Per-Keymap Basis
|
## Customizing Makefile Options on a Per-Keymap Basis
|
||||||
|
|
||||||
If your keymap directory has a file called `rules.mk` any options you set in that file will take precedence over other `rules.mk` options for your particular keyboard.
|
If your keymap directory has a file called `rules.mk` any options you set in that file will take precedence over other `rules.mk` options for your particular keyboard.
|
||||||
|
|||||||
+1
-1
@@ -269,7 +269,7 @@ This is a reference only. Each group of keys links to the page documenting their
|
|||||||
|`OUT_BT` |Bluetooth only |
|
|`OUT_BT` |Bluetooth only |
|
||||||
|
|
||||||
|
|
||||||
## [Layer Switching](feature_advanced_keycodes.md# Switching and Toggling Layers)
|
## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
||||||
|
|
||||||
|Key |Description |
|
|Key |Description |
|
||||||
|-----------------|---------------------------------------------------------------------|
|
|-----------------|---------------------------------------------------------------------|
|
||||||
|
|||||||
+59
-59
@@ -15,15 +15,15 @@
|
|||||||
void i2c_init(void)
|
void i2c_init(void)
|
||||||
{
|
{
|
||||||
TWSR = 0; /* no prescaler */
|
TWSR = 0; /* no prescaler */
|
||||||
TWBR = (uint8_t)TWBR_val;
|
TWBR = (uint8_t)TWBR_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
||||||
{
|
{
|
||||||
// reset TWI control register
|
// reset TWI control register
|
||||||
TWCR = 0;
|
TWCR = 0;
|
||||||
// transmit START condition
|
// transmit START condition
|
||||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -32,13 +32,13 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the start condition was successfully transmitted
|
// check if the start condition was successfully transmitted
|
||||||
if(((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)){ return I2C_STATUS_ERROR; }
|
if(((TW_STATUS & 0xF8) != TW_START) && ((TW_STATUS & 0xF8) != TW_REP_START)){ return I2C_STATUS_ERROR; }
|
||||||
|
|
||||||
// load slave address into data register
|
// load slave address into data register
|
||||||
TWDR = address;
|
TWDR = address;
|
||||||
// start transmission of address
|
// start transmission of address
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
timeout_timer = timer_read();
|
timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -47,19 +47,19 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the device has acknowledged the READ / WRITE mode
|
// check if the device has acknowledged the READ / WRITE mode
|
||||||
uint8_t twst = TW_STATUS & 0xF8;
|
uint8_t twst = TW_STATUS & 0xF8;
|
||||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return I2C_STATUS_ERROR;
|
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return I2C_STATUS_ERROR;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
||||||
{
|
{
|
||||||
// load data into data register
|
// load data into data register
|
||||||
TWDR = data;
|
TWDR = data;
|
||||||
// start transmission of data
|
// start transmission of data
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -68,16 +68,16 @@ i2c_status_t i2c_write(uint8_t data, uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (TW_STATUS & 0xF8) != TW_MT_DATA_ACK ){ return I2C_STATUS_ERROR; }
|
if( (TW_STATUS & 0xF8) != TW_MT_DATA_ACK ){ return I2C_STATUS_ERROR; }
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t i2c_read_ack(uint16_t timeout)
|
int16_t i2c_read_ack(uint16_t timeout)
|
||||||
{
|
{
|
||||||
|
|
||||||
// start TWI module and acknowledge data after reception
|
// start TWI module and acknowledge data after reception
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -86,15 +86,15 @@ int16_t i2c_read_ack(uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return received data from TWDR
|
// return received data from TWDR
|
||||||
return TWDR;
|
return TWDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t i2c_read_nack(uint16_t timeout)
|
int16_t i2c_read_nack(uint16_t timeout)
|
||||||
{
|
{
|
||||||
|
|
||||||
// start receiving without acknowledging reception
|
// start receiving without acknowledging reception
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while( !(TWCR & (1<<TWINT)) ) {
|
while( !(TWCR & (1<<TWINT)) ) {
|
||||||
@@ -103,39 +103,39 @@ int16_t i2c_read_nack(uint16_t timeout)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return received data from TWDR
|
// return received data from TWDR
|
||||||
return TWDR;
|
return TWDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
i2c_status_t status = i2c_start(address | I2C_WRITE, timeout);
|
||||||
if (status) return status;
|
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
|
||||||
status = i2c_write(data[i], timeout);
|
|
||||||
if (status) return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
status = i2c_stop(timeout);
|
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
|
status = i2c_write(data[i], timeout);
|
||||||
|
if (status) return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = i2c_stop(timeout);
|
||||||
|
if (status) return status;
|
||||||
|
|
||||||
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(address | I2C_READ, timeout);
|
i2c_status_t status = i2c_start(address | I2C_READ, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < (length-1); i++) {
|
for (uint16_t i = 0; i < (length-1); i++) {
|
||||||
status = i2c_read_ack(timeout);
|
status = i2c_read_ack(timeout);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
} else {
|
} else {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = i2c_read_nack(timeout);
|
status = i2c_read_nack(timeout);
|
||||||
if (status >= 0 ) {
|
if (status >= 0 ) {
|
||||||
@@ -147,47 +147,47 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
|||||||
status = i2c_stop(timeout);
|
status = i2c_stop(timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
i2c_status_t status = i2c_start(devaddr | 0x00, timeout);
|
||||||
if (status) return status;
|
|
||||||
|
|
||||||
status = i2c_write(regaddr, timeout);
|
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
status = i2c_write(regaddr, timeout);
|
||||||
|
if (status) return status;
|
||||||
|
|
||||||
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = i2c_write(data[i], timeout);
|
status = i2c_write(data[i], timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = i2c_stop(timeout);
|
status = i2c_stop(timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||||
{
|
{
|
||||||
i2c_status_t status = i2c_start(devaddr, timeout);
|
i2c_status_t status = i2c_start(devaddr, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
status = i2c_write(regaddr, timeout);
|
status = i2c_write(regaddr, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
status = i2c_start(devaddr | 0x01, timeout);
|
status = i2c_start(devaddr | 0x01, timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < (length-1); i++) {
|
for (uint16_t i = 0; i < (length-1); i++) {
|
||||||
status = i2c_read_ack(timeout);
|
status = i2c_read_ack(timeout);
|
||||||
if (status >= 0) {
|
if (status >= 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
} else {
|
} else {
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
status = i2c_read_nack(timeout);
|
status = i2c_read_nack(timeout);
|
||||||
if (status >= 0 ) {
|
if (status >= 0 ) {
|
||||||
@@ -199,13 +199,13 @@ i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16
|
|||||||
status = i2c_stop(timeout);
|
status = i2c_stop(timeout);
|
||||||
if (status) return status;
|
if (status) return status;
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_stop(uint16_t timeout)
|
i2c_status_t i2c_stop(uint16_t timeout)
|
||||||
{
|
{
|
||||||
// transmit STOP condition
|
// transmit STOP condition
|
||||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while(TWCR & (1<<TWSTO)) {
|
while(TWCR & (1<<TWSTO)) {
|
||||||
@@ -215,4 +215,4 @@ i2c_status_t i2c_stop(uint16_t timeout)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
@@ -28,4 +28,4 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint1
|
|||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
i2c_status_t i2c_stop(uint16_t timeout);
|
i2c_status_t i2c_stop(uint16_t timeout);
|
||||||
|
|
||||||
#endif // I2C_MASTER_H
|
#endif // I2C_MASTER_H
|
||||||
+51
-83
@@ -5,96 +5,64 @@
|
|||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include <util/twi.h>
|
#include <util/twi.h>
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "i2c_slave.h"
|
#include "i2c_slave.h"
|
||||||
|
|
||||||
void i2c_init(uint8_t address){
|
void i2c_init(uint8_t address){
|
||||||
// load address into TWI address register
|
// load address into TWI address register
|
||||||
TWAR = (address << 1);
|
TWAR = (address << 1);
|
||||||
// set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
|
// set the TWCR to enable address matching and enable TWI, clear TWINT, enable TWI interrupt
|
||||||
TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN);
|
TWCR = (1 << TWIE) | (1 << TWEA) | (1 << TWINT) | (1 << TWEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
void i2c_stop(void){
|
void i2c_stop(void){
|
||||||
// clear acknowledge and enable bits
|
// clear acknowledge and enable bits
|
||||||
TWCR &= ~( (1<<TWEA) | (1<<TWEN) );
|
TWCR &= ~((1 << TWEA) | (1 << TWEN));
|
||||||
}
|
}
|
||||||
|
|
||||||
ISR(TWI_vect){
|
ISR(TWI_vect){
|
||||||
|
uint8_t ack = 1;
|
||||||
// temporary stores the received data
|
// temporary stores the received data
|
||||||
uint8_t data;
|
//uint8_t data;
|
||||||
|
|
||||||
// own address has been acknowledged
|
switch(TW_STATUS){
|
||||||
if( (TWSR & 0xF8) == TW_SR_SLA_ACK ){
|
case TW_SR_SLA_ACK:
|
||||||
buffer_address = 0xFF;
|
// The device is now a slave receiver
|
||||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
slave_has_register_set = false;
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
break;
|
||||||
}
|
|
||||||
else if( (TWSR & 0xF8) == TW_SR_DATA_ACK ){ // data has been received in slave receiver mode
|
case TW_SR_DATA_ACK:
|
||||||
|
// This device is a slave receiver and has received data
|
||||||
// save the received byte inside data
|
// First byte is the location then the bytes will be writen in buffer with auto-incriment
|
||||||
data = TWDR;
|
if(!slave_has_register_set){
|
||||||
|
buffer_address = TWDR;
|
||||||
// check wether an address has already been transmitted or not
|
|
||||||
if(buffer_address == 0xFF){
|
if (buffer_address >= RX_BUFFER_SIZE){ // address out of bounds dont ack
|
||||||
|
ack = 0;
|
||||||
buffer_address = data;
|
buffer_address = 0;
|
||||||
|
}
|
||||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
slave_has_register_set = true; // address has been receaved now fill in buffer
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
} else {
|
||||||
}
|
rxbuffer[buffer_address] = TWDR;
|
||||||
else{ // if a databyte has already been received
|
buffer_address++;
|
||||||
|
}
|
||||||
// store the data at the current address
|
break;
|
||||||
rxbuffer[buffer_address] = data;
|
|
||||||
|
case TW_ST_SLA_ACK:
|
||||||
// increment the buffer address
|
case TW_ST_DATA_ACK:
|
||||||
buffer_address++;
|
// This device is a slave transmitter and master has requested data
|
||||||
|
TWDR = txbuffer[buffer_address];
|
||||||
// if there is still enough space inside the buffer
|
buffer_address++;
|
||||||
if(buffer_address < 0xFF){
|
break;
|
||||||
// clear TWI interrupt flag, prepare to receive next byte and acknowledge
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
case TW_BUS_ERROR:
|
||||||
}
|
// We got an error, reset i2c
|
||||||
else{
|
TWCR = 0;
|
||||||
// Don't acknowledge
|
default:
|
||||||
TWCR &= ~(1<<TWEA);
|
break;
|
||||||
// clear TWI interrupt flag, prepare to receive last byte.
|
}
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEN);
|
|
||||||
}
|
// Reset i2c state mahcine to be ready for next interrupt
|
||||||
}
|
TWCR |= (1 << TWIE) | (1 << TWINT) | (ack << TWEA) | (1 << TWEN);
|
||||||
}
|
}
|
||||||
else if( (TWSR & 0xF8) == TW_ST_DATA_ACK ){ // device has been addressed to be a transmitter
|
|
||||||
|
|
||||||
// copy data from TWDR to the temporary memory
|
|
||||||
data = TWDR;
|
|
||||||
|
|
||||||
// if no buffer read address has been sent yet
|
|
||||||
if( buffer_address == 0xFF ){
|
|
||||||
buffer_address = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
// copy the specified buffer address into the TWDR register for transmission
|
|
||||||
TWDR = txbuffer[buffer_address];
|
|
||||||
// increment buffer read address
|
|
||||||
buffer_address++;
|
|
||||||
|
|
||||||
// if there is another buffer address that can be sent
|
|
||||||
if(buffer_address < 0xFF){
|
|
||||||
// clear TWI interrupt flag, prepare to send next byte and receive acknowledge
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEA) | (1<<TWEN);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// Don't acknowledge
|
|
||||||
TWCR &= ~(1<<TWEA);
|
|
||||||
// clear TWI interrupt flag, prepare to receive last byte.
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (1<<TWEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
// if none of the above apply prepare TWI to be addressed again
|
|
||||||
TWCR |= (1<<TWIE) | (1<<TWEA) | (1<<TWEN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -8,12 +8,16 @@
|
|||||||
#ifndef I2C_SLAVE_H
|
#ifndef I2C_SLAVE_H
|
||||||
#define I2C_SLAVE_H
|
#define I2C_SLAVE_H
|
||||||
|
|
||||||
|
#define TX_BUFFER_SIZE 30
|
||||||
|
#define RX_BUFFER_SIZE 30
|
||||||
|
|
||||||
volatile uint8_t buffer_address;
|
volatile uint8_t buffer_address;
|
||||||
volatile uint8_t txbuffer[0xFF];
|
static volatile bool slave_has_register_set = false;
|
||||||
volatile uint8_t rxbuffer[0xFF];
|
volatile uint8_t txbuffer[TX_BUFFER_SIZE];
|
||||||
|
volatile uint8_t rxbuffer[RX_BUFFER_SIZE];
|
||||||
|
|
||||||
void i2c_init(uint8_t address);
|
void i2c_init(uint8_t address);
|
||||||
void i2c_stop(void);
|
void i2c_stop(void);
|
||||||
ISR(TWI_vect);
|
ISR(TWI_vect);
|
||||||
|
|
||||||
#endif // I2C_SLAVE_H
|
#endif // I2C_SLAVE_H
|
||||||
@@ -5,15 +5,9 @@
|
|||||||
#define BASE 0
|
#define BASE 0
|
||||||
#define KEYNAV 1
|
#define KEYNAV 1
|
||||||
#define KEYSEL 2
|
#define KEYSEL 2
|
||||||
#define MOUSE 3
|
#define COMBINED 3
|
||||||
#define COMBINED 4
|
#define BROWSER_CONTROL 4
|
||||||
#define BROWSER_CONTROL 5
|
|
||||||
|
|
||||||
// macros
|
|
||||||
#define MOUSE_TOGGLE 1
|
|
||||||
#define MOUSE_LOCK 2
|
|
||||||
|
|
||||||
static bool mouse_lock = false;
|
|
||||||
|
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||||
@@ -63,18 +57,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TRNS, KC_TILD, KC_GRAVE, KC_CIRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_PIPE, KC_BSLS
|
KC_TRNS, KC_TILD, KC_GRAVE, KC_CIRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_DOT, KC_PIPE, KC_BSLS
|
||||||
),
|
),
|
||||||
|
|
||||||
[MOUSE] = LAYOUT(
|
|
||||||
KC_TRNS, KC_PGUP, KC_MS_WH_UP, KC_UP, KC_TRNS, KC_UP, KC_HOME, KC_MS_U, KC_END, KC_MS_WH_UP,
|
|
||||||
KC_MS_ACCEL0, KC_PGDN, KC_MS_WH_DOWN, KC_DOWN, KC_TRNS, KC_DOWN, KC_MS_L, KC_MS_D, KC_MS_R, KC_MS_WH_DOWN,
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MEH(KC_X), MEH(KC_Y), MEH(KC_Z), KC_F5, RCTL(KC_W),
|
|
||||||
KC_TRNS, M(MOUSE_LOCK), KC_TRNS, KC_MS_ACCEL0, KC_TRNS, KC_BTN3, KC_BTN1, KC_BTN2, RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), RCTL(KC_T), LALT(KC_LEFT)
|
|
||||||
),
|
|
||||||
|
|
||||||
[BROWSER_CONTROL] = LAYOUT(
|
[BROWSER_CONTROL] = LAYOUT(
|
||||||
KC_TRNS, KC_BTN3, KC_MS_U, KC_BTN1, KC_BTN2, KC_UP, KC_PGUP, KC_PGDN, KC_MS_WH_UP, KC_TRNS,
|
MEH(KC_0), KC_BTN3, KC_MS_U, KC_BTN1, KC_BTN2, KC_UP, KC_PGUP, KC_PGDN, KC_MS_WH_UP, MEH(KC_9),
|
||||||
KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_DOWN, RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), KC_MS_WH_DOWN, LALT(KC_LEFT),
|
MEH(KC_1), KC_MS_L, KC_MS_D, KC_MS_R, MEH(KC_6), KC_DOWN, RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), KC_MS_WH_DOWN, LALT(KC_LEFT),
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_1), RCTL(KC_9), KC_F6, KC_F5,
|
MEH(KC_2), MEH(KC_3), MEH(KC_4), MEH(KC_5), MEH(KC_7), MEH(KC_8), RCTL(KC_1), RCTL(KC_9), KC_F6, KC_F5,
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_W), RCTL(KC_T), RSFT(RCTL(KC_TAB)), KC_TRNS, KC_TRNS, KC_TRNS
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RCTL(KC_W), RCTL(KC_T), RSFT(RCTL(KC_TAB)), KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -116,30 +103,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
||||||
{
|
|
||||||
// MACRODOWN only works in this function
|
|
||||||
switch(id) {
|
|
||||||
case MOUSE_TOGGLE:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
layer_on(MOUSE);
|
|
||||||
} else {
|
|
||||||
if(!mouse_lock)
|
|
||||||
layer_off(MOUSE);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MOUSE_LOCK:
|
|
||||||
if (record->event.pressed)
|
|
||||||
{
|
|
||||||
if(mouse_lock)
|
|
||||||
{
|
|
||||||
mouse_lock = false;
|
|
||||||
layer_off(MOUSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mouse_lock = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return MACRO_NONE;
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
#include "chocopad.h"
|
||||||
|
|
||||||
|
#define _BASE 0
|
||||||
|
#define _FN1 1
|
||||||
|
#define _FN2 2
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define KC_ KC_TRNS
|
||||||
|
#define KC_XX KC_NO
|
||||||
|
|
||||||
|
#define KC_L1 LT(1, KC_P0)
|
||||||
|
#define KC_L2 LT(2, KC_SPC)
|
||||||
|
#define KC_RST RESET
|
||||||
|
#define KC_BSTP BL_STEP
|
||||||
|
#define KC_RTOG RGB_TOG
|
||||||
|
#define KC_RMOD RGB_MOD
|
||||||
|
#define KC_RHUI RGB_HUI
|
||||||
|
#define KC_RHUD RGB_HUD
|
||||||
|
#define KC_RSAI RGB_SAI
|
||||||
|
#define KC_RSAD RGB_SAD
|
||||||
|
#define KC_RVAI RGB_VAI
|
||||||
|
#define KC_RVAD RGB_VAD
|
||||||
|
#define KC_MAC1 ADMIN
|
||||||
|
#define KC_MAC2 SMSPC
|
||||||
|
#define KC_M192 M192
|
||||||
|
#define KC_M255 M255
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
NUMPAD = SAFE_RANGE,
|
||||||
|
ADMIN,
|
||||||
|
SMSPC,
|
||||||
|
M192,
|
||||||
|
M255
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
[_BASE] = KC_KEYMAP(
|
||||||
|
//,----+----+----+----.
|
||||||
|
P7 , P8 , P9 ,BSPC,
|
||||||
|
//|----+----+----+----|
|
||||||
|
P4 , P5 , P6 ,TAB ,
|
||||||
|
//|----+----+----+----|
|
||||||
|
P1 , P2 , P3 ,PENT,
|
||||||
|
//|----+----+----+----|
|
||||||
|
L1 , L2 ,PDOT,PSLS
|
||||||
|
//`----+----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_FN1] = KC_KEYMAP(
|
||||||
|
//,----+----+----+----.
|
||||||
|
ESC ,MAC1,MAC2,DEL ,
|
||||||
|
//|----+----+----+----|
|
||||||
|
LEFT,DOWN, UP ,RGHT,
|
||||||
|
//|----+----+----+----|
|
||||||
|
M192,M255, XX , XX ,
|
||||||
|
//|----+----+----+----|
|
||||||
|
, XX , , XX
|
||||||
|
//`----+----+----+----'
|
||||||
|
),
|
||||||
|
|
||||||
|
[_FN2] = KC_KEYMAP(
|
||||||
|
//,----+----+----+----.
|
||||||
|
RST , XX , XX , XX ,
|
||||||
|
//|----+----+----+----|
|
||||||
|
RTOG,RHUI,RSAI,RVAI,
|
||||||
|
//|----+----+----+----|
|
||||||
|
RMOD,RHUD,RSAD,RVAD,
|
||||||
|
//|----+----+----+----|
|
||||||
|
BSTP, , XX , XX
|
||||||
|
//`----+----+----+----'
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case ADMIN:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("Administrator");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case SMSPC:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("Simspace1!");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case M192:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("192.168.");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case M255:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("255");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
|
||||||
|
ifndef QUANTUM_DIR
|
||||||
|
include ../../../../Makefile
|
||||||
|
endif
|
||||||
@@ -18,7 +18,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | | | | |
|
* | | | | |
|
||||||
* `---------------------- '
|
* `---------------------- '
|
||||||
*/
|
*/
|
||||||
[0] = KEYMAP( /* LAYER SELECT */
|
[0] = LAYOUT( /* LAYER SELECT */
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, RESET, \
|
KC_TRNS, KC_TRNS, KC_TRNS, RESET, \
|
||||||
TO(4), KC_TRNS, KC_TRNS, KC_TRNS, \
|
TO(4), KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||||
TO(1), TO(2), TO(3), KC_TRNS, \
|
TO(1), TO(2), TO(3), KC_TRNS, \
|
||||||
@@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | 0 | . | / | = |
|
* | 0 | . | / | = |
|
||||||
* `---------------------- '
|
* `---------------------- '
|
||||||
*/
|
*/
|
||||||
[1] = KEYMAP( /* NUMPAD */
|
[1] = LAYOUT( /* NUMPAD */
|
||||||
KC_P7, KC_P8, KC_P9, KC_PAST, \
|
KC_P7, KC_P8, KC_P9, KC_PAST, \
|
||||||
KC_P4, KC_P5, KC_P6, KC_PMNS, \
|
KC_P4, KC_P5, KC_P6, KC_PMNS, \
|
||||||
KC_P1, KC_P2, KC_P3, KC_PPLS, \
|
KC_P1, KC_P2, KC_P3, KC_PPLS, \
|
||||||
@@ -52,7 +52,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* | | | | |
|
* | | | | |
|
||||||
* `---------------------- '
|
* `---------------------- '
|
||||||
*/
|
*/
|
||||||
[5] = KEYMAP( /* NUMPAD SUPPLEMENT */
|
[5] = LAYOUT( /* NUMPAD SUPPLEMENT */
|
||||||
KC_NLCK, KC_TRNS, KC_TRNS, TO(0), \
|
KC_NLCK, KC_TRNS, KC_TRNS, TO(0), \
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||||
@@ -69,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |LEFT |DOWN |RIGHT|ENTER|
|
* |LEFT |DOWN |RIGHT|ENTER|
|
||||||
* `---------------------- '
|
* `---------------------- '
|
||||||
*/
|
*/
|
||||||
[2] = KEYMAP( /* NAV CLUSTER */
|
[2] = LAYOUT( /* NAV CLUSTER */
|
||||||
KC_INS, KC_PGUP, KC_TAB, KC_PSCR, \
|
KC_INS, KC_PGUP, KC_TAB, KC_PSCR, \
|
||||||
KC_DEL, KC_PGDN, KC_VOLD, KC_VOLU, \
|
KC_DEL, KC_PGDN, KC_VOLD, KC_VOLU, \
|
||||||
KC_HOME, KC_UP, KC_END, TO(0), \
|
KC_HOME, KC_UP, KC_END, TO(0), \
|
||||||
@@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |CTRL | C | R |SPACE|
|
* |CTRL | C | R |SPACE|
|
||||||
* `---------------------- '
|
* `---------------------- '
|
||||||
*/
|
*/
|
||||||
[3] = KEYMAP( /* GAMING */
|
[3] = LAYOUT( /* GAMING */
|
||||||
LT(4, KC_ESC), KC_1, KC_2, KC_3, \
|
LT(4, KC_ESC), KC_1, KC_2, KC_3, \
|
||||||
KC_TAB, KC_Q, KC_W, KC_E, \
|
KC_TAB, KC_Q, KC_W, KC_E, \
|
||||||
KC_LSFT, KC_A, KC_S, KC_D, \
|
KC_LSFT, KC_A, KC_S, KC_D, \
|
||||||
@@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
* |TOGGL|MODE | | |
|
* |TOGGL|MODE | | |
|
||||||
* `---------------------- '
|
* `---------------------- '
|
||||||
*/
|
*/
|
||||||
[4] = KEYMAP( /* NUMPAD SUPPLEMENT */
|
[4] = LAYOUT( /* NUMPAD SUPPLEMENT */
|
||||||
KC_NO, KC_NO, KC_NO, KC_NO, \
|
KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||||
KC_NO, KC_NO, KC_NO, KC_NO, \
|
KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||||
KC_NO, KC_NO, KC_NO, KC_NO, \
|
KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// The following is an example using the Planck MIT layout
|
// The following is an example using the Planck MIT layout
|
||||||
// The first section contains all of the arguements
|
// The first section contains all of the arguements
|
||||||
// The second converts the arguments into a two-dimensional array
|
// The second converts the arguments into a two-dimensional array
|
||||||
#define KEYMAP( \
|
#define LAYOUT( \
|
||||||
k00, k01, k02, k03, \
|
k00, k01, k02, k03, \
|
||||||
k10, k11, k12, k13, \
|
k10, k11, k12, k13, \
|
||||||
k20, k21, k22, k23, \
|
k20, k21, k22, k23, \
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
* @details Frequency of the system timer that drives the system ticks. This
|
* @details Frequency of the system timer that drives the system ticks. This
|
||||||
* setting also defines the system tick time unit.
|
* setting also defines the system tick time unit.
|
||||||
*/
|
*/
|
||||||
#define CH_CFG_ST_FREQUENCY 10000
|
#define CH_CFG_ST_FREQUENCY 100000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Time delta constant for the tick-less mode.
|
* @brief Time delta constant for the tick-less mode.
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
#include "../config.h"
|
|
||||||
|
|
||||||
#define TAPPING_TERM 600 // ms
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "arrow.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef ARROW_H
|
||||||
|
#define ARROW_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_all( \
|
||||||
|
K00, K01, K02, \
|
||||||
|
K10, K11, K12, \
|
||||||
|
\
|
||||||
|
K31, \
|
||||||
|
K40, K41, K42 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02 }, \
|
||||||
|
{ K10, K11, K12 }, \
|
||||||
|
{ XXX, XXX, XXX }, \
|
||||||
|
{ XXX, K31, XXX }, \
|
||||||
|
{ K40, K41, K42 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1012
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Arrow
|
||||||
|
#define DESCRIPTION Arrow cluster of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B0, C7, C6, B6, B4 }
|
||||||
|
#define MATRIX_COL_PINS { F0, B7, D2 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Arrow Cluster",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 3,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_all": {
|
||||||
|
"layout": [{"label":"Insert", "x":0, "y":0}, {"label":"Home", "x":1, "y":0}, {"label":"PgUp", "x":2, "y":0}, {"label":"Delete", "x":0, "y":1}, {"label":"End", "x":1, "y":1}, {"label":"PgDn", "x":2, "y":1}, {"label":"\u2191", "x":1, "y":3}, {"label":"\u2190", "x":0, "y":4}, {"label":"\u2193", "x":1, "y":4}, {"label":"\u2192", "x":2, "y":4}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_all( /* Base */
|
||||||
|
KC_INS, KC_HOME, KC_PGUP, \
|
||||||
|
KC_DEL, KC_END, KC_PGDN, \
|
||||||
|
\
|
||||||
|
KC_UP, \
|
||||||
|
KC_LEFT, KC_DOWN, KC_RIGHT \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default ANSI keymap for DC01 Arrow cluster
|
||||||
|
|
||||||
|
When using the arrow module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2017 Danny Nguyen <danny@keeb.io>
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -14,33 +15,26 @@ GNU General Public License for more details.
|
|||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
* scan matrix
|
|
||||||
*/
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "matrix.h"
|
#include "matrix.h"
|
||||||
#include "split_util.h"
|
|
||||||
#include "pro_micro.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
#include "i2c_slave.h"
|
||||||
|
#include "lufa.h"
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
#define SLAVE_I2C_ADDRESS 0x23
|
||||||
#include "backlight.h"
|
|
||||||
extern backlight_config_t backlight_config;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
/* Set 0 if debouncing isn't needed */
|
||||||
# include "i2c.h"
|
|
||||||
#else // USE_SERIAL
|
|
||||||
# include "serial.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DEBOUNCING_DELAY
|
#ifndef DEBOUNCING_DELAY
|
||||||
# define DEBOUNCING_DELAY 5
|
# define DEBOUNCING_DELAY 5
|
||||||
@@ -56,26 +50,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||||
# define matrix_bitpop(i) bitpop(matrix[i])
|
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||||
# define ROW_SHIFTER ((uint8_t)1)
|
# define ROW_SHIFTER ((uint8_t)1)
|
||||||
#else
|
#elif (MATRIX_COLS <= 16)
|
||||||
# error "Currently only supports 8 COLS"
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
#endif
|
#endif
|
||||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
|
||||||
|
|
||||||
#define ERROR_DISCONNECT_COUNT 5
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
#define SERIAL_LED_ADDR 0x00
|
#endif
|
||||||
|
|
||||||
#define ROWS_PER_HAND (MATRIX_ROWS/2)
|
|
||||||
|
|
||||||
static uint8_t error_count = 0;
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* matrix state(1:on, 0:off) */
|
/* matrix state(1:on, 0:off) */
|
||||||
static matrix_row_t matrix[MATRIX_ROWS];
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
|
||||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||||
|
|
||||||
|
|
||||||
#if (DIODE_DIRECTION == COL2ROW)
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
static void init_cols(void);
|
static void init_cols(void);
|
||||||
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
@@ -90,6 +91,16 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
|||||||
static void select_col(uint8_t col);
|
static void select_col(uint8_t col);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_quantum(void) {
|
||||||
|
matrix_init_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_quantum(void) {
|
||||||
|
matrix_scan_kb();
|
||||||
|
}
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
void matrix_init_kb(void) {
|
void matrix_init_kb(void) {
|
||||||
matrix_init_user();
|
matrix_init_user();
|
||||||
@@ -109,27 +120,25 @@ void matrix_scan_user(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
uint8_t matrix_rows(void)
|
uint8_t matrix_rows(void) {
|
||||||
{
|
|
||||||
return MATRIX_ROWS;
|
return MATRIX_ROWS;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
uint8_t matrix_cols(void)
|
uint8_t matrix_cols(void) {
|
||||||
{
|
|
||||||
return MATRIX_COLS;
|
return MATRIX_COLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_init(void)
|
void matrix_init(void) {
|
||||||
{
|
|
||||||
debug_enable = true;
|
|
||||||
debug_matrix = true;
|
|
||||||
debug_mouse = true;
|
|
||||||
// initialize row and col
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
unselect_rows();
|
unselect_rows();
|
||||||
init_cols();
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
TX_RX_LED_INIT;
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
// initialize matrix state: all keys off
|
// initialize matrix state: all keys off
|
||||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
@@ -138,17 +147,16 @@ void matrix_init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
matrix_init_quantum();
|
matrix_init_quantum();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t _matrix_scan(void)
|
uint8_t matrix_scan(void)
|
||||||
{
|
{
|
||||||
int offset = isLeftHand ? 0 : (ROWS_PER_HAND);
|
|
||||||
#if (DIODE_DIRECTION == COL2ROW)
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
// Set row, read cols
|
// Set row, read cols
|
||||||
for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) {
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
# if (DEBOUNCING_DELAY > 0)
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row);
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
if (matrix_changed) {
|
if (matrix_changed) {
|
||||||
debouncing = true;
|
debouncing = true;
|
||||||
@@ -156,181 +164,82 @@ uint8_t _matrix_scan(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
read_cols_on_row(matrix+offset, current_row);
|
read_cols_on_row(matrix, current_row);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif (DIODE_DIRECTION == ROW2COL)
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
// Set col, read rows
|
// Set col, read rows
|
||||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||||
# if (DEBOUNCING_DELAY > 0)
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col);
|
bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
|
||||||
if (matrix_changed) {
|
if (matrix_changed) {
|
||||||
debouncing = true;
|
debouncing = true;
|
||||||
debouncing_time = timer_read();
|
debouncing_time = timer_read();
|
||||||
}
|
}
|
||||||
# else
|
# else
|
||||||
read_rows_on_col(matrix+offset, current_col);
|
read_rows_on_col(matrix, current_col);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# if (DEBOUNCING_DELAY > 0)
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
for (uint8_t i = 0; i < ROWS_PER_HAND; i++) {
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
matrix[i+offset] = matrix_debouncing[i+offset];
|
matrix[i] = matrix_debouncing[i];
|
||||||
}
|
}
|
||||||
debouncing = false;
|
debouncing = false;
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
return 1;
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
}
|
txbuffer[1] = 0x55;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++){
|
||||||
#ifdef USE_I2C
|
txbuffer[i+2] = matrix[i]; //send matrix over i2c
|
||||||
|
|
||||||
// Get rows from other half over i2c
|
|
||||||
int i2c_transaction(void) {
|
|
||||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
|
||||||
|
|
||||||
int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE);
|
|
||||||
if (err) goto i2c_error;
|
|
||||||
|
|
||||||
// start of matrix stored at 0x00
|
|
||||||
err = i2c_master_write(0x00);
|
|
||||||
if (err) goto i2c_error;
|
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Write backlight level for slave to read
|
|
||||||
err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0);
|
|
||||||
#else
|
|
||||||
// Write zero, so our byte index is the same
|
|
||||||
err = i2c_master_write(0x00);
|
|
||||||
#endif
|
|
||||||
if (err) goto i2c_error;
|
|
||||||
|
|
||||||
// Start read
|
|
||||||
err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ);
|
|
||||||
if (err) goto i2c_error;
|
|
||||||
|
|
||||||
if (!err) {
|
|
||||||
int i;
|
|
||||||
for (i = 0; i < ROWS_PER_HAND-1; ++i) {
|
|
||||||
matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
|
|
||||||
}
|
|
||||||
matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
|
|
||||||
i2c_master_stop();
|
|
||||||
} else {
|
|
||||||
i2c_error: // the cable is disconnceted, or something else went wrong
|
|
||||||
i2c_reset_state();
|
|
||||||
return err;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#else // USE_SERIAL
|
|
||||||
|
|
||||||
int serial_transaction(void) {
|
|
||||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
|
||||||
|
|
||||||
if (serial_update_buffers()) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
matrix[slaveOffset+i] = serial_slave_buffer[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Write backlight level for slave to read
|
|
||||||
serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0;
|
|
||||||
#endif
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint8_t matrix_scan(void)
|
|
||||||
{
|
|
||||||
uint8_t ret = _matrix_scan();
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
if( i2c_transaction() ) {
|
|
||||||
#else // USE_SERIAL
|
|
||||||
if( serial_transaction() ) {
|
|
||||||
#endif
|
|
||||||
// turn on the indicator led when halves are disconnected
|
|
||||||
TXLED1;
|
|
||||||
|
|
||||||
error_count++;
|
|
||||||
|
|
||||||
if (error_count > ERROR_DISCONNECT_COUNT) {
|
|
||||||
// reset other half if disconnected
|
|
||||||
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
matrix[slaveOffset+i] = 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// turn off the indicator led on no error
|
|
||||||
TXLED0;
|
|
||||||
error_count = 0;
|
|
||||||
}
|
|
||||||
matrix_scan_quantum();
|
matrix_scan_quantum();
|
||||||
return ret;
|
return 1;
|
||||||
}
|
|
||||||
|
|
||||||
void matrix_slave_scan(void) {
|
|
||||||
_matrix_scan();
|
|
||||||
|
|
||||||
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
|
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Read backlight level sent from master and update level on slave
|
|
||||||
backlight_set(i2c_slave_buffer[0]);
|
|
||||||
#endif
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
i2c_slave_buffer[i+1] = matrix[offset+i];
|
|
||||||
}
|
|
||||||
#else // USE_SERIAL
|
|
||||||
for (int i = 0; i < ROWS_PER_HAND; ++i) {
|
|
||||||
serial_slave_buffer[i] = matrix[offset+i];
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef BACKLIGHT_ENABLE
|
|
||||||
// Read backlight level sent from master and update level on slave
|
|
||||||
backlight_set(serial_master_buffer[SERIAL_LED_ADDR]);
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool matrix_is_modified(void)
|
bool matrix_is_modified(void)
|
||||||
{
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
if (debouncing) return false;
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||||
{
|
{
|
||||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
return (matrix[row] & ((matrix_row_t)1<col));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline
|
inline
|
||||||
matrix_row_t matrix_get_row(uint8_t row)
|
matrix_row_t matrix_get_row(uint8_t row)
|
||||||
{
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
return matrix[row];
|
return matrix[row];
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void matrix_print(void)
|
void matrix_print(void)
|
||||||
{
|
{
|
||||||
print("\nr/c 0123456789ABCDEF\n");
|
print_matrix_header();
|
||||||
|
|
||||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
phex(row); print(": ");
|
phex(row); print(": ");
|
||||||
pbin_reverse16(matrix_get_row(row));
|
print_matrix_row(row);
|
||||||
print("\n");
|
print("\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -339,11 +248,13 @@ uint8_t matrix_key_count(void)
|
|||||||
{
|
{
|
||||||
uint8_t count = 0;
|
uint8_t count = 0;
|
||||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
count += bitpop16(matrix[i]);
|
count += matrix_bitpop(i);
|
||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if (DIODE_DIRECTION == COL2ROW)
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
static void init_cols(void)
|
static void init_cols(void)
|
||||||
@@ -400,7 +311,7 @@ static void unselect_row(uint8_t row)
|
|||||||
|
|
||||||
static void unselect_rows(void)
|
static void unselect_rows(void)
|
||||||
{
|
{
|
||||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
uint8_t pin = row_pins[x];
|
uint8_t pin = row_pins[x];
|
||||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
@@ -411,7 +322,7 @@ static void unselect_rows(void)
|
|||||||
|
|
||||||
static void init_rows(void)
|
static void init_rows(void)
|
||||||
{
|
{
|
||||||
for(uint8_t x = 0; x < ROWS_PER_HAND; x++) {
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
uint8_t pin = row_pins[x];
|
uint8_t pin = row_pins[x];
|
||||||
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
@@ -427,7 +338,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
|||||||
wait_us(30);
|
wait_us(30);
|
||||||
|
|
||||||
// For each row...
|
// For each row...
|
||||||
for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++)
|
for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Store last value of row prior to reading
|
// Store last value of row prior to reading
|
||||||
@@ -482,3 +393,12 @@ static void unselect_cols(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
|
||||||
|
sei(); //enable interupts
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Arrow Cluster
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the arrow cluster.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/arrow:default
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_slave.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
@@ -0,0 +1,152 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1010
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Left
|
||||||
|
#define DESCRIPTION Left half of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 21
|
||||||
|
#define MATRIX_COLS_SCANNED 6
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { B6, B5, B4, D7, D6 }
|
||||||
|
#define MATRIX_COL_PINS { F4, F1, F0, F7, F6, F5 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
@@ -6,8 +6,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
|
||||||
#ifdef USE_I2C
|
|
||||||
|
|
||||||
// Limits the amount of we wait for any one i2c transaction.
|
// Limits the amount of we wait for any one i2c transaction.
|
||||||
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
|
// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is
|
||||||
// 9 bits, a single transaction will take around 90μs to complete.
|
// 9 bits, a single transaction will take around 90μs to complete.
|
||||||
@@ -159,4 +157,3 @@ ISR(TWI_vect) {
|
|||||||
// Reset everything, so we are ready for the next TWI interrupt
|
// Reset everything, so we are ready for the next TWI interrupt
|
||||||
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#ifndef I2C_H
|
||||||
|
#define I2C_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifndef F_CPU
|
||||||
|
#define F_CPU 16000000UL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define I2C_READ 1
|
||||||
|
#define I2C_WRITE 0
|
||||||
|
|
||||||
|
#define I2C_ACK 1
|
||||||
|
#define I2C_NACK 0
|
||||||
|
|
||||||
|
#define SLAVE_BUFFER_SIZE 0x10
|
||||||
|
|
||||||
|
// i2c SCL clock frequency
|
||||||
|
#define SCL_CLOCK 400000L
|
||||||
|
|
||||||
|
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
|
||||||
|
|
||||||
|
void i2c_master_init(void);
|
||||||
|
uint8_t i2c_master_start(uint8_t address);
|
||||||
|
void i2c_master_stop(void);
|
||||||
|
uint8_t i2c_master_write(uint8_t data);
|
||||||
|
uint8_t i2c_master_read(int);
|
||||||
|
void i2c_reset_state(void);
|
||||||
|
void i2c_slave_init(uint8_t address);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Left Half",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 22.5,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_ansi": {
|
||||||
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Home", "x":16.25, "y":0}, {"label":"PgUp", "x":17.25, "y":0}, {"label":"Num Lock", "x":18.5, "y":0}, {"label":"/", "x":19.5, "y":0}, {"label":"*", "x":20.5, "y":0}, {"label":"-", "x":21.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15.25, "y":1}, {"label":"End", "x":16.25, "y":1}, {"label":"PgDn", "x":17.25, "y":1}, {"label":"7", "x":18.5, "y":1}, {"label":"8", "x":19.5, "y":1}, {"label":"9", "x":20.5, "y":1}, {"label":"+", "x":21.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":18.5, "y":2}, {"label":"5", "x":19.5, "y":2}, {"label":"6", "x":20.5, "y":2}, {"label":"KC_NO", "x":21.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"\u2191", "x":16.25, "y":3}, {"label":"1", "x":18.5, "y":3}, {"label":"2", "x":19.5, "y":3}, {"label":"3", "x":20.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}, {"label":"\u2190", "x":15.25, "y":4}, {"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}, {"label":"0", "x":18.5, "y":4}, {"label":"KC_NO", "x":19.5, "y":4}, {"label":".", "x":20.5, "y":4}, {"label":"Enter", "x":21.5, "y":3, "h":2}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ansi( /* Base */
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, \
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_NO, \
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_NO, KC_PDOT, KC_PENT \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# The default ANSI keymap for DC01 Left
|
||||||
|
|
||||||
|
The keymap looks like a full layout keymap.
|
||||||
|
|
||||||
|
This is because the left part of the keyboard acts as the masterm coordinating all four part.
|
||||||
|
|
||||||
|
When using the keyboard to connect the other three parts, this keymap overwrites the individual keymaps of the single modules.
|
||||||
|
|
||||||
|
When using a module individually, the keymap of that module will take effect.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "left.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef LEFT_H
|
||||||
|
#define LEFT_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_ansi( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K45, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, K2H, K2J, K2K, K2L, \
|
||||||
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, K3F, K3H, K3J, K3K, \
|
||||||
|
K40, K41, K42, K43, K46, K47, K48, K49, K4A, K4B, K4E, K4F, K4G, K4H, K4J, K4K, K4L \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, XXX, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0J, K0K, K0L }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1J, K1K, K1L }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, K2D, XXX, XXX, XXX, K2H, K2J, K2K, K2L }, \
|
||||||
|
{ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, XXX, K3D, XXX, K3F, XXX, K3H, K3J, K3K, XXX }, \
|
||||||
|
{ K40, K41, K42, K43, XXX, K45, K46, K47, K48, K49, K4A, K4B, XXX, XXX, K4E, K4F, K4G, K4H, K4J, K4K, K4L } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,479 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "i2c_master.h"
|
||||||
|
|
||||||
|
#define SLAVE_I2C_ADDRESS_RIGHT 0x19
|
||||||
|
#define SLAVE_I2C_ADDRESS_NUMPAD 0x21
|
||||||
|
#define SLAVE_I2C_ADDRESS_ARROW 0x23
|
||||||
|
|
||||||
|
#define ERROR_DISCONNECT_COUNT 5
|
||||||
|
static uint8_t error_count_right = 0;
|
||||||
|
static uint8_t error_count_numpad = 0;
|
||||||
|
static uint8_t error_count_arrow = 0;
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
|
||||||
|
#ifndef DEBOUNCING_DELAY
|
||||||
|
# define DEBOUNCING_DELAY 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
static uint16_t debouncing_time;
|
||||||
|
static bool debouncing = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (MATRIX_COLS <= 8)
|
||||||
|
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint8_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 16)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const uint8_t col_pins[MATRIX_COLS_SCANNED] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* matrix state(1:on, 0:off) */
|
||||||
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
|
||||||
|
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static void init_cols(void);
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
|
static void unselect_rows(void);
|
||||||
|
static void select_row(uint8_t row);
|
||||||
|
static void unselect_row(uint8_t row);
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
static void init_rows(void);
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||||
|
static void unselect_cols(void);
|
||||||
|
static void unselect_col(uint8_t col);
|
||||||
|
static void select_col(uint8_t col);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_quantum(void) {
|
||||||
|
matrix_init_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_quantum(void) {
|
||||||
|
matrix_scan_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_rows(void) {
|
||||||
|
return MATRIX_ROWS;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_cols(void) {
|
||||||
|
return MATRIX_COLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset);
|
||||||
|
//uint8_t i2c_transaction_numpad(void);
|
||||||
|
//uint8_t i2c_transaction_arrow(void);
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
i2c_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
|
||||||
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
unselect_rows();
|
||||||
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
matrix_debouncing[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
read_cols_on_row(matrix, current_row);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
// Set col, read rows
|
||||||
|
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
read_rows_on_col(matrix, current_col);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (i2c_transaction(SLAVE_I2C_ADDRESS_RIGHT, 0x3F, 0)){ //error has occured for main right half
|
||||||
|
error_count_right++;
|
||||||
|
if (error_count_right > ERROR_DISCONNECT_COUNT){ //disconnect half
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS ; i++) {
|
||||||
|
matrix[i] &= 0x3F; //mask bits to keep
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{ //no error
|
||||||
|
error_count_right = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i2c_transaction(SLAVE_I2C_ADDRESS_ARROW, 0X3FFF, 8)){ //error has occured for arrow cluster
|
||||||
|
error_count_arrow++;
|
||||||
|
if (error_count_arrow > ERROR_DISCONNECT_COUNT){ //disconnect arrow cluster
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS ; i++) {
|
||||||
|
matrix[i] &= 0x3FFF; //mask bits to keep
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{ //no error
|
||||||
|
error_count_arrow = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i2c_transaction(SLAVE_I2C_ADDRESS_NUMPAD, 0x1FFFF, 11)){ //error has occured for numpad
|
||||||
|
error_count_numpad++;
|
||||||
|
if (error_count_numpad > ERROR_DISCONNECT_COUNT){ //disconnect numpad
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS ; i++) {
|
||||||
|
matrix[i] &= 0x1FFFF; //mask bits to keep
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{ //no error
|
||||||
|
error_count_numpad = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_is_modified(void)
|
||||||
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||||
|
{
|
||||||
|
return (matrix[row] & ((matrix_row_t)1<col));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
matrix_row_t matrix_get_row(uint8_t row)
|
||||||
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void)
|
||||||
|
{
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_key_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
count += matrix_bitpop(i);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
static void init_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS_SCANNED; x++) {
|
||||||
|
uint8_t pin = col_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||||
|
{
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[current_row];
|
||||||
|
|
||||||
|
// Clear data in matrix row
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
// Select row and wait for row selecton to stabilize
|
||||||
|
select_row(current_row);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each col...
|
||||||
|
for(uint8_t col_index = 0; col_index < MATRIX_COLS_SCANNED; col_index++) {
|
||||||
|
|
||||||
|
// Select the col pin to read (active low)
|
||||||
|
uint8_t pin = col_pins[col_index];
|
||||||
|
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||||
|
|
||||||
|
// Populate the matrix row with the state of the col pin
|
||||||
|
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect row
|
||||||
|
unselect_row(current_row);
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void select_row(uint8_t row)
|
||||||
|
{
|
||||||
|
uint8_t pin = row_pins[row];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_row(uint8_t row)
|
||||||
|
{
|
||||||
|
uint8_t pin = row_pins[row];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_rows(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
uint8_t pin = row_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
static void init_rows(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
uint8_t pin = row_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||||
|
{
|
||||||
|
bool matrix_changed = false;
|
||||||
|
|
||||||
|
// Select col and wait for col selecton to stabilize
|
||||||
|
select_col(current_col);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each row...
|
||||||
|
for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[row_index];
|
||||||
|
|
||||||
|
// Check row pin state
|
||||||
|
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||||
|
{
|
||||||
|
// Pin LO, set col bit
|
||||||
|
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Pin HI, clear col bit
|
||||||
|
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the matrix changed state
|
||||||
|
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||||
|
{
|
||||||
|
matrix_changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect col
|
||||||
|
unselect_col(current_col);
|
||||||
|
|
||||||
|
return matrix_changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void select_col(uint8_t col)
|
||||||
|
{
|
||||||
|
uint8_t pin = col_pins[col];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_col(uint8_t col)
|
||||||
|
{
|
||||||
|
uint8_t pin = col_pins[col];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS_SCANNED; x++) {
|
||||||
|
uint8_t pin = col_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Complete rows from other modules over i2c
|
||||||
|
i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) {
|
||||||
|
i2c_status_t err = i2c_start((address << 1) | I2C_WRITE, 10);
|
||||||
|
if (err) return err;
|
||||||
|
i2c_write(0x01, 10);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
i2c_start((address << 1) | I2C_READ, 10);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
err = i2c_read_ack(10);
|
||||||
|
if (err == 0x55) { //synchronization byte
|
||||||
|
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble slave matrix in main matrix
|
||||||
|
matrix[i] &= mask; //mask bits to keep
|
||||||
|
err = i2c_read_ack(10);
|
||||||
|
if (err >= 0) {
|
||||||
|
matrix[i] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end
|
||||||
|
} else {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//last read request must be followed by a NACK
|
||||||
|
matrix[MATRIX_ROWS - 1] &= mask; //mask bits to keep
|
||||||
|
err = i2c_read_nack(10);
|
||||||
|
if (err >= 0) {
|
||||||
|
matrix[MATRIX_ROWS - 1] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end
|
||||||
|
} else {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
i2c_stop(10);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
i2c_stop(10);
|
||||||
|
if (err) return err;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Left Half
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the left part that also acts as the master.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/left:default
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_master.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1013
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Numpad
|
||||||
|
#define DESCRIPTION Numpad of DC01 keyboard
|
||||||
|
|
||||||
|
/* 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 { B0, E6, D6, D7, B4 }
|
||||||
|
#define MATRIX_COL_PINS { F0, B7, D2, D3 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Numpad",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"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}, {"label":"00", "x":1, "y":4}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_numpad_5x4(
|
||||||
|
TG(1), 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 \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_numpad_5x4(
|
||||||
|
_______, _______, _______, _______, \
|
||||||
|
KC_HOME, KC_UP, KC_PGUP, \
|
||||||
|
KC_LEFT, XXXXXXX, KC_RGHT, _______, \
|
||||||
|
KC_END, KC_DOWN, KC_PGDN, \
|
||||||
|
KC_INS, KC_DEL, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default keymap for DC01 Numpad
|
||||||
|
|
||||||
|
When using the numpad module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
KC_P00 = SAFE_RANGE
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ortho_5x4(
|
||||||
|
TG(1), KC_PSLS, KC_PAST, KC_PMNS, \
|
||||||
|
KC_P7, KC_P8, KC_P9, KC_PPLS, \
|
||||||
|
KC_P4, KC_P5, KC_P6, KC_PPLS, \
|
||||||
|
KC_P1, KC_P2, KC_P3, KC_PENT, \
|
||||||
|
KC_P0, KC_P00, KC_PDOT, KC_PENT \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_ortho_5x4(
|
||||||
|
_______, _______, _______, _______, \
|
||||||
|
KC_HOME, KC_UP, KC_PGUP, _______, \
|
||||||
|
KC_LEFT, XXXXXXX, KC_RGHT, _______, \
|
||||||
|
KC_END, KC_DOWN, KC_PGDN, _______, \
|
||||||
|
KC_INS, XXXXXXX, KC_DEL, _______ \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
if (record->event.pressed) {
|
||||||
|
switch(keycode) {
|
||||||
|
case KC_P00:
|
||||||
|
// types Numpad 0 twice
|
||||||
|
SEND_STRING(SS_TAP(X_KP_0) SS_TAP(X_KP_0));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The orthopad keymap for DC01 Numpad
|
||||||
|
|
||||||
|
When using the numpad module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,404 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "i2c_slave.h"
|
||||||
|
#include "lufa.h"
|
||||||
|
|
||||||
|
#define SLAVE_I2C_ADDRESS 0x21
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
|
||||||
|
#ifndef DEBOUNCING_DELAY
|
||||||
|
# define DEBOUNCING_DELAY 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
static uint16_t debouncing_time;
|
||||||
|
static bool debouncing = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (MATRIX_COLS <= 8)
|
||||||
|
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint8_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 16)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* matrix state(1:on, 0:off) */
|
||||||
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
|
||||||
|
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static void init_cols(void);
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
|
static void unselect_rows(void);
|
||||||
|
static void select_row(uint8_t row);
|
||||||
|
static void unselect_row(uint8_t row);
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
static void init_rows(void);
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||||
|
static void unselect_cols(void);
|
||||||
|
static void unselect_col(uint8_t col);
|
||||||
|
static void select_col(uint8_t col);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_quantum(void) {
|
||||||
|
matrix_init_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_quantum(void) {
|
||||||
|
matrix_scan_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_rows(void) {
|
||||||
|
return MATRIX_ROWS;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_cols(void) {
|
||||||
|
return MATRIX_COLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
|
||||||
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
unselect_rows();
|
||||||
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
matrix_debouncing[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void)
|
||||||
|
{
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
read_cols_on_row(matrix, current_row);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
// Set col, read rows
|
||||||
|
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
read_rows_on_col(matrix, current_col);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
txbuffer[1] = 0x55;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++){
|
||||||
|
txbuffer[i+2] = matrix[i]; //send matrix over i2c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_is_modified(void)
|
||||||
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||||
|
{
|
||||||
|
return (matrix[row] & ((matrix_row_t)1<col));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
matrix_row_t matrix_get_row(uint8_t row)
|
||||||
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void)
|
||||||
|
{
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_key_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
count += matrix_bitpop(i);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
static void init_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||||
|
uint8_t pin = col_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||||
|
{
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[current_row];
|
||||||
|
|
||||||
|
// Clear data in matrix row
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
// Select row and wait for row selecton to stabilize
|
||||||
|
select_row(current_row);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each col...
|
||||||
|
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||||
|
|
||||||
|
// Select the col pin to read (active low)
|
||||||
|
uint8_t pin = col_pins[col_index];
|
||||||
|
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||||
|
|
||||||
|
// Populate the matrix row with the state of the col pin
|
||||||
|
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect row
|
||||||
|
unselect_row(current_row);
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void select_row(uint8_t row)
|
||||||
|
{
|
||||||
|
uint8_t pin = row_pins[row];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_row(uint8_t row)
|
||||||
|
{
|
||||||
|
uint8_t pin = row_pins[row];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_rows(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
uint8_t pin = row_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
static void init_rows(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
uint8_t pin = row_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||||
|
{
|
||||||
|
bool matrix_changed = false;
|
||||||
|
|
||||||
|
// Select col and wait for col selecton to stabilize
|
||||||
|
select_col(current_col);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each row...
|
||||||
|
for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[row_index];
|
||||||
|
|
||||||
|
// Check row pin state
|
||||||
|
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||||
|
{
|
||||||
|
// Pin LO, set col bit
|
||||||
|
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Pin HI, clear col bit
|
||||||
|
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the matrix changed state
|
||||||
|
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||||
|
{
|
||||||
|
matrix_changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect col
|
||||||
|
unselect_col(current_col);
|
||||||
|
|
||||||
|
return matrix_changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void select_col(uint8_t col)
|
||||||
|
{
|
||||||
|
uint8_t pin = col_pins[col];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_col(uint8_t col)
|
||||||
|
{
|
||||||
|
uint8_t pin = col_pins[col];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||||
|
uint8_t pin = col_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
|
||||||
|
sei(); //enable interupts
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 REPLACE_WITH_YOUR_NAME
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "numpad.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef NUMPAD_H
|
||||||
|
#define NUMPAD_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// 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, K43 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03 }, \
|
||||||
|
{ K10, K11, K12, K13 }, \
|
||||||
|
{ K20, K21, K22, XXX }, \
|
||||||
|
{ K30, K31, K32, XXX }, \
|
||||||
|
{ K40, XXX, K42, K43 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#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 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Numpad
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the numpad.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/numpad:default
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_slave.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
|
|
||||||
|
# Community layouts supported
|
||||||
|
LAYOUTS = numpad_5x4 ortho_5x4
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Yiancar
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x1011
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Mechboards
|
||||||
|
#define PRODUCT DC01 Right
|
||||||
|
#define DESCRIPTION Right half of DC01 keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 8
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { C7, C6, B6, B5, B4 }
|
||||||
|
#define MATRIX_COL_PINS { F1, E6, F6, F5, F4, D4, D6, D7 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "DC01 Right Half",
|
||||||
|
"url": "",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 8.5,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_ansi": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0, "w":2}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"|", "x":7, "y":1, "w":1.5}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"\"", "x":5.25, "y":2}, {"label":"Enter", "x":6.25, "y":2, "w":2.25}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"Alt", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
|
"LAYOUT_iso": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0, "w":2}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"@", "x":5.25, "y":2}, {"label":"~", "x":6.25, "y":2}, {"label":"Enter", "x":7.25, "y":1, "w":1.25, "h":2}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"AltGr", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
|
"LAYOUT_hhkb_ansi": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"Backspace", "x":6.5, "y":0}, {"label":"~", "x":7.5, "y":0}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"|", "x":7, "y":1, "w":1.5}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"\"", "x":5.25, "y":2}, {"label":"Enter", "x":6.25, "y":2, "w":2.25}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":1.75}, {"label":"Fn", "x":7.5, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"Alt", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
},
|
||||||
|
"LAYOUT_hhkb_iso": {
|
||||||
|
"layout": [{"label":"&", "x":0.5, "y":0}, {"label":"*", "x":1.5, "y":0}, {"label":"(", "x":2.5, "y":0}, {"label":")", "x":3.5, "y":0}, {"label":"_", "x":4.5, "y":0}, {"label":"+", "x":5.5, "y":0}, {"label":"|", "x":6.5, "y":0}, {"label":"Backspace", "x":7.5, "y":0}, {"label":"Y", "x":0, "y":1}, {"label":"U", "x":1, "y":1}, {"label":"I", "x":2, "y":1}, {"label":"O", "x":3, "y":1}, {"label":"P", "x":4, "y":1}, {"label":"{", "x":5, "y":1}, {"label":"}", "x":6, "y":1}, {"label":"H", "x":0.25, "y":2}, {"label":"J", "x":1.25, "y":2}, {"label":"K", "x":2.25, "y":2}, {"label":"L", "x":3.25, "y":2}, {"label":":", "x":4.25, "y":2}, {"label":"@", "x":5.25, "y":2}, {"label":"~", "x":6.25, "y":2}, {"label":"Enter", "x":7.25, "y":1, "w":1.25, "h":2}, {"label":"N", "x":0.75, "y":3}, {"label":"M", "x":1.75, "y":3}, {"label":"<", "x":2.75, "y":3}, {"label":">", "x":3.75, "y":3}, {"label":"?", "x":4.75, "y":3}, {"label":"Shift", "x":5.75, "y":3, "w":1.75}, {"label":"Fn", "x":7.5, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":2.25}, {"label":"AltGr", "x":3.5, "y":4, "w":1.25}, {"label":"GUI", "x":4.75, "y":4, "w":1.25}, {"label":"Menu", "x":6, "y":4, "w":1.25}, {"label":"Ctrl", "x":7.25, "y":4, "w":1.25}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ansi( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSLS, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default ANSI keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_hhkb_ansi( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC,KC_BSPC, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(1), \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_hhkb_ansi(
|
||||||
|
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||||
|
KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \
|
||||||
|
KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \
|
||||||
|
KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default HHKB ANSI keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_hhkb_iso( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_BSPC, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,MO(1), \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_hhkb_iso(
|
||||||
|
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, \
|
||||||
|
KC_TRNS,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, \
|
||||||
|
KC_PAST,KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_PENT, \
|
||||||
|
KC_PPLS,KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default HHKB ISO keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_iso( /* Base */
|
||||||
|
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \
|
||||||
|
KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, \
|
||||||
|
KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS,KC_ENT, \
|
||||||
|
KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \
|
||||||
|
KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RGUI, KC_RCTL \
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The default ISO keymap for DC01 Right
|
||||||
|
|
||||||
|
When using the right module individually, this keymap will take effect. When using the keyboard as a whole please edit the keymap of the left module.
|
||||||
@@ -0,0 +1,404 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2012 Jun Wako
|
||||||
|
Copyright 2014 Jack Humbert
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#if defined(__AVR__)
|
||||||
|
#include <avr/io.h>
|
||||||
|
#include <avr/wdt.h>
|
||||||
|
#include <avr/interrupt.h>
|
||||||
|
#include <util/delay.h>
|
||||||
|
#endif
|
||||||
|
#include "wait.h"
|
||||||
|
#include "print.h"
|
||||||
|
#include "debug.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "matrix.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "i2c_slave.h"
|
||||||
|
#include "lufa.h"
|
||||||
|
|
||||||
|
#define SLAVE_I2C_ADDRESS 0x19
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
|
||||||
|
#ifndef DEBOUNCING_DELAY
|
||||||
|
# define DEBOUNCING_DELAY 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
static uint16_t debouncing_time;
|
||||||
|
static bool debouncing = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (MATRIX_COLS <= 8)
|
||||||
|
# define print_matrix_header() print("\nr/c 01234567\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint8_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 16)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop16(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint16_t)1)
|
||||||
|
#elif (MATRIX_COLS <= 32)
|
||||||
|
# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n")
|
||||||
|
# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row))
|
||||||
|
# define matrix_bitpop(i) bitpop32(matrix[i])
|
||||||
|
# define ROW_SHIFTER ((uint32_t)1)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
extern const matrix_row_t matrix_mask[];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||||
|
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* matrix state(1:on, 0:off) */
|
||||||
|
static matrix_row_t matrix[MATRIX_ROWS];
|
||||||
|
|
||||||
|
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
static void init_cols(void);
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row);
|
||||||
|
static void unselect_rows(void);
|
||||||
|
static void select_row(uint8_t row);
|
||||||
|
static void unselect_row(uint8_t row);
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
static void init_rows(void);
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
|
||||||
|
static void unselect_cols(void);
|
||||||
|
static void unselect_col(uint8_t col);
|
||||||
|
static void select_col(uint8_t col);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_quantum(void) {
|
||||||
|
matrix_init_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_quantum(void) {
|
||||||
|
matrix_scan_kb();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__ ((weak))
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_rows(void) {
|
||||||
|
return MATRIX_ROWS;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
uint8_t matrix_cols(void) {
|
||||||
|
return MATRIX_COLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_init(void) {
|
||||||
|
|
||||||
|
// initialize row and col
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
unselect_rows();
|
||||||
|
init_cols();
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
unselect_cols();
|
||||||
|
init_rows();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// initialize matrix state: all keys off
|
||||||
|
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = 0;
|
||||||
|
matrix_debouncing[i] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_init_quantum();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_scan(void)
|
||||||
|
{
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
// Set row, read cols
|
||||||
|
for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_cols_on_row(matrix_debouncing, current_row);
|
||||||
|
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
|
||||||
|
# else
|
||||||
|
read_cols_on_row(matrix, current_row);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
// Set col, read rows
|
||||||
|
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
bool matrix_changed = read_rows_on_col(matrix_debouncing, current_col);
|
||||||
|
if (matrix_changed) {
|
||||||
|
debouncing = true;
|
||||||
|
debouncing_time = timer_read();
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
read_rows_on_col(matrix, current_col);
|
||||||
|
# endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
# if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) {
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
matrix[i] = matrix_debouncing[i];
|
||||||
|
}
|
||||||
|
debouncing = false;
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
txbuffer[1] = 0x55;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++){
|
||||||
|
txbuffer[i+2] = matrix[i]; //send matrix over i2c
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
matrix_scan_quantum();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool matrix_is_modified(void)
|
||||||
|
{
|
||||||
|
#if (DEBOUNCING_DELAY > 0)
|
||||||
|
if (debouncing) return false;
|
||||||
|
#endif
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||||
|
{
|
||||||
|
return (matrix[row] & ((matrix_row_t)1<col));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline
|
||||||
|
matrix_row_t matrix_get_row(uint8_t row)
|
||||||
|
{
|
||||||
|
// Matrix mask lets you disable switches in the returned matrix data. For example, if you have a
|
||||||
|
// switch blocker installed and the switch is always pressed.
|
||||||
|
#ifdef MATRIX_MASKED
|
||||||
|
return matrix[row] & matrix_mask[row];
|
||||||
|
#else
|
||||||
|
return matrix[row];
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_print(void)
|
||||||
|
{
|
||||||
|
print_matrix_header();
|
||||||
|
|
||||||
|
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||||
|
phex(row); print(": ");
|
||||||
|
print_matrix_row(row);
|
||||||
|
print("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t matrix_key_count(void)
|
||||||
|
{
|
||||||
|
uint8_t count = 0;
|
||||||
|
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||||
|
count += matrix_bitpop(i);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if (DIODE_DIRECTION == COL2ROW)
|
||||||
|
|
||||||
|
static void init_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||||
|
uint8_t pin = col_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
|
||||||
|
{
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[current_row];
|
||||||
|
|
||||||
|
// Clear data in matrix row
|
||||||
|
current_matrix[current_row] = 0;
|
||||||
|
|
||||||
|
// Select row and wait for row selecton to stabilize
|
||||||
|
select_row(current_row);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each col...
|
||||||
|
for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
|
||||||
|
|
||||||
|
// Select the col pin to read (active low)
|
||||||
|
uint8_t pin = col_pins[col_index];
|
||||||
|
uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF));
|
||||||
|
|
||||||
|
// Populate the matrix row with the state of the col pin
|
||||||
|
current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect row
|
||||||
|
unselect_row(current_row);
|
||||||
|
|
||||||
|
return (last_row_value != current_matrix[current_row]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void select_row(uint8_t row)
|
||||||
|
{
|
||||||
|
uint8_t pin = row_pins[row];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_row(uint8_t row)
|
||||||
|
{
|
||||||
|
uint8_t pin = row_pins[row];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_rows(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
uint8_t pin = row_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#elif (DIODE_DIRECTION == ROW2COL)
|
||||||
|
|
||||||
|
static void init_rows(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
|
||||||
|
uint8_t pin = row_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
|
||||||
|
{
|
||||||
|
bool matrix_changed = false;
|
||||||
|
|
||||||
|
// Select col and wait for col selecton to stabilize
|
||||||
|
select_col(current_col);
|
||||||
|
wait_us(30);
|
||||||
|
|
||||||
|
// For each row...
|
||||||
|
for(uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++)
|
||||||
|
{
|
||||||
|
|
||||||
|
// Store last value of row prior to reading
|
||||||
|
matrix_row_t last_row_value = current_matrix[row_index];
|
||||||
|
|
||||||
|
// Check row pin state
|
||||||
|
if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0)
|
||||||
|
{
|
||||||
|
// Pin LO, set col bit
|
||||||
|
current_matrix[row_index] |= (ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Pin HI, clear col bit
|
||||||
|
current_matrix[row_index] &= ~(ROW_SHIFTER << current_col);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the matrix changed state
|
||||||
|
if ((last_row_value != current_matrix[row_index]) && !(matrix_changed))
|
||||||
|
{
|
||||||
|
matrix_changed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unselect col
|
||||||
|
unselect_col(current_col);
|
||||||
|
|
||||||
|
return matrix_changed;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void select_col(uint8_t col)
|
||||||
|
{
|
||||||
|
uint8_t pin = col_pins[col];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT
|
||||||
|
_SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_col(uint8_t col)
|
||||||
|
{
|
||||||
|
uint8_t pin = col_pins[col];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unselect_cols(void)
|
||||||
|
{
|
||||||
|
for(uint8_t x = 0; x < MATRIX_COLS; x++) {
|
||||||
|
uint8_t pin = col_pins[x];
|
||||||
|
_SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN
|
||||||
|
_SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//this replases tmk code
|
||||||
|
void matrix_setup(void){
|
||||||
|
|
||||||
|
if (USB_DeviceState != DEVICE_STATE_Configured){
|
||||||
|
i2c_init(SLAVE_I2C_ADDRESS); //setup address of slave i2c
|
||||||
|
sei(); //enable interupts
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# DC01 Right Half
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A hotpluggable four part keyboard which comes together with magnets and pogo pins! This is the right part.
|
||||||
|
|
||||||
|
Keyboard Maintainer: [Yiancar](https://github.com/yiancar)
|
||||||
|
Hardware Supported: Runs on an atmega32u4
|
||||||
|
Hardware Availability: [Mechboards](https://mechboards.co.uk/)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make dc01/right:default
|
||||||
|
|
||||||
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "right.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
// put your keyboard start-up code here
|
||||||
|
// runs once when the firmware starts up
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_kb(void) {
|
||||||
|
// put your looping keyboard code here
|
||||||
|
// runs every cycle (a lot)
|
||||||
|
|
||||||
|
matrix_scan_user();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
// put your per-action keyboard code here
|
||||||
|
// runs for every action, just before processing by the firmware
|
||||||
|
|
||||||
|
return process_record_user(keycode, record);
|
||||||
|
}
|
||||||
|
|
||||||
|
void led_set_kb(uint8_t usb_led) {
|
||||||
|
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||||
|
|
||||||
|
led_set_user(usb_led);
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
/* Copyright 2018 Yiancar
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#ifndef RIGHT_H
|
||||||
|
#define RIGHT_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
// This a shortcut to help you visually see your layout.
|
||||||
|
// The first section contains all of the arguments
|
||||||
|
// The second converts the arguments into a two-dimensional array
|
||||||
|
#define LAYOUT_ansi( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ XXX, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, XXX, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, XXX, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_iso( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ XXX, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, XXX }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, XXX, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_hhkb_ansi( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, K00, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K36, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, XXX, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, K36, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_hhkb_iso( \
|
||||||
|
K01, K02, K03, K04, K05, K06, K07, K00, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, \
|
||||||
|
K20, K21, K22, K23, K24, K25, K26, K27, \
|
||||||
|
K30, K31, K32, K33, K34, K36, K37, \
|
||||||
|
K40, K41, K42, K43, K44, K45 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, XXX }, \
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
|
||||||
|
{ K30, K31, K32, K33, K34, XXX, K36, K37 }, \
|
||||||
|
{ K40, K41, K42, K43, K44, K45, XXX, XXX } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
SRC += matrix.c \
|
||||||
|
../../../drivers/avr/i2c_slave.c
|
||||||
|
|
||||||
|
# MCU name
|
||||||
|
#MCU = at90usb1286
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Processor frequency.
|
||||||
|
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||||
|
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||||
|
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||||
|
# automatically to create a 32-bit value in your source code.
|
||||||
|
#
|
||||||
|
# This will be an integer division of F_USB below, as it is sourced by
|
||||||
|
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||||
|
# does not *change* the processor frequency - it should merely be updated to
|
||||||
|
# reflect the processor speed set externally so that the code can use accurate
|
||||||
|
# software delays.
|
||||||
|
F_CPU = 16000000
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# LUFA specific
|
||||||
|
#
|
||||||
|
# Target architecture (see library "Board Types" documentation).
|
||||||
|
ARCH = AVR8
|
||||||
|
|
||||||
|
# Input clock frequency.
|
||||||
|
# This will define a symbol, F_USB, in all source code files equal to the
|
||||||
|
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||||
|
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||||
|
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||||
|
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||||
|
# at the end, this will be done automatically to create a 32-bit value in your
|
||||||
|
# source code.
|
||||||
|
#
|
||||||
|
# If no clock division is performed on the input clock inside the AVR (via the
|
||||||
|
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||||
|
F_USB = $(F_CPU)
|
||||||
|
|
||||||
|
# Interrupt driven control endpoint task(+60)
|
||||||
|
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||||
|
|
||||||
|
|
||||||
|
# Boot Section Size in *bytes*
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
|
||||||
|
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
|
||||||
|
NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
|
||||||
|
CUSTOM_MATRIX = yes # Use custom matrix
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#pragma once
|
||||||
|
#define USB_MAX_POWER_CONSUMPTION 100
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
|
||||||
|
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
|
||||||
|
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_APP, KC_APP, KC_RCTL),
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL,
|
||||||
|
KC_CAPS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, RESET,
|
||||||
|
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______,
|
||||||
|
_______, KC_NO, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
|
||||||
|
};
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||||
|
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
|
||||||
|
} else {
|
||||||
|
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# Build Options
|
||||||
|
# comment out to disable the options.
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
AUDIO_ENABLE = no
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
|
||||||
|
LAYOUTS = 60_ansi
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "e6v2.h"
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#ifndef E6V2_H
|
|
||||||
#define E6V2_H
|
|
||||||
|
|
||||||
#include "quantum.h"
|
|
||||||
|
|
||||||
#ifdef KEYBOARD_e6v2_oe
|
|
||||||
#include "oe.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef KEYBOARD_e6v2_le
|
|
||||||
#include "le.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -7,6 +7,10 @@
|
|||||||
"layouts": {
|
"layouts": {
|
||||||
"LAYOUT": {
|
"LAYOUT": {
|
||||||
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.75}, {"label":"Ctrl", "x":1.75, "y":4, "w":1.25}, {"label":"Win", "x":3, "y":4, "w":1.25}, {"label":"Alt", "x":4.25, "y":4, "w":1.25}, {"x":5.5, "y":4, "w":2.75}, {"x":8.25, "y":4, "w":1.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}]
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.75}, {"label":"Ctrl", "x":1.75, "y":4, "w":1.25}, {"label":"Win", "x":3, "y":4, "w":1.25}, {"label":"Alt", "x":4.25, "y":4, "w":1.25}, {"x":5.5, "y":4, "w":2.75}, {"x":8.25, "y":4, "w":1.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}]
|
||||||
|
},
|
||||||
|
|
||||||
|
"LAYOUT_60_ansi": {
|
||||||
|
"layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-19
@@ -21,24 +21,13 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
|||||||
return process_record_user(keycode, record);
|
return process_record_user(keycode, record);
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_kb(uint8_t usb_led) {
|
void led_set_user(uint8_t usb_led) {
|
||||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||||
DDRB |= (1<<7);
|
DDRB |= (1 << 7);
|
||||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
PORTB &= ~(1 << 7);
|
||||||
// output low
|
} else {
|
||||||
DDRB |= (1<<2);
|
DDRB &= ~(1 << 7);
|
||||||
PORTB &= ~(1<<2);
|
PORTB &= ~(1 << 7);
|
||||||
} else {
|
|
||||||
// Hi-Z
|
|
||||||
DDRB &= ~(1<<2);
|
|
||||||
PORTB &= ~(1<<2);
|
|
||||||
}
|
|
||||||
if (usb_led == 0){
|
|
||||||
PORTB |= (1<<7);
|
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
PORTB &= ~(1<<7);
|
|
||||||
}
|
|
||||||
|
|
||||||
led_set_user(usb_led);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+18
-3
@@ -1,10 +1,10 @@
|
|||||||
#ifndef LE_H
|
#ifndef LE_H
|
||||||
#define LE_H
|
#define LE_H
|
||||||
|
|
||||||
#include "../e6v2.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#define LAYOUT( \
|
#define LAYOUT( \
|
||||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0D, \
|
||||||
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
||||||
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
|
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
|
||||||
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
|
K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \
|
||||||
@@ -18,4 +18,19 @@
|
|||||||
{ K40, KC_NO, K42, K43, K44, KC_NO, KC_NO, K47, KC_NO, K49, K4A, K4B, K4C, K4D, K4E }, \
|
{ K40, KC_NO, K42, K43, K44, KC_NO, KC_NO, K47, KC_NO, K49, K4A, K4B, K4C, K4D, K4E }, \
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#define LAYOUT_60_ansi( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||||
|
K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \
|
||||||
|
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \
|
||||||
|
K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \
|
||||||
|
K40, K42, K43, K47, K4A, K4B, K4D, K4E \
|
||||||
|
)\
|
||||||
|
{\
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, KC_NO }, \
|
||||||
|
{ K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \
|
||||||
|
{ K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \
|
||||||
|
{ K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO }, \
|
||||||
|
{ K40, KC_NO, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, K4B, KC_NO, K4D, K4E }, \
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
# E6-V2 Last Edition (LE)
|
# E6-V2 Last Edition (LE)
|
||||||
|
|
||||||
These docs are for the QMK version of the PCB. [More info on qmk.fm](http://qmk.fm/)
|
These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/)
|
||||||
|
|
||||||
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
|
||||||
Hardware Supported: E6-V2 LE Mid Port rev.qmk
|
Hardware Supported: E6-V2 LE Mid Port rev.qmk
|
||||||
Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0)
|
Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0)
|
||||||
|
|
||||||
|
**Please do not flash LE firmware on OE hardware.**
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
|||||||
@@ -66,3 +66,5 @@ MIDI_ENABLE = no # MIDI controls
|
|||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
AUDIO_ENABLE = no # Audio output on port C6
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
|
||||||
|
LAYOUTS = 60_ansi
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef OE_H
|
#ifndef OE_H
|
||||||
#define OE_H
|
#define OE_H
|
||||||
|
|
||||||
#include "../e6v2.h"
|
#include "quantum.h"
|
||||||
|
|
||||||
#define LAYOUT( \
|
#define LAYOUT( \
|
||||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
# E6-V2 Original Edition (OE)
|
# E6-V2 Original Edition (OE)
|
||||||
|
|
||||||
These docs are for the QMK version of the PCB. [More info on qmk.fm](http://qmk.fm/)
|
These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/)
|
||||||
|
|
||||||
Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287)
|
Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287)
|
||||||
Hardware Supported: E6-V2 OE Mid Port rev.qmk
|
Hardware Supported: E6-V2 OE Mid Port rev.qmk
|
||||||
Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0)
|
Hardware Availability: [geekhack.org/index.php?topic=90787.0](https://geekhack.org/index.php?topic=90787.0)
|
||||||
|
|
||||||
|
**Please do not flash OE firmware on LE hardware.**
|
||||||
|
|
||||||
Make example for this keyboard (after setting up your build environment):
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,20 @@
|
|||||||
# E6-V2
|
# E6-V2
|
||||||
|
|
||||||
These docs are for the QMK version of the PCB. [More info on qmk.fm](http://qmk.fm/)
|
The E6-V2 is a 60% keyboard manufactured by Exclusive.
|
||||||
|
|
||||||
|
### Round 1:
|
||||||
|
- ps2avrGB PCB and QMK powered PCB option (OE PCB)
|
||||||
|
- Center mount and side mount USB
|
||||||
|
|
||||||
|
### Round 2
|
||||||
|
- ps2avrGB PCB and QMK powered PCB option (LE PCB)
|
||||||
|
- Only center mount USB offered
|
||||||
|
- All brass option
|
||||||
|
|
||||||
|
These docs are for the QMK version of the E6-V2 PCB. [More info on qmk.fm](http://qmk.fm/)
|
||||||
|
|
||||||
The E6V2 has been available with either a bootmapper client or QMK powered PCB. During the second round, the QMK powered PCB was redesigned and used different ports and a different switch matrix.
|
The E6V2 has been available with either a bootmapper client or QMK powered PCB. During the second round, the QMK powered PCB was redesigned and used different ports and a different switch matrix.
|
||||||
|
|
||||||
Please use the appropriate version when making your firmware.
|
Please use the appropriate version when making your firmware. Flashing one in place of the other, can brick your PCB. Please be certain whether you have a OE or LE PCB.
|
||||||
|
|
||||||
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
|
||||||
@@ -1 +0,0 @@
|
|||||||
DEFAULT_FOLDER = e6v2/oe
|
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_USER_H
|
||||||
|
#define CONFIG_USER_H
|
||||||
|
|
||||||
|
#include "../../config.h"
|
||||||
|
|
||||||
|
/* Use I2C or Serial, not both */
|
||||||
|
|
||||||
|
#define USE_SERIAL
|
||||||
|
// #define USE_I2C
|
||||||
|
|
||||||
|
/* Select hand configuration */
|
||||||
|
|
||||||
|
#define MASTER_LEFT
|
||||||
|
// #define MASTER_RIGHT
|
||||||
|
// #define EE_HANDS
|
||||||
|
|
||||||
|
// Underglow
|
||||||
|
#undef RGBLED_NUM
|
||||||
|
#define RGBLED_NUM 14 // Number of LEDs
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLIGHT_SLEEP
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
#define BASE 0
|
||||||
|
#define META 1
|
||||||
|
#define SYMB 2
|
||||||
|
#define GAME 3
|
||||||
|
#define RGB 4
|
||||||
|
|
||||||
|
// Fillers to make layering more clear
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
//Following line allows macro to read current RGB settings
|
||||||
|
extern rgblight_config_t rgblight_config;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
RGB_RST = SAFE_RANGE,
|
||||||
|
TAP_ANIM
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* BASE
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | ESC | Tab | Q | W | E | R | T | | Y | U | I | O | P | [ | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Del | RCtrl| A | S | D | F | G | | H | J | K | L | ; | ] | Enter|
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | RGB | LSft | Z | X | C | V | B | | N | M | , | . | / | UP | RSft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT|
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[BASE] = LAYOUT( \
|
||||||
|
KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_BSPC, \
|
||||||
|
KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \
|
||||||
|
MO(RGB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \
|
||||||
|
MO(META), KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* META
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | Reset| 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Del | F1 | |Muhen | Henk | | | | Left | Down | Up |Right | | | Enter|
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | RGB | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | | | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[META] = LAYOUT( \
|
||||||
|
RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \
|
||||||
|
_______, KC_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, _______, \
|
||||||
|
_______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, S(KC_LBRC), S(KC_RBRC), KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* SYMB
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | ESC | ! | @ | # | $ | % | [ | | ] | ^ | & | * | ( | ) | Bksp |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | Del | | | | | | ( | | ) | | | | | | Enter|
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | RGB | | | | | | { | | } | | | | | UP | Sft |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT|
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[SYMB] = LAYOUT( \
|
||||||
|
_______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), KC_LBRC, KC_RBRC, S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), _______, \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_9), S(KC_0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_LBRC), S(KC_RBRC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, \
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||||
|
),
|
||||||
|
|
||||||
|
/* RGB
|
||||||
|
* ,------------------------------------------------. ,------------------------------------------------.
|
||||||
|
* | | | | | | | | | | | | | | | |
|
||||||
|
* |------+------+------+------+------+------+------| |-------------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | TOG | HUI | SAI | VAI |HUANIM| |
|
||||||
|
* |------+------+------+------+------+------+------| |------|------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | MOD | HUD | SAD | VAD |RESET | |
|
||||||
|
* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | | | | |=>RGB | |
|
||||||
|
* `------------------------------------------------' `------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[RGB] = LAYOUT( \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, TAP_ANIM,XXXXXXX, \
|
||||||
|
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUI, RGB_SAD, RGB_VAD, RGB_RST, XXXXXXX, \
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
bool isTapAnim = false;
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case RGB_MOD:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
isTapAnim = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case RGB_RST:
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
if (record->event.pressed) {
|
||||||
|
eeconfig_update_rgblight_default();
|
||||||
|
rgblight_enable();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case TAP_ANIM:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
isTapAnim = !isTapAnim;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isTapAnim) {
|
||||||
|
rgblight_mode_noeeprom(1);
|
||||||
|
uint16_t hue = (rgblight_config.hue + 5) % 360;
|
||||||
|
rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Jacob Jerrell <jacob.jerrell@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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
// Layers
|
||||||
|
enum layers {
|
||||||
|
_SWRKMN = 0,
|
||||||
|
_HWRKMN,
|
||||||
|
_LOWER,
|
||||||
|
_RAISE,
|
||||||
|
_ADJUST,
|
||||||
|
_DIABLO
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
KC_EPRM = SAFE_RANGE,
|
||||||
|
KC_SWRK,
|
||||||
|
KC_HWRK,
|
||||||
|
KC_VRSN,
|
||||||
|
JJ_COPY,
|
||||||
|
JJ_PASTE,
|
||||||
|
JJ_ARRW,
|
||||||
|
MC_LOCK,
|
||||||
|
KC_DIABLO_CLEAR,
|
||||||
|
KC_NMPD
|
||||||
|
// UC_FLIP
|
||||||
|
};
|
||||||
|
|
||||||
|
// Space Cadet Hyper/Meh and [/]
|
||||||
|
#define HYP_LBK ALL_T(KC_LBRACKET)
|
||||||
|
#define MEH_RBK MEH_T(KC_RBRACKET)
|
||||||
|
|
||||||
|
#define KC_LWSP LT(_LOWER, KC_SPACE)
|
||||||
|
#define KC_RSEN LT(_RAISE, KC_ENTER)
|
||||||
|
#define KC_ADJS TT(_ADJUST)
|
||||||
|
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
|
||||||
|
#ifdef TAP_DANCE_ENABLE
|
||||||
|
enum {
|
||||||
|
TD_D3_1 = 0,
|
||||||
|
TD_D3_2,
|
||||||
|
TD_D3_3,
|
||||||
|
TD_D3_4
|
||||||
|
};
|
||||||
|
#endif // TAP_DANCE_ENABLE
|
||||||
|
|
||||||
|
// Custom Keycodes for Diablo 3 layer
|
||||||
|
// But since TD() doesn't work when tap dance is disabled
|
||||||
|
// We use custom codes here, so we can substitute the right stuff
|
||||||
|
#ifdef TAP_DANCE_ENABLE
|
||||||
|
#define KC_D3_1 TD(TD_D3_1)
|
||||||
|
#define KC_D3_2 TD(TD_D3_2)
|
||||||
|
#define KC_D3_3 TD(TD_D3_3)
|
||||||
|
#define KC_D3_4 TD(TD_D3_4)
|
||||||
|
#else // TAP_DANCE_ENABLE
|
||||||
|
#define KC_D3_1 KC_1
|
||||||
|
#define KC_D3_2 KC_2
|
||||||
|
#define KC_D3_3 KC_3
|
||||||
|
#define KC_D3_4 KC_4
|
||||||
|
#endif // TAP_DANCE_ENABLE
|
||||||
|
|
||||||
|
//define diablo macro timer variables
|
||||||
|
extern uint16_t diablo_timer[4];
|
||||||
|
extern uint8_t diablo_times[];
|
||||||
|
extern uint8_t diablo_key_time[4];
|
||||||
|
|
||||||
|
|
||||||
|
void run_diablo_macro_check(void);
|
||||||
|
|
||||||
|
|
||||||
|
#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__)
|
||||||
|
|
||||||
|
/* Pretty Layout
|
||||||
|
.---------------------------------------------. .---------------------------------------------.
|
||||||
|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 |
|
||||||
|
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
|
||||||
|
| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 |
|
||||||
|
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
|
||||||
|
| 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 |
|
||||||
|
'------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------'
|
||||||
|
.-------+-------+-------! !-------+-------+-------.
|
||||||
|
! ! | 69 | ! 70 | ! !
|
||||||
|
! ! !-------! !-------! ! !
|
||||||
|
| 71 | 72 | 73 | ! 74 | 75 | 76 |
|
||||||
|
'-----------------------' '-----------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define ______________________NUMBER_LEFT________________________ KC_1, KC_2, KC_3, KC_4, KC_5
|
||||||
|
#define ______________________NUMBER_RIGHT_______________________ KC_6, KC_7, KC_8, KC_9, KC_0
|
||||||
|
|
||||||
|
#define ______________________SPECIAL_LEFT_______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC
|
||||||
|
#define ______________________SPECIAL_RIGHT______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN
|
||||||
|
|
||||||
|
#define _______________________FUNC_LEFT_________________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5
|
||||||
|
#define _______________________FUNC_RIGHT________________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10
|
||||||
|
|
||||||
|
#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||||
|
#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO
|
||||||
|
|
||||||
|
#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T
|
||||||
|
#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G
|
||||||
|
#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B
|
||||||
|
|
||||||
|
#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P
|
||||||
|
#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN
|
||||||
|
#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||||
|
|
||||||
|
// Hardware Driven Workman
|
||||||
|
#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B
|
||||||
|
#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G
|
||||||
|
#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V
|
||||||
|
|
||||||
|
#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN
|
||||||
|
#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I
|
||||||
|
#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH)
|
||||||
|
|
||||||
|
#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), TT(_ADJUST), XXXXXXX, KC_UP, KC_LEFT
|
||||||
|
#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, TT(_RAISE), TT(_LOWER), TT(_ADJUST)
|
||||||
|
|
||||||
|
// LEFT | RIGHT
|
||||||
|
#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \
|
||||||
|
KC_END, KC_PGDOWN, \
|
||||||
|
KC_LWSP,KC_BSPACE,JJ_COPY, JJ_PASTE,KC_TAB,KC_RSEN
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#ifndef USERSPACE_CONFIG_H
|
||||||
|
#define USERSPACE_CONFIG_H
|
||||||
|
|
||||||
|
#ifndef QMK_KEYS_PER_SCAN
|
||||||
|
#define QMK_KEYS_PER_SCAN 4
|
||||||
|
#endif // QMK KEYS PER SCAN
|
||||||
|
|
||||||
|
// this makes it possible to do rolling combos (zx) with keys that
|
||||||
|
// convert to other keys on hold (z becomes ctrl when you hold it,
|
||||||
|
// and when this option isn't enabled, z rapidly followed by x
|
||||||
|
// actually sends Ctrl-x. That's bad.)
|
||||||
|
#define IGNORE_MOD_TAP_INTERRUPT
|
||||||
|
#define PERMISSIVE_HOLD
|
||||||
|
#undef PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
// Disable action_get_macro and fn_actions, since we don't use these
|
||||||
|
// and it saves on space in the firmware.
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
|
||||||
|
#endif // !USERSPACE_CONFIG_H
|
||||||
@@ -0,0 +1,340 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2018 Jacob Jerrell <jacob.jerrell@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/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
#include "bocaj.h"
|
||||||
|
|
||||||
|
#ifdef UNICODEMAP_ENABLE
|
||||||
|
#include "bocaj_unicode.h"
|
||||||
|
#endif // UNICODEMAP_ENABLE
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Software Workman / QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f
|
||||||
|
.---------------------------------------------. .---------------------------------------------.
|
||||||
|
| ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = |
|
||||||
|
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
|
||||||
|
| DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| ADJST | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' |
|
||||||
|
!-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------!
|
||||||
|
| SHIFT | Z | X | C | V | B | { | ! } | N | M | , | . | / | SHIFT |
|
||||||
|
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
|
||||||
|
| GAME | NUM | VRS | UP | LFT | .---------------. .---------------. ! RGT | DWN | RSE | LWR | ADJ |
|
||||||
|
'------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------'
|
||||||
|
.-------+-------+-------! !-------+-------+-------.
|
||||||
|
! SPACE ! | END | ! PGDN | ! ENTER !
|
||||||
|
! / ! BSPCE !-------! !-------! TAB ! / !
|
||||||
|
| LOWER | | COPY | ! PASTE | | RAISE |
|
||||||
|
'-----------------------' '-----------------------'
|
||||||
|
*/
|
||||||
|
[_SWRKMN] = LAYOUT_ergodox_pretty_wrapper(
|
||||||
|
KC_ESC, ______________________NUMBER_LEFT________________________, JJ_ARRW, KC_MINUS, ______________________NUMBER_RIGHT_______________________, KC_EQUAL,
|
||||||
|
KC_DEL, _______________________SWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________SWORKMAN_R1_______________________, KC_BSLS,
|
||||||
|
KC_ADJS,_______________________SWORKMAN_L2_______________________, _______________________SWORKMAN_R2_______________________, KC_QUOTE,
|
||||||
|
KC_LSFT,_______________________SWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________SWORKMAN_R3_______________________, KC_RSFT,
|
||||||
|
___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________,
|
||||||
|
______________________ERGODOX_THUMBS_____________________
|
||||||
|
),
|
||||||
|
/* Hardware Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1
|
||||||
|
.---------------------------------------------. .---------------------------------------------.
|
||||||
|
| ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = |
|
||||||
|
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
|
||||||
|
| DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| ADJST | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' |
|
||||||
|
!-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------!
|
||||||
|
| SHIFT | Z | X | M | C | V | { | ! } | K | L | , | . | / | SHIFT |
|
||||||
|
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
|
||||||
|
| GAME | NUM | VRS | UP | LFT | .---------------. .---------------. ! RGT | DWN | RSE | LWR | ADJ |
|
||||||
|
'------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------'
|
||||||
|
.-------+-------+-------! !-------+-------+-------.
|
||||||
|
! SPACE ! | END | ! PGDN | ! ENTER !
|
||||||
|
! / ! BSPCE !-------! !-------! TAB ! / !
|
||||||
|
| LOWER | | COPY | ! PASTE | | RAISE |
|
||||||
|
'-----------------------' '-----------------------'
|
||||||
|
*/
|
||||||
|
[_HWRKMN] = LAYOUT_ergodox_pretty_wrapper(
|
||||||
|
KC_ESC, ______________________NUMBER_LEFT________________________, JJ_ARRW, KC_MINUS, ______________________NUMBER_RIGHT_______________________, KC_EQUAL,
|
||||||
|
KC_DEL, _______________________HWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________HWORKMAN_R1_______________________, KC_BSLS,
|
||||||
|
KC_ADJS,_______________________HWORKMAN_L2_______________________, _______________________HWORKMAN_R2_______________________, KC_QUOTE,
|
||||||
|
KC_LSFT,_______________________HWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________HWORKMAN_R3_______________________, KC_RSFT,
|
||||||
|
___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________,
|
||||||
|
______________________ERGODOX_THUMBS_____________________
|
||||||
|
),
|
||||||
|
/* Lower - http://www.keyboard-layout-editor.com/#/gists/f1d745a88d1c48ab55e095efd9e7a43a
|
||||||
|
.---------------------------------------------. .---------------------------------------------.
|
||||||
|
| | F1 | F2 | F3 | F4 | F5 | | ! | F6 | F7 | F8 | F9 | F10 | |
|
||||||
|
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
|
||||||
|
| ` | 1 | 2 | 3 | 4 | 5 | | ! | 6 | 7 | 8 | 9 | 0 | |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| | | | | | |-------! !-------! | | | | | |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| | | | | | | | ! | | | | | | |
|
||||||
|
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
|
||||||
|
| | | | | | .---------------. .---------------. ! | | | | |
|
||||||
|
'------------------------------' | | | ! | | '------------------------------'
|
||||||
|
.-------+-------+-------! !-------+-------+-------.
|
||||||
|
! ! | | ! | ! !
|
||||||
|
! ! !-------! !-------! ! !
|
||||||
|
| | | | ! | | |
|
||||||
|
'-----------------------' '-----------------------'
|
||||||
|
*/
|
||||||
|
[_LOWER] = LAYOUT_ergodox_pretty_wrapper(
|
||||||
|
_______,_______________________FUNC_LEFT_________________________, _______, _______, _______________________FUNC_RIGHT________________________, _______,
|
||||||
|
KC_GRV ,______________________NUMBER_LEFT________________________, _______, _______, ______________________NUMBER_RIGHT_______________________, _______,
|
||||||
|
_______,_________________________________________________________, _________________________________________________________, _______,
|
||||||
|
_______,_________________________________________________________, _______, _______, _________________________________________________________, _______,
|
||||||
|
_________________________________________________________, _________________________________________________________,
|
||||||
|
______________________ERGODOX_THUMBS_____________________
|
||||||
|
),
|
||||||
|
/* Raise - http://www.keyboard-layout-editor.com/#/gists/e0f591ec2ce9f24675a02d15c7048b25
|
||||||
|
.---------------------------------------------. .---------------------------------------------.
|
||||||
|
| | F1 | F2 | F3 | F4 | F5 | | ! _ | F6 | F7 | F8 | F9 | F10 | |
|
||||||
|
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
|
||||||
|
| ~ | ! | @ | # | $ | % | | ! | ^ | & | * | ( | ) | |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| | | | | | |-------! !-------! | | | | | |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| | | | | | | | ! | | | | | | |
|
||||||
|
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
|
||||||
|
| | | | | | .---------------. .---------------. ! | | | | |
|
||||||
|
'------------------------------' | | | ! | | '------------------------------'
|
||||||
|
.-------+-------+-------! !-------+-------+-------.
|
||||||
|
! ! | | ! | ! !
|
||||||
|
! ! !-------! !-------! ! !
|
||||||
|
| | | | ! | | |
|
||||||
|
'-----------------------' '-----------------------'
|
||||||
|
*/
|
||||||
|
[_RAISE] = LAYOUT_ergodox_pretty_wrapper(
|
||||||
|
_______,_______________________FUNC_LEFT_________________________, _______, KC_UNDS, _______________________FUNC_RIGHT________________________, _______,
|
||||||
|
KC_TILD,______________________SPECIAL_LEFT_______________________, _______, _______, ______________________SPECIAL_RIGHT______________________, _______,
|
||||||
|
_______,_________________________________________________________, _________________________________________________________, _______,
|
||||||
|
_______,_________________________________________________________, _______, _______, _________________________________________________________, _______,
|
||||||
|
_________________________________________________________, _________________________________________________________,
|
||||||
|
______________________ERGODOX_THUMBS_____________________
|
||||||
|
),
|
||||||
|
/* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007
|
||||||
|
.---------------------------------------------. .---------------------------------------------.
|
||||||
|
| | | | | | | EPRM | ! EPRM | | | | | | |
|
||||||
|
!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------!
|
||||||
|
| | | | | | | | ! | | 7 | 8 | 9 | * | |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | 4 | 5 | 6 | + | SWRKM |
|
||||||
|
!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------!
|
||||||
|
| | | | | | | | ! | | 1 | 2 | 3 | - | HWRKM |
|
||||||
|
'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------'
|
||||||
|
| | | | | | .---------------. .---------------. ! 0 | . | , | = | |
|
||||||
|
'------------------------------' | | | ! | | '------------------------------'
|
||||||
|
.-------+-------+-------! !-------+-------+-------.
|
||||||
|
! ! | | ! | ! !
|
||||||
|
! ! !-------! !-------! ! !
|
||||||
|
| | | | ! | | |
|
||||||
|
'-----------------------' '-----------------------'
|
||||||
|
*/
|
||||||
|
[_ADJUST] = LAYOUT_ergodox_pretty_wrapper(
|
||||||
|
XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, KC_EPRM, KC_EPRM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, XXXXXXX,
|
||||||
|
_______,KC__MUTE, KC__VOLDOWN, KC__VOLUP, MC_LOCK, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_SWRK,
|
||||||
|
XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, KC_HWRK,
|
||||||
|
XXXXXXX,_______,XXXXXXX,XXXXXXX,XXXXXXX, KC_KP_0, KC_PDOT, KC_COMM, KC_PEQL, _______,
|
||||||
|
______________________ERGODOX_THUMBS_____________________
|
||||||
|
),
|
||||||
|
// Diablo - http://www.keyboard-layout-editor.com/#/gists/28476e4237e77d4835ac8a9d7e5f9b2c
|
||||||
|
[_DIABLO] = LAYOUT_ergodox_pretty_wrapper(
|
||||||
|
KC_ESC , KC_V , KC_D ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
KC_TAB , KC_S , KC_I , KC_F , KC_T , KC_J ,XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX,
|
||||||
|
KC_Q , KC_1 , KC_2 , KC_3 , KC_4 , KC_M , XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX,
|
||||||
|
KC_LSFT,KC_D3_1 ,KC_D3_2 ,KC_D3_3 ,KC_D3_4 ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX,
|
||||||
|
_______,ALT_T(KC_Z) ,KC_G ,KC_Y ,XXXXXXX , KC_KP_0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,
|
||||||
|
XXXXXXX, XXXXXXX,
|
||||||
|
KC_BTN1,KC_BTN2,KC_DIABLO_CLEAR, XXXXXXX,XXXXXXX,XXXXXXX
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Defines actions for my custom keycodes
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
// KC_COPY and KC_PASTE have problems with different hardware/software mappings
|
||||||
|
// e.g. If the mappings conflict, KC_COPY will send Cmd+M which minimizes the
|
||||||
|
// window and is very annoying. JJ_COPY and JJ_PASTE fix this by sending the
|
||||||
|
// raw character rather than the KC_* code
|
||||||
|
case JJ_COPY:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
SEND_STRING(SS_LGUI("c"));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case JJ_PASTE:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
SEND_STRING(SS_LGUI("v"));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case JJ_ARRW:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
SEND_STRING("->");
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case KC_SWRK:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_SWRKMN);
|
||||||
|
layer_move(_SWRKMN);
|
||||||
|
ergodox_blink_all_leds();
|
||||||
|
ergodox_blink_all_leds();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case KC_HWRK:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
set_single_persistent_default_layer(_HWRKMN);
|
||||||
|
layer_move(_HWRKMN);
|
||||||
|
ergodox_blink_all_leds();
|
||||||
|
ergodox_blink_all_leds();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case KC_EPRM:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
ergodox_blink_all_leds();
|
||||||
|
eeconfig_init();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case MC_LOCK:
|
||||||
|
if (!record->event.pressed) {
|
||||||
|
layer_move(_HWRKMN);
|
||||||
|
SEND_STRING(SS_LCTRL(SS_LGUI("q")));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case KC_DIABLO_CLEAR:
|
||||||
|
#ifdef TAP_DANCE_ENABLE
|
||||||
|
if (record->event.pressed) {
|
||||||
|
uint8_t dtime;
|
||||||
|
for (dtime = 0; dtime < 4; dtime++) {
|
||||||
|
diablo_key_time[dtime] = diablo_times[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // TAP_DANCE_ENABLE
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); };
|
||||||
|
|
||||||
|
// Diablo III Fun stuff
|
||||||
|
//define diablo macro timer variables
|
||||||
|
uint16_t diablo_timer[4];
|
||||||
|
uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 };
|
||||||
|
uint8_t diablo_key_time[4];
|
||||||
|
|
||||||
|
// has the correct number of seconds elapsed (as defined by diablo_times)
|
||||||
|
bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; };
|
||||||
|
|
||||||
|
// Cycle through the times for the macro, starting at 0, for disabled.
|
||||||
|
// Max of six values, so don't exceed
|
||||||
|
void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
|
||||||
|
if (state->count >= 7) {
|
||||||
|
diablo_key_time[diablo_key] = diablo_times[0];
|
||||||
|
reset_tap_dance(state);
|
||||||
|
} else {
|
||||||
|
diablo_key_time[diablo_key] = diablo_times[state->count - 1];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Would rather have one function for all of this, but no idea how to do that...
|
||||||
|
void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); }
|
||||||
|
void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); }
|
||||||
|
void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); }
|
||||||
|
void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); }
|
||||||
|
|
||||||
|
//Tap Dance Definitions
|
||||||
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
// tap once to disable, and more to enable timed micros
|
||||||
|
[TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
|
||||||
|
[TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
|
||||||
|
[TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
|
||||||
|
[TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4),
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sends the key press to system, but only if on the Diablo layer
|
||||||
|
void send_diablo_keystroke(uint8_t diablo_key) {
|
||||||
|
if (biton32(layer_state) == _DIABLO) {
|
||||||
|
switch (diablo_key) {
|
||||||
|
case 0:
|
||||||
|
tap(KC_1); break;
|
||||||
|
case 1:
|
||||||
|
tap(KC_2); break;
|
||||||
|
case 2:
|
||||||
|
tap(KC_3); break;
|
||||||
|
case 3:
|
||||||
|
tap(KC_4); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Checks each of the 4 timers/keys to see if enough time has elapsed
|
||||||
|
// Runs the "send string" command if enough time has passed, and resets the timer.
|
||||||
|
void run_diablo_macro_check(void) {
|
||||||
|
uint8_t dtime;
|
||||||
|
for (dtime = 0; dtime < 4; dtime++) {
|
||||||
|
if (check_dtimer(dtime) && diablo_key_time[dtime]) {
|
||||||
|
diablo_timer[dtime] = timer_read();
|
||||||
|
send_diablo_keystroke(dtime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
uint8_t layer = biton32(layer_state);
|
||||||
|
ergodox_board_led_off();
|
||||||
|
ergodox_right_led_1_off();
|
||||||
|
ergodox_right_led_2_off();
|
||||||
|
ergodox_right_led_3_off();
|
||||||
|
switch (layer) {
|
||||||
|
/*
|
||||||
|
Lights are treated as binary here for easy identification.
|
||||||
|
LED1 = 4; LED2 = 2; LED1 = 1
|
||||||
|
This allows for up to 8 identified layers (default layers being no lights on)
|
||||||
|
Which is way more than I should ever need
|
||||||
|
*/
|
||||||
|
case _LOWER:
|
||||||
|
ergodox_right_led_3_on();
|
||||||
|
ergodox_right_led_3_set(10); // Default brightness is deadly in a dark room
|
||||||
|
break;
|
||||||
|
case _RAISE:
|
||||||
|
ergodox_right_led_2_on();
|
||||||
|
ergodox_right_led_2_set(10);
|
||||||
|
break;
|
||||||
|
case _ADJUST:
|
||||||
|
ergodox_right_led_2_on();
|
||||||
|
ergodox_right_led_2_set(10);
|
||||||
|
ergodox_right_led_3_on();
|
||||||
|
ergodox_right_led_3_set(10);
|
||||||
|
break;
|
||||||
|
case _DIABLO:
|
||||||
|
ergodox_right_led_1_on();
|
||||||
|
ergodox_right_led_1_set(10);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// none
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
#ifdef TAP_DANCE_ENABLE
|
||||||
|
run_diablo_macro_check();
|
||||||
|
#endif
|
||||||
|
};
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# Ergodox EZ Layout by JacobJerrell
|
||||||
|
|
||||||
|
My personal Ergodox EZ layout.
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
Contains two base layers because I carry my keyboard between different machines and occassionally use the machines without this keyboard. A side-effect to using it in this manner (with a non-QWERTY layout) is that software/hardware mappings conflict so this allows a quick (2-buttons) to get the keyboard to a compatible layer
|
||||||
|
|
||||||
|
## Layers
|
||||||
|
|
||||||
|
| Layer | Purpose |
|
||||||
|
| ----- | ------- |
|
||||||
|
| 0 | [Hardware Workman](#hardware-workman) - For OS mapped to QWERTY |
|
||||||
|
| 1 | [Software Workman](#software-workman) - For OS mapped to Workman |
|
||||||
|
| 2 | [Lower](#lower) |
|
||||||
|
| 3 | [Raise](#raise) |
|
||||||
|
| 4 | [Adjust](#adjust) |
|
||||||
|
| 5 | [Diablo III](#diablo-iii) |
|
||||||
|
|
||||||
|
### Hardware Workman
|
||||||
|
|
||||||
|
For easy plug and play into QWERTY machines
|
||||||
|

|
||||||
|
|
||||||
|
### Software Workman
|
||||||
|
|
||||||
|
To switch to when I was previously using the laptop keyboard with software mapped to Workman. Or so other people can take the Ergodox for a spin.
|
||||||
|

|
||||||
|
|
||||||
|
### Lower
|
||||||
|
|
||||||
|
Reveals F1-12 keys and brings numkeys down.
|
||||||
|

|
||||||
|
|
||||||
|
### Raise
|
||||||
|
|
||||||
|
Reveals F1-F12 keys and gives shifted numkeys.
|
||||||
|

|
||||||
|
|
||||||
|
### Adjust
|
||||||
|
|
||||||
|
Numpad, Wipe EEPROM, OSX Volume Control, OSX Lockscreen, and Default Layer Switching.
|
||||||
|

|
||||||
|
|
||||||
|
### Diablo III
|
||||||
|
|
||||||
|
Arranged to make playing on a laptop much more enjoyable. Credit for the D1-4 macros (as well as much of the ideas in this layout goes to Drashna)
|
||||||
|

|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
AUTO_SHIFT_ENABLE = no
|
||||||
|
COMMAND_ENABLE = no
|
||||||
|
SWAP_HANDS_ENABLE = no
|
||||||
|
TAP_DANCE_ENABLE = yes
|
||||||
|
EXTRAKEY_ENABLE = no
|
||||||
@@ -12,7 +12,8 @@ Layers
|
|||||||
* BASE: basic dvorak layout
|
* BASE: basic dvorak layout
|
||||||
* KEYNAV: arrow-key navigation. Momentary toggle held by thumb allows the right hand to navigate through text as well as copy/paste/cut, page up/page down
|
* KEYNAV: arrow-key navigation. Momentary toggle held by thumb allows the right hand to navigate through text as well as copy/paste/cut, page up/page down
|
||||||
* KEYSEL: similar to KEYNAV, except for shift-selection
|
* KEYSEL: similar to KEYNAV, except for shift-selection
|
||||||
* COMBINED: this is a layer that combines numbers, brackets and special characters. !@#$%^&*( can be type by shift+COMBINED+1/2/3/etc..
|
* COMBINED: this is a layer that combines numbers, brackets and special characters. !@#$%^&*( can be typed by shift+COMBINED+1/2/3/etc..
|
||||||
* MOUSE: mouse navigation, as well as browser tab-left/tab-right shortcuts
|
* BROWSER_CONTROL: primarily browser left/right tab, open new tab/delete tab, but also mouse keys.
|
||||||
* SHELL_NAV: Linux Bash shortcuts (move forward/backward in command line, Ctrl+C, recall last argument, etc
|
* SHELL_NAV: Linux Bash shortcuts (move forward/backward in command line, Ctrl+C, recall last argument, etc
|
||||||
* SHELL_SCREEN: Linux screen (run multiple terminals in one window) shortcuts such as open new tabs, switch between tabs
|
* SHELL_SCREEN: Linux screen (run multiple terminals in one window) shortcuts such as open new tabs, switch between tabs
|
||||||
|
* SCREEN_NAV: special layer for copy/pasting within Linux screen, allows using various copy/paste buffers
|
||||||
@@ -15,8 +15,6 @@
|
|||||||
// pushing dev branch
|
// pushing dev branch
|
||||||
// git push origin dev:dev
|
// git push origin dev:dev
|
||||||
|
|
||||||
static bool mouse_lock = false;
|
|
||||||
|
|
||||||
enum custom_keycodes {
|
enum custom_keycodes {
|
||||||
PLACEHOLDER = SAFE_RANGE, // can always be here
|
PLACEHOLDER = SAFE_RANGE, // can always be here
|
||||||
EPRM,
|
EPRM,
|
||||||
@@ -40,7 +38,12 @@ enum custom_keycodes {
|
|||||||
SHELL_SCREEN_LIST,
|
SHELL_SCREEN_LIST,
|
||||||
SHELL_MKE,
|
SHELL_MKE,
|
||||||
SHELL_HTCSTATUS,
|
SHELL_HTCSTATUS,
|
||||||
|
SHELL_HTCBOUNCE,
|
||||||
|
SHELL_DUMPTLOG,
|
||||||
|
|
||||||
|
SHELL_EXPAND_OE_LOGPATTERN,
|
||||||
|
SHELL_EXPAND_OE_TRANPATTERN,
|
||||||
|
|
||||||
// Cloud9 macros
|
// Cloud9 macros
|
||||||
CLOUD9_TAB_LEFT,
|
CLOUD9_TAB_LEFT,
|
||||||
CLOUD9_TAB_RIGHT,
|
CLOUD9_TAB_RIGHT,
|
||||||
@@ -57,19 +60,15 @@ enum custom_keycodes {
|
|||||||
#define KEYSEL 2 // arrow navigation + shift (allow text selection)
|
#define KEYSEL 2 // arrow navigation + shift (allow text selection)
|
||||||
#define SHELL_NAV 3 // bash shortcuts
|
#define SHELL_NAV 3 // bash shortcuts
|
||||||
#define SHELL_SCREEN 4 // linux screen shortcuts
|
#define SHELL_SCREEN 4 // linux screen shortcuts
|
||||||
#define SCREEN_NAV 5 // navigate between linux screen tabs
|
#define SCREEN_NAV 5 // navigate between linux screen tabs
|
||||||
#define MOUSE 6 // mouse layer (can be locked with lock key), unmapped for now
|
#define BROWSER_CONTROL 6 // control browser and mouse
|
||||||
#define BROWSER_CONTROL 7 // control browser and mouse
|
#define COMBINED 7 // combined numbers and symbols layer
|
||||||
#define COMBINED 8 // combined numbers and symbols layer
|
|
||||||
|
|
||||||
|
|
||||||
// macros
|
// macros
|
||||||
#define MOUSE_TOGGLE 1
|
|
||||||
#define MOUSE_LOCK 2
|
|
||||||
#define SCREEN_TAB_LEFT 4
|
#define SCREEN_TAB_LEFT 4
|
||||||
#define SCREEN_TAB_RIGHT 5
|
#define SCREEN_TAB_RIGHT 5
|
||||||
#define SCREEN_NEW_TAB 6
|
#define SCREEN_NEW_TAB 6
|
||||||
#define SWITCH_NDS 7
|
|
||||||
#define SCREEN_COPY_MODE 8
|
#define SCREEN_COPY_MODE 8
|
||||||
#define SCREEN_PASTE 9
|
#define SCREEN_PASTE 9
|
||||||
#define SCREEN_RENAME 10
|
#define SCREEN_RENAME 10
|
||||||
@@ -93,9 +92,8 @@ enum custom_keycodes {
|
|||||||
#define SCREEN_PASTEREG_1 28
|
#define SCREEN_PASTEREG_1 28
|
||||||
#define SCREEN_PASTEREG_2 29
|
#define SCREEN_PASTEREG_2 29
|
||||||
#define SCREEN_PASTEREG_3 30
|
#define SCREEN_PASTEREG_3 30
|
||||||
#define SHELL_WRITE_LOGPATTERN 31
|
#define DEL_TO_HOME 36
|
||||||
#define SHELL_WRITE_TRANPATTERN 32
|
|
||||||
#define SHELL_EXPAND_PATTERN 33
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -175,13 +173,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TRNS,MEH(KC_B), CLOUD9_NAVIGATE, CLOUD9_TAB_LEFT, CLOUD9_TAB_RIGHT, CLOUD9_TAB_CLOSE, KC_TRNS,
|
KC_TRNS,MEH(KC_B), CLOUD9_NAVIGATE, CLOUD9_TAB_LEFT, CLOUD9_TAB_RIGHT, CLOUD9_TAB_CLOSE, KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
// left thumb cluster
|
// left thumb cluster
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS,TO(MOUSE),KC_TRNS,KC_TRNS,
|
KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,
|
||||||
|
|
||||||
|
|
||||||
// right hand
|
// right hand
|
||||||
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MEH(KC_G),
|
KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MEH(KC_G),
|
||||||
KC_TRNS,KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, MEH(KC_H),
|
KC_TRNS,KC_NO, KC_HOME, KC_UP, KC_END, KC_PGUP, MEH(KC_H),
|
||||||
LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), MEH(KC_I),
|
LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), MEH(KC_I),
|
||||||
KC_TRNS,KC_NO, RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, MEH(KC_J),
|
KC_TRNS,M(DEL_TO_HOME),RCTL(KC_C), RCTL(KC_X), RCTL(KC_V), KC_PGDOWN, MEH(KC_J),
|
||||||
KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), MEH(KC_K),
|
KC_BSPC, RCTL(KC_BSPC), KC_DELETE, LCTL(KC_DELETE), MEH(KC_K),
|
||||||
|
|
||||||
// right thumb cluster
|
// right thumb cluster
|
||||||
@@ -218,7 +217,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
[SHELL_NAV] = LAYOUT_ergodox(
|
[SHELL_NAV] = LAYOUT_ergodox(
|
||||||
// left hand
|
// left hand
|
||||||
KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS, SHELL_PGREP, SHELL_PLESS, SHELL_LESS, KC_TRNS, SHELL_H3,
|
KC_TRNS,KC_TRNS, SHELL_PGREP, SHELL_PLESS, SHELL_LESS, SHELL_HTCBOUNCE, SHELL_H3,
|
||||||
KC_TRNS,SHELL_MKE, SHELL_CDPRE, SHELL_LSLTR, SHELL_LS, SHELL_LSLA,
|
KC_TRNS,SHELL_MKE, SHELL_CDPRE, SHELL_LSLTR, SHELL_LS, SHELL_LSLA,
|
||||||
KC_TRNS,SHELL_SCREEN_LIST, SHELL_SCREENRD, SHELL_SCREEN_NEW, SHELL_TAILF, SHELL_HTCSTATUS, SHELL_AMMCOLO,
|
KC_TRNS,SHELL_SCREEN_LIST, SHELL_SCREENRD, SHELL_SCREEN_NEW, SHELL_TAILF, SHELL_HTCSTATUS, SHELL_AMMCOLO,
|
||||||
// bottom row
|
// bottom row
|
||||||
@@ -228,10 +227,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TRNS,
|
KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS,
|
KC_TRNS,KC_TRNS,KC_TRNS,
|
||||||
// right hand
|
// right hand
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, M(SHELL_WRITE_TRANPATTERN),
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, SHELL_EXPAND_OE_TRANPATTERN,
|
||||||
RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, KC_TRNS, M(SHELL_WRITE_LOGPATTERN),
|
RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, KC_TRNS, SHELL_EXPAND_OE_LOGPATTERN,
|
||||||
LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), RCTL(KC_W),
|
LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), RCTL(KC_W),
|
||||||
RCTL(KC_C), RCTL(KC_U), LALT(KC_DOT), RCTL(KC_R), MEH(KC_V), RCTL(KC_K), M(SHELL_EXPAND_PATTERN),
|
RCTL(KC_C), RCTL(KC_U), LALT(KC_DOT), RCTL(KC_R), MEH(KC_V), RCTL(KC_K), SHELL_DUMPTLOG,
|
||||||
// bottom row (match functionality of base layer)
|
// bottom row (match functionality of base layer)
|
||||||
KC_BSPC, RCTL(KC_W), KC_DELETE, LALT(KC_D), RCTL(KC_U),
|
KC_BSPC, RCTL(KC_W), KC_DELETE, LALT(KC_D), RCTL(KC_U),
|
||||||
// thumb cluster
|
// thumb cluster
|
||||||
@@ -320,30 +319,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
KC_TRNS,KC_TRNS,
|
KC_TRNS,KC_TRNS,
|
||||||
KC_TRNS,
|
KC_TRNS,
|
||||||
KC_TRNS,KC_TRNS,KC_TRNS),
|
KC_TRNS,KC_TRNS,KC_TRNS),
|
||||||
|
|
||||||
|
|
||||||
[MOUSE] = LAYOUT_ergodox(
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS, KC_TRNS, KC_PGUP, KC_MS_WH_UP, KC_UP, KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS, KC_MS_ACCEL0, KC_PGDN, KC_MS_WH_DOWN, KC_DOWN, KC_TRNS,
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS, KC_TRNS, M(MOUSE_LOCK), KC_TRNS, KC_MS_ACCEL0,
|
|
||||||
|
|
||||||
KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS,
|
|
||||||
KC_TRNS, KC_BTN3, KC_TRNS,
|
|
||||||
// right hand
|
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS, KC_UP, KC_HOME, KC_MS_U, KC_END, KC_MS_WH_UP, KC_TRNS,
|
|
||||||
KC_DOWN, KC_MS_L, KC_MS_D, KC_MS_R, KC_MS_WH_DOWN, KC_TRNS,
|
|
||||||
KC_TRNS, MEH(KC_X), MEH(KC_Y), MEH(KC_Z), KC_F5, RCTL(KC_W), KC_TRNS,
|
|
||||||
// browser tab control
|
|
||||||
RSFT(RCTL(KC_TAB)), RCTL(KC_TAB), RCTL(KC_T), LALT(KC_LEFT), KC_TRNS,
|
|
||||||
KC_TRNS, KC_TRNS,
|
|
||||||
KC_TRNS,
|
|
||||||
KC_TRNS, KC_BTN1, KC_BTN2
|
|
||||||
),
|
|
||||||
|
|
||||||
[BROWSER_CONTROL] = LAYOUT_ergodox(
|
[BROWSER_CONTROL] = LAYOUT_ergodox(
|
||||||
// left hand
|
// left hand
|
||||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
@@ -379,26 +356,6 @@ const uint16_t PROGMEM fn_actions[] = {
|
|||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
{
|
{
|
||||||
switch(id) {
|
switch(id) {
|
||||||
case MOUSE_TOGGLE:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
layer_on(MOUSE);
|
|
||||||
} else {
|
|
||||||
if(!mouse_lock)
|
|
||||||
layer_off(MOUSE);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case MOUSE_LOCK:
|
|
||||||
if (record->event.pressed)
|
|
||||||
{
|
|
||||||
if(mouse_lock)
|
|
||||||
{
|
|
||||||
mouse_lock = false;
|
|
||||||
layer_off(MOUSE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mouse_lock = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SCREEN_TAB_LEFT:
|
case SCREEN_TAB_LEFT:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
return MACRO( D(LCTL), T(A), U(LCTL), T(P), END);
|
return MACRO( D(LCTL), T(A), U(LCTL), T(P), END);
|
||||||
@@ -478,40 +435,19 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
return MACRO( D(LCTL), T(A), U(LCTL), T(RBRC), END);
|
return MACRO( D(LCTL), T(A), U(LCTL), T(RBRC), END);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHELL_WRITE_LOGPATTERN:
|
case DEL_TO_HOME:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
return MACRO( D(LSFT),
|
return MACRO(
|
||||||
T(8),
|
// delete to the beginning of the line
|
||||||
T(8),
|
D(LSFT), T(HOME), U(LSFT),
|
||||||
U(LSFT),
|
T(DELETE),
|
||||||
T(L),
|
END);
|
||||||
T(O),
|
}
|
||||||
T(G),
|
break;
|
||||||
T(LEFT),
|
|
||||||
T(LEFT),
|
|
||||||
T(LEFT),
|
|
||||||
T(LEFT),
|
|
||||||
END);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SHELL_WRITE_TRANPATTERN:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
return MACRO( D(LSFT),
|
|
||||||
T(8),
|
|
||||||
T(8),
|
|
||||||
U(LSFT), T(T), T(R), T(A), T(N), T(LEFT), T(LEFT), T(LEFT), T(LEFT), T(LEFT), END);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case SHELL_EXPAND_PATTERN:
|
|
||||||
if (record->event.pressed) {
|
|
||||||
return MACRO( D(LALT), T(F), U(LALT), D(LCTL), T(X), U(LCTL), D(LSFT), T(8), D(LSFT), END);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
return MACRO_NONE;
|
return MACRO_NONE;
|
||||||
};
|
};
|
||||||
@@ -599,15 +535,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case SHELL_MKE:
|
case SHELL_MKE:
|
||||||
SEND_STRING("mke\n");
|
SEND_STRING("mki -j8\n");
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
case SHELL_HTCSTATUS:
|
case SHELL_HTCSTATUS:
|
||||||
SEND_STRING("htcStatus -j ");
|
SEND_STRING("htcStatus -j ");
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
// Cloud9 macros
|
case SHELL_HTCBOUNCE:
|
||||||
case CLOUD9_TAB_LEFT:
|
SEND_STRING("htcBounce -j ");
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
case SHELL_EXPAND_OE_LOGPATTERN:
|
||||||
|
SEND_STRING(SS_TAP(X_LEFT)"*CQW_HKEX"SS_TAP(X_END)"*.log"SS_LCTRL("x")SS_LSFT("8"));
|
||||||
|
break;
|
||||||
|
case SHELL_EXPAND_OE_TRANPATTERN:
|
||||||
|
SEND_STRING(SS_TAP(X_LEFT)"*CQW_HKEX"SS_TAP(X_END)"*.tran"SS_LCTRL("x")SS_LSFT("8"));
|
||||||
|
break;
|
||||||
|
case SHELL_DUMPTLOG:
|
||||||
|
SEND_STRING(" | dumptlog - ");
|
||||||
|
return true;
|
||||||
|
break;
|
||||||
|
// Cloud9 macros
|
||||||
|
case CLOUD9_TAB_LEFT:
|
||||||
SEND_STRING(SS_LCTRL("["));
|
SEND_STRING(SS_LCTRL("["));
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
@@ -664,8 +614,7 @@ void matrix_scan_user(void) {
|
|||||||
case SCREEN_NAV:
|
case SCREEN_NAV:
|
||||||
ergodox_right_led_3_on();
|
ergodox_right_led_3_on();
|
||||||
break;
|
break;
|
||||||
case MOUSE:
|
case BROWSER_CONTROL:
|
||||||
case BROWSER_CONTROL:
|
|
||||||
ergodox_right_led_2_on();
|
ergodox_right_led_2_on();
|
||||||
ergodox_right_led_3_on();
|
ergodox_right_led_3_on();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
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 TAPPING_TERM 100
|
||||||
|
|
||||||
|
/* Try to prevent sticky keys */
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
/* Use I2C or Serial, not both */
|
||||||
|
|
||||||
|
#define USE_SERIAL
|
||||||
|
// #define USE_I2C
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
extern keymap_config_t keymap_config;
|
||||||
|
|
||||||
|
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||||
|
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||||
|
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||||
|
// entirely and just use numbers.
|
||||||
|
#define _BASE 0
|
||||||
|
#define _FN1 1
|
||||||
|
#define _FN2 2
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
QWERTY = SAFE_RANGE,
|
||||||
|
};
|
||||||
|
|
||||||
|
#define KC_ KC_TRNS
|
||||||
|
#define _______ KC_TRNS
|
||||||
|
#define XXXXXXX KC_NO
|
||||||
|
#define KC_FN1 MO(_FN1)
|
||||||
|
#define KC_FN2 MO(_FN2)
|
||||||
|
#define KC_SPFN1 LT(_FN1, KC_SPACE)
|
||||||
|
#define KC_SPFN2 LT(_FN2, KC_SPACE)
|
||||||
|
#define KC_BSFN1 LT(_FN1, KC_BSPC)
|
||||||
|
#define KC_BSFN2 LT(_FN2, KC_BSPC)
|
||||||
|
#define KC_RST RESET
|
||||||
|
#define KC_DBUG DEBUG
|
||||||
|
#define KC_RTOG RGB_TOG
|
||||||
|
#define KC_RMOD RGB_MOD
|
||||||
|
#define KC_RHUI RGB_HUI
|
||||||
|
#define KC_RHUD RGB_HUD
|
||||||
|
#define KC_RSAI RGB_SAI
|
||||||
|
#define KC_RSAD RGB_SAD
|
||||||
|
#define KC_RVAI RGB_VAI
|
||||||
|
#define KC_RVAD RGB_VAD
|
||||||
|
|
||||||
|
//Tap Dance Declarations
|
||||||
|
enum {
|
||||||
|
ESC_GR = 0,
|
||||||
|
Q_1,
|
||||||
|
W_2,
|
||||||
|
E_3,
|
||||||
|
R_4,
|
||||||
|
T_5,
|
||||||
|
Y_6,
|
||||||
|
U_7,
|
||||||
|
I_8,
|
||||||
|
O_9,
|
||||||
|
P_0,
|
||||||
|
MIN_LB,
|
||||||
|
EQL_RB,
|
||||||
|
SCL_QUO
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[_BASE] = LAYOUT(
|
||||||
|
// ,----+----+----+----+----+----|----+----+----+----+----+----+----.
|
||||||
|
// |ESC | Q1 | W2 | E3 | R4 | T5 | Y6 | U7 | I8 | O9 | P0 | -[ | =] |
|
||||||
|
// |----`----`----`----`----`----|----`----`----`----`----`----`----|
|
||||||
|
// | TAB | A | S | D | F | G | H | H | J | K | L | BKSP |
|
||||||
|
// |-----`----`----`----`----`----|----`----`----`----`----`--------|
|
||||||
|
// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHFT |
|
||||||
|
// |-------`----`----`----`----`----|----`----`----`----`----`------|
|
||||||
|
// | CTL | SYS| ALT | SP SPACE | SPACE | FN1 | CTL | \ | ENT |
|
||||||
|
// `-----+----+-----+----+--------|--------+-----+------+----+------'
|
||||||
|
|
||||||
|
TD(ESC_GR), TD(Q_1), TD(W_2), TD(E_3), TD(R_4), TD(T_5), TD(Y_6), TD(U_7), TD(I_8), TD(O_9), TD(P_0),TD(MIN_LB),TD(EQL_RB), \
|
||||||
|
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD(SCL_QUO), KC_BSPC, \
|
||||||
|
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_FN1, KC_LCTL, KC_NUBS, KC_ENTER
|
||||||
|
),
|
||||||
|
|
||||||
|
[_FN1] = LAYOUT_kc(
|
||||||
|
// ,----+----+----+----+----+----|----+----+----+----+----+----+----.
|
||||||
|
// | | | UP | | | | | | | | | | |
|
||||||
|
// |----`----`----`----`----`----|----`----`----`----`----`----`----|
|
||||||
|
// | | LT | DN | RT | | | | | | | ' | DEL |
|
||||||
|
// |-----`----`----`----`----`----|----`----`----`----`----`--------|
|
||||||
|
// | | | | | | | | | | |PIPE| |
|
||||||
|
// |-------`----`----`----`----`----|----`----`----`----`----`------|
|
||||||
|
// | | | | | | | | | | |
|
||||||
|
// `-----+----+-----+----+--------|--------+-----+------+----+------'
|
||||||
|
|
||||||
|
, , UP, , , , , , , , , , , \
|
||||||
|
, LEFT, DOWN, RIGHT, , , , , , , QUOT, DEL, \
|
||||||
|
, , , , , , , , , , NUBS, , \
|
||||||
|
, , , , , , , , ,
|
||||||
|
),
|
||||||
|
|
||||||
|
[_FN2] = LAYOUT_kc(
|
||||||
|
// ,----+----+----+----+----+----|----+----+----+----+----+----+----.
|
||||||
|
// | | | | | | | | | | | | | |
|
||||||
|
// |----`----`----`----`----`----|----`----`----`----`----`----`----|
|
||||||
|
// | | | | | | | | | | | | |
|
||||||
|
// |-----`----`----`----`----`----|----`----`----`----`----`--------|
|
||||||
|
// | | | | | | | | | | | | |
|
||||||
|
// |-------`----`----`----`----`----|----`----`----`----`----`------|
|
||||||
|
// | | | | | | | | | | |
|
||||||
|
// `-----+----+-----+----+--------|--------+-----+------+----+------'
|
||||||
|
|
||||||
|
, , , , , , , , , , , , , \
|
||||||
|
, , , , , , , , , , , , \
|
||||||
|
, , , , , , , , , , , , \
|
||||||
|
, , , , , , , , ,
|
||||||
|
)
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void esc_gr_finished (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
if (state->count == 1) {
|
||||||
|
register_code (KC_ESC);
|
||||||
|
} else if (state->count == 2) {
|
||||||
|
register_code (KC_GRV);
|
||||||
|
} else {
|
||||||
|
register_code (KC_LSFT);
|
||||||
|
register_code (KC_GRV);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void esc_gr_reset (qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
if (state->count == 1) {
|
||||||
|
unregister_code (KC_ESC);
|
||||||
|
} else if (state->count == 2) {
|
||||||
|
unregister_code (KC_GRV);
|
||||||
|
} else {
|
||||||
|
unregister_code (KC_LSFT);
|
||||||
|
unregister_code (KC_GRV);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Tap Dance Definitions
|
||||||
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
[ESC_GR] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, esc_gr_finished, esc_gr_reset), //Tap once for ESC, twice for `, thrice for ~
|
||||||
|
[Q_1] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_1), //Tap once for Q, twice for 1/!
|
||||||
|
[W_2] = ACTION_TAP_DANCE_DOUBLE(KC_W, KC_2), //Tap once for W, twice for 2/@
|
||||||
|
[E_3] = ACTION_TAP_DANCE_DOUBLE(KC_E, KC_3), //Tap once for E, twice for 3/#
|
||||||
|
[R_4] = ACTION_TAP_DANCE_DOUBLE(KC_R, KC_4), //Tap once for R, twice for 4/$
|
||||||
|
[T_5] = ACTION_TAP_DANCE_DOUBLE(KC_T, KC_5), //Tap once for T, twice for 5/%
|
||||||
|
[Y_6] = ACTION_TAP_DANCE_DOUBLE(KC_Y, KC_6), //Tap once for Y, twice for 6/^
|
||||||
|
[U_7] = ACTION_TAP_DANCE_DOUBLE(KC_U, KC_7), //Tap once for U, twice for 7/&
|
||||||
|
[I_8] = ACTION_TAP_DANCE_DOUBLE(KC_I, KC_8), //Tap once for I, twice for 8/*
|
||||||
|
[O_9] = ACTION_TAP_DANCE_DOUBLE(KC_O, KC_9), //Tap once for O, twice for 9/(
|
||||||
|
[P_0] = ACTION_TAP_DANCE_DOUBLE(KC_P, KC_0), //Tap once for P, twice for 0/)
|
||||||
|
[MIN_LB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_LBRC), //Tap once for -, twice for [/{
|
||||||
|
[EQL_RB] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_RBRC), //Tap once for =, twice for ]/}
|
||||||
|
[SCL_QUO] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_QUOT) //Tap once for ;, '/"
|
||||||
|
// Other declarations would go here, separated by commas, if you have them
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
TAP_DANCE_ENABLE = yes
|
||||||
Executable
+58
@@ -0,0 +1,58 @@
|
|||||||
|
#ifndef CONFIG_H
|
||||||
|
#define CONFIG_H
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6060
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER KeyPCB
|
||||||
|
#define PRODUCT Fractal
|
||||||
|
#define DESCRIPTION Keyboard
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 12
|
||||||
|
|
||||||
|
/* key matrix pins */
|
||||||
|
#define MATRIX_ROW_PINS { B1, F7, F6, F5, F4 }
|
||||||
|
#define MATRIX_COL_PINS { B3, B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* number of backlight levels */
|
||||||
|
|
||||||
|
#ifdef BACKLIGHT_PIN
|
||||||
|
#define BACKLIGHT_LEVELS 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
#define DEBOUNCING_DELAY 5
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* key combination for command */
|
||||||
|
#define IS_COMMAND() ( \
|
||||||
|
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||||
|
)
|
||||||
|
|
||||||
|
/* prevent stuck modifiers */
|
||||||
|
#define PREVENT_STUCK_MODIFIERS
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 0
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
#include "fractal.h"
|
||||||
Executable
+36
@@ -0,0 +1,36 @@
|
|||||||
|
#ifndef FRACTAL_H
|
||||||
|
#define FRACTAL_H
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT_ortho_5x12( \
|
||||||
|
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
|
||||||
|
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
|
||||||
|
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \
|
||||||
|
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 \
|
||||||
|
) { \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \
|
||||||
|
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
|
||||||
|
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \
|
||||||
|
{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_preonic_mit( \
|
||||||
|
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \
|
||||||
|
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \
|
||||||
|
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \
|
||||||
|
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \
|
||||||
|
K400, K401, K402, K403, K404, K406, K407, K408, K409, K410, K411 \
|
||||||
|
) { \
|
||||||
|
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \
|
||||||
|
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \
|
||||||
|
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \
|
||||||
|
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \
|
||||||
|
{ K400, K401, K402, K403, K404, KC_NO, K406, K407, K408, K409, K410, K411 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define KEYMAP LAYOUT_preonic_mit
|
||||||
|
|
||||||
|
#endif
|
||||||
Loaded 100 of 398 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user