Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79915d3f19 | ||
|
|
d717396708 |
||
|
|
d206c1791e |
||
|
|
4f124574f1 |
||
|
|
fb05b491e7 | ||
|
|
34e244cecf |
||
|
|
1204cbb7ea |
||
|
|
dcdc7290e5 |
||
|
|
f7eb7926e8 | ||
|
|
0151f4c307 | ||
|
|
1f61fb33b4 | ||
|
|
2daad28ab1 | ||
|
|
54383674db | ||
|
|
33b62b6867 | ||
|
|
01ecf332ff |
||
|
|
0d013a21e1 |
||
|
|
01bc974365 |
||
|
|
60cbb25148 | ||
|
|
99614bd89a | ||
|
|
e30cd0fa16 | ||
|
|
c43e89bb4a | ||
|
|
3c9f27e1c9 | ||
|
|
3b9e186019 |
||
|
|
0e60b3a620 | ||
|
|
7060cb7b26 |
||
|
|
2239527871 |
||
|
|
32792826a8 | ||
|
|
25b5c2c538 | ||
|
|
d3858585ac |
||
|
|
a0f857b7a2 | ||
|
|
2f9145c6ea | ||
|
|
b02f178c06 | ||
|
|
9aa9155e88 |
||
|
|
eac0f6d4c9 |
||
|
|
2e27eb318e | ||
|
|
8ea9f13c67 | ||
|
|
b450ffc5c6 | ||
|
|
267864e42c | ||
|
|
86bfd8195c | ||
|
|
608404f874 |
||
|
|
be42c5fb98 |
||
|
|
2d7a2dfad0 | ||
|
|
65fcf951d3 | ||
|
|
d116cf5e9a | ||
|
|
2b23ca876d | ||
|
|
503b40e748 | ||
|
|
52c1517766 | ||
|
|
1a400d8644 |
||
|
|
4c39bad2e6 | ||
|
|
a6eeb930ae | ||
|
|
3370e2b74d | ||
|
|
589e756e98 |
||
|
|
2fb24c0298 | ||
|
|
93ee789387 | ||
|
|
6a81cb44f2 |
||
|
|
2703ecc9e9 |
||
|
|
62eaec52e0 |
||
|
|
36d60769f8 | ||
|
|
2bddffeaec |
||
|
|
4e3db51e92 | ||
|
|
c725b6bf89 |
||
|
|
d6eff188e9 | ||
|
|
7f8886a1b7 | ||
|
|
0da6562c4d |
||
|
|
cfcd647b2e | ||
|
|
17ec1650fd |
||
|
|
7b3ee1db8c |
||
|
|
fe680a8568 |
||
|
|
6d67e9df4b |
||
|
|
e44604c256 | ||
|
|
00872ea7e7 | ||
|
|
c251d88934 | ||
|
|
4610a6bf49 | ||
|
|
999b91fbd9 |
||
|
|
9e35a1f617 | ||
|
|
4e8b864258 | ||
|
|
e312fa44e2 | ||
|
|
0b1bed1d41 |
||
|
|
ef80a1dd67 |
||
|
|
050fa9062f |
||
|
|
fa9ecc431d | ||
|
|
cac5f96275 | ||
|
|
fa8fb60279 |
||
|
|
589bdedc47 | ||
|
|
6e10a80174 | ||
|
|
c40af06871 | ||
|
|
81d2218cee | ||
|
|
85d84938cf | ||
|
|
adf4c27db2 | ||
|
|
4cde5c243b | ||
|
|
87e1ff218d |
||
|
|
2f4c7697a9 | ||
|
|
84d3575fdb | ||
|
|
1706da9054 |
||
|
|
b17324498e | ||
|
|
0c82aafb8a | ||
|
|
577e9d89fa | ||
|
|
d21ee22cc5 | ||
|
|
5ba04d1204 | ||
|
|
10345adaa5 | ||
|
|
0d64038b73 |
||
|
|
d288121f21 | ||
|
|
191c180644 | ||
|
|
90765aaefd | ||
|
|
0d991b8873 | ||
|
|
1a7a6f313e | ||
|
|
af6435d44d |
||
|
|
5887bf7158 | ||
|
|
80034a847f |
||
|
|
568924c76c |
||
|
|
0fd08da806 |
||
|
|
d05a1deb7c | ||
|
|
6b838785b7 | ||
|
|
97fc4f1b6a | ||
|
|
738cec9bd5 | ||
|
|
ef8a30250b | ||
|
|
ed15a579a7 | ||
|
|
c84d058c8b | ||
|
|
e5e2cd94be | ||
|
|
474b4083ae | ||
|
|
c5f26b0e9a | ||
|
|
d2abfaeacd |
||
|
|
0ab51ee29d |
||
|
|
84944df6a6 | ||
|
|
728f7308af | ||
|
|
0e2009c669 | ||
|
|
8a6fd0dc7e | ||
|
|
1e1f387be7 | ||
|
|
1085500e89 |
||
|
|
6df5fce073 | ||
|
|
5141d6eeb1 | ||
|
|
fe08bbc4a0 | ||
|
|
da1c562ddf | ||
|
|
36109a887a | ||
|
|
b74509d4ae | ||
|
|
9d226b92a8 | ||
|
|
11836128fc | ||
|
|
6f82647e8d | ||
|
|
85b3b98570 |
||
|
|
e89478eb0f |
||
|
|
6221c86186 | ||
|
|
d6402fe9fb | ||
|
|
08c556b78b |
||
|
|
af84772a5f |
||
|
|
b1a3f806f5 | ||
|
|
bb324e5b3e | ||
|
|
267f392237 | ||
|
|
b94baa8bc3 | ||
|
|
86e93d7654 | ||
|
|
344b8410f7 | ||
|
|
8bb2c66c88 | ||
|
|
73bd3dff8c | ||
|
|
af02baae78 |
||
|
|
f9e97fd3c3 | ||
|
|
38839a9105 | ||
|
|
6fdce80822 | ||
|
|
bbab8eb993 |
||
|
|
ecce9900c9 |
||
|
|
d44a950c10 |
||
|
|
8545473307 |
||
|
|
9e2fe4eff6 |
||
|
|
e869d089b7 | ||
|
|
f663f84413 | ||
|
|
044486500c | ||
|
|
a099579aa0 | ||
|
|
67e80780bb | ||
|
|
6e4e50d5aa | ||
|
|
2de70e6f2d |
||
|
|
31fb141528 | ||
|
|
6b640db4bb | ||
|
|
e4be4d282c | ||
|
|
9a2943d221 | ||
|
|
f03fe5b917 | ||
|
|
6123698270 | ||
|
|
a765f730b1 | ||
|
|
3ce029c7fd | ||
|
|
87c3a53716 | ||
|
|
103c08cc75 |
576 changed files with 14186 additions and 3258 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -18,3 +18,6 @@
|
||||||
[submodule "lib/printf"]
|
[submodule "lib/printf"]
|
||||||
path = lib/printf
|
path = lib/printf
|
||||||
url = https://github.com/qmk/printf
|
url = https://github.com/qmk/printf
|
||||||
|
[submodule "lib/pico-sdk"]
|
||||||
|
path = lib/pico-sdk
|
||||||
|
url = https://github.com/qmk/pico-sdk.git
|
||||||
|
|
|
||||||
1
Makefile
1
Makefile
|
|
@ -401,6 +401,7 @@ ifndef SKIP_GIT
|
||||||
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 50 --init lib/lufa; fi
|
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 50 --init lib/lufa; fi
|
||||||
if [ ! -e lib/vusb ]; then git submodule sync lib/vusb && git submodule update --depth 50 --init lib/vusb; fi
|
if [ ! -e lib/vusb ]; then git submodule sync lib/vusb && git submodule update --depth 50 --init lib/vusb; fi
|
||||||
if [ ! -e lib/printf ]; then git submodule sync lib/printf && git submodule update --depth 50 --init lib/printf; fi
|
if [ ! -e lib/printf ]; then git submodule sync lib/printf && git submodule update --depth 50 --init lib/printf; fi
|
||||||
|
if [ ! -e lib/pico-sdk ]; then git submodule sync lib/pico-sdk && git submodule update --depth 50 --init lib/pico-sdk; fi
|
||||||
git submodule status --recursive 2>/dev/null | \
|
git submodule status --recursive 2>/dev/null | \
|
||||||
while IFS= read -r x; do \
|
while IFS= read -r x; do \
|
||||||
case "$$x" in \
|
case "$$x" in \
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,10 @@ ifeq ($(strip $(BOOTLOADER)), tinyuf2)
|
||||||
OPT_DEFS += -DBOOTLOADER_TINYUF2
|
OPT_DEFS += -DBOOTLOADER_TINYUF2
|
||||||
BOOTLOADER_TYPE = tinyuf2
|
BOOTLOADER_TYPE = tinyuf2
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(strip $(BOOTLOADER)), rp2040)
|
||||||
|
OPT_DEFS += -DBOOTLOADER_RP2040
|
||||||
|
BOOTLOADER_TYPE = rp2040
|
||||||
|
endif
|
||||||
ifeq ($(strip $(BOOTLOADER)), halfkay)
|
ifeq ($(strip $(BOOTLOADER)), halfkay)
|
||||||
OPT_DEFS += -DBOOTLOADER_HALFKAY
|
OPT_DEFS += -DBOOTLOADER_HALFKAY
|
||||||
BOOTLOADER_TYPE = halfkay
|
BOOTLOADER_TYPE = halfkay
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,14 @@ endif
|
||||||
include paths.mk
|
include paths.mk
|
||||||
include $(BUILDDEFS_PATH)/message.mk
|
include $(BUILDDEFS_PATH)/message.mk
|
||||||
|
|
||||||
|
# Helper to add defines with a 'QMK_' prefix
|
||||||
|
define add_qmk_prefix_defs
|
||||||
|
ifdef $1
|
||||||
|
# Need to cater for 'STM32L4xx+'
|
||||||
|
OPT_DEFS += -DQMK_$(2)="$($1)" -DQMK_$(2)_$(shell echo $($1) | sed -e 's@+@Plus@g' -e 's@[^a-zA-Z0-9]@_@g' | tr '[:lower:]' '[:upper:]')
|
||||||
|
endif
|
||||||
|
endef
|
||||||
|
|
||||||
# Set the qmk cli to use
|
# Set the qmk cli to use
|
||||||
QMK_BIN ?= qmk
|
QMK_BIN ?= qmk
|
||||||
|
|
||||||
|
|
@ -390,10 +398,12 @@ ifneq ("$(KEYMAP_H)","")
|
||||||
CONFIG_H += $(KEYMAP_H)
|
CONFIG_H += $(KEYMAP_H)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
OPT_DEFS += -DKEYMAP_C=\"$(KEYMAP_C)\"
|
||||||
|
|
||||||
# project specific files
|
# project specific files
|
||||||
SRC += \
|
SRC += \
|
||||||
$(KEYBOARD_SRC) \
|
$(KEYBOARD_SRC) \
|
||||||
$(KEYMAP_C) \
|
$(QUANTUM_DIR)/keymap_introspection.c \
|
||||||
$(QUANTUM_SRC) \
|
$(QUANTUM_SRC) \
|
||||||
$(QUANTUM_DIR)/main.c \
|
$(QUANTUM_DIR)/main.c \
|
||||||
|
|
||||||
|
|
@ -436,6 +446,14 @@ else
|
||||||
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
|
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Setup definitions based on the selected MCU
|
||||||
|
$(eval $(call add_qmk_prefix_defs,MCU_ORIG,MCU))
|
||||||
|
$(eval $(call add_qmk_prefix_defs,MCU_ARCH,MCU_ARCH))
|
||||||
|
$(eval $(call add_qmk_prefix_defs,MCU_PORT_NAME,MCU_PORT_NAME))
|
||||||
|
$(eval $(call add_qmk_prefix_defs,MCU_FAMILY,MCU_FAMILY))
|
||||||
|
$(eval $(call add_qmk_prefix_defs,MCU_SERIES,MCU_SERIES))
|
||||||
|
$(eval $(call add_qmk_prefix_defs,BOARD,BOARD))
|
||||||
|
|
||||||
# TODO: remove this bodge?
|
# TODO: remove this bodge?
|
||||||
PROJECT_DEFS := $(OPT_DEFS)
|
PROJECT_DEFS := $(OPT_DEFS)
|
||||||
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
|
||||||
|
|
@ -469,6 +487,19 @@ check-size: build
|
||||||
check-md5: build
|
check-md5: build
|
||||||
objs-size: build
|
objs-size: build
|
||||||
|
|
||||||
|
ifeq ($(strip $(TOP_SYMBOLS)),yes)
|
||||||
|
all: top-symbols
|
||||||
|
check-size: top-symbols
|
||||||
|
top-symbols: build
|
||||||
|
echo "###########################################"
|
||||||
|
echo "# Highest flash usage:"
|
||||||
|
$(NM) -Crtd --size-sort $(BUILD_DIR)/$(TARGET).elf | grep -i ' [t] ' | head -n10 | sed -e 's#^0000000# #g' -e 's#^000000# #g' -e 's#^00000# #g' -e 's#^0000# #g' -e 's#^000# #g' -e 's#^00# #g' -e 's#^0# #g'
|
||||||
|
echo "###########################################"
|
||||||
|
echo "# Highest RAM usage:"
|
||||||
|
$(NM) -Crtd --size-sort $(BUILD_DIR)/$(TARGET).elf | grep -i ' [dbv] ' | head -n10 | sed -e 's#^0000000# #g' -e 's#^000000# #g' -e 's#^00000# #g' -e 's#^0000# #g' -e 's#^000# #g' -e 's#^00# #g' -e 's#^0# #g'
|
||||||
|
echo "###########################################"
|
||||||
|
endif
|
||||||
|
|
||||||
include $(BUILDDEFS_PATH)/show_options.mk
|
include $(BUILDDEFS_PATH)/show_options.mk
|
||||||
include $(BUILDDEFS_PATH)/common_rules.mk
|
include $(BUILDDEFS_PATH)/common_rules.mk
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ VPATH += \
|
||||||
|
|
||||||
all: elf
|
all: elf
|
||||||
|
|
||||||
VPATH += $(COMMON_VPATH)
|
VPATH += $(TEST_PATH) $(COMMON_VPATH)
|
||||||
PLATFORM:=TEST
|
PLATFORM:=TEST
|
||||||
PLATFORM_KEY:=test
|
PLATFORM_KEY:=test
|
||||||
BOOTLOADER_TYPE:=none
|
BOOTLOADER_TYPE:=none
|
||||||
|
|
@ -63,6 +63,7 @@ include $(TMK_PATH)/protocol.mk
|
||||||
include $(QUANTUM_PATH)/debounce/tests/rules.mk
|
include $(QUANTUM_PATH)/debounce/tests/rules.mk
|
||||||
include $(QUANTUM_PATH)/encoder/tests/rules.mk
|
include $(QUANTUM_PATH)/encoder/tests/rules.mk
|
||||||
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
|
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
|
||||||
|
include $(QUANTUM_PATH)/wear_leveling/tests/rules.mk
|
||||||
include $(PLATFORM_PATH)/test/rules.mk
|
include $(PLATFORM_PATH)/test/rules.mk
|
||||||
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
||||||
include $(BUILDDEFS_PATH)/build_full_test.mk
|
include $(BUILDDEFS_PATH)/build_full_test.mk
|
||||||
|
|
|
||||||
|
|
@ -92,10 +92,29 @@ ifeq ($(MUSIC_ENABLE), yes)
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
|
SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
VALID_STENO_PROTOCOL_TYPES := geminipr txbolt all
|
||||||
|
STENO_PROTOCOL ?= all
|
||||||
ifeq ($(strip $(STENO_ENABLE)), yes)
|
ifeq ($(strip $(STENO_ENABLE)), yes)
|
||||||
OPT_DEFS += -DSTENO_ENABLE
|
ifeq ($(filter $(STENO_PROTOCOL),$(VALID_STENO_PROTOCOL_TYPES)),)
|
||||||
VIRTSER_ENABLE ?= yes
|
$(call CATASTROPHIC_ERROR,Invalid STENO_PROTOCOL,STENO_PROTOCOL="$(STENO_PROTOCOL)" is not a valid stenography protocol)
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
|
else
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE
|
||||||
|
VIRTSER_ENABLE ?= yes
|
||||||
|
|
||||||
|
ifeq ($(strip $(STENO_PROTOCOL)), geminipr)
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE_GEMINI
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(STENO_PROTOCOL)), txbolt)
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE_BOLT
|
||||||
|
endif
|
||||||
|
ifeq ($(strip $(STENO_PROTOCOL)), all)
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE_ALL
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE_GEMINI
|
||||||
|
OPT_DEFS += -DSTENO_ENABLE_BOLT
|
||||||
|
endif
|
||||||
|
|
||||||
|
SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
ifeq ($(strip $(VIRTSER_ENABLE)), yes)
|
||||||
|
|
@ -154,33 +173,36 @@ ifeq ($(strip $(QUANTUM_PAINTER_ENABLE)), yes)
|
||||||
include $(QUANTUM_DIR)/painter/rules.mk
|
include $(QUANTUM_DIR)/painter/rules.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi
|
VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi wear_leveling
|
||||||
EEPROM_DRIVER ?= vendor
|
EEPROM_DRIVER ?= vendor
|
||||||
ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),)
|
ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),)
|
||||||
$(call CATASTROPHIC_ERROR,Invalid EEPROM_DRIVER,EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver)
|
$(call CATASTROPHIC_ERROR,Invalid EEPROM_DRIVER,EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver)
|
||||||
else
|
else
|
||||||
OPT_DEFS += -DEEPROM_ENABLE
|
OPT_DEFS += -DEEPROM_ENABLE
|
||||||
|
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
||||||
|
COMMON_VPATH += $(PLATFORM_COMMON_DIR)
|
||||||
ifeq ($(strip $(EEPROM_DRIVER)), custom)
|
ifeq ($(strip $(EEPROM_DRIVER)), custom)
|
||||||
# Custom EEPROM implementation -- only needs to implement init/erase/read_block/write_block
|
# Custom EEPROM implementation -- only needs to implement init/erase/read_block/write_block
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_CUSTOM
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_CUSTOM
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
|
||||||
SRC += eeprom_driver.c
|
SRC += eeprom_driver.c
|
||||||
|
else ifeq ($(strip $(EEPROM_DRIVER)), wear_leveling)
|
||||||
|
# Wear-leveling EEPROM implementation
|
||||||
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING
|
||||||
|
SRC += eeprom_driver.c eeprom_wear_leveling.c
|
||||||
else ifeq ($(strip $(EEPROM_DRIVER)), i2c)
|
else ifeq ($(strip $(EEPROM_DRIVER)), i2c)
|
||||||
# External I2C EEPROM implementation
|
# External I2C EEPROM implementation
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_I2C
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_I2C
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
SRC += eeprom_driver.c eeprom_i2c.c
|
SRC += eeprom_driver.c eeprom_i2c.c
|
||||||
else ifeq ($(strip $(EEPROM_DRIVER)), spi)
|
else ifeq ($(strip $(EEPROM_DRIVER)), spi)
|
||||||
# External SPI EEPROM implementation
|
# External SPI EEPROM implementation
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
|
||||||
QUANTUM_LIB_SRC += spi_master.c
|
QUANTUM_LIB_SRC += spi_master.c
|
||||||
SRC += eeprom_driver.c eeprom_spi.c
|
SRC += eeprom_driver.c eeprom_spi.c
|
||||||
else ifeq ($(strip $(EEPROM_DRIVER)), transient)
|
else ifeq ($(strip $(EEPROM_DRIVER)), transient)
|
||||||
# Transient EEPROM implementation -- no data storage but provides runtime area for it
|
# Transient EEPROM implementation -- no data storage but provides runtime area for it
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
|
||||||
SRC += eeprom_driver.c eeprom_transient.c
|
SRC += eeprom_driver.c eeprom_transient.c
|
||||||
else ifeq ($(strip $(EEPROM_DRIVER)), vendor)
|
else ifeq ($(strip $(EEPROM_DRIVER)), vendor)
|
||||||
# Vendor-implemented EEPROM
|
# Vendor-implemented EEPROM
|
||||||
|
|
@ -191,17 +213,13 @@ else
|
||||||
ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6 %_GD32VF103xB %_GD32VF103x8, $(MCU_SERIES)_$(MCU_LDSCRIPT)),)
|
ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6 %_GD32VF103xB %_GD32VF103x8, $(MCU_SERIES)_$(MCU_LDSCRIPT)),)
|
||||||
# Emulated EEPROM
|
# Emulated EEPROM
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_FLASH_EMULATED
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_FLASH_EMULATED
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash
|
||||||
SRC += eeprom_driver.c
|
COMMON_VPATH += $(DRIVER_PATH)/flash
|
||||||
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
|
SRC += eeprom_driver.c eeprom_stm32.c flash_stm32.c
|
||||||
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
|
|
||||||
else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),)
|
else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),)
|
||||||
# True EEPROM on STM32L0xx, L1xx
|
# True EEPROM on STM32L0xx, L1xx
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_L0_L1
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_L0_L1
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
SRC += eeprom_driver.c eeprom_stm32_L0_L1.c
|
||||||
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom
|
|
||||||
SRC += eeprom_driver.c
|
|
||||||
SRC += eeprom_stm32_L0_L1.c
|
|
||||||
else ifneq ($(filter $(MCU_SERIES),KL2x K20x),)
|
else ifneq ($(filter $(MCU_SERIES),KL2x K20x),)
|
||||||
# Teensy EEPROM implementations
|
# Teensy EEPROM implementations
|
||||||
OPT_DEFS += -DEEPROM_TEENSY
|
OPT_DEFS += -DEEPROM_TEENSY
|
||||||
|
|
@ -209,32 +227,61 @@ else
|
||||||
else
|
else
|
||||||
# Fall back to transient, i.e. non-persistent
|
# Fall back to transient, i.e. non-persistent
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
|
||||||
SRC += eeprom_driver.c eeprom_transient.c
|
SRC += eeprom_driver.c eeprom_transient.c
|
||||||
endif
|
endif
|
||||||
else ifeq ($(PLATFORM),ARM_ATSAM)
|
else ifeq ($(PLATFORM),ARM_ATSAM)
|
||||||
# arm_atsam EEPROM
|
# arm_atsam EEPROM
|
||||||
OPT_DEFS += -DEEPROM_SAMD
|
OPT_DEFS += -DEEPROM_SAMD
|
||||||
SRC += $(PLATFORM_COMMON_DIR)/eeprom_samd.c
|
SRC += eeprom_samd.c
|
||||||
else ifeq ($(PLATFORM),TEST)
|
else ifeq ($(PLATFORM),TEST)
|
||||||
# Test harness "EEPROM"
|
# Test harness "EEPROM"
|
||||||
OPT_DEFS += -DEEPROM_TEST_HARNESS
|
OPT_DEFS += -DEEPROM_TEST_HARNESS
|
||||||
SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
|
SRC += eeprom.c
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
VALID_WEAR_LEVELING_DRIVER_TYPES := custom embedded_flash spi_flash legacy
|
||||||
|
WEAR_LEVELING_DRIVER ?= none
|
||||||
|
ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none)
|
||||||
|
ifeq ($(filter $(WEAR_LEVELING_DRIVER),$(VALID_WEAR_LEVELING_DRIVER_TYPES)),)
|
||||||
|
$(call CATASTROPHIC_ERROR,Invalid WEAR_LEVELING_DRIVER,WEAR_LEVELING_DRIVER="$(WEAR_LEVELING_DRIVER)" is not a valid wear leveling driver)
|
||||||
|
else
|
||||||
|
FNV_ENABLE := yes
|
||||||
|
OPT_DEFS += -DWEAR_LEVELING_ENABLE
|
||||||
|
OPT_DEFS += -DWEAR_LEVELING_$(strip $(shell echo $(WEAR_LEVELING_DRIVER) | tr '[:lower:]' '[:upper:]'))
|
||||||
|
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/wear_leveling
|
||||||
|
COMMON_VPATH += $(QUANTUM_DIR)/wear_leveling
|
||||||
|
SRC += wear_leveling.c
|
||||||
|
ifeq ($(strip $(WEAR_LEVELING_DRIVER)), embedded_flash)
|
||||||
|
OPT_DEFS += -DHAL_USE_EFL
|
||||||
|
SRC += wear_leveling_efl.c
|
||||||
|
POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling/wear_leveling_efl_config.h
|
||||||
|
else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), spi_flash)
|
||||||
|
FLASH_DRIVER := spi
|
||||||
|
SRC += wear_leveling_flash_spi.c
|
||||||
|
POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_flash_spi_config.h
|
||||||
|
else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), legacy)
|
||||||
|
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash
|
||||||
|
SRC += flash_stm32.c wear_leveling_legacy.c
|
||||||
|
POST_CONFIG_H += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/wear_leveling/wear_leveling_legacy_config.h
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VALID_FLASH_DRIVER_TYPES := spi
|
VALID_FLASH_DRIVER_TYPES := spi
|
||||||
FLASH_DRIVER ?= no
|
FLASH_DRIVER ?= none
|
||||||
ifneq ($(strip $(FLASH_DRIVER)), no)
|
ifneq ($(strip $(FLASH_DRIVER)), none)
|
||||||
ifeq ($(filter $(FLASH_DRIVER),$(VALID_FLASH_DRIVER_TYPES)),)
|
ifeq ($(filter $(FLASH_DRIVER),$(VALID_FLASH_DRIVER_TYPES)),)
|
||||||
$(error FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid FLASH driver)
|
$(call CATASTROPHIC_ERROR,Invalid FLASH_DRIVER,FLASH_DRIVER="$(FLASH_DRIVER)" is not a valid flash driver)
|
||||||
else
|
else
|
||||||
OPT_DEFS += -DFLASH_ENABLE
|
OPT_DEFS += -DFLASH_ENABLE
|
||||||
ifeq ($(strip $(FLASH_DRIVER)), spi)
|
ifeq ($(strip $(FLASH_DRIVER)),spi)
|
||||||
OPT_DEFS += -DFLASH_DRIVER -DFLASH_SPI
|
OPT_DEFS += -DFLASH_DRIVER -DFLASH_SPI
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/flash
|
COMMON_VPATH += $(DRIVER_PATH)/flash
|
||||||
SRC += flash_spi.c
|
SRC += flash_spi.c
|
||||||
|
QUANTUM_LIB_SRC += spi_master.c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
@ -500,7 +547,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c
|
VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c vendor
|
||||||
|
|
||||||
WS2812_DRIVER ?= bitbang
|
WS2812_DRIVER ?= bitbang
|
||||||
ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
|
ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
|
||||||
|
|
@ -542,12 +589,6 @@ ifeq ($(strip $(LED_TABLES)), yes)
|
||||||
SRC += $(QUANTUM_DIR)/led_tables.c
|
SRC += $(QUANTUM_DIR)/led_tables.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(TERMINAL_ENABLE)), yes)
|
|
||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
|
|
||||||
OPT_DEFS += -DTERMINAL_ENABLE
|
|
||||||
OPT_DEFS += -DUSER_PRINT
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(strip $(VIA_ENABLE)), yes)
|
ifeq ($(strip $(VIA_ENABLE)), yes)
|
||||||
DYNAMIC_KEYMAP_ENABLE := yes
|
DYNAMIC_KEYMAP_ENABLE := yes
|
||||||
RAW_ENABLE := yes
|
RAW_ENABLE := yes
|
||||||
|
|
@ -595,6 +636,14 @@ ifneq ($(strip $(DEBOUNCE_TYPE)), custom)
|
||||||
QUANTUM_SRC += $(QUANTUM_DIR)/debounce/$(strip $(DEBOUNCE_TYPE)).c
|
QUANTUM_SRC += $(QUANTUM_DIR)/debounce/$(strip $(DEBOUNCE_TYPE)).c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
VALID_SERIAL_DRIVER_TYPES := bitbang usart vendor
|
||||||
|
|
||||||
|
SERIAL_DRIVER ?= bitbang
|
||||||
|
ifeq ($(filter $(SERIAL_DRIVER),$(VALID_SERIAL_DRIVER_TYPES)),)
|
||||||
|
$(call CATASTROPHIC_ERROR,Invalid SERIAL_DRIVER,SERIAL_DRIVER="$(SERIAL_DRIVER)" is not a valid SERIAL driver)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
|
POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
|
||||||
OPT_DEFS += -DSPLIT_KEYBOARD
|
OPT_DEFS += -DSPLIT_KEYBOARD
|
||||||
|
|
@ -619,11 +668,11 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SERIAL_DRIVER ?= bitbang
|
|
||||||
OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]'))
|
OPT_DEFS += -DSERIAL_DRIVER_$(strip $(shell echo $(SERIAL_DRIVER) | tr '[:lower:]' '[:upper:]'))
|
||||||
ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
|
ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
|
||||||
QUANTUM_LIB_SRC += serial.c
|
QUANTUM_LIB_SRC += serial.c
|
||||||
else
|
else
|
||||||
|
QUANTUM_LIB_SRC += serial_protocol.c
|
||||||
QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
|
QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
@ -635,6 +684,12 @@ ifeq ($(strip $(CRC_ENABLE)), yes)
|
||||||
SRC += crc.c
|
SRC += crc.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(FNV_ENABLE)), yes)
|
||||||
|
OPT_DEFS += -DFNV_ENABLE
|
||||||
|
VPATH += $(LIB_PATH)/fnv
|
||||||
|
SRC += qmk_fnv_type_validation.c hash_32a.c hash_64a.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(HAPTIC_ENABLE)),yes)
|
ifeq ($(strip $(HAPTIC_ENABLE)),yes)
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,5 @@
|
||||||
# Hey Emacs, this is a -*- makefile -*-
|
# Hey Emacs, this is a -*- makefile -*-
|
||||||
#----------------------------------------------------------------------------
|
#----------------------------------------------------------------------------
|
||||||
# WinAVR Makefile Template written by Eric B. Weddington, Jg Wunsch, et al.
|
|
||||||
#
|
|
||||||
# Released to the Public Domain
|
|
||||||
#
|
|
||||||
# Additional material for this makefile was written by:
|
|
||||||
# Peter Fleury
|
|
||||||
# Tim Henigan
|
|
||||||
# Colin O'Flynn
|
|
||||||
# Reiner Patommel
|
|
||||||
# Markus Pfaff
|
|
||||||
# Sander Pool
|
|
||||||
# Frederik Rouleau
|
|
||||||
# Carlos Lamas
|
|
||||||
#
|
|
||||||
|
|
||||||
# Enable vpath seraching for source files only
|
# Enable vpath seraching for source files only
|
||||||
# Without this, output files, could be read from the wrong .build directories
|
# Without this, output files, could be read from the wrong .build directories
|
||||||
|
|
@ -38,36 +24,15 @@ NO_LTO_OBJ := $(filter %.a,$(OBJ))
|
||||||
|
|
||||||
MASTER_OUTPUT := $(firstword $(OUTPUTS))
|
MASTER_OUTPUT := $(firstword $(OUTPUTS))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Output format. (can be srec, ihex, binary)
|
# Output format. (can be srec, ihex, binary)
|
||||||
FORMAT = ihex
|
FORMAT = ihex
|
||||||
|
|
||||||
# Optimization level, can be [0, 1, 2, 3, s].
|
# Optimization level, can be [0, 1, 2, 3, s].
|
||||||
# 0 = turn off optimization. s = optimize for size.
|
|
||||||
# (Note: 3 is not always the best optimization level. See avr-libc FAQ.)
|
|
||||||
OPT ?= s
|
OPT ?= s
|
||||||
|
|
||||||
# Compiler flag to set the C Standard level.
|
# Compiler flag to set the C and C++ language standard level
|
||||||
# c89 = "ANSI" C
|
CSTANDARD = -std=gnu11
|
||||||
# gnu89 = c89 plus GCC extensions
|
CXXSTANDARD = -std=gnu++14
|
||||||
# c99 = ISO C99 standard (not yet fully implemented)
|
|
||||||
# gnu99 = c99 plus GCC extensions
|
|
||||||
CSTANDARD = -std=gnu99
|
|
||||||
|
|
||||||
|
|
||||||
# Place -D or -U options here for C sources
|
|
||||||
#CDEFS +=
|
|
||||||
|
|
||||||
|
|
||||||
# Place -D or -U options here for ASM sources
|
|
||||||
#ADEFS +=
|
|
||||||
|
|
||||||
|
|
||||||
# Place -D or -U options here for C++ sources
|
|
||||||
#CXXDEFS += -D__STDC_LIMIT_MACROS
|
|
||||||
#CXXDEFS += -D__STDC_CONSTANT_MACROS
|
|
||||||
#CXXDEFS +=
|
|
||||||
|
|
||||||
# Speed up recompilations by opt-in usage of ccache
|
# Speed up recompilations by opt-in usage of ccache
|
||||||
USE_CCACHE ?= no
|
USE_CCACHE ?= no
|
||||||
|
|
@ -75,12 +40,8 @@ ifneq ($(USE_CCACHE),no)
|
||||||
CC_PREFIX ?= ccache
|
CC_PREFIX ?= ccache
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#---------------- Compiler Options C ----------------
|
#---------------- C Compiler Options ----------------
|
||||||
# -g*: generate debugging information
|
|
||||||
# -O*: optimization level
|
|
||||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
|
||||||
# -Wall...: warning level
|
|
||||||
# -Wa,...: tell GCC to pass this to the assembler.
|
|
||||||
ifeq ($(strip $(LTO_ENABLE)), yes)
|
ifeq ($(strip $(LTO_ENABLE)), yes)
|
||||||
ifeq ($(PLATFORM),ARM_ATSAM)
|
ifeq ($(PLATFORM),ARM_ATSAM)
|
||||||
$(info Enabling LTO on arm_atsam-targeting boards is known to have a high likelihood of failure.)
|
$(info Enabling LTO on arm_atsam-targeting boards is known to have a high likelihood of failure.)
|
||||||
|
|
@ -111,23 +72,14 @@ CFLAGS += -Wstrict-prototypes
|
||||||
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
|
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
|
||||||
CFLAGS += -Werror
|
CFLAGS += -Werror
|
||||||
endif
|
endif
|
||||||
#CFLAGS += -mshort-calls
|
|
||||||
#CFLAGS += -fno-unit-at-a-time
|
|
||||||
#CFLAGS += -Wundef
|
|
||||||
#CFLAGS += -Wunreachable-code
|
|
||||||
#CFLAGS += -Wsign-compare
|
|
||||||
CFLAGS += $(CSTANDARD)
|
CFLAGS += $(CSTANDARD)
|
||||||
|
|
||||||
# This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION
|
# This fixes lots of keyboards linking errors but SHOULDN'T BE A FINAL SOLUTION
|
||||||
# Fixing of multiple variable definitions must be made.
|
# Fixing of multiple variable definitions must be made.
|
||||||
CFLAGS += -fcommon
|
CFLAGS += -fcommon
|
||||||
|
|
||||||
#---------------- Compiler Options C++ ----------------
|
#---------------- C++ Compiler Options ----------------
|
||||||
# -g*: generate debugging information
|
|
||||||
# -O*: optimization level
|
|
||||||
# -f...: tuning, see GCC manual and avr-libc documentation
|
|
||||||
# -Wall...: warning level
|
|
||||||
# -Wa,...: tell GCC to pass this to the assembler.
|
|
||||||
ifeq ($(strip $(DEBUG_ENABLE)),yes)
|
ifeq ($(strip $(DEBUG_ENABLE)),yes)
|
||||||
CXXFLAGS += -g$(DEBUG)
|
CXXFLAGS += -g$(DEBUG)
|
||||||
endif
|
endif
|
||||||
|
|
@ -141,57 +93,17 @@ CXXFLAGS += -Wundef
|
||||||
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
|
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
|
||||||
CXXFLAGS += -Werror
|
CXXFLAGS += -Werror
|
||||||
endif
|
endif
|
||||||
#CXXFLAGS += -mshort-calls
|
|
||||||
#CXXFLAGS += -fno-unit-at-a-time
|
|
||||||
#CXXFLAGS += -Wstrict-prototypes
|
|
||||||
#CXXFLAGS += -Wunreachable-code
|
|
||||||
#CXXFLAGS += -Wsign-compare
|
|
||||||
#CXXFLAGS += $(CSTANDARD)
|
|
||||||
|
|
||||||
#---------------- Assembler Options ----------------
|
#---------------- Assembler Options ----------------
|
||||||
|
|
||||||
ASFLAGS += $(ADEFS)
|
ASFLAGS += $(ADEFS)
|
||||||
ifeq ($(VERBOSE_AS_CMD),yes)
|
ifeq ($(VERBOSE_AS_CMD),yes)
|
||||||
ASFLAGS += -v
|
ASFLAGS += -v
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#---------------- Library Options ----------------
|
|
||||||
# Minimalistic printf version
|
|
||||||
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min
|
|
||||||
|
|
||||||
# Floating point printf version (requires MATH_LIB = -lm below)
|
|
||||||
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt
|
|
||||||
|
|
||||||
# If this is left blank, then it will use the Standard printf version.
|
|
||||||
PRINTF_LIB =
|
|
||||||
#PRINTF_LIB = $(PRINTF_LIB_MIN)
|
|
||||||
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)
|
|
||||||
|
|
||||||
|
|
||||||
# Minimalistic scanf version
|
|
||||||
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min
|
|
||||||
|
|
||||||
# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
|
|
||||||
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt
|
|
||||||
|
|
||||||
# If this is left blank, then it will use the Standard scanf version.
|
|
||||||
SCANF_LIB =
|
|
||||||
#SCANF_LIB = $(SCANF_LIB_MIN)
|
|
||||||
#SCANF_LIB = $(SCANF_LIB_FLOAT)
|
|
||||||
|
|
||||||
|
|
||||||
MATH_LIB = -lm
|
|
||||||
CREATE_MAP ?= yes
|
|
||||||
|
|
||||||
|
|
||||||
#---------------- Linker Options ----------------
|
#---------------- Linker Options ----------------
|
||||||
# -Wl,...: tell GCC to pass this to linker.
|
|
||||||
# -Map: create map file
|
|
||||||
# --cref: add cross reference to map file
|
|
||||||
#
|
|
||||||
# Comennt out "--relax" option to avoid a error such:
|
|
||||||
# (.vectors+0x30): relocation truncated to fit: R_AVR_13_PCREL against symbol `__vector_12'
|
|
||||||
#
|
|
||||||
|
|
||||||
|
CREATE_MAP ?= yes
|
||||||
ifeq ($(CREATE_MAP),yes)
|
ifeq ($(CREATE_MAP),yes)
|
||||||
LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
|
LDFLAGS += -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
|
||||||
endif
|
endif
|
||||||
|
|
@ -201,20 +113,11 @@ endif
|
||||||
#LDFLAGS += -Wl,--relax
|
#LDFLAGS += -Wl,--relax
|
||||||
LDFLAGS += $(EXTMEMOPTS)
|
LDFLAGS += $(EXTMEMOPTS)
|
||||||
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
|
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
|
||||||
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|
LDFLAGS += -lm
|
||||||
#LDFLAGS += -T linker_script.x
|
|
||||||
# You can give EXTRALDFLAGS at 'make' command line.
|
# You can give EXTRALDFLAGS at 'make' command line.
|
||||||
LDFLAGS += $(EXTRALDFLAGS)
|
LDFLAGS += $(EXTRALDFLAGS)
|
||||||
|
|
||||||
#---------------- Assembler Listings ----------------
|
#---------------- Assembler Listings ----------------
|
||||||
# -Wa,...: tell GCC to pass this to the assembler.
|
|
||||||
# -adhlns: create listing
|
|
||||||
# -gstabs: have the assembler create line number information; note that
|
|
||||||
# for use in COFF files, additional information about filenames
|
|
||||||
# and function names needs to be present in the assembler source
|
|
||||||
# files -- see avr-libc docs [FIXME: not yet described there]
|
|
||||||
# -listing-cont-lines: Sets the maximum number of continuation lines of hex
|
|
||||||
# dump that will be displayed for a given single line of source input.
|
|
||||||
|
|
||||||
ADHLNS_ENABLE ?= no
|
ADHLNS_ENABLE ?= no
|
||||||
ifeq ($(ADHLNS_ENABLE),yes)
|
ifeq ($(ADHLNS_ENABLE),yes)
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,41 @@ ifneq ($(findstring MK66FX1M0, $(MCU)),)
|
||||||
BOARD ?= PJRC_TEENSY_3_6
|
BOARD ?= PJRC_TEENSY_3_6
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq ($(findstring RP2040, $(MCU)),)
|
||||||
|
# Cortex version
|
||||||
|
MCU = cortex-m0plus
|
||||||
|
|
||||||
|
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||||
|
CHIBIOS_PORT = ARMv6-M-RP2
|
||||||
|
|
||||||
|
## chip/board settings
|
||||||
|
# - the next two should match the directories in
|
||||||
|
# <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
|
||||||
|
# OR
|
||||||
|
# <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
|
||||||
|
MCU_FAMILY = RP
|
||||||
|
MCU_SERIES = RP2040
|
||||||
|
|
||||||
|
# Linker script to use
|
||||||
|
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
|
||||||
|
# or <keyboard_dir>/ld/
|
||||||
|
STARTUPLD_CONTRIB = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld
|
||||||
|
MCU_LDSCRIPT ?= RP2040_FLASH
|
||||||
|
LDFLAGS += -L $(STARTUPLD_CONTRIB)
|
||||||
|
|
||||||
|
# Startup code to use
|
||||||
|
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
|
||||||
|
MCU_STARTUP ?= rp2040
|
||||||
|
|
||||||
|
# Board: it should exist either in <chibios>/os/hal/boards/,
|
||||||
|
# <keyboard_dir>/boards/, or drivers/boards/
|
||||||
|
BOARD ?= GENERIC_PROMICRO_RP2040
|
||||||
|
|
||||||
|
# Default UF2 Bootloader settings
|
||||||
|
UF2_FAMILY ?= RP2040
|
||||||
|
FIRMWARE_FORMAT ?= uf2
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring STM32F042, $(MCU)),)
|
ifneq ($(findstring STM32F042, $(MCU)),)
|
||||||
# Cortex version
|
# Cortex version
|
||||||
MCU = cortex-m0
|
MCU = cortex-m0
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ BUILD_OPTION_NAMES = \
|
||||||
CONSOLE_ENABLE \
|
CONSOLE_ENABLE \
|
||||||
COMMAND_ENABLE \
|
COMMAND_ENABLE \
|
||||||
NKRO_ENABLE \
|
NKRO_ENABLE \
|
||||||
TERMINAL_ENABLE \
|
|
||||||
CUSTOM_MATRIX \
|
CUSTOM_MATRIX \
|
||||||
DEBOUNCE_TYPE \
|
DEBOUNCE_TYPE \
|
||||||
SPLIT_KEYBOARD \
|
SPLIT_KEYBOARD \
|
||||||
|
|
@ -46,6 +45,7 @@ OTHER_OPTION_NAMES = \
|
||||||
LEADER_ENABLE \
|
LEADER_ENABLE \
|
||||||
PRINTING_ENABLE \
|
PRINTING_ENABLE \
|
||||||
STENO_ENABLE \
|
STENO_ENABLE \
|
||||||
|
STENO_PROTOCOL \
|
||||||
TAP_DANCE_ENABLE \
|
TAP_DANCE_ENABLE \
|
||||||
VIRTSER_ENABLE \
|
VIRTSER_ENABLE \
|
||||||
OLED_ENABLE \
|
OLED_ENABLE \
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ FULL_TESTS := $(notdir $(TEST_LIST))
|
||||||
include $(QUANTUM_PATH)/debounce/tests/testlist.mk
|
include $(QUANTUM_PATH)/debounce/tests/testlist.mk
|
||||||
include $(QUANTUM_PATH)/encoder/tests/testlist.mk
|
include $(QUANTUM_PATH)/encoder/tests/testlist.mk
|
||||||
include $(QUANTUM_PATH)/sequencer/tests/testlist.mk
|
include $(QUANTUM_PATH)/sequencer/tests/testlist.mk
|
||||||
|
include $(QUANTUM_PATH)/wear_leveling/tests/testlist.mk
|
||||||
include $(PLATFORM_PATH)/test/testlist.mk
|
include $(PLATFORM_PATH)/test/testlist.mk
|
||||||
|
|
||||||
define VALIDATE_TEST_LIST
|
define VALIDATE_TEST_LIST
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
"AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "bool"},
|
"AUDIO_VOICES": {"info_key": "audio.voices", "value_type": "bool"},
|
||||||
"BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "bool"},
|
"BACKLIGHT_BREATHING": {"info_key": "backlight.breathing", "value_type": "bool"},
|
||||||
"BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"},
|
"BREATHING_PERIOD": {"info_key": "backlight.breathing_period", "value_type": "int"},
|
||||||
|
"BACKLIGHT_ON_STATE": {"info_key": "backlight.on_state", "value_type": "int"},
|
||||||
"BACKLIGHT_PIN": {"info_key": "backlight.pin"},
|
"BACKLIGHT_PIN": {"info_key": "backlight.pin"},
|
||||||
"BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "bool"},
|
"BOTH_SHIFTS_TURNS_ON_CAPS_WORD": {"info_key": "caps_word.both_shifts_turns_on", "value_type": "bool"},
|
||||||
"CAPS_WORD_IDLE_TIMEOUT": {"info_key": "caps_word.idle_timeout", "value_type": "int"},
|
"CAPS_WORD_IDLE_TIMEOUT": {"info_key": "caps_word.idle_timeout", "value_type": "int"},
|
||||||
|
|
@ -35,6 +36,9 @@
|
||||||
"LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"},
|
"LED_CAPS_LOCK_PIN": {"info_key": "indicators.caps_lock"},
|
||||||
"LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"},
|
"LED_NUM_LOCK_PIN": {"info_key": "indicators.num_lock"},
|
||||||
"LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"},
|
"LED_SCROLL_LOCK_PIN": {"info_key": "indicators.scroll_lock"},
|
||||||
|
"LED_COMPOSE_PIN": {"info_key": "indicators.compose"},
|
||||||
|
"LED_KANA_PIN": {"info_key": "indicators.kana"},
|
||||||
|
"LED_PIN_ON_STATE": {"info_key": "indicators.on_state", "value_type": "int"},
|
||||||
"MANUFACTURER": {"info_key": "manufacturer"},
|
"MANUFACTURER": {"info_key": "manufacturer"},
|
||||||
"MATRIX_HAS_GHOST": {"info_key": "matrix_pins.ghost", "value_type": "bool"},
|
"MATRIX_HAS_GHOST": {"info_key": "matrix_pins.ghost", "value_type": "bool"},
|
||||||
"MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"},
|
"MATRIX_IO_DELAY": {"info_key": "matrix_pins.io_delay", "value_type": "int"},
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
"BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false},
|
"BOOTLOADER": {"info_key": "bootloader", "warn_duplicate": false},
|
||||||
"BLUETOOTH": {"info_key": "bluetooth.driver"},
|
"BLUETOOTH": {"info_key": "bluetooth.driver"},
|
||||||
"CAPS_WORD_ENABLE": {"info_key": "caps_word.enabled", "value_type": "bool"},
|
"CAPS_WORD_ENABLE": {"info_key": "caps_word.enabled", "value_type": "bool"},
|
||||||
|
"ENCODER_ENABLE": {"info_key": "encoder.enabled", "value_type": "bool"},
|
||||||
"FIRMWARE_FORMAT": {"info_key": "build.firmware_format"},
|
"FIRMWARE_FORMAT": {"info_key": "build.firmware_format"},
|
||||||
"KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"},
|
"KEYBOARD_SHARED_EP": {"info_key": "usb.shared_endpoint.keyboard", "value_type": "bool"},
|
||||||
"MOUSE_SHARED_EP": {"info_key": "usb.shared_endpoint.mouse", "value_type": "bool"},
|
"MOUSE_SHARED_EP": {"info_key": "usb.shared_endpoint.mouse", "value_type": "bool"},
|
||||||
|
|
@ -27,6 +28,8 @@
|
||||||
"SPLIT_KEYBOARD": {"info_key": "split.enabled", "value_type": "bool"},
|
"SPLIT_KEYBOARD": {"info_key": "split.enabled", "value_type": "bool"},
|
||||||
"SPLIT_TRANSPORT": {"info_key": "split.transport.protocol", "to_c": false},
|
"SPLIT_TRANSPORT": {"info_key": "split.transport.protocol", "to_c": false},
|
||||||
"WAIT_FOR_USB": {"info_key": "usb.wait_for", "value_type": "bool"},
|
"WAIT_FOR_USB": {"info_key": "usb.wait_for", "value_type": "bool"},
|
||||||
|
"STENO_ENABLE": {"info_key": "stenography.enabled", "value_type": "bool"},
|
||||||
|
"STENO_PROTOCOL": {"info_key": "stenography.protocol"},
|
||||||
|
|
||||||
# Items we want flagged in lint
|
# Items we want flagged in lint
|
||||||
"CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true},
|
"CTPC": {"info_key": "_deprecated.ctpc", "deprecated": true},
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
||||||
"$id": "qmk.definitions.v1",
|
"$id": "qmk.definitions.v1",
|
||||||
"title": "Common definitions used across QMK's jsonschemas.",
|
"title": "Common definitions used across QMK's jsonschemas.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
@ -65,8 +65,7 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"key_unit": {
|
"key_unit": {
|
||||||
"type": "number",
|
"type": "number"
|
||||||
"min": 0.25
|
|
||||||
},
|
},
|
||||||
"keyboard": {
|
"keyboard": {
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
|
|
@ -103,8 +102,11 @@
|
||||||
"pattern": "^LINE_PIN\\d{1,2}$"
|
"pattern": "^LINE_PIN\\d{1,2}$"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "number",
|
"type": "string",
|
||||||
"multipleOf": 1
|
"pattern": "^GP\\d{1,2}$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "integer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "null"
|
"type": "null"
|
||||||
|
|
@ -115,14 +117,12 @@
|
||||||
"type": "number"
|
"type": "number"
|
||||||
},
|
},
|
||||||
"signed_int": {
|
"signed_int": {
|
||||||
"type": "number",
|
"type": "integer"
|
||||||
"multipleOf": 1
|
|
||||||
},
|
},
|
||||||
"signed_int_8": {
|
"signed_int_8": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": -127,
|
"minimum": -127,
|
||||||
"max": 127,
|
"maximum": 127
|
||||||
"multipleOf": 1
|
|
||||||
},
|
},
|
||||||
"string_array": {
|
"string_array": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
|
|
@ -138,17 +138,20 @@
|
||||||
},
|
},
|
||||||
"unsigned_decimal": {
|
"unsigned_decimal": {
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"min": 0
|
"minimum": 0
|
||||||
},
|
},
|
||||||
"unsigned_int": {
|
"unsigned_int": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0
|
||||||
"multipleOf": 1
|
|
||||||
},
|
},
|
||||||
"unsigned_int_8": {
|
"unsigned_int_8": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0,
|
||||||
"max": 255,
|
"maximum": 255
|
||||||
"multipleOf": 1
|
},
|
||||||
|
"bit": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,27 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
||||||
"$id": "qmk.keyboard.v1",
|
"$id": "qmk.keyboard.v1",
|
||||||
"title": "Keyboard Information",
|
"title": "Keyboard Information",
|
||||||
|
"definitions": {
|
||||||
|
"encoder_config": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"rotary": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"required": ["pin_a", "pin_b"],
|
||||||
|
"properties": {
|
||||||
|
"pin_a": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
|
"pin_b": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
|
"resolution": {"$ref": "qmk.definitions.v1#/unsigned_int"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
"keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||||
|
|
@ -22,7 +42,7 @@
|
||||||
},
|
},
|
||||||
"processor": {
|
"processor": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66FX1M0", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L432", "STM32L433", "STM32L442", "STM32L443", "GD32VF103", "WB32F3G71", "WB32FQ95", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"]
|
"enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66FX1M0", "RP2040", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L432", "STM32L433", "STM32L442", "STM32L443", "GD32VF103", "WB32F3G71", "WB32FQ95", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"]
|
||||||
},
|
},
|
||||||
"audio": {
|
"audio": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
@ -40,12 +60,12 @@
|
||||||
"breathing": {"type": "boolean"},
|
"breathing": {"type": "boolean"},
|
||||||
"breathing_period": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"breathing_period": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
||||||
"levels": {
|
"levels": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 1,
|
"minimum": 1,
|
||||||
"max": 31,
|
"maximum": 31
|
||||||
"multipleOf": 1
|
|
||||||
},
|
},
|
||||||
"pin": {"$ref": "qmk.definitions.v1#/mcu_pin"}
|
"pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
|
"on_state": {"$ref": "qmk.definitions.v1#/bit"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bluetooth": {
|
"bluetooth": {
|
||||||
|
|
@ -66,7 +86,7 @@
|
||||||
},
|
},
|
||||||
"bootloader": {
|
"bootloader": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "custom", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "md-boot", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2"],
|
"enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "custom", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "md-boot", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2", "rp2040"],
|
||||||
},
|
},
|
||||||
"bootloader_instructions": {
|
"bootloader_instructions": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
@ -113,13 +133,22 @@
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {"$ref": "qmk.definitions.v1#/filename"}
|
"items": {"$ref": "qmk.definitions.v1#/filename"}
|
||||||
},
|
},
|
||||||
|
"encoder": {
|
||||||
|
"$ref": "#/definitions/encoder_config",
|
||||||
|
"properties": {
|
||||||
|
"enabled": {"type": "boolean"}
|
||||||
|
}
|
||||||
|
},
|
||||||
"features": {"$ref": "qmk.definitions.v1#/boolean_array"},
|
"features": {"$ref": "qmk.definitions.v1#/boolean_array"},
|
||||||
"indicators": {
|
"indicators": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"caps_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
"caps_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
"num_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
"num_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
"scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}
|
"scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
|
"compose": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
|
"kana": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
|
"on_state": {"$ref": "qmk.definitions.v1#/bit"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"layout_aliases": {
|
"layout_aliases": {
|
||||||
|
|
@ -154,12 +183,11 @@
|
||||||
"minItems": 2,
|
"minItems": 2,
|
||||||
"maxItems": 2,
|
"maxItems": 2,
|
||||||
"items": {
|
"items": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0
|
||||||
"multipleOf": 1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"r": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
"r": {"$ref": "qmk.definitions.v1#/signed_decimal"},
|
||||||
"rx": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
"rx": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
||||||
"ry": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
"ry": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
||||||
"h": {"$ref": "qmk.definitions.v1#/key_unit"},
|
"h": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||||
|
|
@ -230,14 +258,13 @@
|
||||||
"minItems": 2,
|
"minItems": 2,
|
||||||
"maxItems": 2,
|
"maxItems": 2,
|
||||||
"items": {
|
"items": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0
|
||||||
"multipleOf": 1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x": {"$ref": "qmk.definitions.v1#/key_unit"},
|
"x": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||||
"y": {"$ref": "qmk.definitions.v1#/key_unit"},
|
"y": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||||
"flags": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}
|
"flags": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -258,14 +285,13 @@
|
||||||
"minItems": 2,
|
"minItems": 2,
|
||||||
"maxItems": 2,
|
"maxItems": 2,
|
||||||
"items": {
|
"items": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0
|
||||||
"multipleOf": 1
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"x": {"$ref": "qmk.definitions.v1#/key_unit"},
|
"x": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||||
"y": {"$ref": "qmk.definitions.v1#/key_unit"},
|
"y": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||||
"flags": {"$ref": "qmk.definitions.v1#/unsigned_decimal"}
|
"flags": {"$ref": "qmk.definitions.v1#/unsigned_int_8"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -290,10 +316,9 @@
|
||||||
"blink": {"type": "boolean"},
|
"blink": {"type": "boolean"},
|
||||||
"enabled": {"type": "boolean"},
|
"enabled": {"type": "boolean"},
|
||||||
"max": {
|
"max": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 1,
|
"minimum": 1,
|
||||||
"max": 32,
|
"maximum": 32
|
||||||
"multipleOf": 1
|
|
||||||
},
|
},
|
||||||
"override_rgb": {"type": "boolean"}
|
"override_rgb": {"type": "boolean"}
|
||||||
}
|
}
|
||||||
|
|
@ -307,8 +332,8 @@
|
||||||
"split": {"type": "boolean"},
|
"split": {"type": "boolean"},
|
||||||
"split_count": {
|
"split_count": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"minLength": 2,
|
"minItems": 2,
|
||||||
"maxLength": 2,
|
"maxItems": 2,
|
||||||
"items": {"$ref": "qmk.definitions.v1#/unsigned_int"}
|
"items": {"$ref": "qmk.definitions.v1#/unsigned_int"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -322,21 +347,31 @@
|
||||||
"idle_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
"idle_timeout": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||||
"unlock_sequence": {
|
"unlock_sequence": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"minLength": 1,
|
"minItems": 1,
|
||||||
"maxLength": 5,
|
"maxItems": 5,
|
||||||
"items": {
|
"items": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"minItems": 2,
|
"minItems": 2,
|
||||||
"maxItems": 2,
|
"maxItems": 2,
|
||||||
"items": {
|
"items": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0
|
||||||
"multipleOf": 1
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"stenography": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"enabled": {"type": "boolean"},
|
||||||
|
"protocol": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["all", "geminipr", "txbolt"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"split": {
|
"split": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
|
|
@ -365,16 +400,24 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"encoder": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": false,
|
||||||
|
"properties": {
|
||||||
|
"right": {
|
||||||
|
"$ref": "#/definitions/encoder_config"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"main": {
|
"main": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": ["eeprom", "left", "matrix_grid", "pin", "right"]
|
"enum": ["eeprom", "left", "matrix_grid", "pin", "right"]
|
||||||
},
|
},
|
||||||
"soft_serial_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
"soft_serial_pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||||
"soft_serial_speed": {
|
"soft_serial_speed": {
|
||||||
"type": "number",
|
"type": "integer",
|
||||||
"min": 0,
|
"minimum": 0,
|
||||||
"max": 5,
|
"maximum": 5
|
||||||
"multipleOf": 1
|
|
||||||
},
|
},
|
||||||
"transport": {
|
"transport": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
@ -428,7 +471,7 @@
|
||||||
"force_nkro": {"type": "boolean"},
|
"force_nkro": {"type": "boolean"},
|
||||||
"pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
"pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||||
"vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
"vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||||
"max_power": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"max_power": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||||
"no_startup_check": {"type": "boolean"},
|
"no_startup_check": {"type": "boolean"},
|
||||||
"polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"polling_interval": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
||||||
"shared_endpoint": {
|
"shared_endpoint": {
|
||||||
|
|
@ -439,7 +482,7 @@
|
||||||
"mouse": {"type": "boolean"}
|
"mouse": {"type": "boolean"}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"suspend_wakeup_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||||
"wait_for": {"type": "boolean"},
|
"wait_for": {"type": "boolean"},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -448,8 +491,8 @@
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"properties": {
|
"properties": {
|
||||||
"keys_per_scan": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"keys_per_scan": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
||||||
"tap_keycode_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"tap_keycode_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||||
"tap_capslock_delay": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
"tap_capslock_delay": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"qmk_lufa_bootloader": {
|
"qmk_lufa_bootloader": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
||||||
"$id": "qmk.keymap.v1",
|
"$id": "qmk.keymap.v1",
|
||||||
"title": "Keymap Information",
|
"title": "Keymap Information",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
@ -50,8 +50,7 @@
|
||||||
},
|
},
|
||||||
"config": {"$ref": "qmk.keyboard.v1"},
|
"config": {"$ref": "qmk.keyboard.v1"},
|
||||||
"notes": {
|
"notes": {
|
||||||
"type": "string",
|
"type": "string"
|
||||||
"description": "asdf"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,6 @@
|
||||||
* [Swap Hands](feature_swap_hands.md)
|
* [Swap Hands](feature_swap_hands.md)
|
||||||
* [Tap Dance](feature_tap_dance.md)
|
* [Tap Dance](feature_tap_dance.md)
|
||||||
* [Tap-Hold Configuration](tap_hold.md)
|
* [Tap-Hold Configuration](tap_hold.md)
|
||||||
* [Terminal](feature_terminal.md)
|
|
||||||
* [Unicode](feature_unicode.md)
|
* [Unicode](feature_unicode.md)
|
||||||
* [Userspace](feature_userspace.md)
|
* [Userspace](feature_userspace.md)
|
||||||
* [WPM Calculation](feature_wpm.md)
|
* [WPM Calculation](feature_wpm.md)
|
||||||
|
|
@ -147,6 +146,7 @@
|
||||||
* [SPI Driver](spi_driver.md)
|
* [SPI Driver](spi_driver.md)
|
||||||
* [WS2812 Driver](ws2812_driver.md)
|
* [WS2812 Driver](ws2812_driver.md)
|
||||||
* [EEPROM Driver](eeprom_driver.md)
|
* [EEPROM Driver](eeprom_driver.md)
|
||||||
|
* [Flash Driver](flash_driver.md)
|
||||||
* ['serial' Driver](serial_driver.md)
|
* ['serial' Driver](serial_driver.md)
|
||||||
* [UART Driver](uart_driver.md)
|
* [UART Driver](uart_driver.md)
|
||||||
* [GPIO Controls](gpio_control.md)
|
* [GPIO Controls](gpio_control.md)
|
||||||
|
|
@ -165,6 +165,7 @@
|
||||||
* Arm/ChibiOS
|
* Arm/ChibiOS
|
||||||
* [Selecting an MCU](platformdev_selecting_arm_mcu.md)
|
* [Selecting an MCU](platformdev_selecting_arm_mcu.md)
|
||||||
* [Early initialization](platformdev_chibios_earlyinit.md)
|
* [Early initialization](platformdev_chibios_earlyinit.md)
|
||||||
|
* [Raspberry Pi RP2040](platformdev_rp2040.md)
|
||||||
|
|
||||||
* QMK Reference
|
* QMK Reference
|
||||||
* [Contributing to QMK](contributing.md)
|
* [Contributing to QMK](contributing.md)
|
||||||
|
|
|
||||||
|
|
@ -65,6 +65,12 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s
|
||||||
* [MK66FX1M0](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k6x-ethernet/kinetis-k66-180-mhz-dual-high-speed-full-speed-usbs-2mb-flash-microcontrollers-mcus-based-on-arm-cortex-m4-core:K66_180)
|
* [MK66FX1M0](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k6x-ethernet/kinetis-k66-180-mhz-dual-high-speed-full-speed-usbs-2mb-flash-microcontrollers-mcus-based-on-arm-cortex-m4-core:K66_180)
|
||||||
* PJRC Teensy 3.6
|
* PJRC Teensy 3.6
|
||||||
|
|
||||||
|
### Raspberry Pi
|
||||||
|
|
||||||
|
* [RP2040](https://www.raspberrypi.com/documentation/microcontrollers/rp2040.html)
|
||||||
|
|
||||||
|
For a detailed overview about the RP2040 support by QMK see the [dedicated RP2040 page](platformdev_rp2040.md).
|
||||||
|
|
||||||
## Atmel ATSAM
|
## Atmel ATSAM
|
||||||
|
|
||||||
There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop). However, it is not recommended to design a board with this microcontroller as the support is quite specialized to Massdrop hardware.
|
There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop). However, it is not recommended to design a board with this microcontroller as the support is quite specialized to Massdrop hardware.
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ If you define these options you will enable the associated feature, which may in
|
||||||
## Behaviors That Can Be Configured
|
## Behaviors That Can Be Configured
|
||||||
|
|
||||||
* `#define TAPPING_TERM 200`
|
* `#define TAPPING_TERM 200`
|
||||||
* how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too
|
* how long before a key press becomes a hold
|
||||||
* `#define TAPPING_TERM_PER_KEY`
|
* `#define TAPPING_TERM_PER_KEY`
|
||||||
* enables handling for per key `TAPPING_TERM` settings
|
* enables handling for per key `TAPPING_TERM` settings
|
||||||
* `#define RETRO_TAPPING`
|
* `#define RETRO_TAPPING`
|
||||||
|
|
@ -174,6 +174,8 @@ If you define these options you will enable the associated feature, which may in
|
||||||
* sets the timer for leader key chords to run on each key press rather than overall
|
* sets the timer for leader key chords to run on each key press rather than overall
|
||||||
* `#define LEADER_KEY_STRICT_KEY_PROCESSING`
|
* `#define LEADER_KEY_STRICT_KEY_PROCESSING`
|
||||||
* Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify `MT(MOD_CTL, KC_A)` if you want to use `KC_A`.
|
* Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify `MT(MOD_CTL, KC_A)` if you want to use `KC_A`.
|
||||||
|
* `#define MOUSE_EXTENDED_REPORT`
|
||||||
|
* Enables support for extended reports (-32767 to 32767, instead of -127 to 127), which may allow for smoother reporting, and prevent maxing out of the reports. Applies to both Pointing Device and Mousekeys.
|
||||||
* `#define ONESHOT_TIMEOUT 300`
|
* `#define ONESHOT_TIMEOUT 300`
|
||||||
* how long before oneshot times out
|
* how long before oneshot times out
|
||||||
* `#define ONESHOT_TAP_TOGGLE 2`
|
* `#define ONESHOT_TAP_TOGGLE 2`
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.
|
The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.
|
||||||
|
|
||||||
|
Selecting the EEPROM driver is done in your keyboard's `rules.mk`:
|
||||||
|
|
||||||
Driver | Description
|
Driver | Description
|
||||||
-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below.
|
`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below.
|
||||||
`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below.
|
`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below.
|
||||||
`EEPROM_DRIVER = spi` | Supports writing to SPI-based 25xx EEPROM chips. See the driver section below.
|
`EEPROM_DRIVER = spi` | Supports writing to SPI-based 25xx EEPROM chips. See the driver section below.
|
||||||
`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost.
|
`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost.
|
||||||
|
`EEPROM_DRIVER = wear_leveling` | Frontend driver for the wear_leveling system, allowing for EEPROM emulation on top of flash -- both in-MCU and external SPI NOR flash.
|
||||||
|
|
||||||
## Vendor Driver Configuration :id=vendor-eeprom-driver-configuration
|
## Vendor Driver Configuration :id=vendor-eeprom-driver-configuration
|
||||||
|
|
||||||
|
|
@ -43,8 +46,9 @@ Module | Equivalent `#define` | Source
|
||||||
-----------------|---------------------------------|------------------------------------------
|
-----------------|---------------------------------|------------------------------------------
|
||||||
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
|
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
|
||||||
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
|
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
|
||||||
24LC64 EEPROM | `#define EEPROM_I2C_24LC64` | <https://www.microchip.com/wwwproducts/en/24LC64>
|
24LC32A EEPROM | `#define EEPROM_I2C_24LC32A` | <https://www.microchip.com/en-us/product/24LC32A>
|
||||||
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/wwwproducts/en/24LC128>
|
24LC64 EEPROM | `#define EEPROM_I2C_24LC64` | <https://www.microchip.com/en-us/product/24LC64>
|
||||||
|
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/en-us/product/24LC128>
|
||||||
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
|
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
|
||||||
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
|
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
|
||||||
|
|
||||||
|
|
@ -54,13 +58,13 @@ MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/p
|
||||||
|
|
||||||
Currently QMK supports 25xx-series chips over SPI. As such, requires a working spi_master driver configuration. You can override the driver configuration via your config.h:
|
Currently QMK supports 25xx-series chips over SPI. As such, requires a working spi_master driver configuration. You can override the driver configuration via your config.h:
|
||||||
|
|
||||||
`config.h` override | Description | Default Value
|
`config.h` override | Default Value | Description
|
||||||
-----------------------------------------------|--------------------------------------------------------------------------------------|--------------
|
-----------------------------------------------|---------------|-------------------------------------------------------------------------------------
|
||||||
`#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN` | SPI Slave select pin in order to inform that the EEPROM is currently being addressed | _none_
|
`#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN` | _none_ | SPI Slave select pin in order to inform that the EEPROM is currently being addressed
|
||||||
`#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR` | Clock divisor used to divide the peripheral clock to derive the SPI frequency | `64`
|
`#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR` | `64` | Clock divisor used to divide the peripheral clock to derive the SPI frequency
|
||||||
`#define EXTERNAL_EEPROM_BYTE_COUNT` | Total size of the EEPROM in bytes | 8192
|
`#define EXTERNAL_EEPROM_BYTE_COUNT` | `8192` | Total size of the EEPROM in bytes
|
||||||
`#define EXTERNAL_EEPROM_PAGE_SIZE` | Page size of the EEPROM in bytes, as specified in the datasheet | 32
|
`#define EXTERNAL_EEPROM_PAGE_SIZE` | `32` | Page size of the EEPROM in bytes, as specified in the datasheet
|
||||||
`#define EXTERNAL_EEPROM_ADDRESS_SIZE` | The number of bytes to transmit for the memory location within the EEPROM | 2
|
`#define EXTERNAL_EEPROM_ADDRESS_SIZE` | `2` | The number of bytes to transmit for the memory location within the EEPROM
|
||||||
|
|
||||||
!> There's no way to determine if there is an SPI EEPROM actually responding. Generally, this will result in reads of nothing but zero.
|
!> There's no way to determine if there is an SPI EEPROM actually responding. Generally, this will result in reads of nothing but zero.
|
||||||
|
|
||||||
|
|
@ -73,3 +77,69 @@ The only configurable item for the transient EEPROM driver is its size:
|
||||||
`#define TRANSIENT_EEPROM_SIZE` | Total size of the EEPROM storage in bytes | 64
|
`#define TRANSIENT_EEPROM_SIZE` | Total size of the EEPROM storage in bytes | 64
|
||||||
|
|
||||||
Default values and extended descriptions can be found in `drivers/eeprom/eeprom_transient.h`.
|
Default values and extended descriptions can be found in `drivers/eeprom/eeprom_transient.h`.
|
||||||
|
|
||||||
|
## Wear-leveling Driver Configuration :id=wear_leveling-eeprom-driver-configuration
|
||||||
|
|
||||||
|
The wear-leveling driver uses an algorithm to minimise the number of erase cycles on the underlying MCU flash memory.
|
||||||
|
|
||||||
|
There is no specific configuration for this driver, but the wear-leveling system used by this driver may need configuration. See the [wear-leveling configuration](#wear_leveling-configuration) section for more information.
|
||||||
|
|
||||||
|
# Wear-leveling Configuration :id=wear_leveling-configuration
|
||||||
|
|
||||||
|
The wear-leveling driver has a few possible _backing stores_ that may be used by adding to your keyboard's `rules.mk` file:
|
||||||
|
|
||||||
|
Driver | Description
|
||||||
|
----------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
`WEAR_LEVELING_DRIVER = embedded_flash` | This driver is used for emulating EEPROM by writing to embedded flash on the MCU.
|
||||||
|
`WEAR_LEVELING_DRIVER = spi_flash` | This driver is used to address external SPI NOR Flash peripherals.
|
||||||
|
`WEAR_LEVELING_DRIVER = legacy` | This driver is the "legacy" emulated EEPROM provided in historical revisions of QMK. Currently used for STM32F0xx and STM32F4x1, but slated for deprecation and removal once `embedded_flash` support for those MCU families is complete.
|
||||||
|
|
||||||
|
!> All wear-leveling drivers require an amount of RAM equivalent to the selected logical EEPROM size. Increasing the size to 32kB of EEPROM requires 32kB of RAM, which a significant number of MCUs simply do not have.
|
||||||
|
|
||||||
|
## Wear-leveling Embedded Flash Driver Configuration :id=wear_leveling-efl-driver-configuration
|
||||||
|
|
||||||
|
This driver performs writes to the embedded flash storage embedded in the MCU. In most circumstances, the last few of sectors of flash are used in order to minimise the likelihood of collision with program code.
|
||||||
|
|
||||||
|
Configurable options in your keyboard's `config.h`:
|
||||||
|
|
||||||
|
`config.h` override | Default | Description
|
||||||
|
-----------------------------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
`#define WEAR_LEVELING_EFL_FIRST_SECTOR` | _unset_ | The first sector on the MCU to use. By default this is not defined and calculated at runtime based on the MCU. However, different flash sizes on MCUs may require custom configuration.
|
||||||
|
`#define WEAR_LEVELING_EFL_FLASH_SIZE` | _unset_ | Allows overriding the flash size available for use for wear-leveling. Under normal circumstances this is automatically calculated and should not need to be overridden. Specifying a size larger than the amount actually available in flash will usually prevent the MCU from booting.
|
||||||
|
`#define WEAR_LEVELING_LOGICAL_SIZE` | `1024` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM.
|
||||||
|
`#define WEAR_LEVELING_BACKING_SIZE` | `2048` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size.
|
||||||
|
`#define BACKING_STORE_WRITE_SIZE` | _automatic_ | The byte width of the underlying write used on the MCU, and is usually automatically determined from the selected MCU family. If an error occurs in the auto-detection, you'll need to consult the MCU's datasheet and determine this value, specifying it directly.
|
||||||
|
|
||||||
|
!> If your MCU does not boot after swapping to the EFL wear-leveling driver, it's likely that the flash size is incorrectly detected, usually as an MCU with larger flash and may require overriding.
|
||||||
|
|
||||||
|
## Wear-leveling SPI Flash Driver Configuration :id=wear_leveling-flash_spi-driver-configuration
|
||||||
|
|
||||||
|
This driver performs writes to an external SPI NOR Flash peripheral. It also requires a working configuration for the SPI NOR Flash peripheral -- see the [flash driver](flash_driver.md) documentation for more information.
|
||||||
|
|
||||||
|
Configurable options in your keyboard's `config.h`:
|
||||||
|
|
||||||
|
`config.h` override | Default | Description
|
||||||
|
----------------------------------------------------|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
`#define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT` | `1` | Number of blocks in the external flash used by the wear-leveling algorithm.
|
||||||
|
`#define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET` | `0` | The index first block in the external flash used by the wear-leveling algorithm.
|
||||||
|
`#define WEAR_LEVELING_LOGICAL_SIZE` | `((block_count*block_size)/2)` | Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM. Result must be <= 64kB.
|
||||||
|
`#define WEAR_LEVELING_BACKING_SIZE` | `(block_count*block_size)` | Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size.
|
||||||
|
`#define BACKING_STORE_WRITE_SIZE` | `8` | The write width used whenever a write is performed on the external flash peripheral.
|
||||||
|
|
||||||
|
!> There is currently a limit of 64kB for the EEPROM subsystem within QMK, so using a larger flash is not going to be beneficial as the logical size cannot be increased beyond 65536. The backing size may be increased to a larger value, but erase timing may suffer as a result.
|
||||||
|
|
||||||
|
## Wear-leveling Legacy EEPROM Emulation Driver Configuration :id=wear_leveling-legacy-driver-configuration
|
||||||
|
|
||||||
|
This driver performs writes to the embedded flash storage embedded in the MCU much like the normal Embedded Flash Driver, and is only for use with STM32F0xx and STM32F4x1 devices. This flash implementation is still currently provided as the EFL driver is currently non-functional for the previously mentioned families.
|
||||||
|
|
||||||
|
By default, `1024` bytes of emulated EEPROM is provided:
|
||||||
|
|
||||||
|
MCU | EEPROM Provided | Flash Used
|
||||||
|
----------|-----------------|--------------
|
||||||
|
STM32F042 | `1024` bytes | `2048` bytes
|
||||||
|
STM32F070 | `1024` bytes | `2048` bytes
|
||||||
|
STM32F072 | `1024` bytes | `2048` bytes
|
||||||
|
STM32F401 | `1024` bytes | `16384` bytes
|
||||||
|
STM32F411 | `1024` bytes | `16384` bytes
|
||||||
|
|
||||||
|
Under normal circumstances configuration of this driver requires intimate knowledge of the MCU's flash structure -- reconfiguration is at your own risk and will require referring to the code.
|
||||||
|
|
@ -87,9 +87,9 @@ This is an extension of the accelerated mode. The kinetic mode uses a quadratic
|
||||||
|`MK_KINETIC_SPEED` |undefined|Enable kinetic mode |
|
|`MK_KINETIC_SPEED` |undefined|Enable kinetic mode |
|
||||||
|`MOUSEKEY_DELAY` |5 |Delay between pressing a movement key and cursor movement |
|
|`MOUSEKEY_DELAY` |5 |Delay between pressing a movement key and cursor movement |
|
||||||
|`MOUSEKEY_INTERVAL` |10 |Time between cursor movements in milliseconds |
|
|`MOUSEKEY_INTERVAL` |10 |Time between cursor movements in milliseconds |
|
||||||
|`MOUSEKEY_MOVE_DELTA` |5 |Step size for accelerating from initial to base speed |
|
|`MOUSEKEY_MOVE_DELTA` |16 |Step size for accelerating from initial to base speed |
|
||||||
|`MOUSEKEY_INITIAL_SPEED` |100 |Initial speed of the cursor in pixel per second |
|
|`MOUSEKEY_INITIAL_SPEED` |100 |Initial speed of the cursor in pixel per second |
|
||||||
|`MOUSEKEY_BASE_SPEED` |1000 |Maximum cursor speed at which acceleration stops |
|
|`MOUSEKEY_BASE_SPEED` |5000 |Maximum cursor speed at which acceleration stops |
|
||||||
|`MOUSEKEY_DECELERATED_SPEED` |400 |Decelerated cursor speed |
|
|`MOUSEKEY_DECELERATED_SPEED` |400 |Decelerated cursor speed |
|
||||||
|`MOUSEKEY_ACCELERATED_SPEED` |3000 |Accelerated cursor speed |
|
|`MOUSEKEY_ACCELERATED_SPEED` |3000 |Accelerated cursor speed |
|
||||||
|`MOUSEKEY_WHEEL_INITIAL_MOVEMENTS` |16 |Initial number of movements of the mouse wheel |
|
|`MOUSEKEY_WHEEL_INITIAL_MOVEMENTS` |16 |Initial number of movements of the mouse wheel |
|
||||||
|
|
@ -100,7 +100,7 @@ This is an extension of the accelerated mode. The kinetic mode uses a quadratic
|
||||||
Tips:
|
Tips:
|
||||||
|
|
||||||
* The smoothness of the cursor movement depends on the `MOUSEKEY_INTERVAL` setting. The shorter the interval is set the smoother the movement will be. Setting the value too low makes the cursor unresponsive. Lower settings are possible if the micro processor is fast enough. For example: At an interval of `8` milliseconds, `125` movements per second will be initiated. With a base speed of `1000` each movement will move the cursor by `8` pixels.
|
* The smoothness of the cursor movement depends on the `MOUSEKEY_INTERVAL` setting. The shorter the interval is set the smoother the movement will be. Setting the value too low makes the cursor unresponsive. Lower settings are possible if the micro processor is fast enough. For example: At an interval of `8` milliseconds, `125` movements per second will be initiated. With a base speed of `1000` each movement will move the cursor by `8` pixels.
|
||||||
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `1`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
|
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `2`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
|
||||||
|
|
||||||
### Constant mode
|
### Constant mode
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ The Analog Joystick is an analog (ADC) driven sensor. There are a variety of jo
|
||||||
|`ANALOG_JOYSTICK_SPEED_MAX` | (Optional) The maximum value used for motion. | `2` |
|
|`ANALOG_JOYSTICK_SPEED_MAX` | (Optional) The maximum value used for motion. | `2` |
|
||||||
|`ANALOG_JOYSTICK_CLICK_PIN` | (Optional) The pin wired up to the press switch of the analog stick. | _not defined_ |
|
|`ANALOG_JOYSTICK_CLICK_PIN` | (Optional) The pin wired up to the press switch of the analog stick. | _not defined_ |
|
||||||
|
|
||||||
|
|
||||||
### Cirque Trackpad
|
### Cirque Trackpad
|
||||||
|
|
||||||
To use the Cirque Trackpad sensor, add this to your `rules.mk`:
|
To use the Cirque Trackpad sensor, add this to your `rules.mk`:
|
||||||
|
|
@ -90,30 +89,42 @@ POINTING_DEVICE_DRIVER = cirque_pinnacle_spi
|
||||||
|
|
||||||
This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the TM040040, TM035035 and the TM023023 trackpads. These are I2C or SPI compatible, and both configurations are supported.
|
This supports the Cirque Pinnacle 1CA027 Touch Controller, which is used in the TM040040, TM035035 and the TM023023 trackpads. These are I2C or SPI compatible, and both configurations are supported.
|
||||||
|
|
||||||
| Setting | Description | Default |
|
| Setting | Description | Default |
|
||||||
|---------------------------------|---------------------------------------------------------------------------------|-----------------------|
|
|-------------------------------- |-----------------------------------------------------------------------|--------------------- |
|
||||||
|`CIRQUE_PINNACLE_X_LOWER` | (Optional) The minimum reachable X value on the sensor. | `127` |
|
|`CIRQUE_PINNACLE_X_LOWER` | (Optional) The minimum reachable X value on the sensor. | `127` |
|
||||||
|`CIRQUE_PINNACLE_X_UPPER` | (Optional) The maximum reachable X value on the sensor. | `1919` |
|
|`CIRQUE_PINNACLE_X_UPPER` | (Optional) The maximum reachable X value on the sensor. | `1919` |
|
||||||
|`CIRQUE_PINNACLE_Y_LOWER` | (Optional) The minimum reachable Y value on the sensor. | `63` |
|
|`CIRQUE_PINNACLE_Y_LOWER` | (Optional) The minimum reachable Y value on the sensor. | `63` |
|
||||||
|`CIRQUE_PINNACLE_Y_UPPER` | (Optional) The maximum reachable Y value on the sensor. | `1471` |
|
|`CIRQUE_PINNACLE_Y_UPPER` | (Optional) The maximum reachable Y value on the sensor. | `1471` |
|
||||||
|`CIRQUE_PINNACLE_TAPPING_TERM` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|
|`CIRQUE_PINNACLE_ATTENUATION` | (Optional) Sets the attenuation of the sensor data. | `ADC_ATTENUATE_4X` |
|
||||||
|`CIRQUE_PINNACLE_TOUCH_DEBOUNCE` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|
|`CIRQUE_PINNACLE_TAPPING_TERM` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|
||||||
|
|`CIRQUE_PINNACLE_TOUCH_DEBOUNCE` | (Optional) Length of time that a touch can be to be considered a tap. | `TAPPING_TERM`/`200` |
|
||||||
|
|
||||||
|
**`CIRQUE_PINNACLE_ATTENUATION`** is a measure of how much data is suppressed in regards to sensitivity. The higher the attenuation, the less sensitive the touchpad will be.
|
||||||
|
|
||||||
|
Default attenuation is set to 4X, although if you are using a thicker overlay (such as the curved overlay) you will want a lower attenuation such as 2X. The possible values are:
|
||||||
|
* `ADC_ATTENUATE_4X`: Least sensitive
|
||||||
|
* `ADC_ATTENUATE_3X`
|
||||||
|
* `ADC_ATTENUATE_2X`
|
||||||
|
* `ADC_ATTENUATE_1X`: Most sensitive
|
||||||
|
|
||||||
| I2C Setting | Description | Default |
|
| I2C Setting | Description | Default |
|
||||||
|--------------------------|---------------------------------------------------------------------------------|---------|
|
|--------------------------|---------------------------------------------------------------------------------|---------|
|
||||||
|`CIRQUE_PINNACLE_ADDR` | (Required) Sets the I2C Address for the Cirque Trackpad | `0x2A` |
|
|`CIRQUE_PINNACLE_ADDR` | (Required) Sets the I2C Address for the Cirque Trackpad | `0x2A` |
|
||||||
|`CIRQUE_PINNACLE_TIMEOUT` | (Optional) The timeout for i2c communication with the trackpad in milliseconds. | `20` |
|
|`CIRQUE_PINNACLE_TIMEOUT` | (Optional) The timeout for i2c communication with the trackpad in milliseconds. | `20` |
|
||||||
|
|
||||||
| SPI Setting | Description | Default |
|
| SPI Setting | Description | Default |
|
||||||
|-------------------------------|------------------------------------------------------------------------|---------------|
|
|-------------------------------|------------------------------------------------------------------------|----------------|
|
||||||
|`CIRQUE_PINNACLE_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `1000000` |
|
|`CIRQUE_PINNACLE_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `1000000` |
|
||||||
|`CIRQUE_PINNACLE_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` |
|
|`CIRQUE_PINNACLE_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` |
|
||||||
|`CIRQUE_PINNACLE_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `1` |
|
|`CIRQUE_PINNACLE_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `1` |
|
||||||
|`CIRQUE_PINNACLE_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ |
|
|`CIRQUE_PINNACLE_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ |
|
||||||
|`CIRQUE_PINNACLE_SPI_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ |
|
|`CIRQUE_PINNACLE_SPI_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ |
|
||||||
|
|
||||||
Default Scaling/CPI is 1024.
|
Default Scaling/CPI is 1024.
|
||||||
|
|
||||||
|
Also see the `POINTING_DEVICE_TASK_THROTTLE_MS`, which defaults to 10ms when using Cirque Pinnacle, which matches the internal update rate of the position registers (in standard configuration). Advanced configuration for pen/stylus usage might require lower values.
|
||||||
|
|
||||||
|
|
||||||
### Pimoroni Trackball
|
### Pimoroni Trackball
|
||||||
|
|
||||||
To use the Pimoroni Trackball module, add this to your `rules.mk`:
|
To use the Pimoroni Trackball module, add this to your `rules.mk`:
|
||||||
|
|
@ -259,6 +270,7 @@ The following configuration options are only available when using `SPLIT_POINTIN
|
||||||
|`POINTING_DEVICE_ROTATION_270_RIGHT` | (Optional) Rotates the X and Y data by 270 degrees. | _not defined_ |
|
|`POINTING_DEVICE_ROTATION_270_RIGHT` | (Optional) Rotates the X and Y data by 270 degrees. | _not defined_ |
|
||||||
|`POINTING_DEVICE_INVERT_X_RIGHT` | (Optional) Inverts the X axis report. | _not defined_ |
|
|`POINTING_DEVICE_INVERT_X_RIGHT` | (Optional) Inverts the X axis report. | _not defined_ |
|
||||||
|`POINTING_DEVICE_INVERT_Y_RIGHT` | (Optional) Inverts the Y axis report. | _not defined_ |
|
|`POINTING_DEVICE_INVERT_Y_RIGHT` | (Optional) Inverts the Y axis report. | _not defined_ |
|
||||||
|
|`MOUSE_EXTENDED_REPORT` | (Optional) Enables support for extended mouse reports. (-32767 to 32767, instead of just -127 to 127) |
|
||||||
|
|
||||||
!> If there is a `_RIGHT` configuration option or callback, the [common configuration](feature_pointing_device.md?id=common-configuration) option will work for the left. For correct left/right detection you should setup a [handedness option](feature_split_keyboard?id=setting-handedness), `EE_HANDS` is usually a good option for an existing board that doesn't do handedness by hardware.
|
!> If there is a `_RIGHT` configuration option or callback, the [common configuration](feature_pointing_device.md?id=common-configuration) option will work for the left. For correct left/right detection you should setup a [handedness option](feature_split_keyboard?id=setting-handedness), `EE_HANDS` is usually a good option for an existing board that doesn't do handedness by hardware.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ You can use between 1 and 4 IS31FL3733 IC's. Do not specify `DRIVER_ADDR_<N>` de
|
||||||
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
|
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
|
||||||
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
|
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
|
||||||
| `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3733B only | 0 |
|
| `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3733B only | 0 |
|
||||||
|
| `ISSI_GLOBALCURRENT` | (Optional) Configuration for the Global Current Register | 0xFF |
|
||||||
| `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
| `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
||||||
| `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
| `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
||||||
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
|
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
|
||||||
|
|
@ -172,6 +173,7 @@ Configure the hardware via your `config.h`:
|
||||||
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
|
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
|
||||||
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
|
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
|
||||||
| `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3737B only | 0 |
|
| `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3737B only | 0 |
|
||||||
|
| `ISSI_GLOBALCURRENT` | (Optional) Configuration for the Global Current Register | 0xFF |
|
||||||
| `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
| `ISSI_SWPULLUP` | (Optional) Set the value of the SWx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
||||||
| `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
| `ISSI_CSPULLUP` | (Optional) Set the value of the CSx lines on-chip de-ghosting resistors | PUR_0R (Disabled) |
|
||||||
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
|
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
|
||||||
|
|
@ -409,6 +411,7 @@ You can use up to 2 AW20216 IC's. Do not specify `DRIVER_<N>_xxx` defines for IC
|
||||||
| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
|
| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
|
||||||
| `AW_SCALING_MAX` | (Optional) LED current scaling value (0-255, higher values mean LED is brighter at full PWM) | 150 |
|
| `AW_SCALING_MAX` | (Optional) LED current scaling value (0-255, higher values mean LED is brighter at full PWM) | 150 |
|
||||||
| `AW_GLOBAL_CURRENT_MAX` | (Optional) Driver global current limit (0-255, higher values means the driver may consume more power) | 150 |
|
| `AW_GLOBAL_CURRENT_MAX` | (Optional) Driver global current limit (0-255, higher values means the driver may consume more power) | 150 |
|
||||||
|
| `AW_SPI_MODE` | (Optional) Mode for SPI communication (0-3, defines polarity and phase of the clock) | 3 |
|
||||||
| `AW_SPI_DIVISOR` | (Optional) Clock divisor for SPI communication (powers of 2, smaller numbers means faster communication, should not be less than 4) | 4 |
|
| `AW_SPI_DIVISOR` | (Optional) Clock divisor for SPI communication (powers of 2, smaller numbers means faster communication, should not be less than 4) | 4 |
|
||||||
|
|
||||||
Here is an example using 2 drivers.
|
Here is an example using 2 drivers.
|
||||||
|
|
@ -665,7 +668,22 @@ In order to change the delay of temperature decrease define `RGB_MATRIX_TYPING_H
|
||||||
#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50
|
#define RGB_MATRIX_TYPING_HEATMAP_DECREASE_DELAY_MS 50
|
||||||
```
|
```
|
||||||
|
|
||||||
Heatmap effect may not light up the correct adjacent LEDs for certain key matrix layout such as split keyboards. The following define will limit the effect to pressed keys only:
|
As heatmap uses the physical position of the leds set in the g_led_config, you may need to tweak the following options to get the best effect for your keyboard. Note the size of this grid is `224x64`.
|
||||||
|
|
||||||
|
Limit the distance the effect spreads to surrounding keys.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define RGB_MATRIX_TYPING_HEATMAP_SPREAD 40
|
||||||
|
```
|
||||||
|
|
||||||
|
Limit how hot surrounding keys get from each press.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define RGB_MATRIX_TYPING_HEATMAP_AREA_LIMIT 16
|
||||||
|
```
|
||||||
|
|
||||||
|
Remove the spread effect entirely.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define RGB_MATRIX_TYPING_HEATMAP_SLIM
|
#define RGB_MATRIX_TYPING_HEATMAP_SLIM
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,9 @@ Next, you will have to flash the EEPROM files once for the correct hand to the c
|
||||||
* ARM controllers with a DFU compatible bootloader (e.g. Proton-C):
|
* ARM controllers with a DFU compatible bootloader (e.g. Proton-C):
|
||||||
* `:dfu-util-split-left`
|
* `:dfu-util-split-left`
|
||||||
* `:dfu-util-split-right`
|
* `:dfu-util-split-right`
|
||||||
|
* ARM controllers with a UF2 compatible bootloader:
|
||||||
|
* `:uf2-split-left`
|
||||||
|
* `:uf2-split-right`
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
|
@ -367,7 +370,7 @@ There are some settings that you may need to configure, based on how the hardwar
|
||||||
#define MATRIX_COL_PINS_RIGHT { <col pins> }
|
#define MATRIX_COL_PINS_RIGHT { <col pins> }
|
||||||
```
|
```
|
||||||
|
|
||||||
This allows you to specify a different set of pins for the matrix on the right side. This is useful if you have a board with differently-shaped halves that requires a different configuration (such as Keebio's Quefrency).
|
This allows you to specify a different set of pins for the matrix on the right side. This is useful if you have a board with differently-shaped halves that requires a different configuration (such as Keebio's Quefrency). The number of pins in the right and left matrices must be the same, if you have a board with a different number of rows or columns on one side, pad out the extra spaces with `NO_PIN` and make sure you add the unused rows or columns to your matrix.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }
|
#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }
|
||||||
|
|
|
||||||
|
|
@ -8,46 +8,107 @@ The [Open Steno Project](https://www.openstenoproject.org/) has built an open-so
|
||||||
|
|
||||||
Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar.
|
Plover can work with any standard QWERTY keyboard, although it is more efficient if the keyboard supports NKRO (n-key rollover) to allow Plover to see all the pressed keys at once. An example keymap for Plover can be found in `planck/keymaps/default`. Switching to the `PLOVER` layer adjusts the position of the keyboard to support the number bar.
|
||||||
|
|
||||||
To use Plover with QMK just enable NKRO and optionally adjust your layout if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys.
|
To enable NKRO, add `NKRO_ENABLE = yes` in your `rules.mk` and make sure to press `NK_ON` to turn it on because `NKRO_ENABLE = yes` merely adds the possibility of switching to NKRO mode but it doesn't automatically switch to it. If you want to automatically switch, add `#define FORCE_NKRO` in your `config.h`.
|
||||||
|
|
||||||
|
You may also need to adjust your layout, either in QMK or in Plover, if you have anything other than a standard layout. You may also want to purchase some steno-friendly keycaps to make it easier to hit multiple keys.
|
||||||
|
|
||||||
## Plover with Steno Protocol :id=plover-with-steno-protocol
|
## Plover with Steno Protocol :id=plover-with-steno-protocol
|
||||||
|
|
||||||
Plover also understands the language of several steno machines. QMK can speak a couple of these languages, TX Bolt and GeminiPR. An example layout can be found in `planck/keymaps/steno`.
|
Plover also understands the language of several steno machines. QMK can speak a couple of these languages: TX Bolt and GeminiPR. An example layout can be found in `planck/keymaps/steno`.
|
||||||
|
|
||||||
When QMK speaks to Plover over a steno protocol Plover will not use the keyboard as input. This means that you can switch back and forth between a standard keyboard and your steno keyboard, or even switch layers from Plover to standard and back without needing to activate/deactivate Plover.
|
When QMK speaks to Plover over a steno protocol, Plover will not use the keyboard as input. This means that you can switch back and forth between a standard keyboard and your steno keyboard, or even switch layers from Plover to standard and back without needing to activate/deactivate Plover.
|
||||||
|
|
||||||
In this mode Plover expects to speak with a steno machine over a serial port so QMK will present itself to the operating system as a virtual serial port in addition to a keyboard. By default QMK will speak the TX Bolt protocol but can be switched to GeminiPR; the last protocol used is stored in non-volatile memory so QMK will use the same protocol on restart.
|
In this mode, Plover expects to speak with a steno machine over a serial port so QMK will present itself to the operating system as a virtual serial port in addition to a keyboard.
|
||||||
|
|
||||||
> Note: Due to hardware limitations you may not be able to run both a virtual serial port and mouse emulation at the same time.
|
> Note: Due to hardware limitations, you might not be able to run both a virtual serial port and mouse emulation at the same time.
|
||||||
|
|
||||||
|
!> Serial stenography protocols are not supported on [V-USB keyboards](compatible_microcontrollers#atmel-avr).
|
||||||
|
|
||||||
|
To enable stenography protocols, add the following lines to your `rules.mk`:
|
||||||
|
```mk
|
||||||
|
STENO_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
### TX Bolt :id=tx-bolt
|
### TX Bolt :id=tx-bolt
|
||||||
|
|
||||||
TX Bolt communicates the status of 24 keys over a very simple protocol in variable-sized (1-5 byte) packets.
|
TX Bolt communicates the status of 24 keys over a simple protocol in variable-sized (1–4 bytes) packets.
|
||||||
|
|
||||||
|
To select TX Bolt, add the following lines to your `rules.mk`:
|
||||||
|
```mk
|
||||||
|
STENO_ENABLE = yes
|
||||||
|
STENO_PROTOCOL = txbolt
|
||||||
|
```
|
||||||
|
|
||||||
|
Each byte of the packet represents a different group of steno keys. Determining the group of a certain byte of the packet is done by checking the first two bits, the remaining bits are set if the corresponding steno key was pressed for the stroke. The last set of keys (as indicated by leading `11`) needs to keep track of less keys than there are bits so one of the bits is constantly 0.
|
||||||
|
|
||||||
|
The start of a new packet can be detected by comparing the group “ID” (the two MSBs) of the current byte to that of the previously received byte. If the group “ID” of the current byte is smaller or equal to that of the previous byte, it means that the current byte is the beginning of a new packet.
|
||||||
|
|
||||||
|
The format of TX Bolt packets is shown below.
|
||||||
|
```
|
||||||
|
00HWPKTS 01UE*OAR 10GLBPRF 110#ZDST
|
||||||
|
```
|
||||||
|
|
||||||
|
Examples of steno strokes and the associated packet:
|
||||||
|
- `EUBG` = `01110000 10101000`
|
||||||
|
- `WAZ` = `00010000 01000010 11001000`
|
||||||
|
- `PHAPBGS` = `00101000 01000010 10101100 11000010`
|
||||||
|
|
||||||
### GeminiPR :id=geminipr
|
### GeminiPR :id=geminipr
|
||||||
|
|
||||||
GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything that is necessary for standard stenography, GeminiPR opens up many more options, including supporting non-English theories.
|
GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything that is necessary for standard stenography, GeminiPR opens up many more options, including differentiating between top and bottom `S-`, and supporting non-English theories.
|
||||||
|
|
||||||
|
To select GeminiPR, add the following lines to your `rules.mk`:
|
||||||
|
```mk
|
||||||
|
STENO_ENABLE = yes
|
||||||
|
STENO_PROTOCOL = geminipr
|
||||||
|
```
|
||||||
|
|
||||||
|
All packets in the GeminiPR protocol consist of exactly six bytes, used as bit-arrays for different groups of keys. The beginning of a packet is indicated by setting the most significant bit (MSB) to 1 while setting the MSB of the remaining five bytes to 0.
|
||||||
|
|
||||||
|
The format of GeminiPR packets is shown below.
|
||||||
|
```
|
||||||
|
1 Fn #1 #2 #3 #4 #5 #6
|
||||||
|
0 S1- S2- T- K- P- W- H-
|
||||||
|
0 R- A- O- *1 *2 res1 res2
|
||||||
|
0 pwr *3 *4 -E -U -F -R
|
||||||
|
0 -P -B -L -G -T -S -D
|
||||||
|
0 #7 #8 #9 #A #B #C -Z
|
||||||
|
```
|
||||||
|
|
||||||
|
Examples of steno strokes and the associated packet:
|
||||||
|
- `EUBG` = `10000000 00000000 00000000 00001100 00101000 00000000`
|
||||||
|
- `WAZ` = `10000000 00000010 00100000 00000000 00000000 00000001`
|
||||||
|
- `PHAPBGS` = `10000000 00000101 00100000 00000000 01101010 00000000`
|
||||||
|
|
||||||
|
### Switching protocols on the fly :id=switching-protocols-on-the-fly
|
||||||
|
|
||||||
|
If you wish to switch the serial protocol used to transfer the steno chords without having to recompile your keyboard firmware every time, you can press the `QK_STENO_BOLT` and `QK_STENO_GEMINI` keycodes in order to switch protocols on the fly.
|
||||||
|
|
||||||
|
To enable these special keycodes, add the following lines to your `rules.mk`:
|
||||||
|
```mk
|
||||||
|
STENO_ENABLE = yes
|
||||||
|
STENO_PROTOCOL = all
|
||||||
|
```
|
||||||
|
|
||||||
|
If you want to switch protocols programatically, as part of a custom macro for example, don't use `tap_code(QK_STENO_*)`, as `tap_code` only supports [basic keycodes](keycodes_basic). Instead, you should use `steno_set_mode(STENO_MODE_*)`, whose valid arguments are `STENO_MODE_BOLT` and `STENO_MODE_GEMINI`.
|
||||||
|
|
||||||
|
The default protocol is Gemini PR but the last protocol used is stored in non-volatile memory so QMK will remember your choice between reboots of your keyboard — assuming that your keyboard features (emulated) EEPROM.
|
||||||
|
|
||||||
|
Naturally, this option takes the most amount of firmware space as it needs to compile the code for all the available stenography protocols. In most cases, compiling a single stenography protocol is sufficient.
|
||||||
|
|
||||||
|
The default value for `STENO_PROTOCOL` is `all`.
|
||||||
|
|
||||||
## Configuring QMK for Steno :id=configuring-qmk-for-steno
|
## Configuring QMK for Steno :id=configuring-qmk-for-steno
|
||||||
|
|
||||||
Firstly, enable steno in your keymap's Makefile. You may also need disable mousekeys, extra keys, or another USB endpoint to prevent conflicts. The builtin USB stack for some processors only supports a certain number of USB endpoints and the virtual serial port needed for steno fills 3 of them.
|
After enabling stenography and optionally selecting a protocol, you may also need disable mouse keys, extra keys, or another USB endpoint to prevent conflicts. The builtin USB stack for some processors only supports a certain number of USB endpoints and the virtual serial port needed for steno fills 3 of them.
|
||||||
|
|
||||||
```make
|
!> If you had *explicitly* set `VIRSTER_ENABLE = no`, none of the serial stenography protocols (GeminiPR, TX Bolt) will work properly. You are expected to either set it to `yes`, remove the line from your `rules.mk` or send the steno chords yourself in an alternative way using the [provided interceptable hooks](#interfacing-with-the-code).
|
||||||
STENO_ENABLE = yes
|
|
||||||
MOUSEKEY_ENABLE = no
|
|
||||||
```
|
|
||||||
|
|
||||||
In your keymap create a new layer for Plover. You will need to include `keymap_steno.h`. See `planck/keymaps/steno/keymap.c` for an example. Remember to create a key to switch to the layer as well as a key for exiting the layer. If you would like to switch modes on the fly you can use the keycodes `QK_STENO_BOLT` and `QK_STENO_GEMINI`. If you only want to use one of the protocols you may set it up in your initialization function:
|
In your keymap, create a new layer for Plover, that you can fill in with the [steno keycodes](#keycode-reference) (you will need to include `keymap_steno.h`, see `planck/keymaps/steno/keymap.c` for an example). Remember to create a key to switch to the layer as well as a key for exiting the layer.
|
||||||
|
|
||||||
```c
|
Once you have your keyboard flashed, launch Plover. Click the 'Configure...' button. In the 'Machine' tab, select the Stenotype Machine that corresponds to your desired protocol. Click the 'Configure...' button on this tab and enter the serial port or click 'Scan'. Baud rate is fine at 9600 (although you should be able to set as high as 115200 with no issues). Use the default settings for everything else (Data Bits: 8, Stop Bits: 1, Parity: N, no flow control).
|
||||||
void eeconfig_init_user() {
|
|
||||||
steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
Once you have your keyboard flashed launch Plover. Click the 'Configure...' button. In the 'Machine' tab select the Stenotype Machine that corresponds to your desired protocol. Click the 'Configure...' button on this tab and enter the serial port or click 'Scan'. Baud rate is fine at 9600 (although you should be able to set as high as 115200 with no issues). Use the default settings for everything else (Data Bits: 8, Stop Bits: 1, Parity: N, no flow control).
|
To test your keymap, you can chord keys on your keyboard and either look at the output of the 'paper tape' (Tools > Paper Tape) or that of the 'layout display' (Tools > Layout Display). If your strokes correctly show up, you are now ready to steno!
|
||||||
|
|
||||||
On the display tab click 'Open stroke display'. With Plover disabled you should be able to hit keys on your keyboard and see them show up in the stroke display window. Use this to make sure you have set up your keymap correctly. You are now ready to steno!
|
|
||||||
|
|
||||||
## Learning Stenography :id=learning-stenography
|
## Learning Stenography :id=learning-stenography
|
||||||
|
|
||||||
|
|
@ -60,7 +121,7 @@ On the display tab click 'Open stroke display'. With Plover disabled you should
|
||||||
The steno code has three interceptable hooks. If you define these functions, they will be called at certain points in processing; if they return true, processing continues, otherwise it's assumed you handled things.
|
The steno code has three interceptable hooks. If you define these functions, they will be called at certain points in processing; if they return true, processing continues, otherwise it's assumed you handled things.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]);
|
bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[MAX_STROKE_SIZE]);
|
||||||
```
|
```
|
||||||
|
|
||||||
This function is called when a chord is about to be sent. Mode will be one of `STENO_MODE_BOLT` or `STENO_MODE_GEMINI`. This represents the actual chord that would be sent via whichever protocol. You can modify the chord provided to alter what gets sent. Remember to return true if you want the regular sending process to happen.
|
This function is called when a chord is about to be sent. Mode will be one of `STENO_MODE_BOLT` or `STENO_MODE_GEMINI`. This represents the actual chord that would be sent via whichever protocol. You can modify the chord provided to alter what gets sent. Remember to return true if you want the regular sending process to happen.
|
||||||
|
|
@ -72,15 +133,23 @@ bool process_steno_user(uint16_t keycode, keyrecord_t *record) { return true; }
|
||||||
This function is called when a keypress has come in, before it is processed. The keycode should be one of `QK_STENO_BOLT`, `QK_STENO_GEMINI`, or one of the `STN_*` key values.
|
This function is called when a keypress has come in, before it is processed. The keycode should be one of `QK_STENO_BOLT`, `QK_STENO_GEMINI`, or one of the `STN_*` key values.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[6], int8_t pressed);
|
bool postprocess_steno_user(uint16_t keycode, keyrecord_t *record, steno_mode_t mode, uint8_t chord[MAX_STROKE_SIZE], int8_t n_pressed_keys);
|
||||||
```
|
```
|
||||||
|
|
||||||
This function is called after a key has been processed, but before any decision about whether or not to send a chord. If `IS_PRESSED(record->event)` is false, and `pressed` is 0 or 1, the chord will be sent shortly, but has not yet been sent. This is where to put hooks for things like, say, live displays of steno chords or keys.
|
This function is called after a key has been processed, but before any decision about whether or not to send a chord. This is where to put hooks for things like, say, live displays of steno chords or keys.
|
||||||
|
|
||||||
|
If `IS_PRESSED(record->event)` is false, and `n_pressed_keys` is 0 or 1, the chord will be sent shortly, but has not yet been sent. This relieves you of the need of keeping track of where a packet ends and another begins.
|
||||||
|
|
||||||
|
The `chord` argument contains the packet of the current chord as specified by the protocol in use. This is *NOT* simply a list of chorded steno keys of the form `[STN_E, STN_U, STN_BR, STN_GR]`. Refer to the appropriate protocol section of this document to learn more about the format of the packets in your steno protocol/mode of choice.
|
||||||
|
|
||||||
|
The `n_pressed_keys` argument is the number of physical keys actually being held down.
|
||||||
|
This is not always equal to the number of bits set to 1 (aka the [Hamming weight](https://en.wikipedia.org/wiki/Hamming_weight)) in `chord` because it is possible to simultaneously press down four keys, then release three of those four keys and then press yet another key while the fourth finger is still holding down its key.
|
||||||
|
At the end of this scenario given as an example, `chord` would have five bits set to 1 but
|
||||||
|
`n_pressed_keys` would be set to 2 because there are only two keys currently being pressed down.
|
||||||
|
|
||||||
## Keycode Reference :id=keycode-reference
|
## Keycode Reference :id=keycode-reference
|
||||||
|
|
||||||
As defined in `keymap_steno.h`.
|
You must include `keymap_steno.h` to your `keymap.c` with `#include "keymap_steno.h"` before you can use these keycodes
|
||||||
|
|
||||||
> Note: TX Bolt does not support the full set of keys. The TX Bolt implementation in QMK will map the GeminiPR keys to the nearest TX Bolt key so that one key map will work for both.
|
> Note: TX Bolt does not support the full set of keys. The TX Bolt implementation in QMK will map the GeminiPR keys to the nearest TX Bolt key so that one key map will work for both.
|
||||||
|
|
||||||
|
|
@ -124,10 +193,10 @@ As defined in `keymap_steno.h`.
|
||||||
|`STN_SR`|`STN_SR`| `-S`|
|
|`STN_SR`|`STN_SR`| `-S`|
|
||||||
|`STN_DR`|`STN_DR`| `-D`|
|
|`STN_DR`|`STN_DR`| `-D`|
|
||||||
|`STN_ZR`|`STN_ZR`| `-Z`|
|
|`STN_ZR`|`STN_ZR`| `-Z`|
|
||||||
|`STN_FN`|| (GeminiPR only)|
|
|`STN_FN`|| (Function)|
|
||||||
|`STN_RES1`||(GeminiPR only)|
|
|`STN_RES1`||(Reset 1)|
|
||||||
|`STN_RES2`||(GeminiPR only)|
|
|`STN_RES2`||(Reset 2)|
|
||||||
|`STN_PWR`||(GeminiPR only)|
|
|`STN_PWR`||(Power)|
|
||||||
|
|
||||||
If you do not want to hit two keys with one finger combined keycodes can be used. These are also defined in `keymap_steno.h`, and causes both keys to be reported as pressed or released. To use these keycodes define `STENO_COMBINEDMAP` in your `config.h` file.
|
If you do not want to hit two keys with one finger combined keycodes can be used. These are also defined in `keymap_steno.h`, and causes both keys to be reported as pressed or released. To use these keycodes define `STENO_COMBINEDMAP` in your `config.h` file.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,55 +14,48 @@ Optionally, you might want to set a custom `TAPPING_TERM` time by adding somethi
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define TAPPING_TERM 175
|
#define TAPPING_TERM 175
|
||||||
|
#define TAPPING_TERM_PER_KEY
|
||||||
```
|
```
|
||||||
|
|
||||||
The `TAPPING_TERM` time is the maximum time allowed between taps of your Tap Dance key, and is measured in milliseconds. For example, if you used the above `#define` statement and set up a Tap Dance key that sends `Space` on single-tap and `Enter` on double-tap, then this key will send `ENT` only if you tap this key twice in less than 175ms. If you tap the key, wait more than 175ms, and tap the key again you'll end up sending `SPC SPC` instead.
|
The `TAPPING_TERM` time is the maximum time allowed between taps of your Tap Dance key, and is measured in milliseconds. For example, if you used the above `#define` statement and set up a Tap Dance key that sends `Space` on single-tap and `Enter` on double-tap, then this key will send `ENT` only if you tap this key twice in less than 175ms. If you tap the key, wait more than 175ms, and tap the key again you'll end up sending `SPC SPC` instead. The `TAPPING_TERM_PER_KEY` definition is only needed if you control the tapping term through a [custom `get_tapping_term` function](tap_hold.md#tapping_term), which may be needed because `TAPPING_TERM` affects not just tap-dance keys.
|
||||||
|
|
||||||
Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro, that takes a number which will later be used as an index into the `tap_dance_actions` array.
|
Next, you will want to define some tap-dance keys, which is easiest to do with the `TD()` macro. That macro takes a number which will later be used as an index into the `tap_dance_actions` array and turns it into a tap-dance keycode.
|
||||||
|
|
||||||
After this, you'll want to use the `tap_dance_actions` array to specify what actions shall be taken when a tap-dance key is in action. Currently, there are five possible options:
|
After this, you'll want to use the `tap_dance_actions` array to specify what actions shall be taken when a tap-dance key is in action. Currently, there are five possible options:
|
||||||
|
|
||||||
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
|
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: Sends the `kc1` keycode when tapped once, `kc2` otherwise. When the key is held, the appropriate keycode is registered: `kc1` when pressed and held, `kc2` when tapped once, then pressed and held.
|
||||||
* `ACTION_TAP_DANCE_LAYER_MOVE(kc, layer)`: Sends the `kc` keycode when tapped once, or moves to `layer`. (this functions like the `TO` layer keycode).
|
* `ACTION_TAP_DANCE_LAYER_MOVE(kc, layer)`: Sends the `kc` keycode when tapped once, or moves to `layer`. (this functions like the `TO` layer keycode).
|
||||||
* This is the same as `ACTION_TAP_DANCE_DUAL_ROLE`, but renamed to something that is clearer about its functionality. Both names will work.
|
|
||||||
* `ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer)`: Sends the `kc` keycode when tapped once, or toggles the state of `layer`. (this functions like the `TG` layer keycode).
|
* `ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer)`: Sends the `kc` keycode when tapped once, or toggles the state of `layer`. (this functions like the `TG` layer keycode).
|
||||||
* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
|
* `ACTION_TAP_DANCE_FN(fn)`: Calls the specified function - defined in the user keymap - with the final tap count of the tap dance action.
|
||||||
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
|
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: Calls the first specified function - defined in the user keymap - on every tap, the second function when the dance action finishes (like the previous option), and the last function when the tap dance action resets.
|
||||||
* ~~`ACTION_TAP_DANCE_FN_ADVANCED_TIME(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn, tap_specific_tapping_term)`~~: This functions identically to the `ACTION_TAP_DANCE_FN_ADVANCED` function, but uses a custom tapping term for it, instead of the predefined `TAPPING_TERM`.
|
|
||||||
* This is deprecated in favor of the Per Key Tapping Term functionality, as outlined [here](tap_hold.md#tapping-term). You'd want to check for the specific `TD()` macro that you want to use (such as `TD(TD_ESC_CAPS)`) instead of using this specific Tap Dance function.
|
|
||||||
|
|
||||||
|
|
||||||
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
|
The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise.
|
||||||
|
|
||||||
!> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported.
|
!> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported.
|
||||||
|
|
||||||
Similar to the first option, the second option is good for simple layer-switching cases.
|
Similar to the first option, the second and third option are good for simple layer-switching cases.
|
||||||
|
|
||||||
For more complicated cases, use the third or fourth options (examples of each are listed below).
|
For more complicated cases, like blink the LEDs, fiddle with the backlighting, and so on, use the fourth or fifth option. Examples of each are listed below.
|
||||||
|
|
||||||
Finally, the fifth option is particularly useful if your non-Tap-Dance keys start behaving weirdly after adding the code for your Tap Dance keys. The likely problem is that you changed the `TAPPING_TERM` time to make your Tap Dance keys easier for you to use, and that this has changed the way your other keys handle interrupts.
|
|
||||||
|
|
||||||
## Implementation Details :id=implementation
|
## Implementation Details :id=implementation
|
||||||
|
|
||||||
Well, that's the bulk of it! You should now be able to work through the examples below, and to develop your own Tap Dance functionality. But if you want a deeper understanding of what's going on behind the scenes, then read on for the explanation of how it all works!
|
Well, that's the bulk of it! You should now be able to work through the examples below, and to develop your own Tap Dance functionality. But if you want a deeper understanding of what's going on behind the scenes, then read on for the explanation of how it all works!
|
||||||
|
|
||||||
The main entry point is `process_tap_dance()`, called from `process_record_quantum()`, which is run for every keypress, and our handler gets to run early. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. If it was the same, we increment the counter and reset the timer.
|
Let's go over the three functions mentioned in `ACTION_TAP_DANCE_FN_ADVANCED` in a little more detail. They all receive the same too arguments: a pointer to a structure that holds all dance related state information, and a pointer to a use case specific state variable. The three functions differ in when they are called. The first, `on_each_tap_fn()`, is called every time the tap dance key is *pressed*. Before it is called, the counter is incremented and the timer is reset. The second function, `on_dance_finished_fn()`, is called when the tap dance is interrupted or ends because `TAPPING_TERM` milliseconds have passed since the last tap. When the `finished` field of the dance state structure is set to `true`, the `on_dance_finished_fn()` is skipped. After `on_dance_finished_fn()` was called or would have been called, but no sooner than when the tap dance key is *released*, `on_dance_reset_fn()` is called. It is possible to end a tap dance immediately, skipping `on_dance_finished_fn()`, but not `on_dance_reset_fn`, by calling `reset_tap_dance(state)`.
|
||||||
|
|
||||||
|
To accomplish this logic, the tap dance mechanics use three entry points. The main entry point is `process_tap_dance()`, called from `process_record_quantum()` *after* `process_record_kb()` and `process_record_user()`. This function is responsible for calling `on_each_tap_fn()` and `on_dance_reset_fn()`. In order to handle interruptions of a tap dance, another entry point, `preprocess_tap_dance()` is run right at the beginning of `process_record_quantum()`. This function checks whether the key pressed is a tap-dance key. If it is not, and a tap-dance was in action, we handle that first, and enqueue the newly pressed key. If it is a tap-dance key, then we check if it is the same as the already active one (if there's one active, that is). If it is not, we fire off the old one first, then register the new one. Finally, `tap_dance_task()` periodically checks whether `TAPPING_TERM` has passed since the last key press and finishes a tap dance if that is the case.
|
||||||
|
|
||||||
This means that you have `TAPPING_TERM` time to tap the key again; you do not have to input all the taps within a single `TAPPING_TERM` timeframe. This allows for longer tap counts, with minimal impact on responsiveness.
|
This means that you have `TAPPING_TERM` time to tap the key again; you do not have to input all the taps within a single `TAPPING_TERM` timeframe. This allows for longer tap counts, with minimal impact on responsiveness.
|
||||||
|
|
||||||
Our next stop is `tap_dance_task()`. This handles the timeout of tap-dance keys.
|
|
||||||
|
|
||||||
For the sake of flexibility, tap-dance actions can be either a pair of keycodes, or a user function. The latter allows one to handle higher tap counts, or do extra things, like blink the LEDs, fiddle with the backlighting, and so on. This is accomplished by using an union, and some clever macros.
|
|
||||||
|
|
||||||
## Examples :id=examples
|
## Examples :id=examples
|
||||||
|
|
||||||
### Simple Example :id=simple-example
|
### Simple Example: Send `ESC` on Single Tap, `CAPS_LOCK` on Double Tap :id=simple-example
|
||||||
|
|
||||||
Here's a simple example for a single definition:
|
Here's a simple example for a single definition:
|
||||||
|
|
||||||
1. In your `rules.mk`, add `TAP_DANCE_ENABLE = yes`
|
1. In your `rules.mk`, add `TAP_DANCE_ENABLE = yes`
|
||||||
2. In your `config.h` (which you can copy from `qmk_firmware/keyboards/planck/config.h` to your keymap directory), add `#define TAPPING_TERM 200`
|
2. In your `keymap.c` file, define the variables and definitions, then add to your keymap:
|
||||||
3. In your `keymap.c` file, define the variables and definitions, then add to your keymap:
|
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// Tap Dance declarations
|
// Tap Dance declarations
|
||||||
|
|
@ -92,40 +85,15 @@ All the enums used in the examples are declared like this:
|
||||||
```c
|
```c
|
||||||
// Enums defined for all examples:
|
// Enums defined for all examples:
|
||||||
enum {
|
enum {
|
||||||
CT_SE,
|
TD_ESC_CAPS,
|
||||||
CT_CLN,
|
|
||||||
CT_EGG,
|
CT_EGG,
|
||||||
CT_FLSH,
|
CT_FLSH,
|
||||||
X_TAP_DANCE
|
CT_CLN,
|
||||||
|
X_CTL,
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example 1: Send `:` on Single Tap, `;` on Double Tap :id=example-1
|
#### Example 1: Send "Safety Dance!" After 100 Taps :id=example-1
|
||||||
|
|
||||||
```c
|
|
||||||
void dance_cln_finished(qk_tap_dance_state_t *state, void *user_data) {
|
|
||||||
if (state->count == 1) {
|
|
||||||
register_code16(KC_COLN);
|
|
||||||
} else {
|
|
||||||
register_code(KC_SCLN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void dance_cln_reset(qk_tap_dance_state_t *state, void *user_data) {
|
|
||||||
if (state->count == 1) {
|
|
||||||
unregister_code16(KC_COLN);
|
|
||||||
} else {
|
|
||||||
unregister_code(KC_SCLN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// All tap dance functions would go here. Only showing this one.
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
|
||||||
[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset),
|
|
||||||
};
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Example 2: Send "Safety Dance!" After 100 Taps :id=example-2
|
|
||||||
|
|
||||||
```c
|
```c
|
||||||
void dance_egg(qk_tap_dance_state_t *state, void *user_data) {
|
void dance_egg(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
|
@ -140,7 +108,7 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Example 3: Turn LED Lights On Then Off, One at a Time :id=example-3
|
#### Example 2: Turn LED Lights On Then Off, One at a Time :id=example-2
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// On each tap, light up one LED, from right to left
|
// On each tap, light up one LED, from right to left
|
||||||
|
|
@ -181,15 +149,74 @@ void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
ergodox_right_led_3_off();
|
ergodox_right_led_3_off();
|
||||||
}
|
}
|
||||||
|
|
||||||
// All tap dances now put together. Example 3 is "CT_FLASH"
|
// All tap dances now put together. Example 2 is "CT_FLSH"
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
[CT_SE] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT),
|
[TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CAPS),
|
||||||
[CT_CLN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_cln_finished, dance_cln_reset),
|
|
||||||
[CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg),
|
[CT_EGG] = ACTION_TAP_DANCE_FN(dance_egg),
|
||||||
[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
[CT_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED(dance_flsh_each, dance_flsh_finished, dance_flsh_reset)
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Example 3: Send `:` on Tap, `;` on Hold :id=example-3
|
||||||
|
|
||||||
|
With a little effort, powerful tap-hold configurations can be implemented as tap dances. To emit taps as early as possible, we need to act on releases of the tap dance key. There is no callback for this in the tap dance framework, so we use `process_record_user()`.
|
||||||
|
|
||||||
|
```c
|
||||||
|
typedef struct {
|
||||||
|
uint16_t tap;
|
||||||
|
uint16_t hold;
|
||||||
|
uint16_t held;
|
||||||
|
} tap_dance_tap_hold_t;
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
qk_tap_dance_action_t *action;
|
||||||
|
|
||||||
|
switch (keycode) {
|
||||||
|
case TD(CT_CLN): // list all tap dance keycodes with tap-hold configurations
|
||||||
|
action = &tap_dance_actions[TD_INDEX(keycode)];
|
||||||
|
if (!record->event.pressed && action->state.count && !action->state.finished) {
|
||||||
|
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)action->user_data;
|
||||||
|
tap_code16(tap_hold->tap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void tap_dance_tap_hold_finished(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;
|
||||||
|
|
||||||
|
if (state->pressed) {
|
||||||
|
if (state->count == 1
|
||||||
|
#ifndef PERMISSIVE_HOLD
|
||||||
|
&& !state->interrupted
|
||||||
|
#endif
|
||||||
|
) {
|
||||||
|
register_code16(tap_hold->hold);
|
||||||
|
tap_hold->held = tap_hold->hold;
|
||||||
|
} else {
|
||||||
|
register_code16(tap_hold->tap);
|
||||||
|
tap_hold->held = tap_hold->tap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void tap_dance_tap_hold_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;
|
||||||
|
|
||||||
|
if (tap_hold->held) {
|
||||||
|
unregister_code16(tap_hold->held);
|
||||||
|
tap_hold->held = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define ACTION_TAP_DANCE_TAP_HOLD(tap, hold) \
|
||||||
|
{ .fn = {NULL, tap_dance_tap_hold_finished, tap_dance_tap_hold_reset}, .user_data = (void *)&((tap_dance_tap_hold_t){tap, hold, 0}), }
|
||||||
|
|
||||||
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
[CT_CLN] = ACTION_TAP_DANCE_TAP_HOLD(KC_COLN, KC_SCLN),
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
#### Example 4: 'Quad Function Tap-Dance' :id=example-4
|
#### Example 4: 'Quad Function Tap-Dance' :id=example-4
|
||||||
|
|
||||||
By [DanielGGordon](https://github.com/danielggordon)
|
By [DanielGGordon](https://github.com/danielggordon)
|
||||||
|
|
@ -329,7 +356,7 @@ And then simply use `TD(X_CTL)` anywhere in your keymap.
|
||||||
|
|
||||||
If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace.
|
If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace.
|
||||||
|
|
||||||
> In this configuration "hold" takes place **after** tap dance timeout (see `ACTION_TAP_DANCE_FN_ADVANCED_TIME`). To achieve instant hold, remove `state->interrupted` checks in conditions. As a result you may use comfortable longer tapping periods to have more time for taps and not to wait too long for holds (try starting with doubled `TAPPING_TERM`).
|
> In this configuration "hold" takes place **after** tap dance timeout. To achieve instant hold, remove `state->interrupted` checks in conditions. As a result you may use comfortable longer tapping periods to have more time for taps and not to wait too long for holds (try starting with doubled `TAPPING_TERM`).
|
||||||
|
|
||||||
#### Example 5: Using tap dance for advanced mod-tap and layer-tap keys :id=example-5
|
#### Example 5: Using tap dance for advanced mod-tap and layer-tap keys :id=example-5
|
||||||
|
|
||||||
|
|
@ -511,8 +538,18 @@ void ql_reset(qk_tap_dance_state_t *state, void *user_data) {
|
||||||
|
|
||||||
// Associate our tap dance key with its functionality
|
// Associate our tap dance key with its functionality
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
[QUOT_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, ql_finished, ql_reset, 275)
|
[QUOT_LAYR] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ql_finished, ql_reset)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Set a long-ish tapping term for tap-dance keys
|
||||||
|
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case QK_TAP_DANCE ... QK_TAP_DANCE_MAX:
|
||||||
|
return 275;
|
||||||
|
default:
|
||||||
|
return TAPPING_TERM;
|
||||||
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The above code is similar to that used in previous examples. The one point to note is that we need to be able to check which layers are active at any time so we can toggle them if needed. To do this we use the `layer_state_is(layer)` function which returns `true` if the given `layer` is active.
|
The above code is similar to that used in previous examples. The one point to note is that we need to be able to check which layers are active at any time so we can toggle them if needed. To do this we use the `layer_state_is(layer)` function which returns `true` if the given `layer` is active.
|
||||||
|
|
@ -521,6 +558,6 @@ The use of `cur_dance()` and `ql_tap_state` mirrors the above examples.
|
||||||
|
|
||||||
The `case: TD_SINGLE_TAP` in `ql_finished` is similar to the above examples. The `TD_SINGLE_HOLD` case works in conjunction with `ql_reset()` to switch to `_MY_LAYER` while the tap dance key is held, and to switch away from `_MY_LAYER` when the key is released. This mirrors the use of `MO(_MY_LAYER)`. The `TD_DOUBLE_TAP` case works by checking whether `_MY_LAYER` is the active layer, and toggling it on or off accordingly. This mirrors the use of `TG(_MY_LAYER)`.
|
The `case: TD_SINGLE_TAP` in `ql_finished` is similar to the above examples. The `TD_SINGLE_HOLD` case works in conjunction with `ql_reset()` to switch to `_MY_LAYER` while the tap dance key is held, and to switch away from `_MY_LAYER` when the key is released. This mirrors the use of `MO(_MY_LAYER)`. The `TD_DOUBLE_TAP` case works by checking whether `_MY_LAYER` is the active layer, and toggling it on or off accordingly. This mirrors the use of `TG(_MY_LAYER)`.
|
||||||
|
|
||||||
`tap_dance_actions[]` works similar to the above examples. Note that I used `ACTION_TAP_DANCE_FN_ADVANCED_TIME()` instead of `ACTION_TAP_DANCE_FN_ADVANCED()`. This is because I like my `TAPPING_TERM` to be short (\~175ms) for my non-tap-dance keys but find that this is too quick for me to reliably complete tap dance actions - thus the increased time of 275ms here.
|
`tap_dance_actions[]` works similar to the above examples. Note that, additionally, I set a longer tapping term for the tap dance keys. This is because I like my `TAPPING_TERM` to be short (\~175ms) for my non-tap-dance keys but find that this is too quick for me to reliably complete tap dance actions - thus the increased time of 275ms here. In order for the per-key tapping terms to take effect, `TAPPING_TERM_PER_KEY` must be defined in your `config.h`.
|
||||||
|
|
||||||
Finally, to get this tap dance key working, be sure to include `TD(QUOT_LAYR)` in your `keymaps[]`.
|
Finally, to get this tap dance key working, be sure to include `TD(QUOT_LAYR)` in your `keymaps[]`.
|
||||||
|
|
|
||||||
|
|
@ -1,107 +0,0 @@
|
||||||
# Terminal
|
|
||||||
|
|
||||||
> This feature is currently *huge*, and should probably only be put on boards with a lot of memory, or for fun.
|
|
||||||
|
|
||||||
The terminal feature is a command-line-like interface designed to communicate through a text editor with keystrokes. It's beneficial to turn off auto-indent features in your editor.
|
|
||||||
|
|
||||||
To enable, stick this in your `rules.mk` or `Makefile`:
|
|
||||||
|
|
||||||
TERMINAL_ENABLE = yes
|
|
||||||
|
|
||||||
And use the `TERM_ON` and `TERM_OFF` keycodes to turn it on or off.
|
|
||||||
|
|
||||||
When enabled, a `> ` prompt will appear, where you'll be able to type, backspace (a bell will ding if you reach the beginning and audio is enabled), and hit enter to send the command. Arrow keys are currently disabled so it doesn't get confused. Moving your cursor around with the mouse is discouraged.
|
|
||||||
|
|
||||||
`#define TERMINAL_HELP` enables some other output helpers that aren't really needed with this page.
|
|
||||||
|
|
||||||
Pressing "up" and "down" will allow you to cycle through the past 5 commands entered.
|
|
||||||
|
|
||||||
## Future Ideas
|
|
||||||
|
|
||||||
* Keyboard/user-extensible commands
|
|
||||||
* Smaller footprint
|
|
||||||
* Arrow key support
|
|
||||||
* Command history - Done
|
|
||||||
* SD card support
|
|
||||||
* LCD support for buffer display
|
|
||||||
* Keycode -> name string LUT
|
|
||||||
* Layer status
|
|
||||||
* *Analog/digital port read/write*
|
|
||||||
* RGB mode stuff
|
|
||||||
* Macro definitions
|
|
||||||
* EEPROM read/write
|
|
||||||
* Audio control
|
|
||||||
|
|
||||||
## Current Commands
|
|
||||||
|
|
||||||
### `about`
|
|
||||||
|
|
||||||
Prints out the current version of QMK with a build date:
|
|
||||||
|
|
||||||
```
|
|
||||||
> about
|
|
||||||
QMK Firmware
|
|
||||||
v0.5.115-7-g80ed73-dirty
|
|
||||||
Built: 2017-08-29-20:24:44
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### `print-buffer`
|
|
||||||
|
|
||||||
Outputs the last 5 commands entered
|
|
||||||
|
|
||||||
```
|
|
||||||
> print-buffer
|
|
||||||
0. print-buffer
|
|
||||||
1. help
|
|
||||||
2. about
|
|
||||||
3. keymap 0
|
|
||||||
4. help
|
|
||||||
5. flush-buffer
|
|
||||||
```
|
|
||||||
|
|
||||||
### `flush-buffer`
|
|
||||||
|
|
||||||
Clears command buffer
|
|
||||||
```
|
|
||||||
> flush-buffer
|
|
||||||
Buffer cleared!
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### `help`
|
|
||||||
|
|
||||||
|
|
||||||
Prints out the available commands:
|
|
||||||
|
|
||||||
```
|
|
||||||
> help
|
|
||||||
commands available:
|
|
||||||
about help keycode keymap exit print-buffer flush-buffer
|
|
||||||
```
|
|
||||||
|
|
||||||
### `keycode <layer> <row> <col>`
|
|
||||||
|
|
||||||
Prints out the keycode value of a certain layer, row, and column:
|
|
||||||
|
|
||||||
```
|
|
||||||
> keycode 0 1 0
|
|
||||||
0x29 (41)
|
|
||||||
```
|
|
||||||
|
|
||||||
### `keymap <layer>`
|
|
||||||
|
|
||||||
Prints out the entire keymap for a certain layer
|
|
||||||
|
|
||||||
```
|
|
||||||
> keymap 0
|
|
||||||
0x002b, 0x0014, 0x001a, 0x0008, 0x0015, 0x0017, 0x001c, 0x0018, 0x000c, 0x0012, 0x0013, 0x002a,
|
|
||||||
0x0029, 0x0004, 0x0016, 0x0007, 0x0009, 0x000a, 0x000b, 0x000d, 0x000e, 0x000f, 0x0033, 0x0034,
|
|
||||||
0x00e1, 0x001d, 0x001b, 0x0006, 0x0019, 0x0005, 0x0011, 0x0010, 0x0036, 0x0037, 0x0038, 0x0028,
|
|
||||||
0x5cd6, 0x00e0, 0x00e2, 0x00e3, 0x5cd4, 0x002c, 0x002c, 0x5cd5, 0x0050, 0x0051, 0x0052, 0x004f,
|
|
||||||
>
|
|
||||||
```
|
|
||||||
|
|
||||||
### `exit`
|
|
||||||
|
|
||||||
Exits the terminal - same as `TERM_OFF`.
|
|
||||||
|
|
@ -358,3 +358,46 @@ CLI Flashing sequence:
|
||||||
2. Wait for the OS to detect the device
|
2. Wait for the OS to detect the device
|
||||||
3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/blackpill_f411_tinyuf2 --keymap default`
|
3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/blackpill_f411_tinyuf2 --keymap default`
|
||||||
4. Wait for the keyboard to become available
|
4. Wait for the keyboard to become available
|
||||||
|
|
||||||
|
### `make` Targets
|
||||||
|
|
||||||
|
* `:uf2-split-left` and `:uf2-split-right`: Flashes the firmware but also sets the handedness setting in EEPROM by generating a side specific firmware.
|
||||||
|
|
||||||
|
## Raspberry Pi RP2040 UF2
|
||||||
|
|
||||||
|
The `rules.mk` setting for this bootloader is `rp2040`, and can be specified at the keymap or user level.
|
||||||
|
|
||||||
|
To ensure compatibility with the rp2040 bootloader, make sure this block is present in your `rules.mk`:
|
||||||
|
|
||||||
|
```make
|
||||||
|
# Bootloader selection
|
||||||
|
BOOTLOADER = rp2040
|
||||||
|
```
|
||||||
|
|
||||||
|
Compatible flashers:
|
||||||
|
|
||||||
|
* Any application able to copy a file from one place to another, such as _macOS Finder_ or _Windows Explorer_.
|
||||||
|
|
||||||
|
Flashing sequence:
|
||||||
|
|
||||||
|
1. Enter the bootloader using any of the following methods:
|
||||||
|
* Tap the `QK_BOOTLOADER` keycode
|
||||||
|
* Hold the `BOOTSEL` button on the PCB while plugin in the usb cable.
|
||||||
|
* Double-tap the `RESET` button on the PCB<sup>1</sup>.
|
||||||
|
2. Wait for the OS to detect the device
|
||||||
|
3. Copy the .uf2 file to the new USB disk
|
||||||
|
4. Wait for the keyboard to become available
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
CLI Flashing sequence:
|
||||||
|
|
||||||
|
1. Enter the bootloader using any of the following methods:
|
||||||
|
* Tap the `QK_BOOTLOADER` keycode
|
||||||
|
* Hold the `BOOTSEL` button on the PCB while plugin in the usb cable.
|
||||||
|
* Double-tap the `RESET` button on the PCB<sup>1</sup>.
|
||||||
|
2. Wait for the OS to detect the device
|
||||||
|
3. Flash via QMK CLI eg. `qmk flash --keyboard handwired/onekey/rpi_pico --keymap default`
|
||||||
|
4. Wait for the keyboard to become available
|
||||||
|
|
||||||
|
<sup>1</sup>: This works only if QMK was compiled with `RP2040_BOOTLOADER_DOUBLE_TAP_RESET` defined.
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,6 @@
|
||||||
* [スワップハンド](ja/feature_swap_hands.md)
|
* [スワップハンド](ja/feature_swap_hands.md)
|
||||||
* [タップダンス](ja/feature_tap_dance.md)
|
* [タップダンス](ja/feature_tap_dance.md)
|
||||||
* [タップホールド設定](ja/tap_hold.md)
|
* [タップホールド設定](ja/tap_hold.md)
|
||||||
* [ターミナル](ja/feature_terminal.md)
|
|
||||||
* [ユニコード](ja/feature_unicode.md)
|
* [ユニコード](ja/feature_unicode.md)
|
||||||
* [ユーザスペース](ja/feature_userspace.md)
|
* [ユーザスペース](ja/feature_userspace.md)
|
||||||
* [WPM 計算](ja/feature_wpm.md)
|
* [WPM 計算](ja/feature_wpm.md)
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
|
||||||
## 設定可能な挙動 :id=behaviors-that-can-be-configured
|
## 設定可能な挙動 :id=behaviors-that-can-be-configured
|
||||||
|
|
||||||
* `#define TAPPING_TERM 200`
|
* `#define TAPPING_TERM 200`
|
||||||
* タップがホールドになるまでの時間。500以上に設定された場合、タップ期間中にタップされたキーもホールドになります。(訳注: PERMISSIVE_HOLDも参照)
|
* タップがホールドになるまでの時間。
|
||||||
* `#define TAPPING_TERM_PER_KEY`
|
* `#define TAPPING_TERM_PER_KEY`
|
||||||
* キーごとの `TAPPING_TERM` 設定の処理を有効にします
|
* キーごとの `TAPPING_TERM` 設定の処理を有効にします
|
||||||
* `#define RETRO_TAPPING`
|
* `#define RETRO_TAPPING`
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
|
|
||||||
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: 1回タップすると `kc1` キーコードを送信し、2回タップすると `kc2` キーコードを送信します。キーを押し続けているときは、適切なキーコードが登録されます: キーを押し続けた場合は `kc1`、一度タップしてから続けてもう一度キーを押してそのまま押し続けたときは、 `kc2` が登録されます。
|
* `ACTION_TAP_DANCE_DOUBLE(kc1, kc2)`: 1回タップすると `kc1` キーコードを送信し、2回タップすると `kc2` キーコードを送信します。キーを押し続けているときは、適切なキーコードが登録されます: キーを押し続けた場合は `kc1`、一度タップしてから続けてもう一度キーを押してそのまま押し続けたときは、 `kc2` が登録されます。
|
||||||
* `ACTION_TAP_DANCE_LAYER_MOVE(kc, layer)`: 1回タップすると `kc` キーコードが送信され、2回タップすると `layer` レイヤーに移動します(これは `TO` レイヤーキーコードのように機能します)。
|
* `ACTION_TAP_DANCE_LAYER_MOVE(kc, layer)`: 1回タップすると `kc` キーコードが送信され、2回タップすると `layer` レイヤーに移動します(これは `TO` レイヤーキーコードのように機能します)。
|
||||||
* この機能は `ACTION_TAP_DANCE_DUAL_ROLE` と同じですが、機能が明確になるように関数名を変更しました。どちらの関数名でも実行できます。
|
|
||||||
* `ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer)`: 1回タップすると `kc` キーコードが送信され、2回タップすると `layer` の状態をトグルします(これは `TG` レイヤーキーコードのように機能します)。
|
* `ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer)`: 1回タップすると `kc` キーコードが送信され、2回タップすると `layer` の状態をトグルします(これは `TG` レイヤーキーコードのように機能します)。
|
||||||
* `ACTION_TAP_DANCE_FN(fn)`: ユーザーキーマップに定義した指定の関数が呼び出されます。タップダンス実行の回数分タップすると、最後の時点で呼び出されます。
|
* `ACTION_TAP_DANCE_FN(fn)`: ユーザーキーマップに定義した指定の関数が呼び出されます。タップダンス実行の回数分タップすると、最後の時点で呼び出されます。
|
||||||
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: タップする度にユーザーキーマップに定義した最初の関数が呼び出されます。タップダンスの実行が終わった時点で2番目の関数が呼び出され、タップダンスの実行をリセットするときに最後の関数が呼び出されます。
|
* `ACTION_TAP_DANCE_FN_ADVANCED(on_each_tap_fn, on_dance_finished_fn, on_dance_reset_fn)`: タップする度にユーザーキーマップに定義した最初の関数が呼び出されます。タップダンスの実行が終わった時点で2番目の関数が呼び出され、タップダンスの実行をリセットするときに最後の関数が呼び出されます。
|
||||||
|
|
|
||||||
|
|
@ -1,112 +0,0 @@
|
||||||
# ターミナル
|
|
||||||
|
|
||||||
<!---
|
|
||||||
original document: 0.8.147:docs/feature_terminal.md
|
|
||||||
git diff 0.8.147 HEAD -- docs/feature_terminal.md | cat
|
|
||||||
-->
|
|
||||||
|
|
||||||
> この機能は現在のところ*巨大*であり、おそらく大量のメモリを搭載したキーボード、または楽しみのためにのみ配置する必要があります。
|
|
||||||
|
|
||||||
ターミナル機能はテキストエディタを介してキーストロークで通信するように設計されたコマンドラインのようなインタフェースです。エディタで自動インデント機能をオフにすることは有益です。
|
|
||||||
|
|
||||||
有効にするには、以下を `rules.mk` または `Makefile` に貼り付けます:
|
|
||||||
|
|
||||||
TERMINAL_ENABLE = yes
|
|
||||||
|
|
||||||
そして、オンまたはオフにするために、`TERM_ON` および `TERM_OFF` キーコードを使います。
|
|
||||||
|
|
||||||
有効な場合、`> ` プロンプトが現れ、ここでコマンドやバックスペース(オーディオが有効な場合は、先頭に到達するとベルが鳴ります)を入力することができ、エンターを入力するとコマンドを送信します。矢印キーは現在のところ無効なため、混乱することはありません。マウスでカーソルを移動することはお勧めしません。
|
|
||||||
|
|
||||||
`#define TERMINAL_HELP` は、このページでは実際には必要のない他の出力ヘルパーを有効にします。
|
|
||||||
|
|
||||||
"上矢印" および "下矢印" により、過去に入力した5つのコマンドを順に切り替えることができます。
|
|
||||||
|
|
||||||
## 今後のアイデア
|
|
||||||
|
|
||||||
* キーボード/ユーザ拡張可能なコマンド
|
|
||||||
* より小さなフットプリント
|
|
||||||
* 矢印キーのサポート
|
|
||||||
* コマンド履歴 - 完了
|
|
||||||
* SD カードのサポート
|
|
||||||
* バッファディスプレイのための LCD サポート
|
|
||||||
* キーコード -> 名称の対応表
|
|
||||||
* レイヤー状態
|
|
||||||
* *アナログ/デジタル ポートの読み込み/書き込み*
|
|
||||||
* RGB モード関連機能
|
|
||||||
* マクロ定義
|
|
||||||
* EEPROM の読み込み/書き込み
|
|
||||||
* オーディオ制御
|
|
||||||
|
|
||||||
## 現在のコマンド
|
|
||||||
|
|
||||||
### `about`
|
|
||||||
|
|
||||||
現在の QMK のバージョンとビルドした日の出力:
|
|
||||||
|
|
||||||
```
|
|
||||||
> about
|
|
||||||
QMK Firmware
|
|
||||||
v0.5.115-7-g80ed73-dirty
|
|
||||||
Built: 2017-08-29-20:24:44
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### `print-buffer`
|
|
||||||
|
|
||||||
最後に入力した5つのコマンドの出力
|
|
||||||
|
|
||||||
```
|
|
||||||
> print-buffer
|
|
||||||
0. print-buffer
|
|
||||||
1. help
|
|
||||||
2. about
|
|
||||||
3. keymap 0
|
|
||||||
4. help
|
|
||||||
5. flush-buffer
|
|
||||||
```
|
|
||||||
|
|
||||||
### `flush-buffer`
|
|
||||||
|
|
||||||
コマンドバッファをクリア
|
|
||||||
```
|
|
||||||
> flush-buffer
|
|
||||||
Buffer cleared!
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### `help`
|
|
||||||
|
|
||||||
|
|
||||||
利用可能なコマンドの出力:
|
|
||||||
|
|
||||||
```
|
|
||||||
> help
|
|
||||||
commands available:
|
|
||||||
about help keycode keymap exit print-buffer flush-buffer
|
|
||||||
```
|
|
||||||
|
|
||||||
### `keycode <layer> <row> <col>`
|
|
||||||
|
|
||||||
特定のレイヤー、行および列のキーコード値の出力:
|
|
||||||
|
|
||||||
```
|
|
||||||
> keycode 0 1 0
|
|
||||||
0x29 (41)
|
|
||||||
```
|
|
||||||
|
|
||||||
### `keymap <layer>`
|
|
||||||
|
|
||||||
特定のレイヤーの全てのキーマップの出力
|
|
||||||
|
|
||||||
```
|
|
||||||
> keymap 0
|
|
||||||
0x002b, 0x0014, 0x001a, 0x0008, 0x0015, 0x0017, 0x001c, 0x0018, 0x000c, 0x0012, 0x0013, 0x002a,
|
|
||||||
0x0029, 0x0004, 0x0016, 0x0007, 0x0009, 0x000a, 0x000b, 0x000d, 0x000e, 0x000f, 0x0033, 0x0034,
|
|
||||||
0x00e1, 0x001d, 0x001b, 0x0006, 0x0019, 0x0005, 0x0011, 0x0010, 0x0036, 0x0037, 0x0038, 0x0028,
|
|
||||||
0x5cd6, 0x00e0, 0x00e2, 0x00e3, 0x5cd4, 0x002c, 0x002c, 0x5cd5, 0x0050, 0x0051, 0x0052, 0x004f,
|
|
||||||
>
|
|
||||||
```
|
|
||||||
|
|
||||||
### `exit`
|
|
||||||
|
|
||||||
ターミナルの終了 - `TERM_OFF` と同じ。
|
|
||||||
|
|
@ -161,7 +161,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
* [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_combo.c#L115)
|
* [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_combo.c#L115)
|
||||||
* [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77)
|
* [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77)
|
||||||
* [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94)
|
* [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94)
|
||||||
* [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_terminal.c#L264)
|
|
||||||
* [Quantum 固有のキーコードを識別して処理する](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291)
|
* [Quantum 固有のキーコードを識別して処理する](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291)
|
||||||
|
|
||||||
この一連のイベントの中の任意のステップで (`process_record_kb()` のような)関数は `false` を返して、以降の処理を停止することができます。
|
この一連のイベントの中の任意のステップで (`process_record_kb()` のような)関数は `false` を返して、以降の処理を停止することができます。
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ As such, if you wish to override this API consider limiting use to writing to lo
|
||||||
| `#define STM32_BOOTLOADER_DUAL_BANK` | Relevant for dual-bank STM32 MCUs, signifies that a GPIO is to be toggled in order to enter bootloader mode. | `FALSE` |
|
| `#define STM32_BOOTLOADER_DUAL_BANK` | Relevant for dual-bank STM32 MCUs, signifies that a GPIO is to be toggled in order to enter bootloader mode. | `FALSE` |
|
||||||
| `#define STM32_BOOTLOADER_DUAL_BANK_GPIO` | Relevant for dual-bank STM32 MCUs, the pin to toggle when attempting to enter bootloader mode, e.g. `B8` | `<none>` |
|
| `#define STM32_BOOTLOADER_DUAL_BANK_GPIO` | Relevant for dual-bank STM32 MCUs, the pin to toggle when attempting to enter bootloader mode, e.g. `B8` | `<none>` |
|
||||||
| `#define STM32_BOOTLOADER_DUAL_BANK_POLARITY` | Relevant for dual-bank STM32 MCUs, the value to set the pin to in order to trigger charging of the RC circuit. e.g. `0` or `1`. | `0` |
|
| `#define STM32_BOOTLOADER_DUAL_BANK_POLARITY` | Relevant for dual-bank STM32 MCUs, the value to set the pin to in order to trigger charging of the RC circuit. e.g. `0` or `1`. | `0` |
|
||||||
| `#define STM32_BOOTLOADER_DUAL_BANK_DELAY` | Relevant for dual-bank STM32 MCUs, an arbitrary measurement of time to delay before resetting the MCU. Increasing number increases the delay. | `100000` |
|
| `#define STM32_BOOTLOADER_DUAL_BANK_DELAY` | Relevant for dual-bank STM32 MCUs, an arbitrary measurement of time to delay before resetting the MCU. Increasing number increases the delay. | `100` |
|
||||||
|
|
||||||
Kinetis MCUs have no configurable options.
|
Kinetis MCUs have no configurable options.
|
||||||
|
|
||||||
|
|
|
||||||
125
docs/platformdev_rp2040.md
Normal file
125
docs/platformdev_rp2040.md
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
# Raspberry Pi RP2040
|
||||||
|
|
||||||
|
The following table shows the current driver status for peripherals on RP2040 MCUs:
|
||||||
|
|
||||||
|
| System | Support |
|
||||||
|
| ------------------------------------ | ---------------------------------------------- |
|
||||||
|
| [ADC driver](adc_driver.md) | Support planned (no ETA) |
|
||||||
|
| [Audio](audio_driver.md) | Support planned (no ETA) |
|
||||||
|
| [I2C driver](i2c_driver.md) | :heavy_check_mark: |
|
||||||
|
| [SPI driver](spi_driver.md) | :heavy_check_mark: |
|
||||||
|
| [WS2812 driver](ws2812_driver.md) | :heavy_check_mark: using `PIO` driver |
|
||||||
|
| [External EEPROMs](eeprom_driver.md) | :heavy_check_mark: using `I2C` or `SPI` driver |
|
||||||
|
| [EEPROM emulation](eeprom_driver.md) | Support planned (no ETA) |
|
||||||
|
| [serial driver](serial_driver.md) | :heavy_check_mark: using `SIO` or `PIO` driver |
|
||||||
|
| [UART driver](uart_driver.md) | Support planned (no ETA) |
|
||||||
|
|
||||||
|
## GPIO
|
||||||
|
|
||||||
|
<img alt="Raspberry Pi Pico pinout" src="https://i.imgur.com/nLaiYDE.jpg" width="48%"/>
|
||||||
|
<img alt="Sparkfun RP2040 Pro Micro pinout" src="https://i.imgur.com/1TPAhrs.jpg" width="48%"/>
|
||||||
|
|
||||||
|
!> The GPIO pins of the RP2040 are not 5V tolerant!
|
||||||
|
|
||||||
|
### Pin nomenclature
|
||||||
|
|
||||||
|
To address individual pins on the RP2040, QMK uses the `GPx` abbreviation -- where the `x` stands for the GPIO number of the pin. This number can likely be found on the official pinout diagram of your board. Note that these GPIO numbers match the RP2040 MCU datasheet, and don't necessarily match the number you see printed on the board. For instance the Raspberry Pi Pico uses numbers from 1 to 40 for their pins, but these are not identical to the RP2040's GPIO numbers. So if you want to use the pin 11 of the Pico for your keyboard, you would refer to it as `GP8` in the config files.
|
||||||
|
|
||||||
|
### Alternate functions
|
||||||
|
|
||||||
|
The RP2040 features flexible GPIO function multiplexing, this means that every pin can be connected to nearly all the internal peripherals like I2C, SPI, UART or PWM. This allows for flexible PCB designs that are much less restricted in the selection of GPIO pins. To find out which pin can use which peripheral refer to the official [Raspberry PI RP2040 datasheet](https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf#page=14) section 1.4.3 GPIO functions.
|
||||||
|
|
||||||
|
## Selecting hardware peripherals and drivers
|
||||||
|
|
||||||
|
QMK RP2040 support builds upon ChibiOS and thus follows their convention for activating drivers and associated hardware peripherals. These tables only give a quick overview which values have to be used, please refer to the ChibiOS specific sections on the driver pages.
|
||||||
|
|
||||||
|
### I2C Driver
|
||||||
|
|
||||||
|
| RP2040 Peripheral | `mcuconf.h` values | `I2C_DRIVER` |
|
||||||
|
| ----------------- | ------------------ | ------------ |
|
||||||
|
| `I2C0` | `RP_I2C_USE_I2C0` | `I2CD1` |
|
||||||
|
| `I2C1` | `RP_I2C_USE_I2C1` | `I2CD2` |
|
||||||
|
|
||||||
|
To configure the I2C driver please read the [ChibiOS/ARM](i2c_driver.md#arm-configuration) section.
|
||||||
|
|
||||||
|
### SPI Driver
|
||||||
|
|
||||||
|
| RP2040 Peripheral | `mcuconf.h` values | `SPI_DRIVER` |
|
||||||
|
| ----------------- | ------------------ | ------------ |
|
||||||
|
| `SPI0` | `RP_SPI_USE_SPI0` | `SPID0` |
|
||||||
|
| `SPI1` | `RP_SPI_USE_SPI1` | `SPID1` |
|
||||||
|
|
||||||
|
To configure the SPI driver please read the [ChibiOS/ARM](spi_driver.md#chibiosarm-configuration) section.
|
||||||
|
|
||||||
|
## Double-tap reset boot-loader entry :id=double-tap
|
||||||
|
|
||||||
|
The double-tap reset mechanism is an alternate way in QMK to enter the embedded mass storage UF2 boot-loader of the RP2040. It enables bootloader entry by a fast double-tap of the reset pin on start up, which is similar to the behavior of AVR Pro Micros. This feature activated by default for the Pro Micro RP2040 board, but has to be configured for other boards. To activate it, add the following options to your keyboards `config.h` file:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET // Activates the double-tap behavior
|
||||||
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 200U // Timeout window in ms in which the double tap can occur.
|
||||||
|
#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED_MASK 0U // Specify a optional status led which blinks when entering the bootloader
|
||||||
|
```
|
||||||
|
|
||||||
|
## Pre-defined RP2040 boards
|
||||||
|
|
||||||
|
QMK defines two boards that you can choose from to base your RP2040 powered keyboard upon. These boards provide pre-configured default pins and drivers.
|
||||||
|
|
||||||
|
### Generic Pro Micro RP2040
|
||||||
|
|
||||||
|
This is the default board that is chosen, unless any other RP2040 board is selected in your keyboards `rules.mk` file. It assumes a pin layout for the I2C, SPI and Serial drivers which is identical to the Sparkfun Pro Micro RP2040, however all values can be overwritten by defining them in your keyboards `config.h` file. The [double-tap](#double-tap) reset to enter boot-loader behavior is activated by default.
|
||||||
|
|
||||||
|
|
||||||
|
| Driver configuration define | Value |
|
||||||
|
| -------------------------------------------------------------------------- | ------------------------------------ |
|
||||||
|
| **I2C driver** | |
|
||||||
|
| `I2C_DRIVER` | `I2CD2` |
|
||||||
|
| `I2C1_SDA_PIN` | `GP2` |
|
||||||
|
| `I2C1_SCL_PIN` | `GP3` |
|
||||||
|
| **SPI driver** | |
|
||||||
|
| `SPI_DRIVER` | `SPID0` |
|
||||||
|
| `SPI_SCK_PIN` | `GP18` |
|
||||||
|
| `SPI_MISO_PIN` | `GP20` |
|
||||||
|
| `SPI_MOSI_PIN` | `GP19` |
|
||||||
|
| **Serial driver** | |
|
||||||
|
| `SERIAL_USART_DRIVER` ([SIO Driver](serial_driver.md#the-sio-driver) only) | `SIOD0` |
|
||||||
|
| `SOFT_SERIAL_PIN` | undefined, use `SERIAL_USART_TX_PIN` |
|
||||||
|
| `SERIAL_USART_TX_PIN` | `GP0` |
|
||||||
|
| `SERIAL_USART_RX_PIN` | `GP1` |
|
||||||
|
|
||||||
|
?> The pin-outs of Adafruit's KB2040 and Boardsource's Blok both deviate from the Sparkfun Pro Micro RP2040. Lookup the pin-out of these boards and adjust your keyboards pin definition accordingly if you want to use these boards.
|
||||||
|
|
||||||
|
### Generic RP2040 board
|
||||||
|
|
||||||
|
This board can be chosen as a base for RP2040 keyboards which configure all necessary pins and drivers themselves and do not wish to leverage the configuration matching the Generic Pro Micro RP2040 board. Thus it doesn't provide any pre-configured pins or drivers. To select this board add the following line to your keyboards `rules.mk` file.
|
||||||
|
|
||||||
|
```make
|
||||||
|
BOARD = GENERIC_RP_RP2040
|
||||||
|
```
|
||||||
|
|
||||||
|
## Split keyboard support
|
||||||
|
|
||||||
|
Split keyboards are fully supported using the [serial driver](serial_driver.md) in both full-duplex and half-duplex configurations. Two driver subsystems are supported by the RP2040, the hardware UART based `SIO` and the Programmable IO based `PIO` driver.
|
||||||
|
|
||||||
|
| Feature | [SIO Driver](serial_driver.md#the-sio-driver) | [PIO Driver](serial_driver.md#the-pio-driver) |
|
||||||
|
| ----------------------------- | --------------------------------------------- | --------------------------------------------- |
|
||||||
|
| Half-Duplex operation | | :heavy_check_mark: |
|
||||||
|
| Full-Duplex operation | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
|
| `TX` and `RX` pin swapping | | :heavy_check_mark: |
|
||||||
|
| Any GPIO as `TX` and `RX` pin | Only UART capable pins | :heavy_check_mark: |
|
||||||
|
| Simple configuration | | :heavy_check_mark: |
|
||||||
|
|
||||||
|
The `PIO` driver is much more flexible then the `SIO` driver, the only "downside" is the usage of `PIO` resources which in turn are not available for advanced user programs. Under normal circumstances, this resource allocation will be a non-issue.
|
||||||
|
|
||||||
|
## RP2040 second stage bootloader selection
|
||||||
|
|
||||||
|
As the RP2040 does not have any internal flash memory it depends on an external SPI flash memory chip to store and execute instructions from. To successfully interact with a wide variety of these chips a second stage bootloader that is compatible with the chosen external flash memory has to be supplied with each firmware image. By default an `W25Q080` compatible bootloader is assumed, but others can be chosen by adding one of the defines listed in the table below to your keyboards `config.h` file.
|
||||||
|
|
||||||
|
| Compatible with flash chip | Selection |
|
||||||
|
| :------------------------- | ---------------------------------- |
|
||||||
|
| W25Q080 | Selected by default |
|
||||||
|
| AT25SF128A | `#define RP2040_FLASH_AT25SF128A` |
|
||||||
|
| GD25Q64CS | `#define RP2040_FLASH_GD25Q64CS` |
|
||||||
|
| W25X10CL | `#define RP2040_FLASH_W25X10CL` |
|
||||||
|
| IS25LP080 | `#define RP2040_FLASH_IS25LP080` |
|
||||||
|
| Generic 03H flash | `#define RP2040_FLASH_GENERIC_03H` |
|
||||||
|
|
@ -187,3 +187,39 @@ Example:
|
||||||
```
|
```
|
||||||
|
|
||||||
The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood.
|
The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood.
|
||||||
|
|
||||||
|
### Encoders
|
||||||
|
|
||||||
|
This section controls the basic [rotary encoder](feature_encoders.md) support.
|
||||||
|
|
||||||
|
The following items can be set. Not every value is required.
|
||||||
|
|
||||||
|
* `pin_a`
|
||||||
|
* __Required__. A pad definition
|
||||||
|
* `pin_b`
|
||||||
|
* __Required__. B pad definition
|
||||||
|
* `resolution`
|
||||||
|
* How many pulses the encoder registers between each detent
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"encoder": {
|
||||||
|
"rotary": [
|
||||||
|
{ "pin_a": "B5", "pin_b": "A2" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"encoder": {
|
||||||
|
"rotary": [
|
||||||
|
{ "pin_a": "B5", "pin_b": "A2", "resolution": 4 }
|
||||||
|
{ "pin_a": "B6", "pin_b": "A3", "resolution": 2 }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,129 +1,301 @@
|
||||||
# 'serial' Driver
|
# 'serial' Driver
|
||||||
This driver powers the [Split Keyboard](feature_split_keyboard.md) feature.
|
|
||||||
|
The serial driver powers the [Split Keyboard](feature_split_keyboard.md) feature. Several implementations are available, depending on the platform of your split keyboard. Note that none of the drivers support split keyboards with more then two halves.
|
||||||
|
|
||||||
|
| Driver | AVR | ARM | Connection between halves |
|
||||||
|
| --------------------------------------- | ------------------ | ------------------ | --------------------------------------------------------------------------------------------- |
|
||||||
|
| [Bitbang](#bitbang) | :heavy_check_mark: | :heavy_check_mark: | Single wire communication. One wire is used for reception and transmission. |
|
||||||
|
| [USART Half-duplex](#usart-half-duplex) | | :heavy_check_mark: | Efficient single wire communication. One wire is used for reception and transmission. |
|
||||||
|
| [USART Full-duplex](#usart-full-duplex) | | :heavy_check_mark: | Efficient two wire communication. Two distinct wires are used for reception and transmission. |
|
||||||
|
|
||||||
?> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards.
|
?> Serial in this context should be read as **sending information one bit at a time**, rather than implementing UART/USART/RS485/RS232 standards.
|
||||||
|
|
||||||
Drivers in this category have the following characteristics:
|
<hr>
|
||||||
* bit bang and USART Half-duplex provide data and signaling over a single conductor
|
|
||||||
* USART Full-duplex provide data and signaling over two conductors
|
|
||||||
* They are all limited to single master and single slave communication scheme
|
|
||||||
|
|
||||||
## Supported Driver Types
|
## Bitbang
|
||||||
|
|
||||||
| | AVR | ARM |
|
This is the Default driver, the absence of configuration assumes this driver. It works by [bit banging](https://en.wikipedia.org/wiki/Bit_banging) a GPIO pin using the CPU. It is therefore not as efficient as a dedicated hardware peripheral, which the Half-duplex and Full-duplex drivers use.
|
||||||
| ----------------- | ------------------ | ------------------ |
|
|
||||||
| bit bang | :heavy_check_mark: | :heavy_check_mark: |
|
|
||||||
| USART Half-duplex | | :heavy_check_mark: |
|
|
||||||
| USART Full-duplex | | :heavy_check_mark: |
|
|
||||||
|
|
||||||
## Driver configuration
|
!> On ARM platforms the bitbang driver causes connection issues when using it together with the bitbang WS2812 driver. Choosing alternate drivers for both serial and WS2812 (instead of bitbang) is strongly recommended.
|
||||||
|
|
||||||
### Bitbang
|
### Pin configuration
|
||||||
Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
|
|
||||||
|
```
|
||||||
|
LEFT RIGHT
|
||||||
|
+-------+ SERIAL +-------+
|
||||||
|
| SSP |-----------------| SSP |
|
||||||
|
| | VDD | |
|
||||||
|
| |-----------------| |
|
||||||
|
| | GND | |
|
||||||
|
| |-----------------| |
|
||||||
|
+-------+ +-------+
|
||||||
|
```
|
||||||
|
|
||||||
|
One GPIO pin is needed for the bitbang driver, as only one wire is used for receiving and transmitting data. This pin is referred to as the `SOFT_SERIAL_PIN` (SSP) in the configuration. A simple TRS or USB cable provides enough conductors for this driver to work.
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
To use the bitbang driver follow these steps to activate it.
|
||||||
|
|
||||||
|
1. Change the `SERIAL_DRIVER` to `bitbang` in your keyboards `rules.mk` file:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
SERIAL_DRIVER = bitbang
|
SERIAL_DRIVER = bitbang
|
||||||
```
|
```
|
||||||
|
|
||||||
Configure the driver via your config.h:
|
2. Configure the GPIO pin of your keyboard via the `config.h` file:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||||
#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
|
|
||||||
// 0: about 189kbps (Experimental only)
|
|
||||||
// 1: about 137kbps (default)
|
|
||||||
// 2: about 75kbps
|
|
||||||
// 3: about 39kbps
|
|
||||||
// 4: about 26kbps
|
|
||||||
// 5: about 20kbps
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### ARM
|
3. On ARM platforms you must turn on ChibiOS `PAL_USE_CALLBACKS` feature:
|
||||||
|
|
||||||
!> The bitbang driver causes connection issues with bitbang WS2812 driver
|
* In `halconf.h` add the line `#define PAL_USE_CALLBACKS TRUE`.
|
||||||
|
|
||||||
Along with the generic options above, you must also turn on the `PAL_USE_CALLBACKS` feature in your halconf.h.
|
<hr>
|
||||||
|
|
||||||
### USART Half-duplex
|
## USART Half-duplex
|
||||||
Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. `SERIAL_PIN_TX` for this driver is the configured USART TX pin. As this Pin is configured in open-drain mode an **external pull-up resistor is needed to keep the line high** (resistor values of 1.5k to 8.2k are known to work). To configure it, add this to your rules.mk:
|
|
||||||
|
Targeting ARM boards based on ChibiOS, where communication is offloaded to a USART hardware device that supports Half-duplex operation. The advantages over bitbanging are fast, accurate timings and reduced CPU usage. Therefore it is advised to choose this driver or the Full-duplex driver whenever possible.
|
||||||
|
|
||||||
|
### Pin configuration
|
||||||
|
|
||||||
|
```
|
||||||
|
LEFT RIGHT
|
||||||
|
+-------+ | | +-------+
|
||||||
|
| | R R | |
|
||||||
|
| | | SERIAL | | |
|
||||||
|
| TX |-----------------| TX |
|
||||||
|
| | VDD | |
|
||||||
|
| |-----------------| |
|
||||||
|
| | GND | |
|
||||||
|
| |-----------------| |
|
||||||
|
+-------+ +-------+
|
||||||
|
```
|
||||||
|
|
||||||
|
Only one GPIO pin is needed for the Half-duplex driver, as only one wire is used for receiving and transmitting data. This pin is referred to as the `SERIAL_USART_TX_PIN` in the configuration. Take care that the pin you chose can act as the TX pin of the USART peripheral. A simple TRS or USB cable provides enough conductors for this driver to work. As the split connection is configured to work in open-drain mode, an **external pull-up resistor is needed to keep the line high**. Resistor values of 1.5kΩ to 8.2kΩ are known to work.
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
To use the Half-duplex driver follow these steps to activate it. If you target the Raspberry Pi RP2040 PIO implementation skip step 1.
|
||||||
|
|
||||||
|
1. Change the `SERIAL_DRIVER` to `usart` in your keyboards `rules.mk` file:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
SERIAL_DRIVER = usart
|
SERIAL_DRIVER = usart
|
||||||
```
|
```
|
||||||
|
|
||||||
Configure the hardware via your config.h:
|
2. (RP2040 PIO only!) Change the `SERIAL_DRIVER` to `vendor` in your keyboards `rules.mk` file:
|
||||||
|
|
||||||
|
```make
|
||||||
|
SERIAL_DRIVER = vendor
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Configure the hardware of your keyboard via the `config.h` file:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define SOFT_SERIAL_PIN B6 // USART TX pin
|
#define SERIAL_USART_TX_PIN B6 // The GPIO pin that is used split communication.
|
||||||
//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
|
|
||||||
#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
|
|
||||||
// 0: about 460800 baud
|
|
||||||
// 1: about 230400 baud (default)
|
|
||||||
// 2: about 115200 baud
|
|
||||||
// 3: about 57600 baud
|
|
||||||
// 4: about 38400 baud
|
|
||||||
// 5: about 19200 baud
|
|
||||||
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
|
|
||||||
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
|
||||||
#define SERIAL_USART_TIMEOUT 20 // USART driver timeout. default 20
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You must also enable the ChibiOS `SERIAL` feature:
|
For STM32 MCUs several GPIO configuration options can be changed as well. See the section ["Alternate Functions for selected STM32 MCUs"](alternate-functions-for-selected-stm32-mcus).
|
||||||
* In your board's halconf.h: `#define HAL_USE_SERIAL TRUE`
|
|
||||||
* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU)
|
|
||||||
|
|
||||||
Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral.
|
```c
|
||||||
|
#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
|
||||||
|
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||||
|
```
|
||||||
|
|
||||||
### USART Full-duplex
|
1. Decide either for `SERIAL`, `SIO` or `PIO` subsystem, see the section ["Choosing a driver subsystem"](#choosing-a-driver-subsystem).
|
||||||
Targeting STM32 boards where communication is offloaded to a USART hardware device. The advantage over bitbang is that this provides fast and accurate timings. USART Full-Duplex requires two conductors **without** pull-up resistors instead of one conductor with a pull-up resistor unlike the Half-duplex driver. Due to its internal design it is more efficent, which can result in even faster transmission speeds.
|
|
||||||
|
|
||||||
#### Pin configuration
|
<hr>
|
||||||
|
|
||||||
`SERIAL_USART_TX_PIN` is the USART `TX` pin, `SERIAL_USART_RX_PIN` is the USART `RX` pin. No external pull-up resistors are needed as the `TX` pin operates in push-pull mode. To use this driver the usart peripherals `TX` and `RX` pins must be configured with the correct Alternate-functions. If you are using a Proton-C everything is already setup, same is true for STM32F103 MCUs. For MCUs which are using a modern flexible GPIO configuration you have to specify these by setting `SERIAL_USART_TX_PAL_MODE` and `SERIAL_USART_RX_PAL_MODE`. Refeer to the corresponding datasheets of your MCU or find those settings in the table below.
|
## USART Full-duplex
|
||||||
|
|
||||||
#### Connecting the halves and Pin Swap
|
Targeting ARM boards based on ChibiOS where communication is offloaded to an USART hardware device. The advantages over bitbanging are fast, accurate timings and reduced CPU usage. Therefore it is advised to choose this driver or the Full-duplex driver whenever possible. Due to its internal design it is slightly more efficient then the Half-duplex driver, but it should be primarily chosen if Half-duplex operation is not supported by the USART peripheral.
|
||||||
Please note that `TX` of the master half has to be connected with the `RX` pin of the slave half and `RX` of the master half has to be connected with the `TX` pin of the slave half! Usually this pin swap has to be done outside of the MCU e.g. with cables or on the pcb. Some MCUs like the STM32F303 used on the Proton-C allow this pin swap directly inside the MCU, this feature can be enabled using `#define SERIAL_USART_PIN_SWAP` in your config.h.
|
|
||||||
|
|
||||||
#### Setup
|
### Pin configuration
|
||||||
To use the driver, add this to your rules.mk:
|
|
||||||
|
```
|
||||||
|
LEFT RIGHT
|
||||||
|
+-------+ +-------+
|
||||||
|
| | SERIAL | |
|
||||||
|
| TX |-----------------| RX |
|
||||||
|
| | SERIAL | |
|
||||||
|
| RX |-----------------| TX |
|
||||||
|
| | VDD | |
|
||||||
|
| |-----------------| |
|
||||||
|
| | GND | |
|
||||||
|
| |-----------------| |
|
||||||
|
+-------+ +-------+
|
||||||
|
```
|
||||||
|
|
||||||
|
Two GPIO pins are needed for the Full-duplex driver, as two distinct wires are used for receiving and transmitting data. The pin transmitting data is the `TX` pin and refereed to as the `SERIAL_USART_TX_PIN`, the pin receiving data is the `RX` pin and refereed to as the `SERIAL_USART_RX_PIN` in this configuration. Please note that `TX` pin of the master half has to be connected with the `RX` pin of the slave half and the `RX` pin of the master half has to be connected with the `TX` pin of the slave half! Usually this pin swap has to be done outside of the MCU e.g. with cables or on the PCB. Some MCUs like the STM32F303 used on the Proton-C allow this pin swap directly inside the MCU. A simple TRRS or USB cable provides enough conductors for this driver to work.
|
||||||
|
|
||||||
|
To use this driver the usart peripherals `TX` and `RX` pins must be configured with the correct Alternate-functions. If you are using a Proton-C everything is already setup, same is true for STM32F103 MCUs. For MCUs which are using a modern flexible GPIO configuration you have to specify these by setting `SERIAL_USART_TX_PAL_MODE` and `SERIAL_USART_RX_PAL_MODE`. Refer to the corresponding datasheets of your MCU or find those settings in the section ["Alternate Functions for selected STM32 MCUs"](#alternate-functions-for-selected-stm32-mcus).
|
||||||
|
|
||||||
|
### Setup
|
||||||
|
|
||||||
|
To use the Full-duplex driver follow these steps to activate it. If you target the Raspberry Pi RP2040 PIO implementation skip step 1.
|
||||||
|
|
||||||
|
1. Change the `SERIAL_DRIVER` to `usart` in your keyboards `rules.mk` file:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
SERIAL_DRIVER = usart
|
SERIAL_DRIVER = usart
|
||||||
```
|
```
|
||||||
|
|
||||||
Next configure the hardware via your config.h:
|
2. (RP2040 PIO only!) Change the `SERIAL_DRIVER` to `vendor` in your keyboards `rules.mk` file:
|
||||||
|
|
||||||
|
```make
|
||||||
|
SERIAL_DRIVER = vendor
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Configure the hardware of your keyboard via the `config.h` file:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
|
#define SERIAL_USART_FULL_DUPLEX // Enable full duplex operation mode.
|
||||||
#define SERIAL_USART_TX_PIN B6 // USART TX pin
|
#define SERIAL_USART_TX_PIN B6 // USART TX pin
|
||||||
#define SERIAL_USART_RX_PIN B7 // USART RX pin
|
#define SERIAL_USART_RX_PIN B7 // USART RX pin
|
||||||
//#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
|
```
|
||||||
//#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve.
|
|
||||||
// Check if this feature is necessary with your keyboard design and available on the mcu.
|
For STM32 MCUs several GPIO configuration options, including the ability for `TX` to `RX` pin swapping, can be changed as well. See the section ["Alternate Functions for selected STM32 MCUs"](alternate-functions-for-selected-stm32-mcus).
|
||||||
#define SELECT_SOFT_SERIAL_SPEED 1 // or 0, 2, 3, 4, 5
|
|
||||||
// 0: 460800 baud
|
```c
|
||||||
// 1: 230400 baud (default)
|
#define SERIAL_USART_PIN_SWAP // Swap TX and RX pins if keyboard is master halve. (Only available on some MCUs)
|
||||||
// 2: 115200 baud
|
#define USART1_REMAP // Remap USART TX and RX pins on STM32F103 MCUs, see table below.
|
||||||
// 3: 57600 baud
|
|
||||||
// 4: 38400 baud
|
|
||||||
// 5: 19200 baud
|
|
||||||
#define SERIAL_USART_DRIVER SD1 // USART driver of TX and RX pin. default: SD1
|
|
||||||
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||||
#define SERIAL_USART_RX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
```
|
||||||
|
|
||||||
|
1. Decide either for `SERIAL`, `SIO` or `PIO` subsystem, see the section ["Choosing a driver subsystem"](#choosing-a-driver-subsystem).
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
## Choosing a driver subsystem
|
||||||
|
|
||||||
|
### The `SERIAL` driver
|
||||||
|
|
||||||
|
The `SERIAL` Subsystem is supported for the majority of ChibiOS MCUs and should be used whenever supported. Follow these steps in order to activate it:
|
||||||
|
|
||||||
|
1. In your keyboards `halconf.h` add:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define HAL_USE_SERIAL TRUE
|
||||||
|
```
|
||||||
|
|
||||||
|
2. In your keyboards `mcuconf.h`: activate the USART peripheral that is used on your MCU. The shown example is for an STM32 MCU, so this will not work on MCUs by other manufacturers. You can find the correct names in the `mcuconf.h` files of your MCU that ship with ChibiOS.
|
||||||
|
|
||||||
|
Just below `#include_next <mcuconf.h>` add:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#include_next <mcuconf.h>
|
||||||
|
|
||||||
|
#undef STM32_SERIAL_USE_USARTn
|
||||||
|
#define STM32_SERIAL_USE_USARTn TRUE
|
||||||
|
```
|
||||||
|
|
||||||
|
Where 'n' matches the peripheral number of your selected USART on the MCU.
|
||||||
|
|
||||||
|
3. In you keyboards `config.h`: override the default USART `SERIAL` driver if you use a USART peripheral that does not belong to the default selected `SD1` driver. For instance, if you selected `STM32_SERIAL_USE_USART3` the matching driver would be `SD3`.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define SERIAL_USART_DRIVER SD3
|
||||||
|
```
|
||||||
|
|
||||||
|
### The `SIO` driver
|
||||||
|
|
||||||
|
The `SIO` Subsystem was added to ChibiOS with the 21.11 release and is only supported on selected MCUs. It should only be chosen when the `SERIAL` subsystem is not supported by your MCU.
|
||||||
|
|
||||||
|
Follow these steps in order to activate it:
|
||||||
|
|
||||||
|
1. In your keyboards `halconf.h` add:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define HAL_USE_SIO TRUE
|
||||||
|
```
|
||||||
|
|
||||||
|
2. In your keyboards `mcuconf.h:` activate the USART peripheral that is used on your MCU. The shown example is for an STM32 MCU, so this will not work on MCUs by other manufacturers. You can find the correct names in the `mcuconf.h` files of your MCU that ship with ChibiOS.
|
||||||
|
|
||||||
|
Just below `#include_next <mcuconf.h>` add:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#include_next <mcuconf.h>
|
||||||
|
|
||||||
|
#undef STM32_SIO_USE_USARTn
|
||||||
|
#define STM32_SIO_USE_USARTn TRUE
|
||||||
|
```
|
||||||
|
|
||||||
|
Where 'n' matches the peripheral number of your selected USART on the MCU.
|
||||||
|
|
||||||
|
3. In you keyboards `config.h`: override the default USART `SIO` driver if you use a USART peripheral that does not belong to the default selected `SIOD1` driver. For instance, if you selected `STM32_SERIAL_USE_USART3` the matching driver would be `SIOD3`.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define SERIAL_USART_DRIVER SIOD3
|
||||||
|
```
|
||||||
|
|
||||||
|
### The `PIO` driver
|
||||||
|
|
||||||
|
The `PIO` subsystem is a Raspberry Pi RP2040 specific implementation, using the integrated PIO peripheral and is therefore only available on this MCU. Because of the flexible nature of the PIO peripherals, **any** GPIO pin can be used as a `TX` or `RX` pin. Half-duplex and Full-duplex operation is fully supported. The Half-duplex operation mode uses the built-in pull-ups and GPIO manipulation on the RP2040 to drive the line high by default. An external pull-up is therefore not necessary.
|
||||||
|
|
||||||
|
Configure the hardware via your config.h:
|
||||||
|
```c
|
||||||
|
#define SERIAL_PIO_USE_PIO1 // Force the usage of PIO1 peripheral, by default the Serial implementation uses the PIO0 peripheral
|
||||||
|
```
|
||||||
|
|
||||||
|
The Serial PIO program uses 2 state machines, 13 instructions and the complete interrupt handler of the PIO peripheral it is running on.
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
## Advanced Configuration
|
||||||
|
|
||||||
|
There are several advanced configuration options that can be defined in your keyboards `config.h` file:
|
||||||
|
|
||||||
|
### Baudrate
|
||||||
|
|
||||||
|
If you're having issues or need a higher baudrate with serial communication, you can change the baudrate which in turn controls the communication speed for serial. You want to lower the baudrate if you experience failed transactions.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define SELECT_SOFT_SERIAL_SPEED {#}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Speed | Bitbang | Half-duplex and Full-duplex |
|
||||||
|
| ----- | -------------------------- | --------------------------- |
|
||||||
|
| `0` | 189000 baud (experimental) | 460800 baud |
|
||||||
|
| `1` | 137000 baud (default) | 230400 baud (default) |
|
||||||
|
| `2` | 75000 baud | 115200 baud |
|
||||||
|
| `3` | 39000 baud | 57600 baud |
|
||||||
|
| `4` | 26000 baud | 38400 baud |
|
||||||
|
| `5` | 20000 baud | 19200 baud |
|
||||||
|
|
||||||
|
Alternatively you can specify the baudrate directly by defining `SERIAL_USART_SPEED`.
|
||||||
|
|
||||||
|
### Timeout
|
||||||
|
|
||||||
|
This is the default time window in milliseconds in which a successful communication has to complete. Usually you don't want to change this value. But you can do so anyways by defining an alternate one in your keyboards `config.h` file:
|
||||||
|
|
||||||
|
```c
|
||||||
#define SERIAL_USART_TIMEOUT 20 // USART driver timeout. default 20
|
#define SERIAL_USART_TIMEOUT 20 // USART driver timeout. default 20
|
||||||
```
|
```
|
||||||
|
|
||||||
You must also enable the ChibiOS `SERIAL` feature:
|
<hr>
|
||||||
* In your board's halconf.h: `#define HAL_USE_SERIAL TRUE`
|
|
||||||
* In your board's mcuconf.h: `#define STM32_SERIAL_USE_USARTn TRUE` (where 'n' matches the peripheral number of your selected USART on the MCU)
|
|
||||||
|
|
||||||
Do note that the configuration required is for the `SERIAL` peripheral, not the `UART` peripheral.
|
## Troubleshooting
|
||||||
|
|
||||||
#### Pins for USART Peripherals with Alternate Functions for selected STM32 MCUs
|
If you're having issues withe serial communication, you can enable debug messages that will give you insights which part of the communication failed. The enable these messages add to your keyboards `config.h` file:
|
||||||
|
|
||||||
##### STM32F303 / Proton-C [Datasheet](https://www.st.com/resource/en/datasheet/stm32f303cc.pdf)
|
```c
|
||||||
|
#define SERIAL_DEBUG
|
||||||
|
```
|
||||||
|
|
||||||
|
?> The messages will be printed out to the `CONSOLE` output. For additional information, refer to [Debugging/Troubleshooting QMK](faq_debug.md).
|
||||||
|
|
||||||
|
## Alternate Functions for selected STM32 MCUs
|
||||||
|
|
||||||
|
Pins for USART Peripherals with
|
||||||
|
|
||||||
|
### STM32F303 / Proton-C [Datasheet](https://www.st.com/resource/en/datasheet/stm32f303cc.pdf)
|
||||||
|
|
||||||
Pin Swap available: :heavy_check_mark:
|
Pin Swap available: :heavy_check_mark:
|
||||||
|
|
||||||
| Pin | Function | Mode |
|
| Pin | Function | Mode |
|
||||||
| ---------- | -------- | ---- |
|
| ---------- | -------- | ---- |
|
||||||
| **USART1** | | |
|
| **USART1** | | |
|
||||||
| PA9 | TX | AF7 |
|
| PA9 | TX | AF7 |
|
||||||
|
|
@ -151,11 +323,11 @@ Pin Swap available: :heavy_check_mark:
|
||||||
| PD8 | TX | AF7 |
|
| PD8 | TX | AF7 |
|
||||||
| PD9 | RX | AF7 |
|
| PD9 | RX | AF7 |
|
||||||
|
|
||||||
##### STM32F072 [Datasheet](https://www.st.com/resource/en/datasheet/stm32f072c8.pdf)
|
### STM32F072 [Datasheet](https://www.st.com/resource/en/datasheet/stm32f072c8.pdf)
|
||||||
|
|
||||||
Pin Swap available: :heavy_check_mark:
|
Pin Swap available: :heavy_check_mark:
|
||||||
|
|
||||||
| Pin | Function | Mode |
|
| Pin | Function | Mode |
|
||||||
| ------ | -------- | ---- |
|
| ------ | -------- | ---- |
|
||||||
| USART1 | | |
|
| USART1 | | |
|
||||||
| PA9 | TX | AF1 |
|
| PA9 | TX | AF1 |
|
||||||
|
|
@ -180,7 +352,7 @@ Pin Swap available: :heavy_check_mark:
|
||||||
| PA0 | TX | AF4 |
|
| PA0 | TX | AF4 |
|
||||||
| PA1 | RX | AF4 |
|
| PA1 | RX | AF4 |
|
||||||
|
|
||||||
##### STM32F103 Medium Density (C8-CB) [Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf)
|
### STM32F103 Medium Density (C8-CB) [Datasheet](https://www.st.com/resource/en/datasheet/stm32f103c8.pdf)
|
||||||
|
|
||||||
Pin Swap available: N/A
|
Pin Swap available: N/A
|
||||||
|
|
||||||
|
|
@ -190,7 +362,7 @@ Pin remapping:
|
||||||
|
|
||||||
The pins of USART Peripherals use default Pins that can be remapped to use other pins using the AFIO registers. Default pins are marked **bold**. Add the appropriate defines to your config.h file.
|
The pins of USART Peripherals use default Pins that can be remapped to use other pins using the AFIO registers. Default pins are marked **bold**. Add the appropriate defines to your config.h file.
|
||||||
|
|
||||||
| Pin | Function | Mode | USART_REMAP |
|
| Pin | Function | Mode | USART_REMAP |
|
||||||
| ---------- | -------- | ---- | ------------------- |
|
| ---------- | -------- | ---- | ------------------- |
|
||||||
| **USART1** | | | |
|
| **USART1** | | | |
|
||||||
| **PA9** | TX | AFPP | |
|
| **PA9** | TX | AFPP | |
|
||||||
|
|
|
||||||
|
|
@ -155,7 +155,6 @@ The `process_record()` function itself is deceptively simple, but hidden within
|
||||||
* [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77)
|
* [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_printer.c#L77)
|
||||||
* [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94)
|
* [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_auto_shift.c#L94)
|
||||||
* `bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record)`
|
* `bool process_dynamic_tapping_term(uint16_t keycode, keyrecord_t *record)`
|
||||||
* [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/process_keycode/process_terminal.c#L264)
|
|
||||||
* [Identify and process Quantum-specific keycodes](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291)
|
* [Identify and process Quantum-specific keycodes](https://github.com/qmk/qmk_firmware/blob/e1203a222bb12ab9733916164a000ef3ac48da93/quantum/quantum.c#L291)
|
||||||
|
|
||||||
At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing.
|
At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing.
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,12 @@ These LEDs are called "addressable" because instead of using a wire per color, e
|
||||||
## Supported Driver Types
|
## Supported Driver Types
|
||||||
|
|
||||||
| | AVR | ARM |
|
| | AVR | ARM |
|
||||||
|----------|--------------------|--------------------|
|
| -------- | ------------------ | ------------------ |
|
||||||
| bit bang | :heavy_check_mark: | :heavy_check_mark: |
|
| bit bang | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
| I2C | :heavy_check_mark: | |
|
| I2C | :heavy_check_mark: | |
|
||||||
| SPI | | :heavy_check_mark: |
|
| SPI | | :heavy_check_mark: |
|
||||||
| PWM | | :heavy_check_mark: |
|
| PWM | | :heavy_check_mark: |
|
||||||
|
| PIO | | :heavy_check_mark: |
|
||||||
|
|
||||||
## Driver configuration
|
## Driver configuration
|
||||||
|
|
||||||
|
|
@ -33,11 +34,11 @@ The default setting is 280 µs, which should work for most cases, but this can b
|
||||||
Some variants of the WS2812 may have their color components in a different physical or logical order. For example, the WS2812B-2020 has physically swapped red and green LEDs, which causes the wrong color to be displayed, because the default order of the bytes sent over the wire is defined as GRB.
|
Some variants of the WS2812 may have their color components in a different physical or logical order. For example, the WS2812B-2020 has physically swapped red and green LEDs, which causes the wrong color to be displayed, because the default order of the bytes sent over the wire is defined as GRB.
|
||||||
In this case, you can change the byte order by defining `WS2812_BYTE_ORDER` as one of the following values:
|
In this case, you can change the byte order by defining `WS2812_BYTE_ORDER` as one of the following values:
|
||||||
|
|
||||||
|Byte order |Known devices |
|
| Byte order | Known devices |
|
||||||
|---------------------------------|-----------------------------|
|
| --------------------------------- | ----------------------------- |
|
||||||
|`WS2812_BYTE_ORDER_GRB` (default)|Most WS2812's, SK6812, SK6805|
|
| `WS2812_BYTE_ORDER_GRB` (default) | Most WS2812's, SK6812, SK6805 |
|
||||||
|`WS2812_BYTE_ORDER_RGB` |WS2812B-2020 |
|
| `WS2812_BYTE_ORDER_RGB` | WS2812B-2020 |
|
||||||
|`WS2812_BYTE_ORDER_BGR` |TM1812 |
|
| `WS2812_BYTE_ORDER_BGR` | TM1812 |
|
||||||
|
|
||||||
|
|
||||||
### Bitbang
|
### Bitbang
|
||||||
|
|
@ -54,13 +55,13 @@ WS2812_DRIVER = bitbang
|
||||||
The WS2812 LED communication topology depends on a serialized timed window. Different versions of the addressable LEDs have differing requirements for the timing parameters, for instance, of the SK6812.
|
The WS2812 LED communication topology depends on a serialized timed window. Different versions of the addressable LEDs have differing requirements for the timing parameters, for instance, of the SK6812.
|
||||||
You can tune these parameters through the definition of the following macros:
|
You can tune these parameters through the definition of the following macros:
|
||||||
|
|
||||||
| Macro |Default | AVR | ARM |
|
| Macro | Default | AVR | ARM |
|
||||||
|---------------------|--------------------------------------------|--------------------|--------------------|
|
| --------------- | ---------------------------- | ------------------ | ------------------ |
|
||||||
|`WS2812_TIMING` |`1250` | :heavy_check_mark: | :heavy_check_mark: |
|
| `WS2812_TIMING` | `1250` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
|`WS2812_T0H` |`350` | :heavy_check_mark: | :heavy_check_mark: |
|
| `WS2812_T0H` | `350` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
|`WS2812_T0L` |`WS2812_TIMING - WS2812_T0H` | | :heavy_check_mark: |
|
| `WS2812_T0L` | `WS2812_TIMING - WS2812_T0H` | | :heavy_check_mark: |
|
||||||
|`WS2812_T1H` |`900` | :heavy_check_mark: | :heavy_check_mark: |
|
| `WS2812_T1H` | `900` | :heavy_check_mark: | :heavy_check_mark: |
|
||||||
|`WS2812_T1L` |`WS2812_TIMING - WS2812_T1H` | | :heavy_check_mark: |
|
| `WS2812_T1L` | `WS2812_TIMING - WS2812_T1H` | | :heavy_check_mark: |
|
||||||
|
|
||||||
### I2C
|
### I2C
|
||||||
Targeting boards where WS2812 support is offloaded to a 2nd MCU. Currently the driver is limited to AVR given the known consumers are ps2avrGB/BMC. To configure it, add this to your rules.mk:
|
Targeting boards where WS2812 support is offloaded to a 2nd MCU. Currently the driver is limited to AVR given the known consumers are ps2avrGB/BMC. To configure it, add this to your rules.mk:
|
||||||
|
|
@ -107,16 +108,16 @@ To adjust the baudrate at which the SPI peripheral is configured, users will nee
|
||||||
|
|
||||||
Only divisors of 2, 4, 8, 16, 32, 64, 128 and 256 are supported by hardware.
|
Only divisors of 2, 4, 8, 16, 32, 64, 128 and 256 are supported by hardware.
|
||||||
|
|
||||||
|Define |Default|Description |
|
| Define | Default | Description |
|
||||||
|--------------------|-------|-------------------------------------|
|
| -------------------- | ------- | ----------------------------------- |
|
||||||
|`WS2812_SPI_DIVISOR`|`16` |SPI source clock peripheral divisor |
|
| `WS2812_SPI_DIVISOR` | `16` | SPI source clock peripheral divisor |
|
||||||
|
|
||||||
#### Testing Notes
|
#### Testing Notes
|
||||||
|
|
||||||
While not an exhaustive list, the following table provides the scenarios that have been partially validated:
|
While not an exhaustive list, the following table provides the scenarios that have been partially validated:
|
||||||
|
|
||||||
| | SPI1 | SPI2 | SPI3 |
|
| | SPI1 | SPI2 | SPI3 |
|
||||||
|------|---------------------------------------------|-----------------------------------------|-----------------------|
|
| ---- | ------------------------------------------- | --------------------------------------- | --------------------- |
|
||||||
| f072 | ? | B15 :heavy_check_mark: (needs SCK: B13) | N/A |
|
| f072 | ? | B15 :heavy_check_mark: (needs SCK: B13) | N/A |
|
||||||
| f103 | A7 :heavy_check_mark: | B15 :heavy_check_mark: | N/A |
|
| f103 | A7 :heavy_check_mark: | B15 :heavy_check_mark: | N/A |
|
||||||
| f303 | A7 :heavy_check_mark: B5 :heavy_check_mark: | B15 :heavy_check_mark: | B5 :heavy_check_mark: |
|
| f303 | A7 :heavy_check_mark: B5 :heavy_check_mark: | B15 :heavy_check_mark: | B5 :heavy_check_mark: |
|
||||||
|
|
@ -150,15 +151,32 @@ You must also turn on the PWM feature in your halconf.h and mcuconf.h
|
||||||
|
|
||||||
While not an exhaustive list, the following table provides the scenarios that have been partially validated:
|
While not an exhaustive list, the following table provides the scenarios that have been partially validated:
|
||||||
|
|
||||||
| | Status |
|
| | Status |
|
||||||
|-|-|
|
| --------- | ------------------ |
|
||||||
| f072 | ? |
|
| f072 | ? |
|
||||||
| f103 | :heavy_check_mark: |
|
| f103 | :heavy_check_mark: |
|
||||||
| f303 | :heavy_check_mark: |
|
| f303 | :heavy_check_mark: |
|
||||||
| f401/f411 | :heavy_check_mark: |
|
| f401/f411 | :heavy_check_mark: |
|
||||||
|
|
||||||
*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*
|
*Other supported ChibiOS boards and/or pins may function, it will be highly chip and configuration dependent.*
|
||||||
|
|
||||||
|
### PIO
|
||||||
|
|
||||||
|
Targeting Raspberry Pi RP2040 boards only where WS2812 support is offloaded to an dedicated PIO implementation. This offloads processing of the WS2812 protocol from the MCU to a dedicated PIO program using DMA transfers.
|
||||||
|
|
||||||
|
To configure it, add this to your rules.mk:
|
||||||
|
|
||||||
|
```make
|
||||||
|
WS2812_DRIVER = vendor
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure the hardware via your config.h:
|
||||||
|
```c
|
||||||
|
#define WS2812_PIO_USE_PIO1 // Force the usage of PIO1 peripheral, by default the WS2812 implementation uses the PIO0 peripheral
|
||||||
|
```
|
||||||
|
|
||||||
|
The WS2812 PIO programm uses 1 state machine, 4 instructions and does not use any interrupt handlers.
|
||||||
|
|
||||||
### Push Pull and Open Drain Configuration
|
### Push Pull and Open Drain Configuration
|
||||||
The default configuration is a push pull on the defined pin.
|
The default configuration is a push pull on the defined pin.
|
||||||
This can be configured for bitbang, PWM and SPI.
|
This can be configured for bitbang, PWM and SPI.
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@
|
||||||
* [换手](zh-cn/feature_swap_hands.md)
|
* [换手](zh-cn/feature_swap_hands.md)
|
||||||
* [一键多用](zh-cn/feature_tap_dance.md)
|
* [一键多用](zh-cn/feature_tap_dance.md)
|
||||||
* [点按配置](zh-cn/tap_hold.md)
|
* [点按配置](zh-cn/tap_hold.md)
|
||||||
* [终端](zh-cn/feature_terminal.md)
|
|
||||||
* [Unicode](zh-cn/feature_unicode.md)
|
* [Unicode](zh-cn/feature_unicode.md)
|
||||||
* [用户空间](zh-cn/feature_userspace.md)
|
* [用户空间](zh-cn/feature_userspace.md)
|
||||||
* [WPM计算](zh-cn/feature_wpm.md)
|
* [WPM计算](zh-cn/feature_wpm.md)
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ void suspend_wakeup_init_user(void) {
|
||||||
|
|
||||||
```c
|
```c
|
||||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _RAISE:
|
case _RAISE:
|
||||||
rgblight_setrgb (0x00, 0x00, 0xFF);
|
rgblight_setrgb (0x00, 0x00, 0xFF);
|
||||||
break;
|
break;
|
||||||
|
|
@ -267,7 +267,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
|
||||||
### `layer_state_set_*` 函数文档
|
### `layer_state_set_*` 函数文档
|
||||||
|
|
||||||
* 键盘/各子版本:`uint32_t layer_state_set_kb(uint32_t state)`
|
* 键盘/各子版本:`layer_state_t layer_state_set_kb(layer_state_t state)`
|
||||||
* 布局: `layer_state_t layer_state_set_user(layer_state_t state)`
|
* 布局: `layer_state_t layer_state_set_user(layer_state_t state)`
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -325,7 +325,7 @@ void keyboard_post_init_user(void) {
|
||||||
|
|
||||||
```c
|
```c
|
||||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _RAISE:
|
case _RAISE:
|
||||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
||||||
break;
|
break;
|
||||||
|
|
@ -474,4 +474,3 @@ cancel_deferred_exec(my_token);
|
||||||
```c
|
```c
|
||||||
#define MAX_DEFERRED_EXECUTORS 16
|
#define MAX_DEFERRED_EXECUTORS 16
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,11 @@
|
||||||
# define EXTERNAL_EEPROM_PAGE_SIZE 32
|
# define EXTERNAL_EEPROM_PAGE_SIZE 32
|
||||||
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
||||||
|
#elif defined(EEPROM_I2C_24LC32A)
|
||||||
|
# define EXTERNAL_EEPROM_BYTE_COUNT 4096
|
||||||
|
# define EXTERNAL_EEPROM_PAGE_SIZE 32
|
||||||
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
|
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
||||||
#elif defined(EEPROM_I2C_MB85RC256V)
|
#elif defined(EEPROM_I2C_MB85RC256V)
|
||||||
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
|
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
|
||||||
# define EXTERNAL_EEPROM_PAGE_SIZE 128
|
# define EXTERNAL_EEPROM_PAGE_SIZE 128
|
||||||
|
|
|
||||||
23
drivers/eeprom/eeprom_wear_leveling.c
Normal file
23
drivers/eeprom/eeprom_wear_leveling.c
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
// Copyright 2022 Nick Brassel (@tzarc)
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "eeprom_driver.h"
|
||||||
|
#include "wear_leveling.h"
|
||||||
|
|
||||||
|
void eeprom_driver_init(void) {
|
||||||
|
wear_leveling_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeprom_driver_erase(void) {
|
||||||
|
wear_leveling_erase();
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
||||||
|
wear_leveling_read((uint32_t)addr, buf, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||||
|
wear_leveling_write((uint32_t)addr, buf, len);
|
||||||
|
}
|
||||||
|
|
@ -53,6 +53,10 @@
|
||||||
# define AW_GLOBAL_CURRENT_MAX 150
|
# define AW_GLOBAL_CURRENT_MAX 150
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef AW_SPI_MODE
|
||||||
|
# define AW_SPI_MODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef AW_SPI_DIVISOR
|
#ifndef AW_SPI_DIVISOR
|
||||||
# define AW_SPI_DIVISOR 4
|
# define AW_SPI_DIVISOR 4
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -63,7 +67,7 @@ bool g_pwm_buffer_update_required[DRIVER_COUNT] = {false};
|
||||||
bool AW20216_write(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t* data, uint8_t len) {
|
bool AW20216_write(pin_t cs_pin, uint8_t page, uint8_t reg, uint8_t* data, uint8_t len) {
|
||||||
static uint8_t s_spi_transfer_buffer[2] = {0};
|
static uint8_t s_spi_transfer_buffer[2] = {0};
|
||||||
|
|
||||||
if (!spi_start(cs_pin, false, 3, AW_SPI_DIVISOR)) {
|
if (!spi_start(cs_pin, false, AW_SPI_MODE, AW_SPI_DIVISOR)) {
|
||||||
spi_stop();
|
spi_stop();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,10 @@
|
||||||
# define ISSI_CSPULLUP PUR_0R
|
# define ISSI_CSPULLUP PUR_0R
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ISSI_GLOBALCURRENT
|
||||||
|
# define ISSI_GLOBALCURRENT 0xFF
|
||||||
|
#endif
|
||||||
|
|
||||||
// Transfer buffer for TWITransmitData()
|
// Transfer buffer for TWITransmitData()
|
||||||
uint8_t g_twi_transfer_buffer[20];
|
uint8_t g_twi_transfer_buffer[20];
|
||||||
|
|
||||||
|
|
@ -182,7 +186,7 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) {
|
||||||
// Set de-ghost pull-down resistors (CSx)
|
// Set de-ghost pull-down resistors (CSx)
|
||||||
IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
||||||
// Set global current to maximum.
|
// Set global current to maximum.
|
||||||
IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF);
|
IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT);
|
||||||
// Disable software shutdown.
|
// Disable software shutdown.
|
||||||
IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01);
|
IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,10 @@
|
||||||
# define ISSI_CSPULLUP PUR_0R
|
# define ISSI_CSPULLUP PUR_0R
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ISSI_GLOBALCURRENT
|
||||||
|
# define ISSI_GLOBALCURRENT 0xFF
|
||||||
|
#endif
|
||||||
|
|
||||||
// Transfer buffer for TWITransmitData()
|
// Transfer buffer for TWITransmitData()
|
||||||
uint8_t g_twi_transfer_buffer[20];
|
uint8_t g_twi_transfer_buffer[20];
|
||||||
|
|
||||||
|
|
@ -172,7 +176,7 @@ void IS31FL3733_init(uint8_t addr, uint8_t sync) {
|
||||||
// Set de-ghost pull-down resistors (CSx)
|
// Set de-ghost pull-down resistors (CSx)
|
||||||
IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
IS31FL3733_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
||||||
// Set global current to maximum.
|
// Set global current to maximum.
|
||||||
IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF);
|
IS31FL3733_write_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT);
|
||||||
// Disable software shutdown.
|
// Disable software shutdown.
|
||||||
IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01);
|
IS31FL3733_write_register(addr, ISSI_REG_CONFIGURATION, ((sync & 0b11) << 6) | ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,10 @@
|
||||||
# define ISSI_CSPULLUP PUR_0R
|
# define ISSI_CSPULLUP PUR_0R
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ISSI_GLOBALCURRENT
|
||||||
|
# define ISSI_GLOBALCURRENT 0xFF
|
||||||
|
#endif
|
||||||
|
|
||||||
// Transfer buffer for TWITransmitData()
|
// Transfer buffer for TWITransmitData()
|
||||||
uint8_t g_twi_transfer_buffer[20];
|
uint8_t g_twi_transfer_buffer[20];
|
||||||
|
|
||||||
|
|
@ -154,7 +158,7 @@ void IS31FL3736_init(uint8_t addr) {
|
||||||
// Set de-ghost pull-down resistors (CSx)
|
// Set de-ghost pull-down resistors (CSx)
|
||||||
IS31FL3736_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
IS31FL3736_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
||||||
// Set global current to maximum.
|
// Set global current to maximum.
|
||||||
IS31FL3736_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF);
|
IS31FL3736_write_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT);
|
||||||
// Disable software shutdown.
|
// Disable software shutdown.
|
||||||
IS31FL3736_write_register(addr, ISSI_REG_CONFIGURATION, 0x01);
|
IS31FL3736_write_register(addr, ISSI_REG_CONFIGURATION, 0x01);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,10 @@
|
||||||
# define ISSI_CSPULLUP PUR_0R
|
# define ISSI_CSPULLUP PUR_0R
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ISSI_GLOBALCURRENT
|
||||||
|
# define ISSI_GLOBALCURRENT 0xFF
|
||||||
|
#endif
|
||||||
|
|
||||||
// Transfer buffer for TWITransmitData()
|
// Transfer buffer for TWITransmitData()
|
||||||
uint8_t g_twi_transfer_buffer[20];
|
uint8_t g_twi_transfer_buffer[20];
|
||||||
|
|
||||||
|
|
@ -161,7 +165,7 @@ void IS31FL3737_init(uint8_t addr) {
|
||||||
// Set de-ghost pull-down resistors (CSx)
|
// Set de-ghost pull-down resistors (CSx)
|
||||||
IS31FL3737_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
IS31FL3737_write_register(addr, ISSI_REG_CSPULLUP, ISSI_CSPULLUP);
|
||||||
// Set global current to maximum.
|
// Set global current to maximum.
|
||||||
IS31FL3737_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF);
|
IS31FL3737_write_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT);
|
||||||
// Disable software shutdown.
|
// Disable software shutdown.
|
||||||
IS31FL3737_write_register(addr, ISSI_REG_CONFIGURATION, ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01);
|
IS31FL3737_write_register(addr, ISSI_REG_CONFIGURATION, ((ISSI_PWM_FREQUENCY & 0b111) << 3) | 0x01);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,10 @@
|
||||||
# define ISSI_CSPULLUP PUR_32KR
|
# define ISSI_CSPULLUP PUR_32KR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef ISSI_GLOBALCURRENT
|
||||||
|
# define ISSI_GLOBALCURRENT 0xFF
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ISSI_MAX_LEDS 351
|
#define ISSI_MAX_LEDS 351
|
||||||
|
|
||||||
// Transfer buffer for TWITransmitData()
|
// Transfer buffer for TWITransmitData()
|
||||||
|
|
@ -163,7 +167,7 @@ void IS31FL3741_init(uint8_t addr) {
|
||||||
IS31FL3741_write_register(addr, ISSI_REG_CONFIGURATION, 0x01);
|
IS31FL3741_write_register(addr, ISSI_REG_CONFIGURATION, 0x01);
|
||||||
|
|
||||||
// Set Golbal Current Control Register
|
// Set Golbal Current Control Register
|
||||||
IS31FL3741_write_register(addr, ISSI_REG_GLOBALCURRENT, 0xFF);
|
IS31FL3741_write_register(addr, ISSI_REG_GLOBALCURRENT, ISSI_GLOBALCURRENT);
|
||||||
// Set Pull up & Down for SWx CSy
|
// Set Pull up & Down for SWx CSy
|
||||||
IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, ((ISSI_CSPULLUP << 4) | ISSI_SWPULLUP));
|
IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, ((ISSI_CSPULLUP << 4) | ISSI_SWPULLUP));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ uint8_t ps2_host_send(uint8_t data);
|
||||||
uint8_t ps2_host_recv_response(void);
|
uint8_t ps2_host_recv_response(void);
|
||||||
uint8_t ps2_host_recv(void);
|
uint8_t ps2_host_recv(void);
|
||||||
void ps2_host_set_led(uint8_t usb_led);
|
void ps2_host_set_led(uint8_t usb_led);
|
||||||
|
bool pbuf_has_data(void);
|
||||||
|
|
||||||
/*--------------------------------------------------------------------
|
/*--------------------------------------------------------------------
|
||||||
* static functions
|
* static functions
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,8 @@ uint8_t ps2_error = PS2_ERR_NONE;
|
||||||
|
|
||||||
static inline uint8_t pbuf_dequeue(void);
|
static inline uint8_t pbuf_dequeue(void);
|
||||||
static inline void pbuf_enqueue(uint8_t data);
|
static inline void pbuf_enqueue(uint8_t data);
|
||||||
static inline bool pbuf_has_data(void);
|
|
||||||
static inline void pbuf_clear(void);
|
static inline void pbuf_clear(void);
|
||||||
|
bool pbuf_has_data(void);
|
||||||
|
|
||||||
#if defined(PROTOCOL_CHIBIOS)
|
#if defined(PROTOCOL_CHIBIOS)
|
||||||
void ps2_interrupt_service_routine(void);
|
void ps2_interrupt_service_routine(void);
|
||||||
|
|
@ -309,7 +309,7 @@ static inline uint8_t pbuf_dequeue(void) {
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
static inline bool pbuf_has_data(void) {
|
bool pbuf_has_data(void) {
|
||||||
#if defined(__AVR__)
|
#if defined(__AVR__)
|
||||||
uint8_t sreg = SREG;
|
uint8_t sreg = SREG;
|
||||||
cli();
|
cli();
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ void ps2_mouse_init(void) {
|
||||||
ps2_mouse_set_remote_mode();
|
ps2_mouse_set_remote_mode();
|
||||||
#else
|
#else
|
||||||
ps2_mouse_enable_data_reporting();
|
ps2_mouse_enable_data_reporting();
|
||||||
|
ps2_mouse_set_stream_mode();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef PS2_MOUSE_ENABLE_SCROLLING
|
#ifdef PS2_MOUSE_ENABLE_SCROLLING
|
||||||
|
|
@ -75,19 +76,33 @@ void ps2_mouse_task(void) {
|
||||||
extern int tp_buttons;
|
extern int tp_buttons;
|
||||||
|
|
||||||
/* receives packet from mouse */
|
/* receives packet from mouse */
|
||||||
|
#ifdef PS2_MOUSE_USE_REMOTE_MODE
|
||||||
uint8_t rcv;
|
uint8_t rcv;
|
||||||
rcv = ps2_host_send(PS2_MOUSE_READ_DATA);
|
rcv = ps2_host_send(PS2_MOUSE_READ_DATA);
|
||||||
if (rcv == PS2_ACK) {
|
if (rcv == PS2_ACK) {
|
||||||
mouse_report.buttons = ps2_host_recv_response() | tp_buttons;
|
mouse_report.buttons = ps2_host_recv_response() | tp_buttons;
|
||||||
mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER;
|
mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER;
|
||||||
mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER;
|
mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER;
|
||||||
#ifdef PS2_MOUSE_ENABLE_SCROLLING
|
# ifdef PS2_MOUSE_ENABLE_SCROLLING
|
||||||
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK) * PS2_MOUSE_V_MULTIPLIER;
|
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK) * PS2_MOUSE_V_MULTIPLIER;
|
||||||
#endif
|
# endif
|
||||||
} else {
|
} else {
|
||||||
if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");
|
if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if (pbuf_has_data()) {
|
||||||
|
mouse_report.buttons = ps2_host_recv_response() | tp_buttons;
|
||||||
|
mouse_report.x = ps2_host_recv_response() * PS2_MOUSE_X_MULTIPLIER;
|
||||||
|
mouse_report.y = ps2_host_recv_response() * PS2_MOUSE_Y_MULTIPLIER;
|
||||||
|
# ifdef PS2_MOUSE_ENABLE_SCROLLING
|
||||||
|
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK) * PS2_MOUSE_V_MULTIPLIER;
|
||||||
|
# endif
|
||||||
|
} else {
|
||||||
|
if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* if mouse moves or buttons state changes */
|
/* if mouse moves or buttons state changes */
|
||||||
if (mouse_report.x || mouse_report.y || mouse_report.v || ((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) {
|
if (mouse_report.x || mouse_report.y || mouse_report.v || ((mouse_report.buttons ^ buttons_prev) & PS2_MOUSE_BTN_MASK)) {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
// Copyright (c) 2018 Cirque Corp. Restrictions apply. See: www.cirque.com/sw-license
|
// Copyright (c) 2018 Cirque Corp. Restrictions apply. See: www.cirque.com/sw-license
|
||||||
|
// based on https://github.com/cirque-corp/Cirque_Pinnacle_1CA027/tree/master/Circular_Trackpad
|
||||||
|
// with modifications and changes for QMK
|
||||||
|
// refer to documentation: Gen2 and Gen3 (Pinnacle ASIC) at https://www.cirque.com/documentation
|
||||||
|
|
||||||
#include "cirque_pinnacle.h"
|
#include "cirque_pinnacle.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
// Registers for RAP
|
// Registers for RAP
|
||||||
// clang-format off
|
// clang-format off
|
||||||
|
|
@ -38,11 +43,9 @@
|
||||||
#define ADC_ATTENUATE_3X 0x80
|
#define ADC_ATTENUATE_3X 0x80
|
||||||
#define ADC_ATTENUATE_4X 0xC0
|
#define ADC_ATTENUATE_4X 0xC0
|
||||||
|
|
||||||
// Register config values for this demo
|
#ifndef CIRQUE_PINNACLE_ATTENUATION
|
||||||
#define SYSCONFIG_1_VALUE 0x00
|
# define CIRQUE_PINNACLE_ATTENUATION ADC_ATTENUATE_4X
|
||||||
#define FEEDCONFIG_1_VALUE 0x03 // 0x03 for absolute mode 0x01 for relative mode
|
#endif
|
||||||
#define FEEDCONFIG_2_VALUE 0x1C // 0x1F for normal functionality 0x1E for intellimouse disabled
|
|
||||||
#define Z_IDLE_COUNT_VALUE 0x05
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
bool touchpad_init;
|
bool touchpad_init;
|
||||||
|
|
@ -110,16 +113,14 @@ void cirque_pinnacle_clear_flags() {
|
||||||
// Enables/Disables the feed
|
// Enables/Disables the feed
|
||||||
void cirque_pinnacle_enable_feed(bool feedEnable) {
|
void cirque_pinnacle_enable_feed(bool feedEnable) {
|
||||||
uint8_t temp;
|
uint8_t temp;
|
||||||
|
|
||||||
RAP_ReadBytes(FEEDCONFIG_1, &temp, 1); // Store contents of FeedConfig1 register
|
RAP_ReadBytes(FEEDCONFIG_1, &temp, 1); // Store contents of FeedConfig1 register
|
||||||
|
|
||||||
if (feedEnable) {
|
if (feedEnable) {
|
||||||
temp |= 0x01; // Set Feed Enable bit
|
temp |= 0x01; // Set Feed Enable bit
|
||||||
RAP_Write(0x04, temp);
|
|
||||||
} else {
|
} else {
|
||||||
temp &= ~0x01; // Clear Feed Enable bit
|
temp &= ~0x01; // Clear Feed Enable bit
|
||||||
RAP_Write(0x04, temp);
|
|
||||||
}
|
}
|
||||||
|
RAP_Write(FEEDCONFIG_1, temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ERA (Extended Register Access) Functions */
|
/* ERA (Extended Register Access) Functions */
|
||||||
|
|
@ -191,7 +192,7 @@ void cirque_pinnacle_tune_edge_sensitivity(void) {
|
||||||
ERA_ReadBytes(0x0168, &temp, 1);
|
ERA_ReadBytes(0x0168, &temp, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Pinnacle-based TM040040 Functions */
|
/* Pinnacle-based TM040040/TM035035/TM023023 Functions */
|
||||||
void cirque_pinnacle_init(void) {
|
void cirque_pinnacle_init(void) {
|
||||||
#if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi)
|
#if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi)
|
||||||
spi_init();
|
spi_init();
|
||||||
|
|
@ -200,39 +201,87 @@ void cirque_pinnacle_init(void) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
touchpad_init = true;
|
touchpad_init = true;
|
||||||
|
|
||||||
// Host clears SW_CC flag
|
// Host clears SW_CC flag
|
||||||
cirque_pinnacle_clear_flags();
|
cirque_pinnacle_clear_flags();
|
||||||
|
|
||||||
// Host configures bits of registers 0x03 and 0x05
|
// SysConfig1 (Low Power Mode)
|
||||||
RAP_Write(SYSCONFIG_1, SYSCONFIG_1_VALUE);
|
// Bit 0: Reset, 1=Reset
|
||||||
RAP_Write(FEEDCONFIG_2, FEEDCONFIG_2_VALUE);
|
// Bit 1: Shutdown, 1=Shutdown, 0=Active
|
||||||
|
// Bit 2: Sleep Enable, 1=low power mode, 0=normal mode
|
||||||
|
// send a RESET command now, in case QMK had a soft-reset without a power cycle
|
||||||
|
RAP_Write(SYSCONFIG_1, 0x01);
|
||||||
|
wait_ms(30); // Pinnacle needs 10-15ms to boot, so wait long enough before configuring
|
||||||
|
RAP_Write(SYSCONFIG_1, 0x00);
|
||||||
|
wait_us(50);
|
||||||
|
|
||||||
// Host enables preferred output mode (absolute)
|
// FeedConfig2 (Feature flags for Relative Mode Only)
|
||||||
RAP_Write(FEEDCONFIG_1, FEEDCONFIG_1_VALUE);
|
// Bit 0: IntelliMouse Enable, 1=enable, 0=disable
|
||||||
|
// Bit 1: All Taps Disable, 1=disable, 0=enable
|
||||||
|
// Bit 2: Secondary Tap Disable, 1=disable, 0=enable
|
||||||
|
// Bit 3: Scroll Disable, 1=disable, 0=enable
|
||||||
|
// Bit 4: GlideExtend® Disable, 1=disable, 0=enable
|
||||||
|
// Bit 5: reserved
|
||||||
|
// Bit 6: reserved
|
||||||
|
// Bit 7: Swap X & Y, 1=90° rotation, 0=0° rotation
|
||||||
|
RAP_Write(FEEDCONFIG_2, 0x00);
|
||||||
|
|
||||||
// Host sets z-idle packet count to 5 (default is 30)
|
// FeedConfig1 (Data Output Flags)
|
||||||
RAP_Write(Z_IDLE_COUNT, Z_IDLE_COUNT_VALUE);
|
// Bit 0: Feed enable, 1=feed, 0=no feed
|
||||||
|
// Bit 1: Data mode, 1=absolute, 0=relative
|
||||||
|
// Bit 2: Filter disable, 1=no filter, 0=filter
|
||||||
|
// Bit 3: X disable, 1=no X data, 0=X data
|
||||||
|
// Bit 4: Y disable, 1=no Y data, 0=Y data
|
||||||
|
// Bit 5: reserved
|
||||||
|
// Bit 6: X data Invert, 1=X max to 0, 0=0 to Y max
|
||||||
|
// Bit 7: Y data Invert, 1=Y max to 0, 0=0 to Y max
|
||||||
|
RAP_Write(FEEDCONFIG_1, CIRQUE_PINNACLE_POSITION_MODE << 1);
|
||||||
|
|
||||||
|
// Host sets z-idle packet count to 5 (default is 0x1F/30)
|
||||||
|
RAP_Write(Z_IDLE_COUNT, 5);
|
||||||
|
|
||||||
|
cirque_pinnacle_set_adc_attenuation(CIRQUE_PINNACLE_ATTENUATION);
|
||||||
|
|
||||||
cirque_pinnacle_set_adc_attenuation(0xFF);
|
|
||||||
cirque_pinnacle_tune_edge_sensitivity();
|
cirque_pinnacle_tune_edge_sensitivity();
|
||||||
cirque_pinnacle_enable_feed(true);
|
cirque_pinnacle_enable_feed(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reads XYZ data from Pinnacle registers 0x14 through 0x17
|
|
||||||
// Stores result in pinnacle_data_t struct with xValue, yValue, and zValue members
|
|
||||||
pinnacle_data_t cirque_pinnacle_read_data(void) {
|
pinnacle_data_t cirque_pinnacle_read_data(void) {
|
||||||
uint8_t data[6] = {0};
|
uint8_t data_ready = 0;
|
||||||
pinnacle_data_t result = {0};
|
uint8_t data[6] = {0};
|
||||||
|
pinnacle_data_t result = {0};
|
||||||
|
|
||||||
|
// Check if there is valid data available
|
||||||
|
RAP_ReadBytes(STATUS_1, &data_ready, 1); // bit2 is Software Data Ready, bit3 is Command Complete, bit0 and bit1 are reserved/unused
|
||||||
|
if ((data_ready & 0x04) == 0) {
|
||||||
|
// no data available yet
|
||||||
|
result.valid = false; // be explicit
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read all data bytes
|
||||||
RAP_ReadBytes(PACKET_BYTE_0, data, 6);
|
RAP_ReadBytes(PACKET_BYTE_0, data, 6);
|
||||||
|
|
||||||
|
// Get ready for the next data sample
|
||||||
cirque_pinnacle_clear_flags();
|
cirque_pinnacle_clear_flags();
|
||||||
|
|
||||||
result.buttonFlags = data[0] & 0x3F;
|
#if CIRQUE_PINNACLE_POSITION_MODE
|
||||||
result.xValue = data[2] | ((data[4] & 0x0F) << 8);
|
// Decode data for absolute mode
|
||||||
result.yValue = data[3] | ((data[4] & 0xF0) << 4);
|
// Register 0x13 is unused in this mode (palm detection area)
|
||||||
result.zValue = data[5] & 0x3F;
|
result.buttonFlags = data[0] & 0x3F; // bit0 to bit5 are switch 0-5, only hardware button presses (from input pin on the Pinnacle chip)
|
||||||
|
result.xValue = data[2] | ((data[4] & 0x0F) << 8); // merge high and low bits for X
|
||||||
result.touchDown = (result.xValue != 0 || result.yValue != 0);
|
result.yValue = data[3] | ((data[4] & 0xF0) << 4); // merge high and low bits for Y
|
||||||
|
result.zValue = data[5] & 0x3F; // Z is only lower 6 bits, upper 2 bits are reserved/unused
|
||||||
|
result.touchDown = (result.xValue != 0 || result.yValue != 0); // (0,0) is a "magic coordinate" to indicate "finger touched down"
|
||||||
|
#else
|
||||||
|
// Decode data for relative mode
|
||||||
|
// Registers 0x16 and 0x17 are unused in this mode
|
||||||
|
result.buttons = data[0] & 0x07; // bit0 = primary button, bit1 = secondary button, bit2 = auxilary button, if Taps enabled then also software-recognized taps are reported
|
||||||
|
result.xDelta = data[1];
|
||||||
|
result.yDelta = data[2];
|
||||||
|
result.wheelCount = data[3];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
result.valid = true;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,14 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
// Convenient way to store and access measurements
|
|
||||||
typedef struct {
|
|
||||||
uint16_t xValue;
|
|
||||||
uint16_t yValue;
|
|
||||||
uint16_t zValue;
|
|
||||||
uint8_t buttonFlags;
|
|
||||||
bool touchDown;
|
|
||||||
} pinnacle_data_t;
|
|
||||||
|
|
||||||
void cirque_pinnacle_init(void);
|
|
||||||
pinnacle_data_t cirque_pinnacle_read_data(void);
|
|
||||||
void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResolution, uint16_t yResolution);
|
|
||||||
uint16_t cirque_pinnacle_get_scale(void);
|
|
||||||
void cirque_pinnacle_set_scale(uint16_t scale);
|
|
||||||
|
|
||||||
#ifndef CIRQUE_PINNACLE_TIMEOUT
|
#ifndef CIRQUE_PINNACLE_TIMEOUT
|
||||||
# define CIRQUE_PINNACLE_TIMEOUT 20
|
# define CIRQUE_PINNACLE_TIMEOUT 20 // I2C timeout in milliseconds
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CIRQUE_PINNACLE_ABSOLUTE_MODE 1
|
||||||
|
#define CIRQUE_PINNACLE_RELATIVE_MODE 0
|
||||||
|
#ifndef CIRQUE_PINNACLE_POSITION_MODE
|
||||||
|
# define CIRQUE_PINNACLE_POSITION_MODE CIRQUE_PINNACLE_ABSOLUTE_MODE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Coordinate scaling values
|
// Coordinate scaling values
|
||||||
|
|
@ -43,7 +34,9 @@ void cirque_pinnacle_set_scale(uint16_t scale);
|
||||||
#ifndef CIRQUE_PINNACLE_Y_RANGE
|
#ifndef CIRQUE_PINNACLE_Y_RANGE
|
||||||
# define CIRQUE_PINNACLE_Y_RANGE (CIRQUE_PINNACLE_Y_UPPER - CIRQUE_PINNACLE_Y_LOWER)
|
# define CIRQUE_PINNACLE_Y_RANGE (CIRQUE_PINNACLE_Y_UPPER - CIRQUE_PINNACLE_Y_LOWER)
|
||||||
#endif
|
#endif
|
||||||
|
#if !defined(POINTING_DEVICE_TASK_THROTTLE_MS)
|
||||||
|
# define POINTING_DEVICE_TASK_THROTTLE_MS 10 // Cirque Pinnacle in normal operation produces data every 10ms. Advanced configuration for pen/stylus usage might require lower values.
|
||||||
|
#endif
|
||||||
#if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c)
|
#if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_i2c)
|
||||||
# include "i2c_master.h"
|
# include "i2c_master.h"
|
||||||
// Cirque's 7-bit I2C Slave Address
|
// Cirque's 7-bit I2C Slave Address
|
||||||
|
|
@ -72,3 +65,26 @@ void cirque_pinnacle_set_scale(uint16_t scale);
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Convenient way to store and access measurements
|
||||||
|
typedef struct {
|
||||||
|
bool valid; // true if valid data was read, false if no data was ready
|
||||||
|
#if CIRQUE_PINNACLE_POSITION_MODE
|
||||||
|
uint16_t xValue;
|
||||||
|
uint16_t yValue;
|
||||||
|
uint16_t zValue;
|
||||||
|
uint8_t buttonFlags;
|
||||||
|
bool touchDown;
|
||||||
|
#else
|
||||||
|
uint8_t xDelta;
|
||||||
|
uint8_t yDelta;
|
||||||
|
uint8_t wheelCount;
|
||||||
|
uint8_t buttons;
|
||||||
|
#endif
|
||||||
|
} pinnacle_data_t;
|
||||||
|
|
||||||
|
void cirque_pinnacle_init(void);
|
||||||
|
pinnacle_data_t cirque_pinnacle_read_data(void);
|
||||||
|
void cirque_pinnacle_scale_data(pinnacle_data_t* coordinates, uint16_t xResolution, uint16_t yResolution);
|
||||||
|
uint16_t cirque_pinnacle_get_scale(void);
|
||||||
|
void cirque_pinnacle_set_scale(uint16_t scale);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) {
|
||||||
i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT);
|
i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, NULL, 0, CIRQUE_PINNACLE_TIMEOUT);
|
||||||
if (i2c_readReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
if (i2c_readReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, data, count, CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
dprintf("error right touchpad\n");
|
dprintf("error cirque_pinnacle i2c_readReg\n");
|
||||||
#endif
|
#endif
|
||||||
touchpad_init = false;
|
touchpad_init = false;
|
||||||
}
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ void RAP_Write(uint8_t address, uint8_t data) {
|
||||||
if (touchpad_init) {
|
if (touchpad_init) {
|
||||||
if (i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
if (i2c_writeReg(CIRQUE_PINNACLE_ADDR << 1, cmdByte, &data, sizeof(data), CIRQUE_PINNACLE_TIMEOUT) != I2C_STATUS_SUCCESS) {
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
dprintf("error right touchpad\n");
|
dprintf("error cirque_pinnacle i2c_writeReg\n");
|
||||||
#endif
|
#endif
|
||||||
touchpad_init = false;
|
touchpad_init = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ void RAP_ReadBytes(uint8_t address, uint8_t* data, uint8_t count) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
dprintf("error right touchpad\n");
|
dprintf("error cirque_pinnacle spi_start read\n");
|
||||||
#endif
|
#endif
|
||||||
touchpad_init = false;
|
touchpad_init = false;
|
||||||
}
|
}
|
||||||
|
|
@ -43,7 +43,7 @@ void RAP_Write(uint8_t address, uint8_t data) {
|
||||||
spi_write(data);
|
spi_write(data);
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONSOLE_ENABLE
|
#ifdef CONSOLE_ENABLE
|
||||||
dprintf("error right touchpad\n");
|
dprintf("error cirque_pinnacle spi_start write\n");
|
||||||
#endif
|
#endif
|
||||||
touchpad_init = false;
|
touchpad_init = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,16 +95,3 @@ int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_di
|
||||||
uint16_t magnitude = (scale * offset * offset * precision) >> 7;
|
uint16_t magnitude = (scale * offset * offset * precision) >> 7;
|
||||||
return isnegative ? -(int16_t)(magnitude) : (int16_t)(magnitude);
|
return isnegative ? -(int16_t)(magnitude) : (int16_t)(magnitude);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pimoroni_trackball_adapt_values(int8_t* mouse, int16_t* offset) {
|
|
||||||
if (*offset > 127) {
|
|
||||||
*mouse = 127;
|
|
||||||
*offset -= 127;
|
|
||||||
} else if (*offset < -127) {
|
|
||||||
*mouse = -127;
|
|
||||||
*offset += 127;
|
|
||||||
} else {
|
|
||||||
*mouse = *offset;
|
|
||||||
*offset = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ typedef struct {
|
||||||
void pimoroni_trackball_device_init(void);
|
void pimoroni_trackball_device_init(void);
|
||||||
void pimoroni_trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
|
void pimoroni_trackball_set_rgbw(uint8_t red, uint8_t green, uint8_t blue, uint8_t white);
|
||||||
int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_dir, uint8_t scale);
|
int16_t pimoroni_trackball_get_offsets(uint8_t negative_dir, uint8_t positive_dir, uint8_t scale);
|
||||||
void pimoroni_trackball_adapt_values(int8_t* mouse, int16_t* offset);
|
|
||||||
uint16_t pimoroni_trackball_get_cpi(void);
|
uint16_t pimoroni_trackball_get_cpi(void);
|
||||||
void pimoroni_trackball_set_cpi(uint16_t cpi);
|
void pimoroni_trackball_set_cpi(uint16_t cpi);
|
||||||
i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data);
|
i2c_status_t read_pimoroni_trackball(pimoroni_data_t* data);
|
||||||
|
|
|
||||||
|
|
@ -27,3 +27,13 @@ void soft_serial_initiator_init(void);
|
||||||
void soft_serial_target_init(void);
|
void soft_serial_target_init(void);
|
||||||
|
|
||||||
bool soft_serial_transaction(int sstd_index);
|
bool soft_serial_transaction(int sstd_index);
|
||||||
|
|
||||||
|
#ifdef SERIAL_DEBUG
|
||||||
|
# include <debug.h>
|
||||||
|
# include <print.h>
|
||||||
|
# define serial_dprintf(...) dprintf(__VA_ARGS__)
|
||||||
|
#else
|
||||||
|
# define serial_dprintf(...) \
|
||||||
|
do { \
|
||||||
|
} while (0)
|
||||||
|
#endif
|
||||||
|
|
|
||||||
101
drivers/wear_leveling/wear_leveling_flash_spi.c
Normal file
101
drivers/wear_leveling/wear_leveling_flash_spi.c
Normal file
|
|
@ -0,0 +1,101 @@
|
||||||
|
// Copyright 2022 Nick Brassel (@tzarc)
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <hal.h>
|
||||||
|
#include "util.h"
|
||||||
|
#include "timer.h"
|
||||||
|
#include "wear_leveling.h"
|
||||||
|
#include "wear_leveling_internal.h"
|
||||||
|
|
||||||
|
#ifndef WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT
|
||||||
|
# define WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT 32
|
||||||
|
#endif // WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT
|
||||||
|
|
||||||
|
bool backing_store_init(void) {
|
||||||
|
bs_dprintf("Init\n");
|
||||||
|
flash_init();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_unlock(void) {
|
||||||
|
bs_dprintf("Unlock\n");
|
||||||
|
// No-op -- handled by the flash driver as it is.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_erase(void) {
|
||||||
|
#ifdef WEAR_LEVELING_DEBUG_OUTPUT
|
||||||
|
uint32_t start = timer_read32();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool ret = true;
|
||||||
|
for (int i = 0; i < (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT); ++i) {
|
||||||
|
flash_status_t status = flash_erase_block(((WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) + i) * (EXTERNAL_FLASH_BLOCK_SIZE));
|
||||||
|
if (status != FLASH_STATUS_SUCCESS) {
|
||||||
|
ret = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bs_dprintf("Backing store erase took %ldms to complete\n", ((long)(timer_read32() - start)));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_write(uint32_t address, backing_store_int_t value) {
|
||||||
|
return backing_store_write_bulk(address, &value, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_lock(void) {
|
||||||
|
bs_dprintf("Lock \n");
|
||||||
|
// No-op -- handled by the flash driver as it is.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_read(uint32_t address, backing_store_int_t *value) {
|
||||||
|
return backing_store_read_bulk(address, value, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_read_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) {
|
||||||
|
bs_dprintf("Read ");
|
||||||
|
uint32_t offset = (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) * (EXTERNAL_FLASH_BLOCK_SIZE) + address;
|
||||||
|
flash_status_t status = flash_read_block(offset, values, sizeof(backing_store_int_t) * item_count);
|
||||||
|
if (status == FLASH_STATUS_SUCCESS) {
|
||||||
|
for (size_t i = 0; i < item_count; ++i) {
|
||||||
|
values[i] = ~values[i];
|
||||||
|
}
|
||||||
|
wl_dump(offset, values, sizeof(backing_store_int_t) * item_count);
|
||||||
|
}
|
||||||
|
return status == FLASH_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool backing_store_write_bulk(uint32_t address, backing_store_int_t *values, size_t item_count) {
|
||||||
|
uint32_t offset = (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET) * (EXTERNAL_FLASH_BLOCK_SIZE) + address;
|
||||||
|
size_t index = 0;
|
||||||
|
backing_store_int_t temp[WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT];
|
||||||
|
do {
|
||||||
|
// Copy out the block of data we want to transmit first
|
||||||
|
size_t this_loop = MIN(item_count, WEAR_LEVELING_EXTERNAL_FLASH_BULK_COUNT);
|
||||||
|
for (size_t i = 0; i < this_loop; ++i) {
|
||||||
|
temp[i] = values[index + i];
|
||||||
|
}
|
||||||
|
|
||||||
|
bs_dprintf("Write ");
|
||||||
|
wl_dump(offset, temp, sizeof(backing_store_int_t) * this_loop);
|
||||||
|
|
||||||
|
// Take the complement instead
|
||||||
|
for (size_t i = 0; i < this_loop; ++i) {
|
||||||
|
temp[i] = ~temp[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write out the block
|
||||||
|
if (flash_write_block(offset, temp, sizeof(backing_store_int_t) * this_loop) != FLASH_STATUS_SUCCESS) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
offset += this_loop * sizeof(backing_store_int_t);
|
||||||
|
index += this_loop;
|
||||||
|
item_count -= this_loop;
|
||||||
|
} while (item_count > 0);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
34
drivers/wear_leveling/wear_leveling_flash_spi_config.h
Normal file
34
drivers/wear_leveling/wear_leveling_flash_spi_config.h
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
// Copyright 2022 Nick Brassel (@tzarc)
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifndef __ASSEMBLER__
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <stdint.h>
|
||||||
|
# include "flash_spi.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Use 1 block -- check the config for the SPI flash to determine how big it is
|
||||||
|
#ifndef WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT
|
||||||
|
# define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT 1
|
||||||
|
#endif // WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT
|
||||||
|
|
||||||
|
// Start at the first block of the external flash
|
||||||
|
#ifndef WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET
|
||||||
|
# define WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET 0
|
||||||
|
#endif // WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_OFFSET
|
||||||
|
|
||||||
|
// 8-byte writes by default
|
||||||
|
#ifndef BACKING_STORE_WRITE_SIZE
|
||||||
|
# define BACKING_STORE_WRITE_SIZE 8
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// The space allocated by the block
|
||||||
|
#ifndef WEAR_LEVELING_BACKING_SIZE
|
||||||
|
# define WEAR_LEVELING_BACKING_SIZE ((EXTERNAL_FLASH_BLOCK_SIZE) * (WEAR_LEVELING_EXTERNAL_FLASH_BLOCK_COUNT))
|
||||||
|
#endif // WEAR_LEVELING_BACKING_SIZE
|
||||||
|
|
||||||
|
// Use half of the backing size for logical EEPROM
|
||||||
|
#ifndef WEAR_LEVELING_LOGICAL_SIZE
|
||||||
|
# define WEAR_LEVELING_LOGICAL_SIZE ((WEAR_LEVELING_BACKING_SIZE) / 2)
|
||||||
|
#endif // WEAR_LEVELING_LOGICAL_SIZE
|
||||||
|
|
@ -4,3 +4,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define TAPPING_TERM 500
|
#define TAPPING_TERM 500
|
||||||
|
#define PERMISSIVE_HOLD
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
/* tap dance stuff*/
|
/* tap dance stuff*/
|
||||||
#undef TAPPING_TERM
|
#undef TAPPING_TERM
|
||||||
#define TAPPING_TERM 500
|
#define TAPPING_TERM 500
|
||||||
|
#define PERMISSIVE_HOLD
|
||||||
|
|
||||||
#define TAPPING_TOGGLE 2
|
#define TAPPING_TOGGLE 2
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ void matrix_scan_user(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _TAPLAND:
|
case _TAPLAND:
|
||||||
rgblight_setrgb(0, 16, 0); //green
|
rgblight_setrgb(0, 16, 0); //green
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ void matrix_scan_user(void) {
|
||||||
#ifdef RGBLIGHT_ENABLE
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
|
||||||
static uint8_t old_layer = 255;
|
static uint8_t old_layer = 255;
|
||||||
uint8_t new_layer = biton32(layer_state);
|
uint8_t new_layer = get_highest_layer(layer_state);
|
||||||
|
|
||||||
// Color of the Icons.
|
// Color of the Icons.
|
||||||
if (old_layer != new_layer) {
|
if (old_layer != new_layer) {
|
||||||
|
|
|
||||||
|
|
@ -128,10 +128,10 @@ void tap_dance_choose_layer_reset (qk_tap_dance_state_t *state, void *user_data)
|
||||||
layer_off(_RAISE);
|
layer_off(_RAISE);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (biton32(default_layer_state) == _DVORAK) {
|
if (get_highest_layer(default_layer_state) == _DVORAK) {
|
||||||
set_single_persistent_default_layer(_QWERTY);
|
set_single_persistent_default_layer(_QWERTY);
|
||||||
}
|
}
|
||||||
else if (biton32(default_layer_state) == _QWERTY) {
|
else if (get_highest_layer(default_layer_state) == _QWERTY) {
|
||||||
set_single_persistent_default_layer(_DVORAK);
|
set_single_persistent_default_layer(_DVORAK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
BACKLIGHT_DRIVER = custom
|
BACKLIGHT_DRIVER = custom
|
||||||
NKRO_ENABLE = yes
|
NKRO_ENABLE = yes
|
||||||
TERMINAL_ENABLE = yes
|
|
||||||
DYNAMIC_MACRO_ENABLE = yes
|
DYNAMIC_MACRO_ENABLE = yes
|
||||||
|
|
||||||
# Use RAM (fake EEPROM, transient) instead of real EEPROM
|
# Use RAM (fake EEPROM, transient) instead of real EEPROM
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,21 @@
|
||||||
|
|
||||||
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
||||||
#define PERMISSIVE_HOLD
|
#define PERMISSIVE_HOLD
|
||||||
|
|
||||||
|
// SPI configuration
|
||||||
|
#define SPI_DRIVER SPID1
|
||||||
|
#define SPI_SCK_PIN A0
|
||||||
|
#define SPI_MOSI_PIN A1
|
||||||
|
#define SPI_MISO_PIN A2
|
||||||
|
|
||||||
|
// Flash configuration
|
||||||
|
#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN B6
|
||||||
|
#define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 16
|
||||||
|
#define EXTERNAL_FLASH_PAGE_SIZE 256
|
||||||
|
#define EXTERNAL_FLASH_SECTOR_SIZE 4096
|
||||||
|
#define EXTERNAL_FLASH_BLOCK_SIZE 4096
|
||||||
|
#define EXTERNAL_FLASH_SIZE (256 * 1024) // 2M-bit flash size
|
||||||
|
|
||||||
|
// Wear-leveling driver configuration
|
||||||
|
#define WEAR_LEVELING_LOGICAL_SIZE 1024
|
||||||
|
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
AUDIO_ENABLE = no # Audio output
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
|
||||||
|
# Wear-levelling driver
|
||||||
|
EEPROM_DRIVER = wear_leveling
|
||||||
|
WEAR_LEVELING_DRIVER = spi_flash
|
||||||
|
|
||||||
# Custom RGB matrix handling
|
# Custom RGB matrix handling
|
||||||
RGB_MATRIX_ENABLE = yes
|
RGB_MATRIX_ENABLE = yes
|
||||||
RGB_MATRIX_DRIVER = custom
|
RGB_MATRIX_DRIVER = custom
|
||||||
|
|
|
||||||
|
|
@ -47,3 +47,21 @@
|
||||||
|
|
||||||
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
// Obins stock firmware has something similar to this already enabled, but disabled by default in QMK
|
||||||
#define PERMISSIVE_HOLD
|
#define PERMISSIVE_HOLD
|
||||||
|
|
||||||
|
// SPI configuration
|
||||||
|
#define SPI_DRIVER SPID1
|
||||||
|
#define SPI_SCK_PIN A0
|
||||||
|
#define SPI_MOSI_PIN A1
|
||||||
|
#define SPI_MISO_PIN A2
|
||||||
|
|
||||||
|
// Flash configuration
|
||||||
|
#define EXTERNAL_FLASH_SPI_SLAVE_SELECT_PIN A3
|
||||||
|
#define EXTERNAL_FLASH_SPI_CLOCK_DIVISOR 16
|
||||||
|
#define EXTERNAL_FLASH_PAGE_SIZE 256
|
||||||
|
#define EXTERNAL_FLASH_SECTOR_SIZE 4096
|
||||||
|
#define EXTERNAL_FLASH_BLOCK_SIZE 4096
|
||||||
|
#define EXTERNAL_FLASH_SIZE (256 * 1024) // 2M-bit flash size
|
||||||
|
|
||||||
|
// Wear-leveling driver configuration
|
||||||
|
#define WEAR_LEVELING_LOGICAL_SIZE 1024
|
||||||
|
#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,10 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
AUDIO_ENABLE = no # Audio output
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
|
||||||
|
# Wear-levelling driver
|
||||||
|
EEPROM_DRIVER = wear_leveling
|
||||||
|
WEAR_LEVELING_DRIVER = spi_flash
|
||||||
|
|
||||||
# Custom RGB matrix handling
|
# Custom RGB matrix handling
|
||||||
RGB_MATRIX_ENABLE = yes
|
RGB_MATRIX_ENABLE = yes
|
||||||
RGB_MATRIX_DRIVER = custom
|
RGB_MATRIX_DRIVER = custom
|
||||||
|
|
|
||||||
|
|
@ -25,4 +25,8 @@
|
||||||
|
|
||||||
#define SERIAL_USB_BUFFERS_SIZE 256
|
#define SERIAL_USB_BUFFERS_SIZE 256
|
||||||
|
|
||||||
|
#define HAL_USE_SPI TRUE
|
||||||
|
#define SPI_USE_WAIT TRUE
|
||||||
|
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
|
||||||
|
|
||||||
#include_next <halconf.h>
|
#include_next <halconf.h>
|
||||||
|
|
|
||||||
|
|
@ -60,3 +60,11 @@
|
||||||
|
|
||||||
#define HT32_USB_USE_USB0 TRUE
|
#define HT32_USB_USE_USB0 TRUE
|
||||||
#define HT32_USB_USB0_IRQ_PRIORITY 5
|
#define HT32_USB_USB0_IRQ_PRIORITY 5
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SPI driver setting
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define HT32_SPI_USE_SPI1 TRUE
|
||||||
|
#define HT32_SPI1_IRQ_PRIORITY 9
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -180,7 +180,7 @@ void keyboard_post_init_user(void) {
|
||||||
#ifdef RGB_MATRIX_ENABLE
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
void rgb_matrix_indicators_user(void) {
|
void rgb_matrix_indicators_user(void) {
|
||||||
if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled.
|
if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled.
|
||||||
uint8_t layer = biton32(layer_state);
|
uint8_t layer = get_highest_layer(layer_state);
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case _CLOSE:
|
case _CLOSE:
|
||||||
// rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy.
|
// rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy.
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ void keyboard_post_init_user(void) {
|
||||||
#ifdef RGB_MATRIX_ENABLE
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
void rgb_matrix_indicators_user(void) {
|
void rgb_matrix_indicators_user(void) {
|
||||||
if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled.
|
if (rgb_matrix_is_enabled()) { // turn the lights on when it is enabled.
|
||||||
uint8_t layer = biton32(layer_state);
|
uint8_t layer = get_highest_layer(layer_state);
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case _CLOSE:
|
case _CLOSE:
|
||||||
// rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy.
|
// rgb_matrix_set_color(pgm_read_byte(&convert_led_location2number[11]), RGB_RED); // RGB_TOG <- too heavy.
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ enum tapdances{
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_ESFL] = ACTION_TAP_DANCE_DUAL_ROLE(KC_ESC, _FLOCK),
|
[TD_ESFL] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _FLOCK),
|
||||||
[TD_ESQW] = ACTION_TAP_DANCE_DUAL_ROLE(KC_ESC, _QWERTY),
|
[TD_ESQW] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _QWERTY),
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ enum tapdances{
|
||||||
};
|
};
|
||||||
|
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_ESFL] = ACTION_TAP_DANCE_DUAL_ROLE(KC_ESC, _FLOCK),
|
[TD_ESFL] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _FLOCK),
|
||||||
[TD_ESQW] = ACTION_TAP_DANCE_DUAL_ROLE(KC_ESC, _QWERTY),
|
[TD_ESQW] = ACTION_TAP_DANCE_LAYER_MOVE(KC_ESC, _QWERTY),
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
// RGB Underglow使用時のレイヤー毎のカラー切り替え
|
// RGB Underglow使用時のレイヤー毎のカラー切り替え
|
||||||
uint32_t layer_state_set_keymap (uint32_t state) {
|
layer_state_t layer_state_set_keymap (layer_state_t state) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ void matrix_init_user(void) {
|
||||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||||
#ifdef RGBLIGHT_ENABLE
|
#ifdef RGBLIGHT_ENABLE
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _RAISE:
|
case _RAISE:
|
||||||
rgblight_setrgb_chartreuse(); // RAISE:シャルトリューズ
|
rgblight_setrgb_chartreuse(); // RAISE:シャルトリューズ
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
// place overrides here
|
// place overrides here
|
||||||
#define TAPPING_TERM 200
|
#define TAPPING_TERM 200
|
||||||
|
#define TAPPING_TERM_PER_KEY
|
||||||
#define LEADER_TIMEOUT 800
|
#define LEADER_TIMEOUT 800
|
||||||
|
|
||||||
#define DISABLE_SPACE_CADET_ROLLOVER
|
#define DISABLE_SPACE_CADET_ROLLOVER
|
||||||
|
|
|
||||||
|
|
@ -52,17 +52,33 @@ qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
// Tap once for CTRL, twice for Caps Lock
|
// Tap once for CTRL, twice for Caps Lock
|
||||||
[TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
|
[TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS),
|
||||||
[COPA] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_C), LCTL(KC_V)),
|
[COPA] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_C), LCTL(KC_V)),
|
||||||
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEmojis, NULL, NULL, 800),
|
[EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEmojis, NULL, NULL),
|
||||||
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAnimals, NULL, NULL, 800),
|
[ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAnimals, NULL, NULL),
|
||||||
//[SYMBOLS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleSymbols, NULL, NULL, 800),
|
//[SYMBOLS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleSymbols, NULL, NULL),
|
||||||
[FOODS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleFoods, NULL, NULL, 800),
|
[FOODS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleFoods, NULL, NULL),
|
||||||
[ETC] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEtc, NULL, NULL, 800),
|
[ETC] = ACTION_TAP_DANCE_FN_ADVANCED(cycleEtc, NULL, NULL),
|
||||||
//[VEHICLES] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleVehicles, NULL, NULL, 800),
|
//[VEHICLES] = ACTION_TAP_DANCE_FN_ADVANCED(cycleVehicles, NULL, NULL),
|
||||||
//[SUPPLEMENT] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleSupplement, NULL, NULL, 800),
|
//[SUPPLEMENT] = ACTION_TAP_DANCE_FN_ADVANCED(cycleSupplement, NULL, NULL),
|
||||||
[ALLS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAll, NULL, NULL, 800)
|
[ALLS] = ACTION_TAP_DANCE_FN_ADVANCED(cycleAll, NULL, NULL)
|
||||||
// Other declarations would go here, separated by commas, if you have them
|
// Other declarations would go here, separated by commas, if you have them
|
||||||
};
|
};
|
||||||
|
|
||||||
|
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case TD(EMOJIS):
|
||||||
|
case TD(ANIMAL):
|
||||||
|
//case TD(SYMBOLS):
|
||||||
|
case TD(FOODS):
|
||||||
|
case TD(ETC):
|
||||||
|
//case TD(VEHICLES):
|
||||||
|
//case TD(SUPPLEMENT):
|
||||||
|
case TD(ALLS):
|
||||||
|
return 800;
|
||||||
|
default:
|
||||||
|
return TAPPING_TERM;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// macros
|
// macros
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||||
switch(id) {
|
switch(id) {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,4 @@ Tap Dance is constrained normally by `TAPPING_TERM` defined in your keyboard's c
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- `ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term)` : This works the same as `ACTION_TAP_DANCE_FN_ADVANCED` just with the extra `tap_specific_tapping_term` arguement at the end. This way you can set a specific tap dance to have a longer or shorter tap in between your taps, giving you more, or less, time in between each tap.
|
- Implementing `uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record)`, you can set a specific tap dance to have a longer or shorter tap in between your taps, giving you more, or less, time in between each tap. The return value should be the same type and range of values that one would put into the `TAPPING_TERM` definition in the config.h file.
|
||||||
|
|
||||||
|
|
||||||
`tap_specific_tapping_term` should be the same type and range of values that one would put into the `TAPPING_TERM` definition in the config.h file.
|
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
void matrix_scan_user(void) {
|
void matrix_scan_user(void) {
|
||||||
uint8_t layer;
|
uint8_t layer;
|
||||||
layer = biton32(layer_state);
|
layer = get_highest_layer(layer_state);
|
||||||
|
|
||||||
if (current_layer_global != layer) {
|
if (current_layer_global != layer) {
|
||||||
current_layer_global = layer;
|
current_layer_global = layer;
|
||||||
|
|
@ -132,7 +132,7 @@ void tap_helper(keyrecord_t *record, uint16_t orig_mod, uint16_t macro_mod, uint
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
uint8_t layer;
|
uint8_t layer;
|
||||||
layer = biton32(layer_state);
|
layer = get_highest_layer(layer_state);
|
||||||
if (layer == PROG2) {
|
if (layer == PROG2) {
|
||||||
if (keycode >= KC_A && keycode <= KC_EXSEL && \
|
if (keycode >= KC_A && keycode <= KC_EXSEL && \
|
||||||
!( // do not send LSFT + these keycodes, they are needed for emulating the US layout
|
!( // do not send LSFT + these keycodes, they are needed for emulating the US layout
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
void matrix_scan_user(void)
|
void matrix_scan_user(void)
|
||||||
{
|
{
|
||||||
uint8_t layer = biton32(layer_state);
|
uint8_t layer = get_highest_layer(layer_state);
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case KM_BLOWRAK:
|
case KM_BLOWRAK:
|
||||||
ph_caps_led_on();
|
ph_caps_led_on();
|
||||||
|
|
|
||||||
|
|
@ -5,47 +5,48 @@
|
||||||
|
|
||||||
uint8_t layer = 0;
|
uint8_t layer = 0;
|
||||||
|
|
||||||
uint32_t layer_state_set_kb(uint32_t state) {
|
layer_state_t layer_state_set_kb(layer_state_t state) {
|
||||||
state = layer_state_set_user(state);
|
state = layer_state_set_user(state);
|
||||||
layer = biton32(state);
|
layer = get_highest_layer(state);
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
bool encoder_update_kb(uint8_t index, bool clockwise) {
|
||||||
if (!encoder_update_user(index, clockwise)) return false;
|
if (!encoder_update_user(index, clockwise)) return false;
|
||||||
uint16_t mapped_code = 0;
|
uint16_t mapped_code = 0;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
switch(layer){
|
switch (layer) {
|
||||||
case 0:
|
case 0:
|
||||||
default:
|
default:
|
||||||
mapped_code = KC_VOLU;
|
mapped_code = KC_VOLU;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
mapped_code = KC_MEDIA_NEXT_TRACK;
|
mapped_code = KC_MEDIA_NEXT_TRACK;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
mapped_code = KC_PGDN;
|
mapped_code = KC_PGDN;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (layer) {
|
||||||
|
case 0:
|
||||||
|
default:
|
||||||
|
mapped_code = KC_VOLD;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
mapped_code = KC_MEDIA_PREV_TRACK;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
mapped_code = KC_PGUP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
uint16_t held_keycode_timer = timer_read();
|
||||||
switch(layer){
|
register_code(mapped_code);
|
||||||
case 0:
|
while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY) { /* no-op */
|
||||||
default:
|
|
||||||
mapped_code = KC_VOLD;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
mapped_code = KC_MEDIA_PREV_TRACK;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
mapped_code = KC_PGUP;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
unregister_code(mapped_code);
|
||||||
}
|
}
|
||||||
uint16_t held_keycode_timer = timer_read();
|
return true;
|
||||||
register_code(mapped_code);
|
|
||||||
while (timer_elapsed(held_keycode_timer) < MEDIA_KEY_DELAY){ /* no-op */ }
|
|
||||||
unregister_code(mapped_code);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ void read_host_led_state(void) {
|
||||||
|
|
||||||
layer_state_t layer_state_set_kb(layer_state_t state) {
|
layer_state_t layer_state_set_kb(layer_state_t state) {
|
||||||
state = layer_state_set_user(state);
|
state = layer_state_set_user(state);
|
||||||
layer = biton32(state);
|
layer = get_highest_layer(state);
|
||||||
oled_request_wakeup();
|
oled_request_wakeup();
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -134,10 +134,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
* `--------=======------------------------'
|
* `--------=======------------------------'
|
||||||
*/
|
*/
|
||||||
[_TERMINAL] = LAYOUT_ortho_4x4(
|
[_TERMINAL] = LAYOUT_ortho_4x4(
|
||||||
_______, TERM_ABOUT, _______, _______,
|
_______, TERM_ABOUT, _______, _______,
|
||||||
TERM_OFF, TERM_PRINT, _______, _______,
|
_______, TERM_PRINT, _______, _______,
|
||||||
_______, TERM_FLUSH, _______, _______,
|
_______, TERM_FLUSH, _______, _______,
|
||||||
TERM_ON, TERM_HELP , _______, _______
|
_______, TERM_HELP , _______, _______
|
||||||
),
|
),
|
||||||
/* ADMIN
|
/* ADMIN
|
||||||
* ,-----------------------------------------.
|
* ,-----------------------------------------.
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
CONSOLE_ENABLE = no # Console for debug
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
TERMINAL_ENABLE = yes
|
|
||||||
NKRO_ENABLE = yes # Enable N-Key Rollover
|
NKRO_ENABLE = yes # Enable N-Key Rollover
|
||||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
AUDIO_ENABLE = no # Audio output
|
AUDIO_ENABLE = no # Audio output
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
switch (biton32(layer_state)) {
|
switch (get_highest_layer(layer_state)) {
|
||||||
case _BASE:
|
case _BASE:
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
tap_code(KC_VOLU);
|
tap_code(KC_VOLU);
|
||||||
|
|
@ -62,7 +62,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
bool oled_task_user(void) {
|
bool oled_task_user(void) {
|
||||||
// Host Keyboard Layer Status
|
// Host Keyboard Layer Status
|
||||||
oled_write_P(PSTR("Layer: "), false);
|
oled_write_P(PSTR("Layer: "), false);
|
||||||
switch (biton32(layer_state)) {
|
switch (get_highest_layer(layer_state)) {
|
||||||
case _BASE:
|
case _BASE:
|
||||||
oled_write_P(PSTR("Default\n"), false);
|
oled_write_P(PSTR("Default\n"), false);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ void matrix_scan_user(void) {
|
||||||
|
|
||||||
if (!rgblight_config.enable || rgblight_config.mode != 1) { return; }
|
if (!rgblight_config.enable || rgblight_config.mode != 1) { return; }
|
||||||
|
|
||||||
uint32_t layer = layer_state;
|
layer_state_t layer = layer_state;
|
||||||
uint8_t val = rgblight_config.val;
|
uint8_t val = rgblight_config.val;
|
||||||
|
|
||||||
if (layer & (1<<_FL)) {
|
if (layer & (1<<_FL)) {
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_ADJUST] = LAYOUT_planck_mit(
|
[_ADJUST] = LAYOUT_planck_mit(
|
||||||
_______, QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
|
_______, QK_BOOT, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
|
||||||
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
|
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
|
||||||
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
|
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
||||||
|
|
||||||
const char *read_logo(void);
|
const char *read_logo(void);
|
||||||
bool oled_task_user(void){
|
bool oled_task_user(void){
|
||||||
switch (biton32(layer_state)){
|
switch (get_highest_layer(layer_state)){
|
||||||
case _DVORAK:
|
case _DVORAK:
|
||||||
oled_write_ln_P(PSTR("DVRK"), false);
|
oled_write_ln_P(PSTR("DVRK"), false);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -54,9 +54,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT
|
#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||||
uint32_t layer_state_set_keymap(uint32_t state) {
|
layer_state_t layer_state_set_keymap(layer_state_t state) {
|
||||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case L_EDVORAKJP_LOWER:
|
case L_EDVORAKJP_LOWER:
|
||||||
rgblight_sethsv_noeeprom_red();
|
rgblight_sethsv_noeeprom_red();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ void render_layer_state(void) {
|
||||||
char layer_name[17];
|
char layer_name[17];
|
||||||
oled_write_P(PSTR("Layer: "), false);
|
oled_write_P(PSTR("Layer: "), false);
|
||||||
|
|
||||||
switch (biton32(layer_state)) {
|
switch (get_highest_layer(layer_state)) {
|
||||||
case L_EDVORAKJP_BASE:
|
case L_EDVORAKJP_BASE:
|
||||||
oled_write_ln_P(PSTR("Default"), false);
|
oled_write_ln_P(PSTR("Default"), false);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ const char *read_keylogs(void);
|
||||||
char matrix_line_str[24];
|
char matrix_line_str[24];
|
||||||
|
|
||||||
const char *read_layer_state(void) {
|
const char *read_layer_state(void) {
|
||||||
uint8_t layer = biton32(layer_state);
|
uint8_t layer = get_highest_layer(layer_state);
|
||||||
|
|
||||||
strcpy(matrix_line_str, "Layer: ");
|
strcpy(matrix_line_str, "Layer: ");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
*/
|
*/
|
||||||
[_FN] = LAYOUT_ortho_5x12(
|
[_FN] = LAYOUT_ortho_5x12(
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, QK_BOOT, DEBUG, _______, _______, _______, _______, _______, _______,TERM_ON, TERM_OFF, KC_DEL,
|
_______, QK_BOOT, DEBUG, _______, _______, _______, _______, _______, _______,_______, _______, KC_DEL,
|
||||||
_______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
*/
|
*/
|
||||||
[_FN] = LAYOUT_ortho_5x12(
|
[_FN] = LAYOUT_ortho_5x12(
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, QK_BOOT, DEBUG, _______, _______, _______, _______, _______, _______,TERM_ON, TERM_OFF, KC_DEL,
|
_______, QK_BOOT, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
|
||||||
_______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ report_mouse_t currentReport = {};
|
||||||
|
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
//uint8_t layer;
|
//uint8_t layer;
|
||||||
//layer = biton32(layer_state); // get the current layer //Or don't, I didn't use it.
|
//layer = get_highest_layer(layer_state); // get the current layer //Or don't, I didn't use it.
|
||||||
bool returnVal = true; //this is to determine if more key processing is needed.
|
bool returnVal = true; //this is to determine if more key processing is needed.
|
||||||
|
|
||||||
//custom layer handling for tri_layer,
|
//custom layer handling for tri_layer,
|
||||||
|
|
@ -437,7 +437,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
};
|
};
|
||||||
|
|
||||||
void matrix_scan_user(void) {
|
void matrix_scan_user(void) {
|
||||||
//uint8_t layer = biton32(layer_state);
|
//uint8_t layer = get_highest_layer(layer_state);
|
||||||
for (uint8_t i = 0; i<LONGPRESS_COUNT; i++){
|
for (uint8_t i = 0; i<LONGPRESS_COUNT; i++){
|
||||||
if ((timer_elapsed(special_timers[i]) >= CUSTOM_LONGPRESS) && (!special_key_states[i]) && special_key_pressed[i]){
|
if ((timer_elapsed(special_timers[i]) >= CUSTOM_LONGPRESS) && (!special_key_states[i]) && special_key_pressed[i]){
|
||||||
switch (i + SAFE_RANGE){
|
switch (i + SAFE_RANGE){
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_ADJUST] = LAYOUT_plaid_grid(
|
[_ADJUST] = LAYOUT_plaid_grid(
|
||||||
QK_BOOT,LED_1, LED_2, LED_3, LED_4, LED_5,LED_6, LED_7, LED_8, LED_9, LED_0,KC_DEL ,
|
QK_BOOT,LED_1, LED_2, LED_3, LED_4, LED_5,LED_6, LED_7, LED_8, LED_9, LED_0,KC_DEL ,
|
||||||
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
|
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
|
||||||
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
|
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______,
|
||||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_laye
|
||||||
|
|
||||||
// Runs constantly in the background, in a loop.
|
// Runs constantly in the background, in a loop.
|
||||||
void matrix_scan_user(void) {
|
void matrix_scan_user(void) {
|
||||||
uint8_t layer = biton32(layer_state);
|
uint8_t layer = get_highest_layer(layer_state);
|
||||||
|
|
||||||
switch (layer) {
|
switch (layer) {
|
||||||
case _LOWER:
|
case _LOWER:
|
||||||
|
|
|
||||||
|
|
@ -15,25 +15,31 @@
|
||||||
*/
|
*/
|
||||||
#include "doppelganger.h"
|
#include "doppelganger.h"
|
||||||
|
|
||||||
void keyboard_pre_init_kb (void) {
|
void keyboard_pre_init_kb(void) {
|
||||||
setPinOutput(C6);
|
setPinOutput(C6);
|
||||||
setPinOutput(B0);
|
setPinOutput(B0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool led_update_kb(led_t led_state) {
|
bool led_update_kb(led_t led_state) {
|
||||||
bool res = led_update_user(led_state);
|
bool res = led_update_user(led_state);
|
||||||
if(res) {
|
if (res) {
|
||||||
// writePin sets the pin high for 1 and low for 0.
|
// writePin sets the pin high for 1 and low for 0.
|
||||||
// In this example the pins are inverted, setting
|
// In this example the pins are inverted, setting
|
||||||
// it low/0 turns it on, and high/1 turns the LED off.
|
// it low/0 turns it on, and high/1 turns the LED off.
|
||||||
// This behavior depends on whether the LED is between the pin
|
// This behavior depends on whether the LED is between the pin
|
||||||
// and VCC or the pin and GND.
|
// and VCC or the pin and GND.
|
||||||
writePin(C6, !led_state.caps_lock);
|
writePin(C6, !led_state.caps_lock);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
|
__attribute__((weak)) layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
writePin(B0, !(state & (1UL << 1)));
|
writePin(B0, !(state & (1UL << 1)));
|
||||||
return state;
|
return state;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Override core logic as we reuse SPLIT_HAND_PIN within matrix pins
|
||||||
|
bool is_keyboard_left(void) {
|
||||||
|
setPinInput(SPLIT_HAND_PIN);
|
||||||
|
return readPin(SPLIT_HAND_PIN);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ enum {
|
||||||
|
|
||||||
//Tap Dance Definitions
|
//Tap Dance Definitions
|
||||||
qk_tap_dance_action_t tap_dance_actions[] = {
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
[TD_F1_GAME] = ACTION_TAP_DANCE_DUAL_ROLE(KC_F1, GAME),
|
[TD_F1_GAME] = ACTION_TAP_DANCE_LAYER_MOVE(KC_F1, GAME),
|
||||||
[TD_CAPS_FN] = ACTION_TAP_DANCE_DUAL_ROLE(KC_CAPS, 5)
|
[TD_CAPS_FN] = ACTION_TAP_DANCE_LAYER_MOVE(KC_CAPS, 5)
|
||||||
};
|
};
|
||||||
|
|
||||||
enum macro_id {
|
enum macro_id {
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue