Compare commits
414 Commits
0.11.2
...
kle2json_h
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69e5e15ccc | ||
|
|
543e663c68 | ||
|
|
0177fbd65b | ||
|
|
7f398eea50 | ||
|
|
df85940a47 | ||
|
|
cd1cfb7c36 | ||
|
|
2ee52e43a7 | ||
|
|
63472dfde7 | ||
|
|
2040fe3d8a | ||
|
|
88cfd3554a | ||
|
|
0f8b34771d | ||
|
|
34446b79d7 | ||
|
|
b7d4a9dc25 | ||
|
|
acec174fde | ||
|
|
1f8acb7619 | ||
|
|
070240f212 | ||
|
|
271c0cf136 | ||
|
|
f3ac792c09 | ||
|
|
e8e090aced | ||
|
|
7456e6c776 | ||
|
|
11bd98f684 | ||
|
|
b3de903a3d | ||
|
|
f27d8d9448 | ||
|
|
f12000a1b6 | ||
|
|
c07543133a | ||
|
|
266343666f | ||
|
|
2e9d091960 | ||
|
|
e190872b82 | ||
|
|
8e68003b28 | ||
|
|
13efa8290e | ||
|
|
d8a9974a41 | ||
|
|
988715910c | ||
|
|
7ecbc83e71 | ||
|
|
8da9219c16 | ||
|
|
ddfb558591 | ||
|
|
d321cb3f8b | ||
|
|
5209576828 | ||
|
|
8ed9eb9c7f | ||
|
|
f410dfa091 | ||
|
|
1d2a9a1cdb | ||
|
|
428eb5faad | ||
|
|
fcd921f3aa | ||
|
|
e45a2af683 | ||
|
|
e11d3d524d | ||
|
|
d288f2f5da | ||
|
|
c01a8b030e | ||
|
|
5fe3de3153 | ||
|
|
b5fc6f0682 | ||
|
|
39bd151472 | ||
|
|
08fdf086b7 | ||
|
|
8a2a39ed06 | ||
|
|
aab056a4a6 | ||
|
|
7b83bb188a | ||
|
|
565a038a3d | ||
|
|
e3da93e658 | ||
|
|
53e9213a22 | ||
|
|
a68d289fa5 | ||
|
|
da8423ca97 | ||
|
|
4ef4347543 | ||
|
|
42cdba8680 | ||
|
|
028d2c91dc | ||
|
|
e319d501f7 | ||
|
|
9f690c94b8 | ||
|
|
633d2cb648 | ||
|
|
6169b47e82 | ||
|
|
47b9b11009 | ||
|
|
f231f24dda | ||
|
|
10096fc42e | ||
|
|
5e5ee3f8de | ||
|
|
b51cc6d67a | ||
|
|
7071900407 | ||
|
|
d5c89c8ed5 | ||
|
|
6f6e28b4c7 | ||
|
|
f801c69c75 | ||
|
|
411b92e206 | ||
|
|
78b12dee89 | ||
|
|
1aa8a3b424 | ||
|
|
a8ac486555 | ||
|
|
0f5f6a6a75 | ||
|
|
a63db4b179 | ||
|
|
a038b712d0 | ||
|
|
09eb6381a9 | ||
|
|
ca8df55858 | ||
|
|
ade1a34cc8 | ||
|
|
fda514bbd7 | ||
|
|
c989da4cfd | ||
|
|
c9156b50d9 | ||
|
|
1b3504e329 | ||
|
|
9410b15ac9 | ||
|
|
992380a5dd | ||
|
|
163e47c29d | ||
|
|
b4ea0a70be | ||
|
|
ed94fe28bf | ||
|
|
c89930ca01 | ||
|
|
5e9b002808 | ||
|
|
a94044c15c | ||
|
|
154bf92b5b | ||
|
|
457042f179 | ||
|
|
aae0e12385 | ||
|
|
944feb2da5 | ||
|
|
e3ce3d6e30 | ||
|
|
b49c657ac1 | ||
|
|
dae6249efa | ||
|
|
ac433b218d | ||
|
|
4f2f21dc05 | ||
|
|
7dd99f2b22 | ||
|
|
8ee03f6a6b | ||
|
|
e29b9e32bb | ||
|
|
0c4663a802 | ||
|
|
5d0c0e7c12 | ||
|
|
599043e7ff | ||
|
|
bea897caf1 | ||
|
|
79265fc2c0 | ||
|
|
e85d904fe1 | ||
|
|
871d99e659 | ||
|
|
12568fb5a9 | ||
|
|
25109f79f1 | ||
|
|
824e1cd95d | ||
|
|
9634c72d7e | ||
|
|
2573ed8c6b | ||
|
|
8609fe8f46 | ||
|
|
25d9cdc88f | ||
|
|
77185961dc | ||
|
|
962b8d3814 | ||
|
|
7ee3eb50b0 | ||
|
|
122cf3ad0f | ||
|
|
525be128c9 | ||
|
|
5edfdeff50 | ||
|
|
7b7763469b | ||
|
|
221d8fd866 | ||
|
|
9748b6b847 | ||
|
|
3300164065 | ||
|
|
d1b9a7e1bd | ||
|
|
55843480ff | ||
|
|
8ea2650ab2 | ||
|
|
5fde2d730c | ||
|
|
99d6349978 | ||
|
|
1b7b72c0e9 | ||
|
|
0c5be869ff | ||
|
|
bbf0f65284 | ||
|
|
0b37c0dfa0 | ||
|
|
1d1d5da43f | ||
|
|
ffd7e44e5a | ||
|
|
48f4768d33 | ||
|
|
6c366ccf6a | ||
|
|
53eb7f0774 | ||
|
|
a4866b31d6 | ||
|
|
5544bf8524 | ||
|
|
f1a67c42a0 | ||
|
|
7ca4b61922 | ||
|
|
c6aa9c4ad7 | ||
|
|
b7f640ca76 | ||
|
|
f83eefba37 | ||
|
|
436b5394bb | ||
|
|
73dfc2b368 | ||
|
|
010271d6ea | ||
|
|
4551e57d64 | ||
|
|
cd0d2d0de5 | ||
|
|
7771e544ac | ||
|
|
6a292e11d3 | ||
|
|
5437c0af6e | ||
|
|
3e3f93c971 | ||
|
|
45bace1328 | ||
|
|
9136c122f8 | ||
|
|
a0af5eb307 | ||
|
|
cc4b93b330 | ||
|
|
363957f919 | ||
|
|
d40d1e4024 | ||
|
|
524da962d3 | ||
|
|
b2ab0af905 | ||
|
|
d6de97b116 | ||
|
|
d898d4a6fc | ||
|
|
7c95e5ef3e | ||
|
|
7c0cb18681 | ||
|
|
83d73b5407 | ||
|
|
e52b4797d3 | ||
|
|
f971934dab | ||
|
|
498d89f4b3 | ||
|
|
3656644c35 | ||
|
|
d5f3f7c126 | ||
|
|
bdc3578e29 | ||
|
|
e9ed5d7571 | ||
|
|
19fd0108d3 | ||
|
|
806aa9bc67 | ||
|
|
529dad88dd | ||
|
|
dc7081a823 | ||
|
|
b02c694992 | ||
|
|
fd177582ad | ||
|
|
dc6b0d3548 | ||
|
|
dee506c096 | ||
|
|
1c04608b0a | ||
|
|
78b2f120e5 | ||
|
|
47db2d3062 | ||
|
|
ce7d3855f4 | ||
|
|
286ab6d53f | ||
|
|
4eebefada7 | ||
|
|
3b06ab51e5 | ||
|
|
3dde354736 | ||
|
|
71b52416d8 | ||
|
|
824175e69c | ||
|
|
bf324c38e3 | ||
|
|
603d5fbeb1 | ||
|
|
f40b564683 | ||
|
|
325179eb63 | ||
|
|
2843e7f995 | ||
|
|
96a5e560d7 | ||
|
|
54e2bf3ede | ||
|
|
71fcfb3cb5 | ||
|
|
9453573080 | ||
|
|
8f867c1bef | ||
|
|
c0dcee96a8 | ||
|
|
37bb69686c | ||
|
|
4e0718a3b7 | ||
|
|
210e614d2a | ||
|
|
a380a26ad2 | ||
|
|
296a6cf4ea | ||
|
|
c8cd2caeac | ||
|
|
e3211e307e | ||
|
|
d7385676bc | ||
|
|
0239ce025a | ||
|
|
aee1798476 | ||
|
|
13bbeefc5a | ||
|
|
24e827ee1f | ||
|
|
63362a9c5e | ||
|
|
8cb52b2048 | ||
|
|
25b1367806 | ||
|
|
32f53c0671 | ||
|
|
624cafbfd2 | ||
|
|
d11116f734 | ||
|
|
5619b1d3db | ||
|
|
35e684d1ff | ||
|
|
bded5f473c | ||
|
|
45a1a3239d | ||
|
|
6890090fbb | ||
|
|
d66c14b71e | ||
|
|
03cbee8637 | ||
|
|
06f9297f94 | ||
|
|
a9f7d4dccc | ||
|
|
115b60b0e1 | ||
|
|
7797070b37 | ||
|
|
6ea4b06f9f | ||
|
|
973057cfe4 | ||
|
|
d9dcb716bf | ||
|
|
e58f69ea6a | ||
|
|
8346151fe0 | ||
|
|
1bd9570ece | ||
|
|
dc4c80eef4 | ||
|
|
398f67290c | ||
|
|
c4aae0e93b | ||
|
|
ddc27c2935 | ||
|
|
49b6c5fd83 | ||
|
|
41bf5505eb | ||
|
|
7938921f9e | ||
|
|
4352416d77 | ||
|
|
58107ebedf | ||
|
|
cb3dff5c3f | ||
|
|
d82ab56a14 | ||
|
|
4631e4ef8e | ||
|
|
14024fabeb | ||
|
|
45fa5416ab | ||
|
|
d60031b321 | ||
|
|
5e2b53541b | ||
|
|
9c205d4a29 | ||
|
|
c807695035 | ||
|
|
4f431e8a90 | ||
|
|
11669bb45b | ||
|
|
13b31938ce | ||
|
|
3295ac90ee | ||
|
|
a5dd5bfd26 | ||
|
|
0d42d7b87b | ||
|
|
2e0f2025bd | ||
|
|
9366ed7282 | ||
|
|
416dea2c54 | ||
|
|
37fb14f1b5 | ||
|
|
55f681a723 | ||
|
|
3925ff5342 | ||
|
|
c1b8b811ed | ||
|
|
0831a3181a | ||
|
|
9a04739b98 | ||
|
|
ac8cddda22 | ||
|
|
ac0ad5ad17 | ||
|
|
e6217b6aa6 | ||
|
|
6c8ed21022 | ||
|
|
795e82074d | ||
|
|
25a1cb5a15 | ||
|
|
70f40339c2 | ||
|
|
11ee2736bd | ||
|
|
10e4487ba3 | ||
|
|
d7e285a4d9 | ||
|
|
8ea7f4f45f | ||
|
|
6873c4cf91 | ||
|
|
4b03b6f7f4 | ||
|
|
1ebd243cdc | ||
|
|
a023484d64 | ||
|
|
b185816717 | ||
|
|
fdfcce57e1 | ||
|
|
501f2fdef1 | ||
|
|
ed76f4394f | ||
|
|
5b5d74a267 | ||
|
|
f77f715aa2 | ||
|
|
6c4b6531fe | ||
|
|
15373c8367 | ||
|
|
82bb47a2f1 | ||
|
|
f743ff2256 | ||
|
|
9517d90e84 | ||
|
|
b8b8a294d3 | ||
|
|
79d992d1e7 | ||
|
|
5e04ed9f53 | ||
|
|
cd67074f72 | ||
|
|
5689df7490 | ||
|
|
01c7108db5 | ||
|
|
cc14d32941 | ||
|
|
f440111b4b | ||
|
|
95c39b3727 | ||
|
|
56933b9b9f | ||
|
|
e03d72d71e | ||
|
|
563723392f | ||
|
|
2ae700c8c8 | ||
|
|
666861dd6f | ||
|
|
eb3964bd57 | ||
|
|
35f922df73 | ||
|
|
af03b92246 | ||
|
|
d354b1f0a4 | ||
|
|
95022bc366 | ||
|
|
399be2a9b3 | ||
|
|
ab2a43edb0 | ||
|
|
d17caeb8ec | ||
|
|
cf0ae2abe8 | ||
|
|
10f7f6009d | ||
|
|
7222210454 | ||
|
|
9346bd6f80 | ||
|
|
07502a28f7 | ||
|
|
a5a1f860c0 | ||
|
|
0e65e9ad51 | ||
|
|
3a69d688f2 | ||
|
|
7fba37db06 | ||
|
|
e2e6ff43ab | ||
|
|
4acfa14df1 | ||
|
|
b953a585d6 | ||
|
|
354262dfe9 | ||
|
|
dfeba3f9b6 | ||
|
|
41a76cd810 | ||
|
|
df3a81b31e | ||
|
|
b36e32a676 | ||
|
|
f1b082320e | ||
|
|
e31671ece0 | ||
|
|
8d6ad23b09 | ||
|
|
3aa2c122e1 | ||
|
|
a6a1289003 | ||
|
|
688b8df982 | ||
|
|
644dd9c388 | ||
|
|
d62e367280 | ||
|
|
3076f86dc1 | ||
|
|
63d06655e6 | ||
|
|
7043561459 | ||
|
|
6b1f96dca8 | ||
|
|
e199fb6190 | ||
|
|
c59f87a5d7 | ||
|
|
5cfbfc2c52 | ||
|
|
08bf9f9e74 | ||
|
|
2c121b3d8e | ||
|
|
cba76092eb | ||
|
|
bb79fbaccf | ||
|
|
5cf70f3993 | ||
|
|
af8697c85b | ||
|
|
54b932e844 | ||
|
|
351f258bed | ||
|
|
9971caa632 | ||
|
|
15200bd8f5 | ||
|
|
15faffacf4 | ||
|
|
f1fef16e4d | ||
|
|
684773f2d4 | ||
|
|
e3888281f4 | ||
|
|
e1ced62836 | ||
|
|
1e7661651c | ||
|
|
fac5e3b540 | ||
|
|
f05b1b54a9 | ||
|
|
64b395cb3a | ||
|
|
59832e7654 | ||
|
|
dc1eebb566 | ||
|
|
0f086df89f | ||
|
|
024b3bd0dd | ||
|
|
6ab0a6e796 | ||
|
|
7a6e7d87cc | ||
|
|
c1dc676d28 | ||
|
|
4444f3cc55 | ||
|
|
138c3e7042 | ||
|
|
7e2ba2784e | ||
|
|
a5a65fb1e2 | ||
|
|
ed2bb46658 | ||
|
|
fc85ebecd4 | ||
|
|
87291437bd | ||
|
|
777a30cb42 | ||
|
|
2989f9ce2b | ||
|
|
de44fdbaf2 | ||
|
|
bcab02b654 | ||
|
|
b5adf4d9e9 | ||
|
|
3aae5300e2 | ||
|
|
0892741b10 | ||
|
|
41347cdcec | ||
|
|
a8d0ec0749 | ||
|
|
33802ab5cd | ||
|
|
9c03a89596 | ||
|
|
eaa8c18174 | ||
|
|
3a77ef5fa3 | ||
|
|
a4da9c47c8 | ||
|
|
1124e51b11 | ||
|
|
58a5193a2b | ||
|
|
c7dab4bb25 | ||
|
|
0abf4647e3 | ||
|
|
9a0a2dce41 | ||
|
|
4a5388a2b6 | ||
|
|
3cc7d22732 | ||
|
|
990d5189d1 |
33
.github/workflows/auto_tag.yaml
vendored
Normal file
33
.github/workflows/auto_tag.yaml
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
name: Essential files modified
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- quantum/**/*
|
||||||
|
- tmk_core/**/*
|
||||||
|
- drivers/**/*
|
||||||
|
- tests/**/*
|
||||||
|
- util/**/*
|
||||||
|
- platforms/**/*
|
||||||
|
- Makefile
|
||||||
|
- '*.mk'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
# protect against those who develop with their fork on master
|
||||||
|
if: github.repository == 'qmk/qmk_firmware'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Bump version and push tag
|
||||||
|
uses: anothrNick/github-tag-action@1.26.0
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
DEFAULT_BUMP: 'patch'
|
||||||
37
.github/workflows/format.yaml
vendored
Normal file
37
.github/workflows/format.yaml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
name: Format Codebase
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: qmkfm/base_container
|
||||||
|
|
||||||
|
# protect against those who develop with their fork on master
|
||||||
|
if: github.repository == 'qmk/qmk_firmware'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.API_TOKEN_GITHUB }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y dos2unix
|
||||||
|
|
||||||
|
- name: Format files
|
||||||
|
run: |
|
||||||
|
bin/qmk cformat -a
|
||||||
|
bin/qmk pyformat
|
||||||
|
bin/qmk fileformat
|
||||||
|
|
||||||
|
- name: Commit files
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: Format code according to conventions for $GITHUB_SHA
|
||||||
|
commit_user_name: QMK Bot
|
||||||
|
commit_user_email: hello@qmk.fm
|
||||||
|
commit_author: QMK Bot <hello@qmk.fm>
|
||||||
@@ -19,7 +19,6 @@ addons:
|
|||||||
- llvm-toolchain-trusty-7
|
- llvm-toolchain-trusty-7
|
||||||
packages:
|
packages:
|
||||||
- diffutils
|
- diffutils
|
||||||
- dos2unix
|
|
||||||
- clang-format-7
|
- clang-format-7
|
||||||
- libstdc++-7-dev
|
- libstdc++-7-dev
|
||||||
script:
|
script:
|
||||||
|
|||||||
111
Makefile
111
Makefile
@@ -68,71 +68,15 @@ PATH_ELEMENTS := $(subst /, ,$(STARTING_DIR))
|
|||||||
# Initialize the path elements list for further processing
|
# Initialize the path elements list for further processing
|
||||||
$(eval $(call NEXT_PATH_ELEMENT))
|
$(eval $(call NEXT_PATH_ELEMENT))
|
||||||
|
|
||||||
# This function sets the KEYBOARD; KEYMAP and SUBPROJECT to the correct
|
|
||||||
# variables depending on which directory you stand in.
|
|
||||||
# It's really a very simple if else chain, if you squint enough,
|
|
||||||
# but the makefile syntax makes it very verbose.
|
|
||||||
# If we are in a subfolder of keyboards
|
|
||||||
#
|
|
||||||
# *** No longer needed **
|
|
||||||
#
|
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keyboards)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# KEYBOARD := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# # If we are in a subfolder of keymaps, or in other words in a keymap
|
|
||||||
# # folder
|
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# KEYMAP := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# # else if we are not in the keyboard folder itself
|
|
||||||
# else ifneq ($(CURRENT_PATH_ELEMENT),)
|
|
||||||
# # the we can assume it's a subproject, as no other folders
|
|
||||||
# # should have make files in them
|
|
||||||
# SUBPROJECT := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# # if we are inside a keymap folder of a subproject
|
|
||||||
# ifeq ($(CURRENT_PATH_ELEMENT),keymaps)
|
|
||||||
# $(eval $(call NEXT_PATH_ELEMENT))
|
|
||||||
# KEYMAP := $(CURRENT_PATH_ELEMENT)
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
define GET_KEYBOARDS
|
|
||||||
ifndef ALT_GET_KEYBOARDS
|
|
||||||
All_RULES_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/rules.mk))
|
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/rules.mk))
|
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/rules.mk))
|
|
||||||
|
|
||||||
KEYMAPS_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/keymaps/*/rules.mk))
|
|
||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/keymaps/*/rules.mk))
|
|
||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/keymaps/*/rules.mk))
|
|
||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/keymaps/*/rules.mk))
|
|
||||||
|
|
||||||
KEYBOARDS := $$(sort $$(filter-out $$(KEYMAPS_MK), $$(All_RULES_MK)))
|
|
||||||
else
|
|
||||||
KEYBOARDS := $(shell find keyboards/ -type f -iname "rules.mk" | grep -v keymaps | sed 's!keyboards/\(.*\)/rules.mk!\1!' | sort | uniq)
|
|
||||||
endif
|
|
||||||
endef
|
|
||||||
|
|
||||||
$(eval $(call GET_KEYBOARDS))
|
|
||||||
|
|
||||||
# Only consider folders with makefiles, to prevent errors in case there are extra folders
|
|
||||||
#KEYBOARDS += $(patsubst $(ROOD_DIR)/keyboards/%/rules.mk,%,$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
|
||||||
|
|
||||||
|
# Phony targets to enable a few simple make commands outside the main processing below.
|
||||||
.PHONY: list-keyboards
|
.PHONY: list-keyboards
|
||||||
list-keyboards:
|
list-keyboards:
|
||||||
echo $(KEYBOARDS)
|
util/list_keyboards.sh | sort -u | tr '\n' ' '
|
||||||
|
|
||||||
define PRINT_KEYBOARD
|
|
||||||
$(info $(PRINTING_KEYBOARD))
|
|
||||||
endef
|
|
||||||
|
|
||||||
.PHONY: generate-keyboards-file
|
.PHONY: generate-keyboards-file
|
||||||
generate-keyboards-file:
|
generate-keyboards-file:
|
||||||
$(foreach PRINTING_KEYBOARD,$(KEYBOARDS),$(eval $(call PRINT_KEYBOARD)))
|
util/list_keyboards.sh | sort -u
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@@ -158,8 +102,6 @@ endif
|
|||||||
# Uncomment these for debugging
|
# Uncomment these for debugging
|
||||||
# $(info Keyboard: $(KEYBOARD))
|
# $(info Keyboard: $(KEYBOARD))
|
||||||
# $(info Keymap: $(KEYMAP))
|
# $(info Keymap: $(KEYMAP))
|
||||||
# $(info Subproject: $(SUBPROJECT))
|
|
||||||
# $(info Keyboards: $(KEYBOARDS))
|
|
||||||
|
|
||||||
|
|
||||||
# Set the default goal depending on where we are running make from
|
# Set the default goal depending on where we are running make from
|
||||||
@@ -217,7 +159,6 @@ endef
|
|||||||
# A recursive helper function for finding the longest match
|
# A recursive helper function for finding the longest match
|
||||||
# $1 The list to be checked
|
# $1 The list to be checked
|
||||||
# It works by always removing the currently matched item from the list
|
# It works by always removing the currently matched item from the list
|
||||||
# and call itself recursively, until a match is found
|
|
||||||
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
|
define TRY_TO_MATCH_RULE_FROM_LIST_HELPER2
|
||||||
# Stop the recursion when the list is empty
|
# Stop the recursion when the list is empty
|
||||||
ifneq ($1,)
|
ifneq ($1,)
|
||||||
@@ -294,7 +235,7 @@ define PARSE_RULE
|
|||||||
$$(eval $$(call PARSE_TEST))
|
$$(eval $$(call PARSE_TEST))
|
||||||
# If the rule starts with the name of a known keyboard, then continue
|
# If the rule starts with the name of a known keyboard, then continue
|
||||||
# the parsing from PARSE_KEYBOARD
|
# the parsing from PARSE_KEYBOARD
|
||||||
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(KEYBOARDS)),true)
|
else ifeq ($$(call TRY_TO_MATCH_RULE_FROM_LIST,$$(shell util/list_keyboards.sh | sort -u)),true)
|
||||||
KEYBOARD_RULE=$$(MATCHED_ITEM)
|
KEYBOARD_RULE=$$(MATCHED_ITEM)
|
||||||
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
|
$$(eval $$(call PARSE_KEYBOARD,$$(MATCHED_ITEM)))
|
||||||
# Otherwise use the KEYBOARD variable, which is determined either by
|
# Otherwise use the KEYBOARD variable, which is determined either by
|
||||||
@@ -411,26 +352,9 @@ endef
|
|||||||
# if we are going to compile all keyboards, match the rest of the rule
|
# if we are going to compile all keyboards, match the rest of the rule
|
||||||
# for each of them
|
# for each of them
|
||||||
define PARSE_ALL_KEYBOARDS
|
define PARSE_ALL_KEYBOARDS
|
||||||
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(KEYBOARDS)))
|
$$(eval $$(call PARSE_ALL_IN_LIST,PARSE_KEYBOARD,$(shell util/list_keyboards.sh noci | sort -u)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# $1 Subproject
|
|
||||||
# When entering this, the keyboard and subproject are known, so now we need
|
|
||||||
# to determine which keymaps are going to get compiled
|
|
||||||
# define PARSE_SUBPROJECT
|
|
||||||
|
|
||||||
# endef
|
|
||||||
|
|
||||||
# If we want to parse all subprojects, but the keyboard doesn't have any,
|
|
||||||
# then use defaultsp instead
|
|
||||||
# define PARSE_ALL_SUBPROJECTS
|
|
||||||
# ifeq ($$(SUBPROJECTS),)
|
|
||||||
# $$(eval $$(call PARSE_SUBPROJECT,defaultsp))
|
|
||||||
# else
|
|
||||||
# $$(eval $$(call PARSE_ALL_IN_LIST,PARSE_SUBPROJECT,$$(SUBPROJECTS)))
|
|
||||||
# endif
|
|
||||||
# endef
|
|
||||||
|
|
||||||
# Prints a list of all known keymaps for the given keyboard
|
# Prints a list of all known keymaps for the given keyboard
|
||||||
define LIST_ALL_KEYMAPS
|
define LIST_ALL_KEYMAPS
|
||||||
COMMAND_true_LIST_KEYMAPS := \
|
COMMAND_true_LIST_KEYMAPS := \
|
||||||
@@ -572,13 +496,13 @@ if [ $$error_occurred -gt 0 ]; then $(HANDLE_ERROR); fi;
|
|||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Let's match everything, we handle all the rule parsing ourselves
|
# Catch everything and parse the command line ourselves.
|
||||||
.PHONY: %
|
.PHONY: %
|
||||||
%:
|
%:
|
||||||
# Check if we have the CMP tool installed
|
# 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;
|
cmp $(ROOT_DIR)/Makefile $(ROOT_DIR)/Makefile >/dev/null 2>&1; if [ $$? -gt 0 ]; then printf "$(MSG_NO_CMP)"; exit 1; fi;
|
||||||
# Ensure that bin/qmk works. This will be a failing check after the next develop merge on 2020 Aug 29.
|
# Ensure that bin/qmk works.
|
||||||
if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
if ! bin/qmk hello 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; exit 1; fi
|
||||||
# Check if the submodules are dirty, and display a warning if they are
|
# Check if the submodules are dirty, and display a warning if they are
|
||||||
ifndef SKIP_GIT
|
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 ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi
|
||||||
@@ -608,25 +532,6 @@ endif
|
|||||||
$(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
$(foreach TEST,$(sort $(TESTS)),$(RUN_TEST))
|
||||||
if [ -f $(ERROR_FILE) ]; then printf "$(MSG_ERRORS)" & exit 1; fi;
|
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
|
|
||||||
|
|
||||||
lib/%:
|
lib/%:
|
||||||
git submodule sync $?
|
git submodule sync $?
|
||||||
git submodule update --init $?
|
git submodule update --init $?
|
||||||
|
|||||||
@@ -90,13 +90,16 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","")
|
|||||||
include $(KEYBOARD_PATH_1)/rules.mk
|
include $(KEYBOARD_PATH_1)/rules.mk
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_1 := $(KEYBOARD_PATH_1)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_2 := $(KEYBOARD_PATH_2)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_3 := $(KEYBOARD_PATH_3)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_4 := $(KEYBOARD_PATH_4)/keymaps/$(KEYMAP)
|
||||||
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
|
MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
|
||||||
|
|
||||||
|
# Pull in rules from info.json
|
||||||
|
INFO_RULES_MK = $(shell bin/qmk generate-rules-mk --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/rules.mk)
|
||||||
|
include $(INFO_RULES_MK)
|
||||||
|
|
||||||
# Check for keymap.json first, so we can regenerate keymap.c
|
# Check for keymap.json first, so we can regenerate keymap.c
|
||||||
include build_json.mk
|
include build_json.mk
|
||||||
|
|
||||||
@@ -136,9 +139,7 @@ ifeq ($(strip $(CTPC)), yes)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
|
ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
|
||||||
TARGET := $(TARGET)_proton_c
|
include platforms/chibios/QMK_PROTON_C/convert_to_proton_c.mk
|
||||||
include platforms/chibios/GENERIC_STM32_F303XC/configs/proton_c.mk
|
|
||||||
OPT_DEFS += -DCONVERT_TO_PROTON_C
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(FORCE_LAYOUT),)
|
ifneq ($(FORCE_LAYOUT),)
|
||||||
@@ -292,6 +293,32 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
|||||||
CONFIG_H += $(KEYMAP_PATH)/config.h
|
CONFIG_H += $(KEYMAP_PATH)/config.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Pull in stuff from info.json
|
||||||
|
INFO_JSON_FILES :=
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_1)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_1)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_2)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_2)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_3)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_3)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_4)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_4)/info.json
|
||||||
|
endif
|
||||||
|
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/info.json)","")
|
||||||
|
INFO_JSON_FILES += $(KEYBOARD_PATH_5)/info.json
|
||||||
|
endif
|
||||||
|
|
||||||
|
CONFIG_H += $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h
|
||||||
|
|
||||||
|
$(KEYBOARD_OUTPUT)/src/info_config.h: $(INFO_JSON_FILES)
|
||||||
|
bin/qmk generate-config-h --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/info_config.h
|
||||||
|
|
||||||
|
$(KEYBOARD_OUTPUT)/src/layouts.h: $(INFO_JSON_FILES)
|
||||||
|
bin/qmk generate-layouts --quiet --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/layouts.h
|
||||||
|
|
||||||
# project specific files
|
# project specific files
|
||||||
SRC += $(KEYBOARD_SRC) \
|
SRC += $(KEYBOARD_SRC) \
|
||||||
$(KEYMAP_C) \
|
$(KEYMAP_C) \
|
||||||
@@ -366,8 +393,9 @@ all:
|
|||||||
echo "skipped" >&2
|
echo "skipped" >&2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
build: elf cpfirmware
|
build: $(KEYBOARD_OUTPUT)/src/info_config.h $(KEYBOARD_OUTPUT)/src/layouts.h elf cpfirmware
|
||||||
check-size: build
|
check-size: build
|
||||||
|
check-md5: build
|
||||||
objs-size: build
|
objs-size: build
|
||||||
|
|
||||||
include show_options.mk
|
include show_options.mk
|
||||||
|
|||||||
@@ -66,4 +66,3 @@ include $(TMK_PATH)/rules.mk
|
|||||||
|
|
||||||
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
|
$(shell mkdir -p $(BUILD_DIR)/test 2>/dev/null)
|
||||||
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
|
$(shell mkdir -p $(TEST_OBJ) 2>/dev/null)
|
||||||
|
|
||||||
|
|||||||
@@ -154,18 +154,38 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RGBLIGHT_ENABLE ?= no
|
||||||
|
VALID_RGBLIGHT_TYPES := WS2812 APA102 custom
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
|
||||||
|
RGBLIGHT_DRIVER ?= custom
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||||
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
RGBLIGHT_DRIVER ?= WS2812
|
||||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
|
||||||
SRC += $(QUANTUM_DIR)/color.c
|
ifeq ($(filter $(RGBLIGHT_DRIVER),$(VALID_RGBLIGHT_TYPES)),)
|
||||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
$(error RGBLIGHT_DRIVER="$(RGBLIGHT_DRIVER)" is not a valid RGB type)
|
||||||
CIE1931_CURVE := yes
|
|
||||||
RGB_KEYCODES_ENABLE := yes
|
|
||||||
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
|
|
||||||
OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
|
|
||||||
else
|
else
|
||||||
|
POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
|
||||||
|
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||||
|
SRC += $(QUANTUM_DIR)/color.c
|
||||||
|
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||||
|
CIE1931_CURVE := yes
|
||||||
|
RGB_KEYCODES_ENABLE := yes
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_DRIVER)), WS2812)
|
||||||
WS2812_DRIVER_REQUIRED := yes
|
WS2812_DRIVER_REQUIRED := yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_DRIVER)), APA102)
|
||||||
|
APA102_DRIVER_REQUIRED := yes
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGBLIGHT_DRIVER)), custom)
|
||||||
|
OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@@ -243,6 +263,11 @@ endif
|
|||||||
WS2812_DRIVER_REQUIRED := yes
|
WS2812_DRIVER_REQUIRED := yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(RGB_MATRIX_DRIVER)), APA102)
|
||||||
|
OPT_DEFS += -DAPA102
|
||||||
|
APA102_DRIVER_REQUIRED := yes
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
|
ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
|
||||||
OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
|
OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
|
||||||
endif
|
endif
|
||||||
@@ -345,6 +370,11 @@ ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(strip $(APA102_DRIVER_REQUIRED)), yes)
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/apa102
|
||||||
|
SRC += apa102.c
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
|
||||||
CIE1931_CURVE := yes
|
CIE1931_CURVE := yes
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -50,4 +50,3 @@ This document marks the inaugural Breaking Change merge. A list of changes follo
|
|||||||
* `KC_DELT` was a redundant, undocumented alias for `KC_DELETE`
|
* `KC_DELT` was a redundant, undocumented alias for `KC_DELETE`
|
||||||
* It has been removed and all its uses replaced with the more common `KC_DEL` alias
|
* It has been removed and all its uses replaced with the more common `KC_DEL` alias
|
||||||
* Around 90 keymaps (mostly for ErgoDox boards) have been modified as a result
|
* Around 90 keymaps (mostly for ErgoDox boards) have been modified as a result
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Totally new to QMK? There are two ways to get started:
|
|||||||
|
|
||||||
## Make It Yours
|
## Make It Yours
|
||||||
|
|
||||||
QMK has lots of [features](features.md) to explore, and a good deal of reference documentation to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
QMK has lots of features to explore, and a good deal of reference documentation to dig through. Most features are taken advantage of by modifying your [keymap](keymap.md), and changing the [keycodes](keycodes.md).
|
||||||
|
|
||||||
## Need help?
|
## Need help?
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
* QMK API
|
* QMK API
|
||||||
* [Overview](api_overview.md)
|
* [Overview](api_overview.md)
|
||||||
* [API Documentation](api_docs.md)
|
* [API Documentation](api_docs.md)
|
||||||
|
* [KLE To info.json](kle2json_guide.md)
|
||||||
* [Keyboard Support](reference_configurator_support.md)
|
* [Keyboard Support](reference_configurator_support.md)
|
||||||
* [Adding Default Keymaps](configurator_default_keymaps.md)
|
* [Adding Default Keymaps](configurator_default_keymaps.md)
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ Creates a keymap.json from a keymap.c.
|
|||||||
**Usage**:
|
**Usage**:
|
||||||
|
|
||||||
```
|
```
|
||||||
qmk c2json [--no-cpp] [-o OUTPUT] filename
|
qmk c2json -km KEYMAP -kb KEYBOARD [-q] [--no-cpp] [-o OUTPUT] filename
|
||||||
```
|
```
|
||||||
|
|
||||||
## `qmk lint`
|
## `qmk lint`
|
||||||
@@ -296,26 +296,44 @@ This command allows you to generate QMK documentation locally. It can be uses fo
|
|||||||
qmk generate-docs
|
qmk generate-docs
|
||||||
```
|
```
|
||||||
|
|
||||||
## `qmk kle2json`
|
## `qmk generate-rgb-breathe-table`
|
||||||
|
|
||||||
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.
|
This command generates a lookup table (LUT) header file for the [RGB Lighting](feature_rgblight.md) feature's breathing animation. Place this file in your keyboard or keymap directory as `rgblight_breathe_table.h` to override the default LUT in `quantum/`.
|
||||||
|
|
||||||
**Usage**:
|
**Usage**:
|
||||||
|
|
||||||
```
|
```
|
||||||
qmk kle2json [-f] <filename>
|
qmk generate-rgb-breathe-table [-q] [-o OUTPUT] [-m MAX] [-c CENTER]
|
||||||
|
```
|
||||||
|
|
||||||
|
## `qmk kle2json`
|
||||||
|
|
||||||
|
This command allows you to convert [Keyboard-Layout-Editor.com](http://keyboard-layout-editor.com) layouts into `info.json` layouts. It will also create a `keymap.json` file for your layout. This saves a lot of time when setting up a new keyboard.
|
||||||
|
|
||||||
|
To use this command your KLE will need to follow a specific format. See [KLE To info.json](kle2json_guide.md) for more details.
|
||||||
|
|
||||||
|
**Usage**:
|
||||||
|
|
||||||
|
```
|
||||||
|
qmk kle2json -kb <keyboard> [-km KEYMAP] [-l LAYOUT] <filename-or-kle-id>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Examples**:
|
**Examples**:
|
||||||
|
|
||||||
```
|
With only a KLE id:
|
||||||
$ qmk kle2json kle.txt
|
|
||||||
☒ File info.json already exists, use -f or --force to overwrite.
|
|
||||||
```
|
|
||||||
|
|
||||||
```
|
```
|
||||||
$ qmk kle2json -f kle.txt -f
|
$ qmk kle2json -kb clueboard/new60 70aaa4bed76d0b2f67fd165641239552
|
||||||
Ψ Wrote out to info.json
|
Ψ Wrote file keyboards/clueboard/new60/info.json
|
||||||
|
Ψ Wrote file keyboards/clueboard/new60/keymaps/default/keymap.json
|
||||||
|
```
|
||||||
|
|
||||||
|
With a full URL:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ qmk kle2json -kb clueboard/new60 'http://www.keyboard-layout-editor.com/#/gists/70aaa4bed76d0b2f67fd165641239552'
|
||||||
|
Ψ Wrote file keyboards/clueboard/new60/info.json
|
||||||
|
Ψ Wrote file keyboards/clueboard/new60/keymaps/default/keymap.json
|
||||||
```
|
```
|
||||||
|
|
||||||
## `qmk pyformat`
|
## `qmk pyformat`
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ This level contains all of the options for that particular keymap. If you wish t
|
|||||||
|
|
||||||
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
This is a C header file that is one of the first things included, and will persist over the whole project (if included). Lots of variables can be set here and accessed elsewhere. The `config.h` file shouldn't be including other `config.h` files, or anything besides this:
|
||||||
|
|
||||||
#include "config_common.h"
|
```c
|
||||||
|
#include "config_common.h"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Hardware Options
|
## Hardware Options
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ Bevorzugst Du es lieber auf der Befehlszeile zu debuggen? Dafür eignet sich das
|
|||||||
|
|
||||||
Manchmal ist es hilfreich Debug-Nachrichten innerhalb deines eigenen [Custom Codes](de/custom_quantum_functions.md) zu drucken. Das ist ziemlich einfach. Beginne damit `print.h` am Anfang deiner Datei zu inkludieren:
|
Manchmal ist es hilfreich Debug-Nachrichten innerhalb deines eigenen [Custom Codes](de/custom_quantum_functions.md) zu drucken. Das ist ziemlich einfach. Beginne damit `print.h` am Anfang deiner Datei zu inkludieren:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
Danach stehen dir verschiedene Druck-Funktionen zur Verfügung:
|
Danach stehen dir verschiedene Druck-Funktionen zur Verfügung:
|
||||||
|
|
||||||
|
|||||||
@@ -14,16 +14,11 @@ Some keyboards may have specific instructions for entering the bootloader. For e
|
|||||||
To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button.
|
To put a device in bootloader mode with USBaspLoader, tap the `RESET` button while holding down the `BOOT` button.
|
||||||
Alternatively, hold `BOOT` while inserting the USB cable.
|
Alternatively, hold `BOOT` while inserting the USB cable.
|
||||||
|
|
||||||
Zadig will automatically detect the bootloader device. You may sometimes need to check **Options → List All Devices**.
|
Zadig should automatically detect the bootloader device, but you may sometimes need to check **Options → List All Devices** and select the device from the dropdown instead.
|
||||||
|
|
||||||
- For keyboards with Atmel AVR MCUs, the bootloader will be named something similar to `ATm32U4DFU`, and have a Vendor ID of `03EB`.
|
|
||||||
- USBasp bootloaders will appear as `USBasp`, with a VID/PID of `16C0:05DC`.
|
|
||||||
- AVR keyboards flashed with the QMK-DFU bootloader will be named `<keyboard name> Bootloader` and will also have the VID `03EB`.
|
|
||||||
- For most ARM keyboards, it will be called `STM32 BOOTLOADER`, and have a VID/PID of `0483:DF11`.
|
|
||||||
|
|
||||||
!> If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is probably not in bootloader mode. The arrow will be colored orange and you will be asked to confirm modifying a system driver. **Do not** proceed if this is the case!
|
!> If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is probably not in bootloader mode. The arrow will be colored orange and you will be asked to confirm modifying a system driver. **Do not** proceed if this is the case!
|
||||||
|
|
||||||
If the arrow appears green, select the driver, and click **Install Driver**. The `libusb-win32` driver will usually work for AVR, and `WinUSB` for ARM, but if you still cannot flash the board, try installing a different driver from the list. USBAspLoader devices must use the `libusbK` driver.
|
If the arrow appears green, select the driver, and click **Install Driver**. See the [list of known bootloaders](#list-of-known-bootloaders) for the correct driver to install.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -43,6 +38,40 @@ Right-click it and hit **Uninstall device**. Make sure to tick **Delete the driv
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
Click **Action → Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again!
|
Click **Action → Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again! Otherwise, repeat the process until Zadig reports the correct driver.
|
||||||
|
|
||||||
?> A full reboot of your computer may sometimes be necessary at this point, to get Windows to pick up the new driver.
|
?> A full reboot of your computer may sometimes be necessary at this point, to get Windows to pick up the new driver.
|
||||||
|
|
||||||
|
## List of Known Bootloaders
|
||||||
|
|
||||||
|
This is a list of known bootloader devices and their USB vendor and product IDs, as well as the correct driver to assign for flashing with QMK. Note that the usbser and HidUsb drivers are built in to Windows, and cannot be assigned with Zadig - if your device has an incorrect driver, you must use the Device Manager to uninstall it as described in the previous section.
|
||||||
|
|
||||||
|
The device name here is the name that appears in Zadig, and may not be what the Device Manager or QMK Toolbox displays.
|
||||||
|
|
||||||
|
|Bootloader |Device Name |VID/PID |Driver |
|
||||||
|
|-------------|------------------------------|--------------|-------|
|
||||||
|
|`atmel-dfu` |ATmega16u2 DFU |`03EB:2FEF` |libusb0|
|
||||||
|
|`atmel-dfu` |ATmega32U2 DFU |`03EB:2FF0` |libusb0|
|
||||||
|
|`atmel-dfu` |ATm16U4 DFU V1.0.2 |`03EB:2FF3` |libusb0|
|
||||||
|
|`atmel-dfu` |ATm32U4DFU |`03EB:2FF4` |libusb0|
|
||||||
|
|`atmel-dfu` |*none* (AT90USB64) |`03EB:2FF9` |libusb0|
|
||||||
|
|`atmel-dfu` |AT90USB128 DFU |`03EB:2FFB` |libusb0|
|
||||||
|
|`qmk-dfu` |(keyboard name) Bootloader |As `atmel-dfu`|libusb0|
|
||||||
|
|`halfkay` |*none* |`16C0:0478` |HidUsb |
|
||||||
|
|`caterina` |Pro Micro 3.3V |`1B4F:9203` |usbser |
|
||||||
|
|`caterina` |Pro Micro 5V |`1B4F:9205` |usbser |
|
||||||
|
|`caterina` |LilyPadUSB |`1B4F:9207` |usbser |
|
||||||
|
|`caterina` |Pololu A-Star 32U4 Bootloader |`1FFB:0101` |usbser |
|
||||||
|
|`caterina` |Arduino Leonardo |`2341:0036` |usbser |
|
||||||
|
|`caterina` |Arduino Micro |`2341:0037` |usbser |
|
||||||
|
|`caterina` |Adafruit Feather 32u4 |`239A:000C` |usbser |
|
||||||
|
|`caterina` |Adafruit ItsyBitsy 32u4 3V |`239A:000D` |usbser |
|
||||||
|
|`caterina` |Adafruit ItsyBitsy 32u4 5V |`239A:000E` |usbser |
|
||||||
|
|`caterina` |Arduino Leonardo |`2A03:0036` |usbser |
|
||||||
|
|`caterina` |Arduino Micro |`2A03:0037` |usbser |
|
||||||
|
|`bootloadHID`|HIDBoot |`16C0:05DF` |HidUsb |
|
||||||
|
|`USBasp` |USBasp |`16C0:05DC` |libusbK|
|
||||||
|
|`apm32-dfu` |APM32 DFU ISP Mode |`314B:0106` |WinUSB |
|
||||||
|
|`stm32-dfu` |STM32 BOOTLOADER |`0483:DF11` |WinUSB |
|
||||||
|
|`kiibohd` |Kiibohd DFU Bootloader |`1C11:B007` |WinUSB |
|
||||||
|
|`stm32duino` |Maple 003 |`1EAF:0003` |WinUSB |
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ Module | Equivalent `#define` | Source
|
|||||||
-----------------|---------------------------------|------------------------------------------
|
-----------------|---------------------------------|------------------------------------------
|
||||||
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
|
CAT24C512 EEPROM | `#define EEPROM_I2C_CAT24C512` | <https://www.sparkfun.com/products/14764>
|
||||||
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
|
RM24C512C EEPROM | `#define EEPROM_I2C_RM24C512C` | <https://www.sparkfun.com/products/14764>
|
||||||
|
24LC64 EEPROM | `#define EEPROM_I2C_24LC64` | <https://www.microchip.com/wwwproducts/en/24LC64>
|
||||||
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/wwwproducts/en/24LC128>
|
24LC128 EEPROM | `#define EEPROM_I2C_24LC128` | <https://www.microchip.com/wwwproducts/en/24LC128>
|
||||||
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
|
24LC256 EEPROM | `#define EEPROM_I2C_24LC256` | <https://www.sparkfun.com/products/525>
|
||||||
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
|
MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/product/1895>
|
||||||
|
|||||||
@@ -33,4 +33,3 @@ Soporte para hasta 2 controladores. Cada controlador implementa 2 matrices charl
|
|||||||
## IS31FL3733
|
## IS31FL3733
|
||||||
|
|
||||||
Soporte para hasta un solo controlador con espacio para expansión. Cada controlador puede controlar 192 LEDs individuales o 64 LEDs RGB. Para obtener más información sobre cómo configurar el controlador, consulta la página de [Matriz RGB](feature_rgb_matrix.md).
|
Soporte para hasta un solo controlador con espacio para expansión. Cada controlador puede controlar 192 LEDs individuales o 64 LEDs RGB. Para obtener más información sobre cómo configurar el controlador, consulta la página de [Matriz RGB](feature_rgb_matrix.md).
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ Para plataformas compatibles, [QMK Toolbox](https://github.com/qmk/qmk_toolbox)
|
|||||||
|
|
||||||
A veces, es útil imprimir mensajes de depuración desde tu [código personalizado](custom_quantum_functions.md). Hacerlo es bastante simple. Comienza incluyendo `print.h` al principio de tu fichero:
|
A veces, es útil imprimir mensajes de depuración desde tu [código personalizado](custom_quantum_functions.md). Hacerlo es bastante simple. Comienza incluyendo `print.h` al principio de tu fichero:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
Después de eso puedes utilzar algunas funciones print diferentes:
|
Después de eso puedes utilzar algunas funciones print diferentes:
|
||||||
|
|
||||||
|
|||||||
@@ -148,4 +148,3 @@ The following old names for existing algorithms will continue to be supported, h
|
|||||||
* eager_pk - old name for sym_eager_pk
|
* eager_pk - old name for sym_eager_pk
|
||||||
* sym_pk - old name for sym_defer_pk
|
* sym_pk - old name for sym_defer_pk
|
||||||
* eager_pr - old name for sym_eager_pr
|
* eager_pr - old name for sym_eager_pr
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,9 @@ Which would send Left Control+`a` (Left Control down, `a`, Left Control up) - no
|
|||||||
|
|
||||||
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
By default, it assumes a US keymap with a QWERTY layout; if you want to change that (e.g. if your OS uses software Colemak), include this somewhere in your keymap:
|
||||||
|
|
||||||
#include <sendstring_colemak.h>
|
```c
|
||||||
|
#include "sendstring_colemak.h"
|
||||||
|
```
|
||||||
|
|
||||||
### Strings in Memory
|
### Strings in Memory
|
||||||
|
|
||||||
@@ -207,7 +209,7 @@ SEND_STRING(".."SS_TAP(X_END));
|
|||||||
|
|
||||||
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
There are some functions you may find useful in macro-writing. Keep in mind that while you can write some fairly advanced code within a macro, if your functionality gets too complex you may want to define a custom keycode instead. Macros are meant to be simple.
|
||||||
|
|
||||||
?> You can also use the functions described in [Useful function](ref_functions.md) for additional functionality. For example `reset_keyboard()` allows you to reset the keyboard as part of a macro.
|
?> You can also use the functions described in [Useful functions](ref_functions.md) for additional functionality. For example `reset_keyboard()` allows you to reset the keyboard as part of a macro.
|
||||||
|
|
||||||
### `record->event.pressed`
|
### `record->event.pressed`
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ In your keymap you can use the following keycodes to map key presses to mouse ac
|
|||||||
Mouse keys supports three different modes to move the cursor:
|
Mouse keys supports three different modes to move the cursor:
|
||||||
|
|
||||||
* **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed.
|
* **Accelerated (default):** Holding movement keys accelerates the cursor until it reaches its maximum speed.
|
||||||
|
* **Kinetic:** Holding movement keys accelerates the cursor with its speed following a quadratic curve until it reaches its maximum speed.
|
||||||
* **Constant:** Holding movement keys moves the cursor at constant speeds.
|
* **Constant:** Holding movement keys moves the cursor at constant speeds.
|
||||||
* **Combined:** Holding movement keys accelerates the cursor until it reaches its maximum speed, but holding acceleration and movement keys simultaneously moves the cursor at constant speeds.
|
* **Combined:** Holding movement keys accelerates the cursor until it reaches its maximum speed, but holding acceleration and movement keys simultaneously moves the cursor at constant speeds.
|
||||||
|
|
||||||
@@ -56,7 +57,8 @@ This is the default mode. You can adjust the cursor and scrolling acceleration u
|
|||||||
|Define |Default|Description |
|
|Define |Default|Description |
|
||||||
|----------------------------|-------|---------------------------------------------------------|
|
|----------------------------|-------|---------------------------------------------------------|
|
||||||
|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement|
|
|`MOUSEKEY_DELAY` |300 |Delay between pressing a movement key and cursor movement|
|
||||||
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements |
|
|`MOUSEKEY_INTERVAL` |50 |Time between cursor movements in milliseconds |
|
||||||
|
|`MOUSEKEY_MOVE_DELTA` |5 |Step size |
|
||||||
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
|`MOUSEKEY_MAX_SPEED` |10 |Maximum cursor speed at which acceleration stops |
|
||||||
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
|`MOUSEKEY_TIME_TO_MAX` |20 |Time until maximum cursor speed is reached |
|
||||||
|`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement |
|
|`MOUSEKEY_WHEEL_DELAY` |300 |Delay between pressing a wheel key and wheel movement |
|
||||||
@@ -73,6 +75,30 @@ Tips:
|
|||||||
|
|
||||||
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
Cursor acceleration uses the same algorithm as the X Window System MouseKeysAccel feature. You can read more about it [on Wikipedia](https://en.wikipedia.org/wiki/Mouse_keys).
|
||||||
|
|
||||||
|
### Kinetic Mode
|
||||||
|
|
||||||
|
This is an extension of the accelerated mode. The kinetic mode uses a quadratic curve on the cursor speed which allows precise movements at the beginning and allows to cover large distances by increasing cursor speed quickly thereafter. You can adjust the cursor and scrolling acceleration using the following settings in your keymap’s `config.h` file:
|
||||||
|
|
||||||
|
|Define |Default |Description |
|
||||||
|
|--------------------------------------|---------|---------------------------------------------------------------|
|
||||||
|
|`MK_KINETIC_SPEED` |undefined|Enable kinetic mode |
|
||||||
|
|`MOUSEKEY_DELAY` |8 |Delay between pressing a movement key and cursor movement |
|
||||||
|
|`MOUSEKEY_INTERVAL` |8 |Time between cursor movements in milliseconds |
|
||||||
|
|`MOUSEKEY_MOVE_DELTA` |25 |Step size for accelerating from initial to base speed |
|
||||||
|
|`MOUSEKEY_INITIAL_SPEED` |100 |Initial speed of the cursor in pixel per second |
|
||||||
|
|`MOUSEKEY_BASE_SPEED` |1000 |Maximum cursor speed at which acceleration stops |
|
||||||
|
|`MOUSEKEY_DECELERATED_SPEED` |400 |Decelerated cursor speed |
|
||||||
|
|`MOUSEKEY_ACCELERATED_SPEED` |3000 |Accelerated cursor speed |
|
||||||
|
|`MOUSEKEY_WHEEL_INITIAL_MOVEMENTS` |16 |Initial number of movements of the mouse wheel |
|
||||||
|
|`MOUSEKEY_WHEEL_BASE_MOVEMENTS` |32 |Maximum number of movements at which acceleration stops |
|
||||||
|
|`MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS`|48 |Accelerated wheel movements |
|
||||||
|
|`MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS`|8 |Decelerated wheel movements |
|
||||||
|
|
||||||
|
Tips:
|
||||||
|
|
||||||
|
* The smoothness of the cursor movement depends on the `MOUSEKEY_INTERVAL` setting. The shorter the interval is set the smoother the movement will be. Setting the value too low makes the cursor unresponsive. Lower settings are possible if the micro processor is fast enough. For example: At an interval of `8` milliseconds, `125` movements per second will be initiated. With a base speed of `1000` each movement will move the cursor by `8` pixels.
|
||||||
|
* Mouse wheel movements are implemented differently from cursor movements. While it's okay for the cursor to move multiple pixels at once for the mouse wheel this would lead to jerky movements. Instead, the mouse wheel operates at step size `1`. Setting mouse wheel speed is done by adjusting the number of wheel movements per second.
|
||||||
|
|
||||||
### Constant mode
|
### Constant mode
|
||||||
|
|
||||||
In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting.
|
In this mode you can define multiple different speeds for both the cursor and the mouse wheel. There is no acceleration. `KC_ACL0`, `KC_ACL1` and `KC_ACL2` change the cursor and scroll speed to their respective setting.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ void raw_hid_receive(uint8_t *data, uint8_t length) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
`raw_hid_receive` can receive variable size packets from host with maximum length `RAW_EPSIZE`. `raw_hid_send` on the other hand can send packets to host of exactly `RAW_EPSIZE` length, therefore it should be used with data of length `RAW_EPSIZE`.
|
These two functions send and receive packets of length `RAW_EPSIZE` bytes to and from the host (32 on LUFA/ChibiOS/V-USB, 64 on ATSAM).
|
||||||
|
|
||||||
Make sure to flash raw enabled firmware before proceeding with working on the host side.
|
Make sure to flash raw enabled firmware before proceeding with working on the host side.
|
||||||
|
|
||||||
|
|||||||
@@ -129,6 +129,28 @@ Configure the hardware via your `config.h`:
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
### APA102 :id=apa102
|
||||||
|
|
||||||
|
There is basic support for APA102 based addressable LED strands. To enable it, add this to your `rules.mk`:
|
||||||
|
|
||||||
|
```makefile
|
||||||
|
RGB_MATRIX_ENABLE = yes
|
||||||
|
RGB_MATRIX_DRIVER = APA102
|
||||||
|
```
|
||||||
|
|
||||||
|
Configure the hardware via your `config.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
// The pin connected to the data pin of the LEDs
|
||||||
|
#define RGB_DI_PIN D7
|
||||||
|
// The pin connected to the clock pin of the LEDs
|
||||||
|
#define RGB_CI_PIN D6
|
||||||
|
// The number of LEDs connected
|
||||||
|
#define DRIVER_LED_TOTAL 70
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
|
From this point forward the configuration is the same for all the drivers. The `led_config_t` struct provides a key electrical matrix to led index lookup table, what the physical position of each LED is on the board, and what type of key or usage the LED if the LED represents. Here is a brief example:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
@@ -306,6 +328,12 @@ To declare new effects, create a new `rgb_matrix_user/kb.inc` that looks somethi
|
|||||||
`rgb_matrix_user.inc` should go in the root of the keymap directory.
|
`rgb_matrix_user.inc` should go in the root of the keymap directory.
|
||||||
`rgb_matrix_kb.inc` should go in the root of the keyboard directory.
|
`rgb_matrix_kb.inc` should go in the root of the keyboard directory.
|
||||||
|
|
||||||
|
To use custom effects in your code, simply prepend `RGB_MATRIX_CUSTOM_` to the effect name specified in `RGB_MATRIX_EFFECT()`. For example, an effect declared as `RGB_MATRIX_EFFECT(my_cool_effect)` would be referenced with:
|
||||||
|
|
||||||
|
```c
|
||||||
|
rgb_matrix_mode(RGB_MATRIX_CUSTOM_my_cool_effect);
|
||||||
|
```
|
||||||
|
|
||||||
```c
|
```c
|
||||||
// !!! DO NOT ADD #pragma once !!! //
|
// !!! DO NOT ADD #pragma once !!! //
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Currently QMK supports the following addressable LEDs (however, the white LED in
|
|||||||
|
|
||||||
* WS2811, WS2812, WS2812B, WS2812C, etc.
|
* WS2811, WS2812, WS2812B, WS2812C, etc.
|
||||||
* SK6812, SK6812MINI, SK6805
|
* SK6812, SK6812MINI, SK6805
|
||||||
|
* APA102
|
||||||
|
|
||||||
These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs.
|
These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs.
|
||||||
|
|
||||||
@@ -21,11 +22,19 @@ On keyboards with onboard RGB LEDs, it is usually enabled by default. If it is n
|
|||||||
RGBLIGHT_ENABLE = yes
|
RGBLIGHT_ENABLE = yes
|
||||||
```
|
```
|
||||||
|
|
||||||
At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these.
|
For APA102 LEDs, add the following to your `rules.mk`:
|
||||||
|
|
||||||
|
```make
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
RGBLIGHT_DRIVER = APA102
|
||||||
|
```
|
||||||
|
|
||||||
|
At minimum you must define the data pin your LED strip is connected to, and the number of LEDs in the strip, in your `config.h`. For APA102 LEDs, you must also define the clock pin. If your keyboard has onboard RGB LEDs, and you are simply creating a keymap, you usually won't need to modify these.
|
||||||
|
|
||||||
|Define |Description |
|
|Define |Description |
|
||||||
|---------------|---------------------------------------------------------------------------------------------------------|
|
|---------------|---------------------------------------------------------------------------------------------------------|
|
||||||
|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs |
|
|`RGB_DI_PIN` |The pin connected to the data pin of the LEDs |
|
||||||
|
|`RGB_CI_PIN` |The pin connected to the clock pin of the LEDs (APA102 only) |
|
||||||
|`RGBLED_NUM` |The number of LEDs connected |
|
|`RGBLED_NUM` |The number of LEDs connected |
|
||||||
|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` |
|
|`RGBLED_SPLIT` |(Optional) For split keyboards, the number of LEDs connected on each half directly wired to `RGB_DI_PIN` |
|
||||||
|
|
||||||
|
|||||||
@@ -85,4 +85,3 @@ While the tempo defines the absolute speed at which the sequencer goes through t
|
|||||||
|`void sequencer_activate_track(uint8_t track);` |Activate the `track` |
|
|`void sequencer_activate_track(uint8_t track);` |Activate the `track` |
|
||||||
|`void sequencer_deactivate_track(uint8_t track);` |Deactivate the `track` |
|
|`void sequencer_deactivate_track(uint8_t track);` |Deactivate the `track` |
|
||||||
|`void sequencer_toggle_single_active_track(uint8_t track);` |Set `track` as the only active track or deactivate all |
|
|`void sequencer_toggle_single_active_track(uint8_t track);` |Set `track` as the only active track or deactivate all |
|
||||||
|
|
||||||
|
|||||||
@@ -181,6 +181,16 @@ If you're having issues with serial communication, you can change this value, as
|
|||||||
* **`4`**: about 26kbps
|
* **`4`**: about 26kbps
|
||||||
* **`5`**: about 20kbps
|
* **`5`**: about 20kbps
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define SPLIT_MODS_ENABLE
|
||||||
|
```
|
||||||
|
|
||||||
|
This enables transmitting modifier state (normal, weak and oneshot) to the non
|
||||||
|
primary side of the split keyboard. This adds a few bytes of data to the split
|
||||||
|
communication protocol and may impact the matrix scan speed when enabled.
|
||||||
|
The purpose of this feature is to support cosmetic use of modifer state (e.g.
|
||||||
|
displaying status on an OLED screen).
|
||||||
|
|
||||||
### Hardware Configuration Options
|
### Hardware Configuration Options
|
||||||
|
|
||||||
There are some settings that you may need to configure, based on how the hardware is set up.
|
There are some settings that you may need to configure, based on how the hardware is set up.
|
||||||
|
|||||||
@@ -129,4 +129,3 @@ As defined in `keymap_steno.h`.
|
|||||||
|`STN_RES1`||(GeminiPR only)|
|
|`STN_RES1`||(GeminiPR only)|
|
||||||
|`STN_RES2`||(GeminiPR only)|
|
|`STN_RES2`||(GeminiPR only)|
|
||||||
|`STN_PWR`||(GeminiPR only)|
|
|`STN_PWR`||(GeminiPR only)|
|
||||||
|
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ If you wanted to consolidate macros and other functions into your userspace for
|
|||||||
|
|
||||||
First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
|
First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes
|
||||||
|
|
||||||
Then add `#include <name.h>` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
|
Then add `#include "<name>.h"` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap.
|
||||||
|
|
||||||
Once you've done that, you'll want to set the keycode definitions that you need to the `<name>.h` file. For instance:
|
Once you've done that, you'll want to set the keycode definitions that you need to the `<name>.h` file. For instance:
|
||||||
```c
|
```c
|
||||||
|
|||||||
@@ -42,7 +42,9 @@ Vous préférez une solution basée sur le terminal? [hid_listen](https://www.pj
|
|||||||
|
|
||||||
Parfois, il est utile d'afficher des messages de débugage depuis votre [code custom](custom_quantum_functions.md). Le faire est assez simple. Commencez par ajouter `print.h` au début de votre fichier:
|
Parfois, il est utile d'afficher des messages de débugage depuis votre [code custom](custom_quantum_functions.md). Le faire est assez simple. Commencez par ajouter `print.h` au début de votre fichier:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
Une fois fait, vous pouvez utiliser les fonctions print suivantes:
|
Une fois fait, vous pouvez utiliser les fonctions print suivantes:
|
||||||
|
|
||||||
|
|||||||
@@ -47,4 +47,3 @@ This configuration is from usbasploader's Makefile.
|
|||||||
# | | +----- LB 2..1 (No memory lock features enabled)
|
# | | +----- LB 2..1 (No memory lock features enabled)
|
||||||
# | +--------- BLB0 2..1 (No restrictions for SPM or LPM accessing the Application section)
|
# | +--------- BLB0 2..1 (No restrictions for SPM or LPM accessing the Application section)
|
||||||
# +--------------- BLB1 2..1 (No restrictions for SPM or LPM accessing the Boot Loader section)
|
# +--------------- BLB1 2..1 (No restrictions for SPM or LPM accessing the Boot Loader section)
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ Established materials and techniques include:
|
|||||||
| Short lengths of wire | [u/xicolinguada's ortho build](https://www.reddit.com/r/MechanicalKeyboards/comments/c39k4f/my_first_hand_wired_keyboard_its_not_perfect_but/) | Easier to strip the wire | More difficult to place | 
|
| Short lengths of wire | [u/xicolinguada's ortho build](https://www.reddit.com/r/MechanicalKeyboards/comments/c39k4f/my_first_hand_wired_keyboard_its_not_perfect_but/) | Easier to strip the wire | More difficult to place | 
|
||||||
| Magnet/Enamelled wire | [Brett Kosinski's handwired alpha](http://blog.b-ark.ca/Blog-2019-01-27) and [fknraiden's custom board](https://geekhack.org/index.php?topic=74223.0) | Can be directly soldered onto (insulation burns off with heat) | Appearance? | 
|
| Magnet/Enamelled wire | [Brett Kosinski's handwired alpha](http://blog.b-ark.ca/Blog-2019-01-27) and [fknraiden's custom board](https://geekhack.org/index.php?topic=74223.0) | Can be directly soldered onto (insulation burns off with heat) | Appearance? | 
|
||||||
| Bending the legs of the diodes for the rows | [Matt3o's Brownfox](https://deskthority.net/viewtopic.php?f=7&t=6050) | Fewer solder joints required | Uninsulated | 
|
| Bending the legs of the diodes for the rows | [Matt3o's Brownfox](https://deskthority.net/viewtopic.php?f=7&t=6050) | Fewer solder joints required | Uninsulated | 
|
||||||
| Using ridid wiring (e.g. brass tube) | [u/d_stilgar's invisible hardline](https://www.reddit.com/r/MechanicalKeyboards/comments/8aw5j2/invisible_hardline_keyboard_progress_update_april/) and [u/jonasfasler's first attempt](https://www.reddit.com/r/MechanicalKeyboards/comments/de1jyv/my_first_attempt_at_handwiring_a_keyboard/) | Very pretty | More difficult. No physical insulation | 
|
| Using rigid wiring (e.g. brass tube) | [u/d_stilgar's invisible hardline](https://www.reddit.com/r/MechanicalKeyboards/comments/8aw5j2/invisible_hardline_keyboard_progress_update_april/) and [u/jonasfasler's first attempt](https://www.reddit.com/r/MechanicalKeyboards/comments/de1jyv/my_first_attempt_at_handwiring_a_keyboard/) | Very pretty | More difficult. No physical insulation | 
|
||||||
| Bare wire with insulation added after (e.g. kapton tape) | [Matt3o's 65% on his website](https://matt3o.com/hand-wiring-a-custom-keyboard/) | Easier (no wire stripping required) | Not as attractive | 
|
| Bare wire with insulation added after (e.g. kapton tape) | [Matt3o's 65% on his website](https://matt3o.com/hand-wiring-a-custom-keyboard/) | Easier (no wire stripping required) | Not as attractive | 
|
||||||
| Copper tape | [ManuForm Dactyl](https://github.com/tshort/dactyl-keyboard) | Very easy | Only really works when your plate/case aligns with the bottom of your switches | 
|
| Copper tape | [ManuForm Dactyl](https://github.com/tshort/dactyl-keyboard) | Very easy | Only really works when your plate/case aligns with the bottom of your switches | 
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ Letting the diode rest, grab your solder, and touch both it and the soldering ir
|
|||||||
|
|
||||||
The smoke that the rosin releases is harmful, so be careful not to breath it or get it in your eyes/face.
|
The smoke that the rosin releases is harmful, so be careful not to breath it or get it in your eyes/face.
|
||||||
|
|
||||||
After soldering things in place, it may be helpful to blow on the joint to push the smoke away from your face, and cool the solder quicker. You should see the solder develop a matte (not shiny) surface as it solidifies. Keep in mind that it will still be very hot afterwards, and will take a couple minutes to be cool to touch. Blow on it will accelerate this process.
|
After soldering things in place, it may be helpful to blow on the joint to push the smoke away from your face, and cool the solder quicker. You should see the solder develop a matte (not shiny) surface as it solidifies. Keep in mind that it will still be very hot afterwards, and will take a couple minutes to be cool to touch. Blowing on it will accelerate this process.
|
||||||
|
|
||||||
When the first diode is complete, the next one will need to be soldered to both the keyswitch, and the previous diode at the new elbow. That will look something like this:
|
When the first diode is complete, the next one will need to be soldered to both the keyswitch, and the previous diode at the new elbow. That will look something like this:
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,10 @@
|
|||||||
headings: 'h1, h2',
|
headings: 'h1, h2',
|
||||||
title: 'Table of Contents',
|
title: 'Table of Contents',
|
||||||
},
|
},
|
||||||
|
tabs: {
|
||||||
|
persist : false,
|
||||||
|
tabComments: false,
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
function (hook, vm) {
|
function (hook, vm) {
|
||||||
hook.beforeEach(function (html) {
|
hook.beforeEach(function (html) {
|
||||||
@@ -148,6 +152,7 @@
|
|||||||
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/search.min.js"></script>
|
||||||
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
|
<script src="//unpkg.com/docsify/lib/plugins/emoji.min.js"></script>
|
||||||
|
<script src="//unpkg.com/docsify-tabs@1"></script>
|
||||||
<script src="//unpkg.com/docsify-copy-code@2"></script>
|
<script src="//unpkg.com/docsify-copy-code@2"></script>
|
||||||
<script src="//unpkg.com/docsify-toc@1.0.0/dist/toc.js"></script>
|
<script src="//unpkg.com/docsify-toc@1.0.0/dist/toc.js"></script>
|
||||||
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
<script src="//unpkg.com/prismjs/components/prism-bash.min.js"></script>
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ QMK での全ての利用可能な設定にはデフォルトがあります。
|
|||||||
|
|
||||||
これは最初に include されるものの 1 つである C ヘッダファイルで、プロジェクト全体(もし含まれる場合)にわたって持続します。多くの変数をここで設定し、他の場所からアクセスすることができます。`config.h` ファイルでは、以下のもの以外の、他の `config.h` ファイルやその他のファイルの include をしないでください:
|
これは最初に include されるものの 1 つである C ヘッダファイルで、プロジェクト全体(もし含まれる場合)にわたって持続します。多くの変数をここで設定し、他の場所からアクセスすることができます。`config.h` ファイルでは、以下のもの以外の、他の `config.h` ファイルやその他のファイルの include をしないでください:
|
||||||
|
|
||||||
#include "config_common.h"
|
```c
|
||||||
|
#include "config_common.h"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## ハードウェアオプション
|
## ハードウェアオプション
|
||||||
|
|||||||
@@ -43,5 +43,3 @@ endif
|
|||||||
* eager_pk - キーごとにデバウンスします。状態が変化すると、応答は即座に行われ、その後そのキーは ```DEBOUNCE``` ミリ秒の間入力されません。
|
* eager_pk - キーごとにデバウンスします。状態が変化すると、応答は即座に行われ、その後そのキーは ```DEBOUNCE``` ミリ秒の間入力されません。
|
||||||
* sym_g - キーボードごとにデバウンスします。状態が変化すると、グローバルタイマが設定されます。```DEBOUNCE``` ミリ秒の間何も変化がなければ、全ての入力の変更がプッシュされます。
|
* sym_g - キーボードごとにデバウンスします。状態が変化すると、グローバルタイマが設定されます。```DEBOUNCE``` ミリ秒の間何も変化がなければ、全ての入力の変更がプッシュされます。
|
||||||
* sym_pk - キーごとにデバウンスします。状態が変化すると、キーごとのタイマーが設定されます。```DEBOUNCE``` ミリ秒の間そのキーに変化がなければ、キーの状態の変更がプッシュされます。
|
* sym_pk - キーごとにデバウンスします。状態が変化すると、キーごとのタイマーが設定されます。```DEBOUNCE``` ミリ秒の間そのキーに変化がなければ、キーの状態の変更がプッシュされます。
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,9 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
|
|
||||||
デフォルトでは、QWERTY レイアウトの US キーマップを想定しています; それを変更したい場合(例えば OS がソフトウェア Colemak を使う場合)、キーマップのどこかに以下を含めます:
|
デフォルトでは、QWERTY レイアウトの US キーマップを想定しています; それを変更したい場合(例えば OS がソフトウェア Colemak を使う場合)、キーマップのどこかに以下を含めます:
|
||||||
|
|
||||||
#include <sendstring_colemak.h>
|
```c
|
||||||
|
#include "sendstring_colemak.h"
|
||||||
|
```
|
||||||
|
|
||||||
### メモリ内の文字列
|
### メモリ内の文字列
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
|
|
||||||
最初に、全ての `keymap.c` ファイルを調べ、代わりに `process_record_user` を `process_record_keymap` に置き換えます。この方法では、これらのキーボードでキーボード固有のコードを使用でき、カスタムの "global" キーコードも使うことができます。また、`SAFE_RANGE` を `NEW_SAFE_RANGE` に置き換えて、キーコードが重複しないようにすることもできます。
|
最初に、全ての `keymap.c` ファイルを調べ、代わりに `process_record_user` を `process_record_keymap` に置き換えます。この方法では、これらのキーボードでキーボード固有のコードを使用でき、カスタムの "global" キーコードも使うことができます。また、`SAFE_RANGE` を `NEW_SAFE_RANGE` に置き換えて、キーコードが重複しないようにすることもできます。
|
||||||
|
|
||||||
次に、全ての keymap.c ファイルに `#include <name.h>` を追加します。これにより、各キーマップでそれらを再定義することなく新しいキーコードを使うことができます。
|
次に、全ての keymap.c ファイルに `#include "<name>.h"` を追加します。これにより、各キーマップでそれらを再定義することなく新しいキーコードを使うことができます。
|
||||||
|
|
||||||
それが完了したら、必要なキーコードの定義を `<name>.h` ファイルに設定します。例えば:
|
それが完了したら、必要なキーコードの定義を `<name>.h` ファイルに設定します。例えば:
|
||||||
```c
|
```c
|
||||||
|
|||||||
@@ -171,4 +171,3 @@
|
|||||||
* `device` 関連するデバイス
|
* `device` 関連するデバイス
|
||||||
|
|
||||||
* `func` 登録するコールバック関数
|
* `func` 登録するコールバック関数
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,9 @@ void keyboard_post_init_user(void) {
|
|||||||
|
|
||||||
[custom code](ja/custom_quantum_functions.md)内からデバッグメッセージを出力すると便利な場合があります。それはとても簡単です。ファイルの先頭に`print.h`のインクルードを追加します:
|
[custom code](ja/custom_quantum_functions.md)内からデバッグメッセージを出力すると便利な場合があります。それはとても簡単です。ファイルの先頭に`print.h`のインクルードを追加します:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
そのあとは、いくつかの異なった print 関数を使用することが出来ます。
|
そのあとは、いくつかの異なった print 関数を使用することが出来ます。
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ Proton C には1つのオンボード LED(C13)しかなく、デフォルトで
|
|||||||
|
|
||||||
```
|
```
|
||||||
MCU = STM32F303
|
MCU = STM32F303
|
||||||
|
BOARD = QMK_PROTON_C
|
||||||
```
|
```
|
||||||
|
|
||||||
次の変数が存在する場合は削除します。
|
次の変数が存在する場合は削除します。
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ HID Keyboard/Keypad usage ページでは 256 未満の usage が定義されて
|
|||||||
| Norwegian | `keymap_norwegian.h` |
|
| Norwegian | `keymap_norwegian.h` |
|
||||||
| Polish | `keymap_polish.h` |
|
| Polish | `keymap_polish.h` |
|
||||||
| Portuguese | `keymap_portuguese.h` |
|
| Portuguese | `keymap_portuguese.h` |
|
||||||
|
| Portuguese (macOS, ISO) | `keymap_portuguese_osx_iso.h` |
|
||||||
| Portuguese (Brazil) | `keymap_br_abnt2.h` |
|
| Portuguese (Brazil) | `keymap_br_abnt2.h` |
|
||||||
| Romanian | `keymap_romanian.h` |
|
| Romanian | `keymap_romanian.h` |
|
||||||
| Russian* | `keymap_russian.h` |
|
| Russian* | `keymap_russian.h` |
|
||||||
|
|||||||
@@ -124,17 +124,17 @@ See also: [Basic Keycodes](keycodes_basic.md)
|
|||||||
|`KC_F22` | |F22 |✔ | |✔ |
|
|`KC_F22` | |F22 |✔ | |✔ |
|
||||||
|`KC_F23` | |F23 |✔ | |✔ |
|
|`KC_F23` | |F23 |✔ | |✔ |
|
||||||
|`KC_F24` | |F24 |✔ | |✔ |
|
|`KC_F24` | |F24 |✔ | |✔ |
|
||||||
|`KC_EXECUTE` |`KC_EXEC` |Execute | | |✔ |
|
|`KC_EXECUTE` |`KC_EXEC` |Execute | | |✔ |
|
||||||
|`KC_HELP` | |Help | | |✔ |
|
|`KC_HELP` | |Help | | |✔ |
|
||||||
|`KC_MENU` | |Menu | | |✔ |
|
|`KC_MENU` | |Menu | | |✔ |
|
||||||
|`KC_SELECT` |`KC_SLCT` |Select | | |✔ |
|
|`KC_SELECT` |`KC_SLCT` |Select | | |✔ |
|
||||||
|`KC_STOP` | |Stop | | |✔ |
|
|`KC_STOP` | |Stop | | |✔ |
|
||||||
|`KC_AGAIN` |`KC_AGIN` |Again | | |✔ |
|
|`KC_AGAIN` |`KC_AGIN` |Again | | |✔ |
|
||||||
|`KC_UNDO` | |Undo | | |✔ |
|
|`KC_UNDO` | |Undo | | |✔ |
|
||||||
|`KC_CUT` | |Cut | | |✔ |
|
|`KC_CUT` | |Cut | | |✔ |
|
||||||
|`KC_COPY` | |Copy | | |✔ |
|
|`KC_COPY` | |Copy | | |✔ |
|
||||||
|`KC_PASTE` |`KC_PSTE` |Paste | | |✔ |
|
|`KC_PASTE` |`KC_PSTE` |Paste | | |✔ |
|
||||||
|`KC_FIND` | |Find | | |✔ |
|
|`KC_FIND` | |Find | | |✔ |
|
||||||
|`KC__MUTE` | |Mute | |✔ |✔ |
|
|`KC__MUTE` | |Mute | |✔ |✔ |
|
||||||
|`KC__VOLUP` | |Volume Up | |✔ |✔ |
|
|`KC__VOLUP` | |Volume Up | |✔ |✔ |
|
||||||
|`KC__VOLDOWN` | |Volume Down | |✔ |✔ |
|
|`KC__VOLDOWN` | |Volume Down | |✔ |✔ |
|
||||||
|
|||||||
@@ -144,48 +144,48 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07
|
|||||||
|
|
||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|------------------|------------------------------|------------------------------|
|
|------------------|------------------------------|--------------------------------------|
|
||||||
|`KC_PSCREEN` |`KC_PSCR` |Print Screen |
|
|`KC_PSCREEN` |`KC_PSCR` |Print Screen |
|
||||||
|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) |
|
|`KC_PAUSE` |`KC_PAUS`, `KC_BRK`, `KC_BRMU`|Pause, Brightness Up (macOS) |
|
||||||
|`KC_INSERT` |`KC_INS` |Insert |
|
|`KC_INSERT` |`KC_INS` |Insert |
|
||||||
|`KC_HOME` | |Home |
|
|`KC_HOME` | |Home |
|
||||||
|`KC_PGUP` | |Page Up |
|
|`KC_PGUP` | |Page Up |
|
||||||
|`KC_DELETE` |`KC_DEL` |Forward Delete |
|
|`KC_DELETE` |`KC_DEL` |Forward Delete |
|
||||||
|`KC_END` | |End |
|
|`KC_END` | |End |
|
||||||
|`KC_PGDOWN` |`KC_PGDN` |Page Down |
|
|`KC_PGDOWN` |`KC_PGDN` |Page Down |
|
||||||
|`KC_RIGHT` |`KC_RGHT` |Right Arrow |
|
|`KC_RIGHT` |`KC_RGHT` |Right Arrow |
|
||||||
|`KC_LEFT` | |Left Arrow |
|
|`KC_LEFT` | |Left Arrow |
|
||||||
|`KC_DOWN` | |Down Arrow |
|
|`KC_DOWN` | |Down Arrow |
|
||||||
|`KC_UP` | |Up Arrow |
|
|`KC_UP` | |Up Arrow |
|
||||||
|`KC_APPLICATION` |`KC_APP` |Application (Windows Menu Key)|
|
|`KC_APPLICATION` |`KC_APP` |Application (Windows Context Menu Key)|
|
||||||
|`KC_POWER` | |System Power (macOS/Linux) |
|
|`KC_POWER` | |System Power |
|
||||||
|`KC_EXECUTE` |`KC_EXEC` |Execute |
|
|`KC_EXECUTE` |`KC_EXEC` |Execute |
|
||||||
|`KC_HELP` | |Help |
|
|`KC_HELP` | |Help |
|
||||||
|`KC_MENU` | |Menu |
|
|`KC_MENU` | |Menu |
|
||||||
|`KC_SELECT` |`KC_SLCT` |Select |
|
|`KC_SELECT` |`KC_SLCT` |Select |
|
||||||
|`KC_STOP` | |Stop |
|
|`KC_STOP` | |Stop |
|
||||||
|`KC_AGAIN` |`KC_AGIN` |Again |
|
|`KC_AGAIN` |`KC_AGIN` |Again |
|
||||||
|`KC_UNDO` | |Undo |
|
|`KC_UNDO` | |Undo |
|
||||||
|`KC_CUT` | |Cut |
|
|`KC_CUT` | |Cut |
|
||||||
|`KC_COPY` | |Copy |
|
|`KC_COPY` | |Copy |
|
||||||
|`KC_PASTE` |`KC_PSTE` |Paste |
|
|`KC_PASTE` |`KC_PSTE` |Paste |
|
||||||
|`KC_FIND` | |Find |
|
|`KC_FIND` | |Find |
|
||||||
|`KC__MUTE` | |Mute (macOS) |
|
|`KC__MUTE` | |Mute |
|
||||||
|`KC__VOLUP` | |Volume Up (macOS) |
|
|`KC__VOLUP` | |Volume Up |
|
||||||
|`KC__VOLDOWN` | |Volume Down (macOS) |
|
|`KC__VOLDOWN` | |Volume Down |
|
||||||
|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase |
|
|`KC_ALT_ERASE` |`KC_ERAS` |Alternate Erase |
|
||||||
|`KC_SYSREQ` | |SysReq/Attention |
|
|`KC_SYSREQ` | |SysReq/Attention |
|
||||||
|`KC_CANCEL` | |Cancel |
|
|`KC_CANCEL` | |Cancel |
|
||||||
|`KC_CLEAR` |`KC_CLR` |Clear |
|
|`KC_CLEAR` |`KC_CLR` |Clear |
|
||||||
|`KC_PRIOR` | |Prior |
|
|`KC_PRIOR` | |Prior |
|
||||||
|`KC_RETURN` | |Return |
|
|`KC_RETURN` | |Return |
|
||||||
|`KC_SEPARATOR` | |Separator |
|
|`KC_SEPARATOR` | |Separator |
|
||||||
|`KC_OUT` | |Out |
|
|`KC_OUT` | |Out |
|
||||||
|`KC_OPER` | |Oper |
|
|`KC_OPER` | |Oper |
|
||||||
|`KC_CLEAR_AGAIN` | |Clear/Again |
|
|`KC_CLEAR_AGAIN` | |Clear/Again |
|
||||||
|`KC_CRSEL` | |CrSel/Props |
|
|`KC_CRSEL` | |CrSel/Props |
|
||||||
|`KC_EXSEL` | |ExSel |
|
|`KC_EXSEL` | |ExSel |
|
||||||
|
|
||||||
## Media Keys
|
## Media Keys
|
||||||
|
|
||||||
@@ -193,34 +193,34 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key
|
|||||||
|
|
||||||
?> Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes `KC_MEDIA_FAST_FORWARD`, `KC_MEDIA_REWIND`, `KC_MEDIA_NEXT_TRACK` and `KC_MEDIA_PREV_TRACK` skip within the current track when held, but skip the entire track when tapped.
|
?> Some of these keycodes may behave differently depending on the OS. For example, on macOS, the keycodes `KC_MEDIA_FAST_FORWARD`, `KC_MEDIA_REWIND`, `KC_MEDIA_NEXT_TRACK` and `KC_MEDIA_PREV_TRACK` skip within the current track when held, but skip the entire track when tapped.
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|-----------------------|---------|-----------------------------|
|
|-----------------------|---------|-------------------|
|
||||||
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|
|`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down |
|
||||||
|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
|
|`KC_SYSTEM_SLEEP` |`KC_SLEP`|System Sleep |
|
||||||
|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
|
|`KC_SYSTEM_WAKE` |`KC_WAKE`|System Wake |
|
||||||
|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
|
|`KC_AUDIO_MUTE` |`KC_MUTE`|Mute |
|
||||||
|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
|
|`KC_AUDIO_VOL_UP` |`KC_VOLU`|Volume Up |
|
||||||
|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
|
|`KC_AUDIO_VOL_DOWN` |`KC_VOLD`|Volume Down |
|
||||||
|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track |
|
|`KC_MEDIA_NEXT_TRACK` |`KC_MNXT`|Next Track |
|
||||||
|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track |
|
|`KC_MEDIA_PREV_TRACK` |`KC_MPRV`|Previous Track |
|
||||||
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track (Windows) |
|
|`KC_MEDIA_STOP` |`KC_MSTP`|Stop Track |
|
||||||
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|
|`KC_MEDIA_PLAY_PAUSE` |`KC_MPLY`|Play/Pause Track |
|
||||||
|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player (Windows)|
|
|`KC_MEDIA_SELECT` |`KC_MSEL`|Launch Media Player|
|
||||||
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject (macOS) |
|
|`KC_MEDIA_EJECT` |`KC_EJCT`|Eject |
|
||||||
|`KC_MAIL` | |Launch Mail (Windows) |
|
|`KC_MAIL` | |Launch Mail |
|
||||||
|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator (Windows) |
|
|`KC_CALCULATOR` |`KC_CALC`|Launch Calculator |
|
||||||
|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer (Windows) |
|
|`KC_MY_COMPUTER` |`KC_MYCM`|Launch My Computer |
|
||||||
|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search (Windows) |
|
|`KC_WWW_SEARCH` |`KC_WSCH`|Browser Search |
|
||||||
|`KC_WWW_HOME` |`KC_WHOM`|Browser Home (Windows) |
|
|`KC_WWW_HOME` |`KC_WHOM`|Browser Home |
|
||||||
|`KC_WWW_BACK` |`KC_WBAK`|Browser Back (Windows) |
|
|`KC_WWW_BACK` |`KC_WBAK`|Browser Back |
|
||||||
|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward (Windows) |
|
|`KC_WWW_FORWARD` |`KC_WFWD`|Browser Forward |
|
||||||
|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop (Windows) |
|
|`KC_WWW_STOP` |`KC_WSTP`|Browser Stop |
|
||||||
|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh (Windows) |
|
|`KC_WWW_REFRESH` |`KC_WREF`|Browser Refresh |
|
||||||
|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) |
|
|`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites |
|
||||||
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) |
|
|`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track |
|
||||||
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) |
|
|`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track |
|
||||||
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|
|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up |
|
||||||
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|
|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down |
|
||||||
|
|
||||||
## Number Pad
|
## Number Pad
|
||||||
|
|
||||||
@@ -248,7 +248,7 @@ These keycodes are not part of the Keyboard/Keypad usage page. The `SYSTEM_` key
|
|||||||
|
|
||||||
## Special Keys
|
## Special Keys
|
||||||
|
|
||||||
In addition to these, keycodes in the range of `0xA5-DF` are reserved for internal use by TMK.
|
In addition to these, keycodes in the range of `0xA5-DF` are reserved for internal use.
|
||||||
|
|
||||||
|Key |Aliases |Description |
|
|Key |Aliases |Description |
|
||||||
|----------------|--------------------|---------------------------------------|
|
|----------------|--------------------|---------------------------------------|
|
||||||
|
|||||||
62
docs/kle2json_guide.md
Normal file
62
docs/kle2json_guide.md
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
# KLE To info.json
|
||||||
|
|
||||||
|
This page describes how to create a [Keyboard Layout Editor](http://keyboard-layout-editor.com) layout that works with `qmk kle2json`. You will also be able to use the same KLE layout to create VIA support for your keyboard.
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
|
||||||
|
QMK uses `info.json` to store metadata about the keyboard including the matrix pins, row and column configuration, and keyboard layout. You can encode some of this data into a KLE layout and then convert that to `info.json`, which saves you time and headaches creating files from scratch.
|
||||||
|
|
||||||
|
Our reference layout is here: <http://www.keyboard-layout-editor.com/#/gists/70aaa4bed76d0b2f67fd165641239552>
|
||||||
|
|
||||||
|
Keep that open in a separate window so that you can refer to it while reading this document.
|
||||||
|
|
||||||
|
## Layout Structure
|
||||||
|
|
||||||
|
The first thing you should notice is that the main layout for the keyboard is in the middle. This is the default layout. Around the sides you'll find layout options. These are groups of keys that can replace specific keys in the default layout. More on that later.
|
||||||
|
|
||||||
|
## Anatomy of a Key
|
||||||
|
|
||||||
|
Every key in KLE has 12 labels- top left, top center, top right, center left, center, center right, bottom left, bottom center, bottom right, front left, front center, front right. We do not use all 12 labels, but we do some of them.
|
||||||
|
|
||||||
|
The labels we use are below:
|
||||||
|
|
||||||
|
| | | |
|
||||||
|
|-|-|-|
|
||||||
|
| **Matrix** | (unused) | (unused) |
|
||||||
|
| **Keycode** | (unused) | (unused) |
|
||||||
|
| (unused) | (unused) | **Option Group** |
|
||||||
|
| **Option Name** | (unused) | (unused) |
|
||||||
|
|
||||||
|
### Matrix
|
||||||
|
|
||||||
|
This is the location of the key in the keyboard matrix. It should be two whole numbers separated by a comma representing row and column. For example, the top left location of the keyboard is usually `0,0`, to the right of that key is `0,1`, below that key is `1,0`, and so on.
|
||||||
|
|
||||||
|
### Keycode
|
||||||
|
|
||||||
|
This is the default keycode for layer 0. You should supply this now even if you won't use the generated keymap because QMK will make greater use of it in the future.
|
||||||
|
|
||||||
|
### Option Group
|
||||||
|
|
||||||
|
This identifies what Layout Options (if any) this key is part of. If this value is empty the key is not part of any Layout Options.
|
||||||
|
|
||||||
|
The value is two whole numbers separated by a comma. The first number is the Layout Option Group Number, which identifies the specific Layout Option this key is associated with. The second number is the specific Layout Option Choice this key is associated with.
|
||||||
|
|
||||||
|
### Option Name
|
||||||
|
|
||||||
|
This identifies the name for each Option Group Choice. This will be used in the future to automatically build layouts from each option. All keys with the same Option Group identifier should have the same Option Name.
|
||||||
|
|
||||||
|
## Running qmk kle2json
|
||||||
|
|
||||||
|
Once you have built your KLE layout you are ready to convert it to `info.json`. Start by clicking `Sign In with GitHub` on Keyboard Layout Editor. Once you have signed in you can click `Save` to save your KLE. Once it's saved grab the URL from the bar, it should end end in `/#/gists/<long_number>`.
|
||||||
|
|
||||||
|
To use the reference layout as an example, I could update the keyboard `clueboard/60` from that KLE using this command:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
qmk kle2json -kb clueboard/60 -l LAYOUT_60_ansi 'http://www.keyboard-layout-editor.com/#/gists/70aaa4bed76d0b2f67fd165641239552'
|
||||||
|
```
|
||||||
|
|
||||||
|
It will fetch the KLE, generate a new `LAYOUT_60_ansi`, and either add a new layout or change the existing layout to match.
|
||||||
|
|
||||||
|
## Adding more layouts
|
||||||
|
|
||||||
|
At the current time QMK only supports the base layout. Layout Options are allowed for VIA compatibility purposes and will be implemented in QMK at a later date. For now we recommend you create a KLE for each layout you want to support in QMK and call `qmk kle2json` once per layout to set up the info.json.
|
||||||
@@ -37,26 +37,45 @@ We've tried to make QMK as easy to set up as possible. You only have to prepare
|
|||||||
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)<br>
|
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)<br>
|
||||||
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
|
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html)
|
||||||
|
|
||||||
### Windows
|
<!-- tabs:start -->
|
||||||
|
|
||||||
You will need to install MSYS2, Git, and the QMK CLI.
|
### ** Windows **
|
||||||
|
|
||||||
Follow the installation instructions on the [MSYS2 homepage](http://www.msys2.org). Close any open MSYS terminals and open a new MinGW 64-bit terminal. **NOTE: This is *not* the same as the MSYS terminal that opens when installation is completed.**
|
#### Prerequisites
|
||||||
|
|
||||||
Then, run the following:
|
You will need to install MSYS2, Git and Python. Follow the installation instructions on https://www.msys2.org.
|
||||||
|
|
||||||
|
Once MSYS2 is installed, close any open MSYS terminals and open a new MinGW 64-bit terminal.
|
||||||
|
|
||||||
|
!> **NOTE:** The MinGW 64-bit terminal is *not* the same as the MSYS terminal that opens when installation is completed. Your prompt should say "MINGW64" in purple text, rather than "MSYS". See [this page](https://www.msys2.org/wiki/MSYS2-introduction/#subsystems) for more information on the differences.
|
||||||
|
|
||||||
|
Then run the following command:
|
||||||
|
|
||||||
pacman --needed --noconfirm --disable-download-timeout -S git mingw-w64-x86_64-toolchain mingw-w64-x86_64-python3-pip
|
pacman --needed --noconfirm --disable-download-timeout -S git mingw-w64-x86_64-toolchain mingw-w64-x86_64-python3-pip
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
|
||||||
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
python3 -m pip install qmk
|
python3 -m pip install qmk
|
||||||
|
|
||||||
### macOS
|
### ** macOS **
|
||||||
|
|
||||||
You will need to install Homebrew. Follow the instructions on the [Homebrew homepage](https://brew.sh).
|
QMK maintains a Homebrew tap and formula which will automatically install the CLI and all necessary dependencies.
|
||||||
|
|
||||||
After Homebrew is installed run this command:
|
#### Prerequisites
|
||||||
|
|
||||||
|
You will need to install Homebrew. Follow the instructions on https://brew.sh.
|
||||||
|
|
||||||
|
#### Installation
|
||||||
|
|
||||||
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
brew install qmk/qmk/qmk
|
brew install qmk/qmk/qmk
|
||||||
|
|
||||||
### Linux
|
### ** Linux/WSL **
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
You will need to install Git and Python. It's very likely that you already have both, but if not, one of the following commands should install them:
|
You will need to install Git and Python. It's very likely that you already have both, but if not, one of the following commands should install them:
|
||||||
|
|
||||||
@@ -66,30 +85,71 @@ You will need to install Git and Python. It's very likely that you already have
|
|||||||
* Void: `sudo xbps-install -y git python3-pip`
|
* Void: `sudo xbps-install -y git python3-pip`
|
||||||
* Solus: `sudo eopkg -y install git python3`
|
* Solus: `sudo eopkg -y install git python3`
|
||||||
* Sabayon: `sudo equo install dev-vcs/git dev-python/pip`
|
* Sabayon: `sudo equo install dev-vcs/git dev-python/pip`
|
||||||
|
* Gentoo: `sudo emerge dev-vcs/git dev-python/pip`
|
||||||
|
|
||||||
Install the global CLI to bootstrap your system:
|
#### Installation
|
||||||
|
|
||||||
`python3 -m pip install --user qmk` (on Arch-based distros you can also try the `qmk` package from AUR (**note**: it's maintained by a community member): `yay -S qmk`)
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
### FreeBSD
|
python3 -m pip install --user qmk
|
||||||
|
|
||||||
|
#### Community Packages
|
||||||
|
|
||||||
|
These packages are maintained by community members, so may not be up to date or completely functional. If you encounter problems, please report them to their respective maintainers.
|
||||||
|
|
||||||
|
On Arch-based distros you can install the CLI from the official repositories (NOTE: at the time of writing this package marks some dependencies as optional that should not be):
|
||||||
|
|
||||||
|
sudo pacman -S qmk
|
||||||
|
|
||||||
|
You can also try the `qmk` package from AUR:
|
||||||
|
|
||||||
|
yay -S qmk
|
||||||
|
|
||||||
|
### ** FreeBSD **
|
||||||
|
|
||||||
|
#### Prerequisites
|
||||||
|
|
||||||
You will need to install Git and Python. It's possible that you already have both, but if not, run the following commands to install them:
|
You will need to install Git and Python. It's possible that you already have both, but if not, run the following commands to install them:
|
||||||
|
|
||||||
pkg install git python3
|
pkg install git python3
|
||||||
|
|
||||||
Make sure that `$HOME/.local/bin` is added to your `$PATH` so that locally install Python packages are available.
|
Make sure that `$HOME/.local/bin` is added to your `$PATH` so that locally installed Python packages are available.
|
||||||
|
|
||||||
Once installed, you can install QMK CLI:
|
#### Installation
|
||||||
|
|
||||||
|
Install the QMK CLI by running:
|
||||||
|
|
||||||
python3 -m pip install --user qmk
|
python3 -m pip install --user qmk
|
||||||
|
|
||||||
|
<!-- tabs:end -->
|
||||||
|
|
||||||
## 3. Run QMK Setup :id=set-up-qmk
|
## 3. Run QMK Setup :id=set-up-qmk
|
||||||
|
|
||||||
|
<!-- tabs:start -->
|
||||||
|
|
||||||
|
### ** Windows **
|
||||||
|
|
||||||
After installing QMK you can set it up with this command:
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
qmk setup
|
qmk setup
|
||||||
|
|
||||||
In most situations you will want to answer Yes to all of the prompts.
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
|
### ** macOS **
|
||||||
|
|
||||||
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
|
qmk setup
|
||||||
|
|
||||||
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
|
### ** Linux/WSL **
|
||||||
|
|
||||||
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
|
qmk setup
|
||||||
|
|
||||||
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
?>**Note on Debian, Ubuntu and their derivatives**:
|
?>**Note on Debian, Ubuntu and their derivatives**:
|
||||||
It's possible, that you will get an error saying something like: `bash: qmk: command not found`.
|
It's possible, that you will get an error saying something like: `bash: qmk: command not found`.
|
||||||
@@ -97,12 +157,22 @@ This is due to a [bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839155)
|
|||||||
Sadly, Ubuntu reitroduced this bug and is [yet to fix it](https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562).
|
Sadly, Ubuntu reitroduced this bug and is [yet to fix it](https://bugs.launchpad.net/ubuntu/+source/bash/+bug/1588562).
|
||||||
Luckily, the fix is easy. Run this as your user: `echo 'PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc && source $HOME/.bashrc`
|
Luckily, the fix is easy. Run this as your user: `echo 'PATH="$HOME/.local/bin:$PATH"' >> $HOME/.bashrc && source $HOME/.bashrc`
|
||||||
|
|
||||||
|
### ** FreeBSD **
|
||||||
|
|
||||||
|
After installing QMK you can set it up with this command:
|
||||||
|
|
||||||
|
qmk setup
|
||||||
|
|
||||||
|
In most situations you will want to answer `y` to all of the prompts.
|
||||||
|
|
||||||
?>**Note on FreeBSD**:
|
?>**Note on FreeBSD**:
|
||||||
It is suggested to run `qmk setup` as a non-`root` user to start with, but this will likely identify packages that need to be installed to your
|
It is suggested to run `qmk setup` as a non-`root` user to start with, but this will likely identify packages that need to be installed to your
|
||||||
base system using `pkg`. However the installation will probably fail when run as an unprivileged user.
|
base system using `pkg`. However the installation will probably fail when run as an unprivileged user.
|
||||||
To manually install the base dependencies, run `./util/qmk_install.sh` either as `root`, or with `sudo`.
|
To manually install the base dependencies, run `./util/qmk_install.sh` either as `root`, or with `sudo`.
|
||||||
Once that completes, re-run `qmk setup` to complete the setup and checks.
|
Once that completes, re-run `qmk setup` to complete the setup and checks.
|
||||||
|
|
||||||
|
<!-- tabs:end -->
|
||||||
|
|
||||||
?> 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.
|
?> 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
|
## 4. Test Your Build Environment
|
||||||
|
|||||||
@@ -36,7 +36,9 @@ Prefer a terminal based solution? [hid_listen](https://www.pjrc.com/teensy/hid_l
|
|||||||
|
|
||||||
Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
|
Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
After that you can use a few different print functions:
|
After that you can use a few different print functions:
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ To use the Proton C natively, without having to specify `CTPC=yes`, you need to
|
|||||||
|
|
||||||
```
|
```
|
||||||
MCU = STM32F303
|
MCU = STM32F303
|
||||||
|
BOARD = QMK_PROTON_C
|
||||||
```
|
```
|
||||||
|
|
||||||
Remove these variables if they exist:
|
Remove these variables if they exist:
|
||||||
|
|||||||
@@ -27,3 +27,20 @@
|
|||||||
.markdown-section hr, .search {
|
.markdown-section hr, .search {
|
||||||
border-bottom: 1px solid #777 !important;
|
border-bottom: 1px solid #777 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--docsifytabs-border-color: #555;
|
||||||
|
--docsifytabs-tab-highlight-color: var(--theme-color,#ea6f5a);
|
||||||
|
|
||||||
|
--docsifytabs-tab-background: #444;
|
||||||
|
--docsifytabs-tab-background-active: #3f3f3f;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__tab:focus {
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__content .anchor {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,3 +28,20 @@
|
|||||||
.markdown-section pre {
|
.markdown-section pre {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--docsifytabs-border-color: #ddd;
|
||||||
|
--docsifytabs-tab-highlight-color: var(--theme-color, #0074d9);
|
||||||
|
|
||||||
|
--docsifytabs-tab-background: #f8f8f8;
|
||||||
|
--docsifytabs-tab-background-active: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__tab:focus {
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.docsify-tabs__content .anchor {
|
||||||
|
transition: none;
|
||||||
|
}
|
||||||
|
|||||||
@@ -19,8 +19,20 @@ The `info.json` file is a JSON formatted dictionary with the following keys avai
|
|||||||
* Width of the board in Key Units
|
* Width of the board in Key Units
|
||||||
* `height`
|
* `height`
|
||||||
* Height of the board in Key Units
|
* Height of the board in Key Units
|
||||||
|
* `debounce`
|
||||||
|
* How many milliseconds (ms) to wait for debounce to happen. (Default: 5)
|
||||||
|
* `diode_direction`
|
||||||
|
* The direction diodes face. See [`DIRECT_PINS` in the hardware configuration](https://docs.qmk.fm/#/config_options?id=hardware-options) for more details.
|
||||||
|
* `layout_aliases`
|
||||||
|
* A dictionary containing layout aliases. The key is the alias and the value is a layout in `layouts` it maps to.
|
||||||
* `layouts`
|
* `layouts`
|
||||||
* Physical Layout representations. See the next section for more detail.
|
* Physical Layout representations. See the [Layout Format](#layout_format) section for more detail.
|
||||||
|
* `matrix_pins`
|
||||||
|
* Configure the pins corresponding to columns and rows, or direct pins. See [Matrix Pins](#matrix_pins) for more detail.
|
||||||
|
* `rgblight`
|
||||||
|
* Configure the [RGB Lighting feature](feature_rgblight.md). See the [RGB Lighting](#rgb_lighting) section for more detail.
|
||||||
|
* `usb`
|
||||||
|
* Configure USB VID, PID, and other parameters. See [USB](#USB) for more detail.
|
||||||
|
|
||||||
### Layout Format
|
### Layout Format
|
||||||
|
|
||||||
@@ -49,25 +61,128 @@ All key positions and rotations are specified in relation to the top-left corner
|
|||||||
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
* The width of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||||
* `h`
|
* `h`
|
||||||
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
* The height of the key, in Key Units. Ignored if `ks` is provided. Default: `1`
|
||||||
* `r`
|
|
||||||
* How many degrees clockwise to rotate the key.
|
|
||||||
* `rx`
|
|
||||||
* The absolute position of the point to rotate the key around in the horizontal axis. Default: `x`
|
|
||||||
* `ry`
|
|
||||||
* The absolute position of the point to rotate the key around in the vertical axis. Default: `y`
|
|
||||||
* `ks`
|
|
||||||
* Key Shape: define a polygon by providing a list of points, in Key Units.
|
|
||||||
* **Important**: These are relative to the top-left of the key, not absolute.
|
|
||||||
* Example ISO Enter: `[ [0,0], [1.5,0], [1.5,2], [0.25,2], [0.25,1], [0,1], [0,0] ]`
|
|
||||||
* `label`
|
* `label`
|
||||||
* What to name this position in the matrix.
|
* What to name this position in the matrix.
|
||||||
* This should usually be the same name as what is silkscreened on the PCB at this location.
|
* This should usually correspond to the keycode for the first layer of the default keymap.
|
||||||
|
* `matrix`
|
||||||
|
* A 2 item list describing the row and column location for this key.
|
||||||
|
|
||||||
## How is the Metadata Exposed?
|
### Matrix Pins
|
||||||
|
|
||||||
This metadata is primarily used in two ways:
|
Currently QMK supports connecting switches either directly to GPIO pins or via a switch matrix. At this time you can not combine these, they are mutually exclusive.
|
||||||
|
|
||||||
* To allow web-based configurators to dynamically generate UI
|
#### Switch Matrix
|
||||||
* To support the new `make keyboard:keymap:qmk` target, which bundles this metadata up with the firmware to allow QMK Toolbox to be smarter.
|
|
||||||
|
|
||||||
Configurator authors can see the [QMK Compiler](https://docs.api.qmk.fm/using-the-api) docs for more information on using the JSON API.
|
Most keyboards use a switch matrix to connect keyswitches to the MCU. You can define your pin columns and rows to configure your switch matrix. When defining switch matrices you should also define your `diode_direction`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"diode_direction": "COL2ROW",
|
||||||
|
"matrix_pins": {
|
||||||
|
"cols": ["F4", "E6", "B1", "D2"],
|
||||||
|
"rows": ["B0", "D3", "D5", "D4", "D6"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Direct Pins
|
||||||
|
|
||||||
|
Direct pins are when you connect one side of the switch to GND and the other side to a GPIO pin on your MCU. No diode is required, but there is a 1:1 mapping between switches and pins.
|
||||||
|
|
||||||
|
When specifying direct pins you need to arrange them in nested arrays. The outer array consists of rows, while the inner array is a text string corresponding to a pin. You can use `null` to indicate an empty spot in the matrix.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"matrix_pins": {
|
||||||
|
"direct": [
|
||||||
|
["A10", "A9"],
|
||||||
|
["A0", "B8"],
|
||||||
|
[null, "B11"],
|
||||||
|
["B9", "A8"],
|
||||||
|
["A7", "B1"],
|
||||||
|
[null, "B2"]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### RGB Lighting
|
||||||
|
|
||||||
|
This section controls the legacy WS2812 support in QMK. This should not be confused with the RGB Matrix feature, which can be used to control both WS2812 and ISSI RGB LEDs.
|
||||||
|
|
||||||
|
The following items can be set. Not every value is required.
|
||||||
|
|
||||||
|
* `led_count`
|
||||||
|
* The number of LEDs in your strip
|
||||||
|
* `pin`
|
||||||
|
* The GPIO pin that your LED strip is connected to
|
||||||
|
* `animations`
|
||||||
|
* A dictionary that lists enabled and disabled animations. See [RGB Light Animations](#rgb_light_animations) below.
|
||||||
|
* `sleep`
|
||||||
|
* Set to `true` to enable lighting during host sleep
|
||||||
|
* `split`
|
||||||
|
* Set to `true` to enable synchronization functionality between split halves
|
||||||
|
* `split_count`
|
||||||
|
* For split keyboards, the number of LEDs on each side
|
||||||
|
* `max_brightness`
|
||||||
|
* (0-255) What the maxmimum brightness (value) level is
|
||||||
|
* `hue_steps`
|
||||||
|
* How many steps of adjustment to have for hue
|
||||||
|
* `saturation_steps`
|
||||||
|
* How many steps of adjustment to have for saturation
|
||||||
|
* `brightness_steps`
|
||||||
|
* How many steps of adjustment to have for brightness (value)
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"rgblight": {
|
||||||
|
"led_count": 4,
|
||||||
|
"pin": "F6",
|
||||||
|
"hue_steps": 10,
|
||||||
|
"saturation_steps": 17,
|
||||||
|
"brightness_steps": 17,
|
||||||
|
"animations": {
|
||||||
|
"all": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### RGB Light Animations
|
||||||
|
|
||||||
|
The following animations can be enabled:
|
||||||
|
|
||||||
|
| Key | Description |
|
||||||
|
|-----|-------------|
|
||||||
|
| `all` | Enable all additional animation modes. |
|
||||||
|
| `alternating` | Enable alternating animation mode. |
|
||||||
|
| `breathing` | Enable breathing animation mode. |
|
||||||
|
| `christmas` | Enable christmas animation mode. |
|
||||||
|
| `knight` | Enable knight animation mode. |
|
||||||
|
| `rainbow_mood` | Enable rainbow mood animation mode. |
|
||||||
|
| `rainbow_swirl` | Enable rainbow swirl animation mode. |
|
||||||
|
| `rgb_test` | Enable RGB test animation mode. |
|
||||||
|
| `snake` | Enable snake animation mode. |
|
||||||
|
| `static_gradient` | Enable static gradient mode. |
|
||||||
|
| `twinkle` | Enable twinkle animation mode. |
|
||||||
|
|
||||||
|
### USB
|
||||||
|
|
||||||
|
Every USB keyboard needs to have its USB parmaters defined. At a minimum you need to set vid, pid, and device version.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"usb": {
|
||||||
|
"vid": "0xC1ED",
|
||||||
|
"pid": "0x23B0",
|
||||||
|
"device_ver": "0x0001"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ To use these, simply `#include` the corresponding [header file](https://github.c
|
|||||||
|Dutch (Belgium) |`keymap_belgian.h` |
|
|Dutch (Belgium) |`keymap_belgian.h` |
|
||||||
|English (Ireland) |`keymap_irish.h` |
|
|English (Ireland) |`keymap_irish.h` |
|
||||||
|English (UK) |`keymap_uk.h` |
|
|English (UK) |`keymap_uk.h` |
|
||||||
|
|English (US Extended) |`keymap_us_extended.h` |
|
||||||
|English (US International) |`keymap_us_international.h` |
|
|English (US International) |`keymap_us_international.h` |
|
||||||
|
|English (US International, Linux)|`keymap_us_international_linux.h`|
|
||||||
|Estonian |`keymap_estonian.h` |
|
|Estonian |`keymap_estonian.h` |
|
||||||
|Finnish |`keymap_finnish.h` |
|
|Finnish |`keymap_finnish.h` |
|
||||||
|French |`keymap_french.h` |
|
|French |`keymap_french.h` |
|
||||||
@@ -46,6 +48,7 @@ To use these, simply `#include` the corresponding [header file](https://github.c
|
|||||||
|Norwegian |`keymap_norwegian.h` |
|
|Norwegian |`keymap_norwegian.h` |
|
||||||
|Polish |`keymap_polish.h` |
|
|Polish |`keymap_polish.h` |
|
||||||
|Portuguese |`keymap_portuguese.h` |
|
|Portuguese |`keymap_portuguese.h` |
|
||||||
|
|Portuguese (macOS, ISO) |`keymap_portuguese_osx_iso.h` |
|
||||||
|Portuguese (Brazil) |`keymap_br_abnt2.h` |
|
|Portuguese (Brazil) |`keymap_br_abnt2.h` |
|
||||||
|Romanian |`keymap_romanian.h` |
|
|Romanian |`keymap_romanian.h` |
|
||||||
|Russian* |`keymap_russian.h` |
|
|Russian* |`keymap_russian.h` |
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ Configure the hardware via your config.h:
|
|||||||
// 5: about 19200 baud
|
// 5: about 19200 baud
|
||||||
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
|
#define SERIAL_USART_DRIVER SD1 // USART driver of TX pin. default: SD1
|
||||||
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
#define SERIAL_USART_TX_PAL_MODE 7 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 7
|
||||||
|
#define SERIAL_USART_TIMEOUT 100 // USART driver timeout. default 100
|
||||||
```
|
```
|
||||||
|
|
||||||
You must also enable the ChibiOS `SERIAL` feature:
|
You must also enable the ChibiOS `SERIAL` feature:
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ The default setting is 280 µs, which should work for most cases, but this can b
|
|||||||
#define WS2812_TRST_US 80
|
#define WS2812_TRST_US 80
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Byte Order
|
||||||
|
|
||||||
|
Some variants of the WS2812 may have their color components in a different physical or logical order. For example, the WS2812B-2020 has physically swapped red and green LEDs, which causes the wrong color to be displayed, because the default order of the bytes sent over the wire is defined as GRB.
|
||||||
|
In this case, you can change the byte order by defining `WS2812_BYTE_ORDER` as one of the following values:
|
||||||
|
|
||||||
|
| Byte order | Known devices |
|
||||||
|
|-----------------------------------|-------------------------------|
|
||||||
|
| `WS2812_BYTE_ORDER_GRB` (default) | Most WS2812's, SK6812, SK6805 |
|
||||||
|
| `WS2812_BYTE_ORDER_RGB` | WS2812B-2020 |
|
||||||
|
|
||||||
|
|
||||||
### Bitbang
|
### Bitbang
|
||||||
Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
|
Default driver, the absence of configuration assumes this driver. To configure it, add this to your rules.mk:
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ void keyboard_post_init_user(void) {
|
|||||||
|
|
||||||
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
|
有时用[custom code](custom_quantum_functions.md)发送自定义调试信息很有用. 这么做很简单. 首先在你文件头部包含`print.h`:
|
||||||
|
|
||||||
#include <print.h>
|
```c
|
||||||
|
#include "print.h"
|
||||||
|
```
|
||||||
|
|
||||||
之后,您可以使用一些不同的打印功能:
|
之后,您可以使用一些不同的打印功能:
|
||||||
|
|
||||||
|
|||||||
151
drivers/apa102/apa102.c
Normal file
151
drivers/apa102/apa102.c
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
/* Copyright 2020 Aldehir Rojas
|
||||||
|
* Copyright 2017 Mikkel (Duckle29)
|
||||||
|
*
|
||||||
|
* 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 "apa102.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#ifndef APA102_NOPS
|
||||||
|
# if defined(__AVR__)
|
||||||
|
# define APA102_NOPS 0 // AVR at 16 MHz already spends 62.5 ns per clock, so no extra delay is needed
|
||||||
|
# elif defined(PROTOCOL_CHIBIOS)
|
||||||
|
|
||||||
|
# include "hal.h"
|
||||||
|
# if defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) || defined(STM32F4XX) || defined(STM32L0XX)
|
||||||
|
# define APA102_NOPS (100 / (1000000000L / (STM32_SYSCLK / 4))) // This calculates how many loops of 4 nops to run to delay 100 ns
|
||||||
|
# else
|
||||||
|
# error("APA102_NOPS configuration required")
|
||||||
|
# define APA102_NOPS 0 // this just pleases the compile so the above error is easier to spot
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define io_wait \
|
||||||
|
do { \
|
||||||
|
for (int i = 0; i < APA102_NOPS; i++) { \
|
||||||
|
__asm__ volatile("nop\n\t" \
|
||||||
|
"nop\n\t" \
|
||||||
|
"nop\n\t" \
|
||||||
|
"nop\n\t"); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define APA102_SEND_BIT(byte, bit) \
|
||||||
|
do { \
|
||||||
|
writePin(RGB_DI_PIN, (byte >> bit) & 1); \
|
||||||
|
io_wait; \
|
||||||
|
writePinHigh(RGB_CI_PIN); \
|
||||||
|
io_wait; \
|
||||||
|
writePinLow(RGB_CI_PIN); \
|
||||||
|
io_wait; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
uint8_t apa102_led_brightness = APA102_DEFAULT_BRIGHTNESS;
|
||||||
|
|
||||||
|
void static apa102_start_frame(void);
|
||||||
|
void static apa102_end_frame(uint16_t num_leds);
|
||||||
|
|
||||||
|
void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness);
|
||||||
|
void static apa102_send_byte(uint8_t byte);
|
||||||
|
|
||||||
|
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds) {
|
||||||
|
LED_TYPE *end = start_led + num_leds;
|
||||||
|
|
||||||
|
apa102_start_frame();
|
||||||
|
for (LED_TYPE *led = start_led; led < end; led++) {
|
||||||
|
apa102_send_frame(led->r, led->g, led->b, apa102_led_brightness);
|
||||||
|
}
|
||||||
|
apa102_end_frame(num_leds);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Overwrite the default rgblight_call_driver to use apa102 driver
|
||||||
|
void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds) { apa102_setleds(start_led, num_leds); }
|
||||||
|
|
||||||
|
void static apa102_init(void) {
|
||||||
|
setPinOutput(RGB_DI_PIN);
|
||||||
|
setPinOutput(RGB_CI_PIN);
|
||||||
|
|
||||||
|
writePinLow(RGB_DI_PIN);
|
||||||
|
writePinLow(RGB_CI_PIN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void apa102_set_brightness(uint8_t brightness) {
|
||||||
|
if (brightness > APA102_MAX_BRIGHTNESS) {
|
||||||
|
apa102_led_brightness = APA102_MAX_BRIGHTNESS;
|
||||||
|
} else if (brightness < 0) {
|
||||||
|
apa102_led_brightness = 0;
|
||||||
|
} else {
|
||||||
|
apa102_led_brightness = brightness;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_send_frame(uint8_t red, uint8_t green, uint8_t blue, uint8_t brightness) {
|
||||||
|
apa102_send_byte(0b11100000 | brightness);
|
||||||
|
apa102_send_byte(blue);
|
||||||
|
apa102_send_byte(green);
|
||||||
|
apa102_send_byte(red);
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_start_frame(void) {
|
||||||
|
apa102_init();
|
||||||
|
for (uint16_t i = 0; i < 4; i++) {
|
||||||
|
apa102_send_byte(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_end_frame(uint16_t num_leds) {
|
||||||
|
// This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h
|
||||||
|
// and adapted. The code is MIT licensed. I think thats compatible?
|
||||||
|
//
|
||||||
|
// The data stream seen by the last LED in the chain will be delayed by
|
||||||
|
// (count - 1) clock edges, because each LED before it inverts the clock
|
||||||
|
// line and delays the data by one clock edge. Therefore, to make sure
|
||||||
|
// the last LED actually receives the data we wrote, the number of extra
|
||||||
|
// edges we send at the end of the frame must be at least (count - 1).
|
||||||
|
//
|
||||||
|
// Assuming we only want to send these edges in groups of size K, the
|
||||||
|
// C/C++ expression for the minimum number of groups to send is:
|
||||||
|
//
|
||||||
|
// ((count - 1) + (K - 1)) / K
|
||||||
|
//
|
||||||
|
// The C/C++ expression above is just (count - 1) divided by K,
|
||||||
|
// rounded up to the nearest whole number if there is a remainder.
|
||||||
|
//
|
||||||
|
// We set K to 16 and use the formula above as the number of frame-end
|
||||||
|
// bytes to transfer. Each byte has 16 clock edges.
|
||||||
|
//
|
||||||
|
// We are ignoring the specification for the end frame in the APA102
|
||||||
|
// datasheet, which says to send 0xFF four times, because it does not work
|
||||||
|
// when you have 66 LEDs or more, and also it results in unwanted white
|
||||||
|
// pixels if you try to update fewer LEDs than are on your LED strip.
|
||||||
|
uint16_t iterations = (num_leds + 14) / 16;
|
||||||
|
for (uint16_t i = 0; i < iterations; i++) {
|
||||||
|
apa102_send_byte(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
apa102_init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void static apa102_send_byte(uint8_t byte) {
|
||||||
|
APA102_SEND_BIT(byte, 7);
|
||||||
|
APA102_SEND_BIT(byte, 6);
|
||||||
|
APA102_SEND_BIT(byte, 5);
|
||||||
|
APA102_SEND_BIT(byte, 4);
|
||||||
|
APA102_SEND_BIT(byte, 3);
|
||||||
|
APA102_SEND_BIT(byte, 2);
|
||||||
|
APA102_SEND_BIT(byte, 1);
|
||||||
|
APA102_SEND_BIT(byte, 0);
|
||||||
|
}
|
||||||
@@ -1,10 +1,5 @@
|
|||||||
/*
|
/* Copyright 2020 Aldehir Rojas
|
||||||
* light weight WS2812 lib include
|
* Copyright 2017 Mikkel (Duckle29)
|
||||||
*
|
|
||||||
* Version 2.3 - Nev 29th 2015
|
|
||||||
* Author: Tim (cpldcpu@gmail.com)
|
|
||||||
*
|
|
||||||
* Please do not change this file! All configuration is handled in "ws2812_config.h"
|
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,24 +17,25 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
|
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
|
|
||||||
|
#ifndef APA102_DEFAULT_BRIGHTNESS
|
||||||
|
# define APA102_DEFAULT_BRIGHTNESS 31
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define APA102_MAX_BRIGHTNESS 31
|
||||||
|
|
||||||
|
extern uint8_t apa102_led_brightness;
|
||||||
|
|
||||||
/* User Interface
|
/* User Interface
|
||||||
*
|
*
|
||||||
* Input:
|
* Input:
|
||||||
* ledarray: An array of GRB data describing the LED colors
|
* start_led: An array of GRB data describing the LED colors
|
||||||
* number_of_leds: The number of LEDs to write
|
* num_leds: The number of LEDs to write
|
||||||
* pinmask (optional): Bitmask describing the output bin. e.g. _BV(PB0)
|
|
||||||
*
|
*
|
||||||
* The functions will perform the following actions:
|
* The functions will perform the following actions:
|
||||||
* - Set the data-out pin as output
|
* - Set the data-out pin as output
|
||||||
* - Send out the LED data
|
* - Send out the LED data
|
||||||
* - Wait 50<EFBFBD>s to reset the LEDs
|
|
||||||
*/
|
*/
|
||||||
|
void apa102_setleds(LED_TYPE *start_led, uint16_t num_leds);
|
||||||
void apa102_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
|
void apa102_set_brightness(uint8_t brightness);
|
||||||
void apa102_setleds_pin(LED_TYPE *ledarray, uint16_t number_of_leds, uint8_t pinmask);
|
|
||||||
void apa102_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
/*
|
|
||||||
* APA102 lib V1.0a
|
|
||||||
*
|
|
||||||
* Controls APA102 RGB-LEDs
|
|
||||||
* Author: Mikkel (Duckle29 on GitHub)
|
|
||||||
*
|
|
||||||
* Dec 22th, 2017 v1.0a Initial Version
|
|
||||||
*
|
|
||||||
* 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 "apa102.h"
|
|
||||||
#include <avr/interrupt.h>
|
|
||||||
#include <avr/io.h>
|
|
||||||
#include <util/delay.h>
|
|
||||||
#include "debug.h"
|
|
||||||
|
|
||||||
// Setleds for standard RGB
|
|
||||||
void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds) { apa102_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF)); }
|
|
||||||
|
|
||||||
void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) {
|
|
||||||
setPinOutput(RGB_DI_PIN);
|
|
||||||
setPinOutput(RGB_CLK_PIN);
|
|
||||||
|
|
||||||
apa102_send_array((uint8_t *)ledarray, leds)
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_send_array(uint8_t *data, uint16_t leds) { // Data is struct of 3 bytes. RGB - leds is number of leds in data
|
|
||||||
apa102_start_frame();
|
|
||||||
while (leds--) {
|
|
||||||
apa102_send_frame(0xFF000000 | (data->b << 16) | (data->g << 8) | data->r);
|
|
||||||
data++;
|
|
||||||
}
|
|
||||||
apa102_end_frame(leds);
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_send_frame(uint32_t frame) {
|
|
||||||
for (uint32_t i = 0xFF; i > 0;) {
|
|
||||||
apa102_send_byte(frame & i);
|
|
||||||
i = i << 8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_start_frame() { apa102_send_frame(0); }
|
|
||||||
|
|
||||||
void apa102_end_frame(uint16_t leds) {
|
|
||||||
// This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h
|
|
||||||
// and adapted. The code is MIT licensed. I think thats compatible?
|
|
||||||
|
|
||||||
// We need to send some more bytes to ensure that all the LEDs in the
|
|
||||||
// chain see their new color and start displaying it.
|
|
||||||
//
|
|
||||||
// The data stream seen by the last LED in the chain will be delayed by
|
|
||||||
// (count - 1) clock edges, because each LED before it inverts the clock
|
|
||||||
// line and delays the data by one clock edge. Therefore, to make sure
|
|
||||||
// the last LED actually receives the data we wrote, the number of extra
|
|
||||||
// edges we send at the end of the frame must be at least (count - 1).
|
|
||||||
// For the APA102C, that is sufficient.
|
|
||||||
//
|
|
||||||
// The SK9822 only updates after it sees 32 zero bits followed by one more
|
|
||||||
// rising edge. To avoid having the update time depend on the color of
|
|
||||||
// the last LED, we send a dummy 0xFF byte. (Unfortunately, this means
|
|
||||||
// that partial updates of the beginning of an LED strip are not possible;
|
|
||||||
// the LED after the last one you are trying to update will be black.)
|
|
||||||
// After that, to ensure that the last LED in the chain sees 32 zero bits
|
|
||||||
// and a rising edge, we need to send at least 65 + (count - 1) edges. It
|
|
||||||
// is sufficent and simpler to just send (5 + count/16) bytes of zeros.
|
|
||||||
//
|
|
||||||
// We are ignoring the specification for the end frame in the APA102/SK9822
|
|
||||||
// datasheets because it does not actually ensure that all the LEDs will
|
|
||||||
// start displaying their new colors right away.
|
|
||||||
|
|
||||||
apa102_send_byte(0xFF);
|
|
||||||
for (uint16_t i = 0; i < 5 + leds / 16; i++) {
|
|
||||||
apa102_send_byte(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_send_byte(uint8_t byte) {
|
|
||||||
uint8_t i;
|
|
||||||
for (i = 0; i < 8; i++) {
|
|
||||||
writePin(RGB_DI_PIN, !!(byte & (1 << (7 - i))));
|
|
||||||
writePinHigh(RGB_CLK_PIN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
#ifndef LCD_H
|
|
||||||
#define LCD_H
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Title : C include file for the HD44780U LCD library (lcd.c)
|
Title : C include file for the HD44780U LCD library (lcd.c)
|
||||||
Author: Peter Fleury <pfleury@gmx.ch> http://tinyurl.com/peterfleury
|
Author: Peter Fleury <pfleury@gmx.ch> http://tinyurl.com/peterfleury
|
||||||
@@ -43,6 +41,8 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
|
|
||||||
@@ -346,5 +346,3 @@ extern void lcd_data(uint8_t data);
|
|||||||
#define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))
|
#define lcd_puts_P(__s) lcd_puts_p(PSTR(__s))
|
||||||
|
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
#endif // LCD_H
|
|
||||||
|
|||||||
@@ -17,8 +17,7 @@
|
|||||||
* GitHub repository: https://github.com/g4lvanix/I2C-master-lib
|
* GitHub repository: https://github.com/g4lvanix/I2C-master-lib
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef I2C_MASTER_H
|
#pragma once
|
||||||
#define I2C_MASTER_H
|
|
||||||
|
|
||||||
#define I2C_READ 0x01
|
#define I2C_READ 0x01
|
||||||
#define I2C_WRITE 0x00
|
#define I2C_WRITE 0x00
|
||||||
@@ -42,5 +41,3 @@ i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16
|
|||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);
|
||||||
void i2c_stop(void);
|
void i2c_stop(void);
|
||||||
|
|
||||||
#endif // I2C_MASTER_H
|
|
||||||
|
|||||||
@@ -20,8 +20,7 @@
|
|||||||
Read or write to the necessary buffer according to the opperation.
|
Read or write to the necessary buffer according to the opperation.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef I2C_SLAVE_H
|
#pragma once
|
||||||
#define I2C_SLAVE_H
|
|
||||||
|
|
||||||
#define I2C_SLAVE_REG_COUNT 30
|
#define I2C_SLAVE_REG_COUNT 30
|
||||||
|
|
||||||
@@ -29,5 +28,3 @@ extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT];
|
|||||||
|
|
||||||
void i2c_slave_init(uint8_t address);
|
void i2c_slave_init(uint8_t address);
|
||||||
void i2c_slave_stop(void);
|
void i2c_slave_stop(void);
|
||||||
|
|
||||||
#endif // I2C_SLAVE_H
|
|
||||||
|
|||||||
@@ -140,27 +140,33 @@ spi_status_t spi_read() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
||||||
spi_status_t status = SPI_STATUS_ERROR;
|
spi_status_t status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = spi_write(data[i]);
|
status = spi_write(data[i]);
|
||||||
|
|
||||||
|
if (status < 0) {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return SPI_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
||||||
spi_status_t status = SPI_STATUS_ERROR;
|
spi_status_t status;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = spi_read();
|
status = spi_read();
|
||||||
|
|
||||||
if (status > 0) {
|
if (status >= 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
|
} else {
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (status < 0) ? status : SPI_STATUS_SUCCESS;
|
return SPI_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void spi_stop(void) {
|
void spi_stop(void) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
#ifndef SSD1306_H
|
#pragma once
|
||||||
#define SSD1306_H
|
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -86,5 +85,3 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c);
|
|||||||
void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
||||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
||||||
void matrix_render(struct CharacterMatrix *matrix);
|
void matrix_render(struct CharacterMatrix *matrix);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "analog.h"
|
#include "analog.h"
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
|
|
||||||
#if !HAL_USE_ADC
|
#if !HAL_USE_ADC
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
|
|
||||||
#ifdef I2C1_BANK
|
#ifdef I2C1_BANK
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "wait.h"
|
#include "wait.h"
|
||||||
|
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
// TODO: resolve/remove build warnings
|
// TODO: resolve/remove build warnings
|
||||||
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
|
#if defined(RGBLIGHT_ENABLE) && defined(RGBLED_SPLIT) && defined(PROTOCOL_CHIBIOS) && defined(WS2812_DRIVER_BITBANG)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "printf.h"
|
#include "print.h"
|
||||||
|
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
#ifndef USART_CR1_M0
|
#ifndef USART_CR1_M0
|
||||||
# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so
|
# define USART_CR1_M0 USART_CR1_M // some platforms (f1xx) dont have this so
|
||||||
@@ -58,7 +58,10 @@
|
|||||||
# error invalid SELECT_SOFT_SERIAL_SPEED value
|
# error invalid SELECT_SOFT_SERIAL_SPEED value
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TIMEOUT 100
|
#ifndef SERIAL_USART_TIMEOUT
|
||||||
|
# define SERIAL_USART_TIMEOUT 100
|
||||||
|
#endif
|
||||||
|
|
||||||
#define HANDSHAKE_MAGIC 7
|
#define HANDSHAKE_MAGIC 7
|
||||||
|
|
||||||
static inline msg_t sdWriteHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size) {
|
static inline msg_t sdWriteHalfDuplex(SerialDriver* driver, uint8_t* data, uint8_t size) {
|
||||||
@@ -201,21 +204,21 @@ int soft_serial_transaction(int index) {
|
|||||||
sdClear(&SERIAL_USART_DRIVER);
|
sdClear(&SERIAL_USART_DRIVER);
|
||||||
|
|
||||||
// First chunk is always transaction id
|
// First chunk is always transaction id
|
||||||
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(TIMEOUT));
|
sdWriteTimeout(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index), TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
|
|
||||||
uint8_t sstd_index_shake = 0xFF;
|
uint8_t sstd_index_shake = 0xFF;
|
||||||
|
|
||||||
// Which we always read back first so that we can error out correctly
|
// Which we always read back first so that we can error out correctly
|
||||||
// - due to the half duplex limitations on return codes, we always have to read *something*
|
// - due to the half duplex limitations on return codes, we always have to read *something*
|
||||||
// - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready
|
// - without the read, write only transactions *always* succeed, even during the boot process where the slave is not ready
|
||||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(TIMEOUT));
|
res = sdReadTimeout(&SERIAL_USART_DRIVER, &sstd_index_shake, sizeof(sstd_index_shake), TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) {
|
if (res < 0 || (sstd_index_shake != (sstd_index ^ HANDSHAKE_MAGIC))) {
|
||||||
dprintf("serial::usart_shake NO_RESPONSE\n");
|
dprintf("serial::usart_shake NO_RESPONSE\n");
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trans->initiator2target_buffer_size) {
|
if (trans->initiator2target_buffer_size) {
|
||||||
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(TIMEOUT));
|
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
dprintf("serial::usart_transmit NO_RESPONSE\n");
|
dprintf("serial::usart_transmit NO_RESPONSE\n");
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
@@ -223,7 +226,7 @@ int soft_serial_transaction(int index) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (trans->target2initiator_buffer_size) {
|
if (trans->target2initiator_buffer_size) {
|
||||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(TIMEOUT));
|
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
dprintf("serial::usart_receive NO_RESPONSE\n");
|
dprintf("serial::usart_receive NO_RESPONSE\n");
|
||||||
return TRANSACTION_NO_RESPONSE;
|
return TRANSACTION_NO_RESPONSE;
|
||||||
|
|||||||
@@ -115,11 +115,17 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_write(uint8_t data) { return spi_transmit(&data, 1); }
|
spi_status_t spi_write(uint8_t data) {
|
||||||
|
uint8_t rxData;
|
||||||
|
spiExchange(&SPI_DRIVER, 1, &data, &rxData);
|
||||||
|
|
||||||
|
return rxData;
|
||||||
|
}
|
||||||
|
|
||||||
spi_status_t spi_read(void) {
|
spi_status_t spi_read(void) {
|
||||||
uint8_t data = 0;
|
uint8_t data = 0;
|
||||||
spi_receive(&data, 1);
|
spiReceive(&SPI_DRIVER, 1, &data);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <ch.h>
|
#include <ch.h>
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
#include <quantum.h>
|
#include "quantum.h"
|
||||||
|
|
||||||
#ifndef SPI_DRIVER
|
#ifndef SPI_DRIVER
|
||||||
# define SPI_DRIVER SPID2
|
# define SPI_DRIVER SPID2
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "ws2812.h"
|
#include "ws2812.h"
|
||||||
#include "ch.h"
|
#include <ch.h>
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */
|
/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */
|
||||||
|
|
||||||
@@ -89,9 +89,16 @@ void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {
|
|||||||
|
|
||||||
for (uint8_t i = 0; i < leds; i++) {
|
for (uint8_t i = 0; i < leds; i++) {
|
||||||
// WS2812 protocol dictates grb order
|
// WS2812 protocol dictates grb order
|
||||||
|
#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB)
|
||||||
sendByte(ledarray[i].g);
|
sendByte(ledarray[i].g);
|
||||||
sendByte(ledarray[i].r);
|
sendByte(ledarray[i].r);
|
||||||
sendByte(ledarray[i].b);
|
sendByte(ledarray[i].b);
|
||||||
|
#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB)
|
||||||
|
sendByte(ledarray[i].r);
|
||||||
|
sendByte(ledarray[i].g);
|
||||||
|
sendByte(ledarray[i].b);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef RGBW
|
#ifdef RGBW
|
||||||
sendByte(ledarray[i].w);
|
sendByte(ledarray[i].w);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "ws2812.h"
|
#include "ws2812.h"
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
|
|
||||||
/* Adapted from https://github.com/joewa/WS2812-LED-Driver_ChibiOS/ */
|
/* Adapted from https://github.com/joewa/WS2812-LED-Driver_ChibiOS/ */
|
||||||
|
|
||||||
@@ -107,6 +107,7 @@
|
|||||||
*/
|
*/
|
||||||
#define WS2812_BIT(led, byte, bit) (24 * (led) + 8 * (byte) + (7 - (bit)))
|
#define WS2812_BIT(led, byte, bit) (24 * (led) + 8 * (byte) + (7 - (bit)))
|
||||||
|
|
||||||
|
#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB)
|
||||||
/**
|
/**
|
||||||
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given red bit
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given red bit
|
||||||
*
|
*
|
||||||
@@ -117,7 +118,7 @@
|
|||||||
*
|
*
|
||||||
* @return The bit index
|
* @return The bit index
|
||||||
*/
|
*/
|
||||||
#define WS2812_RED_BIT(led, bit) WS2812_BIT((led), 1, (bit))
|
# define WS2812_RED_BIT(led, bit) WS2812_BIT((led), 1, (bit))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given green bit
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given green bit
|
||||||
@@ -129,7 +130,7 @@
|
|||||||
*
|
*
|
||||||
* @return The bit index
|
* @return The bit index
|
||||||
*/
|
*/
|
||||||
#define WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 0, (bit))
|
# define WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 0, (bit))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given blue bit
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given blue bit
|
||||||
@@ -141,7 +142,45 @@
|
|||||||
*
|
*
|
||||||
* @return The bit index
|
* @return The bit index
|
||||||
*/
|
*/
|
||||||
#define WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit))
|
# define WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit))
|
||||||
|
|
||||||
|
#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB)
|
||||||
|
/**
|
||||||
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given red bit
|
||||||
|
*
|
||||||
|
* @note The red byte is the middle byte in the color packet
|
||||||
|
*
|
||||||
|
* @param[in] led: The led index [0, @ref RGBLED_NUM)
|
||||||
|
* @param[in] bit: The bit number [0, 7]
|
||||||
|
*
|
||||||
|
* @return The bit index
|
||||||
|
*/
|
||||||
|
# define WS2812_RED_BIT(led, bit) WS2812_BIT((led), 0, (bit))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given green bit
|
||||||
|
*
|
||||||
|
* @note The red byte is the first byte in the color packet
|
||||||
|
*
|
||||||
|
* @param[in] led: The led index [0, @ref RGBLED_NUM)
|
||||||
|
* @param[in] bit: The bit number [0, 7]
|
||||||
|
*
|
||||||
|
* @return The bit index
|
||||||
|
*/
|
||||||
|
# define WS2812_GREEN_BIT(led, bit) WS2812_BIT((led), 1, (bit))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Determine the index in @ref ws2812_frame_buffer "the frame buffer" of a given blue bit
|
||||||
|
*
|
||||||
|
* @note The red byte is the last byte in the color packet
|
||||||
|
*
|
||||||
|
* @param[in] led: The led index [0, @ref RGBLED_NUM)
|
||||||
|
* @param[in] bit: The bit index [0, 7]
|
||||||
|
*
|
||||||
|
* @return The bit index
|
||||||
|
*/
|
||||||
|
# define WS2812_BLUE_BIT(led, bit) WS2812_BIT((led), 2, (bit))
|
||||||
|
#endif
|
||||||
|
|
||||||
/* --- PRIVATE VARIABLES ---------------------------------------------------- */
|
/* --- PRIVATE VARIABLES ---------------------------------------------------- */
|
||||||
|
|
||||||
|
|||||||
@@ -62,9 +62,15 @@ static uint8_t get_protocol_eq(uint8_t data, int pos) {
|
|||||||
static void set_led_color_rgb(LED_TYPE color, int pos) {
|
static void set_led_color_rgb(LED_TYPE color, int pos) {
|
||||||
uint8_t* tx_start = &txbuf[PREAMBLE_SIZE];
|
uint8_t* tx_start = &txbuf[PREAMBLE_SIZE];
|
||||||
|
|
||||||
|
#if (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_GRB)
|
||||||
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.g, j);
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.g, j);
|
||||||
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.r, j);
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.r, j);
|
||||||
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j);
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j);
|
||||||
|
#elif (WS2812_BYTE_ORDER == WS2812_BYTE_ORDER_RGB)
|
||||||
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + j] = get_protocol_eq(color.r, j);
|
||||||
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE + j] = get_protocol_eq(color.g, j);
|
||||||
|
for (int j = 0; j < 4; j++) tx_start[BYTES_FOR_LED * pos + BYTES_FOR_LED_BYTE * 2 + j] = get_protocol_eq(color.b, j);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ws2812_init(void) {
|
void ws2812_init(void) {
|
||||||
|
|||||||
@@ -49,6 +49,11 @@
|
|||||||
# define EXTERNAL_EEPROM_PAGE_SIZE 64
|
# define EXTERNAL_EEPROM_PAGE_SIZE 64
|
||||||
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
||||||
|
#elif defined(EEPROM_I2C_24LC64)
|
||||||
|
# define EXTERNAL_EEPROM_BYTE_COUNT 8192
|
||||||
|
# define EXTERNAL_EEPROM_PAGE_SIZE 32
|
||||||
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
|
# define EXTERNAL_EEPROM_WRITE_TIME 5
|
||||||
#elif defined(EEPROM_I2C_MB85RC256V)
|
#elif defined(EEPROM_I2C_MB85RC256V)
|
||||||
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
|
# define EXTERNAL_EEPROM_BYTE_COUNT 32768
|
||||||
# define EXTERNAL_EEPROM_PAGE_SIZE 128
|
# define EXTERNAL_EEPROM_PAGE_SIZE 128
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "hal.h"
|
#include <hal.h>
|
||||||
#include "eeprom_driver.h"
|
#include "eeprom_driver.h"
|
||||||
#include "eeprom_stm32_L0_L1.h"
|
#include "eeprom_stm32_L0_L1.h"
|
||||||
|
|
||||||
|
|||||||
@@ -21,8 +21,6 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
uint8_t DRV2605L_transfer_buffer[2];
|
uint8_t DRV2605L_transfer_buffer[2];
|
||||||
uint8_t DRV2605L_tx_register[0];
|
|
||||||
uint8_t DRV2605L_read_buffer[0];
|
|
||||||
uint8_t DRV2605L_read_register;
|
uint8_t DRV2605L_read_register;
|
||||||
|
|
||||||
void DRV_write(uint8_t drv_register, uint8_t settings) {
|
void DRV_write(uint8_t drv_register, uint8_t settings) {
|
||||||
@@ -32,8 +30,7 @@ void DRV_write(uint8_t drv_register, uint8_t settings) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t DRV_read(uint8_t regaddress) {
|
uint8_t DRV_read(uint8_t regaddress) {
|
||||||
i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, DRV2605L_read_buffer, 1, 100);
|
i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, &DRV2605L_read_register, 1, 100);
|
||||||
DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0];
|
|
||||||
|
|
||||||
return DRV2605L_read_register;
|
return DRV2605L_read_register;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <timer.h>
|
#include "timer.h"
|
||||||
#include "solenoid.h"
|
#include "solenoid.h"
|
||||||
#include "haptic.h"
|
#include "haptic.h"
|
||||||
|
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ uint8_t g_twi_transfer_buffer[20];
|
|||||||
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's
|
||||||
// probably not worth the extra complexity.
|
// probably not worth the extra complexity.
|
||||||
uint8_t g_pwm_buffer[LED_DRIVER_COUNT][144];
|
uint8_t g_pwm_buffer[LED_DRIVER_COUNT][144];
|
||||||
bool g_pwm_buffer_update_required = false;
|
bool g_pwm_buffer_update_required[LED_DRIVER_COUNT] = {false};
|
||||||
|
|
||||||
/* There's probably a better way to init this... */
|
/* There's probably a better way to init this... */
|
||||||
#if LED_DRIVER_COUNT == 1
|
#if LED_DRIVER_COUNT == 1
|
||||||
@@ -75,7 +75,7 @@ uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}};
|
|||||||
#elif LED_DRIVER_COUNT == 4
|
#elif LED_DRIVER_COUNT == 4
|
||||||
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}, {0}};
|
uint8_t g_led_control_registers[LED_DRIVER_COUNT][18] = {{0}, {0}, {0}, {0}};
|
||||||
#endif
|
#endif
|
||||||
bool g_led_control_registers_update_required = false;
|
bool g_led_control_registers_update_required[LED_DRIVER_COUNT] = {false};
|
||||||
|
|
||||||
// This is the bit pattern in the LED control registers
|
// This is the bit pattern in the LED control registers
|
||||||
// (for matrix A, add one to register for matrix B)
|
// (for matrix A, add one to register for matrix B)
|
||||||
@@ -190,8 +190,8 @@ void IS31FL3731_set_value(int index, uint8_t value) {
|
|||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
// Subtract 0x24 to get the second index of g_pwm_buffer
|
// Subtract 0x24 to get the second index of g_pwm_buffer
|
||||||
g_pwm_buffer[led.driver][led.v - 0x24] = value;
|
g_pwm_buffer[led.driver][led.v - 0x24] = value;
|
||||||
g_pwm_buffer_update_required = true;
|
g_pwm_buffer_update_required[led.driver] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -213,20 +213,21 @@ void IS31FL3731_set_led_control_register(uint8_t index, bool value) {
|
|||||||
g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value);
|
g_led_control_registers[led.driver][control_register] &= ~(1 << bit_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_led_control_registers_update_required = true;
|
g_led_control_registers_update_required[led.driver] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
|
void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
|
||||||
if (g_pwm_buffer_update_required) {
|
if (g_pwm_buffer_update_required[index]) {
|
||||||
IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
|
IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
|
||||||
g_pwm_buffer_update_required = false;
|
g_pwm_buffer_update_required[index] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) {
|
void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||||
if (g_led_control_registers_update_required) {
|
if (g_led_control_registers_update_required[index]) {
|
||||||
for (int i = 0; i < 18; i++) {
|
for (int i = 0; i < 18; i++) {
|
||||||
IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]);
|
IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]);
|
||||||
}
|
}
|
||||||
|
g_led_control_registers_update_required[index] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,6 +271,10 @@ static void rotate_90(const uint8_t *src, uint8_t *dest) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void oled_render(void) {
|
void oled_render(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Do we have work to do?
|
// Do we have work to do?
|
||||||
oled_dirty &= OLED_ALL_BLOCKS_MASK;
|
oled_dirty &= OLED_ALL_BLOCKS_MASK;
|
||||||
if (!oled_dirty || oled_scrolling) {
|
if (!oled_dirty || oled_scrolling) {
|
||||||
@@ -527,6 +531,10 @@ void oled_write_raw_P(const char *data, uint16_t size) {
|
|||||||
#endif // defined(__AVR__)
|
#endif // defined(__AVR__)
|
||||||
|
|
||||||
bool oled_on(void) {
|
bool oled_on(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return oled_active;
|
||||||
|
}
|
||||||
|
|
||||||
#if OLED_TIMEOUT > 0
|
#if OLED_TIMEOUT > 0
|
||||||
oled_timeout = timer_read32() + OLED_TIMEOUT;
|
oled_timeout = timer_read32() + OLED_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
@@ -543,6 +551,10 @@ bool oled_on(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool oled_off(void) {
|
bool oled_off(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return !oled_active;
|
||||||
|
}
|
||||||
|
|
||||||
static const uint8_t PROGMEM display_off[] = {I2C_CMD, DISPLAY_OFF};
|
static const uint8_t PROGMEM display_off[] = {I2C_CMD, DISPLAY_OFF};
|
||||||
if (oled_active) {
|
if (oled_active) {
|
||||||
if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_off) != I2C_STATUS_SUCCESS) {
|
||||||
@@ -557,6 +569,10 @@ bool oled_off(void) {
|
|||||||
bool is_oled_on(void) { return oled_active; }
|
bool is_oled_on(void) { return oled_active; }
|
||||||
|
|
||||||
uint8_t oled_set_brightness(uint8_t level) {
|
uint8_t oled_set_brightness(uint8_t level) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return oled_brightness;
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t set_contrast[] = {I2C_CMD, CONTRAST, level};
|
uint8_t set_contrast[] = {I2C_CMD, CONTRAST, level};
|
||||||
if (oled_brightness != level) {
|
if (oled_brightness != level) {
|
||||||
if (I2C_TRANSMIT(set_contrast) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT(set_contrast) != I2C_STATUS_SUCCESS) {
|
||||||
@@ -596,6 +612,10 @@ void oled_scroll_set_speed(uint8_t speed) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool oled_scroll_right(void) {
|
bool oled_scroll_right(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
// Dont enable scrolling if we need to update the display
|
// Dont enable scrolling if we need to update the display
|
||||||
// This prevents scrolling of bad data from starting the scroll too early after init
|
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||||
if (!oled_dirty && !oled_scrolling) {
|
if (!oled_dirty && !oled_scrolling) {
|
||||||
@@ -610,6 +630,10 @@ bool oled_scroll_right(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool oled_scroll_left(void) {
|
bool oled_scroll_left(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return oled_scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
// Dont enable scrolling if we need to update the display
|
// Dont enable scrolling if we need to update the display
|
||||||
// This prevents scrolling of bad data from starting the scroll too early after init
|
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||||
if (!oled_dirty && !oled_scrolling) {
|
if (!oled_dirty && !oled_scrolling) {
|
||||||
@@ -624,6 +648,10 @@ bool oled_scroll_left(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool oled_scroll_off(void) {
|
bool oled_scroll_off(void) {
|
||||||
|
if (!oled_initialized) {
|
||||||
|
return !oled_scrolling;
|
||||||
|
}
|
||||||
|
|
||||||
if (oled_scrolling) {
|
if (oled_scrolling) {
|
||||||
static const uint8_t PROGMEM display_scroll_off[] = {I2C_CMD, DEACTIVATE_SCROLL};
|
static const uint8_t PROGMEM display_scroll_off[] = {I2C_CMD, DEACTIVATE_SCROLL};
|
||||||
if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_scroll_off) != I2C_STATUS_SUCCESS) {
|
||||||
|
|||||||
@@ -28,11 +28,11 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "micro_oled.h"
|
#include "micro_oled.h"
|
||||||
#include <print.h>
|
#include "print.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "util/font5x7.h"
|
#include "util/font5x7.h"
|
||||||
#include "util/font8x16.h"
|
#include "util/font8x16.h"
|
||||||
#include "string.h"
|
#include <string.h>
|
||||||
|
|
||||||
#define TOTALFONTS 2
|
#define TOTALFONTS 2
|
||||||
const unsigned char* fonts_pointer[] = {font5x7, font8x16};
|
const unsigned char* fonts_pointer[] = {font5x7, font8x16};
|
||||||
|
|||||||
@@ -1,16 +1,17 @@
|
|||||||
ifneq ($(strip $(QWIIC_ENABLE)),)
|
ifeq ($(strip $(QWIIC_ENABLE)),yes)
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/qwiic
|
COMMON_VPATH += $(DRIVER_PATH)/qwiic
|
||||||
OPT_DEFS += -DQWIIC_ENABLE
|
OPT_DEFS += -DQWIIC_ENABLE
|
||||||
SRC += qwiic.c
|
SRC += qwiic.c
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),)
|
ifneq ($(filter JOYSTIIC, $(QWIIC_DRIVERS)),)
|
||||||
OPT_DEFS += -DQWIIC_JOYSTIIC_ENABLE
|
OPT_DEFS += -DQWIIC_JOYSTIIC_ENABLE
|
||||||
SRC += joystiic.c
|
SRC += joystiic.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(filter MICRO_OLED, $(QWIIC_ENABLE)),)
|
ifneq ($(filter MICRO_OLED, $(QWIIC_DRIVERS)),)
|
||||||
OPT_DEFS += -DQWIIC_MICRO_OLED_ENABLE
|
OPT_DEFS += -DQWIIC_MICRO_OLED_ENABLE
|
||||||
SRC += micro_oled.c
|
SRC += micro_oled.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|||||||
0
keyboards/10bleoledhub/.noci
Normal file
0
keyboards/10bleoledhub/.noci
Normal file
@@ -26,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.*/
|
|||||||
/* key matrix size */
|
/* key matrix size */
|
||||||
#define MATRIX_ROWS 4
|
#define MATRIX_ROWS 4
|
||||||
#define MATRIX_COLS 3
|
#define MATRIX_COLS 3
|
||||||
#define MATRIX_ROW_PINS { F6, F5, F4, F1 }
|
#define MATRIX_ROW_PINS { F0, F5, F4, F6 }
|
||||||
#define MATRIX_COL_PINS { D6, D7, B5 }
|
#define MATRIX_COL_PINS { D6, D7, B5 }
|
||||||
#define UNUSED_PINS
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
|||||||
0
keyboards/1upkeyboards/sweet16/.noci
Normal file
0
keyboards/1upkeyboards/sweet16/.noci
Normal file
@@ -1,5 +1,6 @@
|
|||||||
# MCU name
|
# MCU name
|
||||||
MCU = STM32F303
|
MCU = STM32F303
|
||||||
|
BOARD = QMK_PROTON_C
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
CONSOLE_ENABLE = yes
|
CONSOLE_ENABLE = yes
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#include "config_common.h"
|
#include "config_common.h"
|
||||||
|
|
||||||
/* USB Device descriptor parameter */
|
/* USB Device descriptor parameter */
|
||||||
#define VENDOR_ID 0xCEEB
|
#define VENDOR_ID 0x3430 // "40"
|
||||||
#define PRODUCT_ID 0x0510
|
#define PRODUCT_ID 0x4D68 // "M68"
|
||||||
#define DEVICE_VER 0x0101
|
#define DEVICE_VER 0x0101
|
||||||
#define MANUFACTURER di0ib
|
#define MANUFACTURER di0ib
|
||||||
#define PRODUCT MF68
|
#define PRODUCT MF68
|
||||||
|
|||||||
49
keyboards/40percentclub/mf68/keymaps/via/keymap.c
Normal file
49
keyboards/40percentclub/mf68/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/* Copyright 2020 MechMerlin
|
||||||
|
*
|
||||||
|
* 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_68_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_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_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, MO(1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||||
|
),
|
||||||
|
[1] = LAYOUT_68_ansi(
|
||||||
|
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, KC_VOLU, KC_HOME,
|
||||||
|
_______, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, _______, KC_VOLD, KC_END,
|
||||||
|
_______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______, KC_MUTE,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT
|
||||||
|
),
|
||||||
|
[2] = LAYOUT_68_ansi(
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
),
|
||||||
|
[3] = LAYOUT_68_ansi(
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||||
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||||
|
)
|
||||||
|
};
|
||||||
2
keyboards/40percentclub/mf68/keymaps/via/rules.mk
Normal file
2
keyboards/40percentclub/mf68/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
|
LTO_ENABLE = yes
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
{ K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \
|
{ K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \
|
||||||
{ K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \
|
{ K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \
|
||||||
{ K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \
|
{ K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \
|
||||||
{ K70, K71, K72, K73, K74 } \
|
{ K70, K71, K72, K73, K74, KC_NO, KC_NO, KC_NO, KC_NO } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LAYOUT_kc( \
|
#define LAYOUT_kc( \
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ BOOTLOADER = caterina
|
|||||||
# Build Options
|
# Build Options
|
||||||
# change yes to no to disable
|
# change yes to no to disable
|
||||||
#
|
#
|
||||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
CONSOLE_ENABLE = no # Console for debug
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
@@ -22,7 +22,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration
|
|||||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
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
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
NKRO_ENABLE = no # USB Nkey Rollover
|
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
|
||||||
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
MIDI_ENABLE = no # MIDI controls
|
MIDI_ENABLE = no # MIDI controls
|
||||||
|
|||||||
122
keyboards/40percentclub/sixpack/config.h
Normal file
122
keyboards/40percentclub/sixpack/config.h
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/*
|
||||||
|
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 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 0x3430 // "40"
|
||||||
|
#define PRODUCT_ID 0x5350 // "SP"
|
||||||
|
#define DEVICE_VER 0x1001
|
||||||
|
#define MANUFACTURER di0ib
|
||||||
|
#define PRODUCT Six Pack
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 2
|
||||||
|
#define MATRIX_COLS 3
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
// #define MATRIX_ROW_PINS { B0 } // B0 equivalents the ground pin
|
||||||
|
// #define MATRIX_COL_PINS { E6, D7, C6, D4 }
|
||||||
|
#define DIRECT_PINS { \
|
||||||
|
{ D4, C6, D7 }, \
|
||||||
|
{ E6, B4, B5 } \
|
||||||
|
}
|
||||||
|
#define UNUSED_PINS { D1, D0, C4, C5, B1, B2, B3 } // TX, RX, SDA, SCL, PB1, PB2, PB3 on expansion connector
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* Backlight */
|
||||||
|
#define BACKLIGHT_BREATHING
|
||||||
|
#define BACKLIGHT_LEVELS 6
|
||||||
|
#define BACKLIGHT_PINS { F4, F5 } // Top Row, Bottom Row
|
||||||
|
|
||||||
|
// #define RGB_DI_PIN B1 // PB1 on expansion connector
|
||||||
|
// #ifdef RGB_DI_PIN
|
||||||
|
// #define RGBLED_NUM 16
|
||||||
|
// #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
|
||||||
|
|
||||||
|
/* 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
|
||||||
|
|
||||||
|
|
||||||
|
/* Bootmagic Lite key configuration */
|
||||||
|
// #define BOOTMAGIC_LITE_ROW 0
|
||||||
|
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||||
15
keyboards/40percentclub/sixpack/info.json
Normal file
15
keyboards/40percentclub/sixpack/info.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "sixpack",
|
||||||
|
"url": "https://www.40percent.club/2017/05/six-pack-11.html",
|
||||||
|
"maintainer": "qmk",
|
||||||
|
"width": 3,
|
||||||
|
"height": 2,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_ortho_2x3": {
|
||||||
|
"layout": [
|
||||||
|
{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0},
|
||||||
|
{"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
31
keyboards/40percentclub/sixpack/keymaps/default/keymap.c
Normal file
31
keyboards/40percentclub/sixpack/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/* 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 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] = {
|
||||||
|
|
||||||
|
/* Default 2x3 layout
|
||||||
|
* .--------------------------.
|
||||||
|
* | MUTE | UP | PLAY |
|
||||||
|
* |--------+--------+--------+
|
||||||
|
* | LEFT | DOWN | RIGHT |
|
||||||
|
* '--------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[0] = LAYOUT_ortho_2x3(/* Default */
|
||||||
|
KC_MUTE, KC_UP, KC_MPLY,
|
||||||
|
KC_LEFT, KC_DOWN, KC_RGHT),
|
||||||
|
};
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
# The default keymap for Six Pack
|
||||||
50
keyboards/40percentclub/sixpack/keymaps/fkeys/keymap.c
Normal file
50
keyboards/40percentclub/sixpack/keymaps/fkeys/keymap.c
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
/* 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 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
|
||||||
|
|
||||||
|
// Tap Dance declarations
|
||||||
|
enum {
|
||||||
|
F13F19,
|
||||||
|
F14F20,
|
||||||
|
F15F21,
|
||||||
|
F16F22,
|
||||||
|
F17F23,
|
||||||
|
F18F24,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Tap Dance definitions
|
||||||
|
qk_tap_dance_action_t tap_dance_actions[] = {
|
||||||
|
// Tap once for F13 to F18, twice for F19 to F24
|
||||||
|
[F13F19] = ACTION_TAP_DANCE_DOUBLE(KC_F13, KC_F19), [F14F20] = ACTION_TAP_DANCE_DOUBLE(KC_F14, KC_F20), [F15F21] = ACTION_TAP_DANCE_DOUBLE(KC_F15, KC_F21),
|
||||||
|
[F16F22] = ACTION_TAP_DANCE_DOUBLE(KC_F16, KC_F22), [F17F23] = ACTION_TAP_DANCE_DOUBLE(KC_F17, KC_F23), [F18F24] = ACTION_TAP_DANCE_DOUBLE(KC_F18, KC_F24)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Add tap dance item in place of a key code
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/* 2x3 layout
|
||||||
|
* .-----------------------------.
|
||||||
|
* | F13/F19 | D14/F20 | F15/F21 |
|
||||||
|
* |---------+---------+---------+
|
||||||
|
* | F16/F22 | D17/F23 | F18/F24 |
|
||||||
|
* '-----------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[0] = LAYOUT_ortho_2x3(/* F13 to F24 */
|
||||||
|
TD(F13F19), TD(F14F20), TD(F15F21),
|
||||||
|
TD(F16F22), TD(F17F23), TD(F18F24)
|
||||||
|
),
|
||||||
|
};
|
||||||
1
keyboards/40percentclub/sixpack/keymaps/fkeys/readme.md
Normal file
1
keyboards/40percentclub/sixpack/keymaps/fkeys/readme.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# F13 to F24 keymap with Tap Dance for Six Pack
|
||||||
1
keyboards/40percentclub/sixpack/keymaps/fkeys/rules.mk
Normal file
1
keyboards/40percentclub/sixpack/keymaps/fkeys/rules.mk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
TAP_DANCE_ENABLE = yes
|
||||||
41
keyboards/40percentclub/sixpack/keymaps/via/keymap.c
Normal file
41
keyboards/40percentclub/sixpack/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
/* 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 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] = {
|
||||||
|
|
||||||
|
/* Default 2x3 layout with 6 Layers
|
||||||
|
* .--------------------------.
|
||||||
|
* | MUTE | UP | PLAY |
|
||||||
|
* |--------+--------+--------+
|
||||||
|
* | LEFT | DOWN | RIGHT |
|
||||||
|
* '--------------------------'
|
||||||
|
*/
|
||||||
|
|
||||||
|
[0] = LAYOUT_ortho_2x3(KC_MUTE, KC_UP , KC_MPLY,
|
||||||
|
KC_LEFT, KC_DOWN, KC_RGHT),
|
||||||
|
[1] = LAYOUT_ortho_2x3(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
[2] = LAYOUT_ortho_2x3(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
[3] = LAYOUT_ortho_2x3(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
[4] = LAYOUT_ortho_2x3(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
[5] = LAYOUT_ortho_2x3(KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
|
||||||
|
};
|
||||||
1
keyboards/40percentclub/sixpack/keymaps/via/rules.mk
Normal file
1
keyboards/40percentclub/sixpack/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
|||||||
|
VIA_ENABLE = yes
|
||||||
21
keyboards/40percentclub/sixpack/readme.md
Normal file
21
keyboards/40percentclub/sixpack/readme.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Six Pack
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A 6-key macropad PCB with its switch and LED pins wired directly to microcontroller IO pins.
|
||||||
|
|
||||||
|
You can find the main blog post about this macropad [here](http://www.40percent.club/2017/05/six-pack-11.html), also the Gerber files and other documentation is located [here](https://git.40percent.club/di0ib/Misc/src/branch/master/Six%20Pack).
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [The QMK Community](https://github.com/qmk)
|
||||||
|
* Hardware Supported: Six Pack PCB, Pro Micro
|
||||||
|
* Hardware Availability: [40percent.club](https://git.40percent.club/di0ib/Misc/src/branch/master/Six%20Pack)
|
||||||
|
|
||||||
|
Make example for this macropad (after setting up your build environment):
|
||||||
|
|
||||||
|
make 40percentclub/sixpack:default
|
||||||
|
|
||||||
|
Flashing example for this keyboard:
|
||||||
|
|
||||||
|
make 40percentclub/sixpack:default:flash
|
||||||
|
|
||||||
|
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).
|
||||||
22
keyboards/40percentclub/sixpack/rules.mk
Normal file
22
keyboards/40percentclub/sixpack/rules.mk
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
BOOTLOADER = caterina
|
||||||
|
|
||||||
|
# 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 = 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 = yes # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||||
|
AUDIO_ENABLE = no # Audio output
|
||||||
24
keyboards/40percentclub/sixpack/sixpack.c
Normal file
24
keyboards/40percentclub/sixpack/sixpack.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
/* 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 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 "sixpack.h"
|
||||||
|
|
||||||
|
void matrix_init_kb(void) {
|
||||||
|
setPinOutput(B6); // Backlight cathodes Col.3
|
||||||
|
setPinOutput(F6); // Backlight cathodes Col.2
|
||||||
|
setPinOutput(F7); // Backlight cathodes Col.1
|
||||||
|
|
||||||
|
matrix_init_user();
|
||||||
|
}
|
||||||
34
keyboards/40percentclub/sixpack/sixpack.h
Normal file
34
keyboards/40percentclub/sixpack/sixpack.h
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/* 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 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 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_ortho_2x3( \
|
||||||
|
k00, k01, k02, \
|
||||||
|
k10, k11, k12 \
|
||||||
|
) { \
|
||||||
|
{ k00, k01, k02 }, \
|
||||||
|
{ k10, k11, k12 } \
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <avr/io.h>
|
#include <avr/io.h>
|
||||||
#include "stdint.h"
|
#include <stdint.h>
|
||||||
#include "led.h"
|
#include "led.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user