Browse Source

Merge branch 'qmk:master' into master

pull/15212/head
ll3macorn 2 years ago
committed by GitHub
parent
commit
77efdefcb3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3635 changed files with 54122 additions and 45505 deletions
  1. +0
    -1
      .github/labeler.yml
  2. +1
    -2
      .github/workflows/cli.yml
  3. +7
    -5
      .github/workflows/format.yaml
  4. +30
    -0
      .github/workflows/unit_test.yml
  5. +5
    -0
      .gitignore
  6. +0
    -4
      .gitmodules
  7. +7
    -39
      Makefile
  8. +0
    -58
      bin/qmk
  9. +0
    -154
      bootloader.mk
  10. +13
    -10
      build_full_test.mk
  11. +34
    -32
      build_keyboard.mk
  12. +18
    -14
      build_test.mk
  13. +163
    -0
      builddefs/bootloader.mk
  14. +28
    -0
      builddefs/disable_features.mk
  15. +52
    -0
      builddefs/generic_features.mk
  16. +697
    -0
      builddefs/mcu_selection.mk
  17. +0
    -0
      builddefs/message.mk
  18. +148
    -0
      builddefs/show_options.mk
  19. +0
    -28
      common.mk
  20. +126
    -149
      common_features.mk
  21. +2
    -1
      data/mappings/info_config.json
  22. +3
    -2
      data/schemas/keyboard.jsonschema
  23. +34
    -1
      data/schemas/keymap.jsonschema
  24. +0
    -31
      disable_features.mk
  25. +457
    -0
      docs/ChangeLog/20211127.md
  26. +3
    -1
      docs/_summary.md
  27. +7
    -7
      docs/audio_driver.md
  28. +23
    -9
      docs/breaking_changes.md
  29. +1
    -0
      docs/breaking_changes_history.md
  30. +13
    -10
      docs/chibios_upgrade_instructions.md
  31. +27
    -0
      docs/cli_commands.md
  32. +1
    -1
      docs/cli_development.md
  33. +12
    -0
      docs/compatible_microcontrollers.md
  34. +6
    -2
      docs/config_options.md
  35. +4
    -4
      docs/configurator_default_keymaps.md
  36. +1
    -1
      docs/contributing.md
  37. +1
    -1
      docs/custom_matrix.md
  38. +67
    -1
      docs/custom_quantum_functions.md
  39. +0
    -19
      docs/de/cli.md
  40. +1
    -0
      docs/driver_installation_zadig.md
  41. +0
    -4
      docs/es/hardware_drivers.md
  42. +0
    -2
      docs/es/hardware_keyboard_guidelines.md
  43. +2
    -2
      docs/faq_debug.md
  44. +6
    -6
      docs/faq_keymap.md
  45. +1
    -5
      docs/faq_misc.md
  46. +163
    -15
      docs/feature_auto_shift.md
  47. +6
    -6
      docs/feature_backlight.md
  48. +13
    -12
      docs/feature_bluetooth.md
  49. +0
    -2
      docs/feature_bootmagic.md
  50. +2
    -2
      docs/feature_combo.md
  51. +1
    -1
      docs/feature_digitizer.md
  52. +1
    -1
      docs/feature_grave_esc.md
  53. +18
    -3
      docs/feature_haptic_feedback.md
  54. +1
    -1
      docs/feature_joystick.md
  55. +3
    -3
      docs/feature_key_overrides.md
  56. +1
    -1
      docs/feature_layers.md
  57. +1
    -1
      docs/feature_layouts.md
  58. +25
    -24
      docs/feature_led_matrix.md
  59. +118
    -18
      docs/feature_macros.md
  60. +1
    -1
      docs/feature_midi.md
  61. +8
    -3
      docs/feature_oled_driver.md
  62. +197
    -7
      docs/feature_pointing_device.md
  63. +74
    -0
      docs/feature_programmable_button.md
  64. +11
    -29
      docs/feature_ps2_mouse.md
  65. +2
    -2
      docs/feature_rawhid.md
  66. +115
    -67
      docs/feature_rgb_matrix.md
  67. +1
    -1
      docs/feature_stenography.md
  68. +1
    -1
      docs/feature_swap_hands.md
  69. +2
    -2
      docs/feature_tap_dance.md
  70. +2
    -2
      docs/feature_userspace.md
  71. +0
    -1
      docs/feature_velocikey.md
  72. +18
    -6
      docs/feature_wpm.md
  73. +1
    -1
      docs/flashing_bootloadhid.md
  74. +0
    -19
      docs/fr-fr/cli.md
  75. +0
    -4
      docs/fr-fr/faq_debug.md
  76. +1
    -1
      docs/fr-fr/faq_keymap.md
  77. +0
    -1
      docs/fr-fr/getting_started_github.md
  78. +5
    -5
      docs/getting_started_docker.md
  79. +0
    -1
      docs/getting_started_github.md
  80. +5
    -5
      docs/getting_started_make_guide.md
  81. +4
    -4
      docs/getting_started_vagrant.md
  82. +0
    -4
      docs/hardware_drivers.md
  83. +28
    -2
      docs/hardware_keyboard_guidelines.md
  84. +0
    -1
      docs/he-il/getting_started_github.md
  85. +1
    -1
      docs/how_keyboards_work.md
  86. +53
    -12
      docs/i2c_driver.md
  87. +1
    -1
      docs/internals_gpio_control.md
  88. +1
    -0
      docs/ja/compatible_microcontrollers.md
  89. +1
    -1
      docs/ja/config_options.md
  90. +1
    -1
      docs/ja/faq_keymap.md
  91. +0
    -4
      docs/ja/faq_misc.md
  92. +5
    -2
      docs/ja/feature_haptic_feedback.md
  93. +1
    -1
      docs/ja/feature_layers.md
  94. +1
    -1
      docs/ja/feature_led_matrix.md
  95. +7
    -24
      docs/ja/feature_ps2_mouse.md
  96. +0
    -1
      docs/ja/feature_velocikey.md
  97. +0
    -1
      docs/ja/getting_started_github.md
  98. +0
    -4
      docs/ja/hardware_drivers.md
  99. +0
    -2
      docs/ja/hardware_keyboard_guidelines.md
  100. +4
    -7
      docs/ja/i2c_driver.md

+ 0
- 1
.github/labeler.yml View File

@ -22,7 +22,6 @@ keymap:
via:
- keyboards/**/keymaps/via/*
cli:
- bin/qmk
- requirements.txt
- lib/python/**/*
python:


+ 1
- 2
.github/workflows/cli.yml View File

@ -4,11 +4,10 @@ on:
push:
branches:
- master
- future
- develop
pull_request:
paths:
- 'lib/python/**'
- 'bin/qmk'
- 'requirements.txt'
- '.github/workflows/cli.yml'


+ 7
- 5
.github/workflows/format.yaml View File

@ -36,14 +36,16 @@ jobs:
- name: Run qmk formatters
shell: 'bash {0}'
run: |
qmk format-c --core-only $(< ~/files.txt)
qmk format-python $(< ~/files.txt)
qmk format-text $(< ~/files.txt)
git diff
cat ~/files_added.txt ~/files_modified.txt > ~/files_changed.txt
qmk format-c --core-only $(< ~/files_changed.txt) || true
qmk format-python $(< ~/files_changed.txt) || true
qmk format-text $(< ~/files_changed.txt) || true
- name: Fail when formatting required
run: |
git diff
for file in $(git diff --name-only); do
echo "::error file=${file}::::File Requires Formatting"
echo "File '${file}' Requires Formatting"
echo "::error file=${file}::Requires Formatting"
done
test -z "$(git diff --name-only)"

+ 30
- 0
.github/workflows/unit_test.yml View File

@ -0,0 +1,30 @@
name: Unit Tests
on:
push:
branches:
- master
- develop
pull_request:
paths:
- 'builddefs/**'
- 'quantum/**'
- 'platforms/**'
- 'tmk_core/**'
- 'tests/**'
- '*.mk'
- 'Makefile'
- '.github/workflows/unit_test.yml'
jobs:
test:
runs-on: ubuntu-latest
container: qmkfm/base_container
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run tests
run: make test:all

+ 5
- 0
.gitignore View File

@ -86,3 +86,8 @@ __pycache__
# Allow to exist but don't include it in the repo
user_song_list.h
# clangd
compile_commands.json
.clangd/
.cache/

+ 0
- 4
.gitmodules View File

@ -6,10 +6,6 @@
path = lib/chibios-contrib
url = https://github.com/qmk/ChibiOS-Contrib
branch = master
[submodule "lib/ugfx"]
path = lib/ugfx
url = https://github.com/qmk/uGFX
branch = master
[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/qmk/googletest


+ 7
- 39
Makefile View File

@ -30,11 +30,7 @@ endif
endif
# Determine which qmk cli to use
ifeq (,$(shell which qmk))
QMK_BIN = bin/qmk
else
QMK_BIN = qmk
endif
QMK_BIN := qmk
# avoid 'Entering|Leaving directory' messages
MAKEFLAGS += --no-print-directory
@ -58,8 +54,6 @@ BUILD_DIR := $(ROOT_DIR)/.build
TEST_DIR := $(BUILD_DIR)/test
ERROR_FILE := $(BUILD_DIR)/error_occurred
MAKEFILE_INCLUDED=yes
# Helper function to process the newt element of a space separated path
# It works a bit like the traditional functional head tail
# so the CURRENT_PATH_ELEMENT will become the new head
@ -97,31 +91,8 @@ distclean: clean
rm -f *.bin *.hex *.uf2
echo 'done.'
#Compatibility with the old make variables, anything you specify directly on the command line
# always overrides the detected folders
ifdef keyboard
KEYBOARD := $(keyboard)
endif
ifdef keymap
KEYMAP := $(keymap)
endif
# Uncomment these for debugging
# $(info Keyboard: $(KEYBOARD))
# $(info Keymap: $(KEYMAP))
# Set the default goal depending on where we are running make from
# this handles the case where you run make without any arguments
.DEFAULT_GOAL := all:all
ifneq ($(KEYMAP),)
.DEFAULT_GOAL := $(KEYBOARD):$(KEYMAP)
else ifneq ($(KEYBOARD),)
# Inside a keyboard folder, build all keymaps for all subprojects
# Note that this is different from the old behaviour, which would
# build only the default keymap of the default keyboard
.DEFAULT_GOAL := $(KEYBOARD):all
endif
# Compare the start of the RULE variable with the first argument($1)
@ -245,10 +216,6 @@ define PARSE_RULE
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell util/list_keyboards.sh | sort -u)),true)
KEYBOARD_RULE=$$(MATCHED_ITEM)
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
# Otherwise use the KEYBOARD variable, which is determined either by
# the current directory you run make from, or passed in as an argument
else ifneq ($$(KEYBOARD),)
$$(eval $$(call PARSE_KEYBOARD,$$(KEYBOARD)))
else
$$(info make: *** No rule to make target '$1'. Stop.)
$$(info |)
@ -411,11 +378,12 @@ define PARSE_ALL_KEYMAPS
endef
define BUILD_TEST
TEST_NAME := $1
TEST_PATH := $1
TEST_NAME := $$(notdir $$(TEST_PATH))
MAKE_TARGET := $2
COMMAND := $1
MAKE_CMD := $$(MAKE) -r -R -C $(ROOT_DIR) -f build_test.mk $$(MAKE_TARGET)
MAKE_VARS := TEST=$$(TEST_NAME) FULL_TESTS="$$(FULL_TESTS)"
MAKE_VARS := TEST=$$(TEST_NAME) TEST_PATH=$$(TEST_PATH) FULL_TESTS="$$(FULL_TESTS)"
MAKE_MSG := $$(MSG_MAKE_TEST)
$$(eval $$(call BUILD))
ifneq ($$(MAKE_TARGET),clean)
@ -439,7 +407,7 @@ define PARSE_TEST
ifeq ($$(TEST_NAME),all)
MATCHED_TESTS := $$(TEST_LIST)
else
MATCHED_TESTS := $$(foreach TEST,$$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME),$$(TEST)),$$(TEST),))
MATCHED_TESTS := $$(foreach TEST, $$(TEST_LIST),$$(if $$(findstring $$(TEST_NAME), $$(notdir $$(TEST))), $$(TEST),))
endif
$$(foreach TEST,$$(MATCHED_TESTS),$$(eval $$(call BUILD_TEST,$$(TEST),$$(TEST_TARGET))))
endef
@ -458,7 +426,8 @@ define SET_SILENT_MODE
endif
endef
include $(ROOT_DIR)/message.mk
include paths.mk
include $(BUILDDEFS_PATH)/message.mk
ifeq ($(strip $(BREAK_ON_ERRORS)), yes)
HANDLE_ERROR = exit 1
@ -494,7 +463,6 @@ endef
ifndef SKIP_GIT
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 50 --init lib/chibios-contrib; fi
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 50 --init lib/ugfx; 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/printf ]; then git submodule sync lib/printf && git submodule update --depth 50 --init lib/printf; fi


+ 0
- 58
bin/qmk View File

@ -1,58 +0,0 @@
#!/usr/bin/env python3
"""CLI wrapper for running QMK commands.
"""
import os
import sys
from pathlib import Path
# Add the QMK python libs to our path
script_dir = Path(os.path.realpath(__file__)).parent
qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))
# Setup the CLI
import milc # noqa
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
@milc.cli.entrypoint('QMK Helper Script')
def qmk_main(cli):
"""The function that gets run when no subcommand is provided.
"""
cli.print_help()
def main():
"""Setup our environment and then call the CLI entrypoint.
"""
# Change to the root of our checkout
os.environ['ORIG_CWD'] = os.getcwd()
os.environ['DEPRECATED_BIN_QMK'] = '1'
os.chdir(qmk_dir)
print('Warning: The bin/qmk script is being deprecated. Please install the QMK CLI: python3 -m pip install qmk', file=sys.stderr)
# Import the subcommands
import milc.subcommand.config # noqa
import qmk.cli # noqa
# Execute
return_code = milc.cli()
if return_code is False:
exit(1)
elif return_code is not True and isinstance(return_code, int):
if return_code < 0 or return_code > 255:
milc.cli.log.error('Invalid return_code: %d', return_code)
exit(255)
exit(return_code)
exit(0)
if __name__ == '__main__':
main()

+ 0
- 154
bootloader.mk View File

@ -1,154 +0,0 @@
# Copyright 2017 Jack Humbert
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# If it's possible that multiple bootloaders can be used for one project,
# you can leave this unset, and the correct size will be selected
# automatically.
#
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
#
# AVR:
# halfkay PJRC Teensy
# caterina Pro Micro (Sparkfun/generic)
# atmel-dfu Atmel factory DFU
# lufa-dfu LUFA DFU
# qmk-dfu QMK DFU (LUFA + blinkenlight)
# qmk-hid QMK HID (LUFA + blinkenlight)
# bootloadhid HIDBootFlash compatible (ATmega32A)
# usbasploader USBaspLoader (ATmega328P)
# ARM:
# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
# stm32duino STM32Duino (STM32F103x8)
# stm32-dfu STM32 USB DFU in ROM
# apm32-dfu APM32 USB DFU in ROM
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE ?= 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE ?= 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-hid)
OPT_DEFS += -DBOOTLOADER_QMK_HID
OPT_DEFS += -DBOOTLOADER_HID
BOOTLOADER_SIZE ?= 4096
endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 512
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 1024
endif
endif
ifeq ($(strip $(BOOTLOADER)), caterina)
OPT_DEFS += -DBOOTLOADER_CATERINA
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID))
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp))
OPT_DEFS += -DBOOTLOADER_USBASP
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), lufa-ms)
OPT_DEFS += -DBOOTLOADER_MS
BOOTLOADER_SIZE ?= 8192
FIRMWARE_FORMAT = bin
cpfirmware: lufa_warning
.INTERMEDIATE: lufa_warning
lufa_warning: $(FIRMWARE_FORMAT)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
$(info LUFA MASS STORAGE Bootloader selected)
$(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!)
$(info It is extremely prone to bricking, and is only included to support existing boards.)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
endif
ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
endif
ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
OPT_DEFS += -DBOOTLOADER_STM32_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
endif
ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
OPT_DEFS += -DBOOTLOADER_APM32_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 314B -p 0106
endif
ifeq ($(strip $(BOOTLOADER)), kiibohd)
OPT_DEFS += -DBOOTLOADER_KIIBOHD
ifeq ($(strip $(MCU_ORIG)), MK20DX128)
MCU_LDSCRIPT = MK20DX128BLDR4
endif
ifeq ($(strip $(MCU_ORIG)), MK20DX256)
MCU_LDSCRIPT = MK20DX256BLDR8
endif
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1C11:B007
DFU_SUFFIX_ARGS = -v 1C11 -p B007
endif
ifeq ($(strip $(BOOTLOADER)), stm32duino)
OPT_DEFS += -DBOOTLOADER_STM32DUINO
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = STM32_F103_STM32DUINO
# STM32F103 does NOT have an USB bootloader in ROM (only serial), so setting anything here does not make much sense
STM32_BOOTLOADER_ADDRESS = 0x80000000
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
OPT_DEFS += -DBOOTLOADER_TINYUF2
endif

+ 13
- 10
build_full_test.mk View File

