mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-05 14:08:39 +00:00
Compare commits
185 Commits
0.8.89
...
make_cli_p
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a380937f1f | ||
![]() |
e916ce5f3e | ||
![]() |
086a7cf800 | ||
![]() |
99f7fe6bd4 | ||
![]() |
d0c3a4c8d5 | ||
![]() |
2dca087b04 | ||
![]() |
7e4cf9ace2 | ||
![]() |
0d658e0c95 | ||
![]() |
1522d97c2b | ||
![]() |
2d39a9dcdb | ||
![]() |
33bf4863f5 | ||
![]() |
ad547c1fdd | ||
![]() |
9b70e53508 | ||
![]() |
33a5dc4fcf | ||
![]() |
e0fffcde99 | ||
![]() |
06bffbd45b | ||
![]() |
c261076f8e | ||
![]() |
51ecd37d7b | ||
![]() |
ed5e69093c | ||
![]() |
43785126a7 | ||
![]() |
8c97b4a3a4 | ||
![]() |
0698b15aa5 | ||
![]() |
d600631ad1 | ||
![]() |
f3595f65b7 | ||
![]() |
23df763a31 | ||
![]() |
ed910c8e97 | ||
![]() |
7e1c0bd4c0 | ||
![]() |
d2b8398f75 | ||
![]() |
195324cc4c | ||
![]() |
cd5399942b | ||
![]() |
fd4bbd8d11 | ||
![]() |
f43cb31476 | ||
![]() |
89eb3a9e42 | ||
![]() |
66d94dc22a | ||
![]() |
5a8f59503e | ||
![]() |
7918f7d61d | ||
![]() |
55b43f02f0 | ||
![]() |
46a84ec84a | ||
![]() |
3b5998085c | ||
![]() |
bc13dcd349 | ||
![]() |
55002338b1 | ||
![]() |
4a92dd327c | ||
![]() |
7873b49d40 | ||
![]() |
fcf2b45263 | ||
![]() |
5607af8524 | ||
![]() |
5a45627e17 | ||
![]() |
17d0f6338e | ||
![]() |
484c059d86 | ||
![]() |
3cc68543ca | ||
![]() |
daf6dedb02 | ||
![]() |
e990863296 | ||
![]() |
2ae39ccf38 | ||
![]() |
5185c52b4a | ||
![]() |
c0b99badcb | ||
![]() |
f9bb9ef0b8 | ||
![]() |
3d9ffd3efb | ||
![]() |
3cea9fedff | ||
![]() |
575d99816e | ||
![]() |
4bccde37d4 | ||
![]() |
f6b40da7f8 | ||
![]() |
6fb048fdaf | ||
![]() |
06b571aa53 | ||
![]() |
355b693e4e | ||
![]() |
f514ad5503 | ||
![]() |
09a1917103 | ||
![]() |
46e4493761 | ||
![]() |
157d121c71 | ||
![]() |
7e6b550ebf | ||
![]() |
7f4ce4a8b7 | ||
![]() |
6452973761 | ||
![]() |
a2309b306a | ||
![]() |
52ac6c4303 | ||
![]() |
05e9ff6554 | ||
![]() |
17bda000f3 | ||
![]() |
46a69d1f3b | ||
![]() |
b56a41800a | ||
![]() |
d3c29c9b3c | ||
![]() |
370577e4ed | ||
![]() |
6e84247ec2 | ||
![]() |
5380c29dd7 | ||
![]() |
23f19852b9 | ||
![]() |
8a5c1e1859 | ||
![]() |
6265b78307 | ||
![]() |
23124b9fd1 | ||
![]() |
eb7fc7f9d9 | ||
![]() |
c2df714c3b | ||
![]() |
799b21f8cd | ||
![]() |
750179e111 | ||
![]() |
f538b2273a | ||
![]() |
50e85f91e8 | ||
![]() |
27e7f322a5 | ||
![]() |
dfdc89296b | ||
![]() |
671020af08 | ||
![]() |
b8c3f4c60b | ||
![]() |
511fe643c2 | ||
![]() |
f7601dba13 | ||
![]() |
89cab95b63 | ||
![]() |
cc38627816 | ||
![]() |
6c2c3c13e9 | ||
![]() |
e4cc642a79 | ||
![]() |
c3c3943432 | ||
![]() |
061ed87b89 | ||
![]() |
5c1aca0b88 | ||
![]() |
6384a2abd8 | ||
![]() |
439afc883a | ||
![]() |
07c75feba3 | ||
![]() |
b5aa5e4338 | ||
![]() |
be8443b35b | ||
![]() |
4b10235f67 | ||
![]() |
6ef13f83e2 | ||
![]() |
be2f5816b6 | ||
![]() |
ff213d5fe1 | ||
![]() |
3234118e52 | ||
![]() |
a1ffc40b36 | ||
![]() |
8fe5c718b4 | ||
![]() |
38f14c4174 | ||
![]() |
eb683c8c52 | ||
![]() |
21799be1ca | ||
![]() |
5cfc3ce02e | ||
![]() |
724f20ed32 | ||
![]() |
c61f016fa4 | ||
![]() |
ea7e40bae1 | ||
![]() |
974f83ec4b | ||
![]() |
400ca2d035 | ||
![]() |
e409fb47f2 | ||
![]() |
0499f30f59 | ||
![]() |
ae74922d14 | ||
![]() |
3349a8b49b | ||
![]() |
b4ef72423e | ||
![]() |
f4b67cde8a | ||
![]() |
0a643be39e | ||
![]() |
6c8e205fc0 | ||
![]() |
7901006753 | ||
![]() |
9bfa713421 | ||
![]() |
b6fc3ad8e7 | ||
![]() |
e0909a31c7 | ||
![]() |
d6bffdf577 | ||
![]() |
d1190df10b | ||
![]() |
bf38f39c3f | ||
![]() |
6add103827 | ||
![]() |
62d1d69ba9 | ||
![]() |
7642075fc3 | ||
![]() |
ca91dc594b | ||
![]() |
26cb83b8c0 | ||
![]() |
2392ddb76b | ||
![]() |
6de77141a4 | ||
![]() |
6f6c2e1c5c | ||
![]() |
48cad94d7e | ||
![]() |
90665aeec9 | ||
![]() |
845953cc67 | ||
![]() |
c3c2eb71e1 | ||
![]() |
28a6a4a15b | ||
![]() |
ccb37f673a | ||
![]() |
c5efbc45a1 | ||
![]() |
6a0d3c3517 | ||
![]() |
2fbbac04bb | ||
![]() |
04c81a04c7 | ||
![]() |
120fcc58b6 | ||
![]() |
2f15cb2126 | ||
![]() |
8af156d976 | ||
![]() |
70b5015162 | ||
![]() |
3fad3854d6 | ||
![]() |
38d7145da2 | ||
![]() |
6e8876be39 | ||
![]() |
0bb2924670 | ||
![]() |
2f623daa45 | ||
![]() |
ebbaba9001 | ||
![]() |
5f35b07102 | ||
![]() |
59188bf29d | ||
![]() |
9c4bf0ac4a | ||
![]() |
f2901375ce | ||
![]() |
f65e79477f | ||
![]() |
3094422b33 | ||
![]() |
31fd0cbc1c | ||
![]() |
2b427f774a | ||
![]() |
85444176b2 | ||
![]() |
52b48997eb | ||
![]() |
808aab8496 | ||
![]() |
0742f9fc96 | ||
![]() |
58a9c84d6b | ||
![]() |
c217186bea | ||
![]() |
781308507d | ||
![]() |
2eb6cb0dfd | ||
![]() |
95c5c11d0b | ||
![]() |
3fe8d604a4 |
@@ -1,24 +0,0 @@
|
||||
|
||||
-I.
|
||||
-I./drivers
|
||||
-I./drivers/avr
|
||||
-I./keyboards/ergodox_ez
|
||||
-I./keyboards/ergodox_ez/keymaps/vim
|
||||
-I./lib
|
||||
-I./lib/lufa
|
||||
-I./quantum
|
||||
-I./quantum/api
|
||||
-I./quantum/audio
|
||||
-I./quantum/keymap_extras
|
||||
-I./quantum/process_keycode
|
||||
-I./quantum/serial_link
|
||||
-I./quantum/template
|
||||
-I./quantum/tools
|
||||
-I./quantum/visualizer
|
||||
-I./tmk_core
|
||||
-I./tmk_core/common
|
||||
-I./tmk_core/common/debug.h
|
||||
-I./tmk_core/protocol
|
||||
-I./tmk_core/protocol/lufa
|
||||
-I./util
|
||||
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
|
2
.github/workflows/cli.yml
vendored
2
.github/workflows/cli.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
container: qmkfm/base_container
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install dependencies
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -24,6 +24,7 @@ quantum/version.h
|
||||
.idea/
|
||||
CMakeLists.txt
|
||||
cmake-build-debug
|
||||
.clang_complete
|
||||
doxygen/
|
||||
.DS_Store
|
||||
/util/wsl_downloaded
|
||||
@@ -47,7 +48,6 @@ doxygen/
|
||||
*.iml
|
||||
.browse.VC.db*
|
||||
*.stackdump
|
||||
util/Win_Check_Output.txt
|
||||
# Let these ones be user specific, since we have so many different configurations
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
|
20
.vscode/settings.json
vendored
20
.vscode/settings.json
vendored
@@ -9,13 +9,17 @@
|
||||
"**/*.bin": true
|
||||
},
|
||||
"files.associations": {
|
||||
"*.h": "c",
|
||||
"*.c": "c",
|
||||
"*.inc": "c",
|
||||
"*.cpp": "cpp",
|
||||
"*.hpp": "cpp",
|
||||
"xstddef": "c",
|
||||
"type_traits": "c",
|
||||
"utility": "c"
|
||||
"*.h": "c",
|
||||
"*.c": "c",
|
||||
"*.inc": "c",
|
||||
"*.cpp": "cpp",
|
||||
"*.hpp": "cpp",
|
||||
"xstddef": "c",
|
||||
"type_traits": "c",
|
||||
"utility": "c"
|
||||
},
|
||||
"[markdown]": {
|
||||
"editor.trimAutoWhitespace": false,
|
||||
"files.trimTrailingWhitespace": false
|
||||
}
|
||||
}
|
||||
|
79
Makefile
79
Makefile
@@ -557,55 +557,38 @@ endef
|
||||
# Let's match everything, we handle all the rule parsing ourselves
|
||||
.PHONY: %
|
||||
%:
|
||||
# Check if we have the CMP tool installed
|
||||
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
||||
# Ensure that python3 is installed. This check can be removed after python is used in more places.
|
||||
if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
||||
# Check if the submodules are dirty, and display a warning if they are
|
||||
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
|
||||
git submodule status --recursive 2>/dev/null | \
|
||||
while IFS= read -r x; do \
|
||||
case "$$x" in \
|
||||
\ *) ;; \
|
||||
*) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
|
||||
esac \
|
||||
done
|
||||
endif
|
||||
rm -f $(ERROR_FILE) > /dev/null 2>&1
|
||||
$(eval $(call PARSE_RULE,$@))
|
||||
$(eval $(call SET_SILENT_MODE))
|
||||
# Run all the commands in the same shell, notice the + at the first line
|
||||
# it has to be there to allow parallel execution of the submake
|
||||
# This always tries to compile everything, even if error occurs in the middle
|
||||
# But we return the error code at the end, to trigger travis failures
|
||||
# The sort at this point is to remove duplicates
|
||||
$(foreach COMMAND,$(sort $(COMMANDS)),$(RUN_COMMAND))
|
||||
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||
$(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
||||
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||
# # Check if we have the CMP tool installed
|
||||
# cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
||||
# # Ensure that python3 is installed. This check can be removed after python is used in more places.
|
||||
# if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
||||
# # Check if the submodules are dirty, and display a warning if they are
|
||||
#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
|
||||
# git submodule status --recursive 2>/dev/null | \
|
||||
# while IFS= read -r x; do \
|
||||
# case "$$x" in \
|
||||
# \ *) ;; \
|
||||
# *) printf "$(MSG_SUBMODULE_DIRTY)";break;; \
|
||||
# esac \
|
||||
# done
|
||||
#endif
|
||||
# rm -f $(ERROR_FILE) > /dev/null 2>&1
|
||||
# $(eval $(call PARSE_RULE,$@))
|
||||
# $(eval $(call SET_SILENT_MODE))
|
||||
# # Run all the commands in the same shell, notice the + at the first line
|
||||
# # it has to be there to allow parallel execution of the submake
|
||||
# # This always tries to compile everything, even if error occurs in the middle
|
||||
# # But we return the error code at the end, to trigger travis failures
|
||||
# # The sort at this point is to remove duplicates
|
||||
# $(foreach COMMAND,$(sort $(COMMANDS)),$(RUN_COMMAND))
|
||||
# if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||
# $(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
||||
# if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
||||
|
||||
# These no longer work because of the colon system
|
||||
|
||||
# All should compile everything
|
||||
# .PHONY: all
|
||||
# all: all-keyboards test-all
|
||||
|
||||
# Define some shortcuts, mostly for compatibility with the old syntax
|
||||
# .PHONY: all-keyboards
|
||||
# all-keyboards: all\:all\:all
|
||||
|
||||
# .PHONY: all-keyboards-defaults
|
||||
# all-keyboards-defaults: all\:default
|
||||
|
||||
# .PHONY: test
|
||||
# test: test-all
|
||||
|
||||
# .PHONY: test-clean
|
||||
# test-clean: test-all-clean
|
||||
bin/qmk makehandler $@
|
||||
|
||||
lib/%:
|
||||
git submodule sync $?
|
||||
|
File diff suppressed because one or more lines are too long
59
bin/qmk
59
bin/qmk
@@ -4,38 +4,59 @@
|
||||
import os
|
||||
import sys
|
||||
from importlib.util import find_spec
|
||||
from pathlib import Path
|
||||
|
||||
# Add the QMK python libs to our path
|
||||
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||||
qmk_dir = os.path.abspath(os.path.join(script_dir, '..'))
|
||||
python_lib_dir = os.path.abspath(os.path.join(qmk_dir, 'lib', 'python'))
|
||||
sys.path.append(python_lib_dir)
|
||||
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))
|
||||
|
||||
# Make sure our modules have been setup
|
||||
with open(os.path.join(qmk_dir, 'requirements.txt'), 'r') as fd:
|
||||
for line in fd.readlines():
|
||||
line = line.strip().replace('<', '=').replace('>', '=')
|
||||
|
||||
if line[0] == '#':
|
||||
continue
|
||||
def _check_modules(requirements):
|
||||
""" Check if the modules in the given requirements.txt are available.
|
||||
"""
|
||||
with Path(qmk_dir / requirements).open() as fd:
|
||||
for line in fd.readlines():
|
||||
line = line.strip().replace('<', '=').replace('>', '=')
|
||||
|
||||
if '#' in line:
|
||||
line = line.split('#')[0]
|
||||
if len(line) == 0 or line[0] == '#' or line.startswith('-r'):
|
||||
continue
|
||||
|
||||
module = line.split('=')[0] if '=' in line else line
|
||||
if '#' in line:
|
||||
line = line.split('#')[0]
|
||||
|
||||
module = dict()
|
||||
module['name'] = module['import'] = line.split('=')[0] if '=' in line else line
|
||||
|
||||
if module in ['pep8-naming']:
|
||||
# Not every module is importable by its own name.
|
||||
continue
|
||||
if module['name'] == "pep8-naming":
|
||||
module['import'] = "pep8ext_naming"
|
||||
|
||||
if not find_spec(module):
|
||||
print('Could not find module %s!' % module)
|
||||
print('Please run `pip3 install -r requirements.txt` to install the python dependencies.')
|
||||
exit(255)
|
||||
if not find_spec(module['import']):
|
||||
print('Could not find module %s!' % module['name'])
|
||||
print('Please run `python3 -m pip install -r %s` to install required python dependencies.' % (qmk_dir / requirements,))
|
||||
if developer:
|
||||
print('You can also turn off developer mode: qmk config user.developer=None')
|
||||
print()
|
||||
exit(255)
|
||||
|
||||
|
||||
developer = False
|
||||
# Make sure our modules have been setup
|
||||
_check_modules('requirements.txt')
|
||||
|
||||
# Setup the CLI
|
||||
import milc # noqa
|
||||
|
||||
# For developers additional modules are needed
|
||||
if milc.cli.config.user.developer:
|
||||
# Do not run the check for 'config',
|
||||
# so users can turn off developer mode
|
||||
if len(sys.argv) == 1 or (len(sys.argv) > 1 and 'config' != sys.argv[1]):
|
||||
developer = True
|
||||
_check_modules('requirements-dev.txt')
|
||||
|
||||
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
|
||||
|
||||
|
||||
|
@@ -21,6 +21,11 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
||||
endif
|
||||
|
||||
# Load the keymap-level rules.mk if exists
|
||||
ifneq ("$(wildcard $(KEYMAP_PATH))", "")
|
||||
-include $(KEYMAP_PATH)/rules.mk
|
||||
endif
|
||||
|
||||
# Generate the keymap.c
|
||||
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
||||
bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
||||
|
@@ -6,6 +6,7 @@
|
||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||
* [Getting Help/Support](support.md)
|
||||
* [Other Resources](newbs_learn_more_resources.md)
|
||||
* [Syllabus](syllabus.md)
|
||||
|
||||
* FAQs
|
||||
* [General FAQ](faq_general.md)
|
||||
@@ -121,6 +122,7 @@
|
||||
* [Drivers](hardware_drivers.md)
|
||||
* [ADC Driver](adc_driver.md)
|
||||
* [I2C Driver](i2c_driver.md)
|
||||
* [SPI Driver](spi_driver.md)
|
||||
* [WS2812 Driver](ws2812_driver.md)
|
||||
* [EEPROM Driver](eeprom_driver.md)
|
||||
* [GPIO Controls](internals_gpio_control.md)
|
||||
@@ -135,6 +137,10 @@
|
||||
* [Development Environment](api_development_environment.md)
|
||||
* [Architecture Overview](api_development_overview.md)
|
||||
|
||||
* Hardware Platform Development
|
||||
* Arm/ChibiOS
|
||||
* [Early initialization](platformdev_chibios_earlyinit.md)
|
||||
|
||||
* QMK Reference
|
||||
* [Contributing to QMK](contributing.md)
|
||||
* [Translating the QMK Docs](translating.md)
|
||||
|
@@ -6,7 +6,7 @@ The QMK CLI makes building and working with QMK keyboards easier. We have provid
|
||||
|
||||
### Requirements :id=requirements
|
||||
|
||||
The CLI requires Python 3.5 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI.
|
||||
QMK requires Python 3.6 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI.
|
||||
|
||||
### Install Using Homebrew (macOS, some Linux) :id=install-using-homebrew
|
||||
|
||||
@@ -21,7 +21,7 @@ qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build
|
||||
|
||||
### Install Using easy_install or pip :id=install-using-easy_install-or-pip
|
||||
|
||||
If your system is not listed above you can install QMK manually. First ensure that you have python 3.5 (or later) installed and have installed pip. Then install QMK with this command:
|
||||
If your system is not listed above you can install QMK manually. First ensure that you have python 3.6 (or later) installed and have installed pip. Then install QMK with this command:
|
||||
|
||||
```
|
||||
pip3 install qmk
|
||||
|
@@ -1,38 +1,6 @@
|
||||
# QMK CLI Commands
|
||||
|
||||
# CLI Commands
|
||||
|
||||
## `qmk cformat`
|
||||
|
||||
This command formats C code using clang-format.
|
||||
|
||||
Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b <branch_name>`
|
||||
|
||||
Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files.
|
||||
|
||||
**Usage for specified files**:
|
||||
|
||||
```
|
||||
qmk cformat [file1] [file2] [...] [fileN]
|
||||
```
|
||||
|
||||
**Usage for all core files**:
|
||||
|
||||
```
|
||||
qmk cformat -a
|
||||
```
|
||||
|
||||
**Usage for only changed files against origin/master**:
|
||||
|
||||
```
|
||||
qmk cformat
|
||||
```
|
||||
|
||||
**Usage for only changed files against branch_name**:
|
||||
|
||||
```
|
||||
qmk cformat -b branch_name
|
||||
```
|
||||
# User Commands
|
||||
|
||||
## `qmk compile`
|
||||
|
||||
@@ -136,16 +104,6 @@ This command lets you configure the behavior of QMK. For the full `qmk config` d
|
||||
qmk config [-ro] [config_token1] [config_token2] [...] [config_tokenN]
|
||||
```
|
||||
|
||||
## `qmk docs`
|
||||
|
||||
This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936.
|
||||
|
||||
**Usage**:
|
||||
|
||||
```
|
||||
qmk docs [-p PORT]
|
||||
```
|
||||
|
||||
## `qmk doctor`
|
||||
|
||||
This command examines your environment and alerts you to potential build or flash problems. It can fix many of them if you want it to.
|
||||
@@ -180,28 +138,6 @@ Creates a keymap.c from a QMK Configurator export.
|
||||
qmk json2c [-o OUTPUT] filename
|
||||
```
|
||||
|
||||
## `qmk kle2json`
|
||||
|
||||
This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite.
|
||||
|
||||
**Usage**:
|
||||
|
||||
```
|
||||
qmk kle2json [-f] <filename>
|
||||
```
|
||||
|
||||
**Examples**:
|
||||
|
||||
```
|
||||
$ qmk kle2json kle.txt
|
||||
☒ File info.json already exists, use -f or --force to overwrite.
|
||||
```
|
||||
|
||||
```
|
||||
$ qmk kle2json -f kle.txt -f
|
||||
Ψ Wrote out to info.json
|
||||
```
|
||||
|
||||
## `qmk list-keyboards`
|
||||
|
||||
This command lists all the keyboards currently defined in `qmk_firmware`
|
||||
@@ -232,6 +168,74 @@ This command creates a new keymap based on a keyboard's existing default keymap.
|
||||
qmk new-keymap [-kb KEYBOARD] [-km KEYMAP]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# Developer Commands
|
||||
|
||||
## `qmk cformat`
|
||||
|
||||
This command formats C code using clang-format.
|
||||
|
||||
Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b <branch_name>`
|
||||
|
||||
Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files.
|
||||
|
||||
**Usage for specified files**:
|
||||
|
||||
```
|
||||
qmk cformat [file1] [file2] [...] [fileN]
|
||||
```
|
||||
|
||||
**Usage for all core files**:
|
||||
|
||||
```
|
||||
qmk cformat -a
|
||||
```
|
||||
|
||||
**Usage for only changed files against origin/master**:
|
||||
|
||||
```
|
||||
qmk cformat
|
||||
```
|
||||
|
||||
**Usage for only changed files against branch_name**:
|
||||
|
||||
```
|
||||
qmk cformat -b branch_name
|
||||
```
|
||||
|
||||
## `qmk docs`
|
||||
|
||||
This command starts a local HTTP server which you can use for browsing or improving the docs. Default port is 8936.
|
||||
|
||||
**Usage**:
|
||||
|
||||
```
|
||||
qmk docs [-p PORT]
|
||||
```
|
||||
|
||||
## `qmk kle2json`
|
||||
|
||||
This command allows you to convert from raw KLE data to QMK Configurator JSON. It accepts either an absolute file path, or a file name in the current directory. By default it will not overwrite `info.json` if it is already present. Use the `-f` or `--force` flag to overwrite.
|
||||
|
||||
**Usage**:
|
||||
|
||||
```
|
||||
qmk kle2json [-f] <filename>
|
||||
```
|
||||
|
||||
**Examples**:
|
||||
|
||||
```
|
||||
$ qmk kle2json kle.txt
|
||||
☒ File info.json already exists, use -f or --force to overwrite.
|
||||
```
|
||||
|
||||
```
|
||||
$ qmk kle2json -f kle.txt -f
|
||||
Ψ Wrote out to info.json
|
||||
```
|
||||
|
||||
## `qmk pyformat`
|
||||
|
||||
This command formats python code in `qmk_firmware`.
|
||||
@@ -251,3 +255,4 @@ This command runs the python test suite. If you make changes to python code you
|
||||
```
|
||||
qmk pytest
|
||||
```
|
||||
|
||||
|
@@ -6,6 +6,18 @@ This document has useful information for developers wishing to write new `qmk` s
|
||||
|
||||
The QMK CLI operates using the subcommand pattern made famous by git. The main `qmk` script is simply there to setup the environment and pick the correct entrypoint to run. Each subcommand is a self-contained module with an entrypoint (decorated by `@cli.subcommand()`) that performs some action and returns a shell returncode, or None.
|
||||
|
||||
## Developer mode:
|
||||
|
||||
If you intend to maintain keyboards and/or contribute to QMK, you can enable the CLI's "Developer" mode:
|
||||
|
||||
`qmk config user.developer=True`
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
# Subcommands
|
||||
|
||||
[MILC](https://github.com/clueboard/milc) is the CLI framework `qmk` uses to handle argument parsing, configuration, logging, and many other features. It lets you focus on writing your tool without wasting your time writing glue code.
|
||||
@@ -32,7 +44,7 @@ def hello(cli):
|
||||
|
||||
First we import the `cli` object from `milc`. This is how we interact with the user and control the script's behavior. We use `@cli.argument()` to define a command line flag, `--name`. This also creates a configuration variable named `hello.name` (and the corresponding `user.name`) which the user can set so they don't have to specify the argument. The `cli.subcommand()` decorator designates this function as a subcommand. The name of the subcommand will be taken from the name of the function.
|
||||
|
||||
Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.5/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator.
|
||||
Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.6/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator.
|
||||
|
||||
# User Interaction
|
||||
|
||||
@@ -44,13 +56,13 @@ There are two main methods for outputting text in a subcommand- `cli.log` and `c
|
||||
|
||||
You can use special tokens to colorize your text, to make it easier to understand the output of your program. See [Colorizing Text](#colorizing-text) below.
|
||||
|
||||
Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.5/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example.
|
||||
Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.6/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example.
|
||||
|
||||
You should never use the format operator (`%`) directly, always pass values as arguments.
|
||||
|
||||
### Logging (`cli.log`)
|
||||
|
||||
The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.5/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong.
|
||||
The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.6/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong.
|
||||
|
||||
The default log level is `INFO`. If the user runs `qmk -v <subcommand>` the default log level will be set to `DEBUG`.
|
||||
|
||||
|
@@ -20,11 +20,11 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely
|
||||
* We accept both forms of preprocessor if's: `#ifdef DEFINED` and `#if defined(DEFINED)`
|
||||
* If you are not sure which to prefer use the `#if defined(DEFINED)` form.
|
||||
* Do not change existing code from one style to the other, except when moving to a multiple condition `#if`.
|
||||
* Do not put whitespace between `#` and `if`.
|
||||
* When deciding how (or if) to indent directives keep these points in mind:
|
||||
* Readability is more important than consistency.
|
||||
* Follow the file's existing style. If the file is mixed follow the style that makes sense for the section you are modifying.
|
||||
* When choosing to indent you can follow the indention level of the surrounding C code, or preprocessor directives can have their own indent level. Choose the style that best communicates the intent of your code.
|
||||
* When deciding how (or if) to indent preprocessor directives, keep these points in mind:
|
||||
* Readability is more important than consistency.
|
||||
* Follow the file's existing style. If the file is mixed, follow the style that makes sense for the section you are modifying.
|
||||
* When indenting, keep the hash at the start of the line and add whitespace between `#` and `if`, starting with 4 spaces after the `#`.
|
||||
* You can follow the indention level of the surrounding C code, or preprocessor directives can have their own indentation levels. Choose the style that best communicates the intent of your code.
|
||||
|
||||
Here is an example for easy reference:
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
Most of our style follows PEP8 with some local modifications to make things less nit-picky.
|
||||
|
||||
* We target Python 3.5 for compatability with all supported platforms.
|
||||
* We target Python 3.6 for compatability with all supported platforms.
|
||||
* We indent using four (4) spaces (soft tabs)
|
||||
* We encourage liberal use of comments
|
||||
* Think of them as a story describing the feature
|
||||
@@ -317,7 +317,7 @@ At the time of this writing our tests are not very comprehensive. Looking at the
|
||||
|
||||
## Integration Tests
|
||||
|
||||
Integration tests can be found in `lib/python/qmk/tests/test_cli_commands.py`. This is where CLI commands are actually run and their overall behavior is verified. We use [`subprocess`](https://docs.python.org/3.5/library/subprocess.html#module-subprocess) to launch each CLI command and a combination of checking output and returncode to determine if the right thing happened.
|
||||
Integration tests can be found in `lib/python/qmk/tests/test_cli_commands.py`. This is where CLI commands are actually run and their overall behavior is verified. We use [`subprocess`](https://docs.python.org/3.6/library/subprocess.html#module-subprocess) to launch each CLI command and a combination of checking output and returncode to determine if the right thing happened.
|
||||
|
||||
## Unit Tests
|
||||
|
||||
|
@@ -115,9 +115,9 @@ If you define these options you will disable the associated feature, which can s
|
||||
* `#define NO_ACTION_ONESHOT`
|
||||
* disable one-shot modifiers
|
||||
* `#define NO_ACTION_MACRO`
|
||||
* disable old style macro handling: MACRO() & action_get_macro
|
||||
* disable old-style macro handling using `MACRO()`, `action_get_macro()` _(deprecated)_
|
||||
* `#define NO_ACTION_FUNCTION`
|
||||
* disable calling of action_function() from the fn_actions array (deprecated)
|
||||
* disable old-style function handling using `fn_actions`, `action_function()` _(deprecated)_
|
||||
|
||||
## Features That Can Be Enabled
|
||||
|
||||
@@ -317,10 +317,10 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i
|
||||
* `LAYOUTS`
|
||||
* A list of [layouts](feature_layouts.md) this keyboard supports.
|
||||
* `LINK_TIME_OPTIMIZATION_ENABLE`
|
||||
* Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled.
|
||||
It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
|
||||
* Enables Link Time Optimization (LTO) when compiling the keyboard. This makes the process take longer, but it can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable).
|
||||
However, this will automatically disable the legacy TMK Macros and Functions features, as these break when LTO is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`. (Note: This does not affect QMK [Macros](feature_macros.md) and [Layers](feature_layers.md).)
|
||||
* `LTO_ENABLE`
|
||||
* It has the same meaning as LINK_TIME_OPTIMIZATION_ENABLE. You can use `LTO_ENABLE` instead of `LINK_TIME_OPTIMIZATION_ENABLE`.
|
||||
* Has the same meaning as `LINK_TIME_OPTIMIZATION_ENABLE`. You can use `LTO_ENABLE` instead of `LINK_TIME_OPTIMIZATION_ENABLE`.
|
||||
|
||||
## AVR MCU Options
|
||||
* `MCU = atmega32u4`
|
||||
|
@@ -98,6 +98,7 @@
|
||||
* [ISP Flashing Guide](de/isp_flashing_guide.md)
|
||||
* [ARM Debugging Guide](de/arm_debugging.md)
|
||||
* [I2C Driver](de/i2c_driver.md)
|
||||
* [SPI Driver](de/spi_driver.md)
|
||||
* [GPIO Controls](de/internals_gpio_control.md)
|
||||
* [Proton C Conversion](de/proton_c_conversion.md)
|
||||
|
||||
|
@@ -98,6 +98,7 @@
|
||||
* [Guía de flasheado de ISP](es/isp_flashing_guide.md)
|
||||
* [Guía de depuración de ARM](es/arm_debugging.md)
|
||||
* [Driver I2C](es/i2c_driver.md)
|
||||
* [Driver SPI](es/spi_driver.md)
|
||||
* [Controles GPIO](es/internals_gpio_control.md)
|
||||
* [Conversión Proton C](es/proton_c_conversion.md)
|
||||
|
||||
|
@@ -160,10 +160,3 @@ As of now root of its cause is not clear but some build options seem to be relat
|
||||
|
||||
https://github.com/tmk/tmk_keyboard/issues/266
|
||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||
|
||||
|
||||
|
||||
## FLIP Doesn't Work
|
||||
### `AtLibUsbDfu.dll` Not Found
|
||||
Remove current driver and reinstall one FLIP provides from DeviceManager.
|
||||
http://imgur.com/a/bnwzy
|
||||
|
@@ -6,11 +6,11 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown
|
||||
|----------|-------------------------------|----------------------------------------------------|
|
||||
|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|
||||
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
||||
|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` |
|
||||
|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` |
|
||||
|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
||||
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
||||
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
||||
|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` |
|
||||
|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` |
|
||||
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|
||||
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|
||||
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
||||
@@ -18,7 +18,7 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown
|
||||
|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|
||||
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
|
||||
|
||||
You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress.
|
||||
You can also chain them, for example `LCTL(LALT(KC_DEL))` or `C(A(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress.
|
||||
|
||||
# Legacy Content :id=legacy-content
|
||||
|
||||
|
@@ -38,5 +38,6 @@ For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computati
|
||||
appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use.
|
||||
* eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key
|
||||
* sym_g - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE``` milliseconds of no changes has occured, all input changes are pushed.
|
||||
* sym_pk - debouncing per key. On any state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occured on that key, the key status change is pushed.
|
||||
|
||||
|
||||
|
@@ -161,11 +161,11 @@ There's also a couple of mod shortcuts you can use:
|
||||
|
||||
* `SS_LCTL(string)`
|
||||
* `SS_LSFT(string)`
|
||||
* `SS_LALT(string)`
|
||||
* `SS_LALT(string)` or `SS_LOPT(string)`
|
||||
* `SS_LGUI(string)`, `SS_LCMD(string)` or `SS_LWIN(string)`
|
||||
* `SS_RCTL(string)`
|
||||
* `SS_RSFT(string)`
|
||||
* `SS_RALT(string)` or `SS_ALGR(string)`
|
||||
* `SS_RALT(string)`, `SS_ROPT(string)` or `SS_ALGR(string)`
|
||||
* `SS_RGUI(string)`, `SS_RCMD(string)` or `SS_RWIN(string)`
|
||||
|
||||
These press the respective modifier, send the supplied string and then release the modifier.
|
||||
|
@@ -266,6 +266,25 @@ To reverse the scroll axes you can put:
|
||||
|
||||
into config.h.
|
||||
|
||||
### Rotate Mouse Axes :id=rotate-mouse-axes
|
||||
|
||||
Transform the output of the device with a clockwise rotation of 90, 180, or 270
|
||||
degrees.
|
||||
|
||||
When compensating for device orientation, rotate the output the same amount in
|
||||
the opposite direction. E.g. if the normal device orientation is considered to
|
||||
be North-facing, compensate as follows:
|
||||
|
||||
```c
|
||||
#define PS2_MOUSE_ROTATE 270 /* Compensate for East-facing device orientation. */
|
||||
```
|
||||
```c
|
||||
#define PS2_MOUSE_ROTATE 180 /* Compensate for South-facing device orientation. */
|
||||
```
|
||||
```c
|
||||
#define PS2_MOUSE_ROTATE 90 /* Compensate for West-facing device orientation. */
|
||||
```
|
||||
|
||||
### Debug Settings :id=debug-settings
|
||||
|
||||
To debug the mouse, add `debug_mouse = true` or enable via bootmagic.
|
||||
|
@@ -26,7 +26,6 @@ Compatible flashers:
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI)
|
||||
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` in QMK (recommended command line)
|
||||
* [Atmel's Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (not recommended)
|
||||
|
||||
Flashing sequence:
|
||||
|
||||
|
@@ -101,7 +101,8 @@
|
||||
* [Guide des claviers soudés à la main](fr-fr/hand_wire.md)
|
||||
* [Guide de flash de l’ISP](fr-fr/isp_flashing_guide.md)
|
||||
* [Guide du débogage ARM](fr-fr/arm_debugging.md)
|
||||
* [Drivers i2c](fr-fr/i2c_driver.md)
|
||||
* [Drivers I2C](fr-fr/i2c_driver.md)
|
||||
* [Drivers SPI](fr-fr/spi_driver.md)
|
||||
* [Contrôles des GPIO](fr-fr/internals_gpio_control.md)
|
||||
* [Conversion en Proton C](fr-fr/proton_c_conversion.md)
|
||||
|
||||
|
@@ -155,11 +155,3 @@ Pour le moment, l'origine du problème n'est pas comprise, mais certaines option
|
||||
|
||||
https://github.com/tmk/tmk_keyboard/issues/266
|
||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||
|
||||
## FLIP ne marche pas
|
||||
|
||||
### `AtLibUsbDfu.dll` Not Found
|
||||
|
||||
Supprimez le pilote actuel et réinstallez celui donné par FLIP dans le gestionnaire de périphériques.
|
||||
|
||||
http://imgur.com/a/bnwzy
|
||||
|
@@ -26,7 +26,6 @@ Méthodes de flash compatibles :
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (interface graphique recommandé)
|
||||
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` avec QMK (outil en ligne de commande recommandé)
|
||||
* [Atmel's Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (non recommandé)
|
||||
|
||||
Ordre des actions :
|
||||
|
||||
|
@@ -20,7 +20,6 @@ The "easy" way to flash the firmware is using a tool from your host OS:
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (recommended)
|
||||
* [Teensy Loader](https://www.pjrc.com/teensy/loader.html)
|
||||
* [Atmel FLIP](http://www.atmel.com/tools/flip.aspx)
|
||||
|
||||
If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.
|
||||
|
||||
|
@@ -114,6 +114,7 @@
|
||||
* [מדריך לצריבת ISP](he-il/isp_flashing_guide.md)
|
||||
* [מדריך לדיבאגינג ARM](he-il/arm_debugging.md)
|
||||
* [מנהל התקן I2C](he-il/i2c_driver.md)
|
||||
* [מנהל התקן SPI](he-il/spi_driver.md)
|
||||
* [בקרת GPIO](he-il/internals_gpio_control.md)
|
||||
* [המרת Proton C](he-il/proton_c_conversion.md)
|
||||
|
||||
|
@@ -121,6 +121,7 @@
|
||||
* [ドライバ](ja/hardware_drivers.md)
|
||||
* [ADC ドライバ](ja/adc_driver.md)
|
||||
* [I2C ドライバ](ja/i2c_driver.md)
|
||||
* [SPI ドライバ](ja/spi_driver.md)
|
||||
* [WS2812 ドライバ](ja/ws2812_driver.md)
|
||||
* [EEPROM ドライバ](ja/eeprom_driver.md)
|
||||
* [GPIO コントロール](ja/internals_gpio_control.md)
|
||||
|
@@ -152,10 +152,3 @@ https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
||||
|
||||
https://github.com/tmk/tmk_keyboard/issues/266
|
||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||
|
||||
|
||||
|
||||
## FLIP が動作しない
|
||||
### `AtLibUsbDfu.dll` が見つかりません
|
||||
デバイスマネージャから現在のドライバを削除し、FLIP が提供するものを再インストールします。
|
||||
http://imgur.com/a/bnwzy
|
||||
|
85
docs/ja/feature_advanced_keycodes.md
Normal file
85
docs/ja/feature_advanced_keycodes.md
Normal file
@@ -0,0 +1,85 @@
|
||||
# レイヤーの切り替えとトグル :id=switching-and-toggling-layers
|
||||
|
||||
<!---
|
||||
original document: 5d5ff80:docs/feature_advanced_keycodes.md
|
||||
git diff 5d5ff80 HEAD -- docs/feature_advanced_keycodes.md | cat
|
||||
-->
|
||||
|
||||
これらの機能により、様々な方法でレイヤーをアクティブ化することができます。レイヤーは一般的に独立したレイアウトでは無いことに注意してください -- 複数のレイヤーを一度にアクティブ化することができ、レイヤーが `KC_TRNS` を使ってキーの押下を下のレイヤーに渡すことが一般的です。レイヤーの詳細については、[キーマップの概要](ja/keymap.md#keymap-and-layers)を見てください。MO()、LM()、TT() あるいは LT() を使って一時的なレイヤーの切り替えを使う場合、上のレイヤーのキーを透過にするようにしてください。さもないと意図したように動作しないかもしれません。
|
||||
|
||||
* `DF(layer)` - デフォルトレイヤーを切り替えます。デフォルトレイヤーは、他のレイヤーがその上に積み重なっている、常にアクティブな基本レイヤーです。デフォルトレイヤーの詳細については以下を見てください。これは QWERTY から Dvorak レイアウトに切り替えるために使うことができます。(これは一時的な切り替えであり、キーボードの電源が切れるまでしか持続しないことに注意してください。デフォルトレイヤーを永続的に変更するには、[process_record_user](ja/custom_quantum_functions.md#programming-the-behavior-of-any-keycode) 内で `set_single_persistent_default_layer` 関数を呼び出すなど、より深いカスタマイズが必要です。)
|
||||
* `MO(layer)` - 一時的に*レイヤー*をアクティブにします。キーを放すとすぐに、レイヤーは非アクティブになります。
|
||||
* `LM(layer, mod)` - (`MO` のように)一時的に*レイヤー*をアクティブにしますが、モディファイア *mod* がアクティブな状態です。layer 0-15 と、左モディファイアのみをサポートします: `MOD_LCTL`、`MOD_LSFT`、`MOD_LALT`、`MOD_LGUI` (`KC_` の代わりに `MOD_` 定数を使うことに注意してください)。これらのモディファイアは、例えば `LM(_RAISE, MOD_LCTL | MOD_LALT)` のように、ビット単位の OR を使って組み合わせることができます。
|
||||
* `LT(layer, kc)` - ホールドされた時に*レイヤー*を一時的にアクティブにし、タップされた時に *kc* を送信します。layer 0-15 のみをサポートします。
|
||||
* `OSL(layer)` - 次のキーが押されるまで、一時的に*レイヤー*をアクティブにします。詳細と追加機能については、[ワンショットキー](ja/one_shot_keys.md)を見てください。
|
||||
* `TG(layer)` - *レイヤー*を切り替えます。非アクティブな場合はアクティブにし、逆も同様です。
|
||||
* `TO(layer)` - *レイヤー*をアクティブにし、他の全てのレイヤー(デフォルトレイヤーを除く)を非アクティブにします。この関数は特別です。1つのレイヤーをアクティブなレイヤースタックに追加/削除する代わりに、現在のアクティブなレイヤーを完全に置き換え、唯一上位のレイヤーを下位のレイヤーで置き換えることができるからです。これはキーダウンで(キーが押されるとすぐに)アクティブになります。
|
||||
* `TT(layer)` - レイヤーのタップ切り替え。キーを押したままにすると*レイヤー*がアクティブにされ、放すと非アクティブになります (`MO` 風)。繰り返しタップすると、レイヤーはオンあるいはオフを切り替えます (`TG` 風)。デフォルトでは5回のタップが必要ですが、`TAPPING_TOGGLE` を定義することで変更することができます -- 例えば、2回のタップだけで切り替えるには、`#define TAPPING_TOGGLE 2` を定義します。
|
||||
|
||||
## 注意事項
|
||||
|
||||
現在のところ、`LT()` と `MT()` は[基本的なキーコードセット](ja/keycodes_basic.md)に制限されています。つまり、`LCTL()`、`KC_TILD` あるいは `0xFF` より大きなキーコードを使うことができません。レイヤータップあるいはモッドタップのキーコードの一部として指定されたモディファイアは無視されます。タップしたキーコードにモディファイアを適用する必要がある場合は、[タップダンス](ja/feature_tap_dance.md#example-5-using-tap-dance-for-advanced-mod-tap-and-layer-tap-keys)を使うことができます。
|
||||
|
||||
さらに、モッドタップあるいはレイヤータップで少なくとも1つの右手用のモディファイアが指定された場合、指定された全てのモディファイアが右手用になるため、2つをうまく組み合わせて一致させることはできません。
|
||||
|
||||
# レイヤーの使用
|
||||
|
||||
レイヤーを切り替える時は注意してください。(キーボードを取り外さずに)そのレイヤーを非アクティブにすることができずレイヤーから移動できなくなる可能性があります。最も一般的な問題を避けるためのガイドラインを作成しました。
|
||||
|
||||
## 初心者
|
||||
|
||||
QMK を使い始めたばかりの場合は、全てを単純にしたいでしょう。レイヤーをセットアップする時は、これらのガイドラインに従ってください:
|
||||
|
||||
* デフォルトの "base" レイヤーとして、layer 0 をセットアップします。これは通常の入力レイヤーであり、任意のレイアウト (qwerty、dvorak、colemak など)にすることができます。通常はキーボードのキーのほとんどまたは全てが定義されているため、これを最下位のレイヤーとして設定することが重要です。そうすることで、もしそれが他のレイヤーの上 (つまりレイヤー番号が大きい)にある場合の影響を防ぎます。
|
||||
* layer 0 をルートとして、レイヤーを "ツリー" レイアウトに配置します。他の複数のレイヤーから同じレイヤーに行こうとしないでください。
|
||||
* 各レイヤーのキーマップでは、より高い番号のレイヤーのみを参照します。レイヤーは最大の番号(最上位)のアクティブレイヤーから処理されるため、下位レイヤーの状態を変更するのは難しくエラーが発生しやすくなります。
|
||||
|
||||
## 中級ユーザ
|
||||
|
||||
複数の基本レイヤーが必要な場合があります。例えば、QWERTY と Dvorak を切り替える場合、国ごとに異なるレイアウトを切り替える場合、あるいは異なるビデオゲームごとにレイアウトを切り替える場合などです。基本レイヤーは常に最小の番号のレイヤーである必要があります。複数の基本レイヤーがある場合、常にそれらを相互排他的に扱う必要があります。1つの基本レイヤーがオンの場合、他をオフにします。
|
||||
|
||||
## 上級ユーザ
|
||||
|
||||
レイヤーがどのように動作し、何ができるかを理解したら、より創造的になります。初心者のセクションで列挙されている規則は、幾つかの巧妙な詳細を回避するのに役立ちますが、特に超コンパクトなキーボードのユーザにとって制約になる場合があります。レイヤーの仕組みを理解することで、レイヤーをより高度な方法で使うことができます。
|
||||
|
||||
レイヤーは番号順に上に積み重なっています。キーの押下の動作を決定する時に、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) で見つけることができます。
|
||||
|
||||
# 修飾キー :id=modifier-keys
|
||||
|
||||
以下のようにキーコードとモディファイアを組み合わせることができます。押すと、モディファイアのキーダウンイベントが送信され、次に `kc` のキーダウンイベントが送信されます。放すと、`kc` のキーアップイベントが送信され、次にモディファイアのキーアップイベントが送信されます。
|
||||
|
||||
| キー | エイリアス | 説明 |
|
||||
|----------|-------------------------------|----------------------------------------------------|
|
||||
| `LCTL(kc)` | `C(kc)` | 左 Control を押しながら `kc` を押します。 |
|
||||
| `LSFT(kc)` | `S(kc)` | 左 Shift を押しながら `kc` を押します。 |
|
||||
| `LALT(kc)` | `A(kc)`, `LOPT(kc)` | 左 Alt を押しながら `kc`を押します。 |
|
||||
| `LGUI(kc)` | `G(kc)`, `LCMD(kc)`, `LWIN(kc)` | 左 GUI を押しながら `kc` を押します。 |
|
||||
| `RCTL(kc)` | | 右 Control を押しながら `kc` を押します。 |
|
||||
| `RSFT(kc)` | | 右 Shift を押しながら `kc` を押します。 |
|
||||
| `RALT(kc)` | `ROPT(kc)`, `ALGR(kc)` | 右 Alt を押しながら `kc` を押します。 |
|
||||
| `RGUI(kc)` | `RCMD(kc)`, `LWIN(kc)` | 右 GUI を押しながら `kc` を押します。 |
|
||||
| `SGUI(kc)` | `SCMD(kc)`, `SWIN(kc)` | 左 Shift と左 GUI を押しながら `kc` を押します。 |
|
||||
| `LCA(kc)` | | 左 Control と左 Alt を押しながら `kc` を押します。 |
|
||||
| `LCAG(kc)` | | 左 Control、左 Alt、左 GUI を押しながら `kc` を押します。 |
|
||||
| `MEH(kc)` | | 左 Control、左 Shift、左 Alt を押しながら `kc` を押します。 |
|
||||
| `HYPR(kc)` | | 左 Control、左 Shift、左 Alt、左 GUI を押しながら `kc` を押します。 |
|
||||
|
||||
また、それらを繋げることができます。例えば、`LCTL(LALT(KC_DEL))` は1回のキー押下で Control+Alt+Delete を送信するキーを作成します。
|
||||
|
||||
# 過去の内容
|
||||
|
||||
このページには多くの機能が含まれていました。このページを構成していた多くのセクションをそれぞれのページに移動しました。これより下は全て単なるリダイレクトであるため、web上で古いリンクをたどっている人は探しているものを見つけることができます。
|
||||
|
||||
## モッドタップ :id=mod-tap
|
||||
|
||||
* [モッドタップ](ja/mod_tap.md)
|
||||
|
||||
## ワンショットキー :id=one-shot-keys
|
||||
|
||||
* [ワンショットキー](ja/one_shot_keys.md)
|
||||
|
||||
## タップホールド設定オプション :id=tap-hold-configuration-options
|
||||
|
||||
* [タップホールド設定オプション](ja/tap_hold.md)
|
328
docs/ja/feature_audio.md
Normal file
328
docs/ja/feature_audio.md
Normal file
@@ -0,0 +1,328 @@
|
||||
# オーディオ
|
||||
|
||||
<!---
|
||||
original document: 5d5ff80:docs/feature_audio.md
|
||||
git diff 5d5ff80 HEAD -- docs/feature_audio.md | cat
|
||||
-->
|
||||
|
||||
キーボードは音を出すことができます!Planck、Preonic あるいは特定の PWM 対応ピンにアクセスできる AVR キーボードがある場合は、単純なスピーカーを接続してビープ音を鳴らすことができます。これらのビープ音を使ってレイヤーの変化、モディファイア、特殊キーを示したり、あるいは単にイカした8ビットの曲を鳴らすことができます。
|
||||
|
||||
最大2つの同時オーディオ音声がサポートされ、1つはタイマー1によってもう一つはタイマー3によって駆動されます。以下のピンは config.h の中でオーディオ出力として定義することができます:
|
||||
|
||||
Timer 1:
|
||||
`#define B5_AUDIO`
|
||||
`#define B6_AUDIO`
|
||||
`#define B7_AUDIO`
|
||||
|
||||
Timer 3:
|
||||
`#define C4_AUDIO`
|
||||
`#define C5_AUDIO`
|
||||
`#define C6_AUDIO`
|
||||
|
||||
`rules.mk` に `AUDIO_ENABLE = yes` を追加すると、他の設定無しで自動的に有効になる幾つかの異なるサウンドがあります:
|
||||
|
||||
```
|
||||
STARTUP_SONG // キーボードの起動時に再生 (audio.c)
|
||||
GOODBYE_SONG // RESET キーを押すと再生 (quantum.c)
|
||||
AG_NORM_SONG // AG_NORM キーを押すと再生 (quantum.c)
|
||||
AG_SWAP_SONG // AG_SWAP キーを押すと再生 (quantum.c)
|
||||
CG_NORM_SONG // CG_NORM キーを押すと再生 (quantum.c)
|
||||
CG_SWAP_SONG // CG_SWAP キーを押すと再生 (quantum.c)
|
||||
MUSIC_ON_SONG // 音楽モードがアクティブになると再生 (process_music.c)
|
||||
MUSIC_OFF_SONG // 音楽モードが非アクティブになると再生 (process_music.c)
|
||||
CHROMATIC_SONG // 半音階音楽モードが選択された時に再生 (process_music.c)
|
||||
GUITAR_SONG // ギター音楽モードが選択された時に再生 (process_music.c)
|
||||
VIOLIN_SONG // バイオリン音楽モードが選択された時に再生 (process_music.c)
|
||||
MAJOR_SONG // メジャー音楽モードが選択された時に再生 (process_music.c)
|
||||
```
|
||||
|
||||
`config.h` の中で以下のような操作を行うことで、デフォルトの曲を上書きすることができます:
|
||||
|
||||
```c
|
||||
#ifdef AUDIO_ENABLE
|
||||
#define STARTUP_SONG SONG(STARTUP_SOUND)
|
||||
#endif
|
||||
```
|
||||
|
||||
サウンドの完全なリストは、[quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) で見つかります - このリストに自由に追加してください!利用可能な音は [quantum/audio/musical_notes.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/musical_notes.h) で見つかります。
|
||||
|
||||
特定の時にカスタムサウンドを再生するために、以下のように曲を定義することができます(ファイルの上部付近に):
|
||||
|
||||
```c
|
||||
float my_song[][2] = SONG(QWERTY_SOUND);
|
||||
```
|
||||
|
||||
以下のように曲を再生します:
|
||||
|
||||
```c
|
||||
PLAY_SONG(my_song);
|
||||
```
|
||||
|
||||
または、以下のようにループで再生することができます:
|
||||
|
||||
```c
|
||||
PLAY_LOOP(my_song);
|
||||
```
|
||||
|
||||
オーディオがキーボードに組み込まれていない時に問題が起きる事を避けるために、`#ifdef AUDIO_ENABLE` / `#endif` で全てのオーディオ機能をくるむことをお勧めします。
|
||||
|
||||
オーディオで利用可能なキーコードは以下の通りです:
|
||||
|
||||
* `AU_ON` - オーディオ機能をオン
|
||||
* `AU_OFF` - オーディオ機能をオフ
|
||||
* `AU_TOG` - オーディオ機能を切り替え
|
||||
|
||||
!> これらのキーコードは全てのオーディオ機能をオンおよびオフにします。オフにするとオーディオフィードバック、オーディオクリック、音楽モードなどが完全に無効になります。
|
||||
|
||||
## ARM オーディオボリューム
|
||||
|
||||
ARM デバイスの場合、DAC サンプル値を調整できます。キーボードがあなたやあなたの同僚にとって騒々しい場合、`config.h` 内の `DAC_SAMPLE_MAX` を使って最大量を設定することができます:
|
||||
|
||||
```c
|
||||
#define DAC_SAMPLE_MAX 65535U
|
||||
```
|
||||
|
||||
## 音楽モード
|
||||
|
||||
音楽モードは列を半音階に、行をオクターブにマップします。これは格子配列キーボードで最適に動作しますが、他のものでも動作させることができます。`0xFF` 未満の全てのキーコードはブロックされるため、音の演奏中は入力できません - 特別なキー/mod があればそれらは引き続き動作します。これを回避するには、音楽モードを有効にする前(あるいは後)で、KC_NO を使って別のレイヤーにジャンプします。
|
||||
|
||||
メモリの問題により、録音は実験的です - 奇妙な動作が発生した場合は、キーボードの取り外しと再接続で問題が解決するでしょう。
|
||||
|
||||
利用可能なキーコード:
|
||||
|
||||
* `MU_ON` - 音楽モードをオン
|
||||
* `MU_OFF` - 音楽モードをオフ
|
||||
* `MU_TOG` - 音楽モードの切り替え
|
||||
* `MU_MOD` - 音楽モードの循環
|
||||
* `CHROMATIC_MODE` - 半音階。行はオクターブを変更します
|
||||
* `GUITAR_MODE` - 半音階、ただし行は弦を変更します (+5 階)
|
||||
* `VIOLIN_MODE` - 半音階。ただし行は弦を変換します (+7 階)
|
||||
* `MAJOR_MODE` - メージャースケール
|
||||
|
||||
音楽モードでは、以下のキーコードは動作が異なり、通過しません:
|
||||
|
||||
* `LCTL` - 録音を開始
|
||||
* `LALT` - 録音を停止/演奏を停止
|
||||
* `LGUI` - 録音を再生
|
||||
* `KC_UP` - 再生をスピードアップ
|
||||
* `KC_DOWN` - 再生をスローダウン
|
||||
|
||||
ピッチ標準 (`PITCH_STANDARD_A`) はデフォルトで 440.0f です - これを変更するには、`config.h` に以下のようなものを追加します:
|
||||
|
||||
#define PITCH_STANDARD_A 432.0f
|
||||
|
||||
音楽モードも完全に無効にすることができます。コントローラの容量が足りなくて困っている場合に役に立ちます。無効にするには、これを `config.h` に追加します:
|
||||
|
||||
#define NO_MUSIC_MODE
|
||||
|
||||
### 音楽マスク
|
||||
|
||||
デフォルトで、`MUSIC_MASK` は `keycode < 0xFF` に設定されます。これは、`0xFF` 未満のキーコードが音に変換され、何も出力しないことを意味します。`config.h` の中で以下のものを定義することで、これを変更することができます:
|
||||
|
||||
#define MUSIC_MASK keycode != KC_NO
|
||||
|
||||
これは全てのキーコードを捕捉します - これは、キーボードを再起動するまで、音楽モードで動けなくなることに注意してください!
|
||||
|
||||
どのキーコードを引き続き処理するかを制御する、より高度な方法については、`<keyboard>.c` の中の `music_mask_kb(keycode)` および `keymap.c` の中の `music_mask_user(keycode)` を使うことができます:
|
||||
|
||||
bool music_mask_user(uint16_t keycode) {
|
||||
switch (keycode) {
|
||||
case RAISE:
|
||||
case LOWER:
|
||||
return false;
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
false を返すものはマスクの一部では無く、常に処理されます。
|
||||
|
||||
### 音楽マップ
|
||||
|
||||
デフォルトでは、音楽モードはキーのスケールを決定するために列と行を使います。キーボードレイアウトに一致する長方形のマトリックスを使うキーボードの場合、これで十分です。しかし、(Planck Rev6 あるいは多くの分割キーボードなどのように)より複雑なマトリックスを使うキーボードの場合、非常に歪んだ感じを受けることになります。
|
||||
|
||||
しかしながら、音楽マップオプションにより、音楽モードのためにスケーリングを再マップすることができるため、レイアウトに一致し、より自然になります。
|
||||
|
||||
この機能を使うには、`#define MUSIC_MAP` を `config.h` ファイルに追加します。そして、`キーボードの名前.c` または `keymap.c` に `uint8_t music_map` を追加します。
|
||||
|
||||
```c
|
||||
const uint8_t music_map[MATRIX_ROWS][MATRIX_COLS] = LAYOUT_ortho_4x12(
|
||||
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
|
||||
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
|
||||
12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
|
||||
);
|
||||
```
|
||||
|
||||
キーボードが使用する `LAYOUT` マクロも使用したいでしょう。これは正しいキーの位置にマップします。キーボードレイアウトの左下から開始し、右に移動してさらに上に移動します。完全なマトリックスができるまで、全てのエントリを入力します。
|
||||
|
||||
これを実装する方法の例として、[Planck Keyboard](https://github.com/qmk/qmk_firmware/blob/e9ace1487887c1f8b4a7e8e6d87c322988bec9ce/keyboards/planck/planck.c#L24-L29) を見ることができます。
|
||||
|
||||
## オーディオクリック
|
||||
|
||||
これは、ボタンを押すたびにクリック音を追加し、キーボードからのクリック音をシミュレートします。キーを押すたびにわずかに音が異なるため、すばやく入力しても長い単一の音のようには聞こえません。
|
||||
|
||||
* `CK_TOGG` - ステータスを切り替えます (有効にされた場合、音を再生します)
|
||||
* `CK_ON` - オーディオクリックをオンにします (音を再生します)
|
||||
* `CK_OFF` - オーディオクリックをオフにします (音を再生しません)
|
||||
* `CK_RST` - 周波数をデフォルトの状態に再設定します (デフォルトの周波数で音を再生します)
|
||||
* `CK_UP` - クリック音の周波数を増やします (新しい周波数で音を再生します)
|
||||
* `CK_DOWN` - クリック音の周波数を減らします (新しい周波数で音を再生します)
|
||||
|
||||
|
||||
容量を節約するためにデフォルトではこの機能は無効です。有効にするには、`config.h` に以下を追加します:
|
||||
|
||||
#define AUDIO_CLICKY
|
||||
|
||||
|
||||
これらの値を定義することで、デフォルト、最小および最大周波数、ステッピングおよび組み込みのランダム性を設定することができます:
|
||||
|
||||
| オプション | デフォルト値 | 説明 |
|
||||
|--------|---------------|-------------|
|
||||
| `AUDIO_CLICKY_FREQ_DEFAULT` | 440.0f | クリック音のデフォルト/開始音の周波数を設定します。 |
|
||||
| `AUDIO_CLICKY_FREQ_MIN` | 65.0f | 最小周波数を設定します (60f 未満は少しバグがあります)。 |
|
||||
| `AUDIO_CLICKY_FREQ_MAX` | 1500.0f | 最大周波数を設定します。高すぎると同僚があなたを攻撃する可能性があります。 |
|
||||
| `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f | UP/DOWN キーコードのステップを設定します。これは掛け算の係数です。デフォルトでは、音楽のマイナーの1/3ずつ、周波数を上げ/下げします。 |
|
||||
| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | クリックのランダム性の係数を設定します。これを `0f` に設定すると各クリックが同一になり、`1.0f` に設定するとこの音は90年代のコンピュータ画面のスクロール/タイピングの効果があります。 |
|
||||
| `AUDIO_CLICKY_DELAY_DURATION` | 1 | 1がテンポの 1/16、または64分音符である整数音符の長さ (実装の詳細については、`quantum/audio/musical_notes.h` を見てください)。メインのクリック効果は、この時間だけ遅れます。これらを6-12前後の値に調整すると、うるさいスイッチの補正に役立ちます。 |
|
||||
|
||||
|
||||
|
||||
|
||||
## MIDI 機能
|
||||
|
||||
これはまだ WIP ですが、何が起きているかを見るために、`quantum/process_keycode/process_midi.c` を調べてください。Makefile から有効にします。
|
||||
|
||||
|
||||
## オーディオキーコード
|
||||
|
||||
| キー | エイリアス | 説明 |
|
||||
|----------------|---------|----------------------------------|
|
||||
| `AU_ON` | | オーディオモードオン |
|
||||
| `AU_OFF` | | オーディオモードオフ |
|
||||
| `AU_TOG` | | オーディオモードを切り替えます |
|
||||
| `CLICKY_TOGGLE` | `CK_TOGG` | オーディオクリックモードを切り替えます |
|
||||
| `CLICKY_UP` | `CK_UP` | クリック音の周波数を増やします |
|
||||
| `CLICKY_DOWN` | `CK_DOWN` | クリック音の周波数を減らします |
|
||||
| `CLICKY_RESET` | `CK_RST` | 周波数をデフォルトに再設定します |
|
||||
| `MU_ON` | | 音楽モードをオンにします |
|
||||
| `MU_OFF` | | 音楽モードをオフにします |
|
||||
| `MU_TOG` | | 音楽モードを切り替えます |
|
||||
| `MU_MOD` | | 音楽モードを循環します |
|
||||
|
||||
<!-- FIXME: this formatting needs work
|
||||
|
||||
## Audio
|
||||
|
||||
```c
|
||||
#ifdef AUDIO_ENABLE
|
||||
AU_ON,
|
||||
AU_OFF,
|
||||
AU_TOG,
|
||||
|
||||
#ifdef FAUXCLICKY_ENABLE
|
||||
FC_ON,
|
||||
FC_OFF,
|
||||
FC_TOG,
|
||||
#endif
|
||||
|
||||
// Music mode on/off/toggle
|
||||
MU_ON,
|
||||
MU_OFF,
|
||||
MU_TOG,
|
||||
|
||||
// Music voice iterate
|
||||
MUV_IN,
|
||||
MUV_DE,
|
||||
#endif
|
||||
```
|
||||
|
||||
### Midi
|
||||
|
||||
#if !MIDI_ENABLE_STRICT || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
|
||||
MI_ON, // send midi notes when music mode is enabled
|
||||
MI_OFF, // don't send midi notes when music mode is enabled
|
||||
#endif
|
||||
|
||||
MIDI_TONE_MIN,
|
||||
MIDI_TONE_MAX
|
||||
|
||||
MI_C = MIDI_TONE_MIN,
|
||||
MI_Cs,
|
||||
MI_Db = MI_Cs,
|
||||
MI_D,
|
||||
MI_Ds,
|
||||
MI_Eb = MI_Ds,
|
||||
MI_E,
|
||||
MI_F,
|
||||
MI_Fs,
|
||||
MI_Gb = MI_Fs,
|
||||
MI_G,
|
||||
MI_Gs,
|
||||
MI_Ab = MI_Gs,
|
||||
MI_A,
|
||||
MI_As,
|
||||
MI_Bb = MI_As,
|
||||
MI_B,
|
||||
|
||||
MIDI_TONE_KEYCODE_OCTAVES > 1
|
||||
|
||||
where x = 1-5:
|
||||
MI_C_x,
|
||||
MI_Cs_x,
|
||||
MI_Db_x = MI_Cs_x,
|
||||
MI_D_x,
|
||||
MI_Ds_x,
|
||||
MI_Eb_x = MI_Ds_x,
|
||||
MI_E_x,
|
||||
MI_F_x,
|
||||
MI_Fs_x,
|
||||
MI_Gb_x = MI_Fs_x,
|
||||
MI_G_x,
|
||||
MI_Gs_x,
|
||||
MI_Ab_x = MI_Gs_x,
|
||||
MI_A_x,
|
||||
MI_As_x,
|
||||
MI_Bb_x = MI_As_x,
|
||||
MI_B_x,
|
||||
|
||||
MI_OCT_Nx 1-2
|
||||
MI_OCT_x 0-7
|
||||
MIDI_OCTAVE_MIN = MI_OCT_N2,
|
||||
MIDI_OCTAVE_MAX = MI_OCT_7,
|
||||
MI_OCTD, // octave down
|
||||
MI_OCTU, // octave up
|
||||
|
||||
MI_TRNS_Nx 1-6
|
||||
MI_TRNS_x 0-6
|
||||
MIDI_TRANSPOSE_MIN = MI_TRNS_N6,
|
||||
MIDI_TRANSPOSE_MAX = MI_TRNS_6,
|
||||
MI_TRNSD, // transpose down
|
||||
MI_TRNSU, // transpose up
|
||||
|
||||
MI_VEL_x 1-10
|
||||
MIDI_VELOCITY_MIN = MI_VEL_1,
|
||||
MIDI_VELOCITY_MAX = MI_VEL_9,
|
||||
MI_VELD, // velocity down
|
||||
MI_VELU, // velocity up
|
||||
|
||||
MI_CHx 1-16
|
||||
MIDI_CHANNEL_MIN = MI_CH1
|
||||
MIDI_CHANNEL_MAX = MI_CH16,
|
||||
MI_CHD, // previous channel
|
||||
MI_CHU, // next channel
|
||||
|
||||
MI_ALLOFF, // all notes off
|
||||
|
||||
MI_SUS, // sustain
|
||||
MI_PORT, // portamento
|
||||
MI_SOST, // sostenuto
|
||||
MI_SOFT, // soft pedal
|
||||
MI_LEG, // legato
|
||||
|
||||
MI_MOD, // modulation
|
||||
MI_MODSD, // decrease modulation speed
|
||||
MI_MODSU, // increase modulation speed
|
||||
#endif // MIDI_ADVANCED
|
||||
|
||||
-->
|
135
docs/ja/feature_auto_shift.md
Normal file
135
docs/ja/feature_auto_shift.md
Normal file
@@ -0,0 +1,135 @@
|
||||
# 自動シフト: なぜシフトキーが必要ですか?
|
||||
|
||||
<!---
|
||||
original document: 5d5ff80:docs/feature_auto_shift.md
|
||||
git diff 5d5ff80 HEAD -- docs/feature_auto_shift.md | cat
|
||||
-->
|
||||
|
||||
キーをタップすると、その文字を取得します。キーをタップするが、*わずかに*長く押し続けると、シフト状態になります。ほら!シフトキーは必要ありません!
|
||||
|
||||
## なぜ自動シフトなのですか?
|
||||
|
||||
多くの人が腱鞘炎などの症状に苦しんでいます。一般的な原因は、指を繰り返し長い距離を伸ばすことです。私たちはキーボード上でシフトキーに手を伸ばすためにあまりにも頻繁に小指を伸ばします。自動シフトキーはそれを軽減しようとしています。
|
||||
|
||||
## どのように動作しますか?
|
||||
|
||||
キーをタップする時に、キーを放す前にほんの短い間押したままにします。この押したままにする時間は全ての人にとって異なる長さです。自動シフトは、定数 `AUTO_SHIFT_TIMEOUT` を定義し、これは普段の押された状態の時間の2倍に通常は設定されます。タイマーは、キーを押す時に開始され、キーを放す時に止まります。押された時間が `AUTO_SHIFT_TIMEOUT` 以上の場合に、キーのシフトバージョンが発行されます。時間が `AUTO_SHIFT_TIMEOUT` 時間よりも短い場合は、通常の状態が発行されます。
|
||||
|
||||
## 自動シフトには制限がありますか?
|
||||
|
||||
残念ながらあります。
|
||||
|
||||
1. キーリピートが動作しなくなります。例えば、20個の 'a' 文字が必要な場合、'a' キーを1、2秒押し続けるかもしれません。オペレーティングシステムに押されたキーの状態を発行する代わりに押された時間を計るので、自動シフトでは動作しません。
|
||||
2. シフトをするつもりがない時にシフトされた文字を取得し、シフトしたい時にそうではない他の文字を取得するでしょう。これは結局は練習になります。急いでいる時は、シフトされたバージョンのために十分長くキーを押したと思うかもしれませんが、そうではありませんでした。一方、キーをタップしていると思うかもしれませんが、実際には予想よりも少し長い間押していました。
|
||||
|
||||
## どうやって自動シフトを有効にしますか?
|
||||
|
||||
キーマップフォルダの `rules.mk` に追加します:
|
||||
|
||||
AUTO_SHIFT_ENABLE = yes
|
||||
|
||||
`rules.mk` が存在しない場合、それを作成することができます。
|
||||
|
||||
そして自動シフトキーを有効にした新しいファームウェアをコンパイルしてインストールします!以上です!
|
||||
|
||||
## モディファイア
|
||||
|
||||
デフォルトで、1つ以上のモディファイアと一緒にキーが押されると自動シフトは無効になります。従って、本当に長い間 Ctrl+A を保持しても、Ctrl+Shift+A と同じではありません。
|
||||
|
||||
`config.h` に定義を追加することで、モディファイアの自動シフトを再度有効にすることができます
|
||||
|
||||
```c
|
||||
#define AUTO_SHIFT_MODIFIERS
|
||||
```
|
||||
|
||||
この場合、`AUTO_SHIFT_TIMEOUT` を超えて押された Ctrl+A は Ctrl+Shift+A として送信されます
|
||||
|
||||
|
||||
## 自動シフトの設定
|
||||
|
||||
必要に応じて、自動シフトの挙動を変更することができる幾つかの設定があります。キーマップフォルダにある `config.h` に様々な変数を設定することで行われます。`config.h` ファイルが存在しない場合、それを作成することができます。
|
||||
|
||||
例
|
||||
|
||||
```c
|
||||
#pragma once
|
||||
|
||||
#define AUTO_SHIFT_TIMEOUT 150
|
||||
#define NO_AUTO_SHIFT_SPECIAL
|
||||
```
|
||||
|
||||
### AUTO_SHIFT_TIMEOUT (単位: ミリ秒)
|
||||
|
||||
これは、シフトされた状態を取得するためにどれだけ長くキーを押し続けなければならないかを制御します。
|
||||
明らかにこれは人によって異なります。一般的な人にとって、135 から 150 の設定がうまく機能します。ただし、少なくとも 175 の値から開始する必要があります。これはデフォルト値です。その後、ここから下げていきます。間違って検出することなくシフトされた状態を取得するのに必要な、最も短い時間を得るという考え方です。
|
||||
|
||||
完璧に動作するまで、いろいろな値を試してみます。多くの人は、全てが所定の値で適切に動作するものの、時々、1つあるいは2つのキーがシフト状態を発行することが分かるでしょう。これは単に習慣と、幾つかのキーを他のキーよりも少し長く押し続けることによるものです。この値を見つけたら、問題のキーを通常よりも少し早くタップするとともに、その値を設定します。
|
||||
|
||||
?> 自動シフトには、この値を素早く取得するのに役立つ3つの特別なキーがあります。詳細は「自動シフトのセットアップ」を見てください!
|
||||
|
||||
### NO_AUTO_SHIFT_SPECIAL (単純にこのように定義します)
|
||||
|
||||
-\_, =+, [{, ]}, ;:, '", ,<, .> および /? を含む特殊キーを自動シフトしません
|
||||
|
||||
### NO_AUTO_SHIFT_NUMERIC (単純にこのように定義します)
|
||||
|
||||
0から9までの数字キーを自動シフトしません。
|
||||
|
||||
### NO_AUTO_SHIFT_ALPHA (単純にこのように定義します)
|
||||
|
||||
AからZを含むアルファベット文字を自動シフトしません。
|
||||
|
||||
## 自動シフトセットアップの使用
|
||||
|
||||
これにより、`AUTO_SHIFT_TIMEOUT` で設定している時間を一時的に増減させたり報告するために、3つのキーを定義することができます。
|
||||
|
||||
### セットアップ
|
||||
|
||||
3つのキーを一時的にキーマップにマップします:
|
||||
|
||||
| キー名 | 説明 |
|
||||
|----------|-----------------------------------------------------|
|
||||
| KC_ASDN | 自動シフトタイムアウト変数を下げる |
|
||||
| KC_ASUP | 自動シフトタイムアウト変数を上げる |
|
||||
| KC_ASRP | 現在の自動シフトタイムアウト値を報告する |
|
||||
| KC_ASON | 自動シフト機能をオンにする |
|
||||
| KC_ASOFF | 自動シフト機能をオフにする |
|
||||
| KC_ASTG | 自動シフト機能の状態を切り替える |
|
||||
|
||||
新しいファームウェアをコンパイルしてアップロードします。
|
||||
|
||||
### 使い方
|
||||
|
||||
これらのテスト中は、完全に普段通り入力する必要があり、意図的にシフトされたキーを使わずに入力するように注意する必要があります。
|
||||
|
||||
1. アルファベットの複数の文を入力します。
|
||||
2. 大文字に注意してください。
|
||||
3. 大文字が存在しない場合は、自動シフトタイムアウト値を減らすために `KC_ASDN` にマップしたキーを押し、ステップ1に戻ります。
|
||||
4. 大文字が幾つかある場合は、押す時間を短くしてこれらのキーをタップする必要があるか、あるいはタイムアウトを増やす必要があるかを決定します。
|
||||
5. タイムアウトを増やすことに決めた場合は、`KC_ASUP` にマップしたキーを押し、ステップ1に戻ります。
|
||||
6. 結果に満足したら、`KC_ASRP` にマップしたキーを押します。キーボードは `AUTO_SHIFT_TIMEOUT` の値を自動的に入力します。
|
||||
7. 報告された値で `config.h` の `AUTO_SHIFT_TIMEOUT` を更新します。
|
||||
8. `config.h` から `AUTO_SHIFT_SETUP` を削除します。
|
||||
9. `KC_ASDN`、`KC_ASUP` および `KC_ASRP` のキーバインディングを削除します。
|
||||
10. 新しいファームウェアをコンパイルしてアップロードします。
|
||||
|
||||
#### 実行例
|
||||
|
||||
hello world. my name is john doe. i am a computer programmer playing with
|
||||
keyboards right now.
|
||||
|
||||
[KC_ASDN を何度か押します]
|
||||
|
||||
heLLo woRLd. mY nAMe is JOHn dOE. i AM A compUTeR proGRaMMER PlAYiNG witH
|
||||
KEYboArDS RiGHT NOw.
|
||||
|
||||
[KC_ASUP を数回押します]
|
||||
|
||||
hello world. my name is john Doe. i am a computer programmer playing with
|
||||
keyboarDs right now.
|
||||
|
||||
[KC_ASRPを押します]
|
||||
|
||||
115
|
||||
|
||||
キーボードは現在の `AUTO_SHIFT_TIMEOUT` 値を表す `115` を入力しました。これで設定が完了しました!テスト中に現れる *D* キーを少し練習してください。それで完璧です。
|
253
docs/ja/feature_backlight.md
Normal file
253
docs/ja/feature_backlight.md
Normal file
@@ -0,0 +1,253 @@
|
||||
# バックライト
|
||||
|
||||
<!---
|
||||
original document: 5d5ff80:docs/feature_backlight.md
|
||||
git diff 5d5ff80 HEAD -- docs/feature_backlight.md | cat
|
||||
-->
|
||||
|
||||
多くのキーボードは、キースイッチを貫通して配置されたり、キースイッチの下に配置された個々の LED によって、バックライトキーをサポートします。この機能は通常スイッチごとに単一の色しか使用できないため、[RGB アンダーグロー](ja/feature_rgblight.md)および [RGB マトリックス](ja/feature_rgb_matrix.md)機能のどちらとも異なりますが、キーボードに複数の異なる単一色の LED を取り付けることは当然可能です。
|
||||
|
||||
QMK は *パルス幅変調*(*Pulse Width Modulation*) すなわち PWM として知られている技術で急速にオンおよびオフを切り替えることで、これらの LED の輝度を制御できます。PWM 信号のデューティサイクルを変えることで、調光の錯覚を起こすことができます。
|
||||
|
||||
MCU は、GPIO ピンにはそんなに電流を供給できません。MCU から直接バックライトに給電せずに、バックライトピンは LED への電力を切り替えるトランジスタあるいは MOSFET に接続されます。
|
||||
|
||||
## 機能の設定
|
||||
|
||||
ほとんどのキーボードではバックライトをサポートしている場合にデフォルトで有効になっていますが、もし機能しない場合は `rules.mk` が以下を含んでいることを確認してください:
|
||||
|
||||
```makefile
|
||||
BACKLIGHT_ENABLE = yes
|
||||
```
|
||||
|
||||
## キーコード
|
||||
有効にすると、以下のキーコードを使ってバックライトレベルを変更することができます。
|
||||
|
||||
| キー | 説明 |
|
||||
|---------|------------------------------------------|
|
||||
| `BL_TOGG` | バックライトをオンあるいはオフにする |
|
||||
| `BL_STEP` | バックライトレベルを循環する |
|
||||
| `BL_ON` | バックライトを最大輝度に設定する |
|
||||
| `BL_OFF` | バックライトをオフにする |
|
||||
| `BL_INC` | バックライトレベルを上げる |
|
||||
| `BL_DEC` | バックライトレベルを下げる |
|
||||
| `BL_BRTG` | バックライトの明滅動作を切り替える |
|
||||
|
||||
## バックライト関数群
|
||||
|
||||
| 関数 | 説明 |
|
||||
|----------|-----------------------------------------------------------|
|
||||
| `backlight_toggle()` | バックライトをオンあるいはオフにする |
|
||||
| `backlight_enable()` | バックライトをオンにする |
|
||||
| `backlight_disable()` | バックライトをオフにする |
|
||||
| `backlight_step()` | バックライトレベルを循環する |
|
||||
| `backlight_increase()` | バックライトレベルを上げる |
|
||||
| `backlight_decrease()` | バックライトレベルを下げる |
|
||||
| `backlight_level(x)` | バックライトのレベルを特定のレベルに設定する |
|
||||
| `get_backlight_level()` | 現在のバックライトレベルを返す |
|
||||
| `is_backlight_enabled()` | バックライトが現在オンかどうかを返す |
|
||||
|
||||
### バックライトの明滅動作の関数群
|
||||
|
||||
| 関数 | 説明 |
|
||||
|----------|---------------------------------------------------|
|
||||
| `breathing_toggle()` | バックライトの明滅動作をオンまたはオフにする |
|
||||
| `breathing_enable()` | バックライトの明滅動作をオンにする |
|
||||
| `breathing_disable()` | バックライトの明滅動作をオフにする |
|
||||
|
||||
## ドライバの設定
|
||||
|
||||
どのドライバを使うかを選択するには、以下を使って `rules.mk` を設定します:
|
||||
|
||||
```makefile
|
||||
BACKLIGHT_DRIVER = software # 有効なドライバの値は 'pwm,software,no' です
|
||||
```
|
||||
|
||||
各ドライバについてのヘルプは以下を見てください。
|
||||
|
||||
## 共通のドライバ設定
|
||||
|
||||
バックライトの挙動を変更するには、`config.h` の中で以下の `#define` をします:
|
||||
|
||||
| 定義 | デフォルト | 説明 |
|
||||
|---------------------|-------------|--------------------------------------------------------------------------------------|
|
||||
| `BACKLIGHT_LEVELS` | `3` | 輝度のレベルの数 (オフを除いて最大 31) |
|
||||
| `BACKLIGHT_CAPS_LOCK` | *定義なし* | バックライトを使って Caps Lock のインジケータを有効にする (専用 LED の無いキーボードのため) |
|
||||
| `BACKLIGHT_BREATHING` | *定義なし* | サポートされる場合は、バックライトの明滅動作を有効にする |
|
||||
| `BREATHING_PERIOD` | `6` | 各バックライトの "明滅" の長さ(秒) |
|
||||
| `BACKLIGHT_ON_STATE` | `0` | バックライトが "オン" の時のバックライトピンの状態 - high の場合は `1`、low の場合は `0` |
|
||||
|
||||
### バックライトオン状態
|
||||
|
||||
ほとんどのバックライトの回路は N チャンネルの MOSFET あるいは NPN トランジスタによって駆動されます。これは、トランジスタを*オン*にして LED を点灯させるには、ゲートまたはベースに接続されているバックライトピンを *high* に駆動する必要があることを意味します。
|
||||
ただし、P チャンネルの MOSFET あるいは PNP トランジスタが使われる場合があります。この場合、トランジスタがオンの時、ピンは代わりに *low* で駆動されます。
|
||||
|
||||
この機能は `BACKLIGHT_ON_STATE` 定義することでキーボードレベルで設定されます。
|
||||
|
||||
## AVR ドライバ
|
||||
|
||||
AVR ボードでは、デフォルトのドライバは現在のところ最善のシナリオを選択するために構成を探っています。ドライバはデフォルトで設定されますが、rules.mk 内の同等の設定は以下の通りです:
|
||||
```makefile
|
||||
BACKLIGHT_DRIVER = pwm
|
||||
```
|
||||
|
||||
### 注意事項
|
||||
|
||||
ハードウェア PWM は以下の表に従ってサポートされます:
|
||||
|
||||
| バックライトピン | AT90USB64/128 | ATmega16/32U4 | ATmega16/32U2 | ATmega32A | ATmega328P |
|
||||
|-------------|-------------|-------------|-------------|---------|----------|
|
||||
| `B1` | | | | | Timer 1 |
|
||||
| `B2` | | | | | Timer 1 |
|
||||
| `B5` | Timer 1 | Timer 1 | | | |
|
||||
| `B6` | Timer 1 | Timer 1 | | | |
|
||||
| `B7` | Timer 1 | Timer 1 | Timer 1 | | |
|
||||
| `C4` | Timer 3 | | | | |
|
||||
| `C5` | Timer 3 | | Timer 1 | | |
|
||||
| `C6` | Timer 3 | Timer 3 | Timer 1 | | |
|
||||
| `D4` | | | | Timer 1 | |
|
||||
| `D5` | | | | Timer 1 | |
|
||||
|
||||
他の全てのピンはソフトウェア PWM を使います。[オーディオ](ja/feature_audio.md)機能が無効あるいは1つのタイマだけを使っている場合は、ハードウェアタイマによってバックライト PWM を引き起こすことができます:
|
||||
|
||||
| オーディオピン | オーディオタイマ | ソフトウェア PWM タイマ |
|
||||
|---------|-----------|------------------|
|
||||
| `C4` | Timer 3 | Timer 1 |
|
||||
| `C5` | Timer 3 | Timer 1 |
|
||||
| `C6` | Timer 3 | Timer 1 |
|
||||
| `B5` | Timer 1 | Timer 3 |
|
||||
| `B6` | Timer 1 | Timer 3 |
|
||||
| `B7` | Timer 1 | Timer 3 |
|
||||
|
||||
両方のタイマーがオーディオのために使われている場合、バックライト PWM はハードウェアタイマを使いませんが、代わりにマトリックススキャンの間に引き起こされます。この場合、PWM の計算は十分なタイミングの精度で呼ばれないかもしれないため、バックライトの明滅はサポートされず、バックライトもちらつくかもしれません。
|
||||
|
||||
### AVR 設定
|
||||
|
||||
バックライトの挙動を変更するには、`config.h` の中で以下の `#define` をします:
|
||||
|
||||
| 定義 | デフォルト | 説明 |
|
||||
|---------------------|-------------|--------------------------------------------------------------------------------------------------------------|
|
||||
| `BACKLIGHT_PIN` | `B7` | LED を制御するピン。自身のキーボードを設計している場合を除き、これを変更する必要はないはずです |
|
||||
| `BACKLIGHT_PINS` | *定義なし* | 実験的: 詳細は以下を見てください |
|
||||
| `BACKLIGHT_LEVELS` | `3` | 輝度のレベルの数 (オフを除いて最大 31) |
|
||||
| `BACKLIGHT_CAPS_LOCK` | *定義なし* | バックライトを使って Caps Lock のインジケータを有効にする (専用 LED の無いキーボードのため) |
|
||||
| `BACKLIGHT_BREATHING` | *定義なし* | サポートされる場合は、バックライトの明滅動作を有効にする |
|
||||
| `BREATHING_PERIOD` | `6` | 各バックライトの "明滅" の長さ(秒) |
|
||||
| `BACKLIGHT_ON_STATE` | `1` | バックライトが "オン" の時のバックライトピンの状態 - high の場合は `1`、low の場合は `0` |
|
||||
|
||||
### バックライトオン状態
|
||||
|
||||
ほとんどのバックライトの回路は N チャンネルの MOSFET あるいは NPN トランジスタによって駆動されます。これは、トランジスタを*オン*にして LED を点灯させるには、ゲートまたはベースに接続されているバックライトピンを *high* に駆動する必要があることを意味します。
|
||||
ただし、P チャンネルの MOSFET あるいは PNP トランジスタが使われる場合があります。この場合、トランジスタがオンの時、ピンは代わりに *low* で駆動されます。
|
||||
|
||||
この機能は `BACKLIGHT_ON_STATE` 定義することでキーボードレベルで設定されます。
|
||||
|
||||
### 複数のバックライトピン
|
||||
|
||||
ほとんどのキーボードは、全てのバックライト LED を制御するたった1つのバックライトピンを持ちます (特にバックライトがハードウェア PWM ピンに接続されている場合)。
|
||||
ソフトウェア PWM では、複数のバックライトピンを定義することができます。これらすべてのピンは PWM デューティサイクル時に同時にオンおよびオフになります。
|
||||
この機能により、例えば Caps Lock LED (またはその他の制御可能な LED) の輝度を、バックライトの他の LED と同じレベルに設定することができます。Caps Lock の代わりに LCTRL をマップしていて、Caps Lock がオンの時に Caps Lock LED をアクティブにする代わりにバックライトの一部にする必要がある場合に便利です。
|
||||
|
||||
複数のバックライトピンをアクティブにするには、`config.h` に次のようなものを追加する必要があります:
|
||||
|
||||
```c
|
||||
#define BACKLIGHT_LED_COUNT 2
|
||||
#undef BACKLIGHT_PIN
|
||||
#define BACKLIGHT_PINS { F5, B2 }
|
||||
```
|
||||
|
||||
### ハードウェア PWM 実装
|
||||
|
||||
バックライト用にサポートされているピンを使う場合、QMK は PWM 信号を出力するように設定されたハードウェアタイマを使います。タイマーは 0 にリセットする前に `ICRx` (デフォルトでは `0xFFFF`) までカウントします。
|
||||
希望の輝度が計算され、`OCRxx` レジスタ内に格納されます。カウンタがこの値まで達すると、バックライトピンは low になり、カウンタがリセットされると再び high になります。
|
||||
このように `OCRxx` は基本的に LED のデューティサイクル、従って輝度を制御します。`0x0000` は完全にオフで、 `0xFFFF` は完全にオンです。
|
||||
|
||||
明滅動作の効果はカウンタがリセットされる(秒間あたりおよそ244回)たびに呼び出される `TIMER1_OVF_vect` の割り込みハンドラを登録することで可能になります。
|
||||
このハンドラ内で、増分カウンタの値が事前に計算された輝度曲線にマップされます。明滅動作をオフにするには、割り込みを単純に禁止し、輝度を EEPROM に格納されているレベルに再設定します。
|
||||
|
||||
### タイマーにアシストされた PWM 実装
|
||||
|
||||
`BACKLIGHT_PIN` がハードウェアバックライトピンに設定されていない場合、QMK はソフトウェア割り込みを引き起こすように設定されているハードウェアタイマを使います。タイマーは 0 にリセットする前に `ICRx` (デフォルトでは `0xFFFF`) までカウントします。
|
||||
0 に再設定すると、CPU は LED をオンにする OVF (オーバーフロー)割り込みを発火し、デューティサイクルを開始します。
|
||||
希望の輝度が計算され、`OCRxx` レジスタ内に格納されます。カウンタがこの値に達すると、CPU は比較出力一致割り込みを発火し、LED をオフにします。
|
||||
このように `OCRxx` は基本的に LED のデューティサイクル、従って輝度を制御します。 `0x0000` は完全にオフで、 `0xFFFF` は完全にオンです。
|
||||
|
||||
明滅の効果はハードウェア PWM 実装と同じです。
|
||||
|
||||
## ARM ドライバ
|
||||
|
||||
まだ初期段階ですが、ARM バックライトサポートは最終的に AVR と同等の機能を持つことを目指しています。ドライバはデフォルトで設定されますが、rules.mk 内の同等の設定は以下の通りです:
|
||||
```makefile
|
||||
BACKLIGHT_DRIVER = pwm
|
||||
```
|
||||
|
||||
### 注意事項
|
||||
|
||||
現在のところ、ハードウェア PWM のみがサポートされ、タイマーはアシストされず、自動設定は提供されません。
|
||||
|
||||
?> STMF072 のバックライトサポートのテストは制限されています。人によって違うかもしれません。不明な場合は、rules.mk で `BACKLIGHT_ENABLE = no` を設定します。
|
||||
|
||||
### ARM 設定
|
||||
|
||||
バックライトの挙動を変更するには、`config.h` の中で以下の `#define` をします:
|
||||
|
||||
| 定義 | デフォルト | 説明 |
|
||||
|------------------------|-------------|-------------------------------------------------------------------------------------------------------------|
|
||||
| `BACKLIGHT_PIN` | `B7` | LED を制御するピン。自身のキーボードを設計している場合を除き、これを変更する必要はないはずです |
|
||||
| `BACKLIGHT_PWM_DRIVER` | `PWMD4` | 使用する PWM ドライバ。ピンから PWM タイマへのマッピングについては、ST データシートを見てください。自身のキーボードを設計している場合を除き、これを変更する必要はないはずです |
|
||||
| `BACKLIGHT_PWM_CHANNEL` | `3` | 使用する PWM チャンネル。ピンから PWM チャンネルへのマッピングについては、ST データシートを見てください。自身のキーボードを設計している場合を除き、これを変更する必要はないはずです |
|
||||
| `BACKLIGHT_PAL_MODE` | `2` | 使用するピンの代替機能。ピンの AF マッピングについては ST データシートを見てください。自身のキーボードを設計している場合を除き、これを変更する必要はないはずです |
|
||||
|
||||
## Software PWM Driver :id=software-pwm-driver
|
||||
|
||||
他のキーボードのタスクを実行中に PWM をエミュレートすることにより、追加のプラットフォーム設定なしで最大のハードウェア互換性を提供します。トレードオフは、キーボードが忙しい時にバックライトが揺れる可能性があることです。有効にするには、rules.mk に以下を追加します:
|
||||
```makefile
|
||||
BACKLIGHT_DRIVER = software
|
||||
```
|
||||
|
||||
### ソフトウェア PWM 設定
|
||||
|
||||
バックライトの挙動を変更するには、`config.h` の中で以下の `#define` をします:
|
||||
|
||||
| 定義 | デフォルト | 説明 |
|
||||
|-----------------|-------------|-------------------------------------------------------------------------------------------------------------|
|
||||
| `BACKLIGHT_PIN` | `B7` | LED を制御するピン。自身のキーボードを設計している場合を除き、これを変更する必要はないはずです |
|
||||
| `BACKLIGHT_PINS` | *定義なし* | 実験的: 詳細は以下を見てください |
|
||||
|
||||
### 複数のバックライトピン
|
||||
|
||||
ほとんどのキーボードは、全てのバックライト LED を制御するたった1つのバックライトピンを持ちます (特にバックライトがハードウェア PWM ピンに接続されている場合)。
|
||||
ソフトウェア PWM では、複数のバックライトピンを定義することができます。これらすべてのピンは PWM デューティサイクル時に同時にオンおよびオフになります。
|
||||
この機能により、例えば Caps Lock LED (またはその他の制御可能な LED) の輝度を、バックライトの他の LED と同じレベルに設定することができます。Caps Lock の代わりに LCTRL をマップしていて、Caps Lock がオンの時に Caps Lock LED をアクティブにする代わりにバックライトの一部にする必要がある場合に便利です。
|
||||
|
||||
複数のバックライトピンをアクティブにするには、`config.h` に次のようなものを追加する必要があります:
|
||||
|
||||
```c
|
||||
#undef BACKLIGHT_PIN
|
||||
#define BACKLIGHT_PINS { F5, B2 }
|
||||
```
|
||||
|
||||
## カスタムドライバ
|
||||
|
||||
有効にするには、rules.mk に以下を追加します:
|
||||
|
||||
```makefile
|
||||
BACKLIGHT_DRIVER = custom
|
||||
```
|
||||
|
||||
カスタムドライバ API を実装する場合、提供されるキーボードフックは以下の通りです:
|
||||
|
||||
```c
|
||||
void backlight_init_ports(void) {
|
||||
// オプション - 起動時に実行されます
|
||||
// - 通常、ここでピンを設定します
|
||||
}
|
||||
void backlight_set(uint8_t level) {
|
||||
// オプション - レベルの変更時に実行されます
|
||||
// - 通常、ここで新しい値に応答します
|
||||
}
|
||||
|
||||
void backlight_task(void) {
|
||||
// オプション - 定期的に実行されます
|
||||
// - ここで長時間実行されるアクションはパフォーマンスの問題を引き起こします
|
||||
}
|
||||
```
|
52
docs/ja/feature_bluetooth.md
Normal file
52
docs/ja/feature_bluetooth.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# Bluetooth
|
||||
|
||||
<!---
|
||||
original document: 5d5ff80:docs/feature_bluetooth.md
|
||||
git diff 5d5ff80 HEAD -- docs/feature_bluetooth.md | cat
|
||||
-->
|
||||
|
||||
## Bluetooth の既知のサポートハードウェア
|
||||
|
||||
現在のところ Bluetooth のサポートは AVR ベースのチップに限られます。Bluetooth 2.1 については、QMK は RN-42 モジュールと、Bluefruit EZ-Key をサポートしますが、後者はもう生産されていません。より最近の BLE プロトコルについては、現在のところ Adafruit Bluefruit SPI Friend のみが直接サポートされています。iOS デバイスに接続するには、BLE が必要です。iOS はマウス入力をサポートしないことに注意してください。
|
||||
|
||||
| ボード | Bluetooth プロトコル | 接続タイプ | rules.mk | Bluetooth チップ |
|
||||
|----------------------------------------------------------------|----------------------------|----------------|---------------------------|--------------|
|
||||
| [Adafruit EZ-Key HID](https://www.adafruit.com/product/1535) | Bluetooth Classic | UART | `BLUETOOTH = AdafruitEZKey` | |
|
||||
| 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 |
|
||||
|
||||
まだサポートされていませんが、可能性のあるもの:
|
||||
* [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479)。[tmk 実装がおそらく見つかります](https://github.com/tmk/tmk_keyboard/issues/514)
|
||||
* RN-42 ファームウェアが書き込まれた HC-05 ボード。どちらも明らかに CSR BC417 チップを使っています。RN-42 ファームウェアを使って書き込むと、HID 機能が提供されます。
|
||||
* Sparkfun Bluetooth Mate
|
||||
* HM-13 ベースのボード
|
||||
|
||||
### Adafruit BLE SPI Friend
|
||||
現在のところ QMK によってサポートされている唯一の bluetooth チップセットは、Adafruit Bluefruit SPI Friend です。Adafruit のカスタムファームウェアを実行する Nordic nRF5182 ベースのチップです。データは Hardware SPI を介した Adafruit の SDEP を使って転送されます。[Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) は Adafruit ファームウェアを搭載した Nordic BLE チップに SPI 経由で接続された AVR mcu であるため、サポートされます。SPI friend を使ってカスタムボードを構築する場合、32u4 feather が使用するピン選択を使うのが最も簡単ですが、以下の定義で config.h オプションでピンを変更することができます:
|
||||
* #define AdafruitBleResetPin D4
|
||||
* #define AdafruitBleCSPin B4
|
||||
* #define AdafruitBleIRQPin E6
|
||||
|
||||
Bluefruit UART friend は SPI friend に変換することができますが、これにはMDBT40 チップへの直接の再書き込みとはんだ付けが[必要です](https://github.com/qmk/qmk_firmware/issues/2274)。
|
||||
|
||||
## Adafruit EZ-Key hid
|
||||
これには[ハードウェアの変更](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts)が必要ですが、Makefile を使って有効にすることができます。ファームウェアは引き続き USB 経由で文字を出力するため、コンピュータ経由で充電する場合は注意してください。任意にオフにするために Bluefruit 上にスイッチを持つことは理にかなっています。
|
||||
|
||||
|
||||
<!-- FIXME: Document bluetooth support more completely. -->
|
||||
## Bluetooth の Rules.mk オプション
|
||||
これらのうちの1つだけを使ってください
|
||||
* BLUETOOTH_ENABLE = yes (レガシーオプション)
|
||||
* BLUETOOTH = RN42
|
||||
* BLUETOOTH = AdafruitEZKey
|
||||
* BLUETOOTH = AdafruitBLE
|
||||
|
||||
## Bluetooth キーコード
|
||||
|
||||
これは複数のキーボードの出力が選択できる場合に使われます。現在のところ、これは USB と Bluetooth の両方をサポートするキーボードで、それらの間の切り替えのみが可能です。
|
||||
|
||||
| 名前 | 説明 |
|
||||
|----------|----------------------------------------------|
|
||||
| `OUT_AUTO` | USB と Bluetooth を自動的に切り替える |
|
||||
| `OUT_USB` | USB のみ |
|
||||
| `OUT_BT` | Bluetooth のみ |
|
171
docs/ja/feature_bootmagic.md
Normal file
171
docs/ja/feature_bootmagic.md
Normal file
@@ -0,0 +1,171 @@
|
||||
# ブートマジック
|
||||
|
||||
<!---
|
||||
original document: 5d5ff80:docs/feature_bootmagic.md
|
||||
git diff 5d5ff80 HEAD -- docs/feature_bootmagic.md | cat
|
||||
-->
|
||||
|
||||
再書き込みせずにキーボードの挙動を変更することができる、3つの独立した関連する機能があります。それぞれは似たような機能を持ちますが、キーボードがどのように設定されているかによって異なる方法でアクセスされます。
|
||||
|
||||
**ブートマジック**は初期化の間にキーボードを設定するためのシステムです。ブートマジックコマンドを起動するには、ブートマジックキーと1つ以上のコマンドキーを押し続けます。
|
||||
|
||||
**ブートマジックキーコード** は前に `MAGIC_` が付いており、キーボードが初期化された*後で*ブートマジックの機能にアクセスすることができます。キーコードを使うには、他のキーコードと同じようにそれらをキーマップに割り当てます。
|
||||
|
||||
以前は**マジック**として知られていた**コマンド**は、キーボードの異なる側面を制御することができる別の機能です。ブートマジックと一部の機能を共有しますが、コンソールにバージョン情報を出力するような、ブートマジックにはできないこともできます。詳細は、[コマンド](ja/feature_command.md)を見てください。
|
||||
|
||||
一部のキーボードでは、ブートマジックはデフォルトで無効になっています。その場合、`rules.mk` 内で以下のように明示的に有効にする必要があります:
|
||||
|
||||
```make
|
||||
BOOTMAGIC_ENABLE = full
|
||||
```
|
||||
|
||||
?> `full` の代わりに `yes` が使われていることがあるかもしれませんが、これは問題ありません。ただし、`yes` は非推奨で、理想的には `full` (あるいは`lite`) が使われるべきです。
|
||||
|
||||
さらに、以下を `rules.mk` ファイルに追加することで、[ブートマジックライト](#bootmagic-lite) (スケールダウンした、とても基本的なバージョンのブートマジック)を使うことができます:
|
||||
|
||||
```make
|
||||
BOOTMAGIC_ENABLE = lite
|
||||
```
|
||||
|
||||
## ホットキー
|
||||
|
||||
キーボードを接続しながら、ブートマジックキー(デフォルトはスペース)と目的のホットキーを押します。例えば、スペースと `B` を押したままにすると、ブートローダに入ります。
|
||||
|
||||
| ホットキー | 説明 |
|
||||
|------------------|---------------------------------------------|
|
||||
| エスケープ | EEPROM のブートマジック設定を無視する |
|
||||
| `B` | ブートローダに入る |
|
||||
| `D` | シリアルを介するデバッグ出力の切り替え |
|
||||
| `X` | キーマトリックスのデバッグ出力の切り替え |
|
||||
| `K` | キーボードのデバッグの切り替え |
|
||||
| `M` | マウスのデバッグの切り替え |
|
||||
| `L` | EE_HANDS 左右設定に、"左手"を設定 |
|
||||
| `R` | EE_HANDS 左右設定に、"右手"を設定 |
|
||||
| Backspace | EEPROM をクリア |
|
||||
| Caps Lock | Caps Lock を左コントロールとして扱うかを切り替え |
|
||||
| 左 Control | Caps Lock と左コントロールの入れ替えを切り替え |
|
||||
| 左 Alt | 左 Alt と左 GUI の入れ替えを切り替え |
|
||||
| 右 Alt | 右 Alt と右 GUI の入れ替えを切り替え |
|
||||
| 左 GUI | GUI キーの有効・無効を切り替え (ゲームの時に便利です) |
|
||||
| <code>`</code> | <code>`</code> とエスケープの入れ替えを切り替え |
|
||||
| `\` | `\` とバックスペースの入れ替えを切り替え |
|
||||
| `N` | N キーロールオーバー (NKRO) の有効・無効を切り替え |
|
||||
| `0` | レイヤー 0 をデフォルトレイヤーにする |
|
||||
| `1` | レイヤー 1 をデフォルトレイヤーにする |
|
||||
| `2` | レイヤー 2 をデフォルトレイヤーにする |
|
||||
| `3` | レイヤー 3 をデフォルトレイヤーにする |
|
||||
| `4` | レイヤー 4 をデフォルトレイヤーにする |
|
||||
| `5` | レイヤー 5 をデフォルトレイヤーにする |
|
||||
| `6` | レイヤー 6 をデフォルトレイヤーにする |
|
||||
| `7` | レイヤー 7 をデフォルトレイヤーにする |
|
||||
|
||||
## キーコード :id=keycodes
|
||||
|
||||
| キー | エイリアス | 説明 |
|
||||
|----------------------------------|---------|--------------------------------------------------------------------------|
|
||||
| `MAGIC_SWAP_CONTROL_CAPSLOCK` | `CL_SWAP` | Caps Lock と左コントロールの入れ替え |
|
||||
| `MAGIC_UNSWAP_CONTROL_CAPSLOCK` | `CL_NORM` | Caps Lock と左コントロールの入れ替えの解除 |
|
||||
| `MAGIC_CAPSLOCK_TO_CONTROL` | `CL_CTRL` | Caps Lock をコントロールとして扱う |
|
||||
| `MAGIC_UNCAPSLOCK_TO_CONTROL` | `CL_CAPS` | Caps Lock をコントロールとして扱うことを止める |
|
||||
| `MAGIC_SWAP_LCTL_LGUI` | `LCG_SWP` | 左コントロールと GUI の入れ替え |
|
||||
| `MAGIC_UNSWAP_LCTL_LGUI` | `LCG_NRM` | 左コントロールと GUI の入れ替えを解除 |
|
||||
| `MAGIC_SWAP_RCTL_RGUI` | `RCG_SWP` | 右コントロールと GUI の入れ替え |
|
||||
| `MAGIC_UNSWAP_RCTL_RGUI` | `RCG_NRM` | 右コントロールと GUI の入れ替えを解除 |
|
||||
| `MAGIC_SWAP_CTL_GUI` | `CG_SWAP` | 両側のコントロールと GUI の入れ替え |
|
||||
| `MAGIC_UNSWAP_CTL_GUI` | `CG_NORM` | 両側のコントロールと GUI の入れ替えを解除 |
|
||||
| `MAGIC_TOGGLE_CTL_GUI` | `CG_TOGG` | 両側のコントロールと GUI の入れ替えの切り替え |
|
||||
| `MAGIC_SWAP_LALT_LGUI` | `LAG_SWP` | 左 Alt と GUI の入れ替え |
|
||||
| `MAGIC_UNSWAP_LALT_LGUI` | `LAG_NRM` | 左 Alt と GUI の入れ替えを解除 |
|
||||
| `MAGIC_SWAP_RALT_RGUI` | `RAG_SWP` | 右 Alt と GUI の入れ替え |
|
||||
| `MAGIC_UNSWAP_RALT_RGUI` | `RAG_NRM` | 右 Alt と GUI の入れ替えを解除 |
|
||||
| `MAGIC_SWAP_ALT_GUI` | `AG_SWAP` | 両側の Alt と GUI の入れ替え |
|
||||
| `MAGIC_UNSWAP_ALT_GUI` | `AG_NORM` | 両側の Alt と GUI の入れ替えを解除 |
|
||||
| `MAGIC_TOGGLE_ALT_GUI` | `AG_TOGG` | 両側の Alt と GUI の入れ替えの切り替え |
|
||||
| `MAGIC_NO_GUI` | `GUI_OFF` | GUI キーを無効にする |
|
||||
| `MAGIC_UNNO_GUI` | `GUI_ON` | GUI キーを有効にする |
|
||||
| `MAGIC_SWAP_GRAVE_ESC` | `GE_SWAP` | <code>`</code> とエスケープの入れ替え |
|
||||
| `MAGIC_UNSWAP_GRAVE_ESC` | `GE_NORM` | <code>`</code> とエスケープの入れ替えを解除 |
|
||||
| `MAGIC_SWAP_BACKSLASH_BACKSPACE` | `BS_SWAP` | `\` とバックスペースを入れ替え |
|
||||
| `MAGIC_UNSWAP_BACKSLASH_BACKSPACE` | `BS_NORM` | `\` とバックスペースの入れ替えを解除する |
|
||||
| `MAGIC_HOST_NKRO` | `NK_ON` | N キーロールオーバーを有効にする |
|
||||
| `MAGIC_UNHOST_NKRO` | `NK_OFF` | N キーロールオーバーを無効にする |
|
||||
| `MAGIC_TOGGLE_NKRO` | `NK_TOGG` | N キーロールオーバーの有効・無効を切り替え |
|
||||
| `MAGIC_EE_HANDS_LEFT` | `EH_LEFT` | 分割キーボードのマスター側を左手に設定(`EE_HANDS` 用) |
|
||||
| `MAGIC_EE_HANDS_RIGHT` | `EH_RGHT` | 分割キーボードのマスター側を右手に設定(`EE_HANDS` 用) |
|
||||
|
||||
## 設定
|
||||
|
||||
ブートマジックのためのホットキーの割り当てを変更したい場合は、キーボードあるいはキーマップレベルのどちらかで、`config.h` にこれらを `#define` します。
|
||||
|
||||
| 定義 | デフォルト | 説明 |
|
||||
|----------------------------------------|-------------|---------------------------------------------------|
|
||||
| `BOOTMAGIC_KEY_SALT` | `KC_SPACE` | ブートマジックキー |
|
||||
| `BOOTMAGIC_KEY_SKIP` | `KC_ESC` | EEPROM のブートマジック設定を無視する |
|
||||
| `BOOTMAGIC_KEY_EEPROM_CLEAR` | `KC_BSPACE` | EEPROM 設定をクリアする |
|
||||
| `BOOTMAGIC_KEY_BOOTLOADER` | `KC_B` | ブートローダに入る |
|
||||
| `BOOTMAGIC_KEY_DEBUG_ENABLE` | `KC_D` | シリアルを介するデバッグ出力の切り替え |
|
||||
| `BOOTMAGIC_KEY_DEBUG_MATRIX` | `KC_X` | マトリックスのデバッグを切り替え |
|
||||
| `BOOTMAGIC_KEY_DEBUG_KEYBOARD` | `KC_K` | キーボードのデバッグの切り替え |
|
||||
| `BOOTMAGIC_KEY_DEBUG_MOUSE` | `KC_M` | マウスのデバッグの切り替え |
|
||||
| `BOOTMAGIC_KEY_EE_HANDS_LEFT` | `KC_L` | EE_HANDS 左右設定に、"左手"を設定 |
|
||||
| `BOOTMAGIC_KEY_EE_HANDS_RIGHT` | `KC_R` | EE_HANDS 左右設定に、"右手"を設定 |
|
||||
| `BOOTMAGIC_KEY_SWAP_CONTROL_CAPSLOCK` | `KC_LCTRL` | 左コントロールと Caps Lock の入れ替え |
|
||||
| `BOOTMAGIC_KEY_CAPSLOCK_TO_CONTROL` | `KC_CAPSLOCK` | Caps Lock を左コントロールとして扱うかを切り替え |
|
||||
| `BOOTMAGIC_KEY_SWAP_LALT_LGUI` | `KC_LALT` | 左 Alt と左 GUI の入れ替えを切り替え (macOS 用) |
|
||||
| `BOOTMAGIC_KEY_SWAP_RALT_RGUI` | `KC_RALT` | 右 Alt と右 GUI の入れ替えを切り替え (macOS 用) |
|
||||
| `BOOTMAGIC_KEY_NO_GUI` | `KC_LGUI` | GUI キーの有効・無効を切り替え (ゲームの時に便利です) |
|
||||
| `BOOTMAGIC_KEY_SWAP_GRAVE_ESC` | `KC_GRAVE` | <code>`</code> とエスケープの入れ替えを切り替え |
|
||||
| `BOOTMAGIC_KEY_SWAP_BACKSLASH_BACKSPACE` | `KC_BSLASH` | `\` とバックスペースの入れ替えを切り替え |
|
||||
| `BOOTMAGIC_HOST_NKRO` | `KC_N` | N キーロールオーバー (NKRO) の有効・無効を切り替え |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_0` | `KC_0` | レイヤー 0 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_1` | `KC_1` | レイヤー 1 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_2` | `KC_2` | レイヤー 2 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_3` | `KC_3` | レイヤー 3 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_4` | `KC_4` | レイヤー 4 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_5` | `KC_5` | レイヤー 5 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_6` | `KC_6` | レイヤー 6 をデフォルトレイヤーにする |
|
||||
| `BOOTMAGIC_KEY_DEFAULT_LAYER_7` | `KC_7` | レイヤー 7 をデフォルトレイヤーにする |
|
||||
|
||||
# ブートマジックライト :id=bootmagic-lite
|
||||
|
||||
本格的なブートマジック機能の他に、ブートローダへのジャンプのみを処理するブートマジックライトがあります。これは、物理的なリセットボタンが無くブートローダにジャンプする方法が必要だが、ブートマジックが引き起こす問題を扱いたくないキーボードに適しています。
|
||||
|
||||
ブートマジックのこのバージョンを有効にするには、以下を使って `rules.mk` で有効にする必要があります:
|
||||
|
||||
```make
|
||||
BOOTMAGIC_ENABLE = lite
|
||||
```
|
||||
|
||||
さらに、どのキーを使うかを指定したほうが良いかもしれません。これは普通ではないマトリックスを持つキーボードで特に便利です。そのためには、使いたいキーの行と列を指定する必要があります。`config.h` ファイルにこれらのエントリを追加します:
|
||||
|
||||
```c
|
||||
#define BOOTMAGIC_LITE_ROW 0
|
||||
#define BOOTMAGIC_LITE_COLUMN 1
|
||||
```
|
||||
|
||||
デフォルトでは、これらは 0 と 0 に設定されます。これは通常はほとんどのキーボードで "ESC" キーです。
|
||||
|
||||
ブートローダを起動するには、キーボードを接続する時にこのキーを押し続けます。たった1つのキーです。
|
||||
|
||||
!> ブートマジックライトを使用すると、EEPROM を**常にリセットします**。つまり保存された全ての設定は失われます。
|
||||
|
||||
## 高度なブートマジックライト
|
||||
|
||||
`bootmagic_lite` 関数は必要に応じてコード内で置き換えることができるように、弱く定義されています。これの良い例は Zeal60 キーボードで、追加の処理が必要です。
|
||||
|
||||
関数を置き換えるには、以下のようなものをコードに追加するだけです:
|
||||
|
||||
```c
|
||||
void bootmagic_lite(void) {
|
||||
matrix_scan();
|
||||
wait_ms(DEBOUNCE * 2);
|
||||
matrix_scan();
|
||||
|
||||
if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) {
|
||||
// ブートローダにジャンプする。
|
||||
bootloader_jump();
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
追加の機能をここに追加することができます。例えば、eeprom のリセットやブートマジックを起動するために押す必要がある追加のキーです。`bootmagic_lite` はファームウェア内で大部分の機能が初期化される前に呼ばれることに注意してください。
|
108
docs/ja/feature_combo.md
Normal file
108
docs/ja/feature_combo.md
Normal file
@@ -0,0 +1,108 @@
|
||||
# コンボ
|
||||
|
||||
<!---
|
||||
original document: 0.8.94:docs/feature_combo.md
|
||||
git diff 0.8.94 HEAD -- docs/feature_combo.md | cat
|
||||
-->
|
||||
|
||||
コンボ機能は、同時押し方式でのカスタムアクション追加機能です。同時に複数のキーを押して、異なる効果を生み出すことができます。例えば、タッピング時間内で `A` と `S` を押すと、代わりに `ESC` が押されます。もっと複雑なタスクを実行させることもできます。
|
||||
|
||||
この機能を有効にするには、`rules.mk` に `COMBO_ENABLE = yes` を追加する必要があります。
|
||||
|
||||
さらに、使用するコンボの数を `config.h` の中で、`#define COMBO_COUNT 1` (1を使用するコンボの数で置き換えます)と書いて、指定する必要があります。
|
||||
<!-- At this time, this is necessary -->
|
||||
|
||||
また、デフォルトでは、コンボのタッピング時間は `TAPPING_TERM` と同じ値に設定されます (ほとんどのキーボードではデフォルトで 200)。ただし、`config.h` で定義することにより異なる値を指定することができます。例えば: `#define COMBO_TERM 300` はコンボのためのタイムアウト時間を 300ms に設定します。
|
||||
|
||||
次に、`keymap.c` ファイルに、`COMBO_END` で終了するキーのシーケンス、およびキーの組み合わせを列挙する構造体、その結果のアクションを定義する必要があります。
|
||||
|
||||
```c
|
||||
const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
|
||||
```
|
||||
|
||||
これは、A と B のキーを押した場合に、"Escape" を送信します。
|
||||
|
||||
!> このメソッドは[基本的なキーコード](ja/keycodes_basic.md)のみをサポートします。詳細な制御については例を見てください。
|
||||
|
||||
## 例
|
||||
|
||||
リストを追加したい場合は、以下のようなものを使います:
|
||||
|
||||
```c
|
||||
enum combos {
|
||||
AB_ESC,
|
||||
JK_TAB
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[AB_ESC] = COMBO(ab_combo, KC_ESC),
|
||||
[JK_TAB] = COMBO(jk_combo, KC_TAB)
|
||||
};
|
||||
```
|
||||
|
||||
より複雑な実装として、カスタム処理を追加するために `process_combo_event` 関数を使うことができます。
|
||||
|
||||
```c
|
||||
enum combo_events {
|
||||
ZC_COPY,
|
||||
XV_PASTE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||
const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END};
|
||||
|
||||
combo_t key_combos[COMBO_COUNT] = {
|
||||
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||
[XV_PASTE] = COMBO_ACTION(paste_combo),
|
||||
};
|
||||
|
||||
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||
switch(combo_index) {
|
||||
case ZC_COPY:
|
||||
if (pressed) {
|
||||
tap_code16(LCTL(KC_C));
|
||||
}
|
||||
break;
|
||||
case XV_PASTE:
|
||||
if (pressed) {
|
||||
tap_code16(LCTL(KC_V));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
これは、Z と C を押すと Ctrl+C を送信し、X と V を押すと Ctrl+V を送信します。これを変更して、レイヤーの変更、サウンドの再生、設定の変更などを行うこともできます。
|
||||
|
||||
## 追加の設定
|
||||
|
||||
長いコンボあるいはさらに長いコンボを使っている場合、構造体があなたのしていることに対応するのに十分な大きさで無いかもしれないため、問題が発生するかもしれません。
|
||||
|
||||
この場合、`config.h` ファイルに `#define EXTRA_LONG_COMBOS` または `#define EXTRA_EXTRA_LONG_COMBOS` のどちらかを追加することができます。
|
||||
|
||||
`COMBO_ALLOW_ACTION_KEYS` を定義することでアクションキーを有効にすることもできます。
|
||||
|
||||
## キーコード
|
||||
|
||||
その場でコンボ機能を有効、無効および切り替えすることができます。ゲームなどで、一時的にそれらを無効にする必要がある場合に便利です。
|
||||
|
||||
| キーコード | 説明 |
|
||||
|----------|---------------------------------|
|
||||
| `CMB_ON` | コンボ機能をオンにします |
|
||||
| `CMB_OFF` | コンボ機能をオフにします |
|
||||
| `CMB_TOG` | コンボ機能のオンとオフを切り替えます |
|
||||
|
||||
## ユーザコールバック
|
||||
|
||||
キーコードに加えて、状態を設定または状態をチェックするために使うことができる幾つかの関数があります:
|
||||
|
||||
| 関数 | 説明 |
|
||||
|-----------|--------------------------------------------------------------------|
|
||||
| `combo_enable()` | コンボ機能を有効にします |
|
||||
| `combo_disable()` | コンボ機能を無効にし、コンボバッファをクリアします |
|
||||
| `combo_toggle()` | コンボ機能の状態を切り替えます |
|
||||
| `is_combo_enabled()` | コンボ機能の状態(true か false)を返します |
|
56
docs/ja/feature_command.md
Normal file
56
docs/ja/feature_command.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# コマンド
|
||||
|
||||
<!---
|
||||
original document: 0.8.94:docs/feature_command.md
|
||||
git diff 0.8.94 HEAD -- docs/feature_command.md | cat
|
||||
-->
|
||||
|
||||
コマンド(旧称:マジック)は、ファームウェアを書き込んだり、[ブートマジック](ja/feature_bootmagic.md)を使うためにプラグを抜いたりすることなくキーボードの挙動を変更する方法です。この機能と[ブートマジックキーコード](feature_bootmagic.md#keycodes)には多くの重複があります。可能な限り、コマンドでは無くブートマジックキーコードの機能を使うことをお勧めします。
|
||||
|
||||
一部のキーボードではコマンドがデフォルトで無効になっています。その場合、`rules.mk` 内で明示的に有効にする必要があります:
|
||||
|
||||
```make
|
||||
COMMAND_ENABLE = yes
|
||||
```
|
||||
|
||||
## 使用法
|
||||
|
||||
コマンドを使うには、`IS_COMMAND()` マクロで定義されたキーの組み合わせを押し続けます。デフォルトでは、これは「左Shift + 右Shift」です。次に、目的のコマンドに対応するキーを押します。例えば、現在の QMK バージョンを QMK Toolbox コンソールに出力するには、「左Shift + 右Shift + `V`」を押します。
|
||||
|
||||
## 設定
|
||||
|
||||
コマンドのためのキーの割り当てを変更したい場合は、キーボードあるいはキーマップレベルのどちらかで、`config.h` にこれらを `#define` します。ここで割り当てる全てのキーコードは `KC_` 接頭辞を省略する必要があります。
|
||||
|
||||
| 定義 | デフォルト | 説明 |
|
||||
|------------------------------------|--------------------------------|------------------------------------------------|
|
||||
| `IS_COMMAND()` | `(get_mods() == MOD_MASK_SHIFT)` | コマンドをアクティブにするキーの組み合わせ |
|
||||
| `MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` | `true` | ファンクション行を使ってデフォルトレイヤーを設定 |
|
||||
| `MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` | `true` | 数字キーでデフォルトレイヤーを設定 |
|
||||
| `MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM` | `false` | `MAGIC_KEY_LAYER0..9` を使ってデフォルトレイヤーを設定 |
|
||||
| `MAGIC_KEY_DEBUG` | `D` | シリアルを介するデバッグの切り替え |
|
||||
| `MAGIC_KEY_DEBUG_MATRIX` | `X` | キーマトリックスのデバッグの切り替え |
|
||||
| `MAGIC_KEY_DEBUG_KBD` | `K` | キーボードのデバッグの切り替え |
|
||||
| `MAGIC_KEY_DEBUG_MOUSE` | `M` | マウスのデバッグの切り替え |
|
||||
| `MAGIC_KEY_CONSOLE` | `C` | コマンドコンソールを有効にする |
|
||||
| `MAGIC_KEY_VERSION` | `V` | コンソールに実行中の QMK バージョンを出力 |
|
||||
| `MAGIC_KEY_STATUS` | `S` | コンソールに現在のキーボードの状態を出力 |
|
||||
| `MAGIC_KEY_HELP` | `H` | コンソールにコマンドのヘルプを出力 |
|
||||
| `MAGIC_KEY_HELP_ALT` | `SLASH` | コンソールにコマンドのヘルプを出力 (代替) |
|
||||
| `MAGIC_KEY_LAYER0` | `0` | レイヤー 0 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER0_ALT` | `GRAVE` | レイヤー 0 をデフォルトレイヤーにする (代替) |
|
||||
| `MAGIC_KEY_LAYER1` | `1` | レイヤー 1 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER2` | `2` | レイヤー 2 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER3` | `3` | レイヤー 3 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER4` | `4` | レイヤー 4 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER5` | `5` | レイヤー 5 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER6` | `6` | レイヤー 6 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER7` | `7` | レイヤー 7 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER8` | `8` | レイヤー 8 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_LAYER9` | `9` | レイヤー 9 をデフォルトレイヤーにする |
|
||||
| `MAGIC_KEY_BOOTLOADER` | `B` | ブートローダにジャンプする |
|
||||
| `MAGIC_KEY_BOOTLOADER_ALT` | `ESC` | ブートローダにジャンプする (代替) |
|
||||
| `MAGIC_KEY_LOCK` | `CAPS` | 何も入力できないようにキーボードをロック |
|
||||
| `MAGIC_KEY_EEPROM` | `E` | 保存された EEPROM 設定をコンソールに出力 |
|
||||
| `MAGIC_KEY_EEPROM_CLEAR` | `BSPACE` | EEPROM をクリア |
|
||||
| `MAGIC_KEY_NKRO` | `N` | N キーロールオーバー (NKRO) の有効・無効を切り替え |
|
||||
| `MAGIC_KEY_SLEEP_LED` | `Z` | コンピュータがスリープの時に LED を切り替え |
|
95
docs/ja/feature_dip_switch.md
Normal file
95
docs/ja/feature_dip_switch.md
Normal file
@@ -0,0 +1,95 @@
|
||||
# DIP スイッチ
|
||||
|
||||
<!---
|
||||
original document: 0.8.94:docs/feature_dip_switch.md
|
||||
git diff 0.8.94 HEAD -- docs/feature_dip_switch.md | cat
|
||||
-->
|
||||
|
||||
DIP スイッチは、以下を `rules.mk` に追加することでサポートされます:
|
||||
|
||||
DIP_SWITCH_ENABLE = yes
|
||||
|
||||
さらに、以下を `config.h` に追加します:
|
||||
|
||||
```c
|
||||
#define DIP_SWITCH_PINS { B14, A15, A10, B9 }
|
||||
```
|
||||
|
||||
## コールバック
|
||||
|
||||
コールバック関数を `<keyboard>.c` に記述することができます:
|
||||
|
||||
```c
|
||||
void dip_switch_update_kb(uint8_t index, bool active) {
|
||||
dip_switch_update_user(index, active);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
あるいは `keymap.c` に記述することもできます:
|
||||
|
||||
```c
|
||||
void dip_switch_update_user(uint8_t index, bool active) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
if(active) { audio_on(); } else { audio_off(); }
|
||||
break;
|
||||
case 1:
|
||||
if(active) { clicky_on(); } else { clicky_off(); }
|
||||
break;
|
||||
case 2:
|
||||
if(active) { music_on(); } else { music_off(); }
|
||||
break;
|
||||
case 3:
|
||||
if (active) {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(plover_song);
|
||||
#endif
|
||||
layer_on(_PLOVER);
|
||||
} else {
|
||||
#ifdef AUDIO_ENABLE
|
||||
PLAY_SONG(plover_gb_song);
|
||||
#endif
|
||||
layer_off(_PLOVER);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
更に、より複雑な処理ができるビットマスク関数をサポートします。
|
||||
|
||||
|
||||
```c
|
||||
void dip_switch_update_mask_kb(uint32_t state) {
|
||||
dip_switch_update_mask_user(state);
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
あるいは `keymap.c` に記述することもできます:
|
||||
|
||||
```c
|
||||
void dip_switch_update_mask_user(uint32_t state) {
|
||||
if (state & (1UL<<0) && state & (1UL<<1)) {
|
||||
layer_on(_ADJUST); // C on esc
|
||||
} else {
|
||||
layer_off(_ADJUST);
|
||||
}
|
||||
if (state & (1UL<<0)) {
|
||||
layer_on(_TEST_A); // A on ESC
|
||||
} else {
|
||||
layer_off(_TEST_A);
|
||||
}
|
||||
if (state & (1UL<<1)) {
|
||||
layer_on(_TEST_B); // B on esc
|
||||
} else {
|
||||
layer_off(_TEST_B);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## ハードウェア
|
||||
|
||||
DIP スイッチの片側は MCU のピンへ直接配線し、もう一方の側はグラウンドに配線する必要があります。機能的に同じであるため、どちら側がどちらに接続されているかは問題にはならないはずです。
|
81
docs/ja/feature_encoders.md
Normal file
81
docs/ja/feature_encoders.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# エンコーダ
|
||||
|
||||
<!---
|
||||
original document: 0.8.123:docs/feature_encoders.md
|
||||
git diff 0.8.123 HEAD -- docs/feature_encoders.md | cat
|
||||
-->
|
||||
|
||||
以下を `rules.mk` に追加することで基本的なエンコーダがサポートされます:
|
||||
|
||||
```make
|
||||
ENCODER_ENABLE = yes
|
||||
```
|
||||
|
||||
さらに、以下を `config.h` に追加します:
|
||||
|
||||
```c
|
||||
#define ENCODERS_PAD_A { B12 }
|
||||
#define ENCODERS_PAD_B { B13 }
|
||||
```
|
||||
|
||||
各 PAD_A/B 変数は配列を定義するため、複数のエンコーダを定義することができます。例えば:
|
||||
|
||||
```c
|
||||
#define ENCODERS_PAD_A { encoder1a, encoder2a }
|
||||
#define ENCODERS_PAD_B { encoder1b, encoder2b }
|
||||
```
|
||||
|
||||
エンコーダの時計回りの方向が間違っている場合は、A と B のパッド定義を交換することができます。define を使って逆にすることもできます:
|
||||
|
||||
```c
|
||||
#define ENCODER_DIRECTION_FLIP
|
||||
```
|
||||
|
||||
さらに、解像度を同じファイルで指定することができます (デフォルトかつお勧めは4):
|
||||
|
||||
```c
|
||||
#define ENCODER_RESOLUTION 4
|
||||
```
|
||||
|
||||
## 分割キーボード
|
||||
|
||||
分割キーボードのそれぞれの側のエンコーダに異なるピン配列を使っている場合、右側のピン配列を以下のように定義することができます:
|
||||
|
||||
```c
|
||||
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
|
||||
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
|
||||
```
|
||||
|
||||
## コールバック
|
||||
|
||||
コールバック関数を `<keyboard>.c` に記述することができます:
|
||||
|
||||
```c
|
||||
void encoder_update_kb(uint8_t index, bool clockwise) {
|
||||
encoder_update_user(index, clockwise);
|
||||
}
|
||||
```
|
||||
|
||||
あるいは `keymap.c` に記述することもできます:
|
||||
|
||||
```c
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_PGDN);
|
||||
} else {
|
||||
tap_code(KC_PGUP);
|
||||
}
|
||||
} else if (index == 1) { /* Second encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_DOWN);
|
||||
} else {
|
||||
tap_code(KC_UP);
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## ハードウェア
|
||||
|
||||
エンコーダの A と B の線は MCU に直接配線し、C/common 線はグランドに配線する必要があります。
|
@@ -31,7 +31,6 @@ BOOTLOADER = atmel-dfu
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
|
||||
* QMK の [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` (推奨のコマンドライン)
|
||||
* [Atmel の Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (非推奨)
|
||||
|
||||
書き込み手順:
|
||||
|
||||
|
@@ -25,7 +25,6 @@ Vagrant 以外に、適切なプロバイダがインストールされ、その
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (推奨)
|
||||
* [Teensy ローダー](https://www.pjrc.com/teensy/loader.html)
|
||||
* [Atmel FLIP](http://www.atmel.com/tools/flip.aspx)
|
||||
|
||||
コマンドラインでプログラムしたい場合は、Vagranfile の ['modifyvm'] 行のコメントを解除して Linux への USB パススルーを有効にし、dfu-util/dfu-programmer のようなコマンドラインツールを使ってプログラムすることができます。あるいは Teensy CLI バージョンをインストールすることができます。
|
||||
|
||||
|
@@ -175,11 +175,11 @@ See also: [Basic Keycodes](keycodes_basic.md)
|
||||
|`KC_EXSEL` | |ExSel |
|
||||
|`KC_LCTRL` |`KC_LCTL` |Left Control |
|
||||
|`KC_LSHIFT` |`KC_LSFT` |Left Shift |
|
||||
|`KC_LALT` | |Left Alt |
|
||||
|`KC_LALT` |`KC_LOPT` |Left Alt (Option) |
|
||||
|`KC_LGUI` |`KC_LCMD`, `KC_LWIN` |Left GUI (Windows/Command/Meta key) |
|
||||
|`KC_RCTRL` |`KC_RCTL` |Right Control |
|
||||
|`KC_RSHIFT` |`KC_RSFT` |Right Shift |
|
||||
|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) |
|
||||
|`KC_RALT` |`KC_ROPT`, `KC_ALGR` |Right Alt (Option/AltGr) |
|
||||
|`KC_RGUI` |`KC_RCMD`, `KC_RWIN` |Right GUI (Windows/Command/Meta key) |
|
||||
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|
||||
|`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep |
|
||||
@@ -378,11 +378,11 @@ See also: [Modifier Keys](feature_advanced_keycodes.md#modifier-keys)
|
||||
|----------|-------------------------------|----------------------------------------------------|
|
||||
|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|
||||
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
||||
|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` |
|
||||
|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` |
|
||||
|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
||||
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
||||
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
||||
|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` |
|
||||
|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` |
|
||||
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|
||||
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|
||||
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
||||
@@ -401,11 +401,11 @@ See also: [Mod-Tap](mod_tap.md)
|
||||
|`MT(mod, kc)`| |`mod` when held, `kc` when tapped |
|
||||
|`LCTL_T(kc)` |`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||
|`LSFT_T(kc)` |`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||
|`LALT_T(kc)` |`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`LALT_T(kc)` |`LOPT_T(kc)`, `ALT_T(kc)`, `OPT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`LGUI_T(kc)` |`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||
|`RCTL_T(kc)` | |Right Control when held, `kc` when tapped |
|
||||
|`RSFT_T(kc)` | |Right Shift when held, `kc` when tapped |
|
||||
|`RALT_T(kc)` |`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`RALT_T(kc)` |`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`RGUI_T(kc)` |`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||
|`SGUI_T(kc)` |`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||
|
@@ -112,11 +112,11 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07
|
||||
|-----------|--------------------|------------------------------------|
|
||||
|`KC_LCTRL` |`KC_LCTL` |Left Control |
|
||||
|`KC_LSHIFT`|`KC_LSFT` |Left Shift |
|
||||
|`KC_LALT` | |Left Alt |
|
||||
|`KC_LALT` |`KC_LOPT` |Left Alt (Option) |
|
||||
|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) |
|
||||
|`KC_RCTRL` |`KC_RCTL` |Right Control |
|
||||
|`KC_RSHIFT`|`KC_RSFT` |Right Shift |
|
||||
|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) |
|
||||
|`KC_RALT` |`KC_ROPT`, `KC_ALGR`|Right Alt (Option/AltGr) |
|
||||
|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)|
|
||||
|
||||
## International
|
||||
|
@@ -31,11 +31,11 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations
|
||||
|------------|-----------------------------------------------------------------|-------------------------------------------------------|
|
||||
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`LALT_T(kc)`|`LOPT_T(kc)`, `ALT_T(kc)`, `OPT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||
|`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|
||||
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|
||||
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`RALT_T(kc)`|`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||
|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||
|
@@ -78,7 +78,7 @@ After installing QMK you can set it up with this command:
|
||||
|
||||
In most situations you will want to answer Yes to all of the prompts.
|
||||
|
||||
?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>` to clone your personal fork. If you don't know what that means you can safely ignore this message.
|
||||
?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>/qmk_firmware` to clone your personal fork. If you don't know what that means you can safely ignore this message.
|
||||
|
||||
## 4. Test Your Build Environment
|
||||
|
||||
|
53
docs/platformdev_chibios_earlyinit.md
Normal file
53
docs/platformdev_chibios_earlyinit.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Arm/ChibiOS Early Initialization :id=chibios-early-init
|
||||
|
||||
This page describes a part of QMK that is a somewhat advanced concept, and is only relevant to keyboard designers.
|
||||
|
||||
QMK uses ChibiOS as the underlying layer to support a multitude of Arm-based devices. Each ChibiOS-supported keyboard has a low-level board definition which is responsible for initializing hardware peripherals such as the clocks, and GPIOs.
|
||||
|
||||
Older QMK revisions required duplication of these board definitions inside your keyboard's directory in order to override such early initialization points; this is now abstracted into the following APIs, and allows usage of the board definitions supplied with ChibiOS itself. Check `<qmk_firmware>/lib/chibios/os/hal/boards` for the list of official definitions. If your keyboard needs extra initialization at a very early stage, consider providing keyboard-level overrides of the following APIs:
|
||||
|
||||
## `early_hardware_init_pre()` :id=early-hardware-init-pre
|
||||
|
||||
The function `early_hardware_init_pre` is the earliest possible code that can be executed by a keyboard firmware. This is intended as a replacement for the ChibiOS board definition's `__early_init` function, and is the equivalent of executing at the start of the function.
|
||||
|
||||
This is executed before RAM gets cleared, and before clocks or GPIOs are configured; any delays or preparation using GPIOs is not likely to work at this point. After executing this function, RAM on the MCU may be zero'ed. Assigning values to variables during execution of this function may be overwritten.
|
||||
|
||||
As such, if you wish to override this API consider limiting use to writing to low-level registers. The default implementation of this function can be configured to jump to bootloader if a `RESET` key was pressed, by ensuring `#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE` is in the keyboard's `config.h` file.
|
||||
|
||||
To implement your own version of this function, in your keyboard's source files:
|
||||
|
||||
```c
|
||||
void early_hardware_init_pre(void) {
|
||||
// do things with registers
|
||||
}
|
||||
```
|
||||
|
||||
## `early_hardware_init_post()` :id=early-hardware-init-post
|
||||
|
||||
The function `early_hardware_init_post` is the next earliest possible code that can be executed by a keyboard firmware. This is executed after RAM has been cleared, and clocks and GPIOs are configured. This is intended as a replacement for the ChibiOS board definition's `__early_init` function, and is the equivalent of executing at the end of the function.
|
||||
|
||||
Much like `early_hardware_init_pre`, ChibiOS has not yet been initialized either, so the same restrictions on delays and timing apply.
|
||||
|
||||
If you wish to override this API, consider limiting functionality to register writes, variable initialization, and GPIO toggling. The default implementation of this function is to do nothing.
|
||||
|
||||
To implement your own version of this function, in your keyboard's source files:
|
||||
|
||||
```c
|
||||
void early_hardware_init_post(void) {
|
||||
// toggle GPIO pins and write to variables
|
||||
}
|
||||
```
|
||||
|
||||
## `board_init()` :id=board-init
|
||||
|
||||
The function `board_init` is executed directly after the ChibiOS initialization routines have completed. At this stage, all normal low-level functionality should be available for use (including timers and delays), with the restriction that USB is not yet connected. This is intended as a replacement for the ChibiOS board definition's `boardInit` function.
|
||||
|
||||
The default implementation of this function is to do nothing.
|
||||
|
||||
To implement your own version of this function, in your keyboard's source files:
|
||||
|
||||
```c
|
||||
void board_init(void) {
|
||||
// initialize anything that requires ChibiOS
|
||||
}
|
||||
```
|
@@ -1,5 +1,9 @@
|
||||
# Converting a board to use the Proton C
|
||||
|
||||
Since the Proton C is a drop-in replacement for a Pro Micro we've made it easy to use. This page documents a handy automated process for converting keyboards, as well as documenting the manual process if you'd like to make use of Proton C features that aren't available on Pro Micros.
|
||||
|
||||
## Automatic Conversion
|
||||
|
||||
If a board currently supported in QMK uses a Pro Micro (or compatible board) and you want to use the Proton C, you can generate the firmware by appending `CONVERT_TO_PROTON_C=yes` (or `CTPC=yes`) to your make argument, like this:
|
||||
|
||||
make 40percentclub/mf68:default CTPC=yes
|
||||
@@ -8,13 +12,15 @@ You can add the same argument to your keymap's `rules.mk`, which will accomplish
|
||||
|
||||
This exposes the `CONVERT_TO_PROTON_C` flag that you can use in your code with `#ifdef`s, like this:
|
||||
|
||||
#ifdef CONVERT_TO_PROTON_C
|
||||
// Proton C code
|
||||
#else
|
||||
// Pro Micro code
|
||||
#endif
|
||||
```c
|
||||
#ifdef CONVERT_TO_PROTON_C
|
||||
// Proton C code
|
||||
#else
|
||||
// Pro Micro code
|
||||
#endif
|
||||
```
|
||||
|
||||
Before being able to compile, you may get some errors about `PORTB/DDRB`, etc not being defined, so you'll need to convert the keyboard's code to use the [GPIO Controls](internals_gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all.
|
||||
If you get errors about `PORTB/DDRB`, etc not being defined, so you'll need to convert the keyboard's code to use the [GPIO Controls](internals_gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all.
|
||||
|
||||
The Proton C only has one on-board LED (C13), and by default, the TXLED (D5) is mapped to it. If you want the RXLED (B0) mapped to it instead, add this like to your `config.h`:
|
||||
|
||||
@@ -31,3 +37,54 @@ These are defaults based on what has been implemented for ARM boards.
|
||||
| [Backlight](feature_backlight.md) | Forces [task driven PWM](feature_backlight.md#software-pwm-driver) until ARM can provide automatic configuration |
|
||||
| USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) |
|
||||
| [Split keyboards](feature_split_keyboard.md) | Not supported yet |
|
||||
|
||||
## Manual Conversion
|
||||
|
||||
To use the Proton C natively, without having to specify `CTPC=yes`, you need to change the `MCU` line in `rules.mk`:
|
||||
|
||||
```
|
||||
MCU = STM32F303
|
||||
```
|
||||
|
||||
Remove these variables if they exist:
|
||||
|
||||
* `BOOTLOADER`
|
||||
* `EXTRA_FLAGS`
|
||||
|
||||
Finally convert all pin assignments in `config.h` to the stm32 equivalents.
|
||||
|
||||
| Pro Micro Left | Proton C Left | | Proton C Right | Pro Micro Right |
|
||||
|-----------|----------|-|----------|-----------|
|
||||
| `D3` | `A9` | | 5v | RAW (5v) |
|
||||
| `D2` | `A10` | | GND | GND |
|
||||
| GND | GND | | FLASH | RESET |
|
||||
| GND | GND | | 3.3v | VCC <sup>1</sup> |
|
||||
| `D1` | `B7` | | `A2` | `F4` |
|
||||
| `D0` | `B6` | | `A1` | `F5` |
|
||||
| `D4` | `B5` | | `A0` | `F6` |
|
||||
| `C6` | `B4` | | `B8` | `F7` |
|
||||
| `D7` | `B3` | | `B13` | `B1` |
|
||||
| `E6` | `B2` | | `B14` | `B3` |
|
||||
| `B4` | `B1` | | `B15` | `B2` |
|
||||
| `B5` | `B0` | | `B9` | `B6` |
|
||||
| `B0` (RX LED) | `C13` <sup>2</sup> | | `C13` <sup>2</sup> | `D5` (TX LED) |
|
||||
|
||||
You can also make use of several new pins on the extended portion of the Proton C:
|
||||
|
||||
| Left | | Right |
|
||||
|------|-|-------|
|
||||
| `A4`<sup>3</sup> | | `B10` |
|
||||
| `A5`<sup>4</sup> | | `B11` |
|
||||
| `A6` | | `B12` |
|
||||
| `A7` | | `A14`<sup>5</sup> (SWCLK) |
|
||||
| `A8` | | `A13`<sup>5</sup> (SWDIO) |
|
||||
| `A15` | | RESET<sup>6</sup> |
|
||||
|
||||
Notes:
|
||||
|
||||
1. On a Pro Micro VCC can be 3.3v or 5v.
|
||||
2. A Proton C only has one onboard LED, not two like a Pro Micro. The Pro Micro has an RX LED on `D5` and a TX LED on `B0`.
|
||||
3. `A4` is shared with the speaker.
|
||||
4. `A5` is shared with the speaker.
|
||||
5. `A13` and `A14` are used for hardware debugging (SWD). You can also use them for GPIO, but should use them last.
|
||||
6. Short RESET to 3.3v (pull high) to reboot the MCU. This does not enter bootloader mode like a Pro Micro, it only resets the MCU.
|
||||
|
@@ -98,6 +98,7 @@
|
||||
* [ISP Flashing Guide](pt-br/isp_flashing_guide.md)
|
||||
* [ARM Debugging Guide](pt-br/arm_debugging.md)
|
||||
* [I2C Driver](pt-br/i2c_driver.md)
|
||||
* [SPI Driver](pt-br/spi_driver.md)
|
||||
* [GPIO Controls](pt-br/internals_gpio_control.md)
|
||||
* [Proton C Conversion](pt-br/proton_c_conversion.md)
|
||||
|
||||
|
@@ -8,7 +8,7 @@ There are actually separate functions that you can use there, depending on what
|
||||
|
||||
### `update_tri_layer(x, y, z)`
|
||||
|
||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
|
||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it turns on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it turns off layer `z`.
|
||||
|
||||
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
||||
|
||||
@@ -43,7 +43,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
```
|
||||
|
||||
### `update_tri_layer_state(state, x, y, z)`
|
||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from the [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||
|
||||
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
||||
|
||||
|
@@ -46,9 +46,6 @@ An IDE that is popular with many C developers.
|
||||
## Firmware
|
||||
The software that controls your MCU.
|
||||
|
||||
## FLIP
|
||||
Software provided by Atmel for flashing AVR devices. We generally recommend [QMK Flasher](https://github.com/qmk/qmk_flasher) instead, but for some advanced use cases FLIP is required.
|
||||
|
||||
## git
|
||||
Versioning software used at the command line
|
||||
|
||||
|
@@ -99,6 +99,7 @@
|
||||
* [ISP Flashing Guide](ru-ru/isp_flashing_guide.md)
|
||||
* [ARM Debugging Guide](ru-ru/arm_debugging.md)
|
||||
* [I2C Driver](ru-ru/i2c_driver.md)
|
||||
* [SPI Driver](ru-ru/spi_driver.md)
|
||||
* [WS2812 Driver](ru-ru/ws2812_driver.md)
|
||||
* [GPIO Controls](ru-ru/internals_gpio_control.md)
|
||||
* [Proton C Conversion](ru-ru/proton_c_conversion.md)
|
||||
|
121
docs/spi_driver.md
Normal file
121
docs/spi_driver.md
Normal file
@@ -0,0 +1,121 @@
|
||||
# SPI Master Driver
|
||||
|
||||
The SPI Master drivers used in QMK have a set of common functions to allow portability between MCUs.
|
||||
|
||||
## AVR Configuration
|
||||
|
||||
No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` pins of your SPI devices to the matching pins on the MCU:
|
||||
|
||||
|MCU |`SS`|`SCK`|`MOSI`|`MISO`|
|
||||
|---------------|----|-----|------|------|
|
||||
|ATMega16/32U2/4|`B0`|`B1` |`B2` |`B3` |
|
||||
|AT90USB64/128 |`B0`|`B1` |`B2` |`B3` |
|
||||
|ATmega32A |`B4`|`B7` |`B5` |`B6` |
|
||||
|ATmega328P |`B2`|`B5` |`B3` |`B4` |
|
||||
|
||||
You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually.
|
||||
`SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`.
|
||||
|
||||
## ChibiOS/ARM Configuration
|
||||
|
||||
ARM support for this driver is not ready yet. Check back later!
|
||||
|
||||
## Functions
|
||||
|
||||
### `void spi_init(void)`
|
||||
|
||||
Initialize the SPI driver. This function must be called only once, before any of the below functions can be called.
|
||||
|
||||
---
|
||||
|
||||
### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)`
|
||||
|
||||
Start an SPI transaction.
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `pin_t slavePin`
|
||||
The QMK pin to assert as the slave select pin, eg. `B4`.
|
||||
- `bool lsbFirst`
|
||||
Determines the endianness of the transmission. If `true`, the least significant bit of each byte is sent first.
|
||||
- `uint8_t mode`
|
||||
The SPI mode to use:
|
||||
|
||||
|Mode|Clock Polarity |Clock Phase |
|
||||
|----|--------------------|-----------------------|
|
||||
|`0` |Leading edge rising |Sample on leading edge |
|
||||
|`1` |Leading edge rising |Sample on trailing edge|
|
||||
|`2` |Leading edge falling|Sample on leading edge |
|
||||
|`3` |Leading edge falling|Sample on trailing edge|
|
||||
|
||||
- `uint16_t divisor`
|
||||
The SPI clock divisor, will be rounded up to the nearest power of two. This number can be calculated by dividing the MCU's clock speed by the desired SPI clock speed. For example, an MCU running at 8 MHz wanting to talk to an SPI device at 4 MHz would set the divisor to `2`.
|
||||
|
||||
#### Return Value
|
||||
|
||||
`false` if the supplied parameters are invalid or the SPI peripheral is already in use, or `true`.
|
||||
|
||||
---
|
||||
|
||||
### `spi_status_t spi_write(uint8_t data)`
|
||||
|
||||
Write a byte to the selected SPI device.
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `uint8_t data`
|
||||
The byte to write.
|
||||
|
||||
#### Return Value
|
||||
|
||||
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or `SPI_STATUS_SUCCESS`.
|
||||
|
||||
---
|
||||
|
||||
### `spi_status_t spi_read(void)`
|
||||
|
||||
Read a byte from the selected SPI device.
|
||||
|
||||
#### Return Value
|
||||
|
||||
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device.
|
||||
|
||||
---
|
||||
|
||||
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)`
|
||||
|
||||
Send multiple bytes to the selected SPI device.
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `const uint8_t *data`
|
||||
A pointer to the data to write from.
|
||||
- `uint16_t length`
|
||||
The number of bytes to write. Take care not to overrun the length of `data`.
|
||||
|
||||
#### Return Value
|
||||
|
||||
`SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_SUCCESS` on success, or `SPI_STATUS_ERROR` otherwise.
|
||||
|
||||
---
|
||||
|
||||
### `spi_status_t spi_receive(uint8_t *data, uint16_t length)`
|
||||
|
||||
Receive multiple bytes from the selected SPI device.
|
||||
|
||||
#### Arguments
|
||||
|
||||
- `uint8_t *data`
|
||||
A pointer to the buffer to read into.
|
||||
- `uint16_t length`
|
||||
The number of bytes to read. Take care not to overrun the length of `data`.
|
||||
|
||||
#### Return Value
|
||||
|
||||
`SPI_STATUS_TIMEOUT` if the internal transmission timeout period elapses, `SPI_STATUS_SUCCESS` on success, or `SPI_STATUS_ERROR` otherwise.
|
||||
|
||||
---
|
||||
|
||||
### `void spi_stop(void)`
|
||||
|
||||
End the current SPI transaction. This will deassert the slave select pin and reset the endianness, mode and divisor configured by `spi_start()`.
|
70
docs/syllabus.md
Normal file
70
docs/syllabus.md
Normal file
@@ -0,0 +1,70 @@
|
||||
# QMK Syllabus
|
||||
|
||||
This page helps you build up your QMK knowledge by introducing the basics first and guiding you to understanding all the concepts you need to know to be proficient with QMK.
|
||||
|
||||
# Beginning Topics
|
||||
|
||||
If you read nothing else you should read the documents in this section. After reading the [Tutorial](newbs.md) you should be able to create a basic keymap, compile it, and flash it to your keyboard. The remaining documents will flesh out your knowledge of these basics.
|
||||
|
||||
* **Learn How To Use QMK Tools**
|
||||
* [Tutorial](newbs.md)
|
||||
* [CLI](cli.md)
|
||||
* [GIT](newbs_git_best_practices.md)
|
||||
* **Learn About Keymaps**
|
||||
* [Layers](feature_layers.md)
|
||||
* [Keycodes](keycodes.md)
|
||||
* The full list of keycodes you can use. Note that some may require knowledge found in the Intermediate or Advanced Topics.
|
||||
* **Configuring IDEs** - Optional
|
||||
* [Eclipse](other_eclipse.md)
|
||||
* [VS Code](other_vscode.md)
|
||||
|
||||
# Intermediate Topics
|
||||
|
||||
These topics start to dig into some of the features that QMK supports. You don't have to read all of these documents, but some of the documents in the Advanced Topics section won't make sense if you skip over some of these.
|
||||
|
||||
* **Learn How To Configure Features**
|
||||
<!-- * Configuration Overview FIXME(skullydazed/anyone): write this document -->
|
||||
* [Audio](feature_audio.md)
|
||||
* Lighting
|
||||
* [Backlight](feature_backlight.md)
|
||||
* [LED Matrix](feature_led_matrix.md)
|
||||
* [RGB Lighting](feature_rgblight.md)
|
||||
* [RGB Matrix](feature_rgb_matrix.md)
|
||||
* [Tap-Hold Configuration](tap_hold.md)
|
||||
* **Learn More About Keymaps**
|
||||
* [Keymaps](keymap.md)
|
||||
* [Custom Functions and Keycodes](custom_quantum_functions.md)
|
||||
* Macros
|
||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||
* [Compiled Macros](feature_macros.md)
|
||||
* [Tap Dance](feature_tap_dance.md)
|
||||
* [Combos](feature_combo.md)
|
||||
* [Userspace](feature_userspace.md)
|
||||
|
||||
# Advanced Topics
|
||||
|
||||
Everything below here requires a lot of foundational knowledge. Besides being able to create keymaps using advanced features you should be familiar with using both `config.h` and `rules.mk` to configure options for your keyboard.
|
||||
|
||||
* **Maintaining Keyboards Within QMK**
|
||||
* [Handwiring a Keyboard](hand_wire.md)
|
||||
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
||||
* [info.json Reference](reference_info_json.md)
|
||||
* [Debounce API](feature_debounce_type.md)
|
||||
* **Advanced Features**
|
||||
* [Unicode](feature_unicode.md)
|
||||
* [API](api_overview.md)
|
||||
* [Bootmagic](feature_bootmagic.md)
|
||||
* **Hardware**
|
||||
* [How Keyboards Work](how_keyboards_work.md)
|
||||
* [How A Keyboard Matrix Works](how_a_matrix_works.md)
|
||||
* [Split Keyboards](feature_split_keyboard.md)
|
||||
* [Stenography](feature_stenography.md)
|
||||
* [Pointing Devices](feature_pointing_device.md)
|
||||
* **Core Development**
|
||||
* [Coding Conventions](coding_conventions_c.md)
|
||||
* [Compatible Microcontrollers](compatible_microcontrollers.md)
|
||||
* [Custom Matrix](custom_matrix.md)
|
||||
* [Understanding QMK](understanding_qmk.md)
|
||||
* **CLI Development**
|
||||
* [Coding Conventions](coding_conventions_python.md)
|
||||
* [CLI Development Overview](cli_development.md)
|
@@ -12,7 +12,7 @@ As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new
|
||||
#define PERMISSIVE_HOLD
|
||||
```
|
||||
|
||||
This makes tap and hold keys (like Mod Tap) work better for fast typist, or for high `TAPPING_TERM` settings.
|
||||
This makes tap and hold keys (like Mod Tap) work better for fast typists, or for high `TAPPING_TERM` settings.
|
||||
|
||||
If you press a Mod Tap key, tap another key (press and release) and then release the Mod Tap key, all within the tapping term, it will output the "tapping" function for both keys.
|
||||
|
||||
@@ -35,7 +35,7 @@ To enable this setting, add this to your `config.h`:
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
```
|
||||
|
||||
Similar to Permissive Hold, this alters how the firmware processes input for fast typist. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys.
|
||||
Similar to Permissive Hold, this alters how the firmware processes inputs for fast typists. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys.
|
||||
|
||||
Setting `Ignore Mod Tap Interrupt` requires holding both keys for the `TAPPING_TERM` to trigger the hold function (the mod).
|
||||
|
||||
|
@@ -104,6 +104,7 @@
|
||||
* [ARM调试指南](zh-cn/arm_debugging.md)
|
||||
* [ADC设备](zh-cn/adc_driver.md)
|
||||
* [I2C设备](zh-cn/i2c_driver.md)
|
||||
* [SPI设备](zh-cn/spi_driver.md)
|
||||
* [WS2812设备](zh-cn/ws2812_driver.md)
|
||||
* [EEPROM设备](zh-cn/eeprom_driver.md)
|
||||
* [GPIO控制](zh-cn/internals_gpio_control.md)
|
||||
|
@@ -139,10 +139,3 @@ https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
||||
|
||||
https://github.com/tmk/tmk_keyboard/issues/266
|
||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||
|
||||
|
||||
|
||||
## FLIP 不工作
|
||||
### `AtLibUsbDfu.dll` 未找到
|
||||
从设备管理器中删除当前驱动程序并在设备管理器重新安装一个FLIP提供的程序。
|
||||
http://imgur.com/a/bnwzy
|
||||
|
@@ -46,9 +46,6 @@ Français (法国)标准键盘布局。用键盘的前六个字母命名。
|
||||
## Firmware(固件)
|
||||
用来控制单片机的软件。
|
||||
|
||||
## FLIP
|
||||
爱特梅尔(Atmel)提供的AVR器件刷写软件。我们一般推荐 [QMK刷写工具](https://github.com/qmk/qmk_flasher),但是对于一些高级用例,需要FLIP。
|
||||
|
||||
## git
|
||||
命令行版本控制软件
|
||||
|
||||
|
176
drivers/avr/spi_master.c
Normal file
176
drivers/avr/spi_master.c
Normal file
@@ -0,0 +1,176 @@
|
||||
/* Copyright 2020
|
||||
*
|
||||
* 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 3 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <avr/io.h>
|
||||
|
||||
#include "spi_master.h"
|
||||
#include "quantum.h"
|
||||
#include "timer.h"
|
||||
|
||||
#if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
|
||||
# define SPI_SCK_PIN B1
|
||||
# define SPI_MOSI_PIN B2
|
||||
# define SPI_MISO_PIN B3
|
||||
#elif defined(__AVR_ATmega32A__)
|
||||
# define SPI_SCK_PIN B7
|
||||
# define SPI_MOSI_PIN B5
|
||||
# define SPI_MISO_PIN B6
|
||||
#elif defined(__AVR_ATmega328P__)
|
||||
# define SPI_SCK_PIN B5
|
||||
# define SPI_MOSI_PIN B3
|
||||
# define SPI_MISO_PIN B4
|
||||
#endif
|
||||
|
||||
#ifndef SPI_TIMEOUT
|
||||
# define SPI_TIMEOUT 100
|
||||
#endif
|
||||
|
||||
static pin_t currentSlavePin = NO_PIN;
|
||||
static uint8_t currentSlaveConfig = 0;
|
||||
static bool currentSlave2X = false;
|
||||
|
||||
void spi_init(void) {
|
||||
writePinHigh(SPI_SS_PIN);
|
||||
setPinOutput(SPI_SCK_PIN);
|
||||
setPinOutput(SPI_MOSI_PIN);
|
||||
setPinInput(SPI_MISO_PIN);
|
||||
|
||||
SPCR = (_BV(SPE) | _BV(MSTR));
|
||||
}
|
||||
|
||||
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
||||
if (currentSlavePin != NO_PIN || slavePin == NO_PIN) {
|
||||
return false;
|
||||
}
|
||||
|
||||
currentSlaveConfig = 0;
|
||||
|
||||
if (lsbFirst) {
|
||||
currentSlaveConfig |= _BV(DORD);
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case 1:
|
||||
currentSlaveConfig |= _BV(CPHA);
|
||||
break;
|
||||
case 2:
|
||||
currentSlaveConfig |= _BV(CPOL);
|
||||
break;
|
||||
case 3:
|
||||
currentSlaveConfig |= (_BV(CPOL) | _BV(CPHA));
|
||||
break;
|
||||
}
|
||||
|
||||
uint16_t roundedDivisor = 1;
|
||||
while (roundedDivisor < divisor) {
|
||||
roundedDivisor <<= 1;
|
||||
}
|
||||
|
||||
switch (roundedDivisor) {
|
||||
case 16:
|
||||
currentSlaveConfig |= _BV(SPR0);
|
||||
break;
|
||||
case 64:
|
||||
currentSlaveConfig |= _BV(SPR1);
|
||||
break;
|
||||
case 128:
|
||||
currentSlaveConfig |= (_BV(SPR1) | _BV(SPR0));
|
||||
break;
|
||||
case 2:
|
||||
currentSlave2X = true;
|
||||
break;
|
||||
case 8:
|
||||
currentSlave2X = true;
|
||||
currentSlaveConfig |= _BV(SPR0);
|
||||
break;
|
||||
case 32:
|
||||
currentSlave2X = true;
|
||||
currentSlaveConfig |= _BV(SPR1);
|
||||
break;
|
||||
}
|
||||
|
||||
SPCR |= currentSlaveConfig;
|
||||
if (currentSlave2X) {
|
||||
SPSR |= _BV(SPI2X);
|
||||
}
|
||||
currentSlavePin = slavePin;
|
||||
setPinOutput(currentSlavePin);
|
||||
writePinLow(currentSlavePin);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
spi_status_t spi_write(uint8_t data) {
|
||||
SPDR = data;
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while (!(SPSR & _BV(SPIF))) {
|
||||
if ((timer_read() - timeout_timer) >= SPI_TIMEOUT) {
|
||||
return SPI_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
return SPDR;
|
||||
}
|
||||
|
||||
spi_status_t spi_read() {
|
||||
SPDR = 0x00; // Dummy
|
||||
|
||||
uint16_t timeout_timer = timer_read();
|
||||
while (!(SPSR & _BV(SPIF))) {
|
||||
if ((timer_read() - timeout_timer) >= SPI_TIMEOUT) {
|
||||
return SPI_STATUS_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
return SPDR;
|
||||
}
|
||||
|
||||
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
||||
spi_status_t status = SPI_STATUS_ERROR;
|
||||
|
||||
for (uint16_t i = 0; i < length; i++) {
|
||||
status = spi_write(data[i]);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
||||
spi_status_t status = SPI_STATUS_ERROR;
|
||||
|
||||
for (uint16_t i = 0; i < length; i++) {
|
||||
status = spi_read();
|
||||
|
||||
if (status > 0) {
|
||||
data[i] = status;
|
||||
}
|
||||
}
|
||||
|
||||
return (status < 0) ? status : SPI_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void spi_stop(void) {
|
||||
if (currentSlavePin != NO_PIN) {
|
||||
setPinOutput(currentSlavePin);
|
||||
writePinHigh(currentSlavePin);
|
||||
currentSlavePin = NO_PIN;
|
||||
SPSR &= ~(_BV(SPI2X));
|
||||
SPCR &= ~(currentSlaveConfig);
|
||||
currentSlaveConfig = 0;
|
||||
currentSlave2X = false;
|
||||
}
|
||||
}
|
57
drivers/avr/spi_master.h
Normal file
57
drivers/avr/spi_master.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Copyright 2020
|
||||
*
|
||||
* 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 3 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
typedef int16_t spi_status_t;
|
||||
|
||||
// Hardware SS pin is defined in the header so that user code can refer to it
|
||||
#if defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB647__) || defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__)
|
||||
# define SPI_SS_PIN B0
|
||||
#elif defined(__AVR_ATmega32A__)
|
||||
# define SPI_SS_PIN B4
|
||||
#elif defined(__AVR_ATmega328P__)
|
||||
# define SPI_SS_PIN B2
|
||||
#endif
|
||||
|
||||
#define SPI_STATUS_SUCCESS (0)
|
||||
#define SPI_STATUS_ERROR (-1)
|
||||
#define SPI_STATUS_TIMEOUT (-2)
|
||||
|
||||
#define SPI_TIMEOUT_IMMEDIATE (0)
|
||||
#define SPI_TIMEOUT_INFINITE (0xFFFF)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void spi_init(void);
|
||||
|
||||
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor);
|
||||
|
||||
spi_status_t spi_write(uint8_t data);
|
||||
|
||||
spi_status_t spi_read(void);
|
||||
|
||||
spi_status_t spi_transmit(const uint8_t *data, uint16_t length);
|
||||
|
||||
spi_status_t spi_receive(uint8_t *data, uint16_t length);
|
||||
|
||||
void spi_stop(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -20,12 +20,13 @@
|
||||
* 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 "ws2812.h"
|
||||
#include <avr/interrupt.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/delay.h>
|
||||
|
||||
#define pinmask(pin) (_BV((pin)&0xF))
|
||||
|
||||
/*
|
||||
* Forward declare internal functions
|
||||
*
|
||||
@@ -33,20 +34,21 @@
|
||||
* The length is the number of bytes to send - three per LED.
|
||||
*/
|
||||
|
||||
void ws2812_sendarray(uint8_t *array, uint16_t length);
|
||||
void ws2812_sendarray_mask(uint8_t *array, uint16_t length, uint8_t pinmask);
|
||||
static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi);
|
||||
|
||||
// Setleds for standard RGB
|
||||
void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {
|
||||
// ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin));
|
||||
ws2812_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF));
|
||||
void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds) {
|
||||
// wrap up usage of RGB_DI_PIN
|
||||
ws2812_setleds_pin(ledarray, number_of_leds, RGB_DI_PIN);
|
||||
}
|
||||
|
||||
void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask) {
|
||||
// new universal format (DDR)
|
||||
_SFR_IO8((RGB_DI_PIN >> 4) + 1) |= pinmask;
|
||||
void ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t number_of_leds, uint8_t pin) {
|
||||
DDRx_ADDRESS(RGB_DI_PIN) |= pinmask(pin);
|
||||
|
||||
ws2812_sendarray_mask((uint8_t *)ledarray, leds * sizeof(LED_TYPE), pinmask);
|
||||
uint8_t masklo = ~(pinmask(pin)) & PORTx_ADDRESS(pin);
|
||||
uint8_t maskhi = pinmask(pin) | PORTx_ADDRESS(pin);
|
||||
|
||||
ws2812_sendarray_mask((uint8_t *)ledarray, number_of_leds * sizeof(LED_TYPE), masklo, maskhi);
|
||||
|
||||
#ifdef RGBW
|
||||
_delay_us(80);
|
||||
@@ -55,8 +57,6 @@ void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmas
|
||||
#endif
|
||||
}
|
||||
|
||||
void ws2812_sendarray(uint8_t *data, uint16_t datlen) { ws2812_sendarray_mask(data, datlen, _BV(RGB_DI_PIN & 0xF)); }
|
||||
|
||||
/*
|
||||
This routine writes an array of bytes with RGB values to the Dataout pin
|
||||
using the fast 800kHz clockless WS2811/2812 protocol.
|
||||
@@ -118,14 +118,9 @@ void ws2812_sendarray(uint8_t *data, uint16_t datlen) { ws2812_sendarray_mask(da
|
||||
#define w_nop8 w_nop4 w_nop4
|
||||
#define w_nop16 w_nop8 w_nop8
|
||||
|
||||
void inline ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t maskhi) {
|
||||
uint8_t curbyte, ctr, masklo;
|
||||
uint8_t sreg_prev;
|
||||
static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t masklo, uint8_t maskhi) {
|
||||
uint8_t curbyte, ctr, sreg_prev;
|
||||
|
||||
// masklo =~maskhi&ws2812_PORTREG;
|
||||
// maskhi |= ws2812_PORTREG;
|
||||
masklo = ~maskhi & _SFR_IO8((RGB_DI_PIN >> 4) + 2);
|
||||
maskhi |= _SFR_IO8((RGB_DI_PIN >> 4) + 2);
|
||||
sreg_prev = SREG;
|
||||
cli();
|
||||
|
||||
@@ -188,7 +183,7 @@ void inline ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t maskhi
|
||||
" dec %0 \n\t" // '1' [+2] '0' [+2]
|
||||
" brne loop%=\n\t" // '1' [+3] '0' [+4]
|
||||
: "=&d"(ctr)
|
||||
: "r"(curbyte), "I"(_SFR_IO_ADDR(_SFR_IO8((RGB_DI_PIN >> 4) + 2))), "r"(maskhi), "r"(masklo));
|
||||
: "r"(curbyte), "I"(_SFR_IO_ADDR(PORTx_ADDRESS(RGB_DI_PIN))), "r"(maskhi), "r"(masklo));
|
||||
}
|
||||
|
||||
SREG = sreg_prev;
|
||||
|
@@ -29,7 +29,7 @@
|
||||
* Input:
|
||||
* ledarray: An array of GRB data describing the LED colors
|
||||
* number_of_leds: The number of LEDs to write
|
||||
* pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0)
|
||||
* pin (optional): A pin_t definition for the line to drive
|
||||
*
|
||||
* The functions will perform the following actions:
|
||||
* - Set the data-out pin as output
|
||||
@@ -37,4 +37,4 @@
|
||||
* - Wait 50us to reset the LEDs
|
||||
*/
|
||||
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
|
||||
void ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t number_of_leds, uint8_t pinmask);
|
||||
void ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t number_of_leds, uint8_t pin);
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define VENDOR_ID 0x6F75 // OU
|
||||
#define MANUFACTURER 1up Keyboards
|
||||
#define PRODUCT Sweet16
|
||||
#define DESCRIPTION 4x4 grid
|
||||
|
37
keyboards/1upkeyboards/sweet16/keymaps/via/keymap.c
Normal file
37
keyboards/1upkeyboards/sweet16/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,37 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_ortho_4x4(
|
||||
KC_7, KC_8, KC_9, KC_ASTR,
|
||||
KC_4, KC_5, KC_6, KC_SLSH,
|
||||
KC_1, KC_2, KC_3, KC_MINS,
|
||||
KC_0, KC_ENT, KC_DOT, MO(1)
|
||||
),
|
||||
|
||||
[1] = LAYOUT_ortho_4x4(
|
||||
RESET, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
[2] = LAYOUT_ortho_4x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
[3] = LAYOUT_ortho_4x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
),
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
2
keyboards/1upkeyboards/sweet16/keymaps/via/rules.mk
Normal file
2
keyboards/1upkeyboards/sweet16/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
||||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
@@ -3,7 +3,7 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x2010
|
||||
#define PRODUCT_ID 0x0161
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
/* key matrix pins */
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x2011
|
||||
#define PRODUCT_ID 0x0162
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
/* key matrix pins */
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define PRODUCT_ID 0x2011
|
||||
#define PRODUCT_ID 0x0162
|
||||
#define DEVICE_VER 0x0001
|
||||
|
||||
/* key matrix pins */
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2019 Sebastian Williams
|
||||
/* Copyright 2019 Spaceman
|
||||
*
|
||||
* 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
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2019 Sebastian Williams
|
||||
/* Copyright 2019 Spaceman
|
||||
*
|
||||
* 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
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2019 Sebastian Williams
|
||||
/* Copyright 2019 Spaceman
|
||||
*
|
||||
* 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
|
||||
|
@@ -2,7 +2,7 @@
|
||||
"keyboard_name": "2% Milk",
|
||||
"keyboard_folder": "2_milk",
|
||||
"url": "",
|
||||
"maintainer": "rionlion100",
|
||||
"maintainer": "rionlion100 (Spaceman)",
|
||||
"width": 1,
|
||||
"height": 2,
|
||||
"layouts": {
|
||||
@@ -12,4 +12,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,3 @@
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
A 2% Meme board themed around a milk carton
|
||||
|
||||
Keyboard Maintainer: [Rionlion100](https://github.com/rionlion100)
|
||||
Keyboard Maintainer: Spaceman AKA:[Rionlion100](https://github.com/rionlion100)
|
||||
Hardware Availability: [Open Source](https://github.com/Rionlion100/Spaceboards/tree/master/Keyboards/2%25%20Milk)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
@@ -105,10 +105,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define NO_ACTION_ONESHOT
|
||||
|
||||
/* disable these deprecated features by default */
|
||||
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
#endif
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
17
keyboards/absinthe/absinthe.c
Normal file
17
keyboards/absinthe/absinthe.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/* Copyright 2020 cfbender
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "absinthe.h"
|
68
keyboards/absinthe/absinthe.h
Normal file
68
keyboards/absinthe/absinthe.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/* Copyright 2020 cfbender
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define XXX KC_NO
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* This is a shortcut to help you visually see your layout.
|
||||
*
|
||||
* The first section contains all of the arguments representing the physical
|
||||
* layout of the board and position of the keys.
|
||||
*
|
||||
* The second converts the arguments into a two-dimensional array which
|
||||
* represents the switch matrix.
|
||||
*/
|
||||
#define LAYOUT_default( \
|
||||
K00, K10, K01, K11, K02, K12, K03, K13, K04, K14, K05, K15, K06, K16, K07, K17, K08, K18, \
|
||||
K20, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36, K27, K37, K28, K38, \
|
||||
K40, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K46, K56, \
|
||||
K60, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K66, K67, K68, \
|
||||
K80, K81, K82, K83, K76, K86, K87, K77, K88, K78 \
|
||||
) \
|
||||
{ \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08 },\
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18 },\
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28 },\
|
||||
{ XXX, K31, K32, K33, K34, K35, K36, K37, K38 },\
|
||||
{ K40, K41, K42, K43, K44, K45, K46, XXX, XXX },\
|
||||
{ XXX, K51, K52, K53, K54, K55, K56, XXX, XXX },\
|
||||
{ K60, K61, K62, K63, K64, K65, K66, K67, K68 },\
|
||||
{ XXX, K71, K72, K73, K74, K75, K76, K77, K78 },\
|
||||
{ K80, K81, K82, K83, XXX, XXX, K86, K87, K88 } \
|
||||
}
|
||||
|
||||
#define LAYOUT_ansi( \
|
||||
K00, K10, K01, K11, K02, K12, K03, K13, K04, K14, K05, K15, K06, K16, K17, K08, K18, \
|
||||
K20, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36, K27, K37, K28, K38, \
|
||||
K40, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K46, K56, \
|
||||
K60, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K66, K68, \
|
||||
K80, K81, K82, K83, K85, K76, K86, K87, K77, K88, K78 \
|
||||
) \
|
||||
{ \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, XXX, K08 },\
|
||||
{ K10, K11, K12, K13, K14, K15, K16, K17, K18 },\
|
||||
{ K20, K21, K22, K23, K24, K25, K26, K27, K28 },\
|
||||
{ XXX, K31, K32, K33, K34, K35, K36, K37, K38 },\
|
||||
{ K40, K41, K42, K43, K44, K45, K46, XXX, XXX },\
|
||||
{ XXX, K51, K52, K53, K54, K55, K56, XXX, XXX },\
|
||||
{ K60, K61, K62, K63, K64, K65, K66, XXX, K68 },\
|
||||
{ XXX, K71, K72, K73, K74, K75, K76, K77, K78 },\
|
||||
{ K80, K81, K82, K83, XXX, K85, K86, K87, K88 } \
|
||||
}
|
||||
|
102
keyboards/absinthe/config.h
Normal file
102
keyboards/absinthe/config.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
Copyright 2020 cfbender
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xB00B
|
||||
#define PRODUCT_ID 0xFEED
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER cfbender
|
||||
#define PRODUCT absinthe
|
||||
#define DESCRIPTION An F-row-less TKL
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 9
|
||||
#define MATRIX_COLS 9
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D2, D1, B6, D4, C6, D7, E6, B4, B5 }
|
||||
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, D3, D0 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define ENCODERS_PAD_A { D5 }
|
||||
#define ENCODERS_PAD_B { B7 }
|
||||
|
||||
#define ENCODER_DIRECTION_FLIP
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/*
|
||||
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||
*/
|
||||
//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||
|
||||
// #define BACKLIGHT_PIN B7
|
||||
// #define BACKLIGHT_BREATHING
|
||||
// #define BACKLIGHT_LEVELS 3
|
||||
|
||||
#define RGB_DI_PIN B0
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGBLED_NUM 32
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||
/*== all animations enable ==*/
|
||||
// #define RGBLIGHT_ANIMATIONS
|
||||
// /*== or choose animations ==*/
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||
// #define RGBLIGHT_EFFECT_SNAKE
|
||||
// #define RGBLIGHT_EFFECT_KNIGHT
|
||||
// #define RGBLIGHT_EFFECT_CHRISTMAS
|
||||
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||
// #define RGBLIGHT_EFFECT_RGB_TEST
|
||||
// #define RGBLIGHT_EFFECT_ALTERNATING
|
||||
// /*== customize breathing effect ==*/
|
||||
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||
// /*==== use exp() and sin() ====*/
|
||||
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||
#endif
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
150
keyboards/absinthe/info.json
Normal file
150
keyboards/absinthe/info.json
Normal file
@@ -0,0 +1,150 @@
|
||||
{
|
||||
"keyboard_name": "absinthe",
|
||||
"url": "https://github.com/cfbender/keyboards/tree/master/absinthe",
|
||||
"maintainer": "cfbender",
|
||||
"width": 18.25,
|
||||
"height": 5,
|
||||
"layouts": {
|
||||
"LAYOUT_default": {
|
||||
"layout": [
|
||||
{"label":"Esc", "x":0, "y":0},
|
||||
{"label":"!", "x":1, "y":0},
|
||||
{"label":"@", "x":2, "y":0},
|
||||
{"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0},
|
||||
{"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0},
|
||||
{"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0},
|
||||
{"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0},
|
||||
{"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0},
|
||||
{"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0},
|
||||
{"label":"Insert", "x":15.25, "y":0},
|
||||
{"label":"Home", "x":16.25, "y":0},
|
||||
{"label":"PgUp", "x":17.25, "y":0},
|
||||
{"label":"Tab", "x":0, "y":1, "w":1.5},
|
||||
{"label":"Q", "x":1.5, "y":1},
|
||||
{"label":"W", "x":2.5, "y":1},
|
||||
{"label":"E", "x":3.5, "y":1},
|
||||
{"label":"R", "x":4.5, "y":1},
|
||||
{"label":"T", "x":5.5, "y":1},
|
||||
{"label":"Y", "x":6.5, "y":1},
|
||||
{"label":"U", "x":7.5, "y":1},
|
||||
{"label":"I", "x":8.5, "y":1},
|
||||
{"label":"O", "x":9.5, "y":1},
|
||||
{"label":"P", "x":10.5, "y":1},
|
||||
{"label":"{", "x":11.5, "y":1},
|
||||
{"label":"}", "x":12.5, "y":1},
|
||||
{"label":"Backspace", "x":13.5, "y":1, "w":1.5},
|
||||
{"label":"Delete", "x":15.25, "y":1},
|
||||
{"label":"End", "x":16.25, "y":1},
|
||||
{"label":"PgDn", "x":17.25, "y":1},
|
||||
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
|
||||
{"label":"A", "x":1.75, "y":2},
|
||||
{"label":"S", "x":2.75, "y":2},
|
||||
{"label":"D", "x":3.75, "y":2},
|
||||
{"label":"F", "x":4.75, "y":2},
|
||||
{"label":"G", "x":5.75, "y":2},
|
||||
{"label":"H", "x":6.75, "y":2},
|
||||
{"label":"J", "x":7.75, "y":2},
|
||||
{"label":"K", "x":8.75, "y":2},
|
||||
{"label":"L", "x":9.75, "y":2},
|
||||
{"label":":", "x":10.75, "y":2},
|
||||
{"label":"\"", "x":11.75, "y":2},
|
||||
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
|
||||
{"label":"Shift", "x":0, "y":3, "w":2.25},
|
||||
{"label":"Z", "x":2.25, "y":3},
|
||||
{"label":"X", "x":3.25, "y":3},
|
||||
{"label":"C", "x":4.25, "y":3},
|
||||
{"label":"V", "x":5.25, "y":3},
|
||||
{"label":"B", "x":6.25, "y":3},
|
||||
{"label":"N", "x":7.25, "y":3},
|
||||
{"label":"M", "x":8.25, "y":3},
|
||||
{"label":"<", "x":9.25, "y":3},
|
||||
{"label":">", "x":10.25, "y":3},
|
||||
{"label":"?", "x":11.25, "y":3},
|
||||
{"label":"Shift", "x":12.25, "y":3, "w":1.75},
|
||||
{"label":"MO(1)", "x":14, "y":3},
|
||||
{"label":"\u2191", "x":16.25, "y":3},
|
||||
{"label":"Ctrl", "x":0, "y":4, "w":1.5},
|
||||
{"label":"Win", "x":1.5, "y":4},
|
||||
{"label":"Alt", "x":2.5, "y":4, "w":1.5},
|
||||
{"x":4, "y":4, "w":7},
|
||||
{"label":"Alt", "x":11, "y":4, "w":1.5},
|
||||
{"label":"Win", "x":12.5, "y":4},
|
||||
{"label":"Ctrl", "x":13.5, "y":4, "w":1.5},
|
||||
{"label":"\u2190", "x":15.25, "y":4},
|
||||
{"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}]
|
||||
},
|
||||
"LAYOUT_ansi": {
|
||||
"layout": [{"label":"Esc", "x":0, "y":0},
|
||||
{"label":"!", "x":1, "y":0},
|
||||
{"label":"@", "x":2, "y":0},
|
||||
{"label":"#", "x":3, "y":0},
|
||||
{"label":"$", "x":4, "y":0},
|
||||
{"label":"%", "x":5, "y":0},
|
||||
{"label":"^", "x":6, "y":0},
|
||||
{"label":"&", "x":7, "y":0},
|
||||
{"label":"*", "x":8, "y":0},
|
||||
{"label":"(", "x":9, "y":0},
|
||||
{"label":")", "x":10, "y":0},
|
||||
{"label":"_", "x":11, "y":0},
|
||||
{"label":"+", "x":12, "y":0},
|
||||
{"label":"Backspace", "x":13, "y":0, "w":2},
|
||||
{"label":"Insert", "x":15.25, "y":0},
|
||||
{"label":"Home", "x":16.25, "y":0},
|
||||
{"label":"PgUp", "x":17.25, "y":0},
|
||||
{"label":"Tab", "x":0, "y":1, "w":1.5},
|
||||
{"label":"Q", "x":1.5, "y":1},
|
||||
{"label":"W", "x":2.5, "y":1},
|
||||
{"label":"E", "x":3.5, "y":1},
|
||||
{"label":"R", "x":4.5, "y":1},
|
||||
{"label":"T", "x":5.5, "y":1},
|
||||
{"label":"Y", "x":6.5, "y":1},
|
||||
{"label":"U", "x":7.5, "y":1},
|
||||
{"label":"I", "x":8.5, "y":1},
|
||||
{"label":"O", "x":9.5, "y":1},
|
||||
{"label":"P", "x":10.5, "y":1},
|
||||
{"label":"{", "x":11.5, "y":1},
|
||||
{"label":"}", "x":12.5, "y":1},
|
||||
{"label":"|", "x":13.5, "y":1, "w":1.5},
|
||||
{"label":"Delete", "x":15.25, "y":1},
|
||||
{"label":"End", "x":16.25, "y":1},
|
||||
{"label":"PgDn", "x":17.25, "y":1},
|
||||
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
|
||||
{"label":"A", "x":1.75, "y":2},
|
||||
{"label":"S", "x":2.75, "y":2},
|
||||
{"label":"D", "x":3.75, "y":2},
|
||||
{"label":"F", "x":4.75, "y":2},
|
||||
{"label":"G", "x":5.75, "y":2},
|
||||
{"label":"H", "x":6.75, "y":2},
|
||||
{"label":"J", "x":7.75, "y":2},
|
||||
{"label":"K", "x":8.75, "y":2},
|
||||
{"label":"L", "x":9.75, "y":2},
|
||||
{"label":":", "x":10.75, "y":2},
|
||||
{"label":"\"", "x":11.75, "y":2},
|
||||
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
|
||||
{"label":"Shift", "x":0, "y":3, "w":2.25},
|
||||
{"label":"Z", "x":2.25, "y":3},
|
||||
{"label":"X", "x":3.25, "y":3},
|
||||
{"label":"C", "x":4.25, "y":3},
|
||||
{"label":"V", "x":5.25, "y":3},
|
||||
{"label":"B", "x":6.25, "y":3},
|
||||
{"label":"N", "x":7.25, "y":3},
|
||||
{"label":"M", "x":8.25, "y":3},
|
||||
{"label":"<", "x":9.25, "y":3},
|
||||
{"label":">", "x":10.25, "y":3},
|
||||
{"label":"?", "x":11.25, "y":3},
|
||||
{"label":"Shift", "x":12.25, "y":3, "w":2.75},
|
||||
{"label":"\u2191", "x":16.25, "y":3},
|
||||
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
|
||||
{"label":"Win", "x":1.25, "y":4, "w":1.25},
|
||||
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
|
||||
{"x":3.75, "y":4, "w":6.25},
|
||||
{"label":"Alt", "x":10, "y":4, "w":1.25},
|
||||
{"label":"Win", "x":11.25, "y":4, "w":1.25},
|
||||
{"label":"Menu", "x":12.5, "y":4, "w":1.25},
|
||||
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25},
|
||||
{"label":"\u2190", "x":15.25, "y":4},
|
||||
{"label":"\u2193", "x":16.25, "y":4},
|
||||
{"label":"\u2192", "x":17.25, "y":4}]
|
||||
}
|
||||
}
|
||||
}
|
19
keyboards/absinthe/keymaps/ansi/config.h
Normal file
19
keyboards/absinthe/keymaps/ansi/config.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* Copyright 2020 cfbender
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
32
keyboards/absinthe/keymaps/ansi/keymap.c
Normal file
32
keyboards/absinthe/keymaps/ansi/keymap.c
Normal file
@@ -0,0 +1,32 @@
|
||||
/* Copyright 2020 cfbender
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_ansi(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
[1] = LAYOUT_ansi(
|
||||
KC_TRNS, 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_TRNS, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_TOG, RGB_RMOD, RGB_MOD, RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,RGB_VAD,RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS)
|
||||
};
|
3
keyboards/absinthe/keymaps/ansi/readme.md
Normal file
3
keyboards/absinthe/keymaps/ansi/readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# The all ANSI keymap for absinthe
|
||||
|
||||

|
19
keyboards/absinthe/keymaps/default/config.h
Normal file
19
keyboards/absinthe/keymaps/default/config.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* Copyright 2020 cfbender
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
42
keyboards/absinthe/keymaps/default/keymap.c
Normal file
42
keyboards/absinthe/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,42 @@
|
||||
/* Copyright 2020 cfbender
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_default(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_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_BSPC, KC_DEL, KC_END, KC_PGDN,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
[1] = LAYOUT_default(
|
||||
KC_TRNS, 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_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, RGB_TOG, RGB_RMOD, RGB_MOD, RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,RGB_VAD,RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS)
|
||||
};
|
||||
|
||||
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
} else {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
}
|
||||
}
|
6
keyboards/absinthe/keymaps/default/readme.md
Normal file
6
keyboards/absinthe/keymaps/default/readme.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# The default keymap for absinthe
|
||||
|
||||
|
||||
Tsangan HHKB style with split backspace and split right shift.
|
||||
|
||||

|
15
keyboards/absinthe/readme.md
Normal file
15
keyboards/absinthe/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# absinthe
|
||||
|
||||

|
||||
|
||||
A budget-friendly F-rowless TKL with a rotary encoder
|
||||
|
||||
* Keyboard Maintainer: [cfbender](https://cfbender.design)
|
||||
* Hardware Supported: Absinthe PCB, Elite-C (for rotary encoder support - alternatively you can use a Pro Micro without an encoder)
|
||||
* Hardware Availability: [GitHub](https://github.com/cfbender/keyboards/tree/master/absinthe)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make absinthe:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
45
keyboards/absinthe/rules.mk
Normal file
45
keyboards/absinthe/rules.mk
Normal file
@@ -0,0 +1,45 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader selection
|
||||
# Teensy halfkay
|
||||
# Pro Micro caterina
|
||||
# Atmel DFU atmel-dfu
|
||||
# LUFA DFU lufa-dfu
|
||||
# QMK DFU qmk-dfu
|
||||
# ATmega32A bootloadHID
|
||||
# ATmega328P USBasp
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
# If you don't know the bootloader type, then you can specify the
|
||||
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
|
||||
# Otherwise, delete this section
|
||||
# Teensy halfKay 512
|
||||
# Teensy++ halfKay 1024
|
||||
# Atmel DFU loader 4096
|
||||
# LUFA bootloader 4096
|
||||
# USBaspLoader 2048
|
||||
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = no # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||
ENCODER_ENABLE = yes
|
||||
RGBLIGHT_ENABLE = yes
|
||||
# EXTRAFLAGS += -flto
|
@@ -331,7 +331,7 @@
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_CFG_USE_MEMCORE)
|
||||
#define CH_CFG_USE_MEMCORE FALSE
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@@ -331,7 +331,7 @@
|
||||
* @note The default is @p TRUE.
|
||||
*/
|
||||
#if !defined(CH_CFG_USE_MEMCORE)
|
||||
#define CH_CFG_USE_MEMCORE FALSE
|
||||
#define CH_CFG_USE_MEMCORE TRUE
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
173
keyboards/ai03/orbit_x/config.h
Normal file
173
keyboards/ai03/orbit_x/config.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
Copyright 2019 Ryota Goto
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xA103
|
||||
#define PRODUCT_ID 0x0014
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER ai03 Design Studio
|
||||
#define PRODUCT OrbitX
|
||||
#define DESCRIPTION High-end compact ergonomic keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8 // Double the rows for split
|
||||
#define MATRIX_COLS 6
|
||||
|
||||
/*
|
||||
* Keyboard Matrix Assignments
|
||||
*
|
||||
* Change this to how you wired your keyboard
|
||||
* COLS: AVR pins used for columns, left to right
|
||||
* ROWS: AVR pins used for rows, top to bottom
|
||||
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||
*
|
||||
*/
|
||||
#define MATRIX_ROW_PINS { D7, D6, D4, F0 }
|
||||
#define MATRIX_COL_PINS { E6, F6, B1, B0, C7, C6 }
|
||||
#define MATRIX_ROW_PINS_RIGHT { B5, D7, B4, D4 }
|
||||
#define MATRIX_COL_PINS_RIGHT { D6, B6, B1, B0, B3, B2 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/*
|
||||
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||
*/
|
||||
#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||
#define SPLIT_HAND_PIN D5
|
||||
#define SPLIT_USB_DETECT
|
||||
#define SPLIT_USB_TIMEOUT 2500
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||
*/
|
||||
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* key combination for magic key command */
|
||||
/* defined by default; to change, uncomment and set to the combination you want */
|
||||
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP H
|
||||
//#define MAGIC_KEY_HELP_ALT SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER0_ALT GRAVE
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER B
|
||||
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
|
||||
/* disable these deprecated features by default */
|
||||
#define NO_ACTION_MACRO
|
||||
#define NO_ACTION_FUNCTION
|
||||
|
||||
/* Bootmagic Lite key configuration */
|
||||
// #define BOOTMAGIC_LITE_ROW 0
|
||||
// #define BOOTMAGIC_LITE_COLUMN 0
|
61
keyboards/ai03/orbit_x/info.json
Normal file
61
keyboards/ai03/orbit_x/info.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"keyboard_name": "Orbit-X",
|
||||
"url": "",
|
||||
"maintainer": "ai03",
|
||||
"width": 13.5,
|
||||
"height": 4.38,
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"x":0, "y":0.38},
|
||||
{"x":1, "y":0.38},
|
||||
{"x":2, "y":0.13},
|
||||
{"x":3, "y":0},
|
||||
{"x":4, "y":0.13},
|
||||
{"x":5, "y":0.25},
|
||||
{"x":7.5, "y":0.25},
|
||||
{"x":8.5, "y":0.13},
|
||||
{"x":9.5, "y":0},
|
||||
{"x":10.5, "y":0.13},
|
||||
{"x":11.5, "y":0.38},
|
||||
{"x":12.5, "y":0.38},
|
||||
{"x":0, "y":1.38},
|
||||
{"x":1, "y":1.38},
|
||||
{"x":2, "y":1.13},
|
||||
{"x":3, "y":1.0},
|
||||
{"x":4, "y":1.13},
|
||||
{"x":5, "y":1.25},
|
||||
{"x":7.5, "y":1.25},
|
||||
{"x":8.5, "y":1.13},
|
||||
{"x":9.5, "y":1.0},
|
||||
{"x":10.5, "y":1.13},
|
||||
{"x":11.5, "y":1.38},
|
||||
{"x":12.5, "y":1.38},
|
||||
{"x":0, "y":2.38},
|
||||
{"x":1, "y":2.38},
|
||||
{"x":2, "y":2.13},
|
||||
{"x":3, "y":2},
|
||||
{"x":4, "y":2.13},
|
||||
{"x":5, "y":2.25},
|
||||
{"x":7.5, "y":2.25},
|
||||
{"x":8.5, "y":2.13},
|
||||
{"x":9.5, "y":2},
|
||||
{"x":10.5, "y":2.13},
|
||||
{"x":11.5, "y":2.38},
|
||||
{"x":12.5, "y":2.38},
|
||||
{"x":0, "y":3.38},
|
||||
{"x":1, "y":3.38},
|
||||
{"x":2, "y":3.13},
|
||||
{"x":3, "y":3},
|
||||
{"x":4.25, "y":3.38},
|
||||
{"x":5.25, "y":3.25, "h":1.5},
|
||||
{"x":7.25, "y":3.25, "h":1.5},
|
||||
{"x":8.25, "y":3.38},
|
||||
{"x":9.5, "y":3},
|
||||
{"x":10.5, "y":3.13},
|
||||
{"x":11.5, "y":3.38},
|
||||
{"x":12.5, "y":3.38}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
59
keyboards/ai03/orbit_x/keymaps/default/keymap.c
Normal file
59
keyboards/ai03/orbit_x/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/* Copyright 2019 Ryota Goto
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Defines names for use in layer keycodes and the keymap
|
||||
enum layer_names {
|
||||
_BASE,
|
||||
_NUM,
|
||||
_NAV,
|
||||
_FN
|
||||
};
|
||||
|
||||
/*
|
||||
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
|
||||
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
|
||||
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
|
||||
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Base */
|
||||
[_BASE] = LAYOUT(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
MO(3), KC_TAB, KC_LGUI, KC_LALT, MO(2), KC_SPC, KC_SPC, MO(1), KC_TAB, KC_DEL, KC_PSCR, MO(3)
|
||||
),
|
||||
[_NUM] = LAYOUT(
|
||||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
|
||||
_______, KC_GRV, KC_SLSH, KC_LBRC, KC_LPRN, KC_MINS, KC_EQL, KC_RPRN, KC_RBRC, KC_BSLS, XXXXXXX, _______,
|
||||
_______, KC_TILD, KC_QUES, KC_LCBR, XXXXXXX, KC_UNDS, KC_PLUS, XXXXXXX, KC_RCBR, KC_PIPE, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
[_NAV] = LAYOUT(
|
||||
_______, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, _______,
|
||||
_______, XXXXXXX, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______,
|
||||
_______, XXXXXXX, C(G(KC_LEFT)), XXXXXXX, C(G(KC_RGHT)), XXXXXXX, XXXXXXX, C(S(KC_TAB)), XXXXXXX, C(KC_TAB), XXXXXXX, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
[_FN] = LAYOUT(
|
||||
RESET, XXXXXXX, KC_F1, KC_F2, KC_F3, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, XXXXXXX, RESET,
|
||||
_______, XXXXXXX, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, KC_F10, KC_F11, KC_F12, XXXXXXX, _______,
|
||||
_______, XXXXXXX, KC_VOLD, XXXXXXX, KC_VOLU, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
3
keyboards/ai03/orbit_x/keymaps/default/readme.md
Normal file
3
keyboards/ai03/orbit_x/keymaps/default/readme.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# The default keymap for orbit_x
|
||||
|
||||
Basic keymap that works well in most cases.
|
59
keyboards/ai03/orbit_x/keymaps/via/keymap.c
Normal file
59
keyboards/ai03/orbit_x/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,59 @@
|
||||
/* Copyright 2020 Ryota Goto
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// Defines names for use in layer keycodes and the keymap
|
||||
enum layer_names {
|
||||
_BASE,
|
||||
_NUM,
|
||||
_NAV,
|
||||
_FN
|
||||
};
|
||||
|
||||
/*
|
||||
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
|
||||
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
|
||||
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
|
||||
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
|
||||
*/
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
/* Base */
|
||||
[_BASE] = LAYOUT(
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
MO(3), KC_TAB, KC_LGUI, KC_LALT, MO(2), KC_SPC, KC_SPC, MO(1), KC_TAB, KC_DEL, KC_PSCR, MO(3)
|
||||
),
|
||||
[_NUM] = LAYOUT(
|
||||
_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
|
||||
_______, KC_GRV, KC_SLSH, KC_LBRC, KC_LPRN, KC_MINS, KC_EQL, KC_RPRN, KC_RBRC, KC_BSLS, XXXXXXX, _______,
|
||||
_______, KC_TILD, KC_QUES, KC_LCBR, XXXXXXX, KC_UNDS, KC_PLUS, XXXXXXX, KC_RCBR, KC_PIPE, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
[_NAV] = LAYOUT(
|
||||
_______, XXXXXXX, XXXXXXX, KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, _______,
|
||||
_______, XXXXXXX, KC_HOME, KC_PGDN, KC_END, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, _______,
|
||||
_______, XXXXXXX, C(G(KC_LEFT)), XXXXXXX, C(G(KC_RGHT)), XXXXXXX, XXXXXXX, C(S(KC_TAB)), XXXXXXX, C(KC_TAB), XXXXXXX, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
[_FN] = LAYOUT(
|
||||
RESET, XXXXXXX, KC_F1, KC_F2, KC_F3, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, XXXXXXX, RESET,
|
||||
_______, XXXXXXX, KC_F4, KC_F5, KC_F6, XXXXXXX, XXXXXXX, KC_F10, KC_F11, KC_F12, XXXXXXX, _______,
|
||||
_______, XXXXXXX, KC_VOLD, XXXXXXX, KC_VOLU, XXXXXXX, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
2
keyboards/ai03/orbit_x/keymaps/via/readme.md
Normal file
2
keyboards/ai03/orbit_x/keymaps/via/readme.md
Normal file
@@ -0,0 +1,2 @@
|
||||
# The via keymap for orbit_x
|
||||
For use with VIA configurator only
|
1
keyboards/ai03/orbit_x/keymaps/via/rules.mk
Normal file
1
keyboards/ai03/orbit_x/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
18
keyboards/ai03/orbit_x/orbit_x.c
Normal file
18
keyboards/ai03/orbit_x/orbit_x.c
Normal file
@@ -0,0 +1,18 @@
|
||||
/* Copyright 2019 Ryota Goto
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "orbit_x.h"
|
||||
|
44
keyboards/ai03/orbit_x/orbit_x.h
Normal file
44
keyboards/ai03/orbit_x/orbit_x.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/* Copyright 2019 Ryota Goto
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
/* This is a shortcut to help you visually see your layout.
|
||||
*
|
||||
* The first section contains all of the arguments representing the physical
|
||||
* layout of the board and position of the keys.
|
||||
*
|
||||
* The second converts the arguments into a two-dimensional array which
|
||||
* represents the switch matrix.
|
||||
*/
|
||||
#define LAYOUT( \
|
||||
L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \
|
||||
L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \
|
||||
L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \
|
||||
L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \
|
||||
) \
|
||||
{ \
|
||||
{ L00, L01, L02, L03, L04, L05 }, \
|
||||
{ L10, L11, L12, L13, L14, L15 }, \
|
||||
{ L20, L21, L22, L23, L24, L25 }, \
|
||||
{ L30, L31, L32, L33, L34, L35 }, \
|
||||
{ R00, R01, R02, R03, R04, R05 }, \
|
||||
{ R10, R11, R12, R13, R14, R15 }, \
|
||||
{ R20, R21, R22, R23, R24, R25 }, \
|
||||
{ R30, R31, R32, R33, R34, R35 }, \
|
||||
}
|
15
keyboards/ai03/orbit_x/readme.md
Normal file
15
keyboards/ai03/orbit_x/readme.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# Orbit-X
|
||||
|
||||

|
||||
|
||||
A compact high-end split keyboard
|
||||
|
||||
* Keyboard Maintainer: [ai03](https://github.com/ai03-2725)
|
||||
* Hardware Supported: The Orbit-X keyboard PCB
|
||||
* Hardware Availability: Deskeys for official kit; open-source PCB [here](https://github.com/ai03-2725/Orbit/tree/master/OrbitX-PCB)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make ai03/orbit_x:via
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
33
keyboards/ai03/orbit_x/rules.mk
Normal file
33
keyboards/ai03/orbit_x/rules.mk
Normal file
@@ -0,0 +1,33 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader selection
|
||||
# Teensy halfkay
|
||||
# Pro Micro caterina
|
||||
# Atmel DFU atmel-dfu
|
||||
# LUFA DFU lufa-dfu
|
||||
# QMK DFU qmk-dfu
|
||||
# ATmega32A bootloadHID
|
||||
# ATmega328P USBasp
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = no # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
MIDI_ENABLE = no # MIDI support
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||
SPLIT_KEYBOARD = yes # Split keyboard
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user