mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-25 16:25:26 +00:00
Compare commits
196 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c208a6d4e5 | ||
![]() |
b9987d65f9 | ||
![]() |
2c65a17752 | ||
![]() |
dfa6417ae3 | ||
![]() |
918aea5b47 | ||
![]() |
b4f2f44a6f | ||
![]() |
1524c2cb16 | ||
![]() |
8ad12b1eb7 | ||
![]() |
e43e58aad1 | ||
![]() |
f4e4d6f8d0 | ||
![]() |
37987837b1 | ||
![]() |
a3f151b8e9 | ||
![]() |
de80e2c756 | ||
![]() |
a1ce43781a | ||
![]() |
91f3a73a28 | ||
![]() |
6794495336 | ||
![]() |
2b26abf9a9 | ||
![]() |
946f4854c5 | ||
![]() |
a2fbd671ad | ||
![]() |
7389beb18c | ||
![]() |
dd9b00543b | ||
![]() |
7ca335cf5b | ||
![]() |
3522496f24 | ||
![]() |
67b8bf8f70 | ||
![]() |
98373f2fc1 | ||
![]() |
a012c24225 | ||
![]() |
fa96d64f37 | ||
![]() |
2b98ec67f3 | ||
![]() |
7b3c9cc8de | ||
![]() |
f32c68ee65 | ||
![]() |
c21c2cc92b | ||
![]() |
fe9556104b | ||
![]() |
0fb835c54c | ||
![]() |
23b0fc20e3 | ||
![]() |
9d22a1a6d8 | ||
![]() |
8705ac408d | ||
![]() |
23df3016e8 | ||
![]() |
9019d65b3c | ||
![]() |
2c171b3e5f | ||
![]() |
33a271b8e3 | ||
![]() |
e71b3c6572 | ||
![]() |
f169c715eb | ||
![]() |
2ffcf47793 | ||
![]() |
7ce056cad7 | ||
![]() |
3e7bb19612 | ||
![]() |
e951317acb | ||
![]() |
f71c990215 | ||
![]() |
1aa0be4cf1 | ||
![]() |
0f163c0028 | ||
![]() |
fb9b8dadb9 | ||
![]() |
43d8fa5bf1 | ||
![]() |
36f820be7e | ||
![]() |
e85b185796 | ||
![]() |
6a76192fa4 | ||
![]() |
bd1729d5be | ||
![]() |
fb95d86b39 | ||
![]() |
017458a07b | ||
![]() |
c38589d861 | ||
![]() |
3bb0586acc | ||
![]() |
617578399c | ||
![]() |
c588fca06c | ||
![]() |
a72e8f0865 | ||
![]() |
1c0fe956ac | ||
![]() |
d29906cb64 | ||
![]() |
f646f00b93 | ||
![]() |
83509adc3a | ||
![]() |
26eb97a4a8 | ||
![]() |
fdfd48e8c8 | ||
![]() |
efaf0e830b | ||
![]() |
585d646128 | ||
![]() |
8674f9c466 | ||
![]() |
7424261dae | ||
![]() |
30f22d450d | ||
![]() |
621ae42a6c | ||
![]() |
4217cb5bbc | ||
![]() |
517f75d893 | ||
![]() |
dd73e14c9b | ||
![]() |
66e2d6a063 | ||
![]() |
f2e1609801 | ||
![]() |
74d752b531 | ||
![]() |
3ab0f4d9e5 | ||
![]() |
5682254f71 | ||
![]() |
45d437ca04 | ||
![]() |
51a86b85f3 | ||
![]() |
2fd670bec0 | ||
![]() |
6ba22b5f5e | ||
![]() |
a15510b57b | ||
![]() |
5acc0e54aa | ||
![]() |
1a8042ae91 | ||
![]() |
a284245f77 | ||
![]() |
85d688e92c | ||
![]() |
4c2f04986a | ||
![]() |
3007d01718 | ||
![]() |
3b9fabb9aa | ||
![]() |
a8992a2cfe | ||
![]() |
7837d96b6e | ||
![]() |
56026dd4df | ||
![]() |
1552fd6ae1 | ||
![]() |
133908da74 | ||
![]() |
3c2c489768 | ||
![]() |
b236e51b69 | ||
![]() |
17e81baab3 | ||
![]() |
f9eb11a674 | ||
![]() |
bb99d7117c | ||
![]() |
a5ba30338f | ||
![]() |
7feadbd66d | ||
![]() |
206233d98c | ||
![]() |
82372d36af | ||
![]() |
df26ede131 | ||
![]() |
67e150a08a | ||
![]() |
ba945c5e77 | ||
![]() |
be002137f9 | ||
![]() |
a621c7f88b | ||
![]() |
722adce095 | ||
![]() |
98316ef017 | ||
![]() |
ff2b01da49 | ||
![]() |
6549e169f8 | ||
![]() |
e9a4a5e961 | ||
![]() |
ef4abfeb31 | ||
![]() |
b4802d7567 | ||
![]() |
d2a11b523b | ||
![]() |
086aad0d7e | ||
![]() |
ec88a0b3cc | ||
![]() |
7d5606085f | ||
![]() |
19f0285a76 | ||
![]() |
29108d1477 | ||
![]() |
4cefb45a2d | ||
![]() |
f894103997 | ||
![]() |
b56a9a9899 | ||
![]() |
e32e7dc0f5 | ||
![]() |
44ce179192 | ||
![]() |
d9ffd77ee7 | ||
![]() |
e553bb3af4 | ||
![]() |
b107d64d69 | ||
![]() |
c81be932d2 | ||
![]() |
899584187f | ||
![]() |
6a75a7d672 | ||
![]() |
be9fd4b4fa | ||
![]() |
cc158d90ae | ||
![]() |
5c11ba74d8 | ||
![]() |
a44ba492ea | ||
![]() |
22f985eba7 | ||
![]() |
49cfdb544d | ||
![]() |
4b50ab029d | ||
![]() |
5a70cb30ee | ||
![]() |
3af2bca1fc | ||
![]() |
035f7bb1bf | ||
![]() |
b51a0db6ed | ||
![]() |
2a7f9a7e46 | ||
![]() |
effffa33a5 | ||
![]() |
0f9bfafb9e | ||
![]() |
a916f4e8b8 | ||
![]() |
f397402e10 | ||
![]() |
4cf17210b6 | ||
![]() |
4ba9917f82 | ||
![]() |
9af272e4bb | ||
![]() |
e87691fa5d | ||
![]() |
ac97870801 | ||
![]() |
083267680d | ||
![]() |
e6c9b07e1c | ||
![]() |
2dcd6c38fa | ||
![]() |
f54b4771eb | ||
![]() |
164a6c994b | ||
![]() |
a144968807 | ||
![]() |
16774333ad | ||
![]() |
5fc5661147 | ||
![]() |
d1ff2bb9db | ||
![]() |
821f72eae9 | ||
![]() |
b5675e2025 | ||
![]() |
967cf0f6d4 | ||
![]() |
5df74f3ba7 | ||
![]() |
f1d81d2cc6 | ||
![]() |
2c5b551970 | ||
![]() |
52f671c23e | ||
![]() |
b27fb216ef | ||
![]() |
ff6beeb7a3 | ||
![]() |
b3945c103c | ||
![]() |
8665ed3efc | ||
![]() |
046f1baf30 | ||
![]() |
c0ec1756af | ||
![]() |
ec1e936dfb | ||
![]() |
1b1adf35bb | ||
![]() |
15635817b5 | ||
![]() |
0881f2dbfa | ||
![]() |
d8e9c183be | ||
![]() |
dda858c437 | ||
![]() |
a2ac883779 | ||
![]() |
af13e9a12d | ||
![]() |
d89114400c | ||
![]() |
56be300757 | ||
![]() |
91f2e9fb5e | ||
![]() |
02ef122cbb | ||
![]() |
f66361d678 | ||
![]() |
da4c2d2e3e | ||
![]() |
b73c935d36 | ||
![]() |
dfb0a512a0 |
@@ -1,6 +1,7 @@
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
group: edge
|
||||
language: c
|
||||
branches:
|
||||
except:
|
||||
|
2
Makefile
2
Makefile
@@ -419,7 +419,7 @@ define BUILD_TEST
|
||||
MAKE_TARGET := $2
|
||||
COMMAND := $1
|
||||
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
|
||||
MAKE_VARS := TEST=$$(TEST_NAME)
|
||||
MAKE_VARS := TEST=$$(TEST_NAME) FULL_TESTS=$$(FULL_TESTS)
|
||||
MAKE_MSG := $$(MSG_MAKE_TEST)
|
||||
$$(eval $$(call BUILD))
|
||||
ifneq ($$(MAKE_TARGET),clean)
|
||||
|
30
build_full_test.mk
Normal file
30
build_full_test.mk
Normal file
@@ -0,0 +1,30 @@
|
||||
# Copyright 2017 Fred Sundvik
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include $(TMK_PATH)/protocol.mk
|
||||
|
||||
TEST_PATH=tests/$(TEST)
|
||||
|
||||
$(TEST)_SRC= \
|
||||
$(TEST_PATH)/test.cpp \
|
||||
$(TMK_COMMON_SRC) \
|
||||
$(QUANTUM_SRC) \
|
||||
tests/test_common/matrix.c \
|
||||
tests/test_common/test_driver.cpp \
|
||||
tests/test_common/keyboard_report_util.cpp \
|
||||
tests/test_common/test_fixture.cpp
|
||||
$(TEST)_DEFS=$(TMK_COMMON_DEFS)
|
||||
$(TEST)_CONFIG=$(TEST_PATH)/config.h
|
||||
VPATH+=$(TOP_DIR)/tests/test_common
|
@@ -31,8 +31,6 @@ $(error MASTER does not have a valid value(left/right))
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
|
||||
KEYBOARD_PATH := keyboards/$(KEYBOARD)
|
||||
KEYBOARD_C := $(KEYBOARD_PATH)/$(KEYBOARD).c
|
||||
|
||||
@@ -42,7 +40,6 @@ else
|
||||
$(error "$(KEYBOARD_C)" does not exist)
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SUBPROJECT_PATH := keyboards/$(KEYBOARD)/$(SUBPROJECT)
|
||||
SUBPROJECT_C := $(SUBPROJECT_PATH)/$(SUBPROJECT).c
|
||||
@@ -118,139 +115,12 @@ endif
|
||||
# # project specific files
|
||||
SRC += $(KEYBOARD_C) \
|
||||
$(KEYMAP_C) \
|
||||
$(QUANTUM_DIR)/quantum.c \
|
||||
$(QUANTUM_DIR)/keymap_common.c \
|
||||
$(QUANTUM_DIR)/keycode_config.c \
|
||||
$(QUANTUM_DIR)/process_keycode/process_leader.c
|
||||
$(QUANTUM_SRC)
|
||||
|
||||
ifneq ($(SUBPROJECT),)
|
||||
SRC += $(SUBPROJECT_C)
|
||||
endif
|
||||
|
||||
ifndef CUSTOM_MATRIX
|
||||
SRC += $(QUANTUM_DIR)/matrix.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
|
||||
OPT_DEFS += -DAPI_SYSEX_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/api/api_sysex.c
|
||||
OPT_DEFS += -DAPI_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/api.c
|
||||
MIDI_ENABLE=yes
|
||||
endif
|
||||
|
||||
MUSIC_ENABLE := 0
|
||||
|
||||
ifeq ($(strip $(AUDIO_ENABLE)), yes)
|
||||
OPT_DEFS += -DAUDIO_ENABLE
|
||||
MUSIC_ENABLE := 1
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
|
||||
SRC += $(QUANTUM_DIR)/audio/audio.c
|
||||
SRC += $(QUANTUM_DIR)/audio/voices.c
|
||||
SRC += $(QUANTUM_DIR)/audio/luts.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
||||
OPT_DEFS += -DMIDI_ENABLE
|
||||
MUSIC_ENABLE := 1
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
|
||||
endif
|
||||
|
||||
ifeq ($(MUSIC_ENABLE), 1)
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(COMBO_ENABLE)), yes)
|
||||
OPT_DEFS += -DCOMBO_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
||||
OPT_DEFS += -DVIRTSER_ENABLE
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
|
||||
OPT_DEFS += -DFAUXCLICKY_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/fauxclicky.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UCIS_ENABLE)), yes)
|
||||
OPT_DEFS += -DUCIS_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
|
||||
OPT_DEFS += -DUNICODEMAP_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODE_ENABLE)), yes)
|
||||
OPT_DEFS += -DUNICODE_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODE_COMMON)), yes)
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/light_ws2812.c
|
||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||
CIE1931_CURVE = yes
|
||||
LED_BREATHING_TABLE = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||
OPT_DEFS += -DTAP_DANCE_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(PRINTING_ENABLE)), yes)
|
||||
OPT_DEFS += -DPRINTING_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
|
||||
SRC += $(TMK_DIR)/protocol/serial_uart.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
|
||||
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
|
||||
OPT_DEFS += $(SERIAL_DEFS)
|
||||
VAPTH += $(SERIAL_PATH)
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(VARIABLE_TRACE)),)
|
||||
SRC += $(QUANTUM_DIR)/variable_trace.c
|
||||
OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
|
||||
ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
|
||||
OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LCD_ENABLE)), yes)
|
||||
CIE1931_CURVE = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_ENABLE)), yes)
|
||||
CIE1931_CURVE = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CIE1931_CURVE)), yes)
|
||||
OPT_DEFS += -DUSE_CIE1931_CURVE
|
||||
LED_TABLES = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
|
||||
OPT_DEFS += -DUSE_LED_BREATHING_TABLE
|
||||
LED_TABLES = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_TABLES)), yes)
|
||||
SRC += $(QUANTUM_DIR)/led_tables.c
|
||||
endif
|
||||
|
||||
# Optimize size but this may cause error "relocation truncated to fit"
|
||||
#EXTRALDFLAGS = -Wl,--relax
|
||||
|
||||
@@ -262,9 +132,10 @@ endif
|
||||
VPATH += $(KEYBOARD_PATH)
|
||||
VPATH += $(COMMON_VPATH)
|
||||
|
||||
include common_features.mk
|
||||
include $(TMK_PATH)/protocol.mk
|
||||
|
||||
include $(TMK_PATH)/common.mk
|
||||
|
||||
SRC += $(TMK_COMMON_SRC)
|
||||
OPT_DEFS += $(TMK_COMMON_DEFS)
|
||||
EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS)
|
||||
|
@@ -40,13 +40,23 @@ VPATH +=\
|
||||
all: elf
|
||||
|
||||
VPATH += $(COMMON_VPATH)
|
||||
PLATFORM:=TEST
|
||||
|
||||
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
||||
include tests/$(TEST)/rules.mk
|
||||
endif
|
||||
|
||||
include common_features.mk
|
||||
include $(TMK_PATH)/common.mk
|
||||
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
|
||||
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
||||
include build_full_test.mk
|
||||
endif
|
||||
|
||||
$(TEST_OBJ)/$(TEST)_SRC := $($(TEST)_SRC)
|
||||
$(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
|
||||
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
|
||||
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
|
||||
|
||||
include $(TMK_PATH)/native.mk
|
||||
include $(TMK_PATH)/rules.mk
|
||||
|
@@ -11,17 +11,10 @@ QUANTUM_PATH = $(TOP_DIR)/$(QUANTUM_DIR)
|
||||
|
||||
BUILD_DIR := $(TOP_DIR)/.build
|
||||
|
||||
SERIAL_DIR := $(QUANTUM_DIR)/serial_link
|
||||
SERIAL_PATH := $(QUANTUM_PATH)/serial_link
|
||||
SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
|
||||
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
|
||||
SERIAL_DEFS += -DSERIAL_LINK_ENABLE
|
||||
|
||||
COMMON_VPATH := $(TOP_DIR)
|
||||
COMMON_VPATH += $(TMK_PATH)
|
||||
COMMON_VPATH += $(QUANTUM_PATH)
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/audio
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/api
|
||||
COMMON_VPATH += $(SERIAL_PATH)
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/api
|
153
common_features.mk
Normal file
153
common_features.mk
Normal file
@@ -0,0 +1,153 @@
|
||||
# Copyright 2017 Fred Sundvik
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
SERIAL_DIR := $(QUANTUM_DIR)/serial_link
|
||||
SERIAL_PATH := $(QUANTUM_PATH)/serial_link
|
||||
SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
|
||||
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
|
||||
SERIAL_DEFS += -DSERIAL_LINK_ENABLE
|
||||
COMMON_VPATH += $(SERIAL_PATH)
|
||||
|
||||
ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
|
||||
OPT_DEFS += -DAPI_SYSEX_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/api/api_sysex.c
|
||||
OPT_DEFS += -DAPI_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/api.c
|
||||
MIDI_ENABLE=yes
|
||||
endif
|
||||
|
||||
MUSIC_ENABLE := 0
|
||||
|
||||
ifeq ($(strip $(AUDIO_ENABLE)), yes)
|
||||
OPT_DEFS += -DAUDIO_ENABLE
|
||||
MUSIC_ENABLE := 1
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
|
||||
SRC += $(QUANTUM_DIR)/audio/audio.c
|
||||
SRC += $(QUANTUM_DIR)/audio/voices.c
|
||||
SRC += $(QUANTUM_DIR)/audio/luts.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(MIDI_ENABLE)), yes)
|
||||
OPT_DEFS += -DMIDI_ENABLE
|
||||
MUSIC_ENABLE := 1
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
|
||||
endif
|
||||
|
||||
ifeq ($(MUSIC_ENABLE), 1)
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(COMBO_ENABLE)), yes)
|
||||
OPT_DEFS += -DCOMBO_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
||||
OPT_DEFS += -DVIRTSER_ENABLE
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
|
||||
OPT_DEFS += -DFAUXCLICKY_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/fauxclicky.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UCIS_ENABLE)), yes)
|
||||
OPT_DEFS += -DUCIS_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
|
||||
OPT_DEFS += -DUNICODEMAP_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODE_ENABLE)), yes)
|
||||
OPT_DEFS += -DUNICODE_ENABLE
|
||||
UNICODE_COMMON = yes
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(UNICODE_COMMON)), yes)
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/light_ws2812.c
|
||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||
CIE1931_CURVE = yes
|
||||
LED_BREATHING_TABLE = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
|
||||
OPT_DEFS += -DTAP_DANCE_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(PRINTING_ENABLE)), yes)
|
||||
OPT_DEFS += -DPRINTING_ENABLE
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
|
||||
SRC += $(TMK_DIR)/protocol/serial_uart.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
|
||||
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
|
||||
OPT_DEFS += $(SERIAL_DEFS)
|
||||
VAPTH += $(SERIAL_PATH)
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(VARIABLE_TRACE)),)
|
||||
SRC += $(QUANTUM_DIR)/variable_trace.c
|
||||
OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
|
||||
ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
|
||||
OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LCD_ENABLE)), yes)
|
||||
CIE1931_CURVE = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||
CIE1931_CURVE = yes
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CIE1931_CURVE)), yes)
|
||||
OPT_DEFS += -DUSE_CIE1931_CURVE
|
||||
LED_TABLES = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_BREATHING_TABLE)), yes)
|
||||
OPT_DEFS += -DUSE_LED_BREATHING_TABLE
|
||||
LED_TABLES = yes
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(LED_TABLES)), yes)
|
||||
SRC += $(QUANTUM_DIR)/led_tables.c
|
||||
endif
|
||||
|
||||
QUANTUM_SRC:= \
|
||||
$(QUANTUM_DIR)/quantum.c \
|
||||
$(QUANTUM_DIR)/keymap_common.c \
|
||||
$(QUANTUM_DIR)/keycode_config.c \
|
||||
$(QUANTUM_DIR)/process_keycode/process_leader.c
|
||||
|
||||
ifndef CUSTOM_MATRIX
|
||||
QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
|
||||
endif
|
@@ -19,9 +19,11 @@
|
||||
* [FAQ: Compiling QMK](faq_build.md)
|
||||
|
||||
### For hardware makers and modders
|
||||
* [Modding your keyboard](modding_your_keyboard.md)
|
||||
* [Adding a keyboard to QMK](adding_a_keyboard_to_qmk.md)
|
||||
* [Porting your keyboard to QMK](porting_your_keyboard_to_qmk.md)
|
||||
* [Modding your keyboard](modding_your_keyboard.md)
|
||||
* [Adding features to QMK](adding_features_to_qmk.md)
|
||||
* [ISP flashing guide](isp_flashing_guide.md)
|
||||
|
||||
### Other topics
|
||||
* [General FAQ](faq.md)
|
||||
|
35
docs/adding_a_keyboard_to_qmk.md
Normal file
35
docs/adding_a_keyboard_to_qmk.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Adding your keyboard to QMK
|
||||
|
||||
We welcome all keyboard projects into QMK, but ask that you try to stick to a couple guidelines that help us keep things organised and consistent.
|
||||
|
||||
## Naming your directory/project
|
||||
|
||||
All names should be lowercase alphanumeric, and separated by an underscore (`_`), but not begin with one. Dashes (`-`) aren't allow by our build system, and will confuse it with keymaps/subprojects. Your directory and your `.h` and `.c` files should have exactly the same name. Subprojects/revision should follow the same format.
|
||||
|
||||
## `readme.md`
|
||||
|
||||
All projects need to have a `readme.md` file that explains what the keyboard is, who made it, where it is available, and links to move information (template coming).
|
||||
|
||||
## Image/Hardware files
|
||||
|
||||
In an effort to keep the repo size down, we're no longer accepting images of any format in the repo, with few exceptions. Hosting them elsewhere (imgur) and linking them in the readme.md is the preferred method.
|
||||
|
||||
Any sort of hardware file (plate, case, pcb) can't be stored in qmk_firmware, but we have the [qmk.fm repo](https://github.com/qmk/qmk.fm) where such files (as well as in-depth info) can be store, and viewed on [qmk.fm](http://qmk.fm). Downloadable files are stored in `/<keyboard>/` (name follows the same format as above) which are served at `http://qmk.fm/<keyboard>/`, and pages are generated from `/_pages/<keyboard>/` which are served at the same location (.md files are generated into .html files through Jekyll). Check out the `lets_split` directory for an example.
|
||||
|
||||
## Non-production/handwired projects
|
||||
|
||||
We're happy to accept any project that uses QMK, including prototypes and handwired ones, but we have a separate `/keyboards/handwired/` folder for them, so the main `/keyboards/` folder doesn't get overcrowded. If a prototype project becomes a production project at some point in the future, we'd be happy to move it to the main `/keyboards/` folder!
|
||||
|
||||
## Warnings as errors
|
||||
|
||||
When developing your keyboard, keep in mind that all warnings will be treated as errors - these small warnings can build-up and cause larger errors down the road (and keeping them is generally a bad practice).
|
||||
|
||||
## Licenses
|
||||
|
||||
If you're adapting your keyboard's setup from another project, but not using the same code, but sure to update the copyright header at the top of the files to show your name, it this format:
|
||||
|
||||
Copyright 2017 Your Name <your@email.com>
|
||||
|
||||
## Technical details
|
||||
|
||||
If you're looking for more information on making your keyboard work with QMK, [check out this guide](porting_your_keyboard_to_qmk.md)!
|
106
docs/isp_flashing_guide.md
Normal file
106
docs/isp_flashing_guide.md
Normal file
@@ -0,0 +1,106 @@
|
||||
# ISP Flashing Guide
|
||||
|
||||
If you're having trouble flashing/erasing your board, and running into cryptic error messages like any of the following:
|
||||
|
||||
libusb: warning [darwin_transfer_status] transfer error: timed out
|
||||
dfu.c:844: -ETIMEDOUT: Transfer timed out, NAK 0xffffffc4 (-60)
|
||||
atmel.c:1627: atmel_flash: flash data dfu_download failed.
|
||||
atmel.c:1629: Expected message length of 1072, got -60.
|
||||
atmel.c:1434: Error flashing the block: err -2.
|
||||
ERROR
|
||||
Memory write error, use debug for more info.
|
||||
commands.c:360: Error writing memory data. (err -4)
|
||||
|
||||
dfu.c:844: -EPIPE: a) Babble detect or b) Endpoint stalled 0xffffffe0 (-32)
|
||||
Device is write protected.
|
||||
dfu.c:252: dfu_clear_status( 0x7fff4fc2ea80 )
|
||||
atmel.c:1434: Error flashing the block: err -2.
|
||||
ERROR
|
||||
Memory write error, use debug for more info.
|
||||
commands.c:360: Error writing memory data. (err -4)
|
||||
|
||||
You're likely going to need to ISP flash your board/device to get it working again. Luckily, this process is pretty straight-forward, provided you have any extra programmable keyboard, Arduino, or Teensy 2.0/Teensy 2.0++. There are also dedicated ISP flashers available for this, but most cost >$15, and it's assumed that if you are googling this error, this is the first you've heard about ISP flashing, and don't have one readily available (whereas you might have some other AVR board). __We'll be using a Teensy 2.0 with Windows 10 in this guide__ - if you are comfortable doing this on another system, please consider editing this guide and contributing those instructions!
|
||||
|
||||
## Software needed
|
||||
|
||||
* [The Arduino IDE](https://www.arduino.cc/en/Main/Software)
|
||||
* [Teensyduino](https://www.pjrc.com/teensy/td_download.html) (if you're using a Teensy)
|
||||
* [WinAVR](http://www.ladyada.net/learn/avr/setup-win.html) (Windows)
|
||||
|
||||
## Wiring
|
||||
|
||||
This is pretty straight-forward - we'll be connecting like-things to like-things in the following manner:
|
||||
|
||||
Flasher B0 <-> Keyboard RESET
|
||||
Flasher B1 <-> Keyboard B1 (SCLK)
|
||||
Flasher B2 <-> Keyboard B2 (MOSI)
|
||||
Flasher B3 <-> Keyboard B3 (MISO)
|
||||
Flasher VCC <-> Keyboard VCC
|
||||
Flasher GND <-> Keyboard GND
|
||||
|
||||
## The ISP firmware
|
||||
|
||||
Make sure your keyboard is unplugged from any device, and plug in your Teensy.
|
||||
|
||||
1. Run Arduino after you have everything installed
|
||||
2. Select `Tools > Board * > Teensy 2.0`
|
||||
3. Click `File > Examples > 11.ArduinoISP > ArduinoISP`
|
||||
|
||||
Then scroll down until you see something that looks like this block of code:
|
||||
|
||||
// Configure which pins to use:
|
||||
|
||||
// The standard pin configuration.
|
||||
#ifndef ARDUINO_HOODLOADER2
|
||||
|
||||
#define RESET 0 // Use 0 (B0) instead of 10
|
||||
#define LED_HB 11 // Use 11 (LED on the Teensy 2.0)
|
||||
#define LED_ERR 8 // This won't be used unless you have an LED hooked-up to 8 (D3)
|
||||
#define LED_PMODE 7 // This won't be used unless you have an LED hooked-up to 7 (D2)
|
||||
|
||||
And make the changes in the last four lines. If you're using something besides the Teenys 2.0, you'll want to choose something else that makes sense for `LED_HB`. We define `RESET` as `0`/`B0` because that's what's close - if you want to use another pin for some reason, [you can use the pinouts to choose something else](https://www.pjrc.com/teensy/pinout.html).
|
||||
|
||||
Once you've made your changes, you can click the Upload button (right arrow), which will open up the Teensy flasher app - you'll need to press the reset button on the Teensy the first time, but after that, it's automatic (you shouldn't be flashing this more than once, though). Once flashed, the orange LED on the Teensy will flash on and off, indicating it's ready for some action.
|
||||
|
||||
## The .hex file
|
||||
|
||||
Before flashing your firmware, you're going to need to and do a little preparation. We'll be appending [this bootloader (also a .hex file)](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) to the end of our firmware by opening the original .hex file in a text editor, and removing the last line, which should be `:00000001FF` (this is an EOF message). After that's been removed, copy the entire bootloader's contents and paste it at the end of the original file, and save it.
|
||||
|
||||
It's possible to use other bootloaders here in the same way, but __you need a bootloader__, otherwise you'll have to ISP to write new firmware to your keyboard.
|
||||
|
||||
## Flashing your firmware
|
||||
|
||||
Make sure your keyboard is unplugged from any device, and plug in your Teensy.
|
||||
|
||||
Open `cmd` and navigate to your where your modified .hex file is. We'll pretend this file is called `main.hex`, and that your Teensy 2.0 is on the `COM3` port - if you're unsure, you can open your Device Manager, and look for `Ports > USB Serial Device`. Use that COM port here. You can confirm it's the right port with:
|
||||
|
||||
avrdude -c avrisp -P COM3 -p atmega32u4
|
||||
|
||||
and you should get something like the following output:
|
||||
|
||||
avrdude: AVR device initialized and ready to accept instructions
|
||||
|
||||
Reading | ################################################## | 100% 0.02s
|
||||
|
||||
avrdude: Device signature = 0x1e9587
|
||||
|
||||
avrdude: safemode: Fuses OK
|
||||
|
||||
avrdude done. Thank you.
|
||||
|
||||
Since our keyboard uses an `atmega32u4` (common), that is the chip we'll specify. This is the full command:
|
||||
|
||||
avrdude -c avrisp -P COM3 -p atmega32u4 -U flash:w:main.hex:i
|
||||
|
||||
You should see a couple of progress bars, then you should see:
|
||||
|
||||
avrdude: verifying ...
|
||||
avrdude: 32768 bytes of flash verified
|
||||
|
||||
avrdude: safemode: Fuses OK
|
||||
|
||||
avrdude done. Thank you.
|
||||
|
||||
Which means everything should be ok! Your board may restart automatically, otherwise, unplug your Teensy and plug in your keyboard - you can leave your Teensy wired to your keyboard while testing things, but it's recommended that you desolder it/remove the wiring once you're sure everything works.
|
||||
|
||||
If you have any questions/problems, feel free to [open an issue](https://github.com/qmk/qmk_firmware/issues/new)!
|
@@ -7,7 +7,7 @@ In rare circumstances, your keyboard/device can become unwritable, and `dfu-prog
|
||||
[ X ERROR
|
||||
Memory write error, use debug for more info.
|
||||
|
||||
Currently the only way to solve this is to [reprogram the chip via ISP](https://www.reddit.com/r/olkb/comments/4rjzen/flashing_error_on_mac_os_x/d52rj8o/). This requires another device to be hooked up to a couple of exposed pins on the PCB. There is a guide on how to do this [here](https://learn.sparkfun.com/tutorials/installing-an-arduino-bootloader), and [this is where things are on the Planck PCB](http://imgur.com/lvbxbHt).
|
||||
Currently the only way to solve this is to [reprogram the chip via ISP](https://www.reddit.com/r/olkb/comments/4rjzen/flashing_error_on_mac_os_x/d52rj8o/). This requires another device to be hooked up to a couple of exposed pins on the PCB. __[We now have a guide on ISP flashing](isp_flashing_guide.md)__ and [this is where things are on the Planck PCB](http://imgur.com/lvbxbHt).
|
||||
|
||||
An example command to flash the board once things are hooked up is:
|
||||
|
||||
|
@@ -1,3 +1,7 @@
|
||||
# Porting your keyboard to QMK
|
||||
|
||||
This page describes the technical details of porting an existing keyboard to QMK. If you're looking to add your keyboard to QMK, please [look through these guidelines](adding_a_keyboard_to_qmk.md)!
|
||||
|
||||
If your keyboard is running an Atmega chip (atmega32u4 and others), it's pretty easy to get things setup for compiling your own firmware to flash onto your board. There is a `/util/new_project.sh <keyboard>` script to help get you started - you can simply pass your keyboard's name into the script, and all of the necessary files will be created. The components of each are described below.
|
||||
|
||||
## `/keyboards/<keyboard>/config.h`
|
||||
@@ -34,7 +38,7 @@ At the bottom of the file, you'll find lots of features to turn on and off - all
|
||||
|
||||
## `/keyboards/<keyboard>/readme.md`
|
||||
|
||||
This is where you'll describe your keyboard - please write as much as you can about it! Talking about default functionality/features is useful here. Feel free to link to external pages/sites if necessary. Images can be included here as well. This file will be rendered into a webpage at qmk.fm/keyboards/<keyboard>/.
|
||||
This is where you'll describe your keyboard - please write as much as you can about it! Talking about default functionality/features is useful here. Feel free to link to external pages/sites if necessary. Images can be included here as well, as long as they're hosted elsewhere (imgur).
|
||||
|
||||
## `/keyboards/<keyboard>/<keyboard>.c`
|
||||
|
||||
|
@@ -35,8 +35,8 @@ void promicro_bootloader_jmp(bool program);
|
||||
{ KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_NO, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b }, \
|
||||
{ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_NO, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b }, \
|
||||
{ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_NO, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b }, \
|
||||
{ KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k46, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b }, \
|
||||
{ KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k47, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b, KC_##k4c, KC_##k4d } \
|
||||
{ KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k47, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b }, \
|
||||
{ KC_##k40, KC_##k41, KC_##k42, KC_##k43, KC_##k44, KC_##k45, KC_##k46, KC_##k48, KC_##k49, KC_##k4a, KC_##k4b, KC_##k4c, KC_##k4d } \
|
||||
}
|
||||
|
||||
#endif
|
||||
|
4
keyboards/atreus62/keymaps/atreus52/Makefile
Normal file
4
keyboards/atreus62/keymaps/atreus52/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
NKRO_ENABLE = true
|
||||
MOUSEKEY_ENABLE = no
|
||||
EXTRAKEY_ENABLE = yes
|
||||
CONSOLE_ENABLE = no
|
10
keyboards/atreus62/keymaps/atreus52/README.md
Normal file
10
keyboards/atreus62/keymaps/atreus52/README.md
Normal file
@@ -0,0 +1,10 @@
|
||||
<!-- -*- mode: markdown; fill-column: 8192 -*- -->
|
||||
|
||||
Atreus52 Modification
|
||||
=======================
|
||||
|
||||
Firmware for my custom keyboard based on the Atreus layout, but with 5 rows and only 5 columns per hand.
|
||||
More documentation coming soon.
|
||||
|
||||
# License
|
||||
GPL-3+
|
18
keyboards/atreus62/keymaps/atreus52/config.h
Normal file
18
keyboards/atreus62/keymaps/atreus52/config.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "../../config.h"
|
||||
|
||||
#undef MANUFACTURER
|
||||
#undef PRODUCT
|
||||
#undef DESCRIPTION
|
||||
#undef MATRIX_ROW_PINS
|
||||
#undef MATRIX_COL_PINS
|
||||
#undef DIODE_DIRECTION
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define MANUFACTURER Mesh Industries
|
||||
#define PRODUCT Atreus52 Treeboard
|
||||
#define DESCRIPTION q.m.k. keyboard firmware for Atreus52
|
||||
|
||||
#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 }
|
||||
#define MATRIX_COL_PINS { B2, B1, F7, F6, F5, F4, B6, D3, D2, D1, D0, D4, B3 }
|
||||
|
||||
#define DIODE_DIRECTION COL2ROW
|
99
keyboards/atreus62/keymaps/atreus52/keymap.c
Normal file
99
keyboards/atreus62/keymaps/atreus52/keymap.c
Normal file
@@ -0,0 +1,99 @@
|
||||
#include "atreus62.h"
|
||||
|
||||
// Layers
|
||||
#define DVORAK 0
|
||||
#define QWERTY 1
|
||||
#define RAISE 2
|
||||
#define LOWER 3
|
||||
#define BDO 4
|
||||
#define RESETL 5
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[DVORAK] = KC_KEYMAP(
|
||||
NO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, NO, \
|
||||
NO, QUOT, COMM, DOT, P, Y, F, G, C, R, L, NO, \
|
||||
NO, A, O, E, U, I, D, H, T, N, S, NO, \
|
||||
NO, SCLN, Q, J, K, X, B, M, W, V, Z, NO, \
|
||||
NO, FN2, LALT, LCTL, FN1, LSFT, BSPC, ENT, SPC, FN0, LGUI, LEFT, RGHT, NO ),
|
||||
|
||||
[QWERTY] = KC_KEYMAP(
|
||||
NO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, NO, \
|
||||
NO, Q, W, E, R, T, Y, U, I, O, P, NO, \
|
||||
NO, A, S, D, F, G, H, J, K, L, SCLN, NO, \
|
||||
NO, Z, X, C, V, B, N, M, COMM, DOT, SLSH, NO, \
|
||||
NO, FN2, LALT, LCTL, FN1, LSFT, BSPC, ENT, SPC, FN0, LGUI, LEFT, RGHT, NO ),
|
||||
|
||||
[RAISE] = KC_KEYMAP(
|
||||
NO, MRWD, MPRV, MPLY, MNXT, MFFD, TRNS, MUTE, VOLD, VOLU, DEL, NO, \
|
||||
NO, TILD, GRV, LCBR, RCBR, DQUO, QUOT, EQL, PLUS, MINS, QUES, NO, \
|
||||
NO, ESC, TAB, LPRN, RPRN, BSLS, SLSH, LEFT, DOWN, UP, RGHT, NO, \
|
||||
NO, TRNS, TRNS, LBRC, RBRC, TRNS, INS, PIPE, UNDS, TRNS, TRNS, NO, \
|
||||
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, FN3, NO ),
|
||||
|
||||
[LOWER] = KC_KEYMAP(
|
||||
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, NO, \
|
||||
NO, EXLM, AT, HASH, DLR, PERC, CIRC, AMPR, ASTR, LPRN, RPRN, NO, \
|
||||
NO, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, NO, \
|
||||
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, DOT, TRNS, TRNS, TRNS, NO, \
|
||||
NO, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, NO ),
|
||||
|
||||
[BDO] = KC_KEYMAP(
|
||||
NO, ESC, 1, 2, 3, 4, 5, 0, SLSH, U, C, NO, \
|
||||
NO, TAB, Q, W, E, R, 6, Y, I, O, P, NO, \
|
||||
NO, LSFT, A, S, D, F, 7, G, H, J, K, NO, \
|
||||
NO, T, Z, X, C, V, 8, B, N, M, L, NO, \
|
||||
NO, LCTL, SPC, SPC, SPC, SPC, COMM, ENT, 9, NO, NO, NO, FN2, NO ),
|
||||
|
||||
[RESETL] = KEYMAP(
|
||||
KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \
|
||||
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_FN3,KC_NO )
|
||||
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_MOMENTARY(RAISE), // Raise layer
|
||||
[1] = ACTION_LAYER_MOMENTARY(LOWER), // Lower layer
|
||||
[2] = ACTION_LAYER_TOGGLE(BDO), // BDO layer
|
||||
[3] = ACTION_LAYER_TOGGLE(RESETL) // RESET layer
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch (id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
}
|
||||
else {
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
static uint8_t qw_dv_swap_state = 0;
|
||||
|
||||
bool process_record_user (uint16_t keycode, keyrecord_t *record) {
|
||||
if (keycode == KC_LGUI) {
|
||||
if (record->event.pressed)
|
||||
qw_dv_swap_state |= 0b00000001;
|
||||
else
|
||||
qw_dv_swap_state &= ~(0b00000001);
|
||||
}
|
||||
if (keycode == KC_LCTL) {
|
||||
if (record->event.pressed)
|
||||
qw_dv_swap_state |= 0b00000010;
|
||||
else
|
||||
qw_dv_swap_state &= ~(0b00000010);
|
||||
}
|
||||
|
||||
if (qw_dv_swap_state == 0b00000011) {
|
||||
layer_invert(DVORAK);
|
||||
}
|
||||
return true;
|
||||
}
|
@@ -6,3 +6,4 @@ MIDI_ENABLE = yes
|
||||
|
||||
# if MIDI_ENABLE is set to yes, then CONSOLE_ENABLE has to be disabled, because of the firmware size
|
||||
CONSOLE_ENABLE = false
|
||||
COMMAND_ENABLE = no
|
||||
|
@@ -26,4 +26,19 @@
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
#define MIDI_TONE_KEYCODE_OCTAVES 2
|
||||
|
||||
/* Disabling rollover allows you to use the opposite shift key to cancel the space cadet state in the event
|
||||
of an erroneous press instead of emitting a pair of parentheses when the keys are released.
|
||||
*/
|
||||
#define DISABLE_SPACE_CADET_ROLLOVER
|
||||
|
||||
/*
|
||||
Setting the Space Cadet Parens for German layout
|
||||
|
||||
Default is
|
||||
#define LSPO_KEY KC_9
|
||||
#define RSPC_KEY KC_0
|
||||
*/
|
||||
#define LSPO_KEY KC_8
|
||||
#define RSPC_KEY KC_9
|
||||
|
||||
#endif
|
||||
|
@@ -4,6 +4,8 @@
|
||||
#define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
|
||||
#define _______ KC_TRNS
|
||||
#define xxxxxxx KC_NO
|
||||
#define HPR_TAB ALL_T(KC_TAB)
|
||||
#define CTL_ESC CTL_T(KC_ESC)
|
||||
|
||||
// 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.
|
||||
@@ -21,64 +23,73 @@
|
||||
#define TO_MIDI _______
|
||||
#endif
|
||||
|
||||
#define TO_BASE TO(_BL)
|
||||
#define MO_FUNC MO(_FL)
|
||||
#define MEDIA MO(_ME)
|
||||
#define MO_CTL MO(_CL)
|
||||
#define L_MOUSE LT(_ML, KC_SPC)
|
||||
#define ESC_FUN LT(_FL, KC_ESC)
|
||||
|
||||
#define ESC_GRV F(0)
|
||||
#define RGB_RST F(1)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap _BL: Base Layer (Default Layer)
|
||||
*/
|
||||
/* Keymap _BL: Base Layer (Default Layer) */
|
||||
[_BL] = KEYMAP(
|
||||
F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, KC_INS, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \
|
||||
MO(_FL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
|
||||
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, _______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_RALT, MO(_ME), MO(_FL), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
ESC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, _______, KC_BSPC, KC_INS, \
|
||||
HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, \
|
||||
ESC_FUN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, \
|
||||
KC_LSPO, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, KC_RSPC, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT,_______, L_MOUSE, L_MOUSE, _______, KC_RALT, KC_RCTL, MO_FUNC, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
/* Keymap _FL: Function Layer */
|
||||
[_FL] = KEYMAP(
|
||||
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, _______, _______, BL_STEP, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,KC_PSCR,_______, KC_PAUS, _______, _______, _______, _______, \
|
||||
MO(_FL), _______, MO(_CL),_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP,KC_RGHT, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,MO(_ME),_______, _______, TO_MIDI, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______,_______, _______,_______, _______, _______, _______, MO(_FL), KC_HOME, KC_PGDN, KC_END),
|
||||
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, _______, _______, BL_STEP, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, KC_PAUS, _______, _______, _______, _______, \
|
||||
_______, _______, MO_CTL, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, MEDIA, _______, _______, TO_MIDI, _______, _______, KC_PGUP, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, MO_FUNC, KC_HOME, KC_PGDN, KC_END),
|
||||
|
||||
/* Keymap _ME: Media layer */
|
||||
[_ME] = KEYMAP(
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_VOLD, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
MO(_FL), _______, _______,_______,_______,_______,_______,_______,MO(_ME),_______, _______, _______, _______, MO(_FL), _______, \
|
||||
_______, _______, _______,_______, _______,_______, _______, _______, _______, _______, KC_MPRV, KC_MPLY,KC_MNXT),
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, MEDIA, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT),
|
||||
|
||||
/* Keymap _CL: Control layer */
|
||||
[_CL] = KEYMAP(
|
||||
_______, F(1), _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
|
||||
_______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, \
|
||||
_______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, \
|
||||
MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, \
|
||||
_______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
|
||||
_______, RGB_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, \
|
||||
_______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \
|
||||
_______, _______, MO_CTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, \
|
||||
_______, _______, _______, _______, RGB_MOD, RGB_MOD, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI),
|
||||
|
||||
/* Keymap _ML: Mouse layer */
|
||||
[_ML] = KEYMAP(
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, KC_BTN3,KC_BTN2,KC_BTN1,_______,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R, _______, _______, _______, _______, \
|
||||
_______, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, KC_MS_U, \
|
||||
_______, _______, _______,_______, LT(_ML, KC_SPC),LT(_ML, KC_SPC), _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_D,KC_MS_R),
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, KC_BTN3, KC_BTN2, KC_BTN1, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_U, \
|
||||
_______, _______, _______, _______, L_MOUSE, L_MOUSE, _______, KC_BTN1, KC_BTN2, KC_BTN3, KC_MS_L, KC_MS_D, KC_MS_R),
|
||||
|
||||
#if defined(MIDI_ENABLE) && defined(MIDI_ADVANCED)
|
||||
/* Keymap _MI: MIDI layer (Advanced)*/
|
||||
[_MI] = KEYMAP(
|
||||
TO(_BL),MI_VEL_1,MI_VEL_2,MI_VEL_3,MI_VEL_4,MI_VEL_5,MI_VEL_6,MI_VEL_7,MI_VEL_8,MI_VEL_9,MI_VEL_10, MI_CHD, MI_CHU, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, MI_Cs, MI_Ds, xxxxxxx, MI_Fs, MI_Gs, MI_As, xxxxxxx, MI_Cs_1, MI_Ds_1, xxxxxxx, MI_Fs_1, xxxxxxx, xxxxxxx, \
|
||||
MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, MI_G_1, xxxxxxx, \
|
||||
MI_SUS, xxxxxxx, MI_OCTD, MI_OCTU,MI_MODSD,MI_MODSU, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, MI_TRNSD,MI_TRNSU,MI_TRNS_0, MI_SUS, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx, MI_ALLOFF,MI_ALLOFF, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx),
|
||||
TO_BASE,MI_VEL_1,MI_VEL_2,MI_VEL_3,MI_VEL_4,MI_VEL_5,MI_VEL_6,MI_VEL_7,MI_VEL_8,MI_VEL_9,MI_VEL_10, MI_CHD, MI_CHU, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, MI_Cs, MI_Ds, xxxxxxx, MI_Fs, MI_Gs, MI_As, xxxxxxx, MI_Cs_1, MI_Ds_1, xxxxxxx, MI_Fs_1, xxxxxxx, xxxxxxx, \
|
||||
MI_MOD, MI_C, MI_D, MI_E, MI_F, MI_G, MI_A, MI_B, MI_C_1, MI_D_1, MI_E_1, MI_F_1, MI_G_1, xxxxxxx, \
|
||||
MI_SUS, xxxxxxx, MI_OCTD, MI_OCTU,MI_MODSD,MI_MODSU, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, MI_TRNSD,MI_TRNSU,MI_TRNS_0, MI_SUS, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx, MI_ALLOFF, MI_ALLOFF, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx),
|
||||
#elif defined(MIDI_ENABLE) && defined(MIDI_BASIC)
|
||||
/* Keymap _MI: MIDI layer (Basic)*/
|
||||
[_MI] = KEYMAP(
|
||||
TO(_BL), xxxxxxx, xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, MI_ON, MI_OFF,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx,xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx, xxxxxxx,xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx,xxxxxxx),
|
||||
TO_BASE, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, MI_ON, MI_OFF, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, \
|
||||
xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx),
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -125,7 +136,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
rgblight_mode(1);
|
||||
if (record->event.pressed) {
|
||||
rgblight_mode(1);
|
||||
rgblight_sethsv(206, 255, 255);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +157,7 @@ enum layer_id {
|
||||
void clueboard_set_led(uint8_t id, uint8_t val) {
|
||||
switch (id) {
|
||||
case LAYER_BASE:
|
||||
rgblight_sethsv_noeeprom(346, 0, val);
|
||||
rgblight_sethsv_noeeprom(0, 0, val);
|
||||
break;
|
||||
case LAYER_FUNCTION:
|
||||
rgblight_sethsv_noeeprom(46, 255, val);
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# Layout of @magicmonty
|
||||
|
||||
[Keyboard Layout Editor File](http://www.keyboard-layout-editor.com/#/gists/f869b8789242a712e0f46eabbd550056)
|
||||
[Keyboard Layout Editor File]
|
||||
|
||||

|
||||

|
||||
|
||||
This layout is a combination of the `mouse_keys` and the `win_optimized` layouts.
|
||||
This layout is optimized for an ISO layout.
|
||||
@@ -14,7 +14,9 @@ The Left, Down, Up and Right for the mouse movement are also VIM-Like on the HJK
|
||||
|
||||
There is also a MIDI layer included.
|
||||
|
||||
The CapsLock is disabled and works as Function key.
|
||||
The CapsLock is disabled and works as Escape when tapped and Fn when Hold.
|
||||
The Tab key works as Tab when tapped, and [Hyper] (Ctrl + Alt + Shift + Cmd) when hold
|
||||
The Shift-Keys are configured as [Space Cadet Shift Parentheses]
|
||||
|
||||
There is also a separate media layer with Volume/Play controls
|
||||
|
||||
@@ -25,3 +27,8 @@ The different layers are signalled throug setting of the underlight:
|
||||
- Media layer: Green
|
||||
- Mouse layer: Blue
|
||||
- Control layer: Red
|
||||
- Midi layer: Purple
|
||||
|
||||
[Hyper]: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
|
||||
[Space Cadet Shift Parentheses]: http://stevelosh.com/blog/2012/10/a-modern-space-cadet/#shift-parentheses
|
||||
[Keyboard Layout Editor File]: http://www.keyboard-layout-editor.com/#/gists/f869b8789242a712e0f46eabbd550056
|
||||
|
@@ -1,6 +1,30 @@
|
||||
#include "ez.h"
|
||||
#include "i2cmaster.h"
|
||||
|
||||
|
||||
extern inline void ergodox_board_led_on(void);
|
||||
extern inline void ergodox_right_led_1_on(void);
|
||||
extern inline void ergodox_right_led_2_on(void);
|
||||
extern inline void ergodox_right_led_3_on(void);
|
||||
extern inline void ergodox_right_led_on(uint8_t led);
|
||||
|
||||
extern inline void ergodox_board_led_off(void);
|
||||
extern inline void ergodox_right_led_1_off(void);
|
||||
extern inline void ergodox_right_led_2_off(void);
|
||||
extern inline void ergodox_right_led_3_off(void);
|
||||
extern inline void ergodox_right_led_off(uint8_t led);
|
||||
|
||||
extern inline void ergodox_led_all_on(void);
|
||||
extern inline void ergodox_led_all_off(void);
|
||||
|
||||
extern inline void ergodox_right_led_1_set(uint8_t n);
|
||||
extern inline void ergodox_right_led_2_set(uint8_t n);
|
||||
extern inline void ergodox_right_led_3_set(uint8_t n);
|
||||
extern inline void ergodox_right_led_set(uint8_t led, uint8_t n);
|
||||
|
||||
extern inline void ergodox_led_all_set(uint8_t n);
|
||||
|
||||
|
||||
bool i2c_initialized = 0;
|
||||
uint8_t mcp23018_status = 0x20;
|
||||
|
||||
@@ -57,7 +81,7 @@ uint8_t init_mcp23018(void) {
|
||||
// cli();
|
||||
if (i2c_initialized == 0) {
|
||||
i2c_init(); // on pins D(1,0)
|
||||
i2c_initialized++;
|
||||
i2c_initialized = true;
|
||||
_delay_ms(1000);
|
||||
}
|
||||
|
||||
|
@@ -25,43 +25,90 @@
|
||||
#include "lcd_backlight_keyframes.h"
|
||||
#endif
|
||||
|
||||
#ifdef LED_ENABLE
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
#include "led_keyframes.h"
|
||||
#endif
|
||||
|
||||
#include "visualizer_keyframes.h"
|
||||
|
||||
|
||||
#if defined(LCD_ENABLE) && defined(LCD_BACKLIGHT_ENABLE)
|
||||
#if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE)
|
||||
|
||||
static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
|
||||
#ifdef LCD_ENABLE
|
||||
lcd_keyframe_enable(animation, state);
|
||||
#endif
|
||||
#ifdef LCD_BACKLIGHT_ENABLE
|
||||
backlight_keyframe_enable(animation, state);
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
led_keyframe_enable(animation, state);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
|
||||
#ifdef LCD_ENABLE
|
||||
lcd_keyframe_disable(animation, state);
|
||||
#endif
|
||||
#ifdef LCD_BACKLIGHT_ENABLE
|
||||
backlight_keyframe_disable(animation, state);
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
led_keyframe_disable(animation, state);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) {
|
||||
bool ret = false;
|
||||
#ifdef LCD_BACKLIGHT_ENABLE
|
||||
ret |= backlight_keyframe_animate_color(animation, state);
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
ret |= led_keyframe_fade_in_all(animation, state);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) {
|
||||
bool ret = false;
|
||||
#ifdef LCD_BACKLIGHT_ENABLE
|
||||
ret |= backlight_keyframe_animate_color(animation, state);
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
ret |= led_keyframe_fade_out_all(animation, state);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
// Don't worry, if the startup animation is long, you can use the keyboard like normal
|
||||
// during that time
|
||||
keyframe_animation_t default_startup_animation = {
|
||||
.num_frames = 4,
|
||||
.num_frames = 3,
|
||||
.loop = false,
|
||||
.frame_lengths = {0, 0, 0, gfxMillisecondsToTicks(5000), 0},
|
||||
.frame_lengths = {0, 0, gfxMillisecondsToTicks(5000)},
|
||||
.frame_functions = {
|
||||
lcd_keyframe_enable,
|
||||
backlight_keyframe_enable,
|
||||
keyframe_enable,
|
||||
lcd_keyframe_draw_logo,
|
||||
backlight_keyframe_animate_color,
|
||||
keyframe_fade_in,
|
||||
},
|
||||
};
|
||||
|
||||
keyframe_animation_t default_suspend_animation = {
|
||||
.num_frames = 4,
|
||||
.num_frames = 3,
|
||||
.loop = false,
|
||||
.frame_lengths = {0, gfxMillisecondsToTicks(1000), 0, 0},
|
||||
.frame_lengths = {0, gfxMillisecondsToTicks(1000), 0},
|
||||
.frame_functions = {
|
||||
lcd_keyframe_display_layer_text,
|
||||
backlight_keyframe_animate_color,
|
||||
lcd_keyframe_disable,
|
||||
backlight_keyframe_disable,
|
||||
keyframe_fade_out,
|
||||
keyframe_disable,
|
||||
},
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(LED_ENABLE)
|
||||
#if defined(BACKLIGHT_ENABLE)
|
||||
#define CROSSFADE_TIME 1000
|
||||
#define GRADIENT_TIME 3000
|
||||
|
||||
|
@@ -43,7 +43,7 @@ extern const uint8_t CIE1931_CURVE[];
|
||||
#define GDISP_INITIAL_CONTRAST 0
|
||||
#endif
|
||||
#ifndef GDISP_INITIAL_BACKLIGHT
|
||||
#define GDISP_INITIAL_BACKLIGHT 100
|
||||
#define GDISP_INITIAL_BACKLIGHT 0
|
||||
#endif
|
||||
|
||||
#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0)
|
||||
@@ -173,7 +173,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||
}
|
||||
|
||||
// software shutdown disable (i.e. turn stuff on)
|
||||
write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON);
|
||||
write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
|
||||
gfxSleepMilliseconds(10);
|
||||
|
||||
// Finish Init
|
||||
@@ -183,7 +183,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||
g->g.Width = GDISP_SCREEN_WIDTH;
|
||||
g->g.Height = GDISP_SCREEN_HEIGHT;
|
||||
g->g.Orientation = GDISP_ROTATE_0;
|
||||
g->g.Powermode = powerOn;
|
||||
g->g.Powermode = powerOff;
|
||||
g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
|
||||
g->g.Contrast = GDISP_INITIAL_CONTRAST;
|
||||
return TRUE;
|
||||
@@ -204,7 +204,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||
uint8_t* src = PRIV(g)->frame_buffer;
|
||||
for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) {
|
||||
for (int x=0;x<GDISP_SCREEN_WIDTH;x++) {
|
||||
PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[*src];
|
||||
uint8_t val = (uint16_t)*src * g->g.Backlight / 100;
|
||||
PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[val];
|
||||
++src;
|
||||
}
|
||||
}
|
||||
@@ -297,8 +298,13 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
||||
g->g.Orientation = (orientation_t)g->p.ptr;
|
||||
return;
|
||||
|
||||
case GDISP_CONTROL_CONTRAST:
|
||||
return;
|
||||
case GDISP_CONTROL_BACKLIGHT:
|
||||
if (g->g.Backlight == (unsigned)g->p.ptr)
|
||||
return;
|
||||
unsigned val = (unsigned)g->p.ptr;
|
||||
g->g.Backlight = val > 100 ? 100 : val;
|
||||
g->flags |= GDISP_FLG_NEEDFLUSH;
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif // GDISP_NEED_CONTROL
|
||||
|
@@ -62,15 +62,10 @@ CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
SERIAL_LINK_ENABLE = yes
|
||||
VISUALIZER_ENABLE ?= yes
|
||||
LCD_ENABLE ?= yes
|
||||
LED_ENABLE ?= no
|
||||
BACKLIGHT_ENABLE ?= yes
|
||||
LCD_BACKLIGHT_ENABLE ?= yes
|
||||
MIDI_ENABLE = no
|
||||
RGBLIGHT_ENABLE = no
|
||||
|
||||
ifdef LCD_ENABLE
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
|
||||
endif
|
||||
|
||||
ifdef LED_ENABLE
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
|
||||
endif
|
||||
include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk
|
@@ -1,7 +1,6 @@
|
||||
SUBPROJECT_DEFAULT = infinity
|
||||
LCD_BACKLIGHT_ENABLE = yes
|
||||
LCD_ENABLE = yes
|
||||
LED_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = yes
|
||||
NKRO_ENABLE = yes
|
||||
TAP_DANCE_ENABLE = yes
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI |
|
||||
`----------------------------------' `----------------------------------'
|
||||
,-------------. ,-------------.
|
||||
| Home | End | | Alt |Ctrl/Esc|
|
||||
| Copy | Paste| | Alt |Ctrl/Esc|
|
||||
,------|------|------| |------+--------+------.
|
||||
| | | PgUp | | PgDn | | |
|
||||
| Bcksp|OSL(2)|------| |------| Ent |Space |
|
||||
@@ -32,23 +32,28 @@
|
||||
| | | | | | | F10 | | F11 | | | | | | |
|
||||
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
| | | | | | |------| |------| | | | | | |
|
||||
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
|--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------|
|
||||
| | | | | | | | | | | | | | | |
|
||||
`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
| | | | | | | | | | | |
|
||||
| | | | | | | F12 |GoToIm| FAR | | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
,-------------. ,---------------.
|
||||
|Format| | | Test | DTest |
|
||||
|Format|Build | | Test | DTest |
|
||||
,------|------|------| |------+--------+------.
|
||||
| | |Refact| | | | |
|
||||
| | |Refact| |Sort U| | |
|
||||
| | |------| |------| | |
|
||||
| | | | | | | |
|
||||
`--------------------' `----------------------'
|
||||
```
|
||||
* Format - Visual Studio Format. Sends `CTRL + K, CTRL + D`
|
||||
* Refact - Visual Studio Refactor. Sends `CTRL + R, R`
|
||||
* Test - Visual Studio Run Test. Sends `CTRL + R, T`
|
||||
* Build - Visualt Studio Build Solution. Sends `CTRL + SHFT + B`
|
||||
* DTest - Visual Studio Debug Test. Sends `CTRL + R, CTRL + T`
|
||||
* FAR - Visual Studio Find All References. Sends `CTRL + K, R`
|
||||
* Format - Visual Studio Format. Sends `CTRL + K, CTRL + D`
|
||||
* GoToIm - Visual Studio Go To Implementation. Sends `CTRL + F12`
|
||||
* Refact - Visual Studio Refactor. Sends `CTRL + R, R`
|
||||
* Sort U - Visual Studio Sort Usings. Sends `CTRL + R, CTRL + G`
|
||||
* Test - Visual Studio Run Test. Sends `CTRL + R, T`
|
||||
|
||||
|
||||
### Keymap 2: Symbol Layer
|
||||
```
|
||||
@@ -87,9 +92,9 @@
|
||||
| | | | Lclk | Rclk | | | | | | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
,-------------. ,-------------.
|
||||
| | | | Vol+ | |
|
||||
| Back+| Back-| | Vol+ | |
|
||||
,------|------|------| |------+------+------.
|
||||
| | | | | Vol- | | |
|
||||
| | |BL_TOG| | Vol- | | |
|
||||
| | |------| |------| PL/PS| Next |
|
||||
| | | | | Back | | |
|
||||
`--------------------' `--------------------'
|
||||
@@ -100,23 +105,24 @@
|
||||
,--------------------------------------------------. ,--------------------------------------------------.
|
||||
| | | | | | | | | | | | | | | |
|
||||
|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
| | | | | | | | | | | | | | | |
|
||||
| |KOpen |KType | | | | | | | Copy | | | | Paste| |
|
||||
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
| |DLeft |DRight|LShift| | |------| |------| Left | Down | Up | Right| | |
|
||||
| |DLeft |DRight| LCTL | | |------| |------| Left | Down | Up | Right| | |
|
||||
|--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
| |KOpen |KType | | | | | | | | | | | | |
|
||||
| |SFT_TB| Tab | | | | | | | | | | | | |
|
||||
`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
| | | | | | | | | | | |
|
||||
`----------------------------------' `----------------------------------'
|
||||
,-------------. ,-------------.
|
||||
| | | | | |
|
||||
| | | | Home | End |
|
||||
,------|------|------| |------+------+------.
|
||||
| | | | | | | |
|
||||
| | CTRL |------| |------| | |
|
||||
| | LSFT |------| |------| | |
|
||||
| | | | | | | |
|
||||
`--------------------' `--------------------'
|
||||
```
|
||||
* DLeft - Move to the left Desktop. Sends `Ctrl + Win + Left Arrow`
|
||||
* DLeft - Move to the left Desktop. Sends `Ctrl + Win + Left Arrow`
|
||||
* DRight - Move to the right Desktop. Sends `Ctrl + Win + Right Arrow`
|
||||
* KOpen - Opens KeePass. Sends `Ctrl + Alt + k`
|
||||
* KType - Autotypes KeePass password. Sends `Ctrl + Alt + a`
|
||||
* KOpen - Opens KeePass. Sends `Ctrl + Alt + k`
|
||||
* KType - Autotypes KeePass password. Sends `Ctrl + Alt + a`
|
||||
* SFT_TB - Sends `CTRL + TAB`.
|
||||
|
11
keyboards/ergodox/keymaps/333fred/config.h
Normal file
11
keyboards/ergodox/keymaps/333fred/config.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef CONFIG_H_
|
||||
#define CONFIG_H_
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#undef TAPPING_TERM
|
||||
#define TAPPING_TERM 150
|
||||
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
#endif
|
@@ -23,12 +23,17 @@ enum custom_macros {
|
||||
DLEFT,
|
||||
DRIGHT,
|
||||
PSCREEN_APP,
|
||||
LSFT_TAB,
|
||||
|
||||
// VS Macros
|
||||
REFACTOR,
|
||||
TEST,
|
||||
DEBUG_TEST,
|
||||
FORMAT,
|
||||
BUILD,
|
||||
GO_TO_IMPL,
|
||||
FIND_ALL_REF,
|
||||
REMOVE_SORT_USINGS,
|
||||
|
||||
// KeePass macros
|
||||
KEEPASS_OPEN,
|
||||
@@ -61,11 +66,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | Home | End | | Alt |Ctrl/Esc|
|
||||
* | Copy | Paste| | Alt |Ctrl/Esc|
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | | PgUp | | PgDn | | |
|
||||
* | Bcksp|OSL(2)|------| |------| Ent |Space |
|
||||
* | | | Del | |OSL(2)| | |
|
||||
* | | | Del | | RCtrl| | |
|
||||
* `--------------------' `----------------------'
|
||||
*/
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
@@ -75,20 +80,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
|
||||
KC_ESC, KC_A, KC_S, KC_D, LT(MOVE, KC_F),KC_G,
|
||||
KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE),
|
||||
KC_LCTRL, KC_F4, KC_F5, KC_LGUI,KC_LALT,
|
||||
KC_HOME, KC_END,
|
||||
KC_PGUP,
|
||||
KC_BSPC,OSL(SYMB),KC_DEL,
|
||||
OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(CODE),
|
||||
OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT,
|
||||
LCTL(KC_C),LCTL(KC_V),
|
||||
KC_PGUP,
|
||||
KC_BSPC,OSL(SYMB), KC_DEL,
|
||||
// right hand
|
||||
TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
|
||||
TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
|
||||
KC_H, KC_J, KC_K, KC_L, TD(TD_SEMICOLON_COLON),KC_QUOT,
|
||||
MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT,
|
||||
MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT),
|
||||
KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI,
|
||||
KC_RALT, CTL_T(KC_ESC),
|
||||
KC_RALT, CTL_T(KC_ESC),
|
||||
KC_PGDN,
|
||||
OSL(SYMB),KC_ENT, KC_SPC
|
||||
KC_RCTL, KC_ENT, KC_SPC
|
||||
),
|
||||
/* Keymap 1: Code Layer
|
||||
*
|
||||
@@ -98,15 +103,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | F10 | | F11 | | | | | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| | | | | | |
|
||||
* |--------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------|
|
||||
* |--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* | | | | | | | F12 |GoToIm| FAR | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,---------------.
|
||||
* |Format| | | Test | DTest |
|
||||
* |Format|Build | | Test | DTest |
|
||||
* ,------|------|------| |------+--------+------.
|
||||
* | | |Refact| | | | |
|
||||
* | | |Refact| |Sort U| | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `----------------------'
|
||||
@@ -118,20 +123,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(SYMB),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
M(FORMAT), KC_TRNS,
|
||||
M(REFACTOR),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
M(FORMAT),M(BUILD),
|
||||
M(REFACTOR),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS,
|
||||
M(TEST), M(DEBUG_TEST),
|
||||
KC_TRNS,
|
||||
M(REMOVE_SORT_USINGS),
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
/* Keymap 2: Symbol Layer
|
||||
@@ -142,7 +147,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | ! | @ | ( | ) | | |ACCESS| |ACCESS| Up | 7 | 8 | 9 | * | F12 |
|
||||
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | |
|
||||
* |---------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* |---------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | |
|
||||
* `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | EPRM | | | | | | 0 | 0 | . | = | |
|
||||
@@ -190,9 +195,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | Lclk | Rclk | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | Vol+ | |
|
||||
* | Back+| Back-| | Vol+ | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | Vol- | | |
|
||||
* | | |BackTg| | Vol- | | |
|
||||
* | | |------| |------| PL/PS| Next |
|
||||
* | | | | | Back | | |
|
||||
* `--------------------' `--------------------'
|
||||
@@ -204,8 +209,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
BL_INC, BL_DEC,
|
||||
BL_TOGG,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
@@ -222,39 +227,39 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* | |KOpen |KType | | | | | | | Copy | | | | Paste| |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | |DLeft |DRight|LShift|ACCESS| |------| |------| Left | Down | Up | Right| | |
|
||||
* | |DLeft |DRight|LCTRL |ACCESS| |------| |------| Left | Down | Up | Right| | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | |KOpen |KType | | | | | | | | | | | | |
|
||||
* | |SFT_TB| TAB | | | | | | | | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | | | |
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
* | | | | Home | End |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | CTRL |------| |------| | |
|
||||
* | |LSHIFT|------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
// MEDIA AND MOUSE
|
||||
[MOVE] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, M(DLEFT), M(DRIGHT), KC_LSFT, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_LCTRL,KC_TRNS,
|
||||
KC_TRNS, KC_LSFT, KC_TRNS,
|
||||
// right hand
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_HOME, KC_END,
|
||||
KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
|
||||
@@ -291,9 +296,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
break;
|
||||
case PSCREEN_APP:
|
||||
if (record->event.pressed) {
|
||||
return MACRO(D(LALT), T(PSCR), U(LALT));
|
||||
return MACRO(D(LALT), T(PSCR), U(LALT), END);
|
||||
}
|
||||
break;
|
||||
case LSFT_TAB:
|
||||
if (record->event.pressed) {
|
||||
return MACRO(D(LSFT), T(TAB), U(LSFT), END);
|
||||
}
|
||||
case REFACTOR:
|
||||
if (record->event.pressed) { // VS Refactor CTRL+R, R
|
||||
return MACRO(D(LCTL), T(R), U(LCTL), T(R), END);
|
||||
@@ -314,6 +323,26 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
return MACRO(D(LCTL), T(K), T(D), U(LCTL), END);
|
||||
}
|
||||
break;
|
||||
case BUILD:
|
||||
if (record->event.pressed) { // VS Build. Sends CTRL+SHFT+B
|
||||
return MACRO(D(LCTL), D(LSFT), T(B), U(LSFT), U(LCTL), END);
|
||||
}
|
||||
break;
|
||||
case GO_TO_IMPL:
|
||||
if (record->event.pressed) { // VS Go To Implementation. Sends CTRL+F12
|
||||
return MACRO(D(LCTL), T(F12), U(LCTL), END);
|
||||
}
|
||||
break;
|
||||
case FIND_ALL_REF:
|
||||
if (record->event.pressed) { // VS Find All References. Sends CTRL+K, R
|
||||
return MACRO(D(LCTL), T(K), U(LCTL), T(R), END);
|
||||
}
|
||||
break;
|
||||
case REMOVE_SORT_USINGS:
|
||||
if (record->event.pressed) {
|
||||
return MACRO(D(LCTL), T(R), T(G), U(LCTL), END);
|
||||
}
|
||||
break;
|
||||
case KEEPASS_OPEN:
|
||||
if (record->event.pressed) { // Keepass open application
|
||||
return MACRO(D(LCTL), D(LALT), T(K), U(LALT), U(LCTL), END);
|
||||
|
21
keyboards/ergodox/keymaps/belak/LICENSE
Normal file
21
keyboards/ergodox/keymaps/belak/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Kaleb Elwert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
6
keyboards/ergodox/keymaps/belak/Makefile
Normal file
6
keyboards/ergodox/keymaps/belak/Makefile
Normal file
@@ -0,0 +1,6 @@
|
||||
TAP_DANCE_ENABLE=yes
|
||||
UNICODE_ENABLE=yes
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
79
keyboards/ergodox/keymaps/belak/README.md
Normal file
79
keyboards/ergodox/keymaps/belak/README.md
Normal file
@@ -0,0 +1,79 @@
|
||||
# Belak's Ergodox Layout
|
||||
|
||||
This has been based off of [emacs\_osx\_dk](https://github.com/jackhumbert/qmk_firmware/tree/master/keyboards/ergodox/keymaps/emacs_osx_dk)
|
||||
from the main qmk repo. However, I've taken some of the ideas for the thumbs
|
||||
from [dvorak\_emacs](https://github.com/jackhumbert/qmk_firmware/tree/master/keyboards/ergodox/keymaps/dvorak_emacs)
|
||||
and tweaked it a bit based on the keycaps I have.
|
||||
|
||||
This keyboard is intended for use in emacs (one of the main reasons for easy
|
||||
access to modifiers) but it could be useful in other instances as well.
|
||||
|
||||
The main repo is used as a testbed, so sometimes the layout may be in a strange
|
||||
state. The qmk version should be relatively stable.
|
||||
|
||||
## Instructions
|
||||
|
||||
This is currently being used on a regular ergodox, but it should work fine on
|
||||
the infinity as well. Though, you may have to modify the commands to build and
|
||||
flash the firmware to match the separate halves as defined in the infinity
|
||||
documentation.
|
||||
|
||||
If you are using this keymap in the qmk repo, you should be able to just run
|
||||
`make ergodox-belak-teensy`. If you're using this externally (I sometimes make
|
||||
changes before syncing them to qmk), use the following instructions:
|
||||
|
||||
1. Clone the main qmk repo
|
||||
2. Clone this to `$QMK/keyboards/ergodox/keymaps/belak-external`
|
||||
3. Run `make ergodox-belak-external-teensy` from the root of the qmk repo.
|
||||
|
||||
## Changelog
|
||||
|
||||
Fifth Revision
|
||||
|
||||
* Change layer keys to tap-dance keys which cycle through additional layers
|
||||
* Add a few emoji keys (in preparation for an emoji layer)
|
||||
|
||||
Fourth Revision
|
||||
|
||||
* Remove media layer
|
||||
* Add a layer which swaps control and gui on the thumb keys.
|
||||
* Add some basic code to save settings to the eeprom
|
||||
* Save the state of the keys swapped in the thumb in the eeprom
|
||||
|
||||
Third Revision
|
||||
|
||||
* Add numpad layer and remove numpad from symbols layer
|
||||
* Disable media layer
|
||||
* Add arrow keys on ijkl to the symbols layer
|
||||
* Replace ALT on held enter and held delete with GUI (for better OSX
|
||||
compatibility, as there's already an ALT key relatively close)
|
||||
* Replace keys above enter and delete with temporary layer switch buttons not
|
||||
matching the other layer switch for that hand.
|
||||
* Reindent and space out most of the layer definitions
|
||||
|
||||
Second Revision
|
||||
|
||||
* Clean up definitions to make differences between layers easier to see
|
||||
* Remove old LCD code
|
||||
* Add new LCD code based on fredizzimo's branch
|
||||
|
||||
First Revision
|
||||
|
||||
* Reverse grave and escape
|
||||
|
||||
Initial Version
|
||||
|
||||
* Copy from emacs\_osx\_dk
|
||||
* "Fix" right alt
|
||||
* Change thumb keys to match default layout (backspace, delete, enter, space)
|
||||
* Add modifiers to thumb keys (ctrl to backspace and space, alt to delete and
|
||||
enter)
|
||||
* Replace the RAlt below the brackets with LGui and RGui
|
||||
* Remove LCtrl and RCtrl from the keys above shift
|
||||
* Add browser forward, and move browser back
|
||||
* "Fix" the order of volume keys
|
||||
|
||||
## Repository
|
||||
|
||||
The original code for this is kept at https://github.com/belak/ergodox-layout and
|
||||
is synced to qmk every few main revisions.
|
368
keyboards/ergodox/keymaps/belak/keymap.c
Normal file
368
keyboards/ergodox/keymaps/belak/keymap.c
Normal file
@@ -0,0 +1,368 @@
|
||||
#include "ergodox.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
#define LAYER_ON(pos) ((layer_state) & (1<<(pos)))
|
||||
#define _______ KC_TRNS
|
||||
|
||||
#define EECONFIG_BELAK_MAGIC (uint16_t)0xBE42
|
||||
|
||||
// NOTE: This is just a number that's a bit beyond the end of what's already
|
||||
// defined. As there is no other define we can base this on, it may need to be
|
||||
// changed in the future. The initial value here is used as a placeholder with a
|
||||
// magic word, similar to the normal eeconfig. Note that all the storage being
|
||||
// used needs to fit inside the 32 bytes of the Ergodox Infinity.
|
||||
#define EECONFIG_BELAK (uint16_t *)16
|
||||
|
||||
// The correct way to do this would be how the normal eeconfig handles it and
|
||||
// use a bitfield. However, the eeprom has a ton of space which isn't being
|
||||
// used so I don't really care and have a separate byte for every setting.
|
||||
#define EECONFIG_BELAK_SWAP_GUI_CTRL (uint8_t *)18
|
||||
|
||||
static uint8_t swap_gui_ctrl = 0;
|
||||
static uint8_t td_led_override = 0;
|
||||
|
||||
enum belak_keycodes {
|
||||
// Function codes
|
||||
BEL_F0 = SAFE_RANGE,
|
||||
BEL_F1,
|
||||
|
||||
E_SHRUG,
|
||||
E_TFLIP,
|
||||
E_TSET,
|
||||
};
|
||||
|
||||
inline void tap(uint16_t keycode) {
|
||||
register_code(keycode);
|
||||
unregister_code(keycode);
|
||||
};
|
||||
|
||||
// TODO: Add LED support to the tap dance by using the advanced macro
|
||||
#define LTOGGLE TD(TD_LAYER_TOGGLE)
|
||||
|
||||
#define BASE 0 // default layer
|
||||
#define SYMB 1 // symbols
|
||||
#define NUMP 2 // numpad
|
||||
#define SWPH 3 // swap gui/ctrl on the hands
|
||||
|
||||
enum belak_td {
|
||||
TD_LAYER_TOGGLE = 0,
|
||||
};
|
||||
|
||||
void belak_td_each(qk_tap_dance_state_t *state, void *user_data);
|
||||
void belak_td_finished(qk_tap_dance_state_t *state, void *user_data);
|
||||
void belak_td_reset(qk_tap_dance_state_t *state, void *user_data);
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[TD_LAYER_TOGGLE] = ACTION_TAP_DANCE_FN_ADVANCED(belak_td_each, belak_td_finished, belak_td_reset),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Keymap 0: Basic layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | Esc | 1 | 2 | 3 | 4 | 5 | L1 | | L2 | 6 | 7 | 8 | 9 | 0 | = |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | \ | A | S | D | F | G |------| |------| H | J | K | L | ; | ' |
|
||||
* |--------+------+------+------+------+------| LGui | | RGui |------+------+------+------+------+--------|
|
||||
* | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |Layers| LCtrl| Left | Right| LAlt | | RAlt | Up | Down | RCtrl|Layers|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,--------------.
|
||||
* | ~L2 | Ins | | Grv | ~L1 |
|
||||
* ,-------|------|------| |------+-------+-------.
|
||||
* | Back | | Home | | PgUp | | |
|
||||
* | Space | Del |------| |------| Enter | Space |
|
||||
* | | | End | | PgDn | | |
|
||||
* `---------------------' `----------------------'
|
||||
*/
|
||||
[BASE] = KEYMAP( // layer 0 : default
|
||||
// left hand
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, TG(SYMB),
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC,
|
||||
CTL_T(KC_BSLS), KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LGUI,
|
||||
LTOGGLE, KC_LCTRL, KC_LEFT,KC_RGHT,KC_LALT,
|
||||
MO(NUMP),KC_INS,
|
||||
KC_HOME,
|
||||
CTL_T(KC_BSPC),GUI_T(KC_DEL),KC_END,
|
||||
// right hand
|
||||
TG(NUMP), KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL,
|
||||
KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,
|
||||
KC_RALT,KC_UP, KC_DOWN,KC_RCTRL, LTOGGLE,
|
||||
KC_GRV, MO(SYMB),
|
||||
KC_PGUP,
|
||||
KC_PGDN, GUI_T(KC_ENT), CTL_T(KC_SPC)
|
||||
),
|
||||
/* Keymap 1: Symbol Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ! | @ | { | } | | | | | | Up | | Up | | | F12 |
|
||||
* |--------+------+------+------+------+------| TFLIP| | TSET |------+------+------+------+------+--------|
|
||||
* | | # | $ | ( | ) | ` |------| |------| Down | Left | Down | Rght | | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | % | ^ | [ | ] | ~ | SHRUG| | | & | | | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |LClear| | | | | | | | | |LClear|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | TOGL | | | | TOGL |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, E_TFLIP,
|
||||
_______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, E_TSET,
|
||||
_______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV,
|
||||
_______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, E_SHRUG,
|
||||
BEL_F1, _______, _______, _______, _______,
|
||||
BEL_F0, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
// right hand
|
||||
_______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
|
||||
_______, KC_UP, _______, KC_UP, _______, _______, KC_F12,
|
||||
KC_DOWN, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______,
|
||||
_______, KC_AMPR, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, BEL_F1,
|
||||
_______, BEL_F0,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
/* Keymap 2: Numpad Layer
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | | | | | | | | | | | | | | | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | 7 | 8 | 9 | * | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | |------| |------| | 4 | 5 | 6 | + | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | 1 | 2 | 3 | \ | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* |LClear| | | | | | 0 | 0 | . | = |LClear|
|
||||
* `----------------------------------' `----------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | TOGL | | | | TOGL |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[NUMP] = KEYMAP(
|
||||
// left hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
BEL_F1, _______, _______, _______, _______,
|
||||
BEL_F0, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
// right hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______,
|
||||
_______, KC_4, KC_5, KC_6, KC_PLUS, _______,
|
||||
_______, _______, KC_1, KC_2, KC_3, KC_BSLS, _______,
|
||||
KC_0, KC_0, KC_DOT, KC_EQL, BEL_F1,
|
||||
_______, BEL_F0,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
/* Keymap 3: Swap control and gui on the thumb */
|
||||
[SWPH] = KEYMAP(
|
||||
// left hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
GUI_T(KC_BSPC), CTL_T(KC_DEL), _______,
|
||||
// right hand
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, CTL_T(KC_ENT), GUI_T(KC_SPC)
|
||||
),
|
||||
};
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
// If our magic word wasn't set properly, we need to zero out the settings.
|
||||
if (eeprom_read_word(EECONFIG_BELAK) != EECONFIG_BELAK_MAGIC) {
|
||||
eeprom_update_word(EECONFIG_BELAK, EECONFIG_BELAK_MAGIC);
|
||||
eeprom_update_byte(EECONFIG_BELAK_SWAP_GUI_CTRL, 0);
|
||||
}
|
||||
|
||||
if (eeprom_read_byte(EECONFIG_BELAK_SWAP_GUI_CTRL)) {
|
||||
layer_on(SWPH);
|
||||
swap_gui_ctrl = 1;
|
||||
}
|
||||
};
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
|
||||
switch (td_led_override) {
|
||||
case 1:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case 2:
|
||||
ergodox_right_led_2_on();
|
||||
break;
|
||||
default:
|
||||
// Layer 1 and 2 are both overlay layers, so they could both be on. This
|
||||
// means we can't use the lazy check of checking for the first significant
|
||||
// bit.
|
||||
if (LAYER_ON(SYMB)) {
|
||||
ergodox_right_led_1_on();
|
||||
}
|
||||
if (LAYER_ON(NUMP)) {
|
||||
ergodox_right_led_2_on();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case BEL_F0:
|
||||
if(record->event.pressed){
|
||||
swap_gui_ctrl = !swap_gui_ctrl;
|
||||
eeprom_update_byte(EECONFIG_BELAK_SWAP_GUI_CTRL, swap_gui_ctrl);
|
||||
|
||||
if (swap_gui_ctrl) {
|
||||
layer_on(SWPH);
|
||||
} else {
|
||||
layer_off(SWPH);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case BEL_F1:
|
||||
if(record->event.pressed){
|
||||
layer_off(SYMB);
|
||||
layer_off(NUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case E_SHRUG: // ¯\_(ツ)_/¯
|
||||
if (record->event.pressed) {
|
||||
process_unicode((0x00AF|QK_UNICODE), record); // Hand
|
||||
tap(KC_BSLS); // Arm
|
||||
register_code(KC_RSFT);
|
||||
tap(KC_UNDS); // Arm
|
||||
tap(KC_LPRN); // Head
|
||||
unregister_code(KC_RSFT);
|
||||
process_unicode((0x30C4|QK_UNICODE), record); // Face
|
||||
register_code(KC_RSFT);
|
||||
tap(KC_RPRN); // Head
|
||||
tap(KC_UNDS); // Arm
|
||||
unregister_code(KC_RSFT);
|
||||
tap(KC_SLSH); // Arm
|
||||
process_unicode((0x00AF|QK_UNICODE), record); // Hand
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case E_TFLIP: // (╯°□°)╯ ︵ ┻━┻
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_RSFT);
|
||||
tap(KC_9);
|
||||
unregister_code(KC_RSFT);
|
||||
process_unicode((0x256F|QK_UNICODE), record); // Arm
|
||||
process_unicode((0x00B0|QK_UNICODE), record); // Eye
|
||||
process_unicode((0x25A1|QK_UNICODE), record); // Mouth
|
||||
process_unicode((0x00B0|QK_UNICODE), record); // Eye
|
||||
register_code(KC_RSFT);
|
||||
tap(KC_0);
|
||||
unregister_code(KC_RSFT);
|
||||
process_unicode((0x256F|QK_UNICODE), record); // Arm
|
||||
tap(KC_SPC);
|
||||
process_unicode((0x0361|QK_UNICODE), record); // Flippy
|
||||
tap(KC_SPC);
|
||||
process_unicode((0x253B|QK_UNICODE), record); // Table
|
||||
process_unicode((0x2501|QK_UNICODE), record); // Table
|
||||
process_unicode((0x253B|QK_UNICODE), record); // Table
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case E_TSET: // ┬──┬ ノ( ゜-゜ノ)
|
||||
if (record->event.pressed) {
|
||||
process_unicode((0x252C|QK_UNICODE), record); // Table
|
||||
process_unicode((0x2500|QK_UNICODE), record); // Table
|
||||
process_unicode((0x2500|QK_UNICODE), record); // Table
|
||||
process_unicode((0x252C|QK_UNICODE), record); // Table
|
||||
tap(KC_SPC);
|
||||
process_unicode((0x30CE|QK_UNICODE), record); // Arm
|
||||
register_code(KC_RSFT);
|
||||
tap(KC_9);
|
||||
unregister_code(KC_RSFT);
|
||||
tap(KC_SPC);
|
||||
process_unicode((0x309C|QK_UNICODE), record); // Eye
|
||||
tap(KC_MINS);
|
||||
process_unicode((0x309C|QK_UNICODE), record); // Eye
|
||||
process_unicode((0x30CE|QK_UNICODE), record); // Arm
|
||||
register_code(KC_RSFT);
|
||||
tap(KC_0);
|
||||
unregister_code(KC_RSFT);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void belak_td_each(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (state->count) {
|
||||
case 1:
|
||||
td_led_override = 1;
|
||||
break;
|
||||
case 2:
|
||||
td_led_override = 2;
|
||||
break;
|
||||
default:
|
||||
reset_tap_dance(state);
|
||||
}
|
||||
}
|
||||
|
||||
void belak_td_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||
switch (state->count) {
|
||||
case 1:
|
||||
layer_on(SYMB);
|
||||
break;
|
||||
case 2:
|
||||
layer_on(NUMP);
|
||||
break;
|
||||
}
|
||||
td_led_override = 0;
|
||||
}
|
||||
|
||||
void belak_td_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||
td_led_override = 0;
|
||||
}
|
49
keyboards/ergodox/keymaps/belak/visualizer.c
Normal file
49
keyboards/ergodox/keymaps/belak/visualizer.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2017 Fred Sundvik
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// Currently we are assuming that both the backlight and LCD are enabled
|
||||
// But it's entirely possible to write a custom visualizer that use only
|
||||
// one of them
|
||||
#ifndef LCD_BACKLIGHT_ENABLE
|
||||
#error This visualizer needs that LCD backlight is enabled
|
||||
#endif
|
||||
|
||||
#ifndef LCD_ENABLE
|
||||
#error This visualizer needs that LCD is enabled
|
||||
#endif
|
||||
|
||||
#include "simple_visualizer.h"
|
||||
|
||||
static void get_visualizer_layer_and_color(visualizer_state_t* state) {
|
||||
uint8_t saturation = 60;
|
||||
if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) {
|
||||
saturation = 255;
|
||||
}
|
||||
|
||||
if (state->status.layer & 0x4) {
|
||||
state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF);
|
||||
state->layer_text = "Media";
|
||||
}
|
||||
else if (state->status.layer & 0x2) {
|
||||
state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF);
|
||||
state->layer_text = "Symbols";
|
||||
}
|
||||
else {
|
||||
state->target_lcd_color = LCD_COLOR(84, saturation, 0xFF);
|
||||
state->layer_text = "Base";
|
||||
}
|
||||
}
|
1
keyboards/ergodox/keymaps/familiar/Makefile
Normal file
1
keyboards/ergodox/keymaps/familiar/Makefile
Normal file
@@ -0,0 +1 @@
|
||||
TAP_DANCE_ENABLE=yes
|
@@ -1,5 +1,5 @@
|
||||
# ErgoDox Familiar Layout
|
||||
Familiar layout for those who regularly switch back and forth from ErgoDox to regular QWERTY.
|
||||
Familiar layout for those who regularly switch back and forth from ErgoDox to "normal" QWERTY.
|
||||
|
||||
[](../../../../license_GPLv3.md../../../../license_GPLv3.md) [](https://github.com/RichardLitt/standard-readme)
|
||||
|
||||
@@ -23,12 +23,12 @@ Key features of the familiar layout:
|
||||
1. QWERTY default layout.
|
||||
1. International symbols layer, mapped in the US-International layout default positions, through [UCIS](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable).
|
||||
1. Numpad layer on right hand.
|
||||
1. Thumb cluster holds spacebar, ALT, and access to secondary layers.
|
||||
1. Thumb cluster holds spacebar and access to secondary layers.
|
||||
1. Function-layer arrow keys in both the first-person-shooter (actually ESDF instead of WASD) and vim (HJKL) locations.
|
||||
|
||||
## Install
|
||||
|
||||
If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 235).
|
||||
If you are on Windows or Mac, choose the proper line in [`keymap.c`](keymap.c) for [unicode/international character support](https://github.com/qmk/qmk_firmware/wiki/Unicode-and-additional-language-support#ucis_enable) (starts at line 253).
|
||||
```c
|
||||
void matrix_init_user(void) {
|
||||
set_unicode_input_mode(UC_LNX); // Linux
|
||||
@@ -45,13 +45,13 @@ $ make ergodox-ez-familiar-teensy
|
||||
|
||||
## Usage
|
||||
|
||||
[](http://www.keyboard-layout-editor.com/#/gists/13508a9f99cff381d58b7be6f7dcc644)
|
||||
[](https://gist.github.com/nstickney/13508a9f99cff381d58b7be6f7dcc644)
|
||||
|
||||
### Layers
|
||||
1. Base Layer: QWERTY, with arrow keys at bottom right.
|
||||
1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `INTL` layer using the UCIS key (bottom of left thumb cluster).
|
||||
1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed through holding shift while the UCIS layer is active (toggles the `INSF` layer).
|
||||
1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NPAD key (bottom of right thumb cluster).
|
||||
1. UCIS Layer: US-International symbols layer, plus —. Accessed by toggling the `SYMB` layer using the UCIS key (bottom of left thumb cluster).
|
||||
1. UCIS-Shifted Layer: Making shift work for UCIS characters. An ugly workaround. Any ideas? Accessed by holding shift while the `SYMB` layer is active (toggles the `CSYM` layer).
|
||||
1. Numpad Layer: Right hand number pad. Accessed by toggling the `NUMP` layer using the NUMP key (bottom of right thumb cluster).
|
||||
1. Function Layer: F1-F12, arrows on ESDF and HJKL, media player controls. Accessed by holding either FN key (center key of each thumb cluster), which toggles the `ARRW` layer. I know, I need to work on my naming conventions.
|
||||
|
||||
## Contribute
|
||||
@@ -61,9 +61,9 @@ $ make ergodox-ez-familiar-teensy
|
||||
I'm terrible at this; I have no background in human-computer interaction, kinesiology, or keyboard-ology. Please send comments/issues/pull requests/angry tweets/etc. If you think there is a better way to take advantage of the ErgoDox/QMK comination without straying far from 84/101-key QWERTY, I want to know it.
|
||||
|
||||
### Issues
|
||||
1. The top two keys of the right thumb cluster are currently unused. I wanted them for screen brightness, but I haven't found a solution I like.
|
||||
1. The `'`, `"`, `[`, and `]` keys are terrible to access; I want to put them somewhere else but I haven't figured out where.
|
||||
1. The `INSF` layer is an ugly workaround. I should write a function for doing different things in the `INTL` layer depending on whether SHIFT is being held. Or something. Ideas?
|
||||
1. The `CSYM` layer is an ugly workaround. I should write a function for doing different things in the `SYMB` layer depending on whether SHIFT is being held. Or something. Ideas?
|
||||
1. Right now, the thumb cluster function keys double as slash and whack... this really isnt a great solution.
|
||||
1. `MENU` and `LEAD` are useless, at the moment.
|
||||
|
||||
## License
|
||||
QMK is licensed ([mostly](https://github.com/qmk/qmk_firmware/issues/1038)) under the [GPLv2](blob/master/license_GPLv2.md). Accordingly, to whatever extent applicable, this keymap is licensed under the [GPLv3](../../../../license_GPLv3.md).
|
||||
|
@@ -5,8 +5,8 @@
|
||||
|
||||
// Layers
|
||||
#define BASE 0 // default layer
|
||||
#define INTL 1 // international symbols
|
||||
#define INSF 2 // international symbols shifted
|
||||
#define SYMB 1 // international symbols
|
||||
#define CSYM 2 // international symbols shifted
|
||||
#define NUMP 3 // numpad
|
||||
#define ARRW 4 // function, media, arrow keys
|
||||
|
||||
@@ -14,63 +14,81 @@
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
// Tap Dancing
|
||||
void dance_lock (qk_tap_dance_state_t *state, void *user_data) {
|
||||
if (state->count == 1) { // Press once for NUMLOCK
|
||||
register_code (KC_NLCK);
|
||||
unregister_code (KC_NLCK);
|
||||
} else if (state->count == 2) { // Press twice for CAPSLOCK
|
||||
register_code (KC_CAPS);
|
||||
unregister_code (KC_CAPS);
|
||||
} else if (state->count == 3) { //Press thrice for SCROLLLOCK
|
||||
register_code (KC_SLCK);
|
||||
unregister_code (KC_SLCK);
|
||||
}
|
||||
}
|
||||
enum {LOCKS = 0};
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[LOCKS] = ACTION_TAP_DANCE_FN(dance_lock)
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// If it accepts an argument (i.e, is a function), it doesn't need KC_.
|
||||
// Otherwise, it needs KC_*
|
||||
/* layer 0 : default
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC |
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | = | BCKSPC |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | TAB | Q | W | E | R | T | HOME | | PGUP | Y | U | I | O | P | DELETE |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | ` | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER |
|
||||
* | ' | A | S | D | F | G |------| |------| H | J | K | L | ; | ENTER |
|
||||
* |--------+------+------+------+------+------| END | | PGDN |------+------+------+------+------+--------|
|
||||
* | (/LSFT | Z | X | C | V | B | | | | N | M | , | . | UP | )/RSFT |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | LCTRL | LGUI | MENU | ' | " | | [ | ] | LEFT | DOWN | RIGHT |
|
||||
* | LCTRL | LGUI | MENU | LEAD | LALT | |[/RALT|]/RCTL| LEFT | DOWN | RIGHT |
|
||||
* `------------------------------------' `------------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | VOL- | VOL+ | | | |
|
||||
* |PRTSCR| ESC | | VOL- | VOL+ |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | SPC/ |SLASH/| MUTE | |NUMLCK|WHACK/| SPC/ |
|
||||
* | ALT | MO(1)|------| |------|MO(1) | ALT |
|
||||
* | | | LAY3 | | LAY2 | | |
|
||||
* | |SLASH/| LOCKS| | MUTE |WHACK/| |
|
||||
* | SPC | MO(4)|------| |------|MO(4) | SPC |
|
||||
* | | | TO(1)| |TO(3) | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[BASE] = KEYMAP(
|
||||
// left hand
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME,
|
||||
KC_GRV, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_QUOT, KC_A, KC_S, KC_D, KC_F, KC_G,
|
||||
KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END,
|
||||
KC_LCTL, KC_LGUI, KC_MENU, KC_QUOT, S(KC_QUOT),
|
||||
KC_VOLD, KC_VOLU,
|
||||
KC_MUTE,
|
||||
ALT_T(KC_SPC), LT(ARRW,KC_SLSH), TG(INTL),
|
||||
KC_LCTL, KC_LGUI, KC_MENU, KC_LEAD, KC_LALT,
|
||||
KC_PSCR, KC_ESC,
|
||||
TD(LOCKS),
|
||||
KC_SPC, LT(ARRW, KC_SLSH), TG(SYMB),
|
||||
// right hand
|
||||
KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
|
||||
KC_PGUP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL,
|
||||
KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENTER,
|
||||
KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSPC,
|
||||
KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_RGHT,
|
||||
_______, _______,
|
||||
KC_NLCK,
|
||||
TG(NUMP), LT(ARRW,KC_BSLS), ALT_T(KC_SPC)
|
||||
MT(MOD_RALT, KC_LBRC), MT(MOD_RCTL, KC_RBRC), KC_LEFT, KC_DOWN, KC_RGHT,
|
||||
KC_VOLD, KC_VOLU,
|
||||
KC_MUTE,
|
||||
TG(NUMP), LT(ARRW, KC_BSLS), KC_SPC
|
||||
),
|
||||
|
||||
/* layer 1: International symbols, etc
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ´ | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | |
|
||||
* | | ¡ | ² | ³ | ¤ | € | ¼ | | ½ | ¾ | ‘ | ’ | ¥ | × | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | ä | å | é | ® | þ | | | | ü | ú | í | ó | ö | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | á | ß | ð | | |------| |------| | | | ø | ¶ | |
|
||||
* | ´ | á | ß | ð | | |------| |------| | | | ø | ¶ | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* |MO(INSF)| æ | | © | | | | | | ñ | µ | ç | | |MO(INSF)|
|
||||
* |MO(CSYM)| æ | ¿ | © | ¬ | | | | | ñ | µ | ç | | |MO(CSYM)|
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | ¬ | ¿ | | « | » | | | |
|
||||
* | | | | | | | « | » | | | |
|
||||
* `------------------------------------' `------------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
@@ -80,13 +98,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[INTL] = KEYMAP(
|
||||
[SYMB] = KEYMAP(
|
||||
// left hand
|
||||
UC(0x00B4), UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC),
|
||||
_______, UC(0x00A1), UC(0x00B2), UC(0x00B3), UC(0x00A4), UC(0x20AC), UC(0x00BC),
|
||||
_______, UC(0x00E4), UC(0x00E5), UC(0x00E9), UC(0x00AE), UC(0x00FE), _______,
|
||||
_______, UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______,
|
||||
MO(INSF), UC(0x00E6), _______, UC(0x00A9), _______, _______, _______,
|
||||
_______, _______, _______, UC(0x00AC), UC(0x00BF),
|
||||
UC(0x00B4), UC(0x00E1), UC(0x00DF), UC(0x00F0), _______, _______,
|
||||
MO(CSYM), UC(0x00E6), UC(0x00BF), _______, UC(0x00AC), UC(0x00A9), _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
@@ -94,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
UC(0x00BD), UC(0x00BE), UC(0x2018), UC(0x2019), UC(0x00A5), UC(0x00D7), _______,
|
||||
_______, UC(0x00FC), UC(0x00FA), UC(0x00ED), UC(0x00F3), UC(0x00F6), _______,
|
||||
_______, _______, _______, UC(0x00F8), UC(0x00B6), _______,
|
||||
_______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(INSF),
|
||||
_______, UC(0x00F1), UC(0x00B5), UC(0x00E7), _______, _______, MO(CSYM),
|
||||
UC(0x00AB), UC(0x00BB), _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
@@ -106,15 +124,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* which don't produce an "upper case" or "shifted" international symobol.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ¨ | ¹ | | | £ | | | | | | | | — | ÷ | |
|
||||
* | | ¹ | | | £ | | | | | | | | — | ÷ | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | Ä | Å | É | | Þ | | | | Ü | Ú | Í | Ó | Ö | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | Á | § | Ð | | |------| |------| | | | Ø | ° | |
|
||||
* | ¨ | Á | § | Ð | | |------| |------| | | | Ø | ° | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | Æ | | ¢ | | | | | | Ñ | | Ç | | | |
|
||||
* | | Æ | | ¢ | ¦ | | | | | Ñ | | Ç | | | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | ¦ | | | | | | | |
|
||||
* | | | | | | | “ | ” | | | |
|
||||
* `------------------------------------' `------------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
@@ -124,13 +142,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
*/
|
||||
[INSF] = KEYMAP(
|
||||
[CSYM] = KEYMAP(
|
||||
// left hand
|
||||
UC(0x00A8), UC(0x00B9), _______, _______, UC(0x00A3), _______, _______,
|
||||
_______, UC(0x00C4), UC(0x00C5), UC(0x00C9), _______, UC(0x00DE), _______,
|
||||
_______, UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G),
|
||||
_______, UC(0x00C6), S(KC_X), UC(0x00A2), S(KC_V), S(KC_B), _______,
|
||||
_______, _______, _______, UC(0x00A6), _______,
|
||||
_______, UC(0x00B9), _______, _______, UC(0x00A3), _______, _______,
|
||||
_______, UC(0x00C4), UC(0x00C5), UC(0x00C9), S(KC_R), UC(0x00DE), _______,
|
||||
UC(0x00A8), UC(0x00C1), UC(0x00A7), UC(0x00D0), S(KC_F), S(KC_G),
|
||||
_______, UC(0x00C6), UC(0x00A6), UC(0x00A2), S(KC_V), S(KC_B), _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
@@ -139,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, UC(0x00DC), UC(0x00DA), UC(0x00CD), UC(0x00D3), UC(0x00D6), _______,
|
||||
S(KC_H), S(KC_J), S(KC_K), UC(0x00D8), UC(0x00B0), _______,
|
||||
_______, UC(0x00D1), _______, UC(0x00C7), S(KC_DOT), _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
UC(0x201C), UC(0x201D), _______, _______, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
@@ -156,7 +174,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | | | | | | | | | | | 1 | 2 | 3 | = | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | 0 | . | , | ENTER| |
|
||||
* | | | | | | |0/RALT|./RCTL| , | ENTER| |
|
||||
* `------------------------------------' `------------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | | | | |
|
||||
@@ -181,7 +199,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
_______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_PMNS, _______,
|
||||
_______, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______,
|
||||
_______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_PEQL, _______,
|
||||
KC_KP_0, KC_KP_DOT, KC_PCMM, KC_PENT, _______,
|
||||
MT(MOD_RALT, KC_KP_0), MT(MOD_RCTL, KC_KP_DOT),KC_PCMM, KC_PENT, _______,
|
||||
_______, _______,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
@@ -191,20 +209,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* This layer is at the top so that the functions still work no matter what layers are active.
|
||||
*
|
||||
* ,--------------------------------------------------. ,--------------------------------------------------.
|
||||
* | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | SYSREQ |
|
||||
* | ESCAPE | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | |
|
||||
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
|
||||
* | | | | UP | | | | | | | | | | | INSERT |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* |CAPSLOCK| | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | |
|
||||
* | | | LEFT | DOWN |RIGHT | |------| |------| LEFT | DOWN | UP | RIGHT| | |
|
||||
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
|
||||
* | |M_PREV|M_STOP|M_PLPS|M_NEXT| | | | | | | | | PGUP | |
|
||||
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
|
||||
* | | | | | | | | | HOME | PGDN | END |
|
||||
* `------------------------------------' `------------------------------------'
|
||||
* ,-------------. ,-------------.
|
||||
* | | PAUSE| | | |
|
||||
* | SYSRQ| PAUSE| | | |
|
||||
* ,------|------|------| |------+------+------.
|
||||
* | | | | |SCRLK | | |
|
||||
* | | | | | | | |
|
||||
* | | |------| |------| | |
|
||||
* | | | | | | | |
|
||||
* `--------------------' `--------------------'
|
||||
@@ -213,20 +231,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// left hand
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,
|
||||
_______, _______, _______, KC_UP, _______, _______, _______,
|
||||
KC_CAPS, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______,
|
||||
_______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, _______, _______,
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, KC_PAUSE,
|
||||
KC_SYSREQ, KC_PAUSE,
|
||||
_______,
|
||||
_______, _______, _______,
|
||||
// right hand
|
||||
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_SYSREQ,
|
||||
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
|
||||
_______, _______, _______, _______, _______, _______, KC_INS,
|
||||
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______,
|
||||
_______, _______, _______, _______, _______, KC_PGUP, _______,
|
||||
_______, _______, KC_HOME, KC_PGDN, KC_END,
|
||||
_______, _______,
|
||||
KC_SLCK,
|
||||
_______,
|
||||
_______, _______, _______
|
||||
),
|
||||
};
|
||||
@@ -249,8 +267,8 @@ void matrix_scan_user(void) {
|
||||
ergodox_right_led_2_off();
|
||||
ergodox_right_led_3_off();
|
||||
switch (layer) {
|
||||
case INTL:
|
||||
case INSF:
|
||||
case SYMB:
|
||||
case CSYM:
|
||||
ergodox_right_led_1_on();
|
||||
break;
|
||||
case NUMP:
|
||||
|
@@ -1,25 +1,39 @@
|
||||
#include "gh60.h"
|
||||
|
||||
|
||||
extern inline void gh60_caps_led_on(void);
|
||||
extern inline void gh60_poker_leds_on(void);
|
||||
extern inline void gh60_fn_led_on(void);
|
||||
extern inline void gh60_esc_led_on(void);
|
||||
extern inline void gh60_wasd_leds_on(void);
|
||||
|
||||
extern inline void gh60_caps_led_off(void);
|
||||
extern inline void gh60_poker_leds_off(void);
|
||||
extern inline void gh60_fn_led_off(void);
|
||||
extern inline void gh60_esc_led_off(void);
|
||||
extern inline void gh60_wasd_leds_off(void);
|
||||
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
|
||||
|
||||
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
gh60_caps_led_on();
|
||||
} else {
|
||||
gh60_caps_led_off();
|
||||
gh60_caps_led_off();
|
||||
}
|
||||
|
||||
|
||||
// if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
// gh60_esc_led_on();
|
||||
// } else {
|
||||
// gh60_esc_led_off();
|
||||
// gh60_esc_led_off();
|
||||
// }
|
||||
|
||||
|
||||
// if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||||
// gh60_fn_led_on();
|
||||
// } else {
|
||||
// gh60_fn_led_off();
|
||||
// gh60_fn_led_off();
|
||||
// }
|
||||
|
||||
led_set_user(usb_led);
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
|
3
keyboards/handwired/frenchdev/Makefile
Normal file
3
keyboards/handwired/frenchdev/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
85
keyboards/handwired/frenchdev/config.h
Normal file
85
keyboards/handwired/frenchdev/config.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
Copyright 201 Nicolas Poirey <nicolas.poirey@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/>.
|
||||
*/
|
||||
|
||||
#ifndef FRENCHDEV_V1_CONFIG_H
|
||||
#define FRENCHDEV_V1_CONFIG_H
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x1307
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Nicolas Poirey
|
||||
#define PRODUCT Frenchdev V1
|
||||
#define DESCRIPTION QMK keyboard firmware for Frenchdev
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 16
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
#define LED_BRIGHTNESS_LO 15
|
||||
#define LED_BRIGHTNESS_HI 255
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
#define USB_MAX_POWER_CONSUMPTION 500
|
||||
|
||||
#define MOUSEKEY_INTERVAL 20
|
||||
#define MOUSEKEY_DELAY 0
|
||||
#define MOUSEKEY_TIME_TO_MAX 5
|
||||
#define MOUSEKEY_MAX_SPEED 2
|
||||
#define MOUSEKEY_WHEEL_DELAY 0
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
#define TAPPING_TERM 200
|
||||
#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.)
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \
|
||||
)
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
// #define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
// #define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
//#define DEBUG_MATRIX_SCAN_RATE
|
||||
|
||||
#endif //FRENCHDEV_V1_CONFIG_H
|
87
keyboards/handwired/frenchdev/frenchdev.c
Normal file
87
keyboards/handwired/frenchdev/frenchdev.c
Normal file
@@ -0,0 +1,87 @@
|
||||
#include "frenchdev.h"
|
||||
#include "i2cmaster.h"
|
||||
|
||||
bool i2c_initialized = 0;
|
||||
uint8_t mcp23018_status = 0x20;
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// keyboard LEDs (see "PWM on ports OC1(A|B|C)" in "teensy-2-0.md")
|
||||
TCCR1A = 0b10101001; // set and configure fast PWM
|
||||
TCCR1B = 0b00001001; // set and configure fast PWM
|
||||
|
||||
|
||||
|
||||
// unused pins - D4, D5, D7, E6
|
||||
// set as input with internal pull-ip enabled
|
||||
DDRD &= ~(1<<5 | 1<<4);
|
||||
DDRE &= ~(1<<6);
|
||||
PORTD |= (1<<5 | 1<<4);
|
||||
PORTE |= (1<<6);
|
||||
|
||||
frenchdev_blink_all_leds();
|
||||
frenchdev_blink_all_leds();
|
||||
frenchdev_blink_all_leds();
|
||||
frenchdev_blink_all_leds();
|
||||
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void frenchdev_blink_all_leds(void)
|
||||
{
|
||||
frenchdev_led_all_off();
|
||||
frenchdev_led_all_set(LED_BRIGHTNESS_HI);
|
||||
frenchdev_led_1_on();
|
||||
_delay_ms(50);
|
||||
frenchdev_led_2_on();
|
||||
_delay_ms(50);
|
||||
frenchdev_led_3_on();
|
||||
_delay_ms(50);
|
||||
frenchdev_led_1_off();
|
||||
_delay_ms(50);
|
||||
frenchdev_led_2_off();
|
||||
_delay_ms(50);
|
||||
frenchdev_led_3_off();
|
||||
frenchdev_led_all_off();
|
||||
}
|
||||
|
||||
uint8_t init_mcp23018(void) {
|
||||
mcp23018_status = 0x20;
|
||||
|
||||
// I2C subsystem
|
||||
|
||||
// uint8_t sreg_prev;
|
||||
// sreg_prev=SREG;
|
||||
// cli();
|
||||
if (i2c_initialized == 0) {
|
||||
i2c_init(); // on pins D(1,0)
|
||||
i2c_initialized++;
|
||||
_delay_ms(1000);
|
||||
}
|
||||
|
||||
// set pin direction
|
||||
// - unused : input : 1
|
||||
// - input : input : 1
|
||||
// - driving : output : 0
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(IODIRA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out;
|
||||
i2c_stop();
|
||||
|
||||
// set pull-up
|
||||
// - unused : on : 1
|
||||
// - input : on : 1
|
||||
// - driving : off : 0
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPPUA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00000000); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(0b00111111); if (mcp23018_status) goto out;
|
||||
|
||||
out:
|
||||
i2c_stop();
|
||||
|
||||
// SREG=sreg_prev;
|
||||
|
||||
return mcp23018_status;
|
||||
}
|
||||
|
115
keyboards/handwired/frenchdev/frenchdev.h
Normal file
115
keyboards/handwired/frenchdev/frenchdev.h
Normal file
@@ -0,0 +1,115 @@
|
||||
#ifndef FRENCHDEV_V1_H
|
||||
#define FRENCHDEV_V1_H
|
||||
|
||||
#include "quantum.h"
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "i2cmaster.h"
|
||||
#include <util/delay.h>
|
||||
|
||||
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
|
||||
#define CPU_16MHz 0x00
|
||||
|
||||
// I2C aliases and register addresses (see "mcp23018.md" on tmk repository)
|
||||
#define I2C_ADDR 0b0100000
|
||||
#define I2C_ADDR_WRITE ( (I2C_ADDR<<1) | I2C_WRITE )
|
||||
#define I2C_ADDR_READ ( (I2C_ADDR<<1) | I2C_READ )
|
||||
#define IODIRA 0x00 // i/o direction register
|
||||
#define IODIRB 0x01
|
||||
#define GPPUA 0x0C // GPIO pull-up resistor register
|
||||
#define GPPUB 0x0D
|
||||
#define GPIOA 0x12 // general purpose i/o port register (write modifies OLAT)
|
||||
#define GPIOB 0x13
|
||||
#define OLATA 0x14 // output latch register
|
||||
#define OLATB 0x15
|
||||
|
||||
extern uint8_t mcp23018_status;
|
||||
|
||||
void init_frenchdev(void);
|
||||
void frenchdev_blink_all_leds(void);
|
||||
uint8_t init_mcp23018(void);
|
||||
|
||||
#define LED_BRIGHTNESS_LO 15
|
||||
#define LED_BRIGHTNESS_HI 255
|
||||
|
||||
|
||||
inline void frenchdev_board_led_on(void) { DDRD |= (1<<6); PORTD |= (1<<6); }
|
||||
inline void frenchdev_led_1_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); }
|
||||
inline void frenchdev_led_2_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); }
|
||||
inline void frenchdev_led_3_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); }
|
||||
inline void frenchdev_led_on(uint8_t led) { DDRB |= (1<<(led+4)); PORTB |= (1<<(led+4)); }
|
||||
|
||||
inline void frenchdev_board_led_off(void) { DDRD &= ~(1<<6); PORTD &= ~(1<<6); }
|
||||
inline void frenchdev_led_1_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); }
|
||||
inline void frenchdev_led_2_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); }
|
||||
inline void frenchdev_led_3_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); }
|
||||
inline void frenchdev_led_off(uint8_t led) { DDRB &= ~(1<<(led+4)); PORTB &= ~(1<<(led+4)); }
|
||||
|
||||
inline void frenchdev_led_all_on(void)
|
||||
{
|
||||
frenchdev_board_led_on();
|
||||
frenchdev_led_1_on();
|
||||
frenchdev_led_2_on();
|
||||
frenchdev_led_3_on();
|
||||
}
|
||||
|
||||
inline void frenchdev_led_all_off(void)
|
||||
{
|
||||
frenchdev_board_led_off();
|
||||
frenchdev_led_1_off();
|
||||
frenchdev_led_2_off();
|
||||
frenchdev_led_3_off();
|
||||
}
|
||||
|
||||
inline void frenchdev_led_1_set(uint8_t n) { OCR1A = n; }
|
||||
inline void frenchdev_led_2_set(uint8_t n) { OCR1B = n; }
|
||||
inline void frenchdev_led_3_set(uint8_t n) { OCR1C = n; }
|
||||
inline void frenchdev_led_set(uint8_t led, uint8_t n) {
|
||||
(led == 1) ? (OCR1A = n) :
|
||||
(led == 2) ? (OCR1B = n) :
|
||||
(OCR1C = n);
|
||||
}
|
||||
|
||||
inline void frenchdev_led_all_set(uint8_t n)
|
||||
{
|
||||
frenchdev_led_1_set(n);
|
||||
frenchdev_led_2_set(n);
|
||||
frenchdev_led_3_set(n);
|
||||
}
|
||||
|
||||
#define KEYMAP( \
|
||||
\
|
||||
k01, k02, k03, k04, k05, k06, k09, k0a, k0b, k0c, k0d, k0e, \
|
||||
k10, k11, k12, k13, k14, k15, k16, k19, k1a, k1b, k1c, k1d, k1e, k1f, \
|
||||
k20, k21, k22, k23, k24, k25, k26, k29, k2a, k2b, k2c, k2d, k2e, k2f, \
|
||||
k30, k31, k32, k33, k34, k35, k36, k39, k3a, k3b, k3c, k3d, k3e, k3f, \
|
||||
k40, k41, k42, k43, k44, k45, k46, k47, k37, k38, k48, k49, k4a, k4b, k4c, k4d, k4e, k4f, \
|
||||
k50, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5a, k5b, k5c, k5d, k5e, k5f, \
|
||||
\
|
||||
PL1, PL2, PL3, \
|
||||
PR1, PR2, PR3 \
|
||||
) \
|
||||
\
|
||||
/* matrix positions, inverted left and right for I2C to be on row 0-7 */\
|
||||
{ \
|
||||
\
|
||||
{ k5f, k4f, k3f, k2f, k1f, KC_NO}, \
|
||||
{ k5e, k4e, k3e, k2e, k1e, k0e }, \
|
||||
{ k5d, k4d, k3d, k2d, k1d, k0d }, \
|
||||
{ k5c, k4c, k3c, k2c, k1c, k0c }, \
|
||||
{ k5b, k4b, k3b, k2b, k1b, k0b }, \
|
||||
{ k5a, k4a, k3a, k2a, k1a, k0a }, \
|
||||
{ k59, k49, k39, k29, k19, k09 }, \
|
||||
{ k58, k48, k38, PR1, PR2, PR3 }, \
|
||||
\
|
||||
{ k57, k47, k37, PL1, PL2, PL3 }, \
|
||||
{ k56, k46, k36, k26, k16, k06 }, \
|
||||
{ k55, k45, k35, k25, k15, k05 }, \
|
||||
{ k54, k44, k34, k24, k14, k04 }, \
|
||||
{ k53, k43, k33, k23, k13, k03 }, \
|
||||
{ k52, k42, k32, k22, k12, k02 }, \
|
||||
{ k51, k41, k31, k21, k11, k01 }, \
|
||||
{ k50, k40, k30, k20, k10, KC_NO } \
|
||||
}
|
||||
|
||||
#endif
|
178
keyboards/handwired/frenchdev/i2cmaster.h
Normal file
178
keyboards/handwired/frenchdev/i2cmaster.h
Normal file
@@ -0,0 +1,178 @@
|
||||
#ifndef _I2CMASTER_H
|
||||
#define _I2CMASTER_H 1
|
||||
/*************************************************************************
|
||||
* Title: C include file for the I2C master interface
|
||||
* (i2cmaster.S or twimaster.c)
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device
|
||||
* Usage: see Doxygen manual
|
||||
**************************************************************************/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
@defgroup pfleury_ic2master I2C Master library
|
||||
@code #include <i2cmaster.h> @endcode
|
||||
|
||||
@brief I2C (TWI) Master Software Library
|
||||
|
||||
Basic routines for communicating with I2C slave devices. This single master
|
||||
implementation is limited to one bus master on the I2C bus.
|
||||
|
||||
This I2c library is implemented as a compact assembler software implementation of the I2C protocol
|
||||
which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c).
|
||||
Since the API for these two implementations is exactly the same, an application can be linked either against the
|
||||
software I2C implementation or the hardware I2C implementation.
|
||||
|
||||
Use 4.7k pull-up resistor on the SDA and SCL pin.
|
||||
|
||||
Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module
|
||||
i2cmaster.S to your target when using the software I2C implementation !
|
||||
|
||||
Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion.
|
||||
|
||||
@note
|
||||
The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted
|
||||
to GNU assembler and AVR-GCC C call interface.
|
||||
Replaced the incorrect quarter period delays found in AVR300 with
|
||||
half period delays.
|
||||
|
||||
@author Peter Fleury pfleury@gmx.ch http://jump.to/fleury
|
||||
|
||||
@par API Usage Example
|
||||
The following code shows typical usage of this library, see example test_i2cmaster.c
|
||||
|
||||
@code
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
#define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned char ret;
|
||||
|
||||
i2c_init(); // initialize I2C library
|
||||
|
||||
// write 0x75 to EEPROM address 5 (Byte Write)
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_write(0x75); // write value 0x75 to EEPROM
|
||||
i2c_stop(); // set stop conditon = release bus
|
||||
|
||||
|
||||
// read previously written value back from EEPROM address 5
|
||||
i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode
|
||||
|
||||
i2c_write(0x05); // write address = 5
|
||||
i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode
|
||||
|
||||
ret = i2c_readNak(); // read one byte from EEPROM
|
||||
i2c_stop();
|
||||
|
||||
for(;;);
|
||||
}
|
||||
@endcode
|
||||
|
||||
*/
|
||||
#endif /* DOXYGEN */
|
||||
|
||||
/**@{*/
|
||||
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304
|
||||
#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !"
|
||||
#endif
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_READ 1
|
||||
|
||||
/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */
|
||||
#define I2C_WRITE 0
|
||||
|
||||
|
||||
/**
|
||||
@brief initialize the I2C master interace. Need to be called only once
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_init(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Terminates the data transfer and releases the I2C bus
|
||||
@param void
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_stop(void);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
@param addr address and transfer direction of I2C device
|
||||
@retval 0 device accessible
|
||||
@retval 1 failed to access device
|
||||
*/
|
||||
extern unsigned char i2c_rep_start(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Issues a start condition and sends address and transfer direction
|
||||
|
||||
If device is busy, use ack polling to wait until device ready
|
||||
@param addr address and transfer direction of I2C device
|
||||
@return none
|
||||
*/
|
||||
extern void i2c_start_wait(unsigned char addr);
|
||||
|
||||
|
||||
/**
|
||||
@brief Send one byte to I2C device
|
||||
@param data byte to be transfered
|
||||
@retval 0 write successful
|
||||
@retval 1 write failed
|
||||
*/
|
||||
extern unsigned char i2c_write(unsigned char data);
|
||||
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, request more data from device
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readAck(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_readNak(void);
|
||||
|
||||
/**
|
||||
@brief read one byte from the I2C device
|
||||
|
||||
Implemented as a macro, which calls either i2c_readAck or i2c_readNak
|
||||
|
||||
@param ack 1 send ack, request more data from device<br>
|
||||
0 send nak, read is followed by a stop condition
|
||||
@return byte read from I2C device
|
||||
*/
|
||||
extern unsigned char i2c_read(unsigned char ack);
|
||||
#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
409
keyboards/handwired/frenchdev/keymaps/default/keymap.c
Normal file
409
keyboards/handwired/frenchdev/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,409 @@
|
||||
#include "frenchdev.h"
|
||||
#include "mousekey.h"
|
||||
#include "action.h"
|
||||
#include "action_layer.h"
|
||||
#include "keymap_extras/keymap_bepo.h"
|
||||
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
#define _BASE 0
|
||||
#define _SYMBOLS 1
|
||||
#define _MEDIA 2
|
||||
#define _TRNS 8
|
||||
|
||||
#define PEDAL_DELAY 250
|
||||
#define KEY_DELAY 130
|
||||
|
||||
enum macros {
|
||||
M_LP, // left pedal
|
||||
M_RP, // right pedal
|
||||
M_SF, // shift
|
||||
M_SFS, // shift and space
|
||||
M_L1E, // L1 and space
|
||||
L2INS, // L2 and insert
|
||||
L2LOC, // Lock L2
|
||||
M_UN, // undo
|
||||
M_CUT, // cut
|
||||
M_CP, // copy
|
||||
M_PS, // paste
|
||||
M_SE, // search
|
||||
M_SFU, // shift and underscore
|
||||
};
|
||||
|
||||
static uint16_t key_timer_left_pedal;
|
||||
static uint16_t key_timer_right_pedal;
|
||||
static uint16_t key_timer_shift;
|
||||
static uint16_t key_timer_1;
|
||||
static uint16_t key_timer_2;
|
||||
|
||||
static uint16_t shift_count = 0; //this is used to keep track of shift state and avoid inserting non breakable space
|
||||
static uint16_t l2_locked = 0; //this indicate wether L2 is locked
|
||||
|
||||
#define BP_CBSP CTL_T(KC_BSPC)
|
||||
#define BP_CDEL CTL_T(KC_DEL)
|
||||
|
||||
//layout : http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* base
|
||||
* left foot clicked is right click
|
||||
* left foot pressed is layer 2
|
||||
* right foot clicked is left click
|
||||
* right foot pressed is layer 1 + scroll lock (used with autohotkey for easier scrolling with trackballs)
|
||||
* ,------. .. ,------. *
|
||||
* ,------| F3 |-------------. .. ,-------------| F10 |------. *
|
||||
* ,------| F2 |------| F4 | F5 |------. .. ,------| F8 | F9 |------| F11 |------. *
|
||||
* | F1 |------| »/3 |------|------| F6 | .. | F7 |------|------| -/8 |------| F12 | *
|
||||
* ,------+------| «/2 |------| (/4 | )/5 |------| .. |------| @/6 | +/7 |------| //9 |------+------. *
|
||||
* | ESC | "/1 |------| O |------|------| ¨ | .. | ^ |------|------| D |------| * /0 |BCKSP | *
|
||||
* |------+------| É |------| P | È |------| .. |------| K | V |------| L |------+------| *
|
||||
* | TAB | B |------| E |------|------| _ | .. | =/° |------|------| S |------| J |ENTER | *
|
||||
* |------+------| U |------| I | F |------| .. |------| C | T |------| R |------+------| *
|
||||
* | ` | A |------| Y |------|------| ; | .. | ! |------|------| UP |------| N | '/? | *
|
||||
* |------+------| À |------| X | W |------|-------------. .. .-------------|------| M | G |------| H |------+------| *
|
||||
* | SHIFT| Z |------| . |------|------|sp/sh |bsp/ct|L2/ins| .. |L2lock|del/CT|sp/sh |------|------| DOWN |------| Q |SHIFT | *
|
||||
* |------+------| / |------| , | space|------|------|------ .. ------|------|------| L1/sp| LEFT |------| UP |------+------| *
|
||||
* | CTRL | win |------/ \-------------| L1 | alt | .. | CAPS | L1 |-------------/ \------| : | CTRL | *
|
||||
* `-------------/ \-------------/ .. \-------------/ \-------------/ *
|
||||
*M(M_LP)
|
||||
*/
|
||||
[_BASE] = KEYMAP(
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
|
||||
KC_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \
|
||||
KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \
|
||||
BP_GRV, BP_A, BP_U, BP_E, BP_I, BP_F, BP_SCLN, BP_EXLM, BP_C, BP_T, BP_S, BP_R, BP_N, BP_APOS, \
|
||||
M(M_SF), BP_Z, BP_AGRV, BP_Y, BP_X, KC_RBRACKET, M(M_SFS), BP_CBSP, M(L2INS), M(L2LOC), BP_CDEL, M(M_SFS),BP_M, BP_G, KC_UP, BP_H, BP_Q, M(M_SF), \
|
||||
KC_LCTL, KC_LGUI, KC_PSLS, BP_DOT, BP_COMM, KC_SPACE,M(M_L1E), KC_LALT, KC_CAPS, M(M_L1E),KC_SPACE,KC_LEFT, KC_DOWN, KC_RIGHT,BP_COLN, KC_RCTL, \
|
||||
//left pedals
|
||||
M(M_LP), M(M_RP), KC_TRNS, \
|
||||
//right pedals
|
||||
M(M_LP), M(M_RP), KC_TRNS \
|
||||
),
|
||||
|
||||
/* Larer 1 for symbols.
|
||||
* left foot is middle click
|
||||
* ,------. .. ,------. *
|
||||
* ,------| |-------------. .. ,-------------| |------. *
|
||||
* ,------| |------| | |------. .. ,------| | |------| |------. *
|
||||
* | |------| § |------|------| | .. | |------|------| ± |------| | *
|
||||
* ,------+------| ¶ |------| µ | |------| .. |------| ≤ | ≥ |------| ÷ |------+------. *
|
||||
* | | ¤ |------| { |------|------| ~ | .. | ˇ |------|------| ] |------| × | | *
|
||||
* |------+------| * |------| } | ` |------| .. |------| # | [ |------| % |------+------| *
|
||||
* | | \ |------| ( |------|------| | .. | ≠ |------|------| > |------| ‰ | | *
|
||||
* |------+------| Ù |------| ) | + |------| .. |------| Ç | < |------| & |------+------| *
|
||||
* | | = |------| copy |------|------| : | .. | ? |------|------| PGUP |------| _ | | *
|
||||
* |------+------| cut |------| paste|search|------|-------------. .. .-------------|------| $ | = |------| | |------+------| *
|
||||
* | | undo |------| \ |------|------| | | | .. | | | |------|------| PGDN |------| / | | *
|
||||
* |------+------| |------| | |------|------|------ .. ------|------|------| | HOME |------| PGDN |------+------| *
|
||||
* | | |------/ \-------------| | | .. | | |-------------/ \------| | | *
|
||||
* `-------------/ \-------------/ .. \-------------/ \-------------/ *
|
||||
*
|
||||
*/
|
||||
[_SYMBOLS] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \
|
||||
KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \
|
||||
KC_TRNS, BP_EQL, BP_UGRV, BP_LPRN, BP_RPRN, BP_PLUS, BP_COLN, BP_QEST, BP_CCED, BP_LESS, BP_GRTR, BP_AMPR, BP_UNDS, KC_TRNS, \
|
||||
KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), M(M_SE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BP_DLR, BP_EQL, KC_PGUP, BP_PIPE, BP_SLSH, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, BP_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, \
|
||||
//left pedals
|
||||
KC_TRNS, KC_BTN1, KC_TRNS, \
|
||||
//right pedals
|
||||
KC_TRNS, KC_BTN1, KC_TRNS \
|
||||
),
|
||||
|
||||
/* MEDIA, mouse and numpad.
|
||||
* right pedal is left clic
|
||||
* ,------. .. ,------. *
|
||||
* ,------|PAUSE |-------------. .. ,-------------| PRINT|------. *
|
||||
* ,------|SCROLL|------|MUTE |VOLUD |------. .. ,------| pre | next |------| calc |------. *
|
||||
* |RESET |------| stop |------|------|VOLDU | .. | play |------|------| stop |------| num | *
|
||||
* ,------+------| |------| pre | next |------| .. |------| pre | next |------| |------+------. *
|
||||
* | | |------|scrolu|------|------| play | .. | play |------|------| 8 |------| - | | *
|
||||
* |------+------| |------| | bt4 |------| .. |------| next | 7 |------| 9 |------+------| *
|
||||
* | | |------|scrold|------|------| bt5 | .. | pre |------|------| 5 |------| + | | *
|
||||
* |------+------| |------|mclic | rclic|------| .. |------| rclic| 4 |------| 6 |------+------| *
|
||||
* | | |------| |------|------| lclic| .. | lclic|------|------| 2 |------| * | | *
|
||||
* |------+------| |------| | mclck|------|-------------. .. .-------------|------| mclic| 1 |------| 3 |------+------| *
|
||||
* | | |------| |------|------| | | | .. | | | |------|------| num. |------| / | | *
|
||||
* |------+------| |------| | |------|------|------ .. ------|------|------| | 0 |------| . |------+------| *
|
||||
* | | |------/ \-------------| | | .. | | |-------------/ \------| , | | *
|
||||
* `-------------/ \-------------/ .. \-------------/ \-------------/ *
|
||||
*
|
||||
*/
|
||||
[_MEDIA] = KEYMAP(
|
||||
RESET, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_CALC, KC_NLCK, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, KC_TRNS, \
|
||||
KC_TRNS, M(M_UN), M(M_CUT),M(M_CP), M(M_PS), KC_BTN3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_KP_1, KC_KP_2, KC_KP_3, KC_PSLS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_PDOT, BP_DOT, BP_COMM, KC_TRNS, \
|
||||
//left pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS, \
|
||||
//right pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS \
|
||||
),
|
||||
|
||||
/* TRNS - skeleton for laters
|
||||
* ,------. .. ,------. *
|
||||
* ,------| |-------------. .. ,-------------| |------. *
|
||||
* ,------| |------| | |------. .. ,------| | |------| |------. *
|
||||
* | |------| |------|------| | .. | |------|------| |------| | *
|
||||
* ,------+------| |------| | |------| .. |------| | |------| |------+------. *
|
||||
* | | |------| |------|------| | .. | |------|------| |------| | | *
|
||||
* |------+------| |------| | |------| .. |------| | |------| |------+------| *
|
||||
* | | |------| |------|------| | .. | |------|------| |------| | | *
|
||||
* |------+------| |------| | |------| .. |------| | |------| |------+------| *
|
||||
* | | |------| |------|------| | .. | |------|------| |------| | | *
|
||||
* |------+------| |------| | |------|-------------. .. .-------------|------| | |------| |------+------| *
|
||||
* | | |------| |------|------| | | | .. | | | |------|------| |------| | | *
|
||||
* |------+------| |------| | |------|------|------ .. ------|------|------| | |------| |------+------| *
|
||||
* | | |------/ \-------------| | | .. | | |-------------/ \------| | | *
|
||||
* `-------------/ \-------------/ .. \-------------/ \-------------/ *
|
||||
*
|
||||
*/
|
||||
|
||||
[_TRNS] = KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \
|
||||
//left pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS, \
|
||||
//right pedals
|
||||
KC_BTN3, M(M_RP), KC_TRNS \
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
||||
void hold_shift(void) {
|
||||
shift_count = shift_count + 1;
|
||||
register_code(KC_LSHIFT);
|
||||
}
|
||||
|
||||
void release_shift(void) {
|
||||
shift_count = shift_count - 1;
|
||||
if(shift_count <= 0){
|
||||
unregister_code(KC_LSHIFT);
|
||||
shift_count = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void press_space(void) {
|
||||
if(shift_count > 0) unregister_code (KC_LSHIFT);
|
||||
register_code (KC_SPACE);
|
||||
unregister_code (KC_SPACE);
|
||||
if(shift_count > 0) register_code (KC_LSHIFT);
|
||||
}
|
||||
|
||||
void press_enter(void) {
|
||||
if(shift_count > 0) unregister_code (KC_LSHIFT);
|
||||
register_code (KC_ENT);
|
||||
unregister_code (KC_ENT);
|
||||
if(shift_count > 0) register_code (KC_LSHIFT);
|
||||
}
|
||||
|
||||
void press_underscore(void) {
|
||||
if(shift_count > 0) unregister_code (KC_LSHIFT);
|
||||
register_code ((unsigned char) BP_UNDS);
|
||||
unregister_code ((unsigned char) BP_UNDS);
|
||||
if(shift_count > 0) register_code (KC_LSHIFT);
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
switch(id) {
|
||||
case M_LP: //left pedal
|
||||
if (record->event.pressed) {
|
||||
layer_on(1);
|
||||
register_code (KC_SLCK);
|
||||
key_timer_left_pedal = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_left_pedal) < KEY_DELAY) {
|
||||
mousekey_on (KC_BTN2);
|
||||
mousekey_send();
|
||||
mousekey_off (KC_BTN2);
|
||||
mousekey_send();
|
||||
}
|
||||
unregister_code (KC_SLCK);
|
||||
layer_off(1);
|
||||
}
|
||||
break;
|
||||
case M_RP: //right pedal
|
||||
if (record->event.pressed) {
|
||||
layer_on(2);
|
||||
key_timer_right_pedal = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_right_pedal) < PEDAL_DELAY) {
|
||||
mousekey_on (KC_BTN1);
|
||||
mousekey_send();
|
||||
mousekey_off (KC_BTN1);
|
||||
mousekey_send();
|
||||
}
|
||||
layer_off(2);
|
||||
}
|
||||
break;
|
||||
case M_SF: // shift, using macro to keep track of shift state and avoid inserting nbsp by mistake
|
||||
if (record->event.pressed) {
|
||||
hold_shift();
|
||||
} else {
|
||||
release_shift();
|
||||
}
|
||||
break;
|
||||
case M_SFS: // shift when held, space when tapped
|
||||
if (record->event.pressed) {
|
||||
hold_shift();
|
||||
key_timer_shift = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_shift) < KEY_DELAY) {
|
||||
press_space();
|
||||
}
|
||||
release_shift();
|
||||
}
|
||||
break;
|
||||
case M_SFU: // shift when held, _ when tapped
|
||||
if (record->event.pressed) {
|
||||
hold_shift();
|
||||
key_timer_shift = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_shift) < KEY_DELAY) {
|
||||
press_space();
|
||||
}
|
||||
release_shift();
|
||||
}
|
||||
break;
|
||||
case M_L1E: // L1 when held, space when tapped
|
||||
if (record->event.pressed) {
|
||||
layer_on(1);
|
||||
key_timer_1 = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_1) < KEY_DELAY) {
|
||||
press_enter();
|
||||
}
|
||||
layer_off(1);
|
||||
}
|
||||
break;
|
||||
case L2INS: //activate layer 2, if released before 100ms trigger INS. basicaly equivalent to LT(2, KC_INS) but without delay for activation of layer 2
|
||||
if (record->event.pressed) {
|
||||
layer_on(2);
|
||||
key_timer_2 = timer_read(); // if the key is being pressed, we start the timer.
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_2) < KEY_DELAY) {
|
||||
register_code (KC_INS);
|
||||
unregister_code (KC_INS);
|
||||
}
|
||||
l2_locked = 0;
|
||||
layer_off(2);
|
||||
}
|
||||
break;
|
||||
case L2LOC: //lock L2
|
||||
if (record->event.pressed) {
|
||||
key_timer_2 = timer_read(); // if the key is being pressed, we start the timer.
|
||||
layer_on(2);
|
||||
} else {
|
||||
if (timer_elapsed(key_timer_2) < KEY_DELAY && l2_locked == 0) {
|
||||
l2_locked = 1;
|
||||
layer_on(2);
|
||||
} else {
|
||||
l2_locked = 0;
|
||||
layer_off(2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case M_UN: // undo
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_Z);
|
||||
unregister_code(BP_Z);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
case M_CUT: // cut
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_X);
|
||||
unregister_code(BP_X);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
case M_CP: // copy
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_C);
|
||||
unregister_code(BP_C);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
case M_PS: // paste
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_V);
|
||||
unregister_code(BP_V);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
case M_SE: // search
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LCTL);
|
||||
register_code(BP_F);
|
||||
unregister_code(BP_F);
|
||||
unregister_code(KC_LCTL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
// Bleah globals need to be initialized.
|
||||
uint8_t old_layer=_BASE;
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
frenchdev_led_1_off();
|
||||
frenchdev_led_2_off();
|
||||
switch (layer) {
|
||||
case _BASE:
|
||||
frenchdev_led_2_on();
|
||||
break;
|
||||
case _SYMBOLS:
|
||||
frenchdev_led_1_on();
|
||||
break;
|
||||
case _MEDIA:
|
||||
frenchdev_led_1_on();
|
||||
frenchdev_led_2_on();
|
||||
default:
|
||||
// none
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)){
|
||||
frenchdev_led_3_on();
|
||||
} else {
|
||||
frenchdev_led_3_off();
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
|
13
keyboards/handwired/frenchdev/keymaps/default/readme.md
Normal file
13
keyboards/handwired/frenchdev/keymaps/default/readme.md
Normal file
@@ -0,0 +1,13 @@
|
||||
layout :
|
||||
|
||||
[default layout](http://i.imgur.com/r2Nvr4p.png)
|
||||
|
||||
the thing when finished :
|
||||
http://imgur.com/a/6FY8v
|
||||
|
||||
concept and mockup:
|
||||
http://imgur.com/a/R0vvs
|
||||
|
||||
to build :
|
||||
|
||||
docker run --rm -e keymap=default -e keyboard=frenchdev --rm -v D:/Repositories/qmk:/qmk:rw edasque/qmk_firmware
|
396
keyboards/handwired/frenchdev/matrix.c
Normal file
396
keyboards/handwired/frenchdev/matrix.c
Normal file
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
|
||||
Note to self: adapted from ergodox EZ matrix
|
||||
The "column" and "row" in here actually refers to the opposite on the keyboard
|
||||
see definition of KEYMAP in v1.h, the grid is transposed so that a "row" in here is actually a "column" on the physical keyboard
|
||||
Nicolas
|
||||
|
||||
Note for ErgoDox EZ customizers: Here be dragons!
|
||||
This is not a file you want to be messing with.
|
||||
All of the interesting stuff for you is under keymaps/ :)
|
||||
Love, Erez
|
||||
|
||||
Copyright 2013 Oleg Kostyuk <cub.uanic@gmail.com>
|
||||
Copyright 2013 Nicolas Poirey <nicolas.poirey@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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* scan matrix
|
||||
*/
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <avr/io.h>
|
||||
#include "wait.h"
|
||||
#include "action_layer.h"
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "util.h"
|
||||
#include "matrix.h"
|
||||
#include "frenchdev.h"
|
||||
#include "i2cmaster.h"
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
#include "timer.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This constant define not debouncing time in msecs, but amount of matrix
|
||||
* scan loops which should be made to get stable debounced results.
|
||||
*
|
||||
* On Ergodox matrix scan rate is relatively low, because of slow I2C.
|
||||
* Now it's only 317 scans/second, or about 3.15 msec/scan.
|
||||
* According to Cherry specs, debouncing time is 5 msec.
|
||||
*
|
||||
* And so, there is no sense to have DEBOUNCE higher than 2.
|
||||
*/
|
||||
|
||||
#ifndef DEBOUNCE
|
||||
# define DEBOUNCE 5
|
||||
#endif
|
||||
static uint8_t debouncing = DEBOUNCE;
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
static matrix_row_t read_cols(uint8_t row);
|
||||
static void init_cols(void);
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
static uint8_t mcp23018_reset_loop;
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
uint32_t matrix_timer;
|
||||
uint32_t matrix_scan_count;
|
||||
#endif
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_kb(void) {
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
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
|
||||
debug_enable = true;
|
||||
debug_matrix = true;
|
||||
debug_keyboard = true;
|
||||
debug_mouse = true;
|
||||
|
||||
mcp23018_status = init_mcp23018();
|
||||
|
||||
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
matrix_timer = timer_read32();
|
||||
matrix_scan_count = 0;
|
||||
#endif
|
||||
|
||||
matrix_init_quantum();
|
||||
|
||||
}
|
||||
|
||||
void matrix_power_up(void) {
|
||||
mcp23018_status = init_mcp23018();
|
||||
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
matrix_timer = timer_read32();
|
||||
matrix_scan_count = 0;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
uint8_t matrix_scan(void)
|
||||
{
|
||||
if (mcp23018_status) { // if there was an error
|
||||
if (++mcp23018_reset_loop == 0) {
|
||||
// since mcp23018_reset_loop is 8 bit - we'll try to reset once in 255 matrix scans
|
||||
// this will be approx bit more frequent than once per second
|
||||
print("trying to reset mcp23018\n");
|
||||
mcp23018_status = init_mcp23018();
|
||||
if (mcp23018_status) {
|
||||
print("left side not responding\n");
|
||||
} else {
|
||||
print("left side attached\n");
|
||||
frenchdev_blink_all_leds();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MATRIX_SCAN_RATE
|
||||
matrix_scan_count++;
|
||||
|
||||
uint32_t timer_now = timer_read32();
|
||||
if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) {
|
||||
print("matrix scan frequency: ");
|
||||
pdec(matrix_scan_count);
|
||||
print("\n");
|
||||
|
||||
matrix_timer = timer_now;
|
||||
matrix_scan_count = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
select_row(i);
|
||||
wait_us(30); // without this wait read unstable value.
|
||||
matrix_row_t cols = read_cols(i);
|
||||
if (matrix_debouncing[i] != cols) {
|
||||
matrix_debouncing[i] = cols;
|
||||
if (debouncing) {
|
||||
debug("bounce!: "); debug_hex(debouncing); debug("\n");
|
||||
}
|
||||
debouncing = DEBOUNCE;
|
||||
}
|
||||
unselect_rows();
|
||||
}
|
||||
|
||||
if (debouncing) {
|
||||
if (--debouncing) {
|
||||
wait_us(1);
|
||||
// this should be wait_ms(1) but has been left as-is at EZ's request
|
||||
} else {
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = matrix_debouncing[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matrix_scan_quantum();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool matrix_is_modified(void)
|
||||
{
|
||||
if (debouncing) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
inline
|
||||
bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
{
|
||||
return (matrix[row] & ((matrix_row_t)1<<col));
|
||||
}
|
||||
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
{
|
||||
print("\nr/c 0123456789ABCDEF\n");
|
||||
for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
|
||||
phex(row); print(": ");
|
||||
pbin_reverse16(matrix_get_row(row));
|
||||
print("\n");
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t matrix_key_count(void)
|
||||
{
|
||||
uint8_t count = 0;
|
||||
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
|
||||
count += bitpop16(matrix[i]);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Column pin configuration
|
||||
*
|
||||
* Teensy
|
||||
* col: 0 1 2 3 4 5
|
||||
* pin: F0 F1 F4 F5 F6 F7
|
||||
*
|
||||
* MCP23018
|
||||
* col: 0 1 2 3 4 5
|
||||
* pin: B5 B4 B3 B2 B1 B0
|
||||
*/
|
||||
static void init_cols(void)
|
||||
{
|
||||
// init on mcp23018
|
||||
// not needed, already done as part of init_mcp23018()
|
||||
|
||||
// init on teensy
|
||||
// Input with pull-up(DDR:0, PORT:1)
|
||||
DDRF &= ~(1<<7 | 1<<6 | 1<<5 | 1<<4 | 1<<1 | 1<<0);
|
||||
PORTF |= (1<<7 | 1<<6 | 1<<5 | 1<<4 | 1<<1 | 1<<0);
|
||||
}
|
||||
|
||||
static matrix_row_t read_cols(uint8_t row)
|
||||
{
|
||||
if (row < 8) {
|
||||
if (mcp23018_status) { // if there was an error
|
||||
return 0;
|
||||
} else {
|
||||
uint8_t data = 0;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOB); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_start(I2C_ADDR_READ); if (mcp23018_status) goto out;
|
||||
data = i2c_readNak();
|
||||
data = ~data;
|
||||
out:
|
||||
i2c_stop();
|
||||
return data;
|
||||
}
|
||||
} else {
|
||||
// read from teensy
|
||||
return
|
||||
(PINF&(1<<0) ? 0 : (1<<0)) |
|
||||
(PINF&(1<<1) ? 0 : (1<<1)) |
|
||||
(PINF&(1<<4) ? 0 : (1<<2)) |
|
||||
(PINF&(1<<5) ? 0 : (1<<3)) |
|
||||
(PINF&(1<<6) ? 0 : (1<<4)) |
|
||||
(PINF&(1<<7) ? 0 : (1<<5)) ;
|
||||
}
|
||||
}
|
||||
|
||||
/* Row pin configuration
|
||||
*
|
||||
* Teensy
|
||||
* row: 7 8 9 10 11 12 13
|
||||
* pin: B0 B1 B2 B3 D2 D3 C6
|
||||
*
|
||||
* MCP23018
|
||||
* row: 0 1 2 3 4 5 6
|
||||
* pin: A0 A1 A2 A3 A4 A5 A6
|
||||
*/
|
||||
static void unselect_rows(void)
|
||||
{
|
||||
// unselect on mcp23018
|
||||
if (mcp23018_status) { // if there was an error
|
||||
// do nothing
|
||||
} else {
|
||||
// set all rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF
|
||||
& ~(0<<8)
|
||||
); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
|
||||
// unselect on teensy
|
||||
// Hi-Z(DDR:0, PORT:0) to unselect
|
||||
DDRB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3);
|
||||
PORTB &= ~(1<<0 | 1<<1 | 1<<2 | 1<<3);
|
||||
DDRD &= ~(1<<2 | 1<<3);
|
||||
PORTD &= ~(1<<2 | 1<<3);
|
||||
DDRC &= ~(1<<6 | 1<<7);
|
||||
PORTC &= ~(1<<6 | 1<<7);
|
||||
}
|
||||
|
||||
static void select_row(uint8_t row)
|
||||
{
|
||||
if (row < 8) {
|
||||
// select on mcp23018
|
||||
if (mcp23018_status) { // if there was an error
|
||||
// do nothing
|
||||
} else {
|
||||
// set active row low : 0
|
||||
// set other rows hi-Z : 1
|
||||
mcp23018_status = i2c_start(I2C_ADDR_WRITE); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write(GPIOA); if (mcp23018_status) goto out;
|
||||
mcp23018_status = i2c_write( 0xFF & ~(1<<row)
|
||||
& ~(0<<8)
|
||||
); if (mcp23018_status) goto out;
|
||||
out:
|
||||
i2c_stop();
|
||||
}
|
||||
} else {
|
||||
// select on teensy
|
||||
// Output low(DDR:1, PORT:0) to select
|
||||
switch (row) {
|
||||
case 8:
|
||||
DDRB |= (1<<0);
|
||||
PORTB &= ~(1<<0);
|
||||
break;
|
||||
case 9:
|
||||
DDRB |= (1<<1);
|
||||
PORTB &= ~(1<<1);
|
||||
break;
|
||||
case 10:
|
||||
DDRB |= (1<<2);
|
||||
PORTB &= ~(1<<2);
|
||||
break;
|
||||
case 11:
|
||||
DDRB |= (1<<3);
|
||||
PORTB &= ~(1<<3);
|
||||
break;
|
||||
case 12:
|
||||
DDRD |= (1<<2);
|
||||
PORTD &= ~(1<<3);
|
||||
break;
|
||||
case 13:
|
||||
DDRD |= (1<<3);
|
||||
PORTD &= ~(1<<3);
|
||||
break;
|
||||
case 14:
|
||||
DDRC |= (1<<6);
|
||||
PORTC &= ~(1<<6);
|
||||
break;
|
||||
case 15:
|
||||
DDRC |= (1<<7);
|
||||
PORTC &= ~(1<<7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
102
keyboards/handwired/frenchdev/readme.md
Normal file
102
keyboards/handwired/frenchdev/readme.md
Normal file
@@ -0,0 +1,102 @@
|
||||
# Frenchdev : My take on a splitted keyboard for dev and french language
|
||||
Concept based on
|
||||
- [ergodox](https://ergodox-ez.com/)
|
||||
- [katy](https://deskthority.net/workshop-f7/katy-keyboard-or-k80cs-key80-contoured-split-t8524.html)
|
||||
|
||||
with the added possibility to connect up to 6 external switches like pedals,
|
||||
and somewhat like the katy, not all keys are on the same level for easier reach.
|
||||
|
||||
###Photos
|
||||
- [default layout](http://i.imgur.com/r2Nvr4p.png)
|
||||
- [editable layout on keyboard layout editor](http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa) (keys placement is NOT precise on this)
|
||||
- [the thing when finished](http://imgur.com/a/6FY8v)
|
||||
- [concept and cardboard mockup](http://imgur.com/a/R0vvs)
|
||||
|
||||
##Build instructions
|
||||
|
||||
docker run --rm -e keymap=default -e keyboard=frenchdev --rm -v D:/Repositories/qmk:/qmk:rw edasque/qmk_firmware
|
||||
|
||||
##Laser-cuttable file
|
||||
There is intentionnaly no hole for the TRRS connector, you are supposed to use a drill for it.
|
||||
This way if you don't want to use the pedals you don't have a useless hole. Plus it's cleaner.
|
||||
http://qmk.fm/frenchdev/frenchdev_v1_lasercut_template.svg
|
||||
|
||||
##Side stickers
|
||||
You can find my original file here : http://qmk.fm/frenchdev/example_printable_stickers.svg
|
||||
|
||||
I used it when training but now I use blanks and the layout is different.
|
||||
I still uploaded it because I think it can be a good jumpstart for any temporary stickers on the
|
||||
side of keycaps.
|
||||
|
||||
##List of parts
|
||||
- I2C mcp23018
|
||||
- [teensy 2](https://www.pjrc.com/store/teensy.html)
|
||||
- 3 LED, 5mm tall with flat head
|
||||
- 3 330 ohm resistor
|
||||
- 2 470 ohm resistor
|
||||
- 2 TRRS connectors
|
||||
- 1 [micro usb breakout board](http://www.ebay.com/itm/-/201387922085?)
|
||||
- 88 cherry/gateron switchs
|
||||
- 94 4148 diodes
|
||||
- 34 R4 keys
|
||||
- 14 R3 keys
|
||||
- 20 R2 keys
|
||||
- 22 R1 keys
|
||||
|
||||
if you fancy adding pedals :
|
||||
[these are good enough and cheap](https://www.amazon.fr/gp/product/B00V7WITKI/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1). You also need a RCA connector for each of those to replace the included cable
|
||||
|
||||
If you (or your coworkers) find them too loud you can replace the switch inside them.
|
||||
For once we don't really care about what's inside :)
|
||||
|
||||
##Various indications
|
||||
|
||||
The PHYSICAL rows and columns are connected as such :
|
||||
|
||||
on right hand (slave) :
|
||||
|
||||
I2C mcp23018
|
||||
.------- --------.
|
||||
GND -| 1 VSS \_/ NC 28 |
|
||||
| 2 NC A7 27 |- C15
|
||||
R5 -| 3 B0 A6 26 |- C14
|
||||
R4 -| 4 B1 A5 25 |- C13
|
||||
R3 -| 5 B2 A4 24 |- C12
|
||||
R2 -| 6 B3 A3 23 |- C11
|
||||
R1 -| 7 B4 A2 22 |- C10
|
||||
R0 -| 8 B5 A1 21 |- C9
|
||||
| 9 B6 A0 20 |- C8
|
||||
| 10 B7 INTA 19 |
|
||||
VCC -| 11 VDD INTB 18 |
|
||||
SCL -| 12 SCL NC 17 |
|
||||
SDA -| 13 SDA RST 16 |- VCC
|
||||
| 14 NC ADDR 15 |- GND
|
||||
`------------------'
|
||||
|
||||
and on left hand (main) :
|
||||
|
||||
TEENSY
|
||||
.------------------.
|
||||
| GND VCC |
|
||||
C7 -| B0 F0 |- R5
|
||||
C6 -| B1 F1 |- R4
|
||||
C5 -| B2 F4 |- R3
|
||||
C4 -| B3 F5 |- R2
|
||||
LEDC -| B7 F6 |- R1
|
||||
SCL -| D0 F7 |- R0
|
||||
SDA -| D1 B6 |- LEDB
|
||||
C3 -| D2 B5 |- LEDA
|
||||
C2 -| D3 B4 |
|
||||
C1 -| C6 D7 |
|
||||
C0 -| C7 D6 |- GND
|
||||
| D5 D4 |
|
||||
| VCC RST |
|
||||
| E6 GND |
|
||||
`------------------'
|
||||
|
||||
We use pull up resistor for SCL and VDA, see https://github.com/ErgoDox-EZ/docs/blob/master/ErgoDox%20EZ%20Schematic.pdf for example
|
||||
|
||||
the connector is a standard TRRS (jack with audio + mic)
|
||||
|
||||
Diode direction is row to column
|
||||
|
92
keyboards/handwired/frenchdev/rules.mk
Normal file
92
keyboards/handwired/frenchdev/rules.mk
Normal file
@@ -0,0 +1,92 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# On command line:
|
||||
#
|
||||
# make = Make software.
|
||||
#
|
||||
# make clean = Clean out built project files.
|
||||
#
|
||||
# That's pretty much all you need. To compile, always go make clean,
|
||||
# followed by make.
|
||||
#
|
||||
# For advanced users only:
|
||||
# make teensy = Download the hex file to the device, using teensy_loader_cli.
|
||||
# (must have teensy_loader_cli installed).
|
||||
#
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# # project specific files
|
||||
SRC = twimaster.c \
|
||||
matrix.c
|
||||
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=512
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file (taken and adapted from the ErgoDox EZ to handle custom number of columns)
|
||||
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
|
||||
UNICODE_ENABLE ?= yes # Unicode
|
||||
BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default
|
||||
MIDI_ENABLE ?= no # MIDI controls
|
||||
UNICODE_ENABLE ?= no # Unicode
|
||||
BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE ?= no # Audio output on port C6
|
||||
RGBLIGHT_ENABLE = no
|
||||
API_SYSEX_ENABLE ?= no
|
||||
|
||||
#ifndef QUANTUM_DIR
|
||||
# include ../../../Makefile
|
||||
#endif
|
208
keyboards/handwired/frenchdev/twimaster.c
Normal file
208
keyboards/handwired/frenchdev/twimaster.c
Normal file
@@ -0,0 +1,208 @@
|
||||
/*************************************************************************
|
||||
* Title: I2C master library using hardware TWI interface
|
||||
* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
|
||||
* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
|
||||
* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
|
||||
* Target: any AVR device with hardware TWI
|
||||
* Usage: API compatible with I2C Software Library i2cmaster.h
|
||||
**************************************************************************/
|
||||
#include <inttypes.h>
|
||||
#include <compat/twi.h>
|
||||
|
||||
#include <i2cmaster.h>
|
||||
|
||||
|
||||
/* define CPU frequency in Mhz here if not defined in Makefile */
|
||||
#ifndef F_CPU
|
||||
#define F_CPU 16000000UL
|
||||
#endif
|
||||
|
||||
/* I2C clock in Hz */
|
||||
#define SCL_CLOCK 400000L
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Initialization of the I2C bus interface. Need to be called only once
|
||||
*************************************************************************/
|
||||
void i2c_init(void)
|
||||
{
|
||||
/* initialize TWI clock
|
||||
* minimal values in Bit Rate Register (TWBR) and minimal Prescaler
|
||||
* bits in the TWI Status Register should give us maximal possible
|
||||
* I2C bus speed - about 444 kHz
|
||||
*
|
||||
* for more details, see 20.5.2 in ATmega16/32 secification
|
||||
*/
|
||||
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = 10; /* must be >= 10 for stable operation */
|
||||
|
||||
}/* i2c_init */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
return 0 = device accessible, 1= failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_start(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed and ACK/NACK has been received
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
|
||||
|
||||
return 0;
|
||||
|
||||
}/* i2c_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a start condition and sends address and transfer direction.
|
||||
If device is busy, use ack polling to wait until device is ready
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
*************************************************************************/
|
||||
void i2c_start_wait(unsigned char address)
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
|
||||
while ( 1 )
|
||||
{
|
||||
// send START condition
|
||||
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
|
||||
|
||||
// send device address
|
||||
TWDR = address;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wail until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits.
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
|
||||
{
|
||||
/* device busy, send stop condition to terminate write operation */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
continue;
|
||||
}
|
||||
//if( twst != TW_MT_SLA_ACK) return 1;
|
||||
break;
|
||||
}
|
||||
|
||||
}/* i2c_start_wait */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Issues a repeated start condition and sends address and transfer direction
|
||||
|
||||
Input: address and transfer direction of I2C device
|
||||
|
||||
Return: 0 device accessible
|
||||
1 failed to access device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_rep_start(unsigned char address)
|
||||
{
|
||||
return i2c_start( address );
|
||||
|
||||
}/* i2c_rep_start */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Terminates the data transfer and releases the I2C bus
|
||||
*************************************************************************/
|
||||
void i2c_stop(void)
|
||||
{
|
||||
/* send stop condition */
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
|
||||
|
||||
// wait until stop condition is executed and bus released
|
||||
while(TWCR & (1<<TWSTO));
|
||||
|
||||
}/* i2c_stop */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Send one byte to I2C device
|
||||
|
||||
Input: byte to be transfered
|
||||
Return: 0 write successful
|
||||
1 write failed
|
||||
*************************************************************************/
|
||||
unsigned char i2c_write( unsigned char data )
|
||||
{
|
||||
uint8_t twst;
|
||||
|
||||
// send data to the previously addressed device
|
||||
TWDR = data;
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
|
||||
// wait until transmission completed
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
// check value of TWI Status Register. Mask prescaler bits
|
||||
twst = TW_STATUS & 0xF8;
|
||||
if( twst != TW_MT_DATA_ACK) return 1;
|
||||
return 0;
|
||||
|
||||
}/* i2c_write */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, request more data from device
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readAck(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readAck */
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
Read one byte from the I2C device, read is followed by a stop condition
|
||||
|
||||
Return: byte read from I2C device
|
||||
*************************************************************************/
|
||||
unsigned char i2c_readNak(void)
|
||||
{
|
||||
TWCR = (1<<TWINT) | (1<<TWEN);
|
||||
while(!(TWCR & (1<<TWINT)));
|
||||
|
||||
return TWDR;
|
||||
|
||||
}/* i2c_readNak */
|
@@ -54,7 +54,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define INFINITY_PROTOTYPE
|
||||
|
||||
/* Keymap for Infinity 1.1a (first revision with LED support) */
|
||||
//#define INFINITY_LED
|
||||
#define INFINITY_LED
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
|
@@ -76,7 +76,7 @@
|
||||
* @brief Enables the I2C subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_I2C FALSE
|
||||
#define HAL_USE_I2C TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
@@ -139,7 +139,7 @@
|
||||
* @brief Enables the SERIAL over USB subsystem.
|
||||
*/
|
||||
#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
|
||||
#define HAL_USE_SERIAL_USB TRUE
|
||||
#define HAL_USE_SERIAL_USB FALSE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
4
keyboards/infinity60/keymaps/jpetermans/Makefile
Normal file
4
keyboards/infinity60/keymaps/jpetermans/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
11
keyboards/infinity60/keymaps/jpetermans/config.h
Normal file
11
keyboards/infinity60/keymaps/jpetermans/config.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
//overrides
|
||||
#undef TAPPING_TOGGLE
|
||||
#define TAPPING_TOGGLE 2
|
||||
|
||||
#endif
|
304
keyboards/infinity60/keymaps/jpetermans/keymap.c
Normal file
304
keyboards/infinity60/keymaps/jpetermans/keymap.c
Normal file
@@ -0,0 +1,304 @@
|
||||
#include "infinity60.h"
|
||||
#include "led_controller.h"
|
||||
|
||||
//Helpful Defines
|
||||
#define _______ KC_TRNS
|
||||
|
||||
//Define Layer Names
|
||||
#define _BASE 0
|
||||
#define _NUMPAD 1
|
||||
#define _FNAV 2
|
||||
#define _MEDIA 3
|
||||
#define _TILDE 4
|
||||
|
||||
//IS31 chip has 8 available led pages, using 0 for all leds and 7 for single toggles
|
||||
#define max_pages 6
|
||||
|
||||
enum ic60_keycodes {
|
||||
NUMPAD,
|
||||
FNAV,
|
||||
MEDIA,
|
||||
TILDE,
|
||||
CTLALTDEL,
|
||||
BACKLIGHT,
|
||||
BRIGHT,
|
||||
DIM,
|
||||
ALL,
|
||||
GAME,
|
||||
MODE_SINGLE,
|
||||
MODE_PAGE,
|
||||
MODE_FLASH
|
||||
};
|
||||
|
||||
uint8_t current_layer_global = 0;
|
||||
uint8_t led_mode_global = MODE_SINGLE;
|
||||
uint8_t backlight_status_global = 1; //init on/off state of backlight
|
||||
uint32_t led_layer_state = 0;
|
||||
|
||||
/* ==================================
|
||||
* KEYMAPS
|
||||
* ==================================*/
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Layer 0: Default Layer
|
||||
* ,-----------------------------------------------------------.
|
||||
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Backs|
|
||||
* |-----------------------------------------------------------|
|
||||
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
|
||||
* |-----------------------------------------------------------|
|
||||
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Enter |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Shif| | Z| X| C| V| B| N| M| ,| .| /|Shift |
|
||||
* |-----------------------------------------------------------|
|
||||
* |Ctrl|Gui |Alt | Space |Alt |Gui | FN | Ctrl |
|
||||
* `-----------------------------------------------------------'
|
||||
*/
|
||||
/* default */
|
||||
[_BASE] = KEYMAP( \
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS,KC_NO,\
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC, \
|
||||
TT(_FNAV), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,F(TILDE),KC_NO, \
|
||||
KC_LCTL, KC_LGUI,KC_LALT, LT(_FNAV, KC_SPC), KC_RALT,TG(_NUMPAD),MO(_MEDIA), KC_RCTL \
|
||||
),
|
||||
|
||||
/* numpad */
|
||||
[_NUMPAD] = KEYMAP( \
|
||||
_______,_______,_______,_______,_______,_______,_______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______,_______,_______,KC_NO,\
|
||||
_______,_______,_______,_______,_______,_______,_______, KC_P4, KC_P5, KC_P6, KC_PAST, _______,_______,_______, \
|
||||
MO(_FNAV),_______,_______,_______,_______,_______,_______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______,_______, \
|
||||
_______,_______,_______,_______,_______,_______,_______, KC_P0,KC_COMM,KC_PDOT,KC_PPLS, _______,KC_NO, \
|
||||
_______,_______,_______, TO(_BASE), _______,_______,_______,_______ \
|
||||
),
|
||||
|
||||
/* F-, arrow, and media keys */
|
||||
[_FNAV] = KEYMAP( \
|
||||
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_NO,\
|
||||
KC_CAPS,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,_______,_______,KC_DEL, \
|
||||
_______,_______,KC_BTN2,_______,_______,_______,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_INS,_______,_______, \
|
||||
_______,KC_APP,KC_BTN1,KC_CALC,_______,_______,KC_END,_______,_______,_______,_______,_______,KC_NO, \
|
||||
_______,_______,_______, _______, F(CTLALTDEL),KC_NLCK,_______,_______ \
|
||||
),
|
||||
|
||||
/* media */
|
||||
[_MEDIA] = KEYMAP( \
|
||||
_______,F(MODE_SINGLE),F(MODE_PAGE),F(MODE_FLASH),_______,_______,_______, _______, _______, _______,KC_MUTE, KC_VOLD, KC_VOLU,_______,KC_NO,\
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\
|
||||
_______,_______,_______,_______,_______,F(GAME),_______, _______, _______, _______,_______, _______,_______, \
|
||||
_______,_______,F(ALL) ,F(BRIGHT),F(DIM),F(BACKLIGHT),_______, _______, KC_MPRV, KC_MNXT,KC_MSTP, _______,KC_NO, \
|
||||
_______,_______,_______, KC_MPLY, _______,_______, _______,_______ \
|
||||
),
|
||||
/* ~ */
|
||||
[_TILDE] = KEYMAP( \
|
||||
KC_GRV,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,KC_NO,\
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______, \
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,KC_NO, \
|
||||
_______,_______,_______, _______, _______,_______, _______,_______ \
|
||||
),
|
||||
/* template */
|
||||
[5] = KEYMAP( \
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,KC_NO,\
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______, \
|
||||
_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,KC_NO, \
|
||||
_______,_______,_______, _______, _______,_______, _______,_______ \
|
||||
),
|
||||
};
|
||||
|
||||
//id for user defined functions and macros
|
||||
enum function_id {
|
||||
NONE,
|
||||
};
|
||||
|
||||
enum macro_id {
|
||||
ACTION_LEDS_ALL,
|
||||
ACTION_LEDS_GAME,
|
||||
ACTION_LEDS_BACKLIGHT,
|
||||
ACTION_LEDS_BRIGHT,
|
||||
ACTION_LEDS_DIM,
|
||||
ACTION_LEDS_SINGLE,
|
||||
ACTION_LEDS_PAGE,
|
||||
ACTION_LEDS_FLASH
|
||||
};
|
||||
|
||||
/* ==================================
|
||||
* LED MAPPING
|
||||
* ==================================*/
|
||||
|
||||
/*
|
||||
Infinity60 LED MAP
|
||||
11 12 13 14 15 16 17 18 21 22 23 24 25 26 27*
|
||||
28 31 32 33 34 35 36 37 38 41 42 43 44 45
|
||||
46 47 48 51 52 53 54 55 56 57 58 61 62
|
||||
63 64 65 66 67 68 71 72 73 74 75 76 77*
|
||||
78 81 82 83 84 85 86 87
|
||||
*Unused in Alphabet Layout
|
||||
*/
|
||||
|
||||
//======== full page arrays =========
|
||||
//any change in array size needs to be mirrored in matrix_init_user
|
||||
uint8_t led_numpad[16] = {
|
||||
18,21,22,23,
|
||||
37,38,41,42,
|
||||
55,56,57,58,
|
||||
72,73,74,75
|
||||
};
|
||||
//LED Page 2 - _Nav
|
||||
uint8_t led_nav[12] = {
|
||||
38,
|
||||
47,48, 55,56,57,
|
||||
64,65,66
|
||||
};
|
||||
//LED Page 3 - _Media
|
||||
uint8_t led_media[15] = {
|
||||
12,13,14, 23,24,25,
|
||||
65,66,67,68, 73,74,75,
|
||||
83, 86
|
||||
};
|
||||
//LED Page 4 - _Game "WASD"
|
||||
uint8_t led_game[5] = {
|
||||
11,
|
||||
32,
|
||||
47,48,51
|
||||
};
|
||||
|
||||
//======== qmk functions =========
|
||||
const uint16_t fn_actions[] = {
|
||||
[CTLALTDEL] = ACTION_KEY(LALT(LCTL(KC_DEL))),
|
||||
[TILDE] = ACTION_LAYER_MODS(_TILDE, MOD_LSFT),
|
||||
[ALL] = ACTION_FUNCTION(ACTION_LEDS_ALL),
|
||||
[GAME] = ACTION_FUNCTION(ACTION_LEDS_GAME),
|
||||
[BACKLIGHT] = ACTION_FUNCTION(ACTION_LEDS_BACKLIGHT),
|
||||
[BRIGHT] = ACTION_FUNCTION(ACTION_LEDS_BRIGHT),
|
||||
[DIM] = ACTION_FUNCTION(ACTION_LEDS_DIM),
|
||||
[MODE_SINGLE] = ACTION_FUNCTION(ACTION_LEDS_SINGLE),
|
||||
[MODE_PAGE] = ACTION_FUNCTION(ACTION_LEDS_PAGE),
|
||||
[MODE_FLASH] = ACTION_FUNCTION(ACTION_LEDS_FLASH),
|
||||
};
|
||||
|
||||
/* custom action function */
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
msg_t msg;
|
||||
|
||||
switch(id) {
|
||||
case ACTION_LEDS_ALL:
|
||||
if(record->event.pressed) {
|
||||
led_mode_global = led_mode_global == ALL ? MODE_SINGLE : ALL;
|
||||
msg=TOGGLE_ALL;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTION_LEDS_BACKLIGHT:
|
||||
if(record->event.pressed) {
|
||||
backlight_status_global ^= 1;
|
||||
msg=(backlight_status_global << 8) | TOGGLE_BACKLIGHT;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTION_LEDS_GAME:
|
||||
if(record->event.pressed) {
|
||||
led_mode_global = led_mode_global == GAME ? MODE_SINGLE : GAME;
|
||||
|
||||
msg=(4 << 8) | DISPLAY_PAGE;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTION_LEDS_BRIGHT:
|
||||
if(record->event.pressed) {
|
||||
msg=(1 << 8) | STEP_BRIGHTNESS;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACTION_LEDS_DIM:
|
||||
if(record->event.pressed) {
|
||||
msg=(0 << 8) | STEP_BRIGHTNESS;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
}
|
||||
break;
|
||||
|
||||
//set led_mode for matrix_scan to toggle leds
|
||||
case ACTION_LEDS_SINGLE:
|
||||
led_mode_global = MODE_SINGLE;
|
||||
break;
|
||||
case ACTION_LEDS_PAGE:
|
||||
led_mode_global = MODE_PAGE;
|
||||
break;
|
||||
case ACTION_LEDS_FLASH:
|
||||
led_mode_global = MODE_FLASH;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
|
||||
bool process_record_user (uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Runs just one time when the keyboard initializes.
|
||||
void matrix_init_user(void) {
|
||||
|
||||
led_controller_init();
|
||||
|
||||
// Write predefined led pages.
|
||||
write_led_page(_NUMPAD, led_numpad, 16);
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
write_led_page(_FNAV, led_nav, 12);
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
write_led_page(_MEDIA, led_media, 15);
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
write_led_page(4, led_game, 5);
|
||||
chThdSleepMilliseconds(1000);
|
||||
};
|
||||
|
||||
// Loops constantly in the background.
|
||||
void matrix_scan_user(void) {
|
||||
uint8_t page;
|
||||
uint8_t led_pin_byte;
|
||||
msg_t msg;
|
||||
|
||||
if (backlight_status_global == 0) {//backlight is off, skip the rest
|
||||
return;
|
||||
}
|
||||
|
||||
if (led_layer_state != layer_state && led_mode_global != GAME && led_mode_global != ALL) {
|
||||
//check mode
|
||||
//Turn on layer indicator or page depending on mode
|
||||
switch(led_mode_global) {
|
||||
case MODE_FLASH: //flash preset page leds then single indicator
|
||||
page = biton32(layer_state) > max_pages ? 7 : biton32(layer_state);
|
||||
msg=(page << 8) | DISPLAY_PAGE;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
chThdSleepMilliseconds(500);
|
||||
//flow to display single layer leds
|
||||
|
||||
case MODE_SINGLE: //light layer indicators for all active layers
|
||||
led_pin_byte = layer_state & 0xFF;
|
||||
msg=(7 << 8) | DISPLAY_PAGE;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
msg=(1 << 16) | (led_pin_byte << 8) | SET_FULL_ROW;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
break;
|
||||
|
||||
case MODE_PAGE: //display pre-defined led page
|
||||
page = biton32(layer_state) > max_pages ? 7 : biton32(layer_state);
|
||||
msg=(page << 8) | DISPLAY_PAGE;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
break;
|
||||
}
|
||||
led_layer_state = layer_state;
|
||||
}
|
||||
}
|
87
keyboards/infinity60/keymaps/jpetermans/readme.md
Normal file
87
keyboards/infinity60/keymaps/jpetermans/readme.md
Normal file
@@ -0,0 +1,87 @@
|
||||
Backlight for Infinity60
|
||||
========================
|
||||
|
||||
## Led Controller Specs
|
||||
|
||||
The Infinity60 (revision 1.1a) pcb uses the IS31FL3731C matrix LED driver from ISSI [(datasheet)](http://www.issi.com/WW/pdf/31FL3731C.pdf). The IS31 has the ability to control two led matrices (A & B), each matrix controlling 9 pins, each pin controlling 8 leds. The Infinity only utilizes matrix A.
|
||||
|
||||
Infinity60 LED Map:
|
||||
digits mean "row" and "col", i.e. 45 means pin 4, column 5 in the IS31 datasheet
|
||||
```c
|
||||
11 12 13 14 15 16 17 18 21 22 23 24 25 26 27*
|
||||
28 31 32 33 34 35 36 37 38 41 42 43 44 45
|
||||
46 47 48 51 52 53 54 55 56 57 58 61 62
|
||||
63 64 65 66 67 68 71 72 73 74 75 76 77*
|
||||
78 81 82 83 84 85 86 87
|
||||
```
|
||||
*Unused in Alphabet Layout
|
||||
|
||||
The IS31 includes 8 led pages (or frames) 0-7 than can be displayed, and each page consists of 144 bytes.
|
||||
- **bytes 0 - 17** - LED control (on/off).
|
||||
* 18 pins which alternate between A and B matrices (A1, B1, A2, B2, ..).
|
||||
* Each byte controls the 8 leds on that pin with bits (8 to 1).
|
||||
- **bytes 8 - 35** - Blink control.
|
||||
* Same as LED control above, but sets blink on/off.
|
||||
- **bytes 36 - 143** - PWM control.
|
||||
* One byte per LED, sets PWM from 0 to 255.
|
||||
* Same as above, the register alternates, every 8 *bytes* (not bits) between the A & B matrices.
|
||||
|
||||
## Led Controller Code
|
||||
In the Infinity60 project folder, led_controller.c sets up ability to write led layers at startup or control leds on demand as part of fn_actions. By default led_controller.c assumes page 0 will be used for full on/off. The remaining 7 pages (1-7) are free for preset led maps or single led actions at init or on demand. Communication with the IS31 is primarily done through the led_mailbox using chMBPost described further below under "Sending messages in Keymap.c". This code is based on work matt3o and flabbergast did for tmk firmware on the [whitefox](https://github.com/tmk/whitefox).
|
||||
|
||||
One function is available to directly set leds without the mailbox:
|
||||
```
|
||||
write_led_page(page#, array of leds by address, # of addresses in array)
|
||||
```
|
||||
This function saves a full page to the controller using a supplied array of led locations such as:
|
||||
```c
|
||||
uint8_t led_numpad[16] = {
|
||||
18,21,22,23,
|
||||
37,38,41,42,
|
||||
55,56,57,58,
|
||||
72,73,74,75
|
||||
}
|
||||
write_led_page(5, led_numpad, 16);
|
||||
```
|
||||
|
||||
Remaining led control is done through the led mailbox using these message types:
|
||||
- **SET_FULL_ROW** (3 bytes) - message type, 8-bit mask, and row#. Sets all leds on one pin per the bit mask.
|
||||
- **OFF_LED, ON_LED, TOGGLE_LED** (3 bytes) - message type, led address, and page#. Off/on/toggle specific led.
|
||||
- **BLINK_OFF_LED, BLINK_ON_LED, BLINK_OFF_LED** (3 bytes) - message type, led address, and page#. Set blink Off/on/toggle for specific led.
|
||||
- **TOGGLE_ALL** (1 byte) - Turn on/off full backlight.
|
||||
- **TOGGLE_BACKLIGHT** (2 bytes) - message type, on/off. Sets backlight completely off, no leds will display.
|
||||
- **DISPLAY_PAGE** (2 bytes) - message type, page to display. Switch to specific pre-set page.
|
||||
- **RESET_PAGE** (2 bytes) - message type, page to reset. Reset/erase specific page.
|
||||
- **TOGGLE_NUM_LOCK** (2 bytes) - message type, on/off (NUM_LOCK_LED_ADDRESS). Toggle numlock on/off. Usually run with the `set_leds` function to check state of numlock or capslock. If all leds are on (e.i. TOGGLE_ALL) then this sets numlock to blink instead (this is still a little buggy if toggling on/off quickly).
|
||||
- **TOGGLE_CAPS_LOCK** (2 bytes) - message type, on/off (CAPS_LOCK_LED_ADDRESS). Same as numlock.
|
||||
- **STEP_BRIGHTNESS** (2 bytes) - message type, and step up (1) or step down (0). Increase or decrease led brightness.
|
||||
|
||||
## Sending messages in Keymap.c
|
||||
Sending an action to the led mailbox is done using chMBPost:
|
||||
```
|
||||
chMBPost(&led_mailbox, message, timeout);
|
||||
```
|
||||
- &led_mailbox - pointer to led mailbox
|
||||
- message - up to 4 bytes but most messages use only 2. First byte (LSB) is the message type, the remaining three bytes are the message to process.
|
||||
- timeout is TIME_IMMEDIATE
|
||||
|
||||
An example:
|
||||
```c
|
||||
//set the message to be sent. First byte (LSB) is the led address, and second is the message type
|
||||
msg=(42 << 8) | ON_LED;
|
||||
|
||||
//send msg to the led mailbox
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
```
|
||||
|
||||
Another:
|
||||
```c
|
||||
msg=(46 << 8) | BLINK_TOGGLE_LED;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
```
|
||||
|
||||
Finally, SET_FULL_ROW requires an extra byte with row information in the message so sending this message looks like:
|
||||
```c
|
||||
msg=(row<<16) | (led_pin_byte << 8) | SET_FULL_ROW;
|
||||
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
|
||||
```
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -19,6 +19,35 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "led.h"
|
||||
|
||||
#include "led_controller.h"
|
||||
|
||||
/* WARNING! This function needs to be callable from
|
||||
* both regular threads and ISRs, unlocked (during resume-from-sleep).
|
||||
* In particular, I2C functions (interrupt-driven) should NOT be called from here.
|
||||
*/
|
||||
void led_set(uint8_t usb_led) {
|
||||
msg_t msg;
|
||||
|
||||
if (usb_led & (1<<USB_LED_NUM_LOCK)) {
|
||||
chSysUnconditionalLock();
|
||||
msg=(1 << 8) | TOGGLE_NUM_LOCK;
|
||||
chMBPostI(&led_mailbox, msg);
|
||||
chSysUnconditionalUnlock();
|
||||
} else {
|
||||
chSysUnconditionalLock();
|
||||
msg=(0 << 8) | TOGGLE_NUM_LOCK;
|
||||
chMBPostI(&led_mailbox, msg);
|
||||
chSysUnconditionalUnlock();
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
chSysUnconditionalLock();
|
||||
msg=(1 << 8) | TOGGLE_CAPS_LOCK;
|
||||
chMBPostI(&led_mailbox, msg);
|
||||
chSysUnconditionalUnlock();
|
||||
} else {
|
||||
chSysUnconditionalLock();
|
||||
msg=(0 << 8) | TOGGLE_CAPS_LOCK;
|
||||
chMBPostI(&led_mailbox, msg);
|
||||
chSysUnconditionalUnlock();
|
||||
}
|
||||
}
|
||||
|
486
keyboards/infinity60/led_controller.c
Normal file
486
keyboards/infinity60/led_controller.c
Normal file
@@ -0,0 +1,486 @@
|
||||
/*
|
||||
Copyright 2016 flabbergast <s3+flabbergast@sdfeu.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General 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/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* LED controller code
|
||||
* IS31FL3731C matrix LED driver from ISSI
|
||||
* datasheet: http://www.issi.com/WW/pdf/31FL3731C.pdf
|
||||
*/
|
||||
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
#include "print.h"
|
||||
#include "led.h"
|
||||
#include "host.h"
|
||||
|
||||
#include "led_controller.h"
|
||||
|
||||
#include "suspend.h"
|
||||
|
||||
#include "usb_main.h"
|
||||
|
||||
/* Infinity60 LED MAP
|
||||
- digits mean "row" and "col", i.e. 45 means C4-5 in the IS31 datasheet, matrix A
|
||||
|
||||
11 12 13 14 15 16 17 18 21 22 23 24 25 26 27*
|
||||
28 31 32 33 34 35 36 37 38 41 42 43 44 45
|
||||
46 47 48 51 52 53 54 55 56 57 58 61 62
|
||||
63 64 65 66 67 68 71 72 73 74 75 76 77*
|
||||
78 81 82 83 84 85 86 87
|
||||
|
||||
*Unused in Alphabet Layout
|
||||
*/
|
||||
|
||||
/*
|
||||
each page has 0xB4 bytes
|
||||
0 - 0x11: LED control (on/off):
|
||||
order: CA1, CB1, CA2, CB2, .... (CA - matrix A, CB - matrix B)
|
||||
CAn controls Cn-8 .. Cn-1 (LSbit)
|
||||
0x12 - 0x23: blink control (like "LED control")
|
||||
0x24 - 0xB3: PWM control: byte per LED, 0xFF max on
|
||||
order same as above (CA 1st row (8bytes), CB 1st row (8bytes), ...)
|
||||
*/
|
||||
|
||||
// Which LED should be used for CAPS LOCK indicator
|
||||
#if !defined(CAPS_LOCK_LED_ADDRESS)
|
||||
#define CAPS_LOCK_LED_ADDRESS 46
|
||||
#endif
|
||||
|
||||
#if !defined(NUM_LOCK_LED_ADDRESS)
|
||||
#define NUM_LOCK_LED_ADDRESS 85
|
||||
#endif
|
||||
|
||||
/* Which LED should breathe during sleep */
|
||||
#if !defined(BREATHE_LED_ADDRESS)
|
||||
#define BREATHE_LED_ADDRESS CAPS_LOCK_LED_ADDRESS
|
||||
#endif
|
||||
|
||||
/* =================
|
||||
* ChibiOS I2C setup
|
||||
* ================= */
|
||||
static const I2CConfig i2ccfg = {
|
||||
400000 // clock speed (Hz); 400kHz max for IS31
|
||||
};
|
||||
|
||||
/* ==============
|
||||
* variables
|
||||
* ============== */
|
||||
// internal communication buffers
|
||||
uint8_t tx[2] __attribute__((aligned(2)));
|
||||
uint8_t rx[1] __attribute__((aligned(2)));
|
||||
|
||||
// buffer for sending the whole page at once (used also as a temp buffer)
|
||||
uint8_t full_page[0xB4+1] = {0};
|
||||
|
||||
// LED mask (which LEDs are present, selected by bits)
|
||||
// IC60 pcb uses only CA matrix.
|
||||
// Each byte is a control pin for 8 leds ordered 8-1
|
||||
const uint8_t all_on_leds_mask[0x12] = {
|
||||
0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF,
|
||||
0x00, 0xFF, 0x00, 0xFF, 0x00, 0x7F, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
// array to hold brightness pwm steps
|
||||
const uint8_t pwm_levels[5] = {
|
||||
0x00, 0x16, 0x4E, 0xA1, 0xFF
|
||||
};
|
||||
|
||||
// array to write to pwm register
|
||||
uint8_t pwm_register_array[9] = {0};
|
||||
|
||||
|
||||
/* ============================
|
||||
* communication functions
|
||||
* ============================ */
|
||||
msg_t is31_select_page(uint8_t page) {
|
||||
tx[0] = IS31_COMMANDREGISTER;
|
||||
tx[1] = page;
|
||||
return i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, tx, 2, NULL, 0, US2ST(IS31_TIMEOUT));
|
||||
}
|
||||
|
||||
msg_t is31_write_data(uint8_t page, uint8_t *buffer, uint8_t size) {
|
||||
is31_select_page(page);
|
||||
return i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, buffer, size, NULL, 0, US2ST(IS31_TIMEOUT));
|
||||
}
|
||||
|
||||
msg_t is31_write_register(uint8_t page, uint8_t reg, uint8_t data) {
|
||||
is31_select_page(page);
|
||||
tx[0] = reg;
|
||||
tx[1] = data;
|
||||
return i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, tx, 2, NULL, 0, US2ST(IS31_TIMEOUT));
|
||||
}
|
||||
|
||||
msg_t is31_read_register(uint8_t page, uint8_t reg, uint8_t *result) {
|
||||
is31_select_page(page);
|
||||
|
||||
tx[0] = reg;
|
||||
return i2cMasterTransmitTimeout(&I2CD1, IS31_ADDR_DEFAULT, tx, 1, result, 1, US2ST(IS31_TIMEOUT));
|
||||
}
|
||||
|
||||
/* ========================
|
||||
* initialise the IS31 chip
|
||||
* ======================== */
|
||||
void is31_init(void) {
|
||||
// just to be sure that it's all zeroes
|
||||
__builtin_memset(full_page,0,0xB4+1);
|
||||
// zero function page, all registers (assuming full_page is all zeroes)
|
||||
is31_write_data(IS31_FUNCTIONREG, full_page, 0xD + 1);
|
||||
// disable hardware shutdown
|
||||
palSetPadMode(GPIOB, 16, PAL_MODE_OUTPUT_PUSHPULL);
|
||||
palSetPad(GPIOB, 16);
|
||||
chThdSleepMilliseconds(10);
|
||||
// software shutdown
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON);
|
||||
chThdSleepMilliseconds(10);
|
||||
// zero function page, all registers
|
||||
is31_write_data(IS31_FUNCTIONREG, full_page, 0xD + 1);
|
||||
chThdSleepMilliseconds(10);
|
||||
// software shutdown disable (i.e. turn stuff on)
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
|
||||
chThdSleepMilliseconds(10);
|
||||
// zero all LED registers on all 8 pages
|
||||
uint8_t i;
|
||||
for(i=0; i<8; i++) {
|
||||
is31_write_data(i, full_page, 0xB4 + 1);
|
||||
chThdSleepMilliseconds(5);
|
||||
}
|
||||
}
|
||||
|
||||
/* ==================
|
||||
* LED control thread
|
||||
* ================== */
|
||||
#define LED_MAILBOX_NUM_MSGS 5
|
||||
static msg_t led_mailbox_queue[LED_MAILBOX_NUM_MSGS];
|
||||
mailbox_t led_mailbox;
|
||||
static THD_WORKING_AREA(waLEDthread, 256);
|
||||
static THD_FUNCTION(LEDthread, arg) {
|
||||
(void)arg;
|
||||
chRegSetThreadName("LEDthread");
|
||||
|
||||
uint8_t i;
|
||||
uint8_t control_register_word[2] = {0};//2 bytes: register address, byte to write
|
||||
uint8_t led_control_reg[0x13] = {0};//led control register start address + 0x12 bytes
|
||||
|
||||
//persistent status variables
|
||||
uint8_t pwm_step_status, page_status, capslock_status, numlock_status;
|
||||
|
||||
//mailbox variables
|
||||
uint8_t temp, msg_type;
|
||||
uint8_t msg_args[3];
|
||||
msg_t msg;
|
||||
|
||||
// initialize persistent variables
|
||||
pwm_step_status = 4; //full brightness
|
||||
page_status = 0; //start frame 0 (all off/on)
|
||||
numlock_status = (host_keyboard_leds() & (1<<USB_LED_NUM_LOCK)) ? 1 : 0;
|
||||
capslock_status = (host_keyboard_leds() & (1<<USB_LED_CAPS_LOCK)) ? 1 : 0;
|
||||
|
||||
while(true) {
|
||||
// wait for a message (asynchronous)
|
||||
// (messages are queued (up to LED_MAILBOX_NUM_MSGS) if they can't
|
||||
// be processed right away
|
||||
chMBFetch(&led_mailbox, &msg, TIME_INFINITE);
|
||||
msg_type = msg & 0xFF; //first byte is action information
|
||||
msg_args[0] = (msg >> 8) & 0xFF;
|
||||
msg_args[1] = (msg >> 16) & 0XFF;
|
||||
msg_args[2] = (msg >> 24) & 0xFF;
|
||||
|
||||
|
||||
switch (msg_type){
|
||||
case SET_FULL_ROW:
|
||||
//write full byte to pin address, msg_args[1] = pin #, msg_args[0] = 8 bits to write
|
||||
//writes only to currently displayed page
|
||||
write_led_byte(page_status, msg_args[1], msg_args[0]);
|
||||
break;
|
||||
|
||||
case OFF_LED:
|
||||
//on/off/toggle single led, msg_args[0] = row/col of led, msg_args[1] = page
|
||||
set_led_bit(msg_args[1], control_register_word, msg_args[0], 0);
|
||||
break;
|
||||
case ON_LED:
|
||||
set_led_bit(msg_args[1], control_register_word, msg_args[0], 1);
|
||||
break;
|
||||
case TOGGLE_LED:
|
||||
set_led_bit(msg_args[1], control_register_word, msg_args[0], 2);
|
||||
break;
|
||||
|
||||
case BLINK_OFF_LED:
|
||||
//on/off/toggle single led, msg_args[0] = row/col of led
|
||||
set_led_bit(msg_args[1], control_register_word, msg_args[0], 4);
|
||||
break;
|
||||
case BLINK_ON_LED:
|
||||
set_led_bit(msg_args[1], control_register_word, msg_args[0], 5);
|
||||
break;
|
||||
case BLINK_TOGGLE_LED:
|
||||
set_led_bit(msg_args[1], control_register_word, msg_args[0], 6);
|
||||
break;
|
||||
|
||||
case TOGGLE_ALL:
|
||||
//turn on/off all leds, msg_args = unused
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON);
|
||||
chThdSleepMilliseconds(5);
|
||||
is31_read_register(0, 0x00, &temp);
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
|
||||
|
||||
led_control_reg[0] = 0;
|
||||
|
||||
//toggle led mask based on current state (temp)
|
||||
if (temp==0 || page_status > 0) {
|
||||
__builtin_memcpy(led_control_reg+1, all_on_leds_mask, 0x12);
|
||||
} else {
|
||||
__builtin_memset(led_control_reg+1, 0, 0x12);
|
||||
}
|
||||
is31_write_data(0, led_control_reg, 0x13);
|
||||
|
||||
if (page_status > 0) {
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_PICTDISP, 0);
|
||||
|
||||
page_status=0;
|
||||
|
||||
//maintain lock leds, reset to off and force recheck to blink of all leds toggled on
|
||||
numlock_status = 0;
|
||||
capslock_status = 0;
|
||||
led_set(host_keyboard_leds());
|
||||
}
|
||||
break;
|
||||
|
||||
case TOGGLE_BACKLIGHT:
|
||||
//msg_args[0] = on/off
|
||||
|
||||
//populate 9 byte rows to be written to each pin, first byte is register (pin) address
|
||||
if (msg_args[0] == 1) {
|
||||
__builtin_memset(pwm_register_array+1, pwm_levels[pwm_step_status], 8);
|
||||
} else {
|
||||
__builtin_memset(pwm_register_array+1, 0, 8);
|
||||
}
|
||||
|
||||
for(i=0; i<8; i++) {
|
||||
//first byte is register address, every 0x10 9 bytes is A-matrix pwm pins
|
||||
pwm_register_array[0] = 0x24 + (i * 0x10);
|
||||
is31_write_data(0,pwm_register_array,9);
|
||||
}
|
||||
break;
|
||||
|
||||
case DISPLAY_PAGE:
|
||||
//msg_args[0] = page to toggle on
|
||||
if (page_status != msg_args[0]) {
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_PICTDISP, msg_args[0]);
|
||||
page_status = msg_args[0];
|
||||
|
||||
//maintain lock leds, reset to off and force recheck for new page
|
||||
numlock_status = 0;
|
||||
capslock_status = 0;
|
||||
led_set(host_keyboard_leds());
|
||||
}
|
||||
break;
|
||||
|
||||
case RESET_PAGE:
|
||||
//led_args[0] = page to reset
|
||||
led_control_reg[0] = 0;
|
||||
__builtin_memset(led_control_reg+1, 0, 0x12);
|
||||
is31_write_data(msg_args[0], led_control_reg, 0x13);
|
||||
|
||||
//repeat for blink register
|
||||
led_control_reg[0] = 0x12;
|
||||
is31_write_data(msg_args[0], led_control_reg, 0x13);
|
||||
break;
|
||||
|
||||
case TOGGLE_NUM_LOCK:
|
||||
//msg_args[0] = 0 or 1, off/on
|
||||
if (numlock_status != msg_args[0]) {
|
||||
set_lock_leds(NUM_LOCK_LED_ADDRESS, msg_args[0], page_status);
|
||||
numlock_status = msg_args[0];
|
||||
}
|
||||
break;
|
||||
case TOGGLE_CAPS_LOCK:
|
||||
//msg_args[0] = 0 or 1, off/on
|
||||
if (capslock_status != msg_args[0]) {
|
||||
set_lock_leds(CAPS_LOCK_LED_ADDRESS, msg_args[0], page_status);
|
||||
capslock_status = msg_args[0];
|
||||
}
|
||||
break;
|
||||
|
||||
case STEP_BRIGHTNESS:
|
||||
//led_args[0] = step up (1) or down (0)
|
||||
switch (msg_args[0]) {
|
||||
case 0:
|
||||
if (pwm_step_status == 0) {
|
||||
pwm_step_status = 4;
|
||||
} else {
|
||||
pwm_step_status--;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (pwm_step_status == 4) {
|
||||
pwm_step_status = 0;
|
||||
} else {
|
||||
pwm_step_status++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//populate 8 byte arrays to write on each pin
|
||||
//first byte is register address, every 0x10 9 bytes are A-matrix pwm pins
|
||||
__builtin_memset(pwm_register_array+1, pwm_levels[pwm_step_status], 8);
|
||||
|
||||
for(i=0; i<8; i++) {
|
||||
pwm_register_array[0] = 0x24 + (i * 0x10);
|
||||
is31_write_data(0,pwm_register_array,9);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ==============================
|
||||
* led processing functions
|
||||
* ============================== */
|
||||
|
||||
void set_led_bit (uint8_t page, uint8_t *led_control_word, uint8_t led_addr, uint8_t action) {
|
||||
//returns 2 bytes: led control register address and byte to write
|
||||
//action: 0 - off, 1 - on, 2 - toggle, 4 - blink on, 5 - blink off, 6 - toggle blink
|
||||
|
||||
uint8_t control_reg_addr, column_bit, column_byte, temp, blink_bit;
|
||||
|
||||
//check for valid led address
|
||||
if (led_addr < 0 || led_addr > 87 || led_addr % 10 > 8) {
|
||||
return;
|
||||
}
|
||||
|
||||
blink_bit = action>>2;//check for blink bit
|
||||
action &= ~(1<<2); //strip blink bit
|
||||
|
||||
//led_addr tens column is pin#, ones column is bit position in 8-bit mask
|
||||
control_reg_addr = ((led_addr / 10) % 10 - 1 ) * 0x02;// A-matrix is every other byte
|
||||
control_reg_addr += blink_bit == 1 ? 0x12 : 0x00;//if blink_bit, shift 12 bytes to blink register
|
||||
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON);
|
||||
chThdSleepMilliseconds(5);
|
||||
is31_read_register(page, control_reg_addr, &temp);//maintain status of leds on this byte
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
|
||||
|
||||
column_bit = 1<<(led_addr % 10 - 1);
|
||||
column_byte = temp;
|
||||
|
||||
switch(action) {
|
||||
case 0:
|
||||
column_byte &= ~column_bit;
|
||||
break;
|
||||
case 1:
|
||||
column_byte |= column_bit;
|
||||
break;
|
||||
case 2:
|
||||
column_byte ^= column_bit;
|
||||
break;
|
||||
}
|
||||
|
||||
//return word to be written in register
|
||||
led_control_word[0] = control_reg_addr;
|
||||
led_control_word[1] = column_byte;
|
||||
is31_write_data (page, led_control_word, 0x02);
|
||||
}
|
||||
|
||||
void write_led_byte (uint8_t page, uint8_t row, uint8_t led_byte) {
|
||||
uint8_t led_control_word[2] = {0};//register address and on/off byte
|
||||
|
||||
led_control_word[0] = (row - 1 ) * 0x02;// A-matrix is every other byte
|
||||
led_control_word[1] = led_byte;
|
||||
is31_write_data(page, led_control_word, 0x02);
|
||||
}
|
||||
|
||||
void write_led_page (uint8_t page, uint8_t *user_led_array, uint8_t led_count) {
|
||||
uint8_t i;
|
||||
uint8_t pin, col;
|
||||
uint8_t led_control_register[0x13] = {0};
|
||||
|
||||
__builtin_memset(led_control_register,0,13);
|
||||
|
||||
for(i=0;i<led_count;i++){
|
||||
//shift pin by 1 for led register 0x00 address
|
||||
pin = ((user_led_array[i] / 10) % 10 - 1 ) * 2 + 1;
|
||||
col = user_led_array[i] % 10 - 1;
|
||||
led_control_register[pin] |= 1<<(col);
|
||||
}
|
||||
|
||||
is31_write_data(page, led_control_register, 0x13);
|
||||
}
|
||||
|
||||
void set_lock_leds(uint8_t led_addr, uint8_t led_action, uint8_t page) {
|
||||
uint8_t temp;
|
||||
uint8_t led_control_word[2] = {0};
|
||||
|
||||
//blink if all leds are on
|
||||
if (page == 0) {
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON);
|
||||
chThdSleepMilliseconds(5);
|
||||
is31_read_register(0, 0x00, &temp);
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
|
||||
|
||||
if (temp == 0xFF) {
|
||||
led_action |= (1<<2); //set blink bit
|
||||
}
|
||||
}
|
||||
|
||||
set_led_bit(page,led_control_word,led_addr,led_action);
|
||||
}
|
||||
|
||||
/* =====================
|
||||
* hook into user keymap
|
||||
* ===================== */
|
||||
void led_controller_init(void) {
|
||||
uint8_t i;
|
||||
|
||||
/* initialise I2C */
|
||||
/* I2C pins */
|
||||
palSetPadMode(GPIOB, 0, PAL_MODE_ALTERNATIVE_2); // PTB0/I2C0/SCL
|
||||
palSetPadMode(GPIOB, 1, PAL_MODE_ALTERNATIVE_2); // PTB1/I2C0/SDA
|
||||
/* start I2C */
|
||||
i2cStart(&I2CD1, &i2ccfg);
|
||||
// try high drive (from kiibohd)
|
||||
I2CD1.i2c->C2 |= I2Cx_C2_HDRS;
|
||||
// try glitch fixing (from kiibohd)
|
||||
I2CD1.i2c->FLT = 4;
|
||||
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
/* initialise IS31 chip */
|
||||
is31_init();
|
||||
|
||||
//set Display Option Register so all pwm intensity is controlled from page 0
|
||||
//enable blink and set blink period to 0.27s x rate
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_DISPLAYOPT, IS31_REG_DISPLAYOPT_INTENSITY_SAME + IS31_REG_DISPLAYOPT_BLINK_ENABLE + 4);
|
||||
|
||||
/* set full pwm on page 1 */
|
||||
pwm_register_array[0] = 0;
|
||||
__builtin_memset(pwm_register_array+1, 0xFF, 8);
|
||||
for(i=0; i<8; i++) {
|
||||
pwm_register_array[0] = 0x24 + (i * 0x10);//first byte of 9 bytes must be register address
|
||||
is31_write_data(0, pwm_register_array, 9);
|
||||
chThdSleepMilliseconds(5);
|
||||
}
|
||||
|
||||
/* enable breathing when the displayed page changes */
|
||||
// Fade-in Fade-out, time = 26ms * 2^N, N=3
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_BREATHCTRL1, (3<<4)|3);
|
||||
is31_write_register(IS31_FUNCTIONREG, IS31_REG_BREATHCTRL2, IS31_REG_BREATHCTRL2_ENABLE|3);
|
||||
|
||||
/* more time consuming LED processing should be offloaded into
|
||||
* a thread, with asynchronous messaging. */
|
||||
chMBObjectInit(&led_mailbox, led_mailbox_queue, LED_MAILBOX_NUM_MSGS);
|
||||
chThdCreateStatic(waLEDthread, sizeof(waLEDthread), LOWPRIO, LEDthread, NULL);
|
||||
}
|
120
keyboards/infinity60/led_controller.h
Normal file
120
keyboards/infinity60/led_controller.h
Normal file
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
Copyright 2016 flabbergast <s3+flabbergast@sdfeu.org>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General 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 _LED_CONTROLLER_H_
|
||||
#define _LED_CONTROLLER_H_
|
||||
|
||||
/* =========================
|
||||
* communication functions
|
||||
* ========================= */
|
||||
|
||||
msg_t is31_write_data(uint8_t page, uint8_t *buffer, uint8_t size);
|
||||
msg_t is31_write_register(uint8_t page, uint8_t reg, uint8_t data);
|
||||
msg_t is31_read_register(uint8_t page, uint8_t reg, uint8_t *result);
|
||||
|
||||
/* ============================
|
||||
* init functions/definitions
|
||||
* ============================*/
|
||||
|
||||
void led_controller_init(void);
|
||||
|
||||
#define CAPS_LOCK_LED_ADDRESS 46 //pin matrix location
|
||||
#define NUM_LOCK_LED_ADDRESS 85
|
||||
|
||||
/* =============================
|
||||
* IS31 chip related definitions
|
||||
* ============================= */
|
||||
|
||||
#define IS31_ADDR_DEFAULT 0x74
|
||||
|
||||
#define IS31_REG_CONFIG 0x00
|
||||
// bits in reg
|
||||
#define IS31_REG_CONFIG_PICTUREMODE 0x00
|
||||
#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08
|
||||
#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18
|
||||
// D2:D0 bits are starting frame for autoplay mode
|
||||
|
||||
#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode
|
||||
|
||||
#define IS31_REG_AUTOPLAYCTRL1 0x02
|
||||
// D6:D4 number of loops (000=infty)
|
||||
// D2:D0 number of frames to be used
|
||||
|
||||
#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms)
|
||||
|
||||
#define IS31_REG_DISPLAYOPT 0x05
|
||||
#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames
|
||||
#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x08
|
||||
// D2:D0 bits blink period time (*0.27s)
|
||||
|
||||
#define IS31_REG_AUDIOSYNC 0x06
|
||||
#define IS31_REG_AUDIOSYNC_ENABLE 0x1
|
||||
|
||||
#define IS31_REG_FRAMESTATE 0x07
|
||||
|
||||
#define IS31_REG_BREATHCTRL1 0x08
|
||||
// D6:D4 fade out time (26ms*2^i)
|
||||
// D2:D0 fade in time (26ms*2^i)
|
||||
|
||||
#define IS31_REG_BREATHCTRL2 0x09
|
||||
#define IS31_REG_BREATHCTRL2_ENABLE 0x10
|
||||
// D2:D0 extinguish time (3.5ms*2^i)
|
||||
|
||||
#define IS31_REG_SHUTDOWN 0x0A
|
||||
#define IS31_REG_SHUTDOWN_OFF 0x1
|
||||
#define IS31_REG_SHUTDOWN_ON 0x0
|
||||
|
||||
#define IS31_REG_AGCCTRL 0x0B
|
||||
#define IS31_REG_ADCRATE 0x0C
|
||||
|
||||
#define IS31_COMMANDREGISTER 0xFD
|
||||
#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine'
|
||||
|
||||
#define IS31_TIMEOUT 10000 // needs to be long enough to write a whole page
|
||||
|
||||
/* ========================================
|
||||
* LED Thread related items
|
||||
* ========================================*/
|
||||
|
||||
extern mailbox_t led_mailbox;
|
||||
|
||||
void set_led_bit (uint8_t page, uint8_t *led_control_reg, uint8_t led_addr, uint8_t action);
|
||||
void set_lock_leds (uint8_t led_addr, uint8_t led_action, uint8_t page);
|
||||
void write_led_byte (uint8_t page, uint8_t row, uint8_t led_byte);
|
||||
void write_led_page (uint8_t page, uint8_t *led_array, uint8_t led_count);
|
||||
|
||||
// constants for signaling the LED controller thread
|
||||
enum led_msg_t {
|
||||
KEY_LIGHT,
|
||||
SET_FULL_ROW,
|
||||
OFF_LED,
|
||||
ON_LED,
|
||||
TOGGLE_LED,
|
||||
BLINK_OFF_LED,
|
||||
BLINK_ON_LED,
|
||||
BLINK_TOGGLE_LED,
|
||||
TOGGLE_ALL,
|
||||
TOGGLE_BACKLIGHT,
|
||||
DISPLAY_PAGE,
|
||||
RESET_PAGE,
|
||||
TOGGLE_NUM_LOCK,
|
||||
TOGGLE_CAPS_LOCK,
|
||||
TOGGLE_BREATH,
|
||||
STEP_BRIGHTNESS
|
||||
};
|
||||
|
||||
#endif /* _LED_CONTROLLER_H_ */
|
@@ -47,9 +47,12 @@
|
||||
* USB driver settings
|
||||
*/
|
||||
#define KINETIS_USB_USE_USB0 TRUE
|
||||
/* Need to redefine this, since the default is for K20x */
|
||||
/* This is for Teensy LC; you should comment it out (or change to 5)
|
||||
* for Teensy 3.x */
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 2
|
||||
#define KINETIS_USB_USB0_IRQ_PRIORITY 5
|
||||
|
||||
/*
|
||||
* I2C driver settings
|
||||
*/
|
||||
#define KINETIS_I2C_USE_I2C0 TRUE
|
||||
#define KINETIS_I2C_I2C0_PRIORITY 4
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
||||
|
@@ -1,6 +1,7 @@
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
led.c
|
||||
led.c \
|
||||
led_controller.c
|
||||
|
||||
## chip/board settings
|
||||
# - the next two should match the directories in
|
||||
@@ -55,7 +56,7 @@ OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration
|
||||
BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration
|
||||
## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control
|
||||
@@ -63,4 +64,4 @@ CONSOLE_ENABLE ?= yes # Console for debug
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
|
3
keyboards/kbd75/Makefile
Normal file
3
keyboards/kbd75/Makefile
Normal file
@@ -0,0 +1,3 @@
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
58
keyboards/kbd75/config.h
Normal file
58
keyboards/kbd75/config.h
Normal file
@@ -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 qmkbuilder
|
||||
#define PRODUCT KBD75
|
||||
#define DESCRIPTION QMK keyboard firmware for KBD75 R3 or later
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 6
|
||||
#define MATRIX_COLS 16
|
||||
|
||||
/* key matrix pins */
|
||||
#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5, B7 }
|
||||
#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, F5, D4, B1, B0, B5, B4, D7, D6, B3, F4, F6 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* number of backlight levels */
|
||||
#define BACKLIGHT_PIN B6
|
||||
#ifdef BACKLIGHT_PIN
|
||||
#define BACKLIGHT_LEVELS 5
|
||||
#endif
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCING_DELAY 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
#define IS_COMMAND() ( \
|
||||
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \
|
||||
)
|
||||
|
||||
/* prevent stuck modifiers */
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#define RGB_DI_PIN E2
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 16
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#endif
|
||||
|
||||
#endif
|
1
keyboards/kbd75/kbd75.c
Normal file
1
keyboards/kbd75/kbd75.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "kbd75.h"
|
22
keyboards/kbd75/kbd75.h
Normal file
22
keyboards/kbd75/kbd75.h
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef KB_H
|
||||
#define KB_H
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define KEYMAP( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \
|
||||
K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, \
|
||||
K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K315, \
|
||||
K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K413, K414, K415, \
|
||||
K500, K501, K503, K504, K506, K508, K510, K511, K512, K513, K514, K515 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \
|
||||
{ K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \
|
||||
{ K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, KC_NO, K315 }, \
|
||||
{ K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, KC_NO, K413, K414, K415 }, \
|
||||
{ K500, K501, KC_NO, K503, K504, KC_NO, K506, KC_NO, K508, KC_NO, K510, K511, K512, K513, K514, K515 } \
|
||||
}
|
||||
|
||||
#endif
|
220
keyboards/kbd75/keymaps/default/keymap.c
Normal file
220
keyboards/kbd75/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,220 @@
|
||||
#include "kbd75.h"
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
KEYMAP(
|
||||
LT(2, KC_ESC), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, MO(1), KC_DEL,
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_DEL, KC_BSPC, KC_HOME,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGUP,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN,
|
||||
KC_LSFT, MO(1), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_END,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,
|
||||
KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, M(1), M(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
|
||||
KEYMAP(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
|
||||
|
||||
switch (id) {
|
||||
|
||||
}
|
||||
return MACRO_NONE;
|
||||
}
|
||||
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
||||
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
||||
DDRB |= (1 << 2); PORTB &= ~(1 << 2);
|
||||
} else {
|
||||
DDRB &= ~(1 << 2); PORTB &= ~(1 << 2);
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_COMPOSE)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if (usb_led & (1 << USB_LED_KANA)) {
|
||||
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
enum function_id {
|
||||
SHIFT_ESC,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(SHIFT_ESC),
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t shift_esc_shift_mask;
|
||||
switch (id) {
|
||||
case SHIFT_ESC:
|
||||
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
|
||||
if (record->event.pressed) {
|
||||
if (shift_esc_shift_mask) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
add_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
if (shift_esc_shift_mask) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
del_key(KC_ESC);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
56
keyboards/kbd75/rules.mk
Normal file
56
keyboards/kbd75/rules.mk
Normal file
@@ -0,0 +1,56 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Processor frequency.
|
||||
# This will define a symbol, F_CPU, in all source code files equal to the
|
||||
# processor frequency in Hz. You can then use this symbol in your source code to
|
||||
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
|
||||
# automatically to create a 32-bit value in your source code.
|
||||
#
|
||||
# This will be an integer division of F_USB below, as it is sourced by
|
||||
# F_USB after it has run through any CPU prescalers. Note that this value
|
||||
# does not *change* the processor frequency - it should merely be updated to
|
||||
# reflect the processor speed set externally so that the code can use accurate
|
||||
# software delays.
|
||||
F_CPU = 16000000
|
||||
|
||||
#
|
||||
# LUFA specific
|
||||
#
|
||||
# Target architecture (see library "Board Types" documentation).
|
||||
ARCH = AVR8
|
||||
|
||||
# Input clock frequency.
|
||||
# This will define a symbol, F_USB, in all source code files equal to the
|
||||
# input clock frequency (before any prescaling is performed) in Hz. This value may
|
||||
# differ from F_CPU if prescaling is used on the latter, and is required as the
|
||||
# raw input clock is fed directly to the PLL sections of the AVR for high speed
|
||||
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
|
||||
# at the end, this will be done automatically to create a 32-bit value in your
|
||||
# source code.
|
||||
#
|
||||
# If no clock division is performed on the input clock inside the AVR (via the
|
||||
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
|
||||
F_USB = $(F_CPU)
|
||||
|
||||
# Interrupt driven control endpoint task(+60)
|
||||
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
|
||||
|
||||
|
||||
# Boot Section Size in *bytes*
|
||||
OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
|
||||
# Build Options
|
||||
# comment out to disable the options.
|
||||
#
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= no # Commands for debug and configuration
|
||||
SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend
|
||||
NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
AUDIO_ENABLE ?= no
|
||||
RGBLIGHT_ENABLE ?= yes
|
@@ -15,13 +15,13 @@
|
||||
|
||||
|
||||
# QMK Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
@@ -29,9 +29,9 @@ MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -26,22 +26,22 @@
|
||||
#define _FL 1
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_BL] = KEYMAP(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[_FL] = KEYMAP(
|
||||
BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[_BL] = KEYMAP(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[_FL] = KEYMAP(
|
||||
BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
@@ -50,32 +50,32 @@ const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("The");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("The");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Custom");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Custom");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Keyboard");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Keyboard");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (record->event.pressed) {
|
||||
return MACRO( D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END );
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (record->event.pressed) {
|
||||
return MACRO( D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END );
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
@@ -6,7 +6,7 @@ See [keymap.c](keymap.c) for details.
|
||||
|
||||
## Layers
|
||||
|
||||
The keymap have two layers. To access the functions on the second layer, hold down caps lock and press the corresponding key.
|
||||
The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key.
|
||||
|
||||
### Layer 1: Default Layer
|
||||
,---. ,---------------. ,---------------. ,---------------. ,-----------.
|
||||
|
@@ -15,13 +15,13 @@
|
||||
|
||||
|
||||
# QMK Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
@@ -29,9 +29,9 @@ MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
include ../../../../Makefile
|
||||
endif
|
||||
|
@@ -26,22 +26,22 @@
|
||||
#define _FL 1
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_BL] = KEYMAP_WINKEYLESS(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[_FL] = KEYMAP_WINKEYLESS(
|
||||
BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
[_BL] = KEYMAP_WINKEYLESS(
|
||||
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_BRK, \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
|
||||
),
|
||||
[_FL] = KEYMAP_WINKEYLESS(
|
||||
BL_STEP, M(0), M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
|
||||
),
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
@@ -50,32 +50,32 @@ const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
// MACRODOWN only works in this function
|
||||
switch(id) {
|
||||
case 0:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("The");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("The");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Custom");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Custom");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Keyboard");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
if (record->event.pressed) {
|
||||
SEND_STRING("Keyboard");
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (record->event.pressed) {
|
||||
return MACRO( D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END );
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (record->event.pressed) {
|
||||
return MACRO( D(LCTL), T(C), U(LCTL), T(RGHT), D(LCTL), T(V), U(LCTL), END );
|
||||
}
|
||||
break;
|
||||
}
|
||||
return MACRO_NONE;
|
||||
};
|
||||
|
||||
@@ -89,7 +89,7 @@ void matrix_scan_user(void) {
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
|
@@ -7,7 +7,7 @@ See [keymap.c](keymap.c) for details.
|
||||
|
||||
## Layers
|
||||
|
||||
The keymap have two layers. To access the functions on the second layer, hold down caps lock and press the corresponding key.
|
||||
The keymap have two layers. To access the functions on the second layer, hold down `Fn` and press the corresponding key.
|
||||
|
||||
### Layer 1: Default Layer
|
||||
,---. ,---------------. ,---------------. ,---------------. ,-----------.
|
||||
|
@@ -16,24 +16,24 @@
|
||||
#include "kmac.h"
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
led_init_ports();
|
||||
matrix_init_user();
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
led_init_ports();
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
matrix_scan_user();
|
||||
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
|
||||
// put your per-action keyboard code here
|
||||
// runs for every action, just before processing by the firmware
|
||||
|
||||
return process_record_user(keycode, record);
|
||||
return process_record_user(keycode, record);
|
||||
}
|
||||
|
||||
void led_init_ports(void) {
|
||||
@@ -64,12 +64,12 @@ void led_set_kb(uint8_t usb_led) {
|
||||
PORTE |= (1<<6); // HI
|
||||
}
|
||||
|
||||
led_set_user(usb_led);
|
||||
led_set_user(usb_led);
|
||||
}
|
||||
|
||||
void backlight_init_ports(void) {
|
||||
DDRB |= (1<<1) | (1<<2) | (1<<3) | (1<<4); // OUT
|
||||
DDRD |= (1<<7); // OUT
|
||||
DDRB |= (1<<1) | (1<<2) | (1<<3) | (1<<4); // OUT
|
||||
DDRD |= (1<<7); // OUT
|
||||
}
|
||||
|
||||
/* Backlight pin configuration
|
||||
|
@@ -103,7 +103,7 @@ bool matrix_is_on(uint8_t row, uint8_t col)
|
||||
inline
|
||||
matrix_row_t matrix_get_row(uint8_t row)
|
||||
{
|
||||
return matrix[row];
|
||||
return matrix[row];
|
||||
}
|
||||
|
||||
void matrix_print(void)
|
||||
|
@@ -57,14 +57,14 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE ?= yes # Console for debug(+400)
|
||||
CONSOLE_ENABLE ?= no # Console for debug(+400)
|
||||
COMMAND_ENABLE ?= yes # Commands for debug and configuration
|
||||
CUSTOM_MATRIX ?= yes # Custom matrix file
|
||||
# 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
|
||||
BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality
|
||||
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
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Before Width: | Height: | Size: 753 KiB |
Binary file not shown.
Binary file not shown.
7
keyboards/lets_split/keymaps/khord/Makefile
Normal file
7
keyboards/lets_split/keymaps/khord/Makefile
Normal file
@@ -0,0 +1,7 @@
|
||||
TAP_DANCE_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = yes
|
||||
USE_I2C = no
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
@@ -15,29 +15,19 @@ 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 <avr/io.h>
|
||||
#include "stdint.h"
|
||||
#include "led.h"
|
||||
#define TAPPING_TERM 150
|
||||
|
||||
void led_init_ports(void) {
|
||||
// * Set our LED pins as output
|
||||
DDRB |= (1<<6);
|
||||
DDRB |= (1<<7);
|
||||
}
|
||||
#define USE_SERIAL
|
||||
#define EE_HANDS
|
||||
|
||||
void led_set_kb(uint8_t usb_led) {
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
// Turn capslock on
|
||||
PORTB |= (1<<6);
|
||||
} else {
|
||||
// Turn capslock off
|
||||
PORTB &= ~(1<<6);
|
||||
}
|
||||
if (usb_led & (1<<USB_LED_SCROLL_LOCK)) {
|
||||
// Turn scrolllock on
|
||||
PORTB |= (1<<7);
|
||||
} else {
|
||||
// Turn scrolllock off
|
||||
PORTB &= ~(1<<7);
|
||||
}
|
||||
}
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
|
||||
#ifdef SUBPROJECT_rev1
|
||||
#include "../../rev1/config.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_rev2
|
||||
#include "../../rev2/config.h"
|
||||
#endif
|
||||
#ifdef SUBPROJECT_rev2fliphalf
|
||||
#include "../../rev2fliphalf/config.h"
|
||||
#endif
|
235
keyboards/lets_split/keymaps/khord/keymap.c
Normal file
235
keyboards/lets_split/keymaps/khord/keymap.c
Normal file
@@ -0,0 +1,235 @@
|
||||
#include "lets_split.h"
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
extern keymap_config_t keymap_config;
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
#define _QWERTY 0
|
||||
#define _COLEMAK 1
|
||||
#define _DVORAK 2
|
||||
#define _LOWER 3
|
||||
#define _RAISE 4
|
||||
#define _ADJUST 16
|
||||
|
||||
enum custom_keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
LOWER,
|
||||
RAISE,
|
||||
ADJUST,
|
||||
};
|
||||
|
||||
// Fillers to make layering more clear
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
// Tap Dance Declarations
|
||||
enum {
|
||||
SFT_CAP = 0,
|
||||
LFT_HOM,
|
||||
DWN_PDN,
|
||||
UPP_PUP,
|
||||
RGT_END
|
||||
};
|
||||
|
||||
// Dylan's additions
|
||||
#define C_A_DEL LALT(LCTL(KC_DEL))
|
||||
#define C_A_INS LALT(LCTL(KC_INS))
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Qwerty
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_QWERTY] = KEYMAP( \
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
|
||||
CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
|
||||
TD(SFT_CAP), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \
|
||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Colemak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_COLEMAK] = KEYMAP( \
|
||||
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
|
||||
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
|
||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Dvorak
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Esc | A | O | E | U | I | D | H | T | N | S | / |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_DVORAK] = KEYMAP( \
|
||||
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
|
||||
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
|
||||
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
|
||||
ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
|
||||
),
|
||||
|
||||
/* Lower
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | END | HOME |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_LOWER] = KEYMAP( \
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
|
||||
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_END, KC_HOME, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
|
||||
/* Raise
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |PG DN |PG UP |Enter |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_RAISE] = KEYMAP( \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
|
||||
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
|
||||
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGDN, KC_PGUP, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
|
||||
),
|
||||
|
||||
/* Adjust (Lower + Raise)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | Reset| | | | | | | | | | Del |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | | |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | | | | | | | | | | | |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[_ADJUST] = KEYMAP( \
|
||||
_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
|
||||
_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
|
||||
_______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, C_A_INS, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_A_DEL \
|
||||
)
|
||||
|
||||
|
||||
};
|
||||
|
||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||
[SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
|
||||
[LFT_HOM] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME),
|
||||
[DWN_PDN] = ACTION_TAP_DANCE_DOUBLE(KC_DOWN, KC_PGDN),
|
||||
[UPP_PUP] = ACTION_TAP_DANCE_DOUBLE(KC_UP, KC_PGUP),
|
||||
[RGT_END] = ACTION_TAP_DANCE_DOUBLE(KC_RGHT, KC_END)
|
||||
};
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
||||
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
||||
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
||||
#endif
|
||||
|
||||
void persistent_default_layer_set(uint16_t default_layer) {
|
||||
eeconfig_update_default_layer(default_layer);
|
||||
default_layer_set(default_layer);
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case QWERTY:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_QWERTY);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case COLEMAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_COLEMAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case DVORAK:
|
||||
if (record->event.pressed) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
||||
#endif
|
||||
persistent_default_layer_set(1UL<<_DVORAK);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case LOWER:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_LOWER);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case RAISE:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
} else {
|
||||
layer_off(_RAISE);
|
||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case ADJUST:
|
||||
if (record->event.pressed) {
|
||||
layer_on(_ADJUST);
|
||||
} else {
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
@@ -6,6 +6,7 @@ This readme and most of the code are from https://github.com/ahtn/tmk_keyboard/
|
||||
Split keyboard firmware for Arduino Pro Micro or other ATmega32u4
|
||||
based boards.
|
||||
|
||||
**Hardware files for the Let's Split are now stored at http://qmk.fm/lets_split/**
|
||||
|
||||
## Build Guide
|
||||
|
||||
|
@@ -17,6 +17,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#include "pegasushoof.h"
|
||||
|
||||
|
||||
extern inline void ph_caps_led_on(void);
|
||||
extern inline void ph_caps_led_off(void);
|
||||
|
||||
extern inline void ph_sclk_led_on(void);
|
||||
extern inline void ph_sclk_led_off(void);
|
||||
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
};
|
||||
|
@@ -24,9 +24,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x6060
|
||||
#define DEVICE_VER 0x0003
|
||||
#define MANUFACTURER PHANTOM
|
||||
#define PRODUCT PHANTOM RGB MOD
|
||||
#define DESCRIPTION QMK keyboard firmware for PHANTOM TKL
|
||||
#define MANUFACTURER bpiphany
|
||||
#define PRODUCT PHANTOM
|
||||
#define DESCRIPTION QMK keyboard firmware for PHANTOM
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 6
|
||||
@@ -44,6 +44,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION ROW2COL
|
||||
|
||||
// #define BACKLIGHT_PIN B7
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
/* Underlight configuration
|
||||
*/
|
||||
#define RGB_DI_PIN E2
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 20 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
@@ -55,19 +68,79 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* key combination for command */
|
||||
/*
|
||||
* 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)) \
|
||||
)
|
||||
|
||||
/* Underlight configuration
|
||||
*/
|
||||
#define RGB_DI_PIN E2
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLED_NUM 20 // Number of LEDs
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#define RGBLIGHT_SAT_STEP 17
|
||||
#define RGBLIGHT_VAL_STEP 17
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
@@ -87,4 +160,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
//#define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||
|
||||
#endif
|
||||
|
37
keyboards/phantom/keymaps/default/Makefile
Normal file
37
keyboards/phantom/keymaps/default/Makefile
Normal file
@@ -0,0 +1,37 @@
|
||||
# Copyright 2013 Jun Wako <wakojun@gmail.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# QMK Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user