@ -13,21 +13,24 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#include $(TMK_PATH)/protocol.mk
$(TEST)_INC := \
tests\test_common\common_config.h
TEST_PATH=tests/$(TEST)
$(TEST)_SRC= \
$(TEST_PATH)/keymap.c \
$(TEST)_SRC := \
$(TMK_COMMON_SRC) \
$(QUANTUM_SRC) \
$(SRC) \
tests/test_common/keymap.c \
tests/test_common/matrix.c \
tests/test_common/test_driver.cpp \
tests/test_common/keyboard_report_util.cpp \
tests/test_common/test_fixture.cpp
$(TEST)_SRC += $(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
tests/test_common/test_fixture.cpp \
tests/test_common/test_keymap_key.cpp \
tests/test_common/test_logger.cpp \
$(patsubst $(ROOTDIR)/%,%,$(wildcard $(TEST_PATH)/*.cpp))
$(TEST)_DEFS := $(TMK_COMMON_DEFS) $(OPT_DEFS)
$(TEST)_CONFIG := $(TEST_PATH)/config.h
$(TEST)_DEFS=$(TMK_COMMON_DEFS) $(OPT_DEFS)
$(TEST)_CONFIG=$(TEST_PATH)/config.h
VPATH+=$(TOP_DIR)/tests/test_common
VPATH += $(TOP_DIR)/tests/test_common

+ 34
- 32
build_keyboard.mk View File

@ -10,7 +10,8 @@ endif
.DEFAULT_GOAL := all
include common.mk
include paths.mk
include $(BUILDDEFS_PATH)/message.mk
# Set the qmk cli to use
QMK_BIN ?= qmk
@ -32,20 +33,6 @@ endif
# this an empty or blank macro!
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
# For split boards we need to set a master half.
MASTER ?= left
ifdef master
MASTER = $(master)
endif
ifeq ($(MASTER),right)
OPT_DEFS += -DMASTER_IS_ON_RIGHT
else
ifneq ($(MASTER),left)
$(error MASTER does not have a valid value(left/right))
endif
endif
ifdef SKIP_VERSION
OPT_DEFS += -DSKIP_VERSION
endif
@ -115,6 +102,7 @@ include $(INFO_RULES_MK)
# Check for keymap.json first, so we can regenerate keymap.c
include build_json.mk
# Pull in keymap level rules.mk
ifeq ("$(wildcard $(KEYMAP_PATH))", "")
# Look through the possible keymap folders until we find a matching keymap.c
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.c)","")
@ -177,7 +165,7 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
include platforms/chibios/boards/QMK_PROTON_C/convert_to_proton_c.mk
endif
include quantum/mcu_selection.mk
include $(BUILDDEFS_PATH)/mcu_selection.mk
# Find all the C source files to be compiled in subfolders.
KEYBOARD_SRC :=
@ -345,6 +333,7 @@ ifeq ("$(USER_NAME)","")
endif
USER_PATH := users/$(USER_NAME)
# Pull in user level rules.mk
-include $(USER_PATH)/rules.mk
ifneq ("$(wildcard $(USER_PATH)/config.h)","")
CONFIG_H += $(USER_PATH)/config.h
@ -354,7 +343,24 @@ ifneq ("$(wildcard $(USER_PATH)/post_config.h)","")
endif
# Disable features that a keyboard doesn't support
-include disable_features.mk
-include $(BUILDDEFS_PATH)/disable_features.mk
# Pull in post_rules.mk files from all our subfolders
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/post_rules.mk)","")
include $(KEYBOARD_PATH_1)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/post_rules.mk)","")
include $(KEYBOARD_PATH_2)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/post_rules.mk)","")
include $(KEYBOARD_PATH_3)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/post_rules.mk)","")
include $(KEYBOARD_PATH_4)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_rules.mk)","")
include $(KEYBOARD_PATH_5)/post_rules.mk
endif
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
CONFIG_H += $(KEYMAP_PATH)/config.h
@ -380,9 +386,10 @@ VPATH += $(KEYBOARD_PATHS)
VPATH += $(COMMON_VPATH)
include common_features.mk
include $(BUILDDEFS_PATH)/generic_features.mk
include $(TMK_PATH)/protocol.mk
include $(TMK_PATH)/common.mk
include bootloader.mk
include $(PLATFORM_PATH)/common.mk
include $(BUILDDEFS_PATH)/bootloader.mk
SRC += $(patsubst %.c,%.clib,$(LIB_SRC))
SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC))
@ -397,39 +404,34 @@ ifneq ($(REQUIRE_PLATFORM_KEY),)
endif
endif
include $(TMK_PATH)/$(PLATFORM_KEY).mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
-include $(PLATFORM_PATH)/$(PLATFORM_KEY)/flash.mk
ifneq ($(strip $(PROTOCOL)),)
include $(TMK_PATH)/protocol/$(strip $(shell echo $(PROTOCOL) | tr '[:upper:]' '[:lower:]')).mk
else
include $(TMK_PATH)/protocol/$(PLATFORM_KEY).mk
endif
-include $(TOP_DIR)/platforms/$(PLATFORM_KEY)/flash.mk
# TODO: remove this bodge?
PROJECT_DEFS := $(OPT_DEFS)
PROJECT_INC := $(VPATH) $(EXTRAINCDIRS) $(KEYBOARD_PATHS)
PROJECT_CONFIG := $(CONFIG_H)
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
VISUALIZER_DIR = $(QUANTUM_DIR)/visualizer
VISUALIZER_PATH = $(QUANTUM_PATH)/visualizer
include $(VISUALIZER_PATH)/visualizer.mk
endif
CONFIG_H += $(POST_CONFIG_H)
ALL_CONFIGS := $(PROJECT_CONFIG) $(CONFIG_H)
OUTPUTS := $(KEYMAP_OUTPUT) $(KEYBOARD_OUTPUT)
$(KEYMAP_OUTPUT)_SRC := $(SRC)
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) $(GFXDEFS) \
$(KEYMAP_OUTPUT)_DEFS := $(OPT_DEFS) \
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYBOARD_H=\"$(QMK_KEYBOARD_H)\" \
-DQMK_KEYMAP=\"$(KEYMAP)\" -DQMK_KEYMAP_H=\"$(KEYMAP).h\" -DQMK_KEYMAP_CONFIG_H=\"$(KEYMAP_PATH)/config.h\" \
-DQMK_SUBPROJECT -DQMK_SUBPROJECT_H -DQMK_SUBPROJECT_CONFIG_H
$(KEYMAP_OUTPUT)_INC := $(VPATH) $(EXTRAINCDIRS)
$(KEYMAP_OUTPUT)_CONFIG := $(CONFIG_H)
$(KEYBOARD_OUTPUT)_SRC := $(CHIBISRC) $(GFXSRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS) $(GFXDEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC) $(GFXINC)
$(KEYBOARD_OUTPUT)_SRC := $(PLATFORM_SRC)
$(KEYBOARD_OUTPUT)_DEFS := $(PROJECT_DEFS)
$(KEYBOARD_OUTPUT)_INC := $(PROJECT_INC)
$(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG)
# Default target.
@ -445,7 +447,7 @@ check-size: build
check-md5: build
objs-size: build
include show_options.mk
include $(BUILDDEFS_PATH)/show_options.mk
include $(TMK_PATH)/rules.mk
# Ensure we have generated files available for each of the objects


+ 18
- 14
build_test.mk View File

@ -4,7 +4,8 @@ endif
.DEFAULT_GOAL := all
include common.mk
include paths.mk
include $(BUILDDEFS_PATH)/message.mk
TARGET=test/$(TEST)
@ -15,14 +16,14 @@ TEST_OBJ = $(BUILD_DIR)/test_obj
OUTPUTS := $(TEST_OBJ)/$(TEST) $(GTEST_OUTPUT)
GTEST_INC := \
$(LIB_PATH)/googletest/googletest/include\
$(LIB_PATH)/googletest/googlemock/include\
$(LIB_PATH)/googletest/googletest/include \
$(LIB_PATH)/googletest/googlemock/include
GTEST_INTERNAL_INC :=\
$(LIB_PATH)/googletest/googletest\
GTEST_INTERNAL_INC := \
$(LIB_PATH)/googletest/googletest \
$(LIB_PATH)/googletest/googlemock
$(GTEST_OUTPUT)_SRC :=\
$(GTEST_OUTPUT)_SRC := \
googletest/src/gtest-all.cc\
googlemock/src/gmock-all.cc
@ -32,9 +33,9 @@ $(GTEST_OUTPUT)_INC := $(GTEST_INC) $(GTEST_INTERNAL_INC)
LDFLAGS += -lstdc++ -lpthread -shared-libgcc
CREATE_MAP := no
VPATH +=\
$(LIB_PATH)/googletest\
$(LIB_PATH)/googlemock\
VPATH += \
$(LIB_PATH)/googletest \
$(LIB_PATH)/googlemock \
$(LIB_PATH)/printf
all: elf
@ -48,15 +49,18 @@ CONSOLE_ENABLE = yes
endif
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include tests/$(TEST)/rules.mk
include tests/test_common/build.mk
include $(TEST_PATH)/test.mk
endif
include common_features.mk
include $(TMK_PATH)/common.mk
include $(BUILDDEFS_PATH)/generic_features.mk
include $(PLATFORM_PATH)/common.mk
include $(TMK_PATH)/protocol.mk
include $(QUANTUM_PATH)/debounce/tests/rules.mk
include $(QUANTUM_PATH)/encoder/tests/rules.mk
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
include $(TMK_PATH)/common/test/rules.mk
include $(PLATFORM_PATH)/test/rules.mk
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
include build_full_test.mk
endif
@ -71,7 +75,7 @@ $(TEST_OBJ)/$(TEST)_INC := $($(TEST)_INC) $(VPATH) $(GTEST_INC)
$(TEST_OBJ)/$(TEST)_DEFS := $($(TEST)_DEFS)
$(TEST_OBJ)/$(TEST)_CONFIG := $($(TEST)_CONFIG)
include $(TMK_PATH)/native.mk
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/platform.mk
include $(TMK_PATH)/rules.mk


+ 163
- 0
builddefs/bootloader.mk View File

@ -0,0 +1,163 @@
# Copyright 2017 Jack Humbert
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# If it's possible that multiple bootloaders can be used for one project,
# you can leave this unset, and the correct size will be selected
# automatically.
#
# Sets the bootloader defined in the keyboard's/keymap's rules.mk
# Current options:
#
# AVR:
# halfkay PJRC Teensy
# caterina Pro Micro (Sparkfun/generic)
# atmel-dfu Atmel factory DFU
# lufa-dfu LUFA DFU
# qmk-dfu QMK DFU (LUFA + blinkenlight)
# qmk-hid QMK HID (LUFA + blinkenlight)
# bootloadhid HIDBootFlash compatible (ATmega32A)
# usbasploader USBaspLoader (ATmega328P)
# ARM:
# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
# stm32duino STM32Duino (STM32F103x8)
# stm32-dfu STM32 USB DFU in ROM
# apm32-dfu APM32 USB DFU in ROM
# RISC-V:
# gd32v-dfu GD32V USB DFU in ROM
#
# BOOTLOADER_SIZE can still be defined manually, but it's recommended
# you add any possible configuration to this list
ifeq ($(strip $(BOOTLOADER)), atmel-dfu)
OPT_DEFS += -DBOOTLOADER_ATMEL_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE = 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), lufa-dfu)
OPT_DEFS += -DBOOTLOADER_LUFA_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE ?= 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-dfu)
OPT_DEFS += -DBOOTLOADER_QMK_DFU
OPT_DEFS += -DBOOTLOADER_DFU
ifneq (,$(filter $(MCU), at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647))
BOOTLOADER_SIZE ?= 4096
endif
ifneq (,$(filter $(MCU), at90usb1286 at90usb1287))
BOOTLOADER_SIZE ?= 8192
endif
endif
ifeq ($(strip $(BOOTLOADER)), qmk-hid)
OPT_DEFS += -DBOOTLOADER_QMK_HID
OPT_DEFS += -DBOOTLOADER_HID
BOOTLOADER_SIZE ?= 4096
endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
ifeq ($(strip $(MCU)), atmega32u4)
BOOTLOADER_SIZE = 512
endif
ifeq ($(strip $(MCU)), at90usb1286)
BOOTLOADER_SIZE = 1024
endif
endif
ifeq ($(strip $(BOOTLOADER)), caterina)
OPT_DEFS += -DBOOTLOADER_CATERINA
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(BOOTLOADER), bootloadhid bootloadHID))
OPT_DEFS += -DBOOTLOADER_BOOTLOADHID
BOOTLOADER_SIZE = 4096
endif
ifneq (,$(filter $(BOOTLOADER), usbasploader USBasp))
OPT_DEFS += -DBOOTLOADER_USBASP
BOOTLOADER_SIZE = 4096
endif
ifeq ($(strip $(BOOTLOADER)), lufa-ms)
OPT_DEFS += -DBOOTLOADER_MS
BOOTLOADER_SIZE ?= 8192
FIRMWARE_FORMAT = bin
cpfirmware: lufa_warning
.INTERMEDIATE: lufa_warning
lufa_warning: $(FIRMWARE_FORMAT)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
$(info LUFA MASS STORAGE Bootloader selected)
$(info DO NOT USE THIS BOOTLOADER IN NEW PROJECTS!)
$(info It is extremely prone to bricking, and is only included to support existing boards.)
$(info @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@)
endif
ifdef BOOTLOADER_SIZE
OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
endif
ifeq ($(strip $(BOOTLOADER)), stm32-dfu)
OPT_DEFS += -DBOOTLOADER_STM32_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 0483:DF11 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 0483 -p DF11
endif
ifeq ($(strip $(BOOTLOADER)), apm32-dfu)
OPT_DEFS += -DBOOTLOADER_APM32_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 314B:0106 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 314B -p 0106
endif
ifeq ($(strip $(BOOTLOADER)), gd32v-dfu)
OPT_DEFS += -DBOOTLOADER_GD32V_DFU
# Options to pass to dfu-util when flashing
DFU_ARGS ?= -d 28E9:0189 -a 0 -s 0x08000000:leave
DFU_SUFFIX_ARGS ?= -v 28E9 -p 0189
endif
ifeq ($(strip $(BOOTLOADER)), kiibohd)
OPT_DEFS += -DBOOTLOADER_KIIBOHD
ifeq ($(strip $(MCU_ORIG)), MK20DX128)
MCU_LDSCRIPT = MK20DX128BLDR4
endif
ifeq ($(strip $(MCU_ORIG)), MK20DX256)
MCU_LDSCRIPT = MK20DX256BLDR8
endif
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1C11:B007
DFU_SUFFIX_ARGS = -v 1C11 -p B007
endif
ifeq ($(strip $(BOOTLOADER)), stm32duino)
OPT_DEFS += -DBOOTLOADER_STM32DUINO
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = STM32_F103_STM32DUINO
# STM32F103 does NOT have an USB bootloader in ROM (only serial), so setting anything here does not make much sense
STM32_BOOTLOADER_ADDRESS = 0x80000000
# Options to pass to dfu-util when flashing
DFU_ARGS = -d 1EAF:0003 -a 2 -R
DFU_SUFFIX_ARGS = -v 1EAF -p 0003
endif
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
OPT_DEFS += -DBOOTLOADER_TINYUF2
endif

+ 28
- 0
builddefs/disable_features.mk View File

@ -0,0 +1,28 @@
# Unconditionally disable features that a keyboard advertises it doesn't support
FEATURE_NAMES :=
FEATURE_NAMES += AUDIO
FEATURE_NAMES += BACKLIGHT
FEATURE_NAMES += BLUETOOTH
FEATURE_NAMES += DIP_SWITCH
FEATURE_NAMES += DYNAMIC_KEYMAP
FEATURE_NAMES += ENCODER
FEATURE_NAMES += HAPTIC
FEATURE_NAMES += HD44780
FEATURE_NAMES += IOS_DEVICE
FEATURE_NAMES += LCD_BACKLIGHT
FEATURE_NAMES += LCD
FEATURE_NAMES += OLED
FEATURE_NAMES += POINTING_DEVICE
FEATURE_NAMES += PRINTING
FEATURE_NAMES += PS2_MOUSE
FEATURE_NAMES += RGBLIGHT
FEATURE_NAMES += RGB_MATRIX
FEATURE_NAMES += SLEEP_LED
FEATURE_NAMES += STENO
FEATURE_NAMES += SWAP_HANDS
FEATURE_NAMES += WATCHDOG
FEATURE_NAMES += XT
$(foreach AFEATURE,$(FEATURE_NAMES),\
$(if $(filter $($(AFEATURE)_SUPPORTED),no),$(eval $(AFEATURE)_ENABLE=no)))

+ 52
- 0
builddefs/generic_features.mk View File

@ -0,0 +1,52 @@
# Copyright 2021 QMK
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
SPACE_CADET_ENABLE ?= yes
GRAVE_ESC_ENABLE ?= yes
GENERIC_FEATURES = \
COMBO \
COMMAND \
DEFERRED_EXEC \
DIGITIZER \
DIP_SWITCH \
DYNAMIC_KEYMAP \
DYNAMIC_MACRO \
ENCODER \
GRAVE_ESC \
HAPTIC \
KEY_LOCK \
KEY_OVERRIDE \
LEADER \
PROGRAMMABLE_BUTTON \
SPACE_CADET \
SWAP_HANDS \
TAP_DANCE \
VELOCIKEY \
WPM \
DYNAMIC_TAPPING_TERM \
define HANDLE_GENERIC_FEATURE
# $$(info "Processing: $1_ENABLE $2.c")
SRC += $$(wildcard $$(QUANTUM_DIR)/process_keycode/process_$2.c)
SRC += $$(wildcard $$(QUANTUM_DIR)/$2.c)
OPT_DEFS += -D$1_ENABLE
endef
$(foreach F,$(GENERIC_FEATURES),\
$(if $(filter yes, $(strip $($(F)_ENABLE))),\
$(eval $(call HANDLE_GENERIC_FEATURE,$(F),$(shell echo $(F) | tr '[:upper:]' '[:lower:]'))) \
) \
)

+ 697
- 0
builddefs/mcu_selection.mk View File

@ -0,0 +1,697 @@
MCU_ORIG := $(MCU)
ifneq ($(findstring MKL26Z64, $(MCU)),)
# Cortex version
MCU = cortex-m0plus
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 6
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = KINETIS
MCU_SERIES = KL2x
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= MKL26Z64
# Startup code to use
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= kl2x
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= PJRC_TEENSY_LC
endif
ifneq ($(findstring MK20DX128, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = KINETIS
MCU_SERIES = K20x
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= MK20DX128
# Startup code to use
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= k20x5
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= PJRC_TEENSY_3
endif
ifneq ($(findstring MK20DX256, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = KINETIS
MCU_SERIES = K20x
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= MK20DX256
# Startup code to use
# - it should exist in <chibios>/os/common/ports/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= k20x7
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= PJRC_TEENSY_3_1
endif
ifneq ($(findstring MK66FX1M0, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = KINETIS
MCU_SERIES = MK66F18
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= MK66FX1M0
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= MK66F18
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= PJRC_TEENSY_3_6
endif
ifneq ($(findstring STM32F042, $(MCU)),)
# Cortex version
MCU = cortex-m0
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 6
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F0xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F042x6
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f0xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F042X6
USE_FPU ?= no
# UF2 settings
UF2_FAMILY ?= STM32F0
# Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced.
# This ensures that the EEPROM page buffer fits into RAM
USE_PROCESS_STACKSIZE = 0x600
USE_EXCEPTIONS_STACKSIZE = 0x300
endif
ifneq ($(findstring STM32F072, $(MCU)),)
# Cortex version
MCU = cortex-m0
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 6
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F0xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F072xB
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f0xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F072XB
USE_FPU ?= no
# UF2 settings
UF2_FAMILY ?= STM32F0
endif
ifneq ($(findstring STM32F103, $(MCU)),)
# Cortex version
MCU = cortex-m3
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F1xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F103x8
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f1xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F103
USE_FPU ?= no
# UF2 settings
UF2_FAMILY ?= STM32F1
endif
ifneq ($(findstring STM32F303, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F3xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F303xC
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f3xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F303XC
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32F3
endif
ifneq ($(findstring STM32F401, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
MCU_LDSCRIPT ?= STM32F401xC_tinyuf2
FIRMWARE_FORMAT ?= uf2
else
MCU_LDSCRIPT ?= STM32F401xC
endif
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= BLACKPILL_STM32_F401
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32F4
endif
ifneq ($(findstring STM32F405, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F405xG
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F405XG
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32F4
endif
ifneq ($(findstring STM32F407, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F407xE
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F407XE
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32F4
endif
ifneq ($(findstring STM32F411, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
ifeq ($(strip $(BOOTLOADER)), tinyuf2)
MCU_LDSCRIPT ?= STM32F411xE_tinyuf2
FIRMWARE_FORMAT ?= uf2
else
MCU_LDSCRIPT ?= STM32F411xE
endif
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= BLACKPILL_STM32_F411
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32F4
endif
ifneq ($(findstring STM32F446, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32F4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32F446xE
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32f4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_F446XE
USE_FPU ?= yes
endif
ifneq ($(findstring STM32G431, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32G4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32G431xB
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32g4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_G431XB
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32G4
endif
ifneq ($(findstring STM32G474, $(MCU)),)
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32G4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32G474xE
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32g4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_G474XE
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32G4
endif
ifneq (,$(filter $(MCU),STM32L433 STM32L443))
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32L4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32L432xC
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32l4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_L433XC
PLATFORM_NAME ?= platform_l432
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32L4
endif
ifneq (,$(filter $(MCU),STM32L412 STM32L422))
# Cortex version
MCU = cortex-m4
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = STM32
MCU_SERIES = STM32L4xx
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= STM32L412xB
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= stm32l4xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_STM32_L412XB
PLATFORM_NAME ?= platform_l432
USE_FPU ?= yes
# UF2 settings
UF2_FAMILY ?= STM32L4
endif
ifneq ($(findstring WB32F3G71, $(MCU)),)
# Cortex version
MCU = cortex-m3
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
ARMV = 7
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = WB32
MCU_SERIES = WB32F3G71xx
# Linker script to use
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= WB32F3G71x9
# Startup code to use
# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
MCU_STARTUP ?= wb32f3g71xx
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= GENERIC_WB32_F3G71XX
USE_FPU ?= no
endif
ifneq ($(findstring GD32VF103, $(MCU)),)
# RISC-V
MCU = risc-v
# RISC-V extensions and abi configuration
MCU_ARCH = rv32imac
MCU_ABI = ilp32
MCU_CMODEL = medlow
## chip/board settings
# - the next two should match the directories in
# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
MCU_FAMILY = GD32V
MCU_SERIES = GD32VF103
# Linker script to use
# - it should exist either in <chibios>/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/
# or <keyboard_dir>/ld/
MCU_LDSCRIPT ?= GD32VF103xB
# Startup code to use
# - it should exist in <chibios>/os/common/startup/RISCV-ECLIC/compilers/GCC/mk/
MCU_STARTUP ?= gd32vf103
# Board: it should exist either in <chibios>/os/hal/boards/,
# <keyboard_dir>/boards/, or drivers/boards/
BOARD ?= SIPEED_LONGAN_NANO
USE_FPU ?= no
endif
ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2 atmega16u4 atmega32u4 at90usb646 at90usb647 at90usb1286 at90usb1287))
PROTOCOL = LUFA
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU ?= 16000000
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task
ifeq (,$(filter $(NO_INTERRUPT_CONTROL_ENDPOINT),yes))
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
endif
ifneq (,$(filter $(MCU),at90usb162 atmega16u2 atmega32u2))
NO_I2C = yes
endif
endif
ifneq (,$(filter $(MCU),atmega32a))
# MCU name for avrdude
AVRDUDE_MCU = m32
PROTOCOL = VUSB
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
F_CPU ?= 12000000
endif
ifneq (,$(filter $(MCU),atmega328p))
# MCU name for avrdude
AVRDUDE_MCU = m328p
PROTOCOL = VUSB
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
F_CPU ?= 16000000
endif
ifneq (,$(filter $(MCU),atmega328))
# MCU name for avrdude
AVRDUDE_MCU = m328
PROTOCOL = VUSB
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
F_CPU ?= 16000000
endif
ifneq (,$(filter $(MCU),attiny85))
PROTOCOL = VUSB
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
F_CPU ?= 16500000
endif

message.mk → builddefs/message.mk View File


+ 148
- 0
builddefs/show_options.mk View File

@ -0,0 +1,148 @@
BUILD_OPTION_NAMES = \
BOOTMAGIC_ENABLE \
MOUSEKEY_ENABLE \
EXTRAKEY_ENABLE \
CONSOLE_ENABLE \
COMMAND_ENABLE \
NKRO_ENABLE \
TERMINAL_ENABLE \
CUSTOM_MATRIX \
DEBOUNCE_TYPE \
SPLIT_KEYBOARD \
DYNAMIC_KEYMAP_ENABLE \
USB_HID_ENABLE \
VIA_ENABLE
HARDWARE_OPTION_NAMES = \
SLEEP_LED_ENABLE \
BACKLIGHT_ENABLE \
BACKLIGHT_DRIVER \
RGBLIGHT_ENABLE \
RGBLIGHT_CUSTOM_DRIVER \
RGB_MATRIX_ENABLE \
RGB_MATRIX_DRIVER \
CIE1931_CURVE \
MIDI_ENABLE \
BLUETOOTH_ENABLE \
BLUETOOTH_DRIVER \
AUDIO_ENABLE \
HD44780_ENABLE \
ENCODER_ENABLE \
LED_TABLES \
POINTING_DEVICE_ENABLE \
DIP_SWITCH_ENABLE
OTHER_OPTION_NAMES = \
UNICODE_ENABLE \
UCIS_ENABLE \
UNICODEMAP_ENABLE \
UNICODE_COMMON \
AUTO_SHIFT_ENABLE \
AUTO_SHIFT_MODIFIERS \
DYNAMIC_TAPPING_TERM_ENABLE \
COMBO_ENABLE \
KEY_LOCK_ENABLE \
KEY_OVERRIDE_ENABLE \
LEADER_ENABLE \
PRINTING_ENABLE \
STENO_ENABLE \
TAP_DANCE_ENABLE \
VIRTSER_ENABLE \
OLED_ENABLE \
OLED_DRIVER \
LED_BACK_ENABLE \
LED_UNDERGLOW_ENABLE \
LED_ANIMATIONS \
IOS_DEVICE_ENABLE \
HELIX ZINC \
AUTOLOG_ENABLE \
DEBUG_ENABLE \
ENCODER_ENABLE_CUSTOM \
GERMAN_ENABLE \
HAPTIC_ENABLE \
HHKB_RN42_ENABLE \
ISSI_ENABLE \
KEYLOGGER_ENABLE \
LCD_BACKLIGHT_ENABLE \
MACROS_ENABLED \
PS2_MOUSE_ENABLE \
RAW_ENABLE \
SWAP_HANDS_ENABLE \
RING_BUFFERED_6KRO_REPORT_ENABLE \
WATCHDOG_ENABLE \
ERGOINU \
NO_USB_STARTUP_CHECK \
DISABLE_PROMICRO_LEDs \
MITOSIS_DATAGROK_BOTTOMSPACE \
MITOSIS_DATAGROK_SLOWUART \
RGB_MATRIX_KEYPRESSES \
LED_MIRRORED \
RGBLIGHT_FULL_POWER \
LTO_ENABLE \
PROGRAMMABLE_BUTTON_ENABLE
define NAME_ECHO
@printf " %-30s = %-16s # %s\\n" "$1" "$($1)" "$(origin $1)"
endef
define YAML_NAME_ECHO
@echo ' $1 : "$(strip $($1))"'
endef
.PHONY: show_build_options0 show_build_options
show_build_options0:
@echo " KEYBOARD = $(KEYBOARD)"
@echo " KEYMAP = $(KEYMAP)"
@echo " MCU = $(MCU)"
@echo " MCU_SERIES = $(MCU_SERIES)"
@echo " PLATFORM = $(PLATFORM)"
@echo " BOOTLOADER = $(BOOTLOADER)"
@echo " FIRMWARE_FORMAT = $(FIRMWARE_FORMAT)"
@echo
@echo "Build Options:"
$(foreach A_OPTION_NAME,$(sort $(BUILD_OPTION_NAMES)),\
$(call NAME_ECHO,$(A_OPTION_NAME)))
show_build_options: show_build_options0
@echo
@echo "If you want to know more, please try 'show_all_features' or 'show_full_features'"
@echo
.PHONY: show_all_features
show_all_features: show_build_options0
@echo
@echo "Hardware Options:"
$(foreach A_OPTION_NAME,$(sort $(HARDWARE_OPTION_NAMES)),\
$(if $($(A_OPTION_NAME)),$(call NAME_ECHO,$(A_OPTION_NAME))))
@echo
@echo "Other Options:"
$(foreach A_OPTION_NAME,$(sort $(OTHER_OPTION_NAMES)),\
$(if $($(A_OPTION_NAME)),$(call NAME_ECHO,$(A_OPTION_NAME))))
.PHONY: show_full_features
show_full_features: show_build_options0
@echo
@echo "Hardware Options:"
$(foreach A_OPTION_NAME,$(sort $(HARDWARE_OPTION_NAMES)),\
$(call NAME_ECHO,$(A_OPTION_NAME)))
@echo
@echo "Other Options:"
$(foreach A_OPTION_NAME,$(sort $(OTHER_OPTION_NAMES)),\
$(call NAME_ECHO,$(A_OPTION_NAME)))
.PHONY: yaml_build_options
yaml_build_options:
@echo '- KEYBOARD : "$(KEYBOARD)"'
@echo ' KEYMAP : "$(KEYMAP)"'
@echo ' MCU : "$(MCU)"'
@echo ' MCU_SERIES : "$(MCU_SERIES)"'
@echo ' PLATFORM : "$(PLATFORM)"'
@echo ' FIRMWARE_FORMAT : "$(FIRMWARE_FORMAT)"'
$(foreach A_OPTION_NAME,$(sort $(BUILD_OPTION_NAMES)),\
$(call YAML_NAME_ECHO,$(A_OPTION_NAME)))
$(foreach A_OPTION_NAME,$(sort $(HARDWARE_OPTION_NAMES)),\
$(if $($(A_OPTION_NAME)),$(call YAML_NAME_ECHO,$(A_OPTION_NAME))))
$(foreach A_OPTION_NAME,$(sort $(OTHER_OPTION_NAMES)),\
$(if $($(A_OPTION_NAME)),$(call YAML_NAME_ECHO,$(A_OPTION_NAME))))

+ 0
- 28
common.mk View File

@ -1,28 +0,0 @@
include message.mk
# Directory common source files exist
TOP_DIR = .
TMK_DIR = tmk_core
TMK_PATH = $(TMK_DIR)
LIB_PATH = lib
QUANTUM_DIR = quantum
QUANTUM_PATH = $(QUANTUM_DIR)
DRIVER_DIR = drivers
DRIVER_PATH = $(DRIVER_DIR)
PLATFORM_DIR = platforms
PLATFORM_PATH = $(PLATFORM_DIR)
BUILD_DIR := .build
COMMON_VPATH := $(TOP_DIR)
COMMON_VPATH += $(TMK_PATH)
COMMON_VPATH += $(QUANTUM_PATH)
COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras
COMMON_VPATH += $(QUANTUM_PATH)/audio
COMMON_VPATH += $(QUANTUM_PATH)/process_keycode
COMMON_VPATH += $(QUANTUM_PATH)/api
COMMON_VPATH += $(QUANTUM_PATH)/sequencer
COMMON_VPATH += $(DRIVER_PATH)

+ 126
- 149
common_features.mk View File

@ -13,8 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
SERIAL_PATH := $(QUANTUM_PATH)/serial_link
QUANTUM_SRC += \
$(QUANTUM_DIR)/quantum.c \
$(QUANTUM_DIR)/send_string.c \
@ -29,13 +27,16 @@ QUANTUM_SRC += \
$(QUANTUM_DIR)/keyboard.c \
$(QUANTUM_DIR)/keymap_common.c \
$(QUANTUM_DIR)/keycode_config.c \
$(QUANTUM_DIR)/sync_timer.c \
$(QUANTUM_DIR)/logging/debug.c \
$(QUANTUM_DIR)/logging/sendchar.c \
VPATH += $(QUANTUM_DIR)/logging
# Fall back to lib/printf if there is no platform provided print
ifeq ("$(wildcard $(TMK_PATH)/common/$(PLATFORM_KEY)/printf.mk)","")
ifeq ("$(wildcard $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk)","")
include $(QUANTUM_PATH)/logging/print.mk
else
include $(PLATFORM_PATH)/$(PLATFORM_KEY)/printf.mk
endif
ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes)
@ -45,19 +46,6 @@ else ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), api)
OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE
endif
ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
OPT_DEFS += -DAPI_SYSEX_ENABLE
OPT_DEFS += -DAPI_ENABLE
MIDI_ENABLE=yes
SRC += $(QUANTUM_DIR)/api/api_sysex.c
SRC += $(QUANTUM_DIR)/api.c
endif
ifeq ($(strip $(COMMAND_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/command.c
OPT_DEFS += -DCOMMAND_ENABLE
endif
AUDIO_ENABLE ?= no
ifeq ($(strip $(AUDIO_ENABLE)), yes)
ifeq ($(PLATFORM),CHIBIOS)
@ -82,7 +70,7 @@ ifeq ($(strip $(AUDIO_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
SRC += $(QUANTUM_DIR)/audio/audio.c ## common audio code, hardware agnostic
SRC += $(QUANTUM_DIR)/audio/driver_$(PLATFORM_KEY)_$(strip $(AUDIO_DRIVER)).c
SRC += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/audio_$(strip $(AUDIO_DRIVER)).c
SRC += $(QUANTUM_DIR)/audio/voices.c
SRC += $(QUANTUM_DIR)/audio/luts.c
endif
@ -121,10 +109,43 @@ ifeq ($(strip $(MOUSEKEY_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/mousekey.c
endif
VALID_POINTING_DEVICE_DRIVER_TYPES := adns5050 adns9800 analog_joystick cirque_pinnacle_i2c cirque_pinnacle_spi pmw3360 pimoroni_trackball custom
POINTING_DEVICE_DRIVER ?= custom
ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
OPT_DEFS += -DPOINTING_DEVICE_ENABLE
MOUSE_ENABLE := yes
SRC += $(QUANTUM_DIR)/pointing_device.c
ifeq ($(filter $(POINTING_DEVICE_DRIVER),$(VALID_POINTING_DEVICE_DRIVER_TYPES)),)
$(error POINTING_DEVICE_DRIVER="$(POINTING_DEVICE_DRIVER)" is not a valid pointing device type)
else
OPT_DEFS += -DPOINTING_DEVICE_ENABLE
MOUSE_ENABLE := yes
SRC += $(QUANTUM_DIR)/pointing_device.c
SRC += $(QUANTUM_DIR)/pointing_device_drivers.c
ifneq ($(strip $(POINTING_DEVICE_DRIVER)), custom)
SRC += drivers/sensors/$(strip $(POINTING_DEVICE_DRIVER)).c
OPT_DEFS += -DPOINTING_DEVICE_DRIVER_$(strip $(shell echo $(POINTING_DEVICE_DRIVER) | tr '[:lower:]' '[:upper:]'))
endif
OPT_DEFS += -DPOINTING_DEVICE_DRIVER_$(strip $(POINTING_DEVICE_DRIVER))
ifeq ($(strip $(POINTING_DEVICE_DRIVER)), adns9800)
OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE
QUANTUM_LIB_SRC += spi_master.c
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), analog_joystick)
OPT_DEFS += -DSTM32_ADC -DHAL_USE_ADC=TRUE
LIB_SRC += analog.c
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_i2c)
OPT_DEFS += -DSTM32_I2C -DHAL_USE_I2C=TRUE
SRC += drivers/sensors/cirque_pinnacle.c
QUANTUM_LIB_SRC += i2c_master.c
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), cirque_pinnacle_spi)
OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE
SRC += drivers/sensors/cirque_pinnacle.c
QUANTUM_LIB_SRC += spi_master.c
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pimoroni_trackball)
OPT_DEFS += -DSTM32_SPI -DHAL_USE_I2C=TRUE
QUANTUM_LIB_SRC += i2c_master.c
else ifeq ($(strip $(POINTING_DEVICE_DRIVER)), pmw3360)
OPT_DEFS += -DSTM32_SPI -DHAL_USE_SPI=TRUE
QUANTUM_LIB_SRC += spi_master.c
endif
endif
endif
VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi
@ -156,37 +177,18 @@ else
ifeq ($(PLATFORM),AVR)
# Automatically provided by avr-libc, nothing required
else ifeq ($(PLATFORM),CHIBIOS)
ifeq ($(MCU_SERIES), STM32F3xx)
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F303xC
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else ifeq ($(MCU_SERIES), STM32F1xx)
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F103xB
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB)
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F072xB
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F042x6)
# Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced.
# This ensures that the EEPROM page buffer fits into RAM
USE_PROCESS_STACKSIZE = 0x600
USE_EXCEPTIONS_STACKSIZE = 0x300
ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6 %_GD32VF103xB %_GD32VF103x8, $(MCU_SERIES)_$(MCU_LDSCRIPT)),)
OPT_DEFS += -DEEPROM_DRIVER
COMMON_VPATH += $(DRIVER_PATH)/eeprom
SRC += eeprom_driver.c
SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
OPT_DEFS += -DEEPROM_EMU_STM32F042x6
OPT_DEFS += -DSTM32_EEPROM_ENABLE
else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),)
OPT_DEFS += -DEEPROM_DRIVER
COMMON_VPATH += $(DRIVER_PATH)/eeprom
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/eeprom
SRC += eeprom_driver.c eeprom_stm32_L0_L1.c
SRC += eeprom_driver.c
SRC += eeprom_stm32_L0_L1.c
else
# This will effectively work the same as "transient" if not supported by the chip
SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c
@ -265,7 +267,7 @@ endif
endif
RGB_MATRIX_ENABLE ?= no
VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 CKLED2001 WS2812 custom
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),)
@ -321,6 +323,13 @@ endif
QUANTUM_LIB_SRC += i2c_master.c
endif
ifeq ($(strip $(RGB_MATRIX_DRIVER)), CKLED2001)
OPT_DEFS += -DCKLED2001 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/led
SRC += ckled2001.c
QUANTUM_LIB_SRC += i2c_master.c
endif
ifeq ($(strip $(RGB_MATRIX_DRIVER)), WS2812)
OPT_DEFS += -DWS2812
WS2812_DRIVER_REQUIRED := yes
@ -350,17 +359,6 @@ ifeq ($(strip $(PRINTING_ENABLE)), yes)
SRC += $(TMK_DIR)/protocol/serial_uart.c
endif
ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
SERIAL_DEFS += -DSERIAL_LINK_ENABLE
COMMON_VPATH += $(SERIAL_PATH)
SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
OPT_DEFS += $(SERIAL_DEFS)
VAPTH += $(SERIAL_PATH)
endif
VARIABLE_TRACE ?= no
ifneq ($(strip $(VARIABLE_TRACE)),no)
SRC += $(QUANTUM_DIR)/variable_trace.c
@ -370,8 +368,11 @@ ifneq ($(strip $(VARIABLE_TRACE)),no)
endif
endif
ifeq ($(strip $(LCD_ENABLE)), yes)
CIE1931_CURVE := yes
ifeq ($(strip $(SLEEP_LED_ENABLE)), yes)
SRC += $(PLATFORM_COMMON_DIR)/sleep_led.c
OPT_DEFS += -DSLEEP_LED_ENABLE
NO_SUSPEND_POWER_DOWN := yes
endif
VALID_BACKLIGHT_TYPES := pwm timer software custom
@ -437,10 +438,6 @@ ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes)
SRC += apa102.c
endif
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
CIE1931_CURVE := yes
endif
ifeq ($(strip $(CIE1931_CURVE)), yes)
OPT_DEFS += -DUSE_CIE1931_CURVE
LED_TABLES := yes
@ -456,40 +453,15 @@ ifeq ($(strip $(TERMINAL_ENABLE)), yes)
OPT_DEFS += -DUSER_PRINT
endif
ifeq ($(strip $(WPM_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/wpm.c
OPT_DEFS += -DWPM_ENABLE
endif
ifeq ($(strip $(ENCODER_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/encoder.c
OPT_DEFS += -DENCODER_ENABLE
endif
ifeq ($(strip $(VELOCIKEY_ENABLE)), yes)
OPT_DEFS += -DVELOCIKEY_ENABLE
SRC += $(QUANTUM_DIR)/velocikey.c
endif
ifeq ($(strip $(VIA_ENABLE)), yes)
DYNAMIC_KEYMAP_ENABLE := yes
RAW_ENABLE := yes
BOOTMAGIC_ENABLE := lite
BOOTMAGIC_ENABLE := yes
SRC += $(QUANTUM_DIR)/via.c
OPT_DEFS += -DVIA_ENABLE
endif
ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes)
OPT_DEFS += -DDYNAMIC_KEYMAP_ENABLE
SRC += $(QUANTUM_DIR)/dynamic_keymap.c
endif
ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
OPT_DEFS += -DDIP_SWITCH_ENABLE
SRC += $(QUANTUM_DIR)/dip_switch.c
endif
VALID_MAGIC_TYPES := yes lite
VALID_MAGIC_TYPES := yes
BOOTMAGIC_ENABLE ?= no
ifneq ($(strip $(BOOTMAGIC_ENABLE)), no)
ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),)
@ -568,23 +540,19 @@ ifeq ($(strip $(CRC_ENABLE)), yes)
SRC += crc.c
endif
HAPTIC_ENABLE ?= no
ifneq ($(strip $(HAPTIC_ENABLE)),no)
ifeq ($(strip $(HAPTIC_ENABLE)),yes)
COMMON_VPATH += $(DRIVER_PATH)/haptic
OPT_DEFS += -DHAPTIC_ENABLE
SRC += $(QUANTUM_DIR)/haptic.c
SRC += $(QUANTUM_DIR)/process_keycode/process_haptic.c
endif
ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), )
SRC += DRV2605L.c
QUANTUM_LIB_SRC += i2c_master.c
OPT_DEFS += -DDRV2605L
endif
ifneq ($(filter DRV2605L, $(HAPTIC_DRIVER)), )
SRC += DRV2605L.c
QUANTUM_LIB_SRC += i2c_master.c
OPT_DEFS += -DDRV2605L
endif
ifneq ($(filter SOLENOID, $(HAPTIC_ENABLE)), )
SRC += solenoid.c
OPT_DEFS += -DSOLENOID_ENABLE
ifneq ($(filter SOLENOID, $(HAPTIC_DRIVER)), )
SRC += solenoid.c
OPT_DEFS += -DSOLENOID_ENABLE
endif
endif
ifeq ($(strip $(HD44780_ENABLE)), yes)
@ -617,8 +585,6 @@ ifeq ($(strip $(ST7565_ENABLE)), yes)
SRC += st7565.c
endif
include $(DRIVER_PATH)/qwiic/qwiic.mk
ifeq ($(strip $(UCIS_ENABLE)), yes)
OPT_DEFS += -DUCIS_ENABLE
UNICODE_COMMON := yes
@ -641,60 +607,52 @@ ifeq ($(strip $(UNICODE_COMMON)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
endif
SPACE_CADET_ENABLE ?= yes
ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
OPT_DEFS += -DSPACE_CADET_ENABLE
endif
MAGIC_ENABLE ?= yes
ifeq ($(strip $(MAGIC_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_magic.c
OPT_DEFS += -DMAGIC_KEYCODE_ENABLE
endif
GRAVE_ESC_ENABLE ?= yes
ifeq ($(strip $(GRAVE_ESC_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_grave_esc.c
OPT_DEFS += -DGRAVE_ESC_ENABLE
endif
ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c
OPT_DEFS += -DDYNAMIC_MACRO_ENABLE
endif
ifeq ($(strip $(COMBO_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
OPT_DEFS += -DCOMBO_ENABLE
ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
OPT_DEFS += -DAUTO_SHIFT_ENABLE
ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes)
OPT_DEFS += -DAUTO_SHIFT_MODIFIERS
endif
endif
ifeq ($(strip $(KEY_OVERRIDE_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_key_override.c
OPT_DEFS += -DKEY_OVERRIDE_ENABLE
ifeq ($(strip $(PS2_MOUSE_ENABLE)), yes)
PS2_ENABLE := yes
SRC += ps2_mouse.c
OPT_DEFS += -DPS2_MOUSE_ENABLE
OPT_DEFS += -DMOUSE_ENABLE
endif
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
OPT_DEFS += -DTAP_DANCE_ENABLE
ifeq ($(strip $(PS2_USE_BUSYWAIT)), yes)
PS2_ENABLE := yes
SRC += ps2_busywait.c
SRC += ps2_io_avr.c
OPT_DEFS += -DPS2_USE_BUSYWAIT
endif
ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
OPT_DEFS += -DKEY_LOCK_ENABLE
ifeq ($(strip $(PS2_USE_INT)), yes)
PS2_ENABLE := yes
SRC += ps2_interrupt.c
SRC += ps2_io.c
OPT_DEFS += -DPS2_USE_INT
endif
ifeq ($(strip $(LEADER_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_leader.c
OPT_DEFS += -DLEADER_ENABLE
ifeq ($(strip $(PS2_USE_USART)), yes)
PS2_ENABLE := yes
SRC += ps2_usart.c
SRC += ps2_io.c
OPT_DEFS += -DPS2_USE_USART
endif
ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
OPT_DEFS += -DAUTO_SHIFT_ENABLE
ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes)
OPT_DEFS += -DAUTO_SHIFT_MODIFIERS
endif
ifeq ($(strip $(PS2_ENABLE)), yes)
COMMON_VPATH += $(DRIVER_PATH)/ps2
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/ps2
OPT_DEFS += -DPS2_ENABLE
endif
JOYSTICK_ENABLE ?= no
@ -717,11 +675,6 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
DIGITIZER_ENABLE ?= no
ifneq ($(strip $(DIGITIZER_ENABLE)), no)
SRC += $(QUANTUM_DIR)/digitizer.c
endif
USBPD_ENABLE ?= no
VALID_USBPD_DRIVER_TYPES = custom vendor
USBPD_DRIVER ?= vendor
@ -745,3 +698,27 @@ ifeq ($(strip $(USBPD_ENABLE)), yes)
endif
endif
endif
BLUETOOTH_ENABLE ?= no
VALID_BLUETOOTH_DRIVER_TYPES := AdafruitBLE RN42 custom
ifeq ($(strip $(BLUETOOTH_ENABLE)), yes)
ifeq ($(filter $(strip $(BLUETOOTH_DRIVER)),$(VALID_BLUETOOTH_DRIVER_TYPES)),)
$(error "$(BLUETOOTH_DRIVER)" is not a valid Bluetooth driver type)
endif
OPT_DEFS += -DBLUETOOTH_ENABLE
NO_USB_STARTUP_CHECK := yes
COMMON_VPATH += $(DRIVER_PATH)/bluetooth
SRC += outputselect.c
ifeq ($(strip $(BLUETOOTH_DRIVER)), AdafruitBLE)
OPT_DEFS += -DMODULE_ADAFRUIT_BLE
SRC += analog.c
SRC += $(DRIVER_PATH)/bluetooth/adafruit_ble.cpp
QUANTUM_LIB_SRC += spi_master.c
endif
ifeq ($(strip $(BLUETOOTH_DRIVER)), RN42)
OPT_DEFS += -DMODULE_RN42
SRC += $(TMK_DIR)/protocol/serial_uart.c
endif
endif

+ 2
- 1
data/mappings/info_config.json View File

@ -68,7 +68,7 @@
"RGBLIGHT_SLEEP": {"info_key": "rgblight.sleep", "value_type": "bool"},
"RGBLIGHT_SPLIT": {"info_key": "rgblight.split", "value_type": "bool"},
"RGBW": {"info_key": "rgblight.rgbw", "value_type": "bool"},
"PRODUCT": {"info_key": "keyboard_folder", "to_json": false},
"PRODUCT": {"info_key": "keyboard_name", "warn_duplicate": false},
"PRODUCT_ID": {"info_key": "usb.pid", "value_type": "hex"},
"VENDOR_ID": {"info_key": "usb.vid", "value_type": "hex"},
"QMK_ESC_OUTPUT": {"info_key": "qmk_lufa_bootloader.esc_output"},
@ -76,6 +76,7 @@
"QMK_KEYS_PER_SCAN": {"info_key": "qmk.keys_per_scan", "value_type": "int"},
"QMK_LED": {"info_key": "qmk_lufa_bootloader.led"},
"QMK_SPEAKER": {"info_key": "qmk_lufa_bootloader.speaker"},
"SENDSTRING_BELL": {"info_key": "audio.macro_beep", "value_type": "bool"},
"SPLIT_MODS_ENABLE": {"info_key": "split.transport.sync_modifiers", "value_type": "bool"},
"SPLIT_TRANSPORT_MIRROR": {"info_key": "split.transport.sync_matrix_state", "value_type": "bool"},
"SPLIT_USB_DETECT": {"info_key": "split.usb_detect.enabled", "value_type": "bool"},


+ 3
- 2
data/schemas/keyboard.jsonschema View File

@ -13,12 +13,13 @@
},
"processor": {
"type": "string",
"enum": ["cortex-m0", "cortex-m0plus", "cortex-m3", "cortex-m4", "MKL26Z64", "MK20DX128", "MK20DX256", "MK66F18", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L433", "STM32L443", "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", "STM32F042", "STM32F072", "STM32F103", "STM32F303", "STM32F401", "STM32F405", "STM32F407", "STM32F411", "STM32F446", "STM32G431", "STM32G474", "STM32L412", "STM32L422", "STM32L433", "STM32L443", "GD32VF103", "WB32F3G71", "atmega16u2", "atmega32u2", "atmega16u4", "atmega32u4", "at90usb162", "at90usb646", "at90usb647", "at90usb1286", "at90usb1287", "atmega32a", "atmega328p", "atmega328", "attiny85", "unknown"]
},
"audio": {
"type": "object",
"additionalProperties": false,
"properties": {
"macro_beep": {"type": "boolean"},
"pins": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
"voices": {"type": "boolean"}
}
@ -56,7 +57,7 @@
},
"bootloader": {
"type": "string",
"enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "unknown", "usbasploader", "USBasp", "tinyuf2"],
"enum": ["atmel-dfu", "bootloadhid", "bootloadHID", "caterina", "halfkay", "kiibohd", "lufa-dfu", "lufa-ms", "micronucleus", "qmk-dfu", "qmk-hid", "stm32-dfu", "stm32duino", "gd32v-dfu", "wb32-dfu", "unknown", "usbasploader", "USBasp", "tinyuf2"],
},
"bootloader_instructions": {
"type": "string",


+ 34
- 1
data/schemas/keymap.jsonschema View File

@ -5,6 +5,7 @@
"type": "object",
"properties": {
"author": {"type": "string"},
"host_language": {"$ref": "qmk.definitions.v1#/text_identifier"},
"keyboard": {"$ref": "qmk.definitions.v1#/text_identifier"},
"keymap": {"$ref": "qmk.definitions.v1#/text_identifier"},
"layout": {"$ref": "qmk.definitions.v1#/layout_macro"},
@ -15,10 +16,42 @@
"items": {"type": "string"}
}
},
"macros": {
"type": "array",
"items": {
"type": "array",
"items": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"action": {
"type": "string",
"enum": ['beep', 'delay', 'down', 'tap', 'up']
},
"keycodes": {
"type": "array",
"items": {
"$ref": "qmk.definitions.v1#/text_identifier"
}
},
"duration": {
"$ref": "qmk.definitions.v1#/unsigned_int"
}
}
}
]
}
}
},
"config": {"$ref": "qmk.keyboard.v1"},
"notes": {
"type": "string",
"description": "asdf"
}
}
}
}

+ 0
- 31
disable_features.mk View File

@ -1,31 +0,0 @@
# Unconditionally disable features that a keyboard advertises it doesn't support
FEATURE_NAMES :=
FEATURE_NAMES += ADAFRUIT_BLE
FEATURE_NAMES += AUDIO
FEATURE_NAMES += BACKLIGHT
FEATURE_NAMES += BLUETOOTH
FEATURE_NAMES += DIP_SWITCH
FEATURE_NAMES += DYNAMIC_KEYMAP
FEATURE_NAMES += ENCODER
FEATURE_NAMES += HAPTIC
FEATURE_NAMES += HD44780
FEATURE_NAMES += IOS_DEVICE
FEATURE_NAMES += LCD_BACKLIGHT
FEATURE_NAMES += LCD
FEATURE_NAMES += OLED
FEATURE_NAMES += POINTING_DEVICE
FEATURE_NAMES += PRINTING
FEATURE_NAMES += PS2_MOUSE
FEATURE_NAMES += RGBLIGHT
FEATURE_NAMES += RGB_MATRIX
FEATURE_NAMES += SLEEP_LED
FEATURE_NAMES += SERIAL_LINK
FEATURE_NAMES += STENO
FEATURE_NAMES += SWAP_HANDS
FEATURE_NAMES += VISUALIZER
FEATURE_NAMES += WATCHDOG
FEATURE_NAMES += XT
$(foreach AFEATURE,$(FEATURE_NAMES),\
$(if $(filter $($(AFEATURE)_SUPPORTED),no),$(eval $(AFEATURE)_ENABLE=no)))

+ 457
- 0
docs/ChangeLog/20211127.md View File

@ -0,0 +1,457 @@
# QMK Breaking Changes - 2021 November 27 Changelog
## 2000 keyboards! :id=qmk-2000th-keyboard
QMK had it's 2000th keyboard submitted during this breaking changes cycle.... and it only _just_ made the cut-off!
```shell
% qmk list-keyboards | wc -l
2003
```
From the whole QMK team, a major thankyou to the community for embracing QMK as your preferred keyboard firmware!
## Notable Features :id=notable-features
### Expanded Pointing Device support ([#14343](https://github.com/qmk/qmk_firmware/pull/14343)) :id=expanded-pointing-device
Pointing device support has been reworked and reimplemented to allow for easier integration of new peripherals.
Usages of `POINTING_DEVICE_ENABLE = yes` in `rules.mk` files now need to be accompanied by a corresponding `POINTING_DEVICE_DRIVER = ???` line, specifying which driver to use during the build. Existing keyboards have already been migrated across to the new usage pattern, so most likely no change is required by users.
QMK now has core-supplied support for the following pointing device peripherals:
| `rules.mk` line | Supported device |
|------------------------------------------------|-----------------------------------------|
| `POINTING_DEVICE_DRIVER = analog_joystick` | Analog joysticks, such as PSP joysticks |
| `POINTING_DEVICE_DRIVER = adns5050` | ADNS 5050 sensor |
| `POINTING_DEVICE_DRIVER = adns9800` | ADNS 9800 laser sensor |
| `POINTING_DEVICE_DRIVER = cirque_pinnacle_i2c` | Cirque touchpad, I2C mode |
| `POINTING_DEVICE_DRIVER = cirque_pinnacle_spi` | Cirque Touchpad, SPI mode |
| `POINTING_DEVICE_DRIVER = pimoroni_trackball` | Pimoroni Trackball |
| `POINTING_DEVICE_DRIVER = pmw3360` | PMW 3360 |
See the new documentation for the [Pointing Device](../feature_pointing_device.md) feature for more information on specific configuration for each driver.
### Dynamic Tapping Term ([#11036](https://github.com/qmk/qmk_firmware/pull/11036)) :id=dynamic-tapping-term
For people who are starting out with tapping keys, or for people who think tapping keys don't "feel right", it's sometimes quite difficult to determine what duration of tapping term to use to make things seem natural.
If you're in this stage of discovery, you can now add `DYNAMIC_TAPPING_TERM_ENABLE = yes` to your `rules.mk`, which enables the use of the following keycodes in your keymap:
| Key | Description |
|-----------|-------------------------------------------------------------------------------|
| `DT_PRNT` | "Dynamic Tapping Term Print": Types the current tapping term, in milliseconds |
| `DT_UP` | "Dynamic Tapping Term Up": Increases the current tapping term by 5ms |
| `DT_DOWN` | "Dynamic Tapping Term Down": Decreases the current tapping term by 5ms |
Coupled with the use of `qmk console` or QMK Toolbox to show console output from your keyboard, you can tweak the tapping term dynamically in order to narrow down what "feels right" to you. Once you're happy, drop in the resulting number into your keymap's `config.h` and you're good to go!
### Macros in JSON keymaps ([#14374](https://github.com/qmk/qmk_firmware/pull/14374)) :id=macros-in-keymap-json
You can now define up to 32 macros in your `keymap.json` file, as used by [QMK Configurator](newbs_building_firmware_configurator.md), and `qmk compile`. You can define these macros in a list under the `macros` keyword, like this:
```json
{
"keyboard": "handwired/my_macropad",
"keymap": "my_keymap",
"macros": [
[ // first listed is MACRO_0...
{"action":"down", "keycodes": ["LSFT"]},
"hello world1",
{"action": "up","keycodes": ["LSFT"]}
],
[ // ...then MACRO_1...
{"action":"tap", "keycodes": ["LCTL", "LALT", "DEL"]}
],
[ // ...then MACRO_2...
"ding!",
{"action":"beep"}
],
[ // ...and MACRO_3.
{"action":"tap", "keycodes": ["F1"]},
{"action":"delay", "duration": "1000"},
{"action":"tap", "keycodes": ["PGDN"]}
]
],
"layout": "LAYOUT_all",
"layers": [
["MACRO_0", "MACRO_1", "MACRO_2", "MACRO_3"]
]
}
```
In due course, [QMK Configurator](https://config.qmk.fm/) will pick up support for defining these in its UI, but for now the json is the only way to define macros.
## Changes Requiring User Action :id=changes-requiring-user-action
### Updated Keyboard Codebases :id=updated-keyboard-codebases
The following keyboards have had their source moved within QMK:
| Old Keyboard Name | New Keyboard Name |
|------------------------|---------------------------------|
| aozora/hotswap | aozora |
| gskt00 | kapcave/gskt00 |
| handwired/dtisaac01 | dtisaac/dtisaac01 |
| kprepublic/bm60poker | kprepublic/bm60hsrgb_poker/rev1 |
| kprepublic/bm60rgb | kprepublic/bm60hsrgb/rev1 |
| kprepublic/bm60rgb_iso | kprepublic/bm60hsrgb_iso/rev1 |
| kprepublic/bm65iso | kprepublic/bm65hsrgb_iso |
| kprepublic/bm68rgb | kprepublic/bm68hsrgb |
| paladin64 | kapcave/paladin64 |
| portal_66 | portal_66/soldered |
| signum/3_0/elitec | signum/3_0 |
| tgr/jane | tgr/jane/v2 |
### Squeezing space out of AVR ([#15243](https://github.com/qmk/qmk_firmware/pull/15243)) :id=squeezing-space-from-avr
The AVR platform has been problematic for some time, in the sense that it is severely resource-constrained -- this makes life difficult for anyone attempting to add new functionality such as display panels to their keymap code. The illustrious Drashna has contributed some newer documentation on how to attempt to free up some space on AVR-based keyboards that are in short supply.
Of course, there are much fewer constraints with ARM chips... ;)
### Require explicit enabling of RGB Matrix modes ([#15018](https://github.com/qmk/qmk_firmware/pull/15018)) :id=explicit-rgb-modes
Related to the previous section -- RGB Matrix modes have now been made to be opt-in, rather than opt-out. As these animations are now opt-in, you may find that your keyboard no longer has all the RGB modes you're expecting -- you may need to configure and recompile your firmware and enable your animations of choice... with any luck they'll still fit in the space available.
Most keyboards keep their original functionality, but over time the QMK maintainers have found that removal of animations ends up being the quickest way to free up space... and some keyboards have had animations such as reactive effects disabled by default in order to still fit within the flash space available.
The full list of configurables to turn specific animations back on can be found at on the [RGB Matrix documentation](feature_rgb_matrix.md#rgb-matrix-effects) page.
### OLED task refactoring ([#14864](https://github.com/qmk/qmk_firmware/pull/14864)) :id=oled-task-refactor
OLED display code was traditionally difficult to override in keymaps as they did not follow the standard pattern of `bool *_kb()` deferring to `bool *_user()` functions, allowing signalling to the higher level that processing had already been done.
This changes the standard OLED drawing function model to allow for a base implementation to be provided by a keyboard, but also still allow for keymap-level overrides without needing to modify the keyboard's code.
The old keymap code went something like this:
```c
void oled_task_user(void) {
// keymap drawing code
}
```
...but the new keymap code looks like this:
```c
bool oled_task_user(void) {
// keymap drawing code
return false;
}
```
Keyboard designers should now structure their keyboard-level drawing routines like the following, in order to allow for keymap overrides:
```c
bool oled_task_kb(void) {
// Defer to the keymap if they want to override
if(!oled_task_user()) { return false; }
// default keyboard drawing code
return false;
}
```
### Bootmagic Full Removal ([#15002](https://github.com/qmk/qmk_firmware/pull/15002)) :id=bootmagic-full-removal
As noted during previous breaking changes cycles, QMK decided to deprecate the full Bootmagic feature and leave Bootmagic Lite as the only remaining option.
This removal is now complete!
This pull request changes the behavior of `BOOTMAGIC_ENABLE` such that specifying `lite` or `full` results in an error, allowing only `yes` or `no`, with `yes` mirroring historical `lite` functionality.
All use of the `lite` keyword within the repository has been migrated to `yes` -- any new submissions using `lite` will now fail to build and should be updated accordingly.
#### Bootmagic Full Deprecation Schedule: Complete!
This is the historical timeline for the behavior of `BOOTMAGIC_ENABLE`:
- (done) From 2021 May 29, setting `BOOTMAGIC_ENABLE = yes` will enable Bootmagic Lite instead of full Bootmagic.
- (done) From 2021 Aug 28, `BOOTMAGIC_ENABLE` must be either `yes`, `lite`, or `no` – setting `BOOTMAGIC_ENABLE = full` will cause compilation to fail.
- (now) From 2021 Nov 27, `BOOTMAGIC_ENABLE` must be either `yes` or `no` – setting `BOOTMAGIC_ENABLE = lite` will cause compilation to fail.
### Remove QWIIC_DRIVERS ([#14174](https://github.com/qmk/qmk_firmware/pull/14174)) :id=remove-qwiic
Due to minimal QWIIC adoption and other options for similar functionality, the QWIIC drivers were removed from QMK. Existing OLED usages have been migrated across to the normal QMK OLED driver instead.
## Notable core changes :id=notable-core
### New MCU Support :id=new-mcu-support
QMK firmware picked up support for a handful of new MCU families, potentially making it a bit easier to source components.
QMK firmware is now no longer limited to AVR and ARM - it also picked up support for our first RISC-V chip, the GD32VF103.
* Add support for RISC-V builds and GD32VF103 MCU ([#12508](https://github.com/qmk/qmk_firmware/pull/12508))
* Add HT32 support to core ([#14388](https://github.com/qmk/qmk_firmware/pull/14388))
* Westberrytech pr ([#14422](https://github.com/qmk/qmk_firmware/pull/14422))
* Initial pass of F405 support ([#14584](https://github.com/qmk/qmk_firmware/pull/14584))
### EEPROM Changes :id=eeprom-changes
There were a few EEPROM-related changes that landed during this breaking changes cycle, most prominently the long-awaited ability for the Drop boards to gain persistent storage. Any users of the Drop CTRL or Drop ALT should update QMK Toolbox as well -- coupled with a QMK firmware update settings should now be saved.
* massdrop alt/ctrl: support saving into nvm ([#6068](https://github.com/qmk/qmk_firmware/pull/6068))
* Implement F4 eeprom ([#14195](https://github.com/qmk/qmk_firmware/pull/14195))
* make the full 4096 bytes of EEPROM work on Teensy 3.6 ([#12947](https://github.com/qmk/qmk_firmware/pull/12947))
* Further tidy up of STM32 eeprom emulation ([#14591](https://github.com/qmk/qmk_firmware/pull/14591))
* Enable eeprom with F401xE ld ([#14752](https://github.com/qmk/qmk_firmware/pull/14752))
### Compilation Database :id=compile-commands
A clang-compatible compilation database generator has been added as an option in order to help development environments such as Visual Studio Code.
Running `qmk generate-compilation-database -kb <yourkb> -km <yourkeymap>` from within the QMK firmware directory will generate a `compile_commands.json` file -- using a compatible IDE will likely see this and correctly start detecting the correct locations for source files as well as type and function information that are relevant to your build.
Do note that switching keyboards will require re-generation of this file.
* New CLI subcommand to create clang-compatible compilation database (`compile_commands.json`) ([#14370](https://github.com/qmk/qmk_firmware/pull/14370))
* compiledb: query include paths from gcc directly. ([#14462](https://github.com/qmk/qmk_firmware/pull/14462))
### Codebase restructure and cleanup :id=codebase-restructure
QMK continues on its restructuring journey, in order to make it easier to integrate newer features and add support for new hardware. This quarter's batch of changes include:
* add 'include keyboard_features.mk' into build_keyboard.mk ([#8422](https://github.com/qmk/qmk_firmware/pull/8422))
* Infer more when building features ([#13890](https://github.com/qmk/qmk_firmware/pull/13890))
* Move `tmk_core/common/<plat>` ([#13918](https://github.com/qmk/qmk_firmware/pull/13918))
* Move feature suspend logic out of platform specific code ([#14210](https://github.com/qmk/qmk_firmware/pull/14210))
* Remove bin/qmk ([#14231](https://github.com/qmk/qmk_firmware/pull/14231))
* Move Audio drivers from quantum to platform drivers folder ([#14308](https://github.com/qmk/qmk_firmware/pull/14308))
* Remove Arduino-style `analogRead()` ([#14348](https://github.com/qmk/qmk_firmware/pull/14348))
* Remove unreferenced IBM4704, Sony NEWS, NeXT keyboard code. ([#14380](https://github.com/qmk/qmk_firmware/pull/14380))
* Move Bluetooth config to common_features.mk ([#14404](https://github.com/qmk/qmk_firmware/pull/14404))
* Relocate Adafruit BLE code ([#14530](https://github.com/qmk/qmk_firmware/pull/14530))
* Change `MK66F18` -> `MK66FX1M0` ([#14659](https://github.com/qmk/qmk_firmware/pull/14659))
* Remove sysex API ([#14723](https://github.com/qmk/qmk_firmware/pull/14723))
* Basic keycode overhaul ([#14726](https://github.com/qmk/qmk_firmware/pull/14726))
* Remove SERIAL_LINK feature ([#14727](https://github.com/qmk/qmk_firmware/pull/14727))
* Move converter specific tmk_core protocols ([#14743](https://github.com/qmk/qmk_firmware/pull/14743))
* Align PS/2 GPIO defines ([#14745](https://github.com/qmk/qmk_firmware/pull/14745))
* Clean up LED/RGB Matrix driver config ([#14760](https://github.com/qmk/qmk_firmware/pull/14760))
* Update UART driver API ([#14839](https://github.com/qmk/qmk_firmware/pull/14839))
* Tidy up LCD_ENABLE/visualizer references ([#14855](https://github.com/qmk/qmk_firmware/pull/14855))
* Remove legacy Makefile functionality ([#14858](https://github.com/qmk/qmk_firmware/pull/14858))
* Begin to carve out platform/protocol API - Migrate keyboard_* calls ([#14888](https://github.com/qmk/qmk_firmware/pull/14888))
* Rename platform SRC variable ([#14894](https://github.com/qmk/qmk_firmware/pull/14894))
* Relocate PS2 code ([#14895](https://github.com/qmk/qmk_firmware/pull/14895))
* Move USE_CCACHE logic to common location ([#14899](https://github.com/qmk/qmk_firmware/pull/14899))
* Migrate makefile utilities to sub-directory ([#14917](https://github.com/qmk/qmk_firmware/pull/14917))
* Remove SERIAL_MOUSE ([#14969](https://github.com/qmk/qmk_firmware/pull/14969))
* Relocate protocol files within tmk_core/common/ ([#14972](https://github.com/qmk/qmk_firmware/pull/14972))
* More platform/protocol alignment ([#14976](https://github.com/qmk/qmk_firmware/pull/14976))
* Fix uart function prototypes ([#15162](https://github.com/qmk/qmk_firmware/pull/15162))
* Remove deprecated KEYMAP alias ([#15037](https://github.com/qmk/qmk_firmware/pull/15037))
* Move non-assignment code to post_rules.mk ([#14207](https://github.com/qmk/qmk_firmware/pull/14207))
* Helix use `post_rules.mk` ([#14216](https://github.com/qmk/qmk_firmware/pull/14216))
* Make ChibiOS PAL interactions less STM32 specific - Round 2 ([#14456](https://github.com/qmk/qmk_firmware/pull/14456))
---
## Full changelist
Core:
* massdrop alt/ctrl: support saving into nvm ([#6068](https://github.com/qmk/qmk_firmware/pull/6068))
* Made AVR backlight pwm resolution configurable ([#7521](https://github.com/qmk/qmk_firmware/pull/7521))
* add 'include keyboard_features.mk' into build_keyboard.mk ([#8422](https://github.com/qmk/qmk_firmware/pull/8422))
* New feature: `DYNAMIC_TAPPING_TERM_ENABLE` ([#11036](https://github.com/qmk/qmk_firmware/pull/11036))
* Add Retro Shift (Auto Shift for Tap Hold via Retro Tapping) and Custom Auto Shifts ([#11059](https://github.com/qmk/qmk_firmware/pull/11059))
* Add support for RISC-V builds and GD32VF103 MCU ([#12508](https://github.com/qmk/qmk_firmware/pull/12508))
* Add Fractal RGB matrix effects ([#12670](https://github.com/qmk/qmk_firmware/pull/12670))
* Added power tracking api ([#12691](https://github.com/qmk/qmk_firmware/pull/12691))
* haptic: Feature to disable it when usb port is not configured or suspended. ([#12692](https://github.com/qmk/qmk_firmware/pull/12692))
* make the full 4096 bytes of EEPROM work on Teensy 3.6 ([#12947](https://github.com/qmk/qmk_firmware/pull/12947))
* Add Support for USB programmable buttons ([#12950](https://github.com/qmk/qmk_firmware/pull/12950))
* [Tests] Increase QMK test coverage ([#13789](https://github.com/qmk/qmk_firmware/pull/13789))
* Add support for ISSI drivers on both sides of a split keyboard ([#13842](https://github.com/qmk/qmk_firmware/pull/13842))
* Infer more when building features ([#13890](https://github.com/qmk/qmk_firmware/pull/13890))
* Reimplements WPM feature to be smaller & precise ([#13902](https://github.com/qmk/qmk_firmware/pull/13902))
* Move `tmk_core/common/<plat>` ([#13918](https://github.com/qmk/qmk_firmware/pull/13918))
* Improvements to handling of disconnected split keyboards. ([#14033](https://github.com/qmk/qmk_firmware/pull/14033))
* Add Pixel Rain RGB Matrix effect ([#14155](https://github.com/qmk/qmk_firmware/pull/14155))
* Remove QWIIC_DRIVERS ([#14174](https://github.com/qmk/qmk_firmware/pull/14174))
* Add LM() keys to the list of keys disabled by NO_HAPTIC_MOD ([#14181](https://github.com/qmk/qmk_firmware/pull/14181))
* Implement F4 eeprom ([#14195](https://github.com/qmk/qmk_firmware/pull/14195))
* define to AUTO_SHIFT_DISABLED_AT_STARTUP ([#14201](https://github.com/qmk/qmk_firmware/pull/14201))
* Move feature suspend logic out of platform specific code ([#14210](https://github.com/qmk/qmk_firmware/pull/14210))
* Remove bin/qmk ([#14231](https://github.com/qmk/qmk_firmware/pull/14231))
* Change keyboard level include guards to `pragma once` ([#14248](https://github.com/qmk/qmk_firmware/pull/14248))
* i2c_master: Add support for reading/writing to 16-bit registers ([#14289](https://github.com/qmk/qmk_firmware/pull/14289))
* Move Audio drivers from quantum to platform drivers folder ([#14308](https://github.com/qmk/qmk_firmware/pull/14308))
* Add RGBW support to PWM and SPI drivers for ChibiOS ([#14327](https://github.com/qmk/qmk_firmware/pull/14327))
* Rework and expand Pointing Device support ([#14343](https://github.com/qmk/qmk_firmware/pull/14343))
* Remove Arduino-style `analogRead()` ([#14348](https://github.com/qmk/qmk_firmware/pull/14348))
* Macros in JSON keymaps ([#14374](https://github.com/qmk/qmk_firmware/pull/14374))
* Remove unreferenced IBM4704, Sony NEWS, NeXT keyboard code. ([#14380](https://github.com/qmk/qmk_firmware/pull/14380))
* Add HT32 support to core ([#14388](https://github.com/qmk/qmk_firmware/pull/14388))
* Align ChibiOS I2C defs with other drivers ([#14399](https://github.com/qmk/qmk_firmware/pull/14399))
* Move Bluetooth config to common_features.mk ([#14404](https://github.com/qmk/qmk_firmware/pull/14404))
* Westberrytech pr ([#14422](https://github.com/qmk/qmk_firmware/pull/14422))
* Refactor use of STM32_SYSCLK ([#14430](https://github.com/qmk/qmk_firmware/pull/14430))
* Migrate STM32_EEPROM_ENABLE to use EEPROM_DRIVER ([#14433](https://github.com/qmk/qmk_firmware/pull/14433))
* Refactor use of _STM32_ defines ([#14439](https://github.com/qmk/qmk_firmware/pull/14439))
* Add i2c defaults for Convert to Proton C ([#14470](https://github.com/qmk/qmk_firmware/pull/14470))
* Use opendrain pin with external pullup again ([#14474](https://github.com/qmk/qmk_firmware/pull/14474))
* Add ability to use numpad digits for unicode mode UC_WIN ([#14496](https://github.com/qmk/qmk_firmware/pull/14496))
* Enable de-ghosting for RGB/LED matrix on all ISSI LED drivers ([#14508](https://github.com/qmk/qmk_firmware/pull/14508))
* Relocate Adafruit BLE code ([#14530](https://github.com/qmk/qmk_firmware/pull/14530))
* Initial pass of F405 support ([#14584](https://github.com/qmk/qmk_firmware/pull/14584))
* Further tidy up of STM32 eeprom emulation ([#14591](https://github.com/qmk/qmk_firmware/pull/14591))
* Remove GCC version check from song list inclusion ([#14600](https://github.com/qmk/qmk_firmware/pull/14600))
* Change `MK66F18` -> `MK66FX1M0` ([#14659](https://github.com/qmk/qmk_firmware/pull/14659))
* Add ifndef to WS2812 timing constraints ([#14678](https://github.com/qmk/qmk_firmware/pull/14678))
* Reuse of EEPROM debounce logic ([#14699](https://github.com/qmk/qmk_firmware/pull/14699))
* Remove sysex API ([#14723](https://github.com/qmk/qmk_firmware/pull/14723))
* Basic keycode overhaul ([#14726](https://github.com/qmk/qmk_firmware/pull/14726))
* Remove SERIAL_LINK feature ([#14727](https://github.com/qmk/qmk_firmware/pull/14727))
* Enable CLI flashing via mdloader ([#14729](https://github.com/qmk/qmk_firmware/pull/14729))
* Correct the Turkish F '?' keycode (TR_QUES) ([#14740](https://github.com/qmk/qmk_firmware/pull/14740))
* Move converter specific tmk_core protocols ([#14743](https://github.com/qmk/qmk_firmware/pull/14743))
* Align PS/2 GPIO defines ([#14745](https://github.com/qmk/qmk_firmware/pull/14745))
* Improve Adafruit BLE configuration defines ([#14749](https://github.com/qmk/qmk_firmware/pull/14749))
* Enable eeprom with F401xE ld ([#14752](https://github.com/qmk/qmk_firmware/pull/14752))
* Clean up LED/RGB Matrix driver config ([#14760](https://github.com/qmk/qmk_firmware/pull/14760))
* Initial USB2422 driver ([#14835](https://github.com/qmk/qmk_firmware/pull/14835))
* Update UART driver API ([#14839](https://github.com/qmk/qmk_firmware/pull/14839))
* Split out arm_atsam shift register logic ([#14848](https://github.com/qmk/qmk_firmware/pull/14848))
* Split out HAPTIC_ENABLE to have separate DRIVER option ([#14854](https://github.com/qmk/qmk_firmware/pull/14854))
* Tidy up LCD_ENABLE/visualizer references ([#14855](https://github.com/qmk/qmk_firmware/pull/14855))
* Remove legacy Makefile functionality ([#14858](https://github.com/qmk/qmk_firmware/pull/14858))
* Add support for deferred executors. ([#14859](https://github.com/qmk/qmk_firmware/pull/14859))
* Change OLED task function to be boolean ([#14864](https://github.com/qmk/qmk_firmware/pull/14864))
* Add a new led driver for Keychron's keyboards. ([#14872](https://github.com/qmk/qmk_firmware/pull/14872))
* Begin to carve out platform/protocol API - Migrate keyboard_* calls ([#14888](https://github.com/qmk/qmk_firmware/pull/14888))
* Rename platform SRC variable ([#14894](https://github.com/qmk/qmk_firmware/pull/14894))
* Relocate PS2 code ([#14895](https://github.com/qmk/qmk_firmware/pull/14895))
* Move USE_CCACHE logic to common location ([#14899](https://github.com/qmk/qmk_firmware/pull/14899))
* Migrate makefile utilities to sub-directory ([#14917](https://github.com/qmk/qmk_firmware/pull/14917))
* Remove legacy handling for ErgoDox Infinity handedness ([#14919](https://github.com/qmk/qmk_firmware/pull/14919))
* Align usbasp flashing behaviour ([#14928](https://github.com/qmk/qmk_firmware/pull/14928))
* Optimize matrix scanning by removing variable shifts ([#14947](https://github.com/qmk/qmk_firmware/pull/14947))
* Stop-gap forward-port Drop LED features for CTRL and ALT ([#14967](https://github.com/qmk/qmk_firmware/pull/14967))
* Remove SERIAL_MOUSE ([#14969](https://github.com/qmk/qmk_firmware/pull/14969))
* Relocate protocol files within tmk_core/common/ ([#14972](https://github.com/qmk/qmk_firmware/pull/14972))
* Move LTO logic from common.mk ([#14973](https://github.com/qmk/qmk_firmware/pull/14973))
* More platform/protocol alignment ([#14976](https://github.com/qmk/qmk_firmware/pull/14976))
* Add support to persist MD LED framework settings ([#14980](https://github.com/qmk/qmk_firmware/pull/14980))
* Enable configuration of PWM frequency for IS31FL3733B ([#14983](https://github.com/qmk/qmk_firmware/pull/14983))
* Remove `BOOTMAGIC_ENABLE = lite` option ([#15002](https://github.com/qmk/qmk_firmware/pull/15002))
* Manually format develop ([#15003](https://github.com/qmk/qmk_firmware/pull/15003))
* Require explicit enabling of RGB Matrix modes ([#15018](https://github.com/qmk/qmk_firmware/pull/15018))
* Remove deprecated KEYMAP alias ([#15037](https://github.com/qmk/qmk_firmware/pull/15037))
* Fix uart function prototypes ([#15162](https://github.com/qmk/qmk_firmware/pull/15162))
* Rename RGB fractal ([#15174](https://github.com/qmk/qmk_firmware/pull/15174))
* Format code according to conventions ([#15195](https://github.com/qmk/qmk_firmware/pull/15195))
* Format code according to conventions ([#15196](https://github.com/qmk/qmk_firmware/pull/15196))
* Add uint to char functions ([#15244](https://github.com/qmk/qmk_firmware/pull/15244))
* [Tests] Increase QMK test coverage take 2 ([#15269](https://github.com/qmk/qmk_firmware/pull/15269))
* Tidy up adjustable ws2812 timing ([#15299](https://github.com/qmk/qmk_firmware/pull/15299))
* Add script for performing compilation size regression investigations. ([#15303](https://github.com/qmk/qmk_firmware/pull/15303))
* WB32F3G71 config migration with removal of unnecessary items. ([#15309](https://github.com/qmk/qmk_firmware/pull/15309))
* Re-add encoder tests ([#15312](https://github.com/qmk/qmk_firmware/pull/15312))
CLI:
* Add check for non-assignment code in rules.mk ([#12108](https://github.com/qmk/qmk_firmware/pull/12108))
* Export list of `develop` PRs to be merged into `master` ([#13944](https://github.com/qmk/qmk_firmware/pull/13944))
* remove qmk console, which is now part of the global cli ([#14206](https://github.com/qmk/qmk_firmware/pull/14206))
* New CLI subcommand to create clang-compatible compilation database (`compile_commands.json`) ([#14370](https://github.com/qmk/qmk_firmware/pull/14370))
* compiledb: query include paths from gcc directly. ([#14462](https://github.com/qmk/qmk_firmware/pull/14462))
Submodule updates:
* Update to ChibiOS 20.3.4, support builds against trunk ([#14208](https://github.com/qmk/qmk_firmware/pull/14208))
* Update ChibiOS-Contrib ([#14408](https://github.com/qmk/qmk_firmware/pull/14408))
* Update ChibiOS-Contrib ([#14419](https://github.com/qmk/qmk_firmware/pull/14419))
* Purge uGFX. ([#14720](https://github.com/qmk/qmk_firmware/pull/14720))
Keyboards:
* Add support for PaladinPad, Arya pcb and move keyboards by KapCave into their own directory ([#14194](https://github.com/qmk/qmk_firmware/pull/14194))
* Move non-assignment code to post_rules.mk ([#14207](https://github.com/qmk/qmk_firmware/pull/14207))
* Helix use `post_rules.mk` ([#14216](https://github.com/qmk/qmk_firmware/pull/14216))
* handwired/symmetric70_proto use post_rules.mk ([#14235](https://github.com/qmk/qmk_firmware/pull/14235))
* Add Adelais PCB. Adelais RGB rev.3, Adelais rev. 4 APM32F103, Adelais AVR rev. 1 ([#14252](https://github.com/qmk/qmk_firmware/pull/14252))
* GMMK Pro keymap ([#14389](https://github.com/qmk/qmk_firmware/pull/14389))
* Migrate boston_meetup/2019 away from QWIIC_DRIVERS ([#14413](https://github.com/qmk/qmk_firmware/pull/14413))
* Migrate hadron away from QWIIC_DRIVERS ([#14415](https://github.com/qmk/qmk_firmware/pull/14415))
* Enable Proton C defaults for SplitKB Kyria ([#14490](https://github.com/qmk/qmk_firmware/pull/14490))
* Set USB max power consumption of kint* controllers to 100mA ([#14546](https://github.com/qmk/qmk_firmware/pull/14546))
* Remove complex `fn_actions` macros ([#14662](https://github.com/qmk/qmk_firmware/pull/14662))
* New Keyboard: TGR Jane CE ([#14713](https://github.com/qmk/qmk_firmware/pull/14713))
* Migrate satisfaction75 away from QWIIC_DRIVERS ([#14747](https://github.com/qmk/qmk_firmware/pull/14747))
* add Lefty keyboard ([#14898](https://github.com/qmk/qmk_firmware/pull/14898))
* overnumpad controller: Add support for turning off solenoid enable in low power. ([#15021](https://github.com/qmk/qmk_firmware/pull/15021))
* Reduce compile size for melgeek mach80 ([#15034](https://github.com/qmk/qmk_firmware/pull/15034))
* Update updated KPrepublic boards to be prepared for the update ([#15040](https://github.com/qmk/qmk_firmware/pull/15040))
* rename kprepublic bm keyboards to have a standardized naming format ([#15047](https://github.com/qmk/qmk_firmware/pull/15047))
* matrix/abelx - Update ChibiOS conf files ([#15130](https://github.com/qmk/qmk_firmware/pull/15130))
* Disable console on Keebio foldkb and iris rev3 ([#15260](https://github.com/qmk/qmk_firmware/pull/15260))
* Disable console on Sofle default keymap ([#15261](https://github.com/qmk/qmk_firmware/pull/15261))
* Disable features on SplitKB boards to fit under size ([#15262](https://github.com/qmk/qmk_firmware/pull/15262))
* Enable LTO on viktus/sp_mini via keymap ([#15263](https://github.com/qmk/qmk_firmware/pull/15263))
Keyboard fixes:
* Fix number of elements in info.json does not match errors ([#14213](https://github.com/qmk/qmk_firmware/pull/14213))
* Fix typos from 14248 ([#14261](https://github.com/qmk/qmk_firmware/pull/14261))
* Stream cheap via fixes/updates ([#14325](https://github.com/qmk/qmk_firmware/pull/14325))
* Map `PRODUCT` define to `keyboard_name` ([#14372](https://github.com/qmk/qmk_firmware/pull/14372))
* Fix BT rules for dosa40rgb ([#14497](https://github.com/qmk/qmk_firmware/pull/14497))
* Fix typo in mechloving adelais header files ([#14590](https://github.com/qmk/qmk_firmware/pull/14590))
* Fix for mechlovin/adelais/standard_led/arm/rev4 ([#14639](https://github.com/qmk/qmk_firmware/pull/14639))
* Fix OLED timeout on recent qwiic migrations ([#14775](https://github.com/qmk/qmk_firmware/pull/14775))
* Fix OLED timeout on satisfaction75 after migration from QWIIC ([#14780](https://github.com/qmk/qmk_firmware/pull/14780))
* Fix Compile issues for lefty ([#14982](https://github.com/qmk/qmk_firmware/pull/14982))
* Fix missing return for oled task on Lefty ([#15010](https://github.com/qmk/qmk_firmware/pull/15010))
* Fix missing return for oled task on Arabica37 ([#15011](https://github.com/qmk/qmk_firmware/pull/15011))
* Fix missing return for oled task in drashna userspace ([#15012](https://github.com/qmk/qmk_firmware/pull/15012))
* Fix size issues on pistachio pro via keymap ([#15017](https://github.com/qmk/qmk_firmware/pull/15017))
* Fix keycode collision in craftwalk keymap ([#15055](https://github.com/qmk/qmk_firmware/pull/15055))
* Fix compilation issues for yanghu Unicorne ([#15068](https://github.com/qmk/qmk_firmware/pull/15068))
* Fixup broken build after #15040 ([#15073](https://github.com/qmk/qmk_firmware/pull/15073))
* Fix compilation issues for Lime ([#15116](https://github.com/qmk/qmk_firmware/pull/15116))
* Fix additional board sizes for RGB Matrix ([#15170](https://github.com/qmk/qmk_firmware/pull/15170))
* Fix bandominedoni via keymap compilation ([#15171](https://github.com/qmk/qmk_firmware/pull/15171))
* Fix handful of boards compiling too large due to RGB matrix changes ([#15184](https://github.com/qmk/qmk_firmware/pull/15184))
* Fix oled_task_user for ffkeebs/puca ([#15185](https://github.com/qmk/qmk_firmware/pull/15185))
* More headroom. ([#15301](https://github.com/qmk/qmk_firmware/pull/15301))
* More headroom. ([#15302](https://github.com/qmk/qmk_firmware/pull/15302))
Others:
* Clean up some code block languages ([#14434](https://github.com/qmk/qmk_firmware/pull/14434))
* Clarify "nested" and "rolling" key sequences ([#14655](https://github.com/qmk/qmk_firmware/pull/14655))
* CI: Create GitHub Actions unit test workflow ([#15223](https://github.com/qmk/qmk_firmware/pull/15223))
* Squeezing space out of AVR ([#15243](https://github.com/qmk/qmk_firmware/pull/15243))
Bugs:
* Fix parallel builds w/ LTO on systems where make is not GNU make. ([#13955](https://github.com/qmk/qmk_firmware/pull/13955))
* fix automatic directory for qmk lint ([#14215](https://github.com/qmk/qmk_firmware/pull/14215))
* RN42 Bluetooth typo fix ([#14421](https://github.com/qmk/qmk_firmware/pull/14421))
* fix typo in backlight code from #14439 ([#14442](https://github.com/qmk/qmk_firmware/pull/14442))
* fix compilation issues with USB programmable buttons ([#14454](https://github.com/qmk/qmk_firmware/pull/14454))
* Fix descriptor for USB Programmable Buttons ([#14455](https://github.com/qmk/qmk_firmware/pull/14455))
* Make ChibiOS PAL interactions less STM32 specific - Round 2 ([#14456](https://github.com/qmk/qmk_firmware/pull/14456))
* fix logical minimum in Programmable Button rdesc ([#14464](https://github.com/qmk/qmk_firmware/pull/14464))
* Fix i2c_readReg16 ([#14730](https://github.com/qmk/qmk_firmware/pull/14730))
* Put back eeconfig_update_ functions ([#14751](https://github.com/qmk/qmk_firmware/pull/14751))
* Fix misplaced endif in led_matrix_drivers.c ([#14785](https://github.com/qmk/qmk_firmware/pull/14785))
* Fix builds for ChibiOS + Cortex-M0[+] ([#14879](https://github.com/qmk/qmk_firmware/pull/14879))
* Fix ccache default ([#14906](https://github.com/qmk/qmk_firmware/pull/14906))
* Fix issues with Oneshot disabling ([#14934](https://github.com/qmk/qmk_firmware/pull/14934))
* Fix develop after recent changes ([#14975](https://github.com/qmk/qmk_firmware/pull/14975))
* Fix up issues shown by clang-format of vusb ([#15004](https://github.com/qmk/qmk_firmware/pull/15004))
* Fix unterminated ifdef in ISSI 3733 driver ([#15014](https://github.com/qmk/qmk_firmware/pull/15014))
* Fix build failures caused by #12947. ([#15019](https://github.com/qmk/qmk_firmware/pull/15019))
* Fixup LED matrix. ([#15020](https://github.com/qmk/qmk_firmware/pull/15020))
* Revert to old init order for host driver ([#15029](https://github.com/qmk/qmk_firmware/pull/15029))
* Fixup #15029 ([#15031](https://github.com/qmk/qmk_firmware/pull/15031))
* RISC-V toolchain and picolibc fixes ([#15109](https://github.com/qmk/qmk_firmware/pull/15109))
* gcc10 LTO - Only specify adhlns assembler options at link time ([#15115](https://github.com/qmk/qmk_firmware/pull/15115))
* Add needed include to pointing_device.c ([#15167](https://github.com/qmk/qmk_firmware/pull/15167))
* Fix missing variable for Backlight Breathing ([#15199](https://github.com/qmk/qmk_firmware/pull/15199))
* Revert backlight pins on function call ([#15205](https://github.com/qmk/qmk_firmware/pull/15205))
* Fix timer include in override_wiring.c ([#15221](https://github.com/qmk/qmk_firmware/pull/15221))
* fix broken macro in transport.h ([#15239](https://github.com/qmk/qmk_firmware/pull/15239))
* Short term bodge for PRODUCT warning ([#15240](https://github.com/qmk/qmk_firmware/pull/15240))
* Remove use of __flash due to LTO issues ([#15268](https://github.com/qmk/qmk_firmware/pull/15268))
* Documentation typo fix ([#15298](https://github.com/qmk/qmk_firmware/pull/15298))
* [Core] Hotfix for HOLD_ON_OTHER_KEY_PRESS after #11059 ([#15307](https://github.com/qmk/qmk_firmware/pull/15307))
* Fix call to pointing_device_handle_buttons ([#15313](https://github.com/qmk/qmk_firmware/pull/15313))
* [Develop] Fix ploopy readme typos ([#15316](https://github.com/qmk/qmk_firmware/pull/15316))

+ 3
- 1
docs/_summary.md View File

@ -13,6 +13,7 @@
* [Troubleshooting QMK](faq_misc.md)
* [Debugging QMK](faq_debug.md)
* [Keymap FAQ](faq_keymap.md)
* [Squeezing Space from AVR](squeezing_avr.md)
* [Glossary](reference_glossary.md)
* Configurator
@ -72,6 +73,7 @@
* [Mod-Tap](mod_tap.md)
* [Macros](feature_macros.md)
* [Mouse Keys](feature_mouse_keys.md)
* [Programmable Button](feature_programmable_button.md)
* [Space Cadet Shift](feature_space_cadet.md)
* [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md)
@ -127,7 +129,7 @@
* Breaking Changes
* [Overview](breaking_changes.md)
* [My Pull Request Was Flagged](breaking_changes_instructions.md)
* [Most Recent ChangeLog](ChangeLog/20210529.md "QMK v0.13.0 - 2021 May 29")
* [Most Recent ChangeLog](ChangeLog/20211127.md "QMK v0.15.0 - 2021 Nov 27")
* [Past Breaking Changes](breaking_changes_history.md)
* C Development


+ 7
- 7
docs/audio_driver.md View File

@ -57,14 +57,14 @@ This driver needs one Timer per enabled/used DAC channel, to trigger conversion;
Additionally, in the board config, you'll want to make changes to enable the DACs, GPT for Timers 6, 7 and 8:
``` c
```c
//halconf.h:
#define HAL_USE_DAC TRUE
#define HAL_USE_GPT TRUE
#include_next <halconf.h>
```
``` c
```c
// mcuconf.h:
#include_next <mcuconf.h>
#undef STM32_DAC_USE_DAC1_CH1
@ -93,14 +93,14 @@ only needs one timer (GPTD6, Tim6) to trigger the DAC unit to do a conversion; t
Additionally, in the board config, you'll want to make changes to enable the DACs, GPT for Timer 6:
``` c
```c
//halconf.h:
#define HAL_USE_DAC TRUE
#define HAL_USE_GPT TRUE
#include_next <halconf.h>
```
``` c
```c
// mcuconf.h:
#include_next <mcuconf.h>
#undef STM32_DAC_USE_DAC1_CH1
@ -153,7 +153,7 @@ This driver uses the ChibiOS-PWM system to produce a square-wave on specific out
The hardware directly toggles the pin via its alternate function. See your MCU's data-sheet for which pin can be driven by what timer - looking for TIMx_CHy and the corresponding alternate function.
A configuration example for the STM32F103C8 would be:
``` c
```c
//halconf.h:
#define HAL_USE_PWM TRUE
#define HAL_USE_PAL TRUE
@ -161,7 +161,7 @@ A configuration example for the STM32F103C8 would be:
#include_next <halconf.h>
```
``` c
```c
// mcuconf.h:
#include_next <mcuconf.h>
#undef STM32_PWM_USE_TIM1
@ -177,7 +177,7 @@ If we now target pin A8, looking through the data-sheet of the STM32F103C8, for
- TIM1_CH4 = PA11
with all this information, the configuration would contain these lines:
``` c
```c
//config.h:
#define AUDIO_PIN A8
#define AUDIO_PWM_DRIVER PWMD1


+ 23
- 9
docs/breaking_changes.md View File

@ -2,10 +2,13 @@
This document describes QMK's Breaking Change process. A Breaking Change is any change which modifies how QMK behaves in a way that in incompatible or potentially dangerous. We limit these changes so that users can have confidence that updating their QMK tree will not break their keymaps.
This also includes any keyboard moves within the repository.
The breaking change period is when we will merge PR's that change QMK in dangerous or unexpected ways. There is a built-in period of testing so we are confident that any problems caused are rare or unable to be predicted.
## What has been included in past Breaking Changes?
* [2021 Nov 27](ChangeLog/20211127.md)
* [2021 Aug 28](ChangeLog/20210828.md)
* [2021 May 29](ChangeLog/20210529.md)
* [2021 Feb 27](ChangeLog/20210227.md)
@ -17,16 +20,17 @@ The breaking change period is when we will merge PR's that change QMK in dangero
## When is the next Breaking Change?
The next Breaking Change is scheduled for August 28, 2021.
The next Breaking Change is scheduled for February 26, 2022.
### Important Dates
* [x] 2021 Aug 29 - `develop` is created. Each push to `master` is subsequently merged to `develop`
* [ ] 2021 Oct 31 - `develop` closed to new PR's.
* [ ] 2021 Oct 31 - Call for testers.
* [ ] 2021 Nov 26 - `master` is locked, no PR's merged.
* [ ] 2021 Nov 28 - Merge `develop` to `master`.
* [ ] 2021 Nov 28 - `master` is unlocked. PR's can be merged again.
* [x] 2021 Nov 27 - `develop` is tagged with a new release version. Each push to `master` is subsequently merged to `develop` by GitHub actions.
* [ ] 2022 Jan 31 - `develop` closed to new PR's.
* [ ] 2022 Jan 31 - Call for testers.
* [ ] 2022 Feb 12 - Last day for merges -- after this point `develop` is locked for testing and accepts only bugfixes
* [ ] 2022 Feb 24 - `master` is locked, no PR's merged.
* [ ] 2022 Feb 26 - Merge `develop` to `master`.
* [ ] 2022 Feb 26 - `master` is unlocked. PR's can be merged again.
## What changes will be included?
@ -36,8 +40,10 @@ If you want your breaking change to be included in this round you need to create
Criteria for acceptance:
* PR is complete and ready to merge
* PR has a ChangeLog
* The PR is complete and ready to merge
* The PR has a ChangeLog file describing the changes under `<qmk_firmware>/docs/Changelog/20220226`.
* This should be in Markdown format, with a name in the format `PR12345.md`, substituting the digits for your PR's ID.
* One strong recommendation that the ChangeLog document matches the PR description on GitHub, so as to ensure traceability.
# Checklists
@ -68,6 +74,14 @@ This happens immediately after the previous `develop` branch is merged.
* [ ] GitHub PR
* [ ] https://reddit.com/r/olkb
## 2 Weeks Before Merge
* `develop` is now closed to existing PR merges, only bugfixes for previous merges may be included
* Post call for testers
* [ ] Discord
* [ ] GitHub PR
* [ ] https://reddit.com/r/olkb
## 1 Week Before Merge
* Announce that master will be closed from <2 Days Before> to <Day of Merge>


+ 1
- 0
docs/breaking_changes_history.md View File

@ -2,6 +2,7 @@
This page links to all previous changelogs from the QMK Breaking Changes process.
* [2021 Nov 27](ChangeLog/20211127.md) - version 0.15.0
* [2021 Aug 28](ChangeLog/20210828.md) - version 0.14.0
* [2021 May 29](ChangeLog/20210529.md) - version 0.13.0
* [2021 Feb 27](ChangeLog/20210227.md) - version 0.12.0


+ 13
- 10
docs/chibios_upgrade_instructions.md View File

@ -14,10 +14,10 @@ ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a bra
* First time around this will take several hours
* Subsequent updates will be incremental only
* Tagging example (work out which version first!):
* `git tag -a ver20.3.3 -m ver20.3.3 svn/tags/ver20.3.3`
* `git push qmk ver20.3.3`
* `git tag -a breaking_YYYY_qN -m breaking_YYYY_qN svn/tags/ver20.3.3`
* `git push qmk breaking_YYYY_qN`
* `git tag -a ver20.3.4 -m ver20.3.4 svn/tags/ver20.3.4`
* `git push qmk ver20.3.4`
* `git tag -a develop_YYYY_qN -m develop_YYYY_qN svn/tags/ver20.3.4`
* `git push qmk develop_YYYY_qN`
## Getting ChibiOS-Contrib
@ -30,8 +30,8 @@ ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a bra
* `git checkout chibios-20.3.x`
* `git pull --ff-only`
* `git push origin chibios-20.3.x`
* `git tag -a breaking_YYYY_qN -m breaking_YYYY_qN chibios-20.3.x`
* `git push origin breaking_YYYY_qN`
* `git tag -a develop_YYYY_qN -m develop_YYYY_qN chibios-20.3.x`
* `git push origin develop_YYYY_qN`
## Updating submodules
@ -42,15 +42,18 @@ ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a bra
* `git checkout -b chibios-version-bump`
* `cd lib/chibios`
* `git fetch --all --tags --prune`
* `git checkout breaking_YYYY_qN`
* `git checkout develop_YYYY_qN`
* `cd ../chibios-contrib`
* `git fetch --all --tags --prune`
* `git checkout breaking_YYYY_qN`
* `git checkout develop_YYYY_qN`
* Update ChibiOS configs within QMK
* `cd $QMK_FIRMWARE`
* `./util/chibios_conf_updater.sh`
* Build everything
* `cd $QMK_FIRMWARE`
* `qmk multibuild -j4`
* Make sure there are no errors
* Push to the repo
* `git commit -am 'Update ChibiOS to XXXXXXXXX'`
* `git commit -am 'Update ChibiOS to 99.9.9'`
* `git push --set-upstream origin chibios-version-bump`
* Make a PR to qmk_firmware with the new branch
* Make a PR to qmk_firmware with the new branch

+ 27
- 0
docs/cli_commands.md View File

@ -382,6 +382,33 @@ qmk format-c
qmk format-c -b branch_name
```
## `qmk generate-compilation-database`
**Usage**:
```
qmk generate-compilation-database [-kb KEYBOARD] [-km KEYMAP]
```
Creates a `compile_commands.json` file.
Does your IDE/editor use a language server but doesn't _quite_ find all the necessary include files? Do you hate red squigglies? Do you wish your editor could figure out `#include QMK_KEYBOARD_H`? You might need a [compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html)! The qmk tool can build this for you.
This command needs to know which keyboard and keymap to build. It uses the same configuration options as the `qmk compile` command: arguments, current directory, and config files.
**Example:**
```
$ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak
$ qmk generate-compilation-database
Ψ Making clean
Ψ Gathering build instructions from make -n gh60/satan:colemak
Ψ Found 50 compile commands
Ψ Writing build database to /Users/you/src/qmk_firmware/compile_commands.json
```
Now open your dev environment and live a squiggly-free life.
## `qmk docs`
This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936.


+ 1
- 1
docs/cli_development.md View File

@ -14,7 +14,7 @@ If you intend to maintain keyboards and/or contribute to QMK, you can enable the
This will allow you to see all available subcommands.
**Note:** You will have to install additional requirements:
```bash
```
python3 -m pip install -r requirements-dev.txt
```


+ 12
- 0
docs/compatible_microcontrollers.md View File

@ -27,6 +27,7 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s
* [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)
* [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html)
* [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)
* [STM32F405](https://www.st.com/en/microcontrollers-microprocessors/stm32f405-415.html)
* [STM32F407](https://www.st.com/en/microcontrollers-microprocessors/stm32f407-417.html)
* [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html)
* [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html)
@ -36,13 +37,24 @@ You can also use any ARM chip with USB that [ChibiOS](https://www.chibios.org) s
* [STM32L422](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x2.html)
* [STM32L433](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html)
* [STM32L443](https://www.st.com/en/microcontrollers-microprocessors/stm32l4x3.html)
### WestBerryTech (WB32)
* [WB32F3G71xx](http://www.westberrytech.com)
### NXP (Kinetis)
* [MKL26Z64](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/kl-series-cortex-m0-plus/kinetis-kl2x-72-96-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x)
* [MK20DX128](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-50-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-based-on-arm-cortex-m4-core:K20_50)
* [MK20DX256](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72)
* [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)
## 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).
## RISC-V
### GigaDevice
[ChibiOS-Contrib](https://github.com/ChibiOS/ChibiOS-Contrib) has support for the GigaDevice [GD32VF103 series](https://www.gigadevice.com/products/microcontrollers/gd32/risc-v/mainstream-line/gd32vf103-series/) microcontrollers and provides configurations for the [SiPeed Longan Nano](https://longan.sipeed.com/en/) development board that uses this microcontroller. It is largely pin and feature compatible with STM32F103 and STM32F303 microcontrollers.

+ 6
- 2
docs/config_options.md View File

@ -206,7 +206,7 @@ If you define these options you will enable the associated feature, which may in
* `#define TAP_CODE_DELAY 100`
* Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds.
* `#define TAP_HOLD_CAPS_DELAY 80`
* Sets the delay for Tap Hold keys (`LT`, `MT`) when using `KC_CAPSLOCK` keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher.
* Sets the delay for Tap Hold keys (`LT`, `MT`) when using `KC_CAPS_LOCK` keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher.
* `#define KEY_OVERRIDE_REPEAT_DELAY 500`
* Sets the key repeat interval for [key overrides](feature_key_overrides.md).
@ -407,7 +407,7 @@ Use these to enable or disable building certain features. The more you have enab
* `MAGIC_ENABLE`
* MAGIC actions (BOOTMAGIC without the boot)
* `BOOTMAGIC_ENABLE`
* Virtual DIP switch configuration
* Enable Bootmagic Lite
* `MOUSEKEY_ENABLE`
* Mouse keys
* `EXTRAKEY_ENABLE`
@ -446,6 +446,10 @@ Use these to enable or disable building certain features. The more you have enab
* Forces the keyboard to wait for a USB connection to be established before it starts up
* `NO_USB_STARTUP_CHECK`
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
* `DEFERRED_EXEC_ENABLE`
* Enables deferred executor support -- timed delays before callbacks are invoked. See [deferred execution](custom_quantum_functions.md#deferred-execution) for more information.
* `DYNAMIC_TAPPING_TERM_ENABLE`
* Allows to configure the global tapping term on the fly.
## USB Endpoint Limitations


+ 4
- 4
docs/configurator_default_keymaps.md View File

@ -20,7 +20,7 @@ Keymaps in this directory require four key-value pairs:
Additionally, most keymaps contain a `commit` key. This key is not consumed by the API that back-stops QMK Configurator, but is used by Configurator's maintainers to tell which version of a keymap was used to create the JSON keymap in this repository. The value is the SHA of the last commit to modify a board's default `keymap.c` in the `qmk_firmware` repository. The SHA is found by checking out [the `master` branch of the `qmk/qmk_firmware` repository](https://github.com/qmk/qmk_firmware/tree/master/) and running `git log -1 --pretty=oneline -- keyboards/<keyboard>/keymaps/default/keymap.c` (use `keymap.json` if the keyboard in question has this file instead), which should return something similar to:
```shell
```
f14629ed1cd7c7ec9089604d64f29a99981558e8 Remove/migrate action_get_macro()s from default keymaps (#5625)
```
@ -31,7 +31,7 @@ In this example, `f14629ed1cd7c7ec9089604d64f29a99981558e8` is the value that sh
If one wished to add a default keymap for the H87a by Hineybush, one would run the `git log` command above against the H87a's default keymap in `qmk_firmware`:
```shell
```
user ~/qmk_firmware (master)
$ git log -1 --pretty=oneline master -- keyboards/hineybush/h87a/keymaps/default/keymap.c
ef8878fba5d3786e3f9c66436da63a560cd36ac9 Hineybush h87a lock indicators (#8237)
@ -46,7 +46,7 @@ Now that we have the commit hash, we need the keymap (edited for readability):
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS,
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SCRL, KC_PAUS,
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
@ -74,7 +74,7 @@ The default keymap uses the `LAYOUT_all` macro, so that will be the value of the
"layout": "LAYOUT_all",
"layers": [
[
"KC_ESC", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_PSCR", "KC_SLCK", "KC_PAUS",
"KC_ESC", "KC_F1", "KC_F2", "KC_F3", "KC_F4", "KC_F5", "KC_F6", "KC_F7", "KC_F8", "KC_F9", "KC_F10", "KC_F11", "KC_F12", "KC_PSCR", "KC_SCRL", "KC_PAUS",
"KC_GRV", "KC_1", "KC_2", "KC_3", "KC_4", "KC_5", "KC_6", "KC_7", "KC_8", "KC_9", "KC_0", "KC_MINS", "KC_EQL", "KC_BSPC", "KC_BSPC", "KC_INS", "KC_HOME", "KC_PGUP",
"KC_TAB", "KC_Q", "KC_W", "KC_E", "KC_R", "KC_T", "KC_Y", "KC_U", "KC_I", "KC_O", "KC_P", "KC_LBRC", "KC_RBRC", "KC_BSLS", "KC_DEL", "KC_END", "KC_PGDN",
"KC_CAPS", "KC_A", "KC_S", "KC_D", "KC_F", "KC_G", "KC_H", "KC_J", "KC_K", "KC_L", "KC_SCLN", "KC_QUOT", "KC_NUHS", "KC_ENT",


+ 1
- 1
docs/contributing.md View File

@ -105,7 +105,7 @@ enum my_keycodes {
Before opening a pull request, you can preview your changes if you have set up the development environment by running this command from the `qmk_firmware/` folder:
./bin/qmk docs
qmk docs
or if you only have Python 3 installed:


+ 1
- 1
docs/custom_matrix.md View File

@ -15,7 +15,7 @@ The reasons to use this feature include:
Implementing custom matrix usually involves compilation of an additional source file. It is recommended that for consistency, this file is called `matrix.c`.
Add a new file to your keyboard directory:
```text
```
keyboards/<keyboard>/matrix.c
```


+ 67
- 1
docs/custom_quantum_functions.md View File

@ -149,7 +149,7 @@ This is useful for setting up stuff that you may need elsewhere, but isn't hardw
* GPIO pin initialisation: `void matrix_init_pins(void)`
* This needs to perform the low-level initialisation of all row and column pins. By default this will initialise the input/output state of each of the GPIO pins listed in `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`, based on whether or not the keyboard is set up for `ROW2COL`, `COL2ROW`, or `DIRECT_PINS`. Should the keyboard designer override this function, no initialisation of pin state will occur within QMK itself, instead deferring to the keyboard's override.
* `COL2ROW`-based row reads: `void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)`
* `ROW2COL`-based column reads: `void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)`
* `ROW2COL`-based column reads: `void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter)`
* `DIRECT_PINS`-based reads: `void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)`
* These three functions need to perform the low-level retrieval of matrix state of relevant input pins, based on the matrix type. Only one of the functions should be implemented, if needed. By default this will iterate through `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`, configuring the inputs and outputs based on whether or not the keyboard is set up for `ROW2COL`, `COL2ROW`, or `DIRECT_PINS`. Should the keyboard designer override this function, no manipulation of matrix GPIO pin state will occur within QMK itself, instead deferring to the keyboard's override.
@ -405,3 +405,69 @@ And you're done. The RGB layer indication will only work if you want it to. And
* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)`
The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM.
### Deferred Execution :id=deferred-execution
QMK has the ability to execute a callback after a specified period of time, rather than having to manually manage timers.
#### Deferred executor callbacks
All _deferred executor callbacks_ have a common function signature and look like:
```c
uint32_t my_callback(uint32_t trigger_time, void *cb_arg) {
/* do something */
bool repeat = my_deferred_functionality();
return repeat ? 500 : 0;
}
```
The first argument `trigger_time` is the intended time of execution. If other delays prevent executing at the exact trigger time, this allows for "catch-up" or even skipping intervals, depending on the required behaviour.
The second argument `cb_arg` is the same argument passed into `defer_exec()` below, and can be used to access state information from the original call context.
The return value is the number of milliseconds to use if the function should be repeated -- if the callback returns `0` then it's automatically unregistered. In the example above, a hypothetical `my_deferred_functionality()` is invoked to determine if the callback needs to be repeated -- if it does, it reschedules for a `500` millisecond delay, otherwise it informs the deferred execution background task that it's done, by returning `0`.
?> Note that the returned delay will be applied to the intended trigger time, not the time of callback invocation. This allows for generally consistent timing even in the face of occasional late execution.
#### Deferred executor registration
Once a callback has been defined, it can be scheduled using the following API:
```c
deferred_token my_token = defer_exec(1500, my_callback, NULL);
```
The first argument is the number of milliseconds to wait until executing `my_callback` -- in the case above, `1500` milliseconds, or 1.5 seconds.
The third parameter is the `cb_arg` that gets passed to the callback at the point of execution. This value needs to be valid at the time the callback is invoked -- a local function value will be destroyed before the callback is executed and should not be used. If this is not required, `NULL` should be used.
The return value is a `deferred_token` that can consequently be used to cancel the deferred executor callback before it's invoked. If a failure occurs, the returned value will be `INVALID_DEFERRED_TOKEN`. Usually this will be as a result of supplying `0` to the delay, or a `NULL` for the callback. The other failure case is if there are too many deferred executions "in flight" -- this can be increased by changing the limit, described below.
#### Extending a deferred execution
The `deferred_token` returned by `defer_exec()` can be used to extend a the duration a pending execution waits before it gets invoked:
```c
// This will re-delay my_token's future execution such that it is invoked 800ms after the current time
extend_deferred_exec(my_token, 800);
```
#### Cancelling a deferred execution
The `deferred_token` returned by `defer_exec()` can be used to cancel a pending execution before it gets invoked:
```c
// This will cancel my_token's future execution
cancel_deferred_exec(my_token);
```
Once a token has been canceled, it should be considered invalid. Reusing the same token is not supported.
#### Deferred callback limits
There are a maximum number of deferred callbacks that can be scheduled, controlled by the value of the define `MAX_DEFERRED_EXECUTORS`.
If registrations fail, then you can increase this value in your keyboard or keymap `config.h` file, for example to 16 instead of the default 8:
```c
#define MAX_DEFERRED_EXECUTORS 16
```

+ 0
- 19
docs/de/cli.md View File

@ -51,25 +51,6 @@ Wir suchen nach Freiwilligen, die ein `qmk`-Package für weitere Betriebssysteme
* Installiere mit einem [virtualenv](https://virtualenv.pypa.io/en/latest/).
* Weise den User an, die Umgebungs-Variable `QMK_HOME` zu setzen, um die Firmware-Quelle anders einzustellen als `~/qmk_firmware`.
# Lokale CLI
Wenn Du die globale CLI nicht verwenden möchtest, beinhaltet `qmk_firmware` auch eine lokale CLI. Du kannst sie hier finden: `qmk_firmware/bin/qmk`. Du kannst den `qmk`-Befehl aus irgendeinem Datei-Verzeichnis ausführen und es wird immer auf dieser Kopie von `qmk_firmware` arbeiten.
**Beispiel**:
```
$ ~/qmk_firmware/bin/qmk hello
Ψ Hello, World!
```
## Einschränkungen der lokalen CLI
Hier ein Vergleich mit der globalen CLI:
* Die lokale CLI unterstützt kein `qmk setup` oder `qmk clone`.
* Die lokale CLI arbeitet immer innerhalb der selben `qmk_firmware`-Verzeichnisstruktur, auch wenn Du mehrere Repositories geklont hast.
* Die lokale CLI läuft nicht in einer virtualenv. Daher ist es möglich, dass Abhängigkeiten (dependencies) miteinander in Konflikt kommen/stehen.
# CLI-Befehle
## `qmk compile`


+ 1
- 0
docs/driver_installation_zadig.md View File

@ -93,6 +93,7 @@ The device name here is the name that appears in Zadig, and may not be what the
|`usbasploader`|USBasp |`16C0:05DC` |libusbK|
|`apm32-dfu` |APM32 DFU ISP Mode |`314B:0106` |WinUSB |
|`stm32-dfu` |STM32 BOOTLOADER |`0483:DF11` |WinUSB |
|`gd32v-dfu` |GD32V BOOTLOADER |`28E9:0189` |WinUSB |
|`kiibohd` |Kiibohd DFU Bootloader |`1C11:B007` |WinUSB |
|`stm32duino` |Maple 003 |`1EAF:0003` |WinUSB |
|`qmk-hid` |(keyboard name) Bootloader |`03EB:2067` |HidUsb |

+ 0
- 4
docs/es/hardware_drivers.md View File

@ -18,10 +18,6 @@ Soporte para direccionar pines en el ProMicro por su nombre Arduino en lugar de
Soporte para pantallas OLED basadas en SSD1306. Para obtener más información consulta la página de [Característica de Controlador OLED](feature_oled_driver.md).
## uGFX
Puedes hacer uso de uGFX dentro de QMK para manejar LCDs de caracteres y gráficos, matrices de LED, OLED, TFT, y otras tecnologías de visualización. Esto necesita ser mejor documentado. Si estás tratando de hacer esto y leer el código no ayuda por favor [abre una issue](https://github.com/qmk/qmk_firmware/issues/new) y podemos ayudarte por el proceso.
## WS2812 (Solo AVR)
Soporte para LEDs WS2811/WS2812{a,b,c}. Para obtener más información consulta la página de [Luz RGB](feature_rgblight.md).


+ 0
- 2
docs/es/hardware_keyboard_guidelines.md View File

@ -142,8 +142,6 @@ El año debe ser el primer año en que se crea el archivo. Si el trabajo se hizo
El núcleo de QMC está licenciado bajo la [GNU General Public License](https://www.gnu.org/licenses/licenses.en.html). Si estás enviando binarios para los procesadores AVR puedes elegir cualquiera [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) o [GPLv3](https://www.gnu.org/licenses/gpl.html). Si estás enviando binarios para ARM procesadores debes elegir [GPL Versión 3](https://www.gnu.org/licenses/gpl.html) para cumplir con los [ChibiOS](https://www.chibios.org) licencia GPLv3.
Si tu teclado hace uso de la [uGFX](https://gfx.io) características dentro de QMK debes cumplir con la [Licencia de uGFX](https://ugfx.io/license.html), que requiere una licencia comercial separada antes de vender un dispositivo que contiene uGFX.
## Detalles técnicos
Si estás buscando más información sobre cómo hacer que su teclado funcione con QMK, [echa un vistazo a la sección hardware](hardware.md)!

+ 2
- 2
docs/faq_debug.md View File

@ -62,7 +62,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
```
Example output
```text
```
Waiting for device:.......
Listening:
KL: kc: 169, col: 0, row: 0, pressed: 1
@ -82,7 +82,7 @@ When testing performance issues, it can be useful to know the frequency at which
```
Example output
```text
```
> matrix scan frequency: 315
> matrix scan frequency: 313
> matrix scan frequency: 316


+ 6
- 6
docs/faq_keymap.md View File

@ -19,7 +19,7 @@ There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JI
Sometimes, for readability's sake, it's useful to define custom names for some keycodes. People often define custom names using `#define`. For example:
```c
#define FN_CAPS LT(_FL, KC_CAPSLOCK)
#define FN_CAPS LT(_FL, KC_CAPS)
#define ALT_TAB LALT(KC_TAB)
```
@ -38,8 +38,8 @@ As a quick fix try holding down `Space`+`Backspace` while you plug in your keybo
The key found on most modern keyboards that is located between `KC_RGUI` and `KC_RCTL` is actually called `KC_APP`. This is because when that key was invented there was already a key named `MENU` in the relevant standards, so MS chose to call that the `APP` key.
## `KC_SYSREQ` Isn't Working
Use keycode for Print Screen(`KC_PSCREEN` or `KC_PSCR`) instead of `KC_SYSREQ`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
## `KC_SYSTEM_REQUEST` Isn't Working
Use keycode for Print Screen (`KC_PRINT_SCREEN`/`KC_PSCR`) instead of `KC_SYSTEM_REQUEST`. Key combination of 'Alt + Print Screen' is recognized as 'System request'.
See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
* https://en.wikipedia.org/wiki/Magic_SysRq_key
@ -47,7 +47,7 @@ See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and
## Power Keys Aren't Working
Somewhat confusingly, there are two "Power" keycodes in QMK: `KC_POWER` in the Keyboard/Keypad HID usage page, and `KC_SYSTEM_POWER` (or `KC_PWR`) in the Consumer page.
Somewhat confusingly, there are two "Power" keycodes in QMK: `KC_KB_POWER` in the Keyboard/Keypad HID usage page, and `KC_SYSTEM_POWER` (or `KC_PWR`) in the Consumer page.
The former is only recognized on macOS, while the latter, `KC_SLEP` and `KC_WAKE` are supported by all three major operating systems, so it is recommended to use those instead. Under Windows, these keys take effect immediately, however on macOS they must be held down until a dialog appears.
@ -57,7 +57,7 @@ https://github.com/tmk/tmk_keyboard/issues/67
## Modifier/Layer Stuck
Modifier keys or layers can be stuck unless layer switching is configured properly.
For Modifier keys and layer actions you have to place `KC_TRANS` on same position of destination layer to unregister the modifier key or return to previous layer on release event.
For Modifier keys and layer actions you have to place `KC_TRNS` on same position of destination layer to unregister the modifier key or return to previous layer on release event.
* https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#31-momentary-switching
* https://geekhack.org/index.php?topic=57008.msg1492604#msg1492604
@ -75,7 +75,7 @@ This feature is for *mechanical lock switch* like [this Alps one](https://deskth
After enabling this feature use keycodes `KC_LCAP`, `KC_LNUM` and `KC_LSCR` in your keymap instead.
Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `KC_CAPS`, `KC_NLCK` and `KC_SLCK`.***
Old vintage mechanical keyboards occasionally have lock switches but modern ones don't have. ***You don't need this feature in most case and just use keycodes `KC_CAPS`, `KC_NUM` and `KC_SCRL`.***
## Input Special Characters Other Than ASCII like Cédille 'Ç'


+ 1
- 5
docs/faq_misc.md View File

@ -36,7 +36,7 @@ Size after:
can retry, loading that one
- Some of the options you might specify in your keyboard's Makefile
consume extra memory; watch out for BOOTMAGIC_ENABLE,
MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE
MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE
- DFU tools do /not/ allow you to write into the bootloader (unless
you throw in an extra fruit salad of options), so there is little risk
there.
@ -49,10 +49,6 @@ First you have to compile firmware with the build option `NKRO_ENABLE` in **Make
Try `Magic` **N** command(`LShift+RShift+N` by default) when **NKRO** still doesn't work. You can use this command to toggle between **NKRO** and **6KRO** mode temporarily. In some situations **NKRO** doesn't work and you will need to switch to **6KRO** mode, in particular when you are in BIOS.
If your firmware was built with `BOOTMAGIC_ENABLE` you need to turn its switch on by `BootMagic` **N** command(`Space+N` by default). This setting is stored in EEPROM and kept over power cycles.
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
## TrackPoint Needs Reset Circuit (PS/2 Mouse Support)
Without reset circuit you will have inconsistent result due to improper initialization of the hardware. See circuit schematic of TPM754:


+ 163
- 15
docs/feature_auto_shift.md View File

@ -26,20 +26,26 @@ down will repeat the shifted key, though this can be disabled with
once then immediately (within `TAPPING_TERM`) hold it down again (this works
with the shifted value as well if auto-repeat is disabled).
There are also the `get_auto_shift_repeat` and `get_auto_shift_no_auto_repeat`
functions for more granular control. Neither will have an effect unless
`AUTO_SHIFT_REPEAT_PER_KEY` or `AUTO_SHIFT_NO_AUTO_REPEAT_PER_KEY` respectively
are defined.
## Are There Limitations to Auto Shift?
Yes, unfortunately.
You will have characters that are shifted when you did not intend on shifting, and
other characters you wanted shifted, but were not. This simply comes down to
practice. As we get in a hurry, we think we have hit the key long enough for a
shifted version, but we did not. On the other hand, we may think we are tapping
the keys, but really we have held it for a little longer than anticipated.
Additionally, with keyrepeat the desired shift state can get mixed up. It will
always 'belong' to the last key pressed. For example, keyrepeating a capital
and then tapping something lowercase (whether or not it's an Auto Shift key)
will result in the capital's *key* still being held, but shift not.
1. You will have characters that are shifted when you did not intend on shifting, and
other characters you wanted shifted, but were not. This simply comes down to
practice. As we get in a hurry, we think we have hit the key long enough for a
shifted version, but we did not. On the other hand, we may think we are tapping
the keys, but really we have held it for a little longer than anticipated.
2. Additionally, with keyrepeat the desired shift state can get mixed up. It will
always 'belong' to the last key pressed. For example, keyrepeating a capital
and then tapping something lowercase (whether or not it's an Auto Shift key)
will result in the capital's *key* still being held, but shift not.
3. Auto Shift does not apply to Tap Hold keys. For automatic shifting of Tap Hold
keys see [Retro Shift](#retro-shift).
## How Do I Enable Auto Shift?
@ -96,6 +102,34 @@ quicker than normal and you will be set.
?> Auto Shift has three special keys that can help you get this value right very quick. See "Auto Shift Setup" for more details!
For more granular control of this feature, you can add the following to your `config.h`:
```c
#define AUTO_SHIFT_TIMEOUT_PER_KEY
```
You can then add the following function to your keymap:
```c
uint16_t get_autoshift_timeout(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case AUTO_SHIFT_NUMERIC:
return 2 * get_generic_autoshift_timeout();
case AUTO_SHIFT_SPECIAL:
return get_generic_autoshift_timeout() + 50;
case AUTO_SHIFT_ALPHA:
default:
return get_generic_autoshift_timeout();
}
}
```
Note that you cannot override individual keys that are in one of those groups
if you are using them; trying to add a case for `KC_A` in the above example will
not compile as `AUTO_SHIFT_ALPHA` is there. A possible solution is a second switch
above to handle individual keys with no default case and only referencing the
groups in the below fallback switch.
### NO_AUTO_SHIFT_SPECIAL (simple define)
Do not Auto Shift special keys, which include -\_, =+, [{, ]}, ;:, '", ,<, .>,
@ -109,11 +143,24 @@ Do not Auto Shift numeric keys, zero through nine.
Do not Auto Shift alpha characters, which include A through Z.
### Auto Shift Per Key
### Auto Shift Per Key
This is a function that allows you to determine which keys shold be autoshifted, much like the tap-hold keys.
There are functions that allows you to determine which keys shold be autoshifted, much like the tap-hold keys.
The default function looks like this:
The first of these, used to simply add a key to Auto Shift, is `get_custom_auto_shifted_key`:
```c
bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case KC_DOT:
return true;
default:
return false;
}
}
```
For more granular control, there is `get_auto_shifted_key`. The default function looks like this:
```c
bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
@ -127,13 +174,14 @@ bool get_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
# ifndef NO_AUTO_SHIFT_SPECIAL
case KC_TAB:
case KC_MINUS ... KC_SLASH:
case KC_NONUS_BSLASH:
case KC_NONUS_BACKSLASH:
# endif
return true;
}
return false;
return get_custom_auto_shifted_key(keycode, record);
}
```
This functionality is enabled by default, and does not need a define.
### AUTO_SHIFT_REPEAT (simple define)
@ -144,6 +192,106 @@ Enables keyrepeat.
Disables automatically keyrepeating when `AUTO_SHIFT_TIMEOUT` is exceeded.
## Custom Shifted Values
Especially on small keyboards, the default shifted value for many keys is not
optimal. To provide more customizability, there are two user-definable
functions, `autoshift_press/release_user`. These register or unregister the
correct value for the passed key. Below is an example adding period to Auto
Shift and making its shifted value exclamation point. Make sure to use weak
mods - setting real would make any keys following it use their shifted values
as if you were holding the key. Clearing of modifiers is handled by Auto Shift,
and the OS-sent shift value if keyrepeating multiple keys is always that of
the last key pressed (whether or not it's an Auto Shift key).
You can also have non-shifted keys for the shifted values (or even no shifted
value), just don't set a shift modifier!
```c
bool get_custom_auto_shifted_key(uint16_t keycode, keyrecord_t *record) {
switch(keycode) {
case KC_DOT:
return true;
default:
return false;
}
}
void autoshift_press_user(uint16_t keycode, bool shifted, keyrecord_t *record) {
switch(keycode) {
case KC_DOT:
register_code16((!shifted) ? KC_DOT : KC_EXLM);
break;
default:
if (shifted) {
add_weak_mods(MOD_BIT(KC_LSFT));
}
// & 0xFF gets the Tap key for Tap Holds, required when using Retro Shift
register_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode);
}
}
void autoshift_release_user(uint16_t keycode, bool shifted, keyrecord_t *record) {
switch(keycode) {
case KC_DOT:
unregister_code16((!shifted) ? KC_DOT : KC_EXLM);
break;
default:
// & 0xFF gets the Tap key for Tap Holds, required when using Retro Shift
// The IS_RETRO check isn't really necessary here, always using
// keycode & 0xFF would be fine.
unregister_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode);
}
}
```
## Retro Shift
Holding and releasing a Tap Hold key without pressing another key will ordinarily
result in only the hold. With `retro shift` enabled this action will instead
produce a shifted version of the tap keycode on release.
It does not require [Retro Tapping](tap_hold.md#retro-tapping) to be enabled, and
if both are enabled the state of `retro tapping` will only apply if the tap keycode
is not matched by Auto Shift. `RETRO_TAPPING_PER_KEY` and its corresponding
function, however, are checked before `retro shift` is applied.
To enable `retro shift`, add the following to your `config.h`:
```c
#define RETRO_SHIFT
```
If `RETRO_SHIFT` is defined to a value, hold times greater than that value will
not produce a tap on release for Mod Taps, and instead triggers the hold action.
This enables modifiers to be held for combining with mouse clicks without
generating taps on release. For example:
```c
#define RETRO_SHIFT 500
```
This value (if set) must be greater than one's `TAPPING_TERM`, as the key press
must be designated as a 'hold' by `process_tapping` before we send the modifier.
There is no such limitation in regards to `AUTO_SHIFT_TIMEOUT` for normal keys.
### Retro Shift and Tap Hold Configurations
Tap Hold Configurations work a little differently when using Retro Shift.
Referencing `TAPPING_TERM` makes little sense, as holding longer would result in
shifting one of the keys.
`IGNORE_MOD_TAP_INTERRUPT` changes *only* rolling from a mod tap (releasing it
first), sending both keys instead of the modifier on the second. Its effects on
nested presses are ignored.
As nested taps were changed to act as though `PERMISSIVE_HOLD` is set unless only
`IGNORE_MOD_TAP_INTERRUPT` is (outside of Retro Shift), and Retro Shift ignores
`IGNORE_MOD_TAP_INTERRUPT`, `PERMISSIVE_HOLD` has no effect on Mod Taps.
Nested taps will *always* act as though the `TAPPING_TERM` was exceeded for both
Mod and Layer Tap keys.
## Using Auto Shift Setup
This will enable you to define three keys temporarily to increase, decrease and report your `AUTO_SHIFT_TIMEOUT`.


+ 6
- 6
docs/feature_backlight.md View File

@ -8,7 +8,7 @@ The MCU can only supply so much current to its GPIO pins. Instead of powering th
Most keyboards have backlighting enabled by default if they support it, but if it is not working for you, check that your `rules.mk` includes the following:
```makefile
```make
BACKLIGHT_ENABLE = yes
```
@ -54,7 +54,7 @@ If backlight breathing is enabled (see below), the following functions are also
To select which driver to use, configure your `rules.mk` with the following:
```makefile
```make
BACKLIGHT_DRIVER = software
```
@ -87,7 +87,7 @@ This functionality is configured at the keyboard level with the `BACKLIGHT_ON_ST
The `pwm` driver is configured by default, however the equivalent setting within `rules.mk` would be:
```makefile
```make
BACKLIGHT_DRIVER = pwm
```
@ -143,7 +143,7 @@ The breathing effect is the same as in the hardware PWM implementation.
While still in its early stages, ARM backlight support aims to eventually have feature parity with AVR. The `pwm` driver is configured by default, however the equivalent setting within `rules.mk` would be:
```makefile
```make
BACKLIGHT_DRIVER = pwm
```
@ -167,7 +167,7 @@ Currently only hardware PWM is supported, not timer assisted, and does not provi
In this mode, PWM is "emulated" while running other keyboard tasks. It offers maximum hardware compatibility without extra platform configuration. The tradeoff is the backlight might jitter when the keyboard is busy. To enable, add this to your `rules.mk`:
```makefile
```make
BACKLIGHT_DRIVER = software
```
@ -188,7 +188,7 @@ To activate multiple backlight pins, add something like this to your `config.h`,
If none of the above drivers apply to your board (for example, you are using a separate IC to control the backlight), you can implement a custom backlight driver using this simple API provided by QMK. To enable, add this to your `rules.mk`:
```makefile
```make
BACKLIGHT_DRIVER = custom
```


+ 13
- 12
docs/feature_bluetooth.md View File

@ -4,10 +4,10 @@
Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1, QMK has support for RN-42 modules. For more recent BLE protocols, currently only the Adafruit Bluefruit SPI Friend is directly supported. BLE is needed to connect to iOS devices. Note iOS does not support mouse input.
|Board |Bluetooth Protocol |Connection Type |rules.mk |Bluetooth Chip|
|----------------------------------------------------------------|----------------------------|----------------|---------------------------|--------------|
|Roving Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic | UART |`BLUETOOTH = RN42` | RN-42 |
|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy | SPI |`BLUETOOTH = AdafruitBLE` | nRF51822 |
|Board |Bluetooth Protocol |Connection Type|rules.mk |Bluetooth Chip|
|----------------------------------------------------------------|--------------------|---------------|--------------------------------|--------------|
|Roving Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic |UART |`BLUETOOTH_DRIVER = RN42` |RN-42 |
|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy|SPI |`BLUETOOTH_DRIVER = AdafruitBLE`|nRF51822 |
Not Supported Yet but possible:
* [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514)
@ -17,22 +17,23 @@ Not Supported Yet but possible:
### Adafruit BLE SPI Friend
Currently The only bluetooth chipset supported by QMK is the Adafruit Bluefruit SPI Friend. It's a Nordic nRF5182 based chip running Adafruit's custom firmware. Data is transmitted via Adafruit's SDEP over Hardware SPI. The [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) is supported as it's an AVR mcu connected via SPI to the Nordic BLE chip with Adafruit firmware. If Building a custom board with the SPI friend it would be easiest to just use the pin selection that the 32u4 feather uses but you can change the pins in the config.h options with the following defines:
* #define AdafruitBleResetPin D4
* #define AdafruitBleCSPin B4
* #define AdafruitBleIRQPin E6
* `#define ADAFRUIT_BLE_RST_PIN D4`
* `#define ADAFRUIT_BLE_CS_PIN B4`
* `#define ADAFRUIT_BLE_IRQ_PIN E6`
A Bluefruit UART friend can be converted to an SPI friend, however this [requires](https://github.com/qmk/qmk_firmware/issues/2274) some reflashing and soldering directly to the MDBT40 chip.
<!-- FIXME: Document bluetooth support more completely. -->
## Bluetooth Rules.mk Options
The currently supported Bluetooth chipsets do not support [N-Key Rollover (NKRO)](reference_glossary.md#n-key-rollover-nkro), so `rules.mk` must contain `NKRO_ENABLE = no`.
Use only one of these to enable Bluetooth:
* BLUETOOTH_ENABLE = yes (Legacy Option)
* BLUETOOTH = RN42
* BLUETOOTH = AdafruitBLE
Add the following to your `rules.mk`:
```make
BLUETOOTH_ENABLE = yes
BLUETOOTH_DRIVER = AdafruitBLE # or RN42
```
## Bluetooth Keycodes


+ 0
- 2
docs/feature_bootmagic.md View File

@ -8,8 +8,6 @@ On some keyboards Bootmagic Lite is disabled by default. If this is the case, it
BOOTMAGIC_ENABLE = yes
```
?> You may see `lite` being used in place of `yes`.
Additionally, you may want to specify which key to use. This is especially useful for keyboards that have unusual matrices. To do so, you need to specify the row and column of the key that you want to use. Add these entries to your `config.h` file:
```c


+ 2
- 2
docs/feature_combo.md View File

@ -56,7 +56,7 @@ combo_t key_combos[COMBO_COUNT] = {
[AB_ESC] = COMBO(ab_combo, KC_ESC),
[JK_TAB] = COMBO(jk_combo, KC_TAB),
[QW_SFT] = COMBO(qw_combo, KC_LSFT)
[SD_LAYER] = COMBO(layer_combo, MO(_LAYER)),
[SD_LAYER] = COMBO(sd_combo, MO(_LAYER)),
};
```
@ -173,7 +173,7 @@ uint16_t get_combo_term(uint16_t index, combo_t *combo) {
// i.e. the exact array of keys you defined for the combo.
// This can be useful if your combos have a common key and you want to apply the
// same combo term for all of them.
if (combo->keys[0] == KC_ENTER) { // if first key in the array is KC_ENTER
if (combo->keys[0] == KC_ENT) { // if first key in the array is Enter
return 150;
}


+ 1
- 1
docs/feature_digitizer.md View File

@ -4,7 +4,7 @@ The digitizer HID interface allows setting the mouse cursor position at absolute
To enable the digitizer interface, add the following line to your rules.mk:
```makefile
```make
DIGITIZER_ENABLE = yes
```


+ 1
- 1
docs/feature_grave_esc.md View File

@ -4,7 +4,7 @@ If you're using a 60% keyboard, or any other layout with no F-row, you will have
## Usage
Replace the `KC_GRAVE` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. Most of the time this key will output `KC_ESC` when pressed. However, when Shift or GUI are held down it will output `KC_GRV` instead.
Replace the `KC_GRV` key in your keymap (usually to the left of the `1` key) with `KC_GESC`. Most of the time this key will output `KC_ESC` when pressed. However, when Shift or GUI are held down it will output `KC_GRV` instead.
## What Your OS Sees


+ 18
- 3
docs/feature_haptic_feedback.md View File

@ -4,9 +4,22 @@
The following options are currently available for haptic feedback in `rules.mk`:
`HAPTIC_ENABLE += DRV2605L`
```
HAPTIC_ENABLE = yes
HAPTIC_DRIVER += DRV2605L
HAPTIC_DRIVER += SOLENOID
```
The following `config.h` settings are available for all types of haptic feedback:
`HAPTIC_ENABLE += SOLENOID`
| Settings | Default | Description |
|--------------------------------------|---------------|---------------------------------------------------------------------------------------------------------------|
|`HAPTIC_ENABLE_PIN` | *Not defined* |Configures a pin to enable a boost converter for some haptic solution, often used with solenoid drivers. |
|`HAPTIC_ENABLE_PIN_ACTIVE_LOW` | *Not defined* |If defined then the haptic enable pin is active-low. |
|`HAPTIC_ENABLE_STATUS_LED` | *Not defined* |Configures a pin to reflect the current enabled/disabled status of haptic feedback. |
|`HAPTIC_ENABLE_STATUS_LED_ACTIVE_LOW` | *Not defined* |If defined then the haptic status led will be active-low. |
|`HAPTIC_OFF_IN_LOW_POWER` | `0` |If set to `1`, haptic feedback is disabled before the device is configured, and while the device is suspended. |
## Known Supported Hardware
@ -45,6 +58,7 @@ First you will need a build a circuit to drive the solenoid through a mosfet as
| Settings | Default | Description |
|----------------------------|----------------------|-------------------------------------------------------|
|`SOLENOID_PIN` | *Not defined* |Configures the pin that the Solenoid is connected to. |
|`SOLENOID_PIN_ACTIVE_LOW` | *Not defined* |If defined then the solenoid trigger pin is active low.|
|`SOLENOID_DEFAULT_DWELL` | `12` ms |Configures the default dwell time for the solenoid. |
|`SOLENOID_MIN_DWELL` | `4` ms |Sets the lower limit for the dwell. |
|`SOLENOID_MAX_DWELL` | `100` ms |Sets the upper limit for the dwell. |
@ -170,8 +184,9 @@ The Haptic Exclusion is implemented as `__attribute__((weak)) bool get_haptic_en
### NO_HAPTIC_MOD
With the entry of `#define NO_HAPTIC_MOD` in config.h, the following keys will not trigger feedback:
* Usual modifier keys such as Control/Shift/Alt/Gui (For example `KC_LCTRL`)
* Usual modifier keys such as Control/Shift/Alt/Gui (For example `KC_LCTL`)
* `MO()` momentary keys. See also [Layers](feature_layers.md).
* `LM()` momentary keys with mod active.
* `LT()` layer tap keys, when held to activate a layer. However when tapped, and the key is quickly released, and sends a keycode, haptic feedback is still triggered.
* `TT()` layer tap toggle keys, when held to activate a layer. However when tapped `TAPPING_TOGGLE` times to permanently toggle the layer, on the last tap haptic feedback is still triggered.
* `MT()` mod tap keys, when held to keep a usual modifier key pressed. However when tapped, and the key is quickly released, and sends a keycode, haptic feedback is still triggered. See also [Mod-Tap](mod_tap.md).


+ 1
- 1
docs/feature_joystick.md View File

@ -15,7 +15,7 @@ or send gamepad reports based on values computed by the keyboard.
To use analog input you must first enable it in `rules.mk`:
```makefile
```make
JOYSTICK_ENABLE = yes
JOYSTICK_DRIVER = analog # or 'digital'
```


+ 3
- 3
docs/feature_key_overrides.md View File

@ -39,7 +39,7 @@ For more customization possibilities, you may directly create a `key_override_t`
This shows how the mentioned example of sending `delete` when `shift` + `backspace` are pressed is realized:
```c
const key_override_t delete_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_BSPACE, KC_DELETE);
const key_override_t delete_key_override = ko_make_basic(MOD_MASK_SHIFT, KC_BSPC, KC_DEL);
// This globally defines all key overrides to be used
const key_override_t **key_overrides = (const key_override_t *[]){
@ -107,10 +107,10 @@ The [Grave Escape feature](feature_grave_esc.md) is limited in its configurabili
```c
// Shift + esc = ~
const key_override_t tilde_esc_override = ko_make_basic(MOD_MASK_SHIFT, KC_ESC, S(KC_GRAVE));
const key_override_t tilde_esc_override = ko_make_basic(MOD_MASK_SHIFT, KC_ESC, S(KC_GRV));
// GUI + esc = `
const key_override_t grave_esc_override = ko_make_basic(MOD_MASK_GUI, KC_ESC, KC_GRAVE);
const key_override_t grave_esc_override = ko_make_basic(MOD_MASK_GUI, KC_ESC, KC_GRV);
const key_override_t **key_overrides = (const key_override_t *[]){
&tilde_esc_override,


+ 1
- 1
docs/feature_layers.md View File

@ -45,7 +45,7 @@ Once you have a good feel for how layers work and what you can do, you can get m
Layers stack on top of each other in numerical order. When determining what a keypress does, QMK scans the layers from the top down, stopping when it reaches the first active layer that is not set to `KC_TRNS`. As a result if you activate a layer that is numerically lower than your current layer, and your current layer (or another layer that is active and higher than your target layer) has something other than `KC_TRNS`, that is the key that will be sent, not the key on the layer you just activated. This is the cause of most people's "why doesn't my layer get switched" problem.
Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h).
Sometimes, you might want to switch between layers in a macro or as part of a tap dance routine. `layer_on` activates a layer, and `layer_off` deactivates it. More layer-related functions can be found in [action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/action_layer.h).
## Functions :id=functions


+ 1
- 1
docs/feature_layouts.md View File

@ -25,7 +25,7 @@ The `layouts/default/` and `layouts/community/` are two examples of layout "repo
Each layout folder is named (`[a-z0-9_]`) after the physical aspects of the layout, in the most generic way possible, and contains a `readme.md` with the layout to be defined by the keyboard:
```md
```markdown
# 60_ansi
LAYOUT_60_ansi


+ 25
- 24
docs/feature_led_matrix.md View File

@ -49,10 +49,12 @@ Here is an example using 2 drivers.
!> Note the parentheses, this is so when `LED_DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL)` will give very different results than `rand() % LED_DRIVER_1_LED_TOTAL + LED_DRIVER_2_LED_TOTAL`.
For split keyboards using `LED_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = {
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
* driver
* | LED address
@ -164,26 +166,26 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
|Define |Description |
|-------------------------------------------------------|-----------------------------------------------|
|`#define DISABLE_LED_MATRIX_ALPHAS_MODS` |Disables `LED_MATRIX_ALPHAS_MODS` |
|`#define DISABLE_LED_MATRIX_BREATHING` |Disables `LED_MATRIX_BREATHING` |
|`#define DISABLE_LED_MATRIX_BAND` |Disables `LED_MATRIX_BAND` |
|`#define DISABLE_LED_MATRIX_BAND_PINWHEEL` |Disables `LED_MATRIX_BAND_PINWHEEL` |
|`#define DISABLE_LED_MATRIX_BAND_SPIRAL` |Disables `LED_MATRIX_BAND_SPIRAL` |
|`#define DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT` |Disables `LED_MATRIX_CYCLE_LEFT_RIGHT` |
|`#define DISABLE_LED_MATRIX_CYCLE_UP_DOWN` |Disables `LED_MATRIX_CYCLE_UP_DOWN` |
|`#define DISABLE_LED_MATRIX_CYCLE_OUT_IN` |Disables `LED_MATRIX_CYCLE_OUT_IN` |
|`#define DISABLE_LED_MATRIX_DUAL_BEACON` |Disables `LED_MATRIX_DUAL_BEACON` |
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` |
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_WIDE` |
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_CROSS` |
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTICROSS`|
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_NEXUS` |
|`#define DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `LED_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
|`#define DISABLE_LED_MATRIX_SOLID_SPLASH` |Disables `LED_MATRIX_SOLID_SPLASH` |
|`#define DISABLE_LED_MATRIX_SOLID_MULTISPLASH` |Disables `LED_MATRIX_SOLID_MULTISPLASH` |
|`#define DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Disables `LED_MATRIX_WAVE_LEFT_RIGHT` |
|`#define DISABLE_LED_MATRIX_WAVE_UP_DOWN` |Disables `LED_MATRIX_WAVE_UP_DOWN` |
|`#define ENABLE_LED_MATRIX_ALPHAS_MODS` |Enables `LED_MATRIX_ALPHAS_MODS` |
|`#define ENABLE_LED_MATRIX_BREATHING` |Enables `LED_MATRIX_BREATHING` |
|`#define ENABLE_LED_MATRIX_BAND` |Enables `LED_MATRIX_BAND` |
|`#define ENABLE_LED_MATRIX_BAND_PINWHEEL` |Enables `LED_MATRIX_BAND_PINWHEEL` |
|`#define ENABLE_LED_MATRIX_BAND_SPIRAL` |Enables `LED_MATRIX_BAND_SPIRAL` |
|`#define ENABLE_LED_MATRIX_CYCLE_LEFT_RIGHT` |Enables `LED_MATRIX_CYCLE_LEFT_RIGHT` |
|`#define ENABLE_LED_MATRIX_CYCLE_UP_DOWN` |Enables `LED_MATRIX_CYCLE_UP_DOWN` |
|`#define ENABLE_LED_MATRIX_CYCLE_OUT_IN` |Enables `LED_MATRIX_CYCLE_OUT_IN` |
|`#define ENABLE_LED_MATRIX_DUAL_BEACON` |Enables `LED_MATRIX_DUAL_BEACON` |
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE` |Enables `LED_MATRIX_SOLID_REACTIVE_SIMPLE` |
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_WIDE` |Enables `LED_MATRIX_SOLID_REACTIVE_WIDE` |
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Enables `LED_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_CROSS` |Enables `LED_MATRIX_SOLID_REACTIVE_CROSS` |
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS` |Enables `LED_MATRIX_SOLID_REACTIVE_MULTICROSS`|
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS` |Enables `LED_MATRIX_SOLID_REACTIVE_NEXUS` |
|`#define ENABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Enables `LED_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
|`#define ENABLE_LED_MATRIX_SOLID_SPLASH` |Enables `LED_MATRIX_SOLID_SPLASH` |
|`#define ENABLE_LED_MATRIX_SOLID_MULTISPLASH` |Enables `LED_MATRIX_SOLID_MULTISPLASH` |
|`#define ENABLE_LED_MATRIX_WAVE_LEFT_RIGHT` |Enables `LED_MATRIX_WAVE_LEFT_RIGHT` |
|`#define ENABLE_LED_MATRIX_WAVE_UP_DOWN` |Enables `LED_MATRIX_WAVE_UP_DOWN` |
## Custom LED Matrix Effects :id=custom-led-matrix-effects
@ -219,7 +221,7 @@ static bool my_cool_effect(effect_params_t* params) {
for (uint8_t i = led_min; i < led_max; i++) {
led_matrix_set_value(i, 0xFF);
}
return led_max < DRIVER_LED_TOTAL;
return led_matrix_check_finished_leds(led_max);
}
// e.g: A more complex effect, relying on external methods and state, with
@ -233,8 +235,7 @@ static bool my_cool_effect2_complex_run(effect_params_t* params) {
for (uint8_t i = led_min; i < led_max; i++) {
led_matrix_set_value(i, some_global_state++);
}
return led_max < DRIVER_LED_TOTAL;
return led_matrix_check_finished_leds(led_max);
}
static bool my_cool_effect2(effect_params_t* params) {
if (params->init) my_cool_effect2_complex_init(params);


+ 118
- 18
docs/feature_macros.md View File

@ -4,7 +4,107 @@ Macros allow you to send multiple keystrokes when pressing just one key. QMK has
!> **Security Note**: While it is possible to use macros to send passwords, credit card numbers, and other sensitive information it is a supremely bad idea to do so. Anyone who gets a hold of your keyboard will be able to access that information by opening a text editor.
## `SEND_STRING()` & `process_record_user`
## Using Macros In JSON Keymaps
You can define up to 32 macros in a `keymap.json` file, as used by [Configurator](newbs_building_firmware_configurator.md), and `qmk compile`. You can define these macros in a list under the `macros` keyword, like this:
```json
{
"keyboard": "handwired/my_macropad",
"keymap": "my_keymap",
"macros": [
[
{"action":"down", "keycodes": ["LSFT"]},
"hello world1",
{"action": "up","keycodes": ["LSFT"]}
],
[
{"action":"tap", "keycodes": ["LCTL", "LALT", "DEL"]}
],
[
"ding!",
{"action":"beep"}
],
[
{"action":"tap", "keycodes": ["F1"]},
{"action":"delay", "duration": "1000"},
{"action":"tap", "keycodes": ["PGDN"]}
]
],
"layout": "LAYOUT_all",
"layers": [
["MACRO_0", "MACRO_1", "MACRO_2", "MACRO_3"]
]
}
```
### Selecting Your Host Keyboard Layout
If you type in a language other than English, or use a non-QWERTY layout like Colemak, Dvorak, or Workman, you may have set your computer's input language to match this layout. This presents a challenge when creating macros- you may need to type different keys to get the same letters! To address this you can add the `host_language` key to your keymap.json, like so:
```json
{
"keyboard": "handwired/my_macropad",
"keymap": "my_keymap",
"host_layout": "dvorak",
"macros": [
["Hello, World!"]
],
"layout": "LAYOUT_all",
"layers": [
["MACRO_0"]
]
}
```
The current list of available languages is:
| belgian | bepo | br_abnt2 | canadian_multilingual |
|:-------:|:----:|:--------:|:---------------------:|
| **colemak** | **croatian** | **czech** | **danish** |
| **dvorak_fr** | **dvorak** | **dvp** | **estonian** |
| **finnish** | **fr_ch** | **french_afnor** | **french** |
| **french_osx** | **german_ch** | **german** | **german_osx** |
| **hungarian** | **icelandic** | **italian** | **italian_osx_ansi** |
| **italian_osx_iso** | **jis** | **latvian** | **lithuanian_azerty** |
| **lithuanian_qwerty** | **norman** | **norwegian** | **portuguese** |
| **portuguese_osx_iso** | **romanian** | **serbian_latin** | **slovak** |
| **slovenian** | **spanish_dvorak** | **spanish** | **swedish** |
| **turkish_f** | **turkish_q** | **uk** | **us_international** |
| **workman** | **workman_zxcvm** |
### Macro Basics
Each macro is an array consisting of strings and objects (dictionaries.) Strings are typed to your computer while objects allow you to control how your macro is typed out.
#### Object Format
All objects have one required key: `action`. This tells QMK what the object does. There are currently 5 actions: beep, delay, down, tap, up
Only basic keycodes (prefixed by `KC_`) are supported. Do not include the `KC_` prefix when listing keycodes.
* `beep`
* Play a bell if the keyboard has [audio enabled](feature_audio.md).
* Example: `{"action": "beep"}`
* `delay`
* Pause macro playback. Duration is specified in milliseconds (ms).
* Example: `{"action": "delay", "duration": 500}`
* `down`
* Send a key down event for one or more keycodes.
* Example, single key: `{"action":"down", "keycodes": ["LSFT"]}`
* Example, multiple keys: `{"action":"down", "keycodes": ["CTRL", "LSFT"]}`
* `tap`
* Type a chord, which sends a down event for each key followed by an up event for each key.
* Example, single key: `{"action":"tap", "keycodes": ["F13"]}`
* Example, multiple keys: `{"action":"tap", "keycodes": ["CTRL", "LALT", "DEL"]}`
* `up`
* Send a key up event for one or more keycodes.
* Example, single key: `{"action":"up", "keycodes": ["LSFT"]}`
* Example, multiple keys: `{"action":"up", "keycodes": ["CTRL", "LSFT"]}`
## Using Macros in C Keymaps
### `SEND_STRING()` & `process_record_user`
Sometimes you want a key to type out words or phrases. For the most common situations, we've provided `SEND_STRING()`, which will type out a string (i.e. a sequence of characters) for you. All ASCII characters that are easily translatable to a keycode are supported (e.g. `qmk 123\n\t`).
@ -91,7 +191,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
};
```
### Advanced Macros
#### Advanced Macros
In addition to the `process_record_user()` function, is the `post_process_record_user()` function. This runs after `process_record` and can be used to do things after a keystroke has been sent. This is useful if you want to have a key pressed before and released after a normal key, for instance.
@ -118,7 +218,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KC_A ... KC_F21: //notice how it skips over F22
case KC_F23 ... KC_EXSEL: //exsel is the last one before the modifier keys
case KC_F23 ... KC_EXSL: //exsel is the last one before the modifier keys
if (!record->event.pressed) {
f22_tracker--;
if (!f22_tracker) {
@ -131,7 +231,7 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
```
### TAP, DOWN and UP
#### TAP, DOWN and UP
You may want to use keys in your macros that you can't write down, such as `Ctrl` or `Home`.
You can send arbitrary keycodes by wrapping them in:
@ -178,7 +278,7 @@ They can be used like this:
Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - notice that they take strings (eg `"k"`), and not the `X_K` keycodes.
### Alternative Keymaps
#### Alternative Keymaps
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
@ -186,7 +286,7 @@ By default, it assumes a US keymap with a QWERTY layout; if you want to change t
#include "sendstring_colemak.h"
```
### Strings in Memory
#### Strings in Memory
If for some reason you're manipulating strings and need to print out something you just generated (instead of being a literal, constant string), you can use `send_string()`, like this:
@ -205,13 +305,13 @@ SEND_STRING(".."SS_TAP(X_END));
```
## Advanced Macro Functions
### Advanced Macro Functions
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
?> You can also use the functions described in [Useful function](ref_functions.md) and [Checking modifier state](feature_advanced_keycodes#checking-modifier-state) for additional functionality. For example, `reset_keyboard()` allows you to reset the keyboard as part of a macro and `get_mods() & MOD_MASK_SHIFT` lets you check for the existence of active shift modifiers.
### `record->event.pressed`
#### `record->event.pressed`
This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is
@ -223,15 +323,15 @@ This is a boolean value that can be tested to see if the switch is being pressed
}
```
### `register_code(<kc>);`
#### `register_code(<kc>);`
This sends the `<kc>` keydown event to the computer. Some examples would be `KC_ESC`, `KC_C`, `KC_4`, and even modifiers such as `KC_LSFT` and `KC_LGUI`.
### `unregister_code(<kc>);`
#### `unregister_code(<kc>);`
Parallel to `register_code` function, this sends the `<kc>` keyup event to the computer. If you don't use this, the key will be held down until it's sent.
### `tap_code(<kc>);`
#### `tap_code(<kc>);`
Sends `register_code(<kc>)` and then `unregister_code(<kc>)`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it).
@ -239,31 +339,31 @@ If `TAP_CODE_DELAY` is defined (default 0), this function waits that many millis
If the keycode is `KC_CAPS`, it waits `TAP_HOLD_CAPS_DELAY` milliseconds instead (default 80), as macOS prevents accidental Caps Lock activation by waiting for the key to be held for a certain amount of time.
### `tap_code_delay(<kc>, <delay>);`
#### `tap_code_delay(<kc>, <delay>);`
Like `tap_code(<kc>)`, but with a `delay` parameter for specifying arbitrary intervals before sending the unregister event.
### `register_code16(<kc>);`, `unregister_code16(<kc>);` and `tap_code16(<kc>);`
#### `register_code16(<kc>);`, `unregister_code16(<kc>);` and `tap_code16(<kc>);`
These functions work similar to their regular counterparts, but allow you to use modded keycodes (with Shift, Alt, Control, and/or GUI applied to them).
Eg, you could use `register_code16(S(KC_5));` instead of registering the mod, then registering the keycode.
### `clear_keyboard();`
#### `clear_keyboard();`
This will clear all mods and keys currently pressed.
### `clear_mods();`
#### `clear_mods();`
This will clear all mods currently pressed.
### `clear_keyboard_but_mods();`
#### `clear_keyboard_but_mods();`
This will clear all keys besides the mods currently pressed.
## Advanced Example:
### Advanced Example:
### Super ALT↯TAB
#### Super ALT↯TAB
This macro will register `KC_LALT` and tap `KC_TAB`, then wait for 1000ms. If the key is tapped again, it will send another `KC_TAB`; if there is no tap, `KC_LALT` will be unregistered, thus allowing you to cycle through windows.


+ 1
- 1
docs/feature_midi.md View File

@ -4,7 +4,7 @@
First, enable MIDI by adding the following to your `rules.mk`:
```makefile
```make
MIDI_ENABLE = yes
```


+ 8
- 3
docs/feature_oled_driver.md View File

@ -38,7 +38,7 @@ Then in your `keymap.c` file, implement the OLED task call. This example assumes
```c
#ifdef OLED_ENABLE
void oled_task_user(void) {
bool oled_task_user(void) {
// Host Keyboard Layer Status
oled_write_P(PSTR("Layer: "), false);
@ -62,6 +62,8 @@ void oled_task_user(void) {
oled_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
oled_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
oled_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
return false;
}
#endif
```
@ -133,13 +135,14 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
return rotation;
}
void oled_task_user(void) {
bool oled_task_user(void) {
if (is_keyboard_master()) {
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
} else {
render_logo(); // Renders a static logo
oled_scroll_left(); // Turns on scrolling
}
return false;
}
#endif
```
@ -242,6 +245,7 @@ bool oled_init(oled_rotation_t rotation);
// Called at the start of oled_init, weak function overridable by the user
// rotation - the value passed into oled_init
// Return new oled_rotation_t if you want to override default rotation
oled_rotation_t oled_init_kb(oled_rotation_t rotation);
oled_rotation_t oled_init_user(oled_rotation_t rotation);
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
@ -333,7 +337,8 @@ uint8_t oled_get_brightness(void);
void oled_task(void);
// Called at the start of oled_task, weak function overridable by the user
void oled_task_user(void);
bool oled_task_kb(void);
bool oled_task_user(void);
// Set the specific 8 lines rows of the screen to scroll.
// 0 is the default for start, and 7 for end, which is the entire


+ 197
- 7
docs/feature_pointing_device.md View File

@ -1,19 +1,205 @@
# Pointing Device :id=pointing-device
Pointing Device is a generic name for a feature intended to be generic: moving the system pointer around. There are certainly other options for it - like mousekeys - but this aims to be easily modifiable and lightweight. You can implement custom keys to control functionality, or you can gather information from other peripherals and insert it directly here - let QMK handle the processing for you.
Pointing Device is a generic name for a feature intended to be generic: moving the system pointer around. There are certainly other options for it - like mousekeys - but this aims to be easily modifiable and hardware driven. You can implement custom keys to control functionality, or you can gather information from other peripherals and insert it directly here - let QMK handle the processing for you.
To enable Pointing Device, uncomment the following line in your rules.mk:
```makefile
```make
POINTING_DEVICE_ENABLE = yes
```
To manipulate the mouse report, you can use the following functions:
## Sensor Drivers
* `pointing_device_get_report()` - Returns the current report_mouse_t that represents the information sent to the host computer
* `pointing_device_set_report(report_mouse_t newMouseReport)` - Overrides and saves the report_mouse_t to be sent to the host computer
There are a number of sensors that are supported by default. Note that only one sensor can be enabled by `POINTING_DEVICE_DRIVER` at a time. If you need to enable more than one sensor, then you need to implement it manually.
### ADNS 5050 Sensor
To use the ADNS 5050 sensor, add this to your `rules.mk`
```make
POINTING_DEVICE_DRIVER = adns5050
```
The ADNS 5050 sensor uses a serial type protocol for communication, and requires an additional light source.
| Setting | Description |
|--------------------|---------------------------------------------------------------------|
|`ADNS5050_SCLK_PIN` | (Required) The pin connected to the clock pin of the sensor. |
|`ADNS5050_SDIO_PIN` | (Required) The pin connected to the data pin of the sensor. |
|`ADNS5050_CS_PIN` | (Required) The pin connected to the cable select pin of the sensor. |
The CPI range is 125-1375, in increments of 125. Defaults to 500 CPI.
### ADSN 9800 Sensor
To use the ADNS 9800 sensor, add this to your `rules.mk`
```make
POINTING_DEVICE_DRIVER = adns9800
```
The ADNS 9800 is an SPI driven optical sensor, that uses laser output for surface tracking.
| Setting | Description | Default |
|------------------------|------------------------------------------------------------------------|---------------|
|`ADNS9800_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` |
|`ADNS9800_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` |
|`ADNS9800_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` |
|`ADNS9800_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ |
|`ADNS9800_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ |
The CPI range is 800-8200, in increments of 200. Defaults to 1800 CPI.
### Analog Joystick
To use an analog joystick to control the pointer, add this to your `rules.mk`
```make
POINTING_DEVICE_DRIVER = analog_joystick
```
The Analog Joystick is an analog (ADC) driven sensor. There are a variety of joysticks that you can use for this.
| Setting | Description | Default |
|----------------------------------|----------------------------------------------------------------------------|---------------|
|`ANALOG_JOYSTICK_X_AXIS_PIN` | (Required) The pin used for the vertical/X axis. | _not defined_ |
|`ANALOG_JOYSTICK_Y_AXIS_PIN` | (Required) The pin used for the horizontal/Y axis. | _not defined_ |
|`ANALOG_JOYSTICK_AXIS_MIN` | (Optional) Sets the lower range to be considered movement. | `0` |
|`ANALOG_JOYSTICK_AXIS_MAX` | (Optional) Sets the upper range to be considered movement. | `1023` |
|`ANALOG_JOYSTICK_SPEED_REGULATOR` | (Optional) The divisor used to slow down movement. (lower makes it faster) | `20` |
|`ANALOG_JOYSTICK_READ_INTERVAL` | (Optional) The interval in milliseconds between reads. | `10` |
|`ANALOG_JOYSTICK_SPEED_MAX` | (Optional) The maxiumum value used for motion. | `2` |
|`ANALOG_JOYSTICK_CLICK_PIN` | (Optional) The pin wired up to the press switch of the analog stick. | _not defined_ |
### Cirque Trackpad
To use the Cirque Trackpad sensor, add this to your `rules.mk`:
```make
POINTING_DEVICE_DRIVER = cirque_pinnacle_i2c
```
or
```make
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.
| Setting | Description | Default |
|---------------------------------|---------------------------------------------------------------------------------|-----------------------|
|`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_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_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` |
Keep in mind that a report_mouse_t (here "mouseReport") has the following properties:
| I2C Setting | Description | Default |
|--------------------------|---------------------------------------------------------------------------------|---------|
|`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` |
| SPI Setting | Description | Default |
|-------------------------------|------------------------------------------------------------------------|---------------|
|`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_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_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ |
Default Scaling/CPI is 1024.
### Pimoroni Trackball
To use the Pimoroni Trackball module, add this to your `rules.mk`:
```make
POINTING_DEVICE_DRIVER = pimoroni_trackball
```
The Pimoroni Trackball module is a I2C based breakout board with an RGB enable trackball.
| Setting | Description | Default |
|-------------------------------------|------------------------------------------------------------------------------------|---------|
|`PIMORONI_TRACKBALL_ADDRESS` | (Required) Sets the I2C Address for the Pimoroni Trackball. | `0x0A` |
|`PIMORONI_TRACKBALL_TIMEOUT` | (Optional) The timeout for i2c communication with the trackpad in milliseconds. | `100` |
|`PIMORONI_TRACKBALL_INTERVAL_MS` | (Optional) The update/read interval for the sensor in milliseconds. | `8` |
|`PIMORONI_TRACKBALL_SCALE` | (Optional) The multiplier used to generate reports from the sensor. | `5` |
|`PIMORONI_TRACKBALL_DEBOUNCE_CYCLES` | (Optional) The number of scan cycles used for debouncing on the ball press. | `20` |
|`PIMORONI_TRACKBALL_ERROR_COUNT` | (Optional) Specifies the number of read/write errors until the sensor is disabled. | `10` |
### PMW 3360 Sensor
To use the PMW 3360 sensor, add this to your `rules.mk`
```make
POINTING_DEVICE_DRIVER = pmw3360
```
The PMW 3360 is an SPI driven optical sensor, that uses a built in IR LED for surface tracking.
| Setting | Description | Default |
|-----------------------------|--------------------------------------------------------------------------------------------|---------------|
|`PMW3360_CS_PIN` | (Required) Sets the Cable Select pin connected to the sensor. | _not defined_ |
|`PMW3360_CLOCK_SPEED` | (Optional) Sets the clock speed that the sensor runs at. | `2000000` |
|`PMW3360_SPI_LSBFIRST` | (Optional) Sets the Least/Most Significant Byte First setting for SPI. | `false` |
|`PMW3360_SPI_MODE` | (Optional) Sets the SPI Mode for the sensor. | `3` |
|`PMW3360_SPI_DIVISOR` | (Optional) Sets the SPI Divisor used for SPI communication. | _varies_ |
|`ROTATIONAL_TRANSFORM_ANGLE` | (Optional) Allows for the sensor data to be rotated +/- 30 degrees directly in the sensor. | `0` |
The CPI range is 100-12000, in increments of 100. Defaults to 1600 CPI.
### Custom Driver
If you have a sensor type that isn't supported here, you can manually implement it, by adding these functions (with the correct implementation for your device):
```c
void pointing_device_driver_init(void) {}
report_mouse_t pointing_device_driver_get_report(report_mouse_t mouse_report) { return mouse_report; }
uint16_t pointing_device_driver_get_cpi(void) { return 0; }
void pointing_device_driver_set_cpi(uint16_t cpi) {}
```
!> Ideally, new sensor hardware should be added to `drivers/sensors/` and `quantum/pointing_device_drivers.c`, but there may be cases where it's very specific to the hardware. So these functions are provided, just in case.
## Common Configuration
| Setting | Description | Default |
|-------------------------------|-----------------------------------------------------------------------|---------------|
|`POINTING_DEVICE_ROTATION_90` | (Optional) Rotates the X and Y data by 90 degrees. | _not defined_ |
|`POINTING_DEVICE_ROTATION_180` | (Optional) Rotates the X and Y data by 180 degrees. | _not defined_ |
|`POINTING_DEVICE_ROTATION_270` | (Optional) Rotates the X and Y data by 270 degrees. | _not defined_ |
|`POINTING_DEVICE_INVERT_X` | (Optional) Inverts the X axis report. | _not defined_ |
|`POINTING_DEVICE_INVERT_Y` | (Optional) Inverts the Y axis report. | _not defined_ |
|`POINTING_DEVICE_MOTION_PIN` | (Optional) If supported, will only read from sensor if pin is active. | _not defined_ |
## Callbacks and Functions
| Function | Description |
|-----------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `pointing_device_init_kb(void)` | Callback to allow for keyboard level initialization. Useful for additional hardware sensors. |
| `pointing_device_init_user(void)` | Callback to allow for user level initialization. Useful for additional hardware sensors. |
| `pointing_device_task_kb(mouse_report)` | Callback that sends sensor data, so keyboard code can intercept and modify the data. Returns a mouse report. |
| `pointing_device_task_user(mouse_report)` | Callback that sends sensor data, so user coe can intercept and modify the data. Returns a mouse report. |
| `pointing_device_handle_buttons(buttons, pressed, button)` | Callback to handle hardware button presses. Returns a `uint8_t`. |
| `pointing_device_get_cpi(void)` | Gets the current CPI/DPI setting from the sensor, if supported. |
| `pointing_device_set_cpi(uint16_t)` | Sets the CPI/DPI, if supported. |
| `pointing_device_get_report(void)` | Returns the current mouse report (as a `mouse_report_t` data structure). |
| `pointing_device_set_report(mouse_report)` | Sets the mouse report to the assigned `mouse_report_t` data structured passed to the function. |
| `pointing_device_send(void)` | Sends the current mouse report to the host system. Function can be replaced. |
| `has_mouse_report_changed(old, new)` | Compares the old and new `mouse_report_t` data and returns true only if it has changed. |
# Manipulating Mouse Reports
The report_mouse_t (here "mouseReport") has the following properties:
* `mouseReport.x` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing movement (+ to the right, - to the left) on the x axis.
* `mouseReport.y` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing movement (+ upward, - downward) on the y axis.
@ -21,8 +207,10 @@ Keep in mind that a report_mouse_t (here "mouseReport") has the following proper
* `mouseReport.h` - this is a signed int from -127 to 127 (not 128, this is defined in USB HID spec) representing horizontal scrolling (+ right, - left).
* `mouseReport.buttons` - this is a uint8_t in which all 8 bits are used. These bits represent the mouse button state - bit 0 is mouse button 1, and bit 7 is mouse button 8.
Once you have made the necessary changes to the mouse report, you need to send it:
To manually manipulate the mouse reports outside of the `pointing_device_task_*` functions, you can use:
* `pointing_device_get_report()` - Returns the current report_mouse_t that represents the information sent to the host computer
* `pointing_device_set_report(report_mouse_t newMouseReport)` - Overrides and saves the report_mouse_t to be sent to the host computer
* `pointing_device_send()` - Sends the mouse report to the host and zeroes out the report.
When the mouse report is sent, the x, y, v, and h values are set to 0 (this is done in `pointing_device_send()`, which can be overridden to avoid this behavior). This way, button states persist, but movement will only occur once. For further customization, both `pointing_device_init` and `pointing_device_task` can be overridden.
@ -31,6 +219,8 @@ Additionally, by default, `pointing_device_send()` will only send a report when
Also, you use the `has_mouse_report_changed(new, old)` function to check to see if the report has changed.
## Example
In the following example, a custom key is used to click the mouse and scroll 127 units vertically and horizontally, then undo all of that when released - because that's a totally useful function. Listen, this is an example:
```c


+ 74
- 0
docs/feature_programmable_button.md View File

@ -0,0 +1,74 @@
## Programmable Button
Programmable button is a feature that can be used to send keys that have no
predefined meaning.
This means they can be processed on the host side by custom software without
colliding without the operating system trying to interpret these keys.
The keycodes are emitted according to the HID usage
"Telephony Device Page" (0x0B), "Programmable button usage" (0x07).
On Linux (> 5.14) they are handled automatically and translated to `KEY_MACRO#`
keycodes.
(Up to `KEY_MACRO30`)
### Enabling Programmable Button support
To enable Programmable Button, add the following line to your keymap’s `rules.mk`:
```c
PROGRAMMABLE_BUTTON_ENABLE = yes
```
### Mapping
In your keymap you can use the following keycodes to map key presses to Programmable Buttons:
|Key |Description |
|------------------------|----------------------|
|`PROGRAMMABLE_BUTTON_1` |Programmable button 1 |
|`PROGRAMMABLE_BUTTON_2` |Programmable button 2 |
|`PROGRAMMABLE_BUTTON_3` |Programmable button 3 |
|`PROGRAMMABLE_BUTTON_4` |Programmable button 4 |
|`PROGRAMMABLE_BUTTON_5` |Programmable button 5 |
|`PROGRAMMABLE_BUTTON_6` |Programmable button 6 |
|`PROGRAMMABLE_BUTTON_7` |Programmable button 7 |
|`PROGRAMMABLE_BUTTON_8` |Programmable button 8 |
|`PROGRAMMABLE_BUTTON_9` |Programmable button 9 |
|`PROGRAMMABLE_BUTTON_10`|Programmable button 10|
|`PROGRAMMABLE_BUTTON_11`|Programmable button 11|
|`PROGRAMMABLE_BUTTON_12`|Programmable button 12|
|`PROGRAMMABLE_BUTTON_13`|Programmable button 13|
|`PROGRAMMABLE_BUTTON_14`|Programmable button 14|
|`PROGRAMMABLE_BUTTON_15`|Programmable button 15|
|`PROGRAMMABLE_BUTTON_16`|Programmable button 16|
|`PROGRAMMABLE_BUTTON_17`|Programmable button 17|
|`PROGRAMMABLE_BUTTON_18`|Programmable button 18|
|`PROGRAMMABLE_BUTTON_19`|Programmable button 19|
|`PROGRAMMABLE_BUTTON_20`|Programmable button 20|
|`PROGRAMMABLE_BUTTON_21`|Programmable button 21|
|`PROGRAMMABLE_BUTTON_22`|Programmable button 22|
|`PROGRAMMABLE_BUTTON_23`|Programmable button 23|
|`PROGRAMMABLE_BUTTON_24`|Programmable button 24|
|`PROGRAMMABLE_BUTTON_25`|Programmable button 25|
|`PROGRAMMABLE_BUTTON_26`|Programmable button 26|
|`PROGRAMMABLE_BUTTON_27`|Programmable button 27|
|`PROGRAMMABLE_BUTTON_28`|Programmable button 28|
|`PROGRAMMABLE_BUTTON_29`|Programmable button 29|
|`PROGRAMMABLE_BUTTON_30`|Programmable button 30|
|`PROGRAMMABLE_BUTTON_31`|Programmable button 31|
|`PROGRAMMABLE_BUTTON_32`|Programmable button 32|
|`PB_1` to `PB_32` |Aliases for keymaps |
### API
You can also use a dedicated API defined in `programmable_button.h` to interact with this feature:
```
void programmable_button_clear(void);
void programmable_button_send(void);
void programmable_button_on(uint8_t code);
void programmable_button_off(uint8_t code);
bool programmable_button_is_on(uint8_t code);
uint32_t programmable_button_get_report(void);
void programmable_button_set_report(uint32_t report);
```

+ 11
- 29
docs/feature_ps2_mouse.md View File

@ -30,7 +30,7 @@ Note: This is not recommended, you may encounter jerky movement or unsent inputs
In rules.mk:
```makefile
```make
PS2_MOUSE_ENABLE = yes
PS2_USE_BUSYWAIT = yes
```
@ -39,14 +39,8 @@ In your keyboard config.h:
```c
#ifdef PS2_USE_BUSYWAIT
# define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1
# define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD
# define PS2_DATA_BIT 2
# define PS2_CLOCK_PIN D1
# define PS2_DATA_PIN D2
#endif
```
@ -56,7 +50,7 @@ The following example uses D2 for clock and D5 for data. You can use any INT or
In rules.mk:
```makefile
```make
PS2_MOUSE_ENABLE = yes
PS2_USE_INT = yes
```
@ -65,14 +59,8 @@ In your keyboard config.h:
```c
#ifdef PS2_USE_INT
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 2
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 5
#define PS2_CLOCK_PIN D2
#define PS2_DATA_PIN D5
#define PS2_INT_INIT() do { \
EICRA |= ((1<<ISC21) | \
@ -102,8 +90,8 @@ PS2_USE_INT = yes
In your keyboard config.h:
```c
#define PS2_CLOCK A8
#define PS2_DATA A9
#define PS2_CLOCK_PIN A8
#define PS2_DATA_PIN A9
```
And in the chibios specifig halconf.h:
@ -118,7 +106,7 @@ To use USART on the ATMega32u4, you have to use PD5 for clock and PD2 for data.
In rules.mk:
```makefile
```make
PS2_MOUSE_ENABLE = yes
PS2_USE_USART = yes
```
@ -127,14 +115,8 @@ In your keyboard config.h:
```c
#ifdef PS2_USE_USART
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 5
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 2
#define PS2_CLOCK_PIN D5
#define PS2_DATA_PIN D2
/* synchronous, odd parity, 1-bit stop, 8-bit data, sample at falling edge */
/* set DDR of CLOCK as input to be slave */


+ 2
- 2
docs/feature_rawhid.md View File

@ -15,7 +15,7 @@ RAW_ENABLE = yes
In your `keymap.c` include `"raw_hid.h"` and implement the following:
```C
```c
void raw_hid_receive(uint8_t *data, uint8_t length) {
// Your code goes here. data is the packet received from host.
}
@ -23,7 +23,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
The `"raw_hid.h"` header also declares `void raw_hid_send(uint8_t *data, uint8_t length);` which allows sending packets from keyboard to host. As an example, it can also be used for debugging when building your host application by returning all data back to the host.
```C
```c
void raw_hid_receive(uint8_t *data, uint8_t length) {
raw_hid_send(data, length);
}


+ 115
- 67
docs/feature_rgb_matrix.md View File

@ -10,7 +10,7 @@ If you want to use single color LED's you should use the [LED Matrix Subsystem](
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
```makefile
```make
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3731
```
@ -21,6 +21,7 @@ You can use between 1 and 4 IS31FL3731 IC's. Do not specify `DRIVER_ADDR_<N>` de
|----------|-------------|---------|
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
| `ISSI_3731_DEGHOST` | (Optional) Set this define to enable de-ghosting by halving Vcc during blanking time | |
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
| `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | |
@ -49,10 +50,12 @@ Here is an example using 2 drivers.
!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
For split keyboards using `RGB_MATRIX_SPLIT` with an LED driver, you can either have the same driver address or different driver addresses. If using different addresses, use `DRIVER_ADDR_1` for one and `DRIVER_ADDR_2` for the other one. Then, in `g_is31_leds`, fill out the correct driver index (0 or 1). If using one address, use `DRIVER_ADDR_1` for both, and use index 0 for `g_is31_leds`.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = {
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -71,7 +74,7 @@ Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet]
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
```makefile
```make
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3733
```
@ -82,6 +85,9 @@ 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_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
| `ISSI_PWM_FREQUENCY` | (Optional) PWM Frequency Setting - IS31FL3733B only | 0 |
| `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) |
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
| `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | |
@ -93,6 +99,18 @@ You can use between 1 and 4 IS31FL3733 IC's. Do not specify `DRIVER_ADDR_<N>` de
| `DRIVER_SYNC_3` | (Optional) Sync configuration for the third RGB driver | 0 |
| `DRIVER_SYNC_4` | (Optional) Sync configuration for the fourth RGB driver | 0 |
The IS31FL3733 IC's have on-chip resistors that can be enabled to allow for de-ghosting of the RGB matrix. By default these resistors are not enabled (`ISSI_SWPULLUP`/`ISSI_CSPULLUP` are given the value of`PUR_0R`), the values that can be set to enable de-ghosting are as follows:
| `ISSI_SWPULLUP/ISSI_CSPULLUP` | Description |
|----------------------|-------------|
| `PUR_0R` | (default) Do not use the on-chip resistors/enable de-ghosting |
| `PUR_05KR` | The 0.5k Ohm resistor used during blanking period (t_NOL) |
| `PUR_3KR` | The 3k Ohm resistor used at all times |
| `PUR_4KR` | The 4k Ohm resistor used at all times |
| `PUR_8KR` | The 8k Ohm resistor used at all times |
| `PUR_16KR` | The 16k Ohm resistor used at all times |
| `PUR_32KR` | The 32k Ohm resistor used during blanking period (t_NOL) |
Here is an example using 2 drivers.
```c
@ -122,7 +140,7 @@ Currently only 4 drivers are supported, but it would be trivial to support all 8
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = {
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -141,7 +159,7 @@ Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3737 RGB controller. To enable it, add this to your `rules.mk`:
```makefile
```make
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = IS31FL3737
```
@ -153,11 +171,25 @@ Configure the hardware via your `config.h`:
|----------|-------------|---------|
| `ISSI_TIMEOUT` | (Optional) How long to wait for i2c messages, in milliseconds | 100 |
| `ISSI_PERSISTENCE` | (Optional) Retry failed messages this many times | 0 |
| `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) |
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
| `DRIVER_ADDR_1` | (Required) Address for the first RGB driver | |
| `DRIVER_ADDR_2` | (Optional) Address for the second RGB driver | |
The IS31FL3737 IC's have on-chip resistors that can be enabled to allow for de-ghosting of the RGB matrix. By default these resistors are not enabled (`ISSI_SWPULLUP`/`ISSI_CSPULLUP` are given the value of`PUR_0R`), the values that can be set to enable de-ghosting are as follows:
| `ISSI_SWPULLUP/ISSI_CSPULLUP` | Description |
|----------------------|-------------|
| `PUR_0R` | (default) Do not use the on-chip resistors/enable de-ghosting |
| `PUR_05KR` | The 0.5k Ohm resistor used during blanking period (t_NOL) |
| `PUR_1KR` | The 1k Ohm resistor used during blanking period (t_NOL) |
| `PUR_2KR` | The 2k Ohm resistor used during blanking period (t_NOL) |
| `PUR_4KR` | The 4k Ohm resistor used during blanking period (t_NOL) |
| `PUR_8KR` | The 8k Ohm resistor during blanking period (t_NOL) |
| `PUR_16KR` | The 16k Ohm resistor during blanking period (t_NOL) |
| `PUR_32KR` | The 32k Ohm resistor used during blanking period (t_NOL) |
Here is an example using 2 drivers.
@ -181,12 +213,12 @@ Here is an example using 2 drivers.
```
!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
Currently only 2 drivers are supported, but it would be trivial to support all 4 combinations.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = {
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
/* Refer to IS31 manual for these locations
* driver
* | R location
@ -206,7 +238,7 @@ Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](
There is basic support for addressable RGB matrix lighting with a WS2811/WS2812{a,b,c} addressable LED strand. To enable it, add this to your `rules.mk`:
```makefile
```make
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = WS2812
```
@ -226,7 +258,7 @@ Configure the hardware via your `config.h`:
There is basic support for APA102 based addressable LED strands. To enable it, add this to your `rules.mk`:
```makefile
```make
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = APA102
```
@ -246,7 +278,7 @@ Configure the hardware via your `config.h`:
### AW20216 :id=aw20216
There is basic support for addressable RGB matrix lighting with the SPI AW20216 RGB controller. To enable it, add this to your `rules.mk`:
```makefile
```make
RGB_MATRIX_ENABLE = yes
RGB_MATRIX_DRIVER = AW20216
```
@ -287,7 +319,7 @@ Here is an example using 2 drivers.
Define these arrays listing all the LEDs in your `<keyboard>.c`:
```c
const aw_led __flash g_aw_leds[DRIVER_LED_TOTAL] = {
const aw_led PROGMEM g_aw_leds[DRIVER_LED_TOTAL] = {
/* Each AW20216 channel is controlled by a register at some offset between 0x00
* and 0xD7 inclusive.
* See drivers/awinic/aw20216.h for the mapping between register offsets and
@ -340,7 +372,7 @@ x = 224 / (NUMBER_OF_COLS - 1) * COL_POSITION
y = 64 / (NUMBER_OF_ROWS - 1) * ROW_POSITION
```
Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout.
Where NUMBER_OF_COLS, NUMBER_OF_ROWS, COL_POSITION, & ROW_POSITION are all based on the physical layout of your keyboard, not the electrical layout.
As mentioned earlier, the center of the keyboard by default is expected to be `{ 112, 32 }`, but this can be changed if you want to more accurately calculate the LED's physical `{ x, y }` positions. Keyboard designers can implement `#define RGB_MATRIX_CENTER { 112, 32 }` in their config.h file with the new center point of the keyboard, or where they want it to be allowing more possibilities for the `{ x, y }` values. Do note that the maximum value for x or y is 255, and the recommended maximum is 224 as this gives animations runoff room before they reset.
@ -383,7 +415,7 @@ All RGB keycodes are currently shared with the RGBLIGHT system:
* `RGB_MODE_*` keycodes will generally work, but not all of the modes are currently mapped to the correct effects for the RGB Matrix system.
`RGB_MODE_PLAIN`, `RGB_MODE_BREATHE`, `RGB_MODE_RAINBOW`, and `RGB_MATRIX_SWIRL` are the only ones that are mapped properly. The rest don't have a direct equivalent, and are not mapped.
`RGB_MODE_PLAIN`, `RGB_MODE_BREATHE`, `RGB_MODE_RAINBOW`, and `RGB_MATRIX_SWIRL` are the only ones that are mapped properly. The rest don't have a direct equivalent, and are not mapped.
!> By default, if you have both the [RGB Light](feature_rgblight.md) and the RGB Matrix feature enabled, these keycodes will work for both features, at the same time. You can disable the keycode functionality by defining the `*_DISABLE_KEYCODES` option for the specific feature.
@ -420,7 +452,9 @@ enum rgb_matrix_effects {
RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation
RGB_MATRIX_HUE_BREATHING, // Hue shifts up a slight ammount at the same time, then shifts back
RGB_MATRIX_HUE_PENDULUM, // Hue shifts up a slight ammount in a wave to the right, then back to the left
RGB_MATRIX_HUE_WAVE, // Hue shifts up a slight ammount and then back down in a wave to the right
RGB_MATRIX_HUE_WAVE, // Hue shifts up a slight ammount and then back down in a wave to the right
RGB_MATRIX_PIXEL_FRACTAL, // Single hue fractal filled keys pulsing horizontally out to edges
RGB_MATRIX_PIXEL_RAIN, // Randomly light keys with random hues
#if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS)
RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM!
RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation
@ -443,51 +477,66 @@ enum rgb_matrix_effects {
};
```
You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`:
|Define |Description |
|-------------------------------------------------------|-----------------------------------------------|
|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` |
|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` |
|`#define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT` |Disables `MATRIX_GRADIENT_LEFT_RIGHT` |
|`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` |
|`#define DISABLE_RGB_MATRIX_BAND_SAT` |Disables `RGB_MATRIX_BAND_SAT` |
|`#define DISABLE_RGB_MATRIX_BAND_VAL` |Disables `RGB_MATRIX_BAND_VAL` |
|`#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT` |Disables `RGB_MATRIX_BAND_PINWHEEL_SAT` |
|`#define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL` |Disables `RGB_MATRIX_BAND_PINWHEEL_VAL` |
|`#define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT` |Disables `RGB_MATRIX_BAND_SPIRAL_SAT` |
|`#define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL` |Disables `RGB_MATRIX_BAND_SPIRAL_VAL` |
|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` |
|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` |
|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` |
|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |
|`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN` |Disables `RGB_MATRIX_CYCLE_OUT_IN` |
|`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL` |Disables `RGB_MATRIX_CYCLE_OUT_IN_DUAL` |
|`#define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL` |Disables `RGB_MATRIX_CYCLE_PINWHEEL` |
|`#define DISABLE_RGB_MATRIX_CYCLE_SPIRAL` |Disables `RGB_MATRIX_CYCLE_SPIRAL` |
|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` |
|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` |
|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` |
|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` |
|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` |
|`#define DISABLE_RGB_MATRIX_HUE_BREATHING` |Disables `RGB_MATRIX_HUE_BREATHING` |
|`#define DISABLE_RGB_MATRIX_HUE_PENDULUM` |Disables `RGB_MATRIX_HUE_PENDULUM` |
|`#define DISABLE_RGB_MATRIX_HUE_WAVE ` |Disables `RGB_MATRIX_HUE_WAVE ` |
|`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` |
|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_WIDE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_CROSS` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`|
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` |
|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Disables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` |
|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` |
|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` |
|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` |
You can enable a single effect by defining `ENABLE_[EFFECT_NAME]` in your `config.h`:
|Define |Description |
|------------------------------------------------------|----------------------------------------------|
|`#define ENABLE_RGB_MATRIX_ALPHAS_MODS` |Enables `RGB_MATRIX_ALPHAS_MODS` |
|`#define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Enables `RGB_MATRIX_GRADIENT_UP_DOWN` |
|`#define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT` |Enables `RGB_MATRIX_GRADIENT_LEFT_RIGHT` |
|`#define ENABLE_RGB_MATRIX_BREATHING` |Enables `RGB_MATRIX_BREATHING` |
|`#define ENABLE_RGB_MATRIX_BAND_SAT` |Enables `RGB_MATRIX_BAND_SAT` |
|`#define ENABLE_RGB_MATRIX_BAND_VAL` |Enables `RGB_MATRIX_BAND_VAL` |
|`#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT` |Enables `RGB_MATRIX_BAND_PINWHEEL_SAT` |
|`#define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL` |Enables `RGB_MATRIX_BAND_PINWHEEL_VAL` |
|`#define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT` |Enables `RGB_MATRIX_BAND_SPIRAL_SAT` |
|`#define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL` |Enables `RGB_MATRIX_BAND_SPIRAL_VAL` |
|`#define ENABLE_RGB_MATRIX_CYCLE_ALL` |Enables `RGB_MATRIX_CYCLE_ALL` |
|`#define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Enables `RGB_MATRIX_CYCLE_LEFT_RIGHT` |
|`#define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Enables `RGB_MATRIX_CYCLE_UP_DOWN` |
|`#define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Enables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |
|`#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN` |Enables `RGB_MATRIX_CYCLE_OUT_IN` |
|`#define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL` |Enables `RGB_MATRIX_CYCLE_OUT_IN_DUAL` |
|`#define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL` |Enables `RGB_MATRIX_CYCLE_PINWHEEL` |
|`#define ENABLE_RGB_MATRIX_CYCLE_SPIRAL` |Enables `RGB_MATRIX_CYCLE_SPIRAL` |
|`#define ENABLE_RGB_MATRIX_DUAL_BEACON` |Enables `RGB_MATRIX_DUAL_BEACON` |
|`#define ENABLE_RGB_MATRIX_RAINBOW_BEACON` |Enables `RGB_MATRIX_RAINBOW_BEACON` |
|`#define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Enables `RGB_MATRIX_RAINBOW_PINWHEELS` |
|`#define ENABLE_RGB_MATRIX_RAINDROPS` |Enables `RGB_MATRIX_RAINDROPS` |
|`#define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Enables `RGB_MATRIX_JELLYBEAN_RAINDROPS` |
|`#define ENABLE_RGB_MATRIX_HUE_BREATHING` |Enables `RGB_MATRIX_HUE_BREATHING` |
|`#define ENABLE_RGB_MATRIX_HUE_PENDULUM` |Enables `RGB_MATRIX_HUE_PENDULUM` |
|`#define ENABLE_RGB_MATRIX_HUE_WAVE` |Enables `RGB_MATRIX_HUE_WAVE ` |
|`#define ENABLE_RGB_MATRIX_PIXEL_FRACTAL` |Enables `RGB_MATRIX_PIXEL_FRACTAL` |
|`#define ENABLE_RGB_MATRIX_PIXEL_RAIN` |Enables `RGB_MATRIX_PIXEL_RAIN` |
?> These modes don't require any additional defines.
|Framebuffer Defines |Description |
|------------------------------------------------------|----------------------------------------------|
|`#define ENABLE_RGB_MATRIX_TYPING_HEATMAP` |Enables `RGB_MATRIX_TYPING_HEATMAP` |
|`#define ENABLE_RGB_MATRIX_DIGITAL_RAIN` |Enables `RGB_MATRIX_DIGITAL_RAIN` |
?> These modes also require the `RGB_MATRIX_FRAMEBUFFER_EFFECTS` define to be available.
|Reactive Defines |Description |
|------------------------------------------------------|----------------------------------------------|
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Enables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE` |Enables `RGB_MATRIX_SOLID_REACTIVE` |
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE` |Enables `RGB_MATRIX_SOLID_REACTIVE_WIDE` |
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |Enables `RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE` |
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS` |Enables `RGB_MATRIX_SOLID_REACTIVE_CROSS` |
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS` |Enables `RGB_MATRIX_SOLID_REACTIVE_MULTICROSS`|
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS` |Enables `RGB_MATRIX_SOLID_REACTIVE_NEXUS` |
|`#define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS` |Enables `RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS`|
|`#define ENABLE_RGB_MATRIX_SPLASH` |Enables `RGB_MATRIX_SPLASH` |
|`#define ENABLE_RGB_MATRIX_MULTISPLASH` |Enables `RGB_MATRIX_MULTISPLASH` |
|`#define ENABLE_RGB_MATRIX_SOLID_SPLASH` |Enables `RGB_MATRIX_SOLID_SPLASH` |
|`#define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Enables `RGB_MATRIX_SOLID_MULTISPLASH` |
?> These modes also require the `RGB_MATRIX_KEYPRESSES` or `RGB_MATRIX_KEYRELEASES` define to be available.
### RGB Matrix Effect Typing Heatmap :id=rgb-matrix-effect-typing-heatmap
@ -537,7 +586,7 @@ static bool my_cool_effect(effect_params_t* params) {
for (uint8_t i = led_min; i < led_max; i++) {
rgb_matrix_set_color(i, 0xff, 0xff, 0x00);
}
return led_max < DRIVER_LED_TOTAL;
return rgb_matrix_check_finished_leds(led_max);
}
// e.g: A more complex effect, relying on external methods and state, with
@ -551,8 +600,7 @@ static bool my_cool_effect2_complex_run(effect_params_t* params) {
for (uint8_t i = led_min; i < led_max; i++) {
rgb_matrix_set_color(i, 0xff, some_global_state++, 0xff);
}
return led_max < DRIVER_LED_TOTAL;
return rgb_matrix_check_finished_leds(led_max);
}
static bool my_cool_effect2(effect_params_t* params) {
if (params->init) my_cool_effect2_complex_init(params);
@ -694,7 +742,7 @@ Where `28` is an unused index from `eeconfig.h`.
### Indicators :id=indicators
If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `rgb_matrix_indicators_kb` or `rgb_matrix_indicators_user` function for that:
If you want to set custom indicators, such as an LED for Caps Lock, or layer indication, you can use the `rgb_matrix_indicators_kb` or `rgb_matrix_indicators_user` function for that:
```c
void rgb_matrix_indicators_kb(void) {
rgb_matrix_set_color(index, red, green, blue);
@ -749,18 +797,18 @@ This example sets the modifiers to be a specific color based on the layer state.
```c
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
HSV hsv = {0, 255, 255};
if (layer_state_is(layer_state, 2)) {
hsv = {130, 255, 255};
} else {
hsv = {30, 255, 255};
}
if (hsv.v > rgb_matrix_get_val()) {
hsv.v = rgb_matrix_get_val();
}
RGB rgb = hsv_to_rgb(hsv);
for (uint8_t i = led_min; i <= led_max; i++) {
if (HAS_FLAGS(g_led_config.flags[i], 0x01)) { // 0x01 == LED_FLAG_MODIFIER
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
@ -769,7 +817,7 @@ void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
}
```
If you want to indicate a Host LED status (caps lock, num lock, etc), you can use something like this to light up the caps lock key:
If you want to indicate a Host LED status (caps lock, num lock, etc), you can use something like this to light up the caps lock key:
```c
void rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {


+ 1
- 1
docs/feature_stenography.md View File

@ -32,7 +32,7 @@ GeminiPR encodes 42 keys into a 6-byte packet. While TX Bolt contains everything
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.
```makefile
```make
STENO_ENABLE = yes
MOUSEKEY_ENABLE = no
```


+ 1
- 1
docs/feature_swap_hands.md View File

@ -6,7 +6,7 @@ The swap-hands action allows support for one-handed typing without requiring a s
The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck:
```C
```c
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
{{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}},
{{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}},


+ 2
- 2
docs/feature_tap_dance.md View File

@ -299,7 +299,7 @@ void x_finished(qk_tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case TD_SINGLE_TAP: register_code(KC_X); break;
case TD_SINGLE_HOLD: register_code(KC_LCTRL); break;
case TD_SINGLE_HOLD: register_code(KC_LCTL); break;
case TD_DOUBLE_TAP: register_code(KC_ESC); break;
case TD_DOUBLE_HOLD: register_code(KC_LALT); break;
// Last case is for fast typing. Assuming your key is `f`:
@ -312,7 +312,7 @@ void x_finished(qk_tap_dance_state_t *state, void *user_data) {
void x_reset(qk_tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case TD_SINGLE_TAP: unregister_code(KC_X); break;
case TD_SINGLE_HOLD: unregister_code(KC_LCTRL); break;
case TD_SINGLE_HOLD: unregister_code(KC_LCTL); break;
case TD_DOUBLE_TAP: unregister_code(KC_ESC); break;
case TD_DOUBLE_HOLD: unregister_code(KC_LALT);
case TD_DOUBLE_SINGLE_TAP: unregister_code(KC_X);


+ 2
- 2
docs/feature_userspace.md View File

@ -240,7 +240,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
For boards that may not have a shift button (such as on a macro pad), we need a way to always include the bootloader option. To do that, add the following to the `rules.mk` in your userspace folder:
```make
```make
ifeq ($(strip $(FLASH_BOOTLOADER)), yes)
OPT_DEFS += -DFLASH_BOOTLOADER
endif
@ -252,4 +252,4 @@ Also, holding Shift will add the flash target (`:flash`) to the command. Holdin
And for the boards that lack a shift key, or that you want to always attempt the flashing part, you can add `FLASH_BOOTLOADER = yes` to the `rules.mk` of that keymap.
?> This should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely. And this doesn't support BootloadHID or mdloader.
?> This should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely.

+ 0
- 1
docs/feature_velocikey.md View File

@ -6,7 +6,6 @@ Velocikey is a feature that lets you control the speed of lighting effects (like
For Velocikey to take effect, there are two steps. First, when compiling your keyboard, you'll need to set `VELOCIKEY_ENABLE=yes` in `rules.mk`, e.g.:
```
BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = no
STENO_ENABLE = no
EXTRAKEY_ENABLE = yes


+ 18
- 6
docs/feature_wpm.md View File

@ -10,11 +10,23 @@ For split keyboards using soft serial, the computed WPM score will be available
## Configuration
|Define |Default | Description |
|-----------------------------|--------------|------------------------------------------------------------------------------------------|
|`WPM_SMOOTHING` |`0.0487` | Sets the smoothing to about 40 keystrokes |
|`WPM_ESTIMATED_WORD_SIZE` |`5` | This is the value used when estimating average word size (for regression and normal use) |
|`WPM_ALLOW_COUNT_REGRESSOIN` |_Not defined_ | If defined allows the WPM to be decreased when hitting Delete or Backspace |
| Define | Default | Description |
|------------------------------|---------------|------------------------------------------------------------------------------------------|
| `WPM_ESTIMATED_WORD_SIZE` | `5` | This is the value used when estimating average word size (for regression and normal use) |
| `WPM_ALLOW_COUNT_REGRESSION` | _Not defined_ | If defined allows the WPM to be decreased when hitting Delete or Backspace |
| `WPM_UNFILTERED` | _Not defined_ | If undefined (the default), WPM values will be smoothed to avoid sudden changes in value |
| `WPM_SAMPLE_SECONDS` | `5` | This defines how many seconds of typing to average, when calculating WPM |
| `WPM_SAMPLE_PERIODS` | `50` | This defines how many sampling periods to use when calculating WPM |
| `WPM_LAUNCH_CONTROL` | _Not defined_ | If defined, WPM values will be calculated using partial buffers when typing begins |
'WPM_UNFILTERED' is potentially useful if you're filtering data in some other way (and also because it reduces the code required for the WPM feature), or if reducing measurement latency to a minimum is important for you.
Increasing 'WPM_SAMPLE_SECONDS' will give more smoothly changing WPM values at the expense of slightly more latency to the WPM calculation.
Increasing 'WPM_SAMPLE_PERIODS' will improve the smoothness at which WPM decays once typing stops, at a cost of approximately this many bytes of firmware space.
If 'WPM_LAUNCH_CONTROL' is defined, whenever WPM drops to zero, the next time typing begins WPM will be calculated based only on the time since that typing began, instead of the whole period of time specified by WPM_SAMPLE_SECONDS. This results in reaching an accurate WPM value much faster, even when filtering is enabled and a large WPM_SAMPLE_SECONDS value is specified.
## Public Functions
|Function |Description |
@ -35,7 +47,7 @@ bool wpm_keycode_user(uint16_t keycode) {
} else if (keycode > 0xFF) {
keycode = 0;
}
if ((keycode >= KC_A && keycode <= KC_0) || (keycode >= KC_TAB && keycode <= KC_SLASH)) {
if ((keycode >= KC_A && keycode <= KC_0) || (keycode >= KC_TAB && keycode <= KC_SLSH)) {
return true;
}


+ 1
- 1
docs/flashing_bootloadhid.md View File

@ -44,7 +44,7 @@ For native Windows flashing, the `bootloadHID.exe` can be used outside of the MS
### Linux Manual Installation
1. Install libusb development dependency:
```bash
```
# This depends on OS - for Debian the following works
sudo apt-get install libusb-dev
```


+ 0
- 19
docs/fr-fr/cli.md View File

@ -48,25 +48,6 @@ Nous recherchons des gens pour créer et maintenir un paquet `qmk` pour plus de
* Installez en utilisant un virtualenv
* Expliquez à l'utilisateur de définir la variable d'environnement `QMK_Home` pour "check out" les sources du firmware à un autre endroit que `~/qmk_firmware`.
# CLI locale
Si vous ne voulez pas utiliser la CLI globale, il y a une CLI locale empaquetée avec `qmk_firmware`. Vous pouvez le trouver dans `qmk_firmware/bin/qmk`. Vous pouvez lancer la commande `qmk` depuis n'importe quel répertoire et elle fonctionnera toujours sur cette copie de `qmk_firmware`.
**Exemple**:
```
$ ~/qmk_firmware/bin/qmk hello
Ψ Hello, World!
```
## Limitations de la CLI locale
Il y a quelques limitations à la CLI locale comparé à la globale:
* La CLI locale ne supporte pas `qmk setup` ou `qmk clone`
* La CLI locale n'opère pas sur le même arbre `qmk_firmware`, même si vous avez plusieurs dépôts clonés.
* La CLI locale ne s'exécute pas dans un virtualenv, donc il y a des risques que des dépendances seront en conflit
# Les commandes CLI
## `qmk compile`


+ 0
- 4
docs/fr-fr/faq_debug.md View File

@ -85,10 +85,6 @@ Premièrement, vous devez compiler le firmware avec l'option de compilation `NKR
Essayez la commande `Magic` **N** (`LShift+RShift+N` par défaut) si **NKRO** ne fonctionne toujours pas. Vous pouvez utiliser cette commande pour basculer temporairement entre le mode **NKRO** et **6KRO**. Sous certaines conditions, **NKRO** ne fonctionnera pas et vous devrez basculer en **6KRO**, en particulier lorsque vous êtes dans le BIOS.
Si votre firmware est compilé avec `BOOTMAGIC_ENABLE` vous devrez l'activer avec la commande `BootMagic` **N** (`Espace+N` par défaut). Cette option est enregistrée dans l'EEPROM et sera gardé entre deux cycles de démarrage.
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
## Le TrackPoint a besoin Circuit de réinitialisation (Support de souris PS/2)
Sans circuit de réinitialisation vous allez avoir des résultats inconsistants à cause de la mauvaise initialisation du matériel. Regardez le schéma du circuit du TPM754.


+ 1
- 1
docs/fr-fr/faq_keymap.md View File

@ -6,7 +6,7 @@ Cette page couvre les questions souvent posées à propos des keymaps. Si vous n
Regardez [Keycodes](keycodes.md) pour une liste des keycodes disponibles. Certains keycodes spécifiques ont des documentations plus complètes de disponible.
Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h).
## Quels sont les keycodes par défaut ?


+ 0
- 1
docs/fr-fr/getting_started_github.md View File

@ -32,7 +32,6 @@ Submodule path 'lib/chibios': checked out '587968d6cbc2b0e1c7147540872f2a67e59ca
Submodule path 'lib/chibios-contrib': checked out 'ede48346eee4b8d6847c19bc01420bee76a5e486'
Submodule path 'lib/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
Submodule path 'lib/lufa': checked out 'ce10f7642b0459e409839b23cc91498945119b4d'
Submodule path 'lib/ugfx': checked out '3e97b74e03c93631cdd3ddb2ce43b963fdce19b2'
```
Vous avez maintenant votre fork QMK sur votre machine locale, vous pouvez ajouter votre keymap, la compiler et la flasher sur votre board. Une fois heureux avec vos changements, vous pouvez les ajouter, commit, et pousser vers votre fork comme suit:


+ 5
- 5
docs/getting_started_docker.md View File

@ -12,13 +12,13 @@ The main prerequisite is a working `docker` or `podman` install.
Acquire a local copy of the QMK's repository (including submodules):
```bash
```
git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git
cd qmk_firmware
```
Run the following command to build a keymap:
```bash
```
util/docker_build.sh <keyboard>:<keymap>
# For example: util/docker_build.sh planck/rev6:default
```
@ -27,14 +27,14 @@ This will compile the desired keyboard/keymap and leave the resulting `.hex` or
There is also support for building _and_ flashing the keyboard straight from Docker by specifying the `target` as well:
```bash
```
util/docker_build.sh keyboard:keymap:target
# For example: util/docker_build.sh planck/rev6:default:flash
```
You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use:
```bash
```
util/docker_build.sh
# Reads parameters as input (leave blank for all keyboards/keymaps)
```
@ -42,7 +42,7 @@ util/docker_build.sh
You can manually set which container runtime you want to use by setting the `RUNTIME` environment variable to it's name or path.
By default docker or podman are automatically detected and docker is preferred over podman.
```bash
```
RUNTIME="podman" util/docker_build.sh keyboard:keymap:target
```


+ 0
- 1
docs/getting_started_github.md View File

@ -32,7 +32,6 @@ Submodule path 'lib/chibios': checked out '587968d6cbc2b0e1c7147540872f2a67e59ca
Submodule path 'lib/chibios-contrib': checked out 'ede48346eee4b8d6847c19bc01420bee76a5e486'
Submodule path 'lib/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
Submodule path 'lib/lufa': checked out 'ce10f7642b0459e409839b23cc91498945119b4d'
Submodule path 'lib/ugfx': checked out '3e97b74e03c93631cdd3ddb2ce43b963fdce19b2'
```
You now have your QMK fork on your local machine, and you can add your keymap, compile it and flash it to your board. Once you're happy with your changes, you can add, commit, and push them to your fork like this:


+ 5
- 5
docs/getting_started_make_guide.md View File

@ -55,7 +55,7 @@ Set these variables to `no` to disable them, and `yes` to enable them.
`BOOTMAGIC_ENABLE`
This allows you to hold a key and the salt key (space by default) and have access to a various EEPROM settings that persist over power loss. It's advised you keep this disabled, as the settings are often changed by accident, and produce confusing results that makes it difficult to debug. It's one of the more common problems encountered in help sessions.
This allows you to hold a key (usually Escape by default) to reset the EEPROM settings that persist over power loss and ready your keyboard to accept new firmware.
`MOUSEKEY_ENABLE`
@ -125,10 +125,6 @@ This allows you output audio on the C6 pin (needs abstracting). See the [audio p
Use this to debug changes to variable values, see the [tracing variables](unit_testing.md#tracing-variables) section of the Unit Testing page for more information.
`API_SYSEX_ENABLE`
This enables using the Quantum SYSEX API to send strings (somewhere?)
`KEY_LOCK_ENABLE`
This enables [key lock](feature_key_lock.md).
@ -149,6 +145,10 @@ Lets you replace the default matrix scanning routine with your own code. For fur
Lets you replace the default key debouncing routine with an alternative one. If `custom` you will need to provide your own implementation.
`DEFERRED_EXEC_ENABLE`
Enables deferred executor support -- timed delays before callbacks are invoked. See [deferred execution](custom_quantum_functions.md#deferred-execution) for more information.
## Customizing Makefile Options on a Per-Keymap Basis
If your keymap directory has a file called `rules.mk` any options you set in that file will take precedence over other `rules.mk` options for your particular keyboard.


+ 4
- 4
docs/getting_started_vagrant.md View File

@ -31,26 +31,26 @@ The development environment is configured to run the QMK Docker image, `qmkfm/qm
### Why am I seeing issues under Virtualbox?
Certain versions of Virtualbox 5 appear to have an incompatibility with the Virtualbox extensions installed in the boxes in this Vagrantfile. If you encounter any issues with the /vagrant mount not succeeding, please upgrade your version of Virtualbox to at least 5.0.12. **Alternately, you can try running the following command:**
```console
```
vagrant plugin install vagrant-vbguest
```
### How do I remove an existing environment?
Finished with your environment? From anywhere inside the folder where you checked out this project, Execute:
```console
```
vagrant destroy
```
### What if I want to use Docker directly?
Want to benefit from the Vagrant workflow without a virtual machine? The Vagrantfile is configured to bypass running a virtual machine, and run the container directly. Execute the following when bringing up the environment to force the use of Docker:
```console
```
vagrant up --provider=docker
```
### How do I access the virtual machine instead of the Docker container?
Execute the following to bypass the `vagrant` user booting directly to the official qmk builder image:
```console
```
vagrant ssh -c 'sudo -i'
```

+ 0
- 4
docs/hardware_drivers.md View File

@ -18,10 +18,6 @@ Support for addressing pins on the ProMicro by their Arduino name rather than th
Support for SSD1306 based OLED displays. For more information see the [OLED Driver Feature](feature_oled_driver.md) page.
## uGFX
You can make use of uGFX within QMK to drive character and graphic LCDs, LED arrays, OLED, TFT, and other display technologies. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
## WS2812
Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page.


+ 28
- 2
docs/hardware_keyboard_guidelines.md View File

@ -144,10 +144,38 @@ The `rules.mk` file can also be placed in a sub-folder, and its reading order is
* `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/rules.mk`
* `keyboards/top_folder/keymaps/a_keymap/rules.mk`
* `users/a_user_folder/rules.mk`
* `keyboards/top_folder/sub_1/sub_2/sub_3/sub_4/post_rules.mk`
* `keyboards/top_folder/sub_1/sub_2/sub_3/post_rules.mk`
* `keyboards/top_folder/sub_1/sub_2/post_rules.mk`
* `keyboards/top_folder/sub_1/post_rules.mk`
* `keyboards/top_folder/post_rules.mk`
* `common_features.mk`
Many of the settings written in the `rules.mk` file are interpreted by `common_features.mk`, which sets the necessary source files and compiler options.
The `post_rules.mk` file can interpret `features` of a keyboard-level before `common_features.mk`. For example, when your designed keyboard has the option to implement backlighting or underglow using rgblight.c, writing the following in the `post_rules.mk` makes it easier for the user to configure the `rules.mk`.
* `keyboards/top_folder/keymaps/a_keymap/rules.mk`
```make
# Please set the following according to the selection of the hardware implementation option.
RGBLED_OPTION_TYPE = backlight ## none, backlight or underglow
```
* `keyboards/top_folder/post_rules.mk`
```make
ifeq ($(filter $(strip $(RGBLED_OPTION_TYPE))x, nonex backlightx underglowx x),)
$(error unknown RGBLED_OPTION_TYPE value "$(RGBLED_OPTION_TYPE)")
endif
ifeq ($(strip $(RGBLED_OPTION_TYPE)),backlight)
RGBLIGHT_ENABLE = yes
OPT_DEFS += -DRGBLED_NUM=30
endif
ifeq ($(strip $(RGBLED_OPTION_TYPE)),underglow)
RGBLIGHT_ENABLE = yes
OPT_DEFS += -DRGBLED_NUM=6
endif
```
?> See `build_keyboard.mk` and `common_features.mk` for more details.
### `<keyboard_name.c>`
@ -227,8 +255,6 @@ The year should be the first year the file is created. If work was done to that
The core of QMK is licensed under the [GNU General Public License](https://www.gnu.org/licenses/licenses.en.html). If you are shipping binaries for AVR processors you may choose either [GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) or [GPLv3](https://www.gnu.org/licenses/gpl.html). If you are shipping binaries for ARM processors you must choose [GPL Version 3](https://www.gnu.org/licenses/gpl.html) to comply with the [ChibiOS](https://www.chibios.org) GPLv3 license.
If your keyboard makes use of the [uGFX](https://ugfx.io) features within QMK you must comply with the [uGFX License](https://ugfx.io/license.html), which requires a separate commercial license before selling a device containing uGFX.
## Technical Details
If you're looking for more information on making your keyboard work with QMK, [check out the hardware section](hardware.md)!

+ 0
- 1
docs/he-il/getting_started_github.md View File

@ -35,7 +35,6 @@ Submodule path 'lib/chibios': checked out '587968d6cbc2b0e1c7147540872f2a67e59ca
Submodule path 'lib/chibios-contrib': checked out 'ede48346eee4b8d6847c19bc01420bee76a5e486'
Submodule path 'lib/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
Submodule path 'lib/lufa': checked out 'ce10f7642b0459e409839b23cc91498945119b4d'
Submodule path 'lib/ugfx': checked out '3e97b74e03c93631cdd3ddb2ce43b963fdce19b2'
```
</div>


+ 1
- 1
docs/how_keyboards_work.md View File

@ -9,7 +9,7 @@ firmware directly.
Whenever you type on 1 particular key, here is the chain of actions taking
place:
``` text
```
+------+ +-----+ +----------+ +----------+ +----+
| User |-------->| Key |------>| Firmware |----->| USB wire |---->| OS |
+------+ +-----+ +----------+ +----------+ +----+


+ 53
- 12
docs/i2c_driver.md View File

@ -62,16 +62,13 @@ Then, modify your board's `mcuconf.h` to enable the peripheral you've chosen, fo
Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303.
|`config.h` Overrride |Description |Default|
|------------------------|-------------------------------------------------------------------------------------------|-------|
|`I2C_DRIVER` |I2C peripheral to use - I2C1 -> `I2CD1`, I2C2 -> `I2CD2` etc. |`I2CD1`|
|`I2C1_BANK` (deprecated)|The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`), superseded by `I2C1_SCL_BANK`/`I2C1_SDA_BANK`|`GPIOB`|
|`I2C1_SCL_BANK` |The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`) to use for SCL |`GPIOB`|
|`I2C1_SCL` |The pin number for SCL (0-15) |`6` |
|`I2C1_SCL_PAL_MODE` |The alternate function mode for SCL |`4` |
|`I2C1_SDA_BANK` |The bank of pins (`GPIOA`, `GPIOB`, `GPIOC`) to use for SDA |`GPIOB`|
|`I2C1_SDA` |The pin number for SDA (0-15) |`7` |
|`I2C1_SDA_PAL_MODE` |The alternate function mode for SDA |`4` |
|`config.h` Overrride |Description |Default|
|------------------------|--------------------------------------------------------------|-------|
|`I2C_DRIVER` |I2C peripheral to use - I2C1 -> `I2CD1`, I2C2 -> `I2CD2` etc. |`I2CD1`|
|`I2C1_SCL_PIN` |The pin definition for SCL |`B6` |
|`I2C1_SCL_PAL_MODE` |The alternate function mode for SCL |`4` |
|`I2C1_SDA_PIN` |The pin definition for SDA |`B7` |
|`I2C1_SDA_PAL_MODE` |The alternate function mode for SDA |`4` |
The following configuration values depend on the specific MCU in use.
@ -190,7 +187,7 @@ Receive multiple bytes from the selected SPI device.
### `i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
Writes to a register on the I2C device.
Writes to a register with an 8-bit address on the I2C device.
#### Arguments
@ -211,9 +208,32 @@ Writes to a register on the I2C device.
---
### `i2c_status_t i2c_writeReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
Writes to a register with a 16-bit address (big endian) on the I2C device.
#### Arguments
- `uint8_t devaddr`
The 7-bit I2C address of the device.
- `uint16_t regaddr`
The register address to write to.
- `uint8_t *data`
A pointer to the data to transmit.
- `uint16_t length`
The number of bytes to write. Take care not to overrun the length of `data`.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
Reads from a register on the I2C device.
Reads from a register with an 8-bit address on the I2C device.
#### Arguments
@ -232,6 +252,27 @@ Reads from a register on the I2C device.
---
### `i2c_status_t i2c_readReg16(uint8_t devaddr, uint16_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)`
Reads from a register with a 16-bit address (big endian) on the I2C device.
#### Arguments
- `uint8_t devaddr`
The 7-bit I2C address of the device.
- `uint16_t regaddr`
The register address to read from.
- `uint16_t length`
The number of bytes to read. Take care not to overrun the length of `data`.
- `uint16_t timeout`
The time in milliseconds to wait for a response from the target device.
#### Return Value
`I2C_STATUS_TIMEOUT` if the timeout period elapses, `I2C_STATUS_ERROR` if some other error occurs, otherwise `I2C_STATUS_SUCCESS`.
---
### `i2c_status_t i2c_stop(void)`
Stop the current I2C transaction.

+ 1
- 1
docs/internals_gpio_control.md View File

@ -4,7 +4,7 @@ QMK has a GPIO control abstraction layer which is microcontroller agnostic. This
## Functions :id=functions
The following functions provide basic control of GPIOs and are found in `tmk_core/common/<platform>/gpio.h`.
The following functions provide basic control of GPIOs and are found in `platforms/<platform>/gpio.h`.
|Function |Description | Old AVR Examples | Old ChibiOS/ARM Examples |
|------------------------|--------------------------------------------------|-------------------------------------------------|-------------------------------------------------|


+ 1
- 0
docs/ja/compatible_microcontrollers.md View File

@ -32,6 +32,7 @@ QMK は十分な容量のフラッシュメモリを備えた USB 対応 AVR ま
* [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)
* [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html)
* [STM32F401](https://www.st.com/en/microcontrollers-microprocessors/stm32f401.html)
* [STM32F405](https://www.st.com/en/microcontrollers-microprocessors/stm32f405-415.html)
* [STM32F407](https://www.st.com/en/microcontrollers-microprocessors/stm32f407-417.html)
* [STM32F411](https://www.st.com/en/microcontrollers-microprocessors/stm32f411.html)
* [STM32F446](https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html)


+ 1
- 1
docs/ja/config_options.md View File

@ -358,7 +358,7 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
これらを使って特定の機能のビルドを有効または無効にします。有効にすればするほどファームウェアが大きくなり、MCU には大きすぎるファームウェアを構築するリスクがあります。
* `BOOTMAGIC_ENABLE`
* 仮想 DIP スイッチ設定
* ブートマジックライトを有効にします
* `MOUSEKEY_ENABLE`
* マウスキー
* `EXTRAKEY_ENABLE`


+ 1
- 1
docs/ja/faq_keymap.md View File

@ -10,7 +10,7 @@
## どのキーコードを使えますか?
あなたが利用可能なキーコードのインデックスについては、[キーコード](ja/keycodes.md)を見てください。より広範なドキュメントがある場合は、そこからリンクしてあります。
キーコードは実際には [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h) で定義されています。
キーコードは実際には [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/keycode.h) で定義されています。
## デフォルトのキーコードとは何か?


+ 0
- 4
docs/ja/faq_misc.md View File

@ -39,10 +39,6 @@ Size after:
**NKRO** がまだ動作しない場合は、`Magic` **N** コマンド(デフォルトでは `LShift+RShift+N`)を試してみてください。**NKRO** モードと **6KRO** モード間を一時的に切り替えるためにこのコマンドを使うことができます。**NKRO** が機能しない状況、特に BIOS の場合は **6KRO** モードに切り替える必要があります。
ファームウェアを `BOOTMAGIC_ENABLE` でビルドした場合、`ブートマジック` **N** コマンドで切り替える必要があります(デフォルトでは `Space+N`)。この設定は EEPROM に格納され、電源を入れ直しても保持されます。
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
## トラックポイントははリセット回路が必要です (PS/2 マウスサポート)
リセット回路が無いとハードウェアの不適切な初期化のために一貫性の無い結果になります。TPM754 の回路図を見てください:


+ 5
- 2
docs/ja/feature_haptic_feedback.md View File

@ -9,9 +9,12 @@
現在のところ、`rules.mk` で触覚フィードバック用に以下のオプションを利用可能です:
`HAPTIC_ENABLE += DRV2605L`
```
HAPTIC_ENABLE = yes
`HAPTIC_ENABLE += SOLENOID`
HAPTIC_DRIVER += DRV2605L
HAPTIC_DRIVER += SOLENOID
```
## サポートされる既知のハードウェア


+ 1
- 1
docs/ja/feature_layers.md View File

@ -50,7 +50,7 @@ QMK を使い始めたばかりの場合は、全てを単純にしたいでし
レイヤーは番号順に上に積み重なっています。キーの押下の動作を決定する時に、QMK は上から順にレイヤーを走査し、`KC_TRNS` に設定されていない最初のアクティブなレイヤーに到達すると停止します。結果として、現在のレイヤーよりも数値的に低いレイヤーをアクティブにし、現在のレイヤー(あるいはアクティブでターゲットレイヤーよりも高い別のレイヤー)に `KC_TRNS` 以外のものがある場合、それが送信されるキーであり、アクティブ化したばかりのレイヤー上のキーではありません。これが、ほとんどの人の "なぜレイヤーが切り替わらないのか" 問題の原因です。
場合によっては、マクロ内あるいはタップダンスルーチンの一部としてレイヤーを切り替えほうが良いかもしれません。`layer_on` はレイヤーをアクティブにし、`layer_off` はそれを非アクティブにします。もっと多くのレイヤーに関する関数は、[action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action_layer.h) で見つけることができます。
場合によっては、マクロ内あるいはタップダンスルーチンの一部としてレイヤーを切り替えほうが良いかもしれません。`layer_on` はレイヤーをアクティブにし、`layer_off` はそれを非アクティブにします。もっと多くのレイヤーに関する関数は、[action_layer.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/action_layer.h) で見つけることができます。
## 関数 :id=functions


+ 1
- 1
docs/ja/feature_led_matrix.md View File

@ -52,7 +52,7 @@ I2C IS31FL3731 RGB コントローラを使ったアドレス指定可能な LED
`<keyboard>.c` に全ての LED を列挙する配列を定義します:
const is31_led __flash g_is31_leds[DRIVER_LED_TOTAL] = {
const is31_led PROGMEM g_is31_leds[DRIVER_LED_TOTAL] = {
/* これらの位置については IS31 マニュアルを参照してください
* driver
* | LED address


+ 7
- 24
docs/ja/feature_ps2_mouse.md View File

@ -43,14 +43,8 @@ PS2_USE_BUSYWAIT = yes
```c
#ifdef PS2_USE_BUSYWAIT
# define PS2_CLOCK_PORT PORTD
# define PS2_CLOCK_PIN PIND
# define PS2_CLOCK_DDR DDRD
# define PS2_CLOCK_BIT 1
# define PS2_DATA_PORT PORTD
# define PS2_DATA_PIN PIND
# define PS2_DATA_DDR DDRD
# define PS2_DATA_BIT 2
# define PS2_CLOCK_PIN D1
# define PS2_DATA_PIN D2
#endif
```
@ -69,14 +63,8 @@ PS2_USE_INT = yes
```c
#ifdef PS2_USE_INT
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 2
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 5
#define PS2_CLOCK_PIN D2
#define PS2_DATA_PIN D5
#define PS2_INT_INIT() do { \
EICRA |= ((1<<ISC21) | \
@ -107,14 +95,9 @@ PS2_USE_USART = yes
```c
#ifdef PS2_USE_USART
#define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND
#define PS2_CLOCK_DDR DDRD
#define PS2_CLOCK_BIT 5
#define PS2_DATA_PORT PORTD
#define PS2_DATA_PIN PIND
#define PS2_DATA_DDR DDRD
#define PS2_DATA_BIT 2
#ifdef PS2_USE_USART
#define PS2_CLOCK_PIN D5
#define PS2_DATA_PIN D2
/* 同期、奇数パリティ、1-bit ストップ、8-bit データ、立ち下がりエッジでサンプル */
/* CLOCK の DDR を入力としてスレーブに設定 */


+ 0
- 1
docs/ja/feature_velocikey.md View File

@ -11,7 +11,6 @@ Velocikey は入力の速度を使って(レインボー渦巻効果のような
Velocikey を使うためには、2つのステップがあります。最初に、キーボードをコンパイルする時に、`rules.mk` に `VELOCIKEY_ENABLE=yes` を設定する必要があります。例えば:
```
BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = no
STENO_ENABLE = no
EXTRAKEY_ENABLE = yes


+ 0
- 1
docs/ja/getting_started_github.md View File

@ -37,7 +37,6 @@ Submodule path 'lib/chibios': checked out '587968d6cbc2b0e1c7147540872f2a67e59ca
Submodule path 'lib/chibios-contrib': checked out 'ede48346eee4b8d6847c19bc01420bee76a5e486'
Submodule path 'lib/googletest': checked out 'ec44c6c1675c25b9827aacd08c02433cccde7780'
Submodule path 'lib/lufa': checked out 'ce10f7642b0459e409839b23cc91498945119b4d'
Submodule path 'lib/ugfx': checked out '3e97b74e03c93631cdd3ddb2ce43b963fdce19b2'
```
ローカルマシンに QMK のフォークができるので、キーマップの追加、コンパイル、キーボードへの書き込みができます。変更に満足したら、以下のようにそれらをフォークへ追加、コミットおよびプッシュすることができます:


+ 0
- 4
docs/ja/hardware_drivers.md View File

@ -24,10 +24,6 @@ ProMicro のピンを AVR の名前ではなく、Arduino の名前で指定で
SSD1306 ベースの OLED ディスプレイのサポート。詳しくは[OLED ドライバ](ja/feature_oled_driver.md)を参照して下さい。
## uGFX
QMK 内で uGFX を使用して、キャラクタ LCD やグラフィック LCD、LED アレイ、OLED ディスプレイ、TFT 液晶や他のディスプレイを制御できます。この部分はより詳しく文書化される必要があります。もしこれを使用したい場合にコードを読んでも分からない場合、[issue を開く](https://github.com/qmk/qmk_firmware/issues/new)を通して助けることができるかもしれません。
## WS2812
WS2811/WS2812{a,b,c} LED のサポート。 詳しくは [RGB ライト](ja/feature_rgblight.md)を参照して下さい。


+ 0
- 2
docs/ja/hardware_keyboard_guidelines.md View File

@ -234,8 +234,6 @@ QMK が提供する機能の量を考えれば、新しいユーザーが混乱
QMK のコア部分は [GNU General Public License](https://www.gnu.org/licenses/licenses.en.html) でライセンスされます。AVR マイコン用のバイナリを提供する場合は、[GPLv2](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) か、[GPLv3](https://www.gnu.org/licenses/gpl.html) のどちらかから選択出来ます。ARM マイコン用のバイナリを提供する場合は、 [ChibiOS](https://www.chibios.org) の GPLv3 ライセンスに準拠するため、[GPL Version 3](https://www.gnu.org/licenses/gpl.html) を選択しなければいけません。
[uGFX](https://ugfx.io) を使用している場合は、[uGFX License](https://ugfx.io/license.html) に準拠する必要があります。uGFX を利用したデバイスを販売するには個別に商用ライセンスを取得しなければいけません。
## 技術的な詳細
キーボードを QMK で動作させるための詳細は[ハードウェア](ja/hardware.md)を参照して下さい!

+ 4
- 7
docs/ja/i2c_driver.md View File

@ -79,13 +79,10 @@ ARM MCU 用の設定はしばしば非常に複雑です。これは、多くの
STM32 MCU では、使用するハードウェアドライバにより、さまざまなピンを I2C ピンとして設定できます。標準では `B6`, `B7` ピンが I2C 用のピンです。 I2C 用のピンを設定するために次の定義が使えます:
| 変数 | 説明 | 既定値 |
|-----------------------|--------------------------------------------------------------------------------------------------|---------|
| `I2C1_SCL_BANK` | SCL に使うピンのバンク (`GPIOA`, `GPIOB`, `GPIOC`) | `GPIOB` |
| `I2C1_SDA_BANK` | SDA に使うピンのバンク (`GPIOA`, `GPIOB`, `GPIOC`) | `GPIOB` |
| `I2C1_SCL` | SCL のピン番号 (0-15) | `6` |
| `I2C1_SDA` | SDA のピン番号 (0-15) | `7` |
| `I2C1_BANK`(非推奨) | 使用するピンのバンク (`GPIOA`, `GPIOB`, `GPIOC`)。後継は `I2C1_SCL_BANK`, `I2C1_SDA_BANK` です。 | `GPIOB` |
| 変数 | 説明 | 既定値 |
|-----------------------|-------------------------------------------------------------------------------------------|---------|
| `I2C1_SCL_PIN` | SCL のピン番号 | `B6` |
| `I2C1_SDA_PIN` | SDA のピン番号 | `B7` |
ChibiOS I2C ドライバの設定項目は STM32 MCU の種類に依存します。


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

Loading…
Cancel
Save