Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54b04d9665 | ||
|
|
4604c70c4c | ||
|
|
010c5b12bd | ||
|
|
4adf4d5a89 | ||
|
|
d0e0202b27 | ||
|
|
fb9425df82 | ||
|
|
22ad35b225 | ||
|
|
f6cec668c7 | ||
|
|
2651edc243 | ||
|
|
2a43989d30 | ||
|
|
2f5521cd48 | ||
|
|
ac3d2a3810 | ||
|
|
1786490993 | ||
|
|
e55d55edc0 | ||
|
|
ad014c2539 | ||
|
|
81698df056 | ||
|
|
fca35a3540 | ||
|
|
5d01cc45be | ||
|
|
eaab0844e8 | ||
|
|
ce842f912e | ||
|
|
cceab93baa | ||
|
|
4161573b28 | ||
|
|
d0e684ef55 | ||
|
|
f125406700 | ||
|
|
afebb6576c | ||
|
|
7f6ba2bf8a | ||
|
|
142ebaea46 | ||
|
|
bbd17def21 | ||
|
|
d89e552419 | ||
|
|
9cf69a1997 | ||
|
|
c6cf1ae4e7 | ||
|
|
2c9ab8a606 | ||
|
|
0bf60acc4b | ||
|
|
6b54f3ce1c | ||
|
|
c3aaed8dfb | ||
|
|
ebc274209e | ||
|
|
1bdfac8afc | ||
|
|
9b716b7ada | ||
|
|
b591c0c24a | ||
|
|
6ba014a572 | ||
|
|
2dd47a3bf4 | ||
|
|
887c1c4e0e | ||
|
|
f66850bfd0 | ||
|
|
632285c982 | ||
|
|
805f5cb72b | ||
|
|
a8a8bf0ff3 | ||
|
|
fadd3cb461 | ||
|
|
a41f973f75 | ||
|
|
7abbc95cd6 | ||
|
|
30a6f231bf | ||
|
|
44ff14f290 | ||
|
|
741c7d5eec | ||
|
|
f3c30e80cc | ||
|
|
d846660e00 | ||
|
|
774384ce31 | ||
|
|
361ac2f32a | ||
|
|
d15a60d2d3 | ||
|
|
73992c68d5 | ||
|
|
8ca4ed9a98 | ||
|
|
640d12d070 | ||
|
|
3beda5c16e | ||
|
|
fb7fc54923 | ||
|
|
179c868059 | ||
|
|
7b11dcce10 | ||
|
|
e2fa05c6d2 | ||
|
|
4c4009c0fd | ||
|
|
e7860d673b | ||
|
|
2fe7e221ec | ||
|
|
e0f548085c | ||
|
|
94fc32f431 | ||
|
|
1f7bbf279c | ||
|
|
803610a284 | ||
|
|
cd0edbb1fb | ||
|
|
6919772fb9 | ||
|
|
fedd8e81d1 | ||
|
|
adda5d7770 | ||
|
|
d2581884d9 | ||
|
|
58fd782ce0 | ||
|
|
8e56d10e4e | ||
|
|
43868a5e20 | ||
|
|
db167ecf79 | ||
|
|
2b8b1045a1 | ||
|
|
7a6e52b5d8 | ||
|
|
ae5f7365ea | ||
|
|
606438692d | ||
|
|
5d29a13e22 | ||
|
|
81c648e947 | ||
|
|
923bad46f9 | ||
|
|
19513fac5f | ||
|
|
7bb9c76c80 | ||
|
|
57e67a4cc8 | ||
|
|
cf3913cd79 | ||
|
|
a30cc37c09 | ||
|
|
b18c261040 | ||
|
|
bac5d6bc6a | ||
|
|
ab1650606c | ||
|
|
dc00942be1 | ||
|
|
e8f842e798 | ||
|
|
3745ebc22b | ||
|
|
d646cba72a | ||
|
|
15e84f79f1 | ||
|
|
6f30b402a2 | ||
|
|
1ff526dac0 | ||
|
|
e17b55e33a | ||
|
|
f31bf1b202 | ||
|
|
5f82b0782f | ||
|
|
2e6959ed87 | ||
|
|
c482a2944b | ||
|
|
65c8ac9ac9 | ||
|
|
e182a38e7c | ||
|
|
fe4581c1a1 | ||
|
|
ddd055b1e2 | ||
|
|
f7324ec684 | ||
|
|
3d760caa85 | ||
|
|
750c7c2bdb | ||
|
|
4846c8eba0 | ||
|
|
3de4c3ea6a | ||
|
|
830bd5460c | ||
|
|
9f54a26dc0 | ||
|
|
16a15c1cfc | ||
|
|
37a4b53c4f | ||
|
|
a84d239661 | ||
|
|
41fd60d624 | ||
|
|
231464c49c | ||
|
|
d26a14c169 | ||
|
|
195be50745 | ||
|
|
8fdb229b66 | ||
|
|
fd3456f362 | ||
|
|
812d80efbd | ||
|
|
86c4c4e91d | ||
|
|
168ba88ada | ||
|
|
5f5c2a219c | ||
|
|
e415198235 | ||
|
|
b17482c3fd | ||
|
|
5b4870c046 | ||
|
|
374525c995 | ||
|
|
e02a3c559d | ||
|
|
e1217dae5a | ||
|
|
485a0b0bc3 | ||
|
|
23cfc4b145 | ||
|
|
bd639752db | ||
|
|
aaeef7a833 | ||
|
|
0d6614f71f | ||
|
|
d322ec5452 | ||
|
|
c7449b3840 | ||
|
|
4c51049b2b | ||
|
|
dd60fcda28 | ||
|
|
fd6b674b49 | ||
|
|
2c0deb8a13 | ||
|
|
a904371b29 | ||
|
|
cfdd105d9d | ||
|
|
82ae6ee007 | ||
|
|
f220e7d713 | ||
|
|
3cb6fb2935 | ||
|
|
5c666398d5 | ||
|
|
a47915d2d2 | ||
|
|
6ec3cc029e | ||
|
|
4597f2bcc8 | ||
|
|
52af38da37 | ||
|
|
b2dbc3f515 | ||
|
|
86b62eadc2 | ||
|
|
3337eb10b2 | ||
|
|
32bab55def | ||
|
|
47fc2f8855 | ||
|
|
ee29b515ec | ||
|
|
c031e13982 | ||
|
|
84bf82f2c9 | ||
|
|
af26238385 | ||
|
|
28e5969f78 | ||
|
|
59246756e5 | ||
|
|
423ce39f18 | ||
|
|
217debff07 | ||
|
|
52e9719d09 | ||
|
|
9df367e227 | ||
|
|
8650b9f10c | ||
|
|
5c9c45619e | ||
|
|
09caf19389 | ||
|
|
4baf49191f | ||
|
|
427da3c19c | ||
|
|
1df8bb3cdb | ||
|
|
99eacdc47a | ||
|
|
5e235d30c7 | ||
|
|
6586280bf3 | ||
|
|
0722986d7a | ||
|
|
22a10cc8a3 | ||
|
|
b349fa0a57 | ||
|
|
e98a9578a1 | ||
|
|
d2b03bf150 | ||
|
|
35ca1c2212 | ||
|
|
ccc8338b0e | ||
|
|
bafa35ff46 | ||
|
|
182286680a | ||
|
|
c1c579c554 | ||
|
|
19bd8aa942 | ||
|
|
d0d105b083 | ||
|
|
c0a57c2a50 | ||
|
|
738c6612ca | ||
|
|
643fc1d806 | ||
|
|
f78896589e | ||
|
|
837ffd0006 | ||
|
|
92a50a386a | ||
|
|
357c6009be | ||
|
|
e916ce5f3e | ||
|
|
086a7cf800 | ||
|
|
99f7fe6bd4 | ||
|
|
d0c3a4c8d5 | ||
|
|
2dca087b04 | ||
|
|
b80340c207 | ||
|
|
cb4a86475e | ||
|
|
7e4cf9ace2 | ||
|
|
0d658e0c95 | ||
|
|
1522d97c2b | ||
|
|
2d39a9dcdb | ||
|
|
33bf4863f5 | ||
|
|
ad547c1fdd | ||
|
|
9b70e53508 | ||
|
|
33a5dc4fcf | ||
|
|
e0fffcde99 | ||
|
|
06bffbd45b | ||
|
|
c261076f8e | ||
|
|
51ecd37d7b | ||
|
|
ed5e69093c | ||
|
|
43785126a7 | ||
|
|
8c97b4a3a4 | ||
|
|
0698b15aa5 | ||
|
|
d600631ad1 | ||
|
|
f3595f65b7 | ||
|
|
23df763a31 | ||
|
|
ed910c8e97 | ||
|
|
7e1c0bd4c0 | ||
|
|
d2b8398f75 | ||
|
|
195324cc4c | ||
|
|
cd5399942b | ||
|
|
fd4bbd8d11 | ||
|
|
f43cb31476 | ||
|
|
89eb3a9e42 | ||
|
|
66d94dc22a | ||
|
|
5a8f59503e | ||
|
|
7918f7d61d | ||
|
|
a6bd8fe67b | ||
|
|
55b43f02f0 | ||
|
|
db4b11f866 | ||
|
|
46a84ec84a | ||
|
|
3b5998085c | ||
|
|
7a9980fd85 | ||
|
|
bc13dcd349 | ||
|
|
55002338b1 | ||
|
|
99d9250045 | ||
|
|
4a92dd327c | ||
|
|
7873b49d40 | ||
|
|
fcf2b45263 | ||
|
|
5607af8524 | ||
|
|
5a45627e17 | ||
|
|
17d0f6338e | ||
|
|
484c059d86 | ||
|
|
3cc68543ca | ||
|
|
daf6dedb02 | ||
|
|
7a0d145e27 | ||
|
|
e990863296 | ||
|
|
d06340f665 | ||
|
|
4c0065dda7 | ||
|
|
2ae39ccf38 | ||
|
|
5185c52b4a | ||
|
|
c0b99badcb | ||
|
|
f9bb9ef0b8 | ||
|
|
3d9ffd3efb | ||
|
|
3cea9fedff | ||
|
|
575d99816e | ||
|
|
4bccde37d4 | ||
|
|
f6b40da7f8 | ||
|
|
6fb048fdaf | ||
|
|
06b571aa53 | ||
|
|
355b693e4e | ||
|
|
f514ad5503 | ||
|
|
09a1917103 | ||
|
|
46e4493761 | ||
|
|
157d121c71 | ||
|
|
7e6b550ebf | ||
|
|
7f4ce4a8b7 | ||
|
|
6452973761 | ||
|
|
a2309b306a | ||
|
|
52ac6c4303 | ||
|
|
05e9ff6554 | ||
|
|
17bda000f3 | ||
|
|
46a69d1f3b | ||
|
|
b56a41800a | ||
|
|
d3c29c9b3c | ||
|
|
370577e4ed | ||
|
|
6e84247ec2 | ||
|
|
5380c29dd7 | ||
|
|
23f19852b9 | ||
|
|
8a5c1e1859 | ||
|
|
6265b78307 | ||
|
|
23124b9fd1 | ||
|
|
eb7fc7f9d9 | ||
|
|
c2df714c3b | ||
|
|
799b21f8cd | ||
|
|
750179e111 | ||
|
|
0499f30f59 | ||
|
|
e0909a31c7 | ||
|
|
d6bffdf577 | ||
|
|
bf38f39c3f | ||
|
|
62d1d69ba9 |
No files matched your search
@@ -1,24 +0,0 @@
|
|||||||
|
|
||||||
-I.
|
|
||||||
-I./drivers
|
|
||||||
-I./drivers/avr
|
|
||||||
-I./keyboards/ergodox_ez
|
|
||||||
-I./keyboards/ergodox_ez/keymaps/vim
|
|
||||||
-I./lib
|
|
||||||
-I./lib/lufa
|
|
||||||
-I./quantum
|
|
||||||
-I./quantum/api
|
|
||||||
-I./quantum/audio
|
|
||||||
-I./quantum/keymap_extras
|
|
||||||
-I./quantum/process_keycode
|
|
||||||
-I./quantum/serial_link
|
|
||||||
-I./quantum/template
|
|
||||||
-I./quantum/tools
|
|
||||||
-I./quantum/visualizer
|
|
||||||
-I./tmk_core
|
|
||||||
-I./tmk_core/common
|
|
||||||
-I./tmk_core/common/debug.h
|
|
||||||
-I./tmk_core/protocol
|
|
||||||
-I./tmk_core/protocol/lufa
|
|
||||||
-I./util
|
|
||||||
-DQMK_KEYBOARD=\"$(KEYBOARD)\" -DQMK_KEYMAP=\"$(KEYMAP)\"
|
|
||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
container: qmkfm/base_container
|
container: qmkfm/base_container
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|||||||
+1
-1
@@ -24,6 +24,7 @@ quantum/version.h
|
|||||||
.idea/
|
.idea/
|
||||||
CMakeLists.txt
|
CMakeLists.txt
|
||||||
cmake-build-debug
|
cmake-build-debug
|
||||||
|
.clang_complete
|
||||||
doxygen/
|
doxygen/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
/util/wsl_downloaded
|
/util/wsl_downloaded
|
||||||
@@ -47,7 +48,6 @@ doxygen/
|
|||||||
*.iml
|
*.iml
|
||||||
.browse.VC.db*
|
.browse.VC.db*
|
||||||
*.stackdump
|
*.stackdump
|
||||||
util/Win_Check_Output.txt
|
|
||||||
# Let these ones be user specific, since we have so many different configurations
|
# Let these ones be user specific, since we have so many different configurations
|
||||||
.vscode/c_cpp_properties.json
|
.vscode/c_cpp_properties.json
|
||||||
.vscode/launch.json
|
.vscode/launch.json
|
||||||
|
|||||||
Vendored
+12
-8
@@ -9,13 +9,17 @@
|
|||||||
"**/*.bin": true
|
"**/*.bin": true
|
||||||
},
|
},
|
||||||
"files.associations": {
|
"files.associations": {
|
||||||
"*.h": "c",
|
"*.h": "c",
|
||||||
"*.c": "c",
|
"*.c": "c",
|
||||||
"*.inc": "c",
|
"*.inc": "c",
|
||||||
"*.cpp": "cpp",
|
"*.cpp": "cpp",
|
||||||
"*.hpp": "cpp",
|
"*.hpp": "cpp",
|
||||||
"xstddef": "c",
|
"xstddef": "c",
|
||||||
"type_traits": "c",
|
"type_traits": "c",
|
||||||
"utility": "c"
|
"utility": "c"
|
||||||
|
},
|
||||||
|
"[markdown]": {
|
||||||
|
"editor.trimAutoWhitespace": false,
|
||||||
|
"files.trimTrailingWhitespace": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -29,6 +29,9 @@ $(info QMK Firmware $(QMK_VERSION))
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# avoid 'Entering|Leaving directory' messages
|
||||||
|
MAKEFLAGS += --no-print-directory
|
||||||
|
|
||||||
ON_ERROR := error_occurred=1
|
ON_ERROR := error_occurred=1
|
||||||
|
|
||||||
BREAK_ON_ERRORS = no
|
BREAK_ON_ERRORS = no
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
complete -W " 9key-default alps64-default amj40-default amj40-fabian amj60-default_60_ansi amj60-iso_split_rshift amj60-maximized amjpad-default amjpad-max amjpad-ortho_left amjpad-ortho_right atomic-default atomic-default_ortho_5x15 atomic-pvc atreus-alphadox atreus-classic atreus-default atreus-erlandsona atreus-gerb atreus-jeremy atreus-replicaJunction atreus-xyverz atreus62-atreus52 atreus62-default atreus62-mneme atreus62-xyverz bananasplit-0010 bananasplit-coloneljesus bananasplit-default bananasplit-hhkbanana bananasplit-nic bananasplit-rask bantam44-default chibios_test-default clueboard-bloodlvst clueboard-caps_fn clueboard-colemak clueboard-default clueboard-jokrik clueboard-mac_optimized clueboard-magicmonty clueboard-maximised clueboard-mouse_keys clueboard-serubin clueboard-shift_fn clueboard-skully clueboard-smt clueboard-tetris clueboard-unix_optimized clueboard-win_optimized clueboard-xyverz cluecard-default cluecard-rgb_effects cluepad-default deltasplit75-default deltasplit75-itsaferbie deltasplit75-protosplit dk60-default eco-default eco-that_canadian ergodone-333fred ergodone-ab ergodone-absenth ergodone-adam ergodone-adnw_k_o_y ergodone-albert ergodone-alexjj ergodone-algernon ergodone-alphadox ergodone-andrew_osx ergodone-belak ergodone-bepo ergodone-bepo_csa ergodone-bryan ergodone-coderkun_neo2 ergodone-colemak ergodone-colemak_osx_pc_no ergodone-colemak_programmer ergodone-common_nighthawk ergodone-csharp_dev ergodone-dave ergodone-deadcyclo ergodone-default ergodone-default_ergodox ergodone-dragon788 ergodone-dvorak ergodone-dvorak_emacs ergodone-dvorak_emacs_software ergodone-dvorak_intl_squisher ergodone-dvorak_plover ergodone-dvorak_programmer ergodone-dvorak_programmer_swe ergodone-dvorak_spanish ergodone-emacs_osx_dk ergodone-erez_experimental ergodone-familiar ergodone-french_hacker ergodone-galson ergodone-german ergodone-german-kinergo ergodone-german-lukas ergodone-german-manuneo ergodone-guni ergodone-ishigoya-jp ergodone-italian ergodone-j3rn ergodone-jack ergodone-jacobono ergodone-jafo ergodone-jgarr ergodone-josh ergodone-kastyle ergodone-kines-ish ergodone-kristian ergodone-maz ergodone-mclennon_osx ergodone-mpiechotka ergodone-msc ergodone-naps62 ergodone-neo2_on_qwertz_hardware ergodone-norwegian_programmer_osx_pc ergodone-norwegian_programmer_osx_pc_colemak ergodone-ordinary ergodone-osx_de ergodone-osx_de_adnw_koy ergodone-osx_de_experimental ergodone-osx_fr ergodone-osx_kinesis_pnut ergodone-osx_whiskey_tango_foxtrot_capslock ergodone-phoenix ergodone-plover ergodone-plums ergodone-pvinis ergodone-replicaJunction ergodone-reset_eeprom ergodone-robot_test_layout ergodone-romanzolotarev-norman-osx ergodone-romanzolotarev-norman-plover-osx ergodone-romanzolotarev-norman-plover-osx-hjkl ergodone-romanzolotarev-norman-qwerty-osx ergodone-sethbc ergodone-siroken3 ergodone-sneako ergodone-software_neo2 ergodone-supercoder ergodone-swedish ergodone-swedish-lindhe ergodone-swissgerman ergodone-techtomas ergodone-teckinesis ergodone-tkuichooseyou ergodone-tm2030 ergodone-tonyabra_osx ergodone-townk_osx ergodone-twentylives_dvorak_with_hebrew ergodone-twey ergodone-videck ergodone-win10_writers-block ergodone-workman_osx_mdw ergodone-xyverz ergodone-yoruian ergodone-zweihander-osx ergodox_ez-333fred ergodox_ez-ab ergodox_ez-absenth ergodox_ez-adam ergodox_ez-adnw_k_o_y ergodox_ez-albert ergodox_ez-alexjj ergodox_ez-algernon ergodox_ez-alphadox ergodox_ez-andrew_osx ergodox_ez-belak ergodox_ez-bepo ergodox_ez-bepo_csa ergodox_ez-blakedietz ergodox_ez-bryan ergodox_ez-coderkun_neo2 ergodox_ez-colemak ergodox_ez-colemak_osx_pc_no ergodox_ez-colemak_programmer ergodox_ez-common_nighthawk ergodox_ez-csharp_dev ergodox_ez-dave ergodox_ez-deadcyclo ergodox_ez-default ergodox_ez-default_ergodox ergodox_ez-default_osx ergodox_ez-dragon788 ergodox_ez-drashna ergodox_ez-drashna-custom ergodox_ez-dvorak ergodox_ez-dvorak_emacs ergodox_ez-dvorak_emacs_software ergodox_ez-dvorak_intl_squisher ergodox_ez-dvorak_plover ergodox_ez-dvorak_programmer ergodox_ez-dvorak_programmer_swe ergodox_ez-dvorak_spanish ergodox_ez-emacs_osx_dk ergodox_ez-erez_experimental ergodox_ez-familiar ergodox_ez-french_hacker ergodox_ez-galson ergodox_ez-german ergodox_ez-german-kinergo ergodox_ez-german-lukas ergodox_ez-german-manuneo ergodox_ez-guni ergodox_ez-ishigoya-jp ergodox_ez-italian ergodox_ez-j3rn ergodox_ez-jack ergodox_ez-jacobono ergodox_ez-jafo ergodox_ez-jgarr ergodox_ez-josh ergodox_ez-kastyle ergodox_ez-kines-ish ergodox_ez-kristian ergodox_ez-maz ergodox_ez-mclennon_osx ergodox_ez-mpiechotka ergodox_ez-msc ergodox_ez-naps62 ergodox_ez-neo2_on_qwertz_hardware ergodox_ez-norwegian_programmer_osx_pc ergodox_ez-norwegian_programmer_osx_pc_colemak ergodox_ez-ordinary ergodox_ez-osx_de ergodox_ez-osx_de_adnw_koy ergodox_ez-osx_de_experimental ergodox_ez-osx_fr ergodox_ez-osx_kinesis_pnut ergodox_ez-osx_whiskey_tango_foxtrot_capslock ergodox_ez-phoenix ergodox_ez-plover ergodox_ez-plums ergodox_ez-prLine truncated
|
|
||||||
@@ -35,7 +35,7 @@ def _check_modules(requirements):
|
|||||||
|
|
||||||
if not find_spec(module['import']):
|
if not find_spec(module['import']):
|
||||||
print('Could not find module %s!' % module['name'])
|
print('Could not find module %s!' % module['name'])
|
||||||
print('Please run `python3 -m pip install -r %s` to install required python dependencies.' % str(qmk_dir / requirements))
|
print('Please run `python3 -m pip install -r %s` to install required python dependencies.' % (qmk_dir / requirements,))
|
||||||
if developer:
|
if developer:
|
||||||
print('You can also turn off developer mode: qmk config user.developer=None')
|
print('You can also turn off developer mode: qmk config user.developer=None')
|
||||||
print()
|
print()
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
|||||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Load the keymap-level rules.mk if exists
|
||||||
|
ifneq ("$(wildcard $(KEYMAP_PATH))", "")
|
||||||
|
-include $(KEYMAP_PATH)/rules.mk
|
||||||
|
endif
|
||||||
|
|
||||||
# Generate the keymap.c
|
# Generate the keymap.c
|
||||||
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
||||||
bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
bin/qmk json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
||||||
+6
-1
@@ -70,7 +70,7 @@ ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
|
|||||||
SRC += $(QUANTUM_DIR)/pointing_device.c
|
SRC += $(QUANTUM_DIR)/pointing_device.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c
|
VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi
|
||||||
EEPROM_DRIVER ?= vendor
|
EEPROM_DRIVER ?= vendor
|
||||||
ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),)
|
ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),)
|
||||||
$(error EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver)
|
$(error EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver)
|
||||||
@@ -85,6 +85,11 @@ else
|
|||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
SRC += eeprom_driver.c eeprom_i2c.c
|
SRC += eeprom_driver.c eeprom_i2c.c
|
||||||
|
else ifeq ($(strip $(EEPROM_DRIVER)), spi)
|
||||||
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI
|
||||||
|
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
||||||
|
QUANTUM_LIB_SRC += spi_master.c
|
||||||
|
SRC += eeprom_driver.c eeprom_spi.c
|
||||||
else ifeq ($(strip $(EEPROM_DRIVER)), transient)
|
else ifeq ($(strip $(EEPROM_DRIVER)), transient)
|
||||||
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
|
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
COMMON_VPATH += $(DRIVER_PATH)/eeprom
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
* [Testing and Debugging](newbs_testing_debugging.md)
|
* [Testing and Debugging](newbs_testing_debugging.md)
|
||||||
* [Getting Help/Support](support.md)
|
* [Getting Help/Support](support.md)
|
||||||
* [Other Resources](newbs_learn_more_resources.md)
|
* [Other Resources](newbs_learn_more_resources.md)
|
||||||
|
* [Syllabus](syllabus.md)
|
||||||
|
|
||||||
* FAQs
|
* FAQs
|
||||||
* [General FAQ](faq_general.md)
|
* [General FAQ](faq_general.md)
|
||||||
@@ -74,6 +75,7 @@
|
|||||||
* [Layers](feature_layers.md)
|
* [Layers](feature_layers.md)
|
||||||
* [One Shot Keys](one_shot_keys.md)
|
* [One Shot Keys](one_shot_keys.md)
|
||||||
* [Pointing Device](feature_pointing_device.md)
|
* [Pointing Device](feature_pointing_device.md)
|
||||||
|
* [Raw HID](feature_rawhid.md)
|
||||||
* [Swap Hands](feature_swap_hands.md)
|
* [Swap Hands](feature_swap_hands.md)
|
||||||
* [Tap Dance](feature_tap_dance.md)
|
* [Tap Dance](feature_tap_dance.md)
|
||||||
* [Tap-Hold Configuration](tap_hold.md)
|
* [Tap-Hold Configuration](tap_hold.md)
|
||||||
@@ -136,6 +138,10 @@
|
|||||||
* [Development Environment](api_development_environment.md)
|
* [Development Environment](api_development_environment.md)
|
||||||
* [Architecture Overview](api_development_overview.md)
|
* [Architecture Overview](api_development_overview.md)
|
||||||
|
|
||||||
|
* Hardware Platform Development
|
||||||
|
* Arm/ChibiOS
|
||||||
|
* [Early initialization](platformdev_chibios_earlyinit.md)
|
||||||
|
|
||||||
* QMK Reference
|
* QMK Reference
|
||||||
* [Contributing to QMK](contributing.md)
|
* [Contributing to QMK](contributing.md)
|
||||||
* [Translating the QMK Docs](translating.md)
|
* [Translating the QMK Docs](translating.md)
|
||||||
|
|||||||
+2
-2
@@ -6,7 +6,7 @@ The QMK CLI makes building and working with QMK keyboards easier. We have provid
|
|||||||
|
|
||||||
### Requirements :id=requirements
|
### Requirements :id=requirements
|
||||||
|
|
||||||
The CLI requires Python 3.5 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI.
|
QMK requires Python 3.6 or greater. We try to keep the number of requirements small but you will also need to install the packages listed in [`requirements.txt`](https://github.com/qmk/qmk_firmware/blob/master/requirements.txt). These are installed automatically when you install the QMK CLI.
|
||||||
|
|
||||||
### Install Using Homebrew (macOS, some Linux) :id=install-using-homebrew
|
### Install Using Homebrew (macOS, some Linux) :id=install-using-homebrew
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build
|
|||||||
|
|
||||||
### Install Using easy_install or pip :id=install-using-easy_install-or-pip
|
### Install Using easy_install or pip :id=install-using-easy_install-or-pip
|
||||||
|
|
||||||
If your system is not listed above you can install QMK manually. First ensure that you have python 3.5 (or later) installed and have installed pip. Then install QMK with this command:
|
If your system is not listed above you can install QMK manually. First ensure that you have python 3.6 (or later) installed and have installed pip. Then install QMK with this command:
|
||||||
|
|
||||||
```
|
```
|
||||||
pip3 install qmk
|
pip3 install qmk
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def hello(cli):
|
|||||||
|
|
||||||
First we import the `cli` object from `milc`. This is how we interact with the user and control the script's behavior. We use `@cli.argument()` to define a command line flag, `--name`. This also creates a configuration variable named `hello.name` (and the corresponding `user.name`) which the user can set so they don't have to specify the argument. The `cli.subcommand()` decorator designates this function as a subcommand. The name of the subcommand will be taken from the name of the function.
|
First we import the `cli` object from `milc`. This is how we interact with the user and control the script's behavior. We use `@cli.argument()` to define a command line flag, `--name`. This also creates a configuration variable named `hello.name` (and the corresponding `user.name`) which the user can set so they don't have to specify the argument. The `cli.subcommand()` decorator designates this function as a subcommand. The name of the subcommand will be taken from the name of the function.
|
||||||
|
|
||||||
Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.5/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator.
|
Once inside our function we find a typical "Hello, World!" program. We use `cli.log` to access the underlying [Logger Object](https://docs.python.org/3.6/library/logging.html#logger-objects), whose behavior is user controllable. We also access the value for name supplied by the user as `cli.config.hello.name`. The value for `cli.config.hello.name` will be determined by looking at the `--name` argument supplied by the user, if not provided it will use the value in the `qmk.ini` config file, and if neither of those is provided it will fall back to the default supplied in the `cli.argument()` decorator.
|
||||||
|
|
||||||
# User Interaction
|
# User Interaction
|
||||||
|
|
||||||
@@ -56,13 +56,13 @@ There are two main methods for outputting text in a subcommand- `cli.log` and `c
|
|||||||
|
|
||||||
You can use special tokens to colorize your text, to make it easier to understand the output of your program. See [Colorizing Text](#colorizing-text) below.
|
You can use special tokens to colorize your text, to make it easier to understand the output of your program. See [Colorizing Text](#colorizing-text) below.
|
||||||
|
|
||||||
Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.5/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example.
|
Both of these methods support built-in string formatting using python's [printf style string format operations](https://docs.python.org/3.6/library/stdtypes.html#old-string-formatting). You can use tokens such as `%s` and `%d` within your text strings then pass the values as arguments. See our Hello, World program above for an example.
|
||||||
|
|
||||||
You should never use the format operator (`%`) directly, always pass values as arguments.
|
You should never use the format operator (`%`) directly, always pass values as arguments.
|
||||||
|
|
||||||
### Logging (`cli.log`)
|
### Logging (`cli.log`)
|
||||||
|
|
||||||
The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.5/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong.
|
The `cli.log` object gives you access to a [Logger Object](https://docs.python.org/3.6/library/logging.html#logger-objects). We have configured our log output to show the user a nice emoji for each log level (or the log level name if their terminal does not support unicode.) This way the user can tell at a glance which messages are most important when something goes wrong.
|
||||||
|
|
||||||
The default log level is `INFO`. If the user runs `qmk -v <subcommand>` the default log level will be set to `DEBUG`.
|
The default log level is `INFO`. If the user runs `qmk -v <subcommand>` the default log level will be set to `DEBUG`.
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
Most of our style follows PEP8 with some local modifications to make things less nit-picky.
|
Most of our style follows PEP8 with some local modifications to make things less nit-picky.
|
||||||
|
|
||||||
* We target Python 3.5 for compatability with all supported platforms.
|
* We target Python 3.6 for compatability with all supported platforms.
|
||||||
* We indent using four (4) spaces (soft tabs)
|
* We indent using four (4) spaces (soft tabs)
|
||||||
* We encourage liberal use of comments
|
* We encourage liberal use of comments
|
||||||
* Think of them as a story describing the feature
|
* Think of them as a story describing the feature
|
||||||
@@ -317,7 +317,7 @@ At the time of this writing our tests are not very comprehensive. Looking at the
|
|||||||
|
|
||||||
## Integration Tests
|
## Integration Tests
|
||||||
|
|
||||||
Integration tests can be found in `lib/python/qmk/tests/test_cli_commands.py`. This is where CLI commands are actually run and their overall behavior is verified. We use [`subprocess`](https://docs.python.org/3.5/library/subprocess.html#module-subprocess) to launch each CLI command and a combination of checking output and returncode to determine if the right thing happened.
|
Integration tests can be found in `lib/python/qmk/tests/test_cli_commands.py`. This is where CLI commands are actually run and their overall behavior is verified. We use [`subprocess`](https://docs.python.org/3.6/library/subprocess.html#module-subprocess) to launch each CLI command and a combination of checking output and returncode to determine if the right thing happened.
|
||||||
|
|
||||||
## Unit Tests
|
## Unit Tests
|
||||||
|
|
||||||
|
|||||||
@@ -191,7 +191,12 @@ If you define these options you will enable the associated feature, which may in
|
|||||||
* `#define RGBLIGHT_ANIMATIONS`
|
* `#define RGBLIGHT_ANIMATIONS`
|
||||||
* run RGB animations
|
* run RGB animations
|
||||||
* `#define RGBLIGHT_LAYERS`
|
* `#define RGBLIGHT_LAYERS`
|
||||||
* Lets you define [lighting layers](feature_rgblight.md) that can be toggled on or off. Great for showing the current keyboard layer or caps lock state.
|
* Lets you define [lighting layers](feature_rgblight.md?id=lighting-layers) that can be toggled on or off. Great for showing the current keyboard layer or caps lock state.
|
||||||
|
* `#define RGBLIGHT_MAX_LAYERS`
|
||||||
|
* Defaults to 8. Can be expanded up to 32 if more [lighting layers](feature_rgblight.md?id=lighting-layers) are needed.
|
||||||
|
* Note: Increasing the maximum will increase the firmware size and slow sync on split keyboards.
|
||||||
|
* `#define RGBLIGHT_LAYER_BLINK`
|
||||||
|
* Adds ability to [blink](feature_rgblight.md?id=lighting-layer-blink) a lighting layer for a specified number of milliseconds (e.g. to acknowledge an action).
|
||||||
* `#define RGBLED_NUM 12`
|
* `#define RGBLED_NUM 12`
|
||||||
* number of LEDs
|
* number of LEDs
|
||||||
* `#define RGBLIGHT_SPLIT`
|
* `#define RGBLIGHT_SPLIT`
|
||||||
|
|||||||
+24
-5
@@ -1,4 +1,4 @@
|
|||||||
# EEPROM Driver Configuration
|
# EEPROM Driver Configuration :id=eeprom-driver-configuration
|
||||||
|
|
||||||
The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.
|
The EEPROM driver can be swapped out depending on the needs of the keyboard, or whether extra hardware is present.
|
||||||
|
|
||||||
@@ -6,15 +6,20 @@ Driver | Description
|
|||||||
-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below.
|
`EEPROM_DRIVER = vendor` (default) | Uses the on-chip driver provided by the chip manufacturer. For AVR, this is provided by avr-libc. This is supported on ARM for a subset of chips -- STM32F3xx, STM32F1xx, and STM32F072xB will be emulated by writing to flash. STM32L0xx and STM32L1xx will use the onboard dedicated true EEPROM. Other chips will generally act as "transient" below.
|
||||||
`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below.
|
`EEPROM_DRIVER = i2c` | Supports writing to I2C-based 24xx EEPROM chips. See the driver section below.
|
||||||
|
`EEPROM_DRIVER = spi` | Supports writing to SPI-based 25xx EEPROM chips. See the driver section below.
|
||||||
`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost.
|
`EEPROM_DRIVER = transient` | Fake EEPROM driver -- supports reading/writing to RAM, and will be discarded when power is lost.
|
||||||
|
|
||||||
## Vendor Driver Configuration
|
## Vendor Driver Configuration :id=vendor-eeprom-driver-configuration
|
||||||
|
|
||||||
|
#### STM32 L0/L1 Configuration :id=stm32l0l1-eeprom-driver-configuration
|
||||||
|
|
||||||
!> Resetting EEPROM using an STM32L0/L1 device takes up to 1 second for every 1kB of internal EEPROM used.
|
!> Resetting EEPROM using an STM32L0/L1 device takes up to 1 second for every 1kB of internal EEPROM used.
|
||||||
|
|
||||||
No configurable options are available.
|
`config.h` override | Description | Default Value
|
||||||
|
------------------------------------|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------
|
||||||
|
`#define STM32_ONBOARD_EEPROM_SIZE` | The size of the EEPROM to use, in bytes. Erase times can be high, so it's configurable here, if not using the default value. | Minimum required to cover base _eeconfig_ data, or `1024` if VIA is enabled.
|
||||||
|
|
||||||
## I2C Driver Configuration
|
## I2C Driver Configuration :id=i2c-eeprom-driver-configuration
|
||||||
|
|
||||||
Currently QMK supports 24xx-series chips over I2C. As such, requires a working i2c_master driver configuration. You can override the driver configuration via your config.h:
|
Currently QMK supports 24xx-series chips over I2C. As such, requires a working i2c_master driver configuration. You can override the driver configuration via your config.h:
|
||||||
|
|
||||||
@@ -41,7 +46,21 @@ MB85RC256V FRAM | `#define EEPROM_I2C_MB85RC256V` | <https://www.adafruit.com/p
|
|||||||
|
|
||||||
?> If you find that the EEPROM is not cooperating, ensure you've correctly shifted up your EEPROM address by 1. For example, the datasheet might state the address as `0b01010000` -- the correct value of `EXTERNAL_EEPROM_I2C_BASE_ADDRESS` needs to be `0b10100000`.
|
?> If you find that the EEPROM is not cooperating, ensure you've correctly shifted up your EEPROM address by 1. For example, the datasheet might state the address as `0b01010000` -- the correct value of `EXTERNAL_EEPROM_I2C_BASE_ADDRESS` needs to be `0b10100000`.
|
||||||
|
|
||||||
## Transient Driver configuration
|
## SPI Driver Configuration :id=spi-eeprom-driver-configuration
|
||||||
|
|
||||||
|
Currently QMK supports 25xx-series chips over SPI. As such, requires a working spi_master driver configuration. You can override the driver configuration via your config.h:
|
||||||
|
|
||||||
|
`config.h` override | Description | Default Value
|
||||||
|
-----------------------------------------------|--------------------------------------------------------------------------------------|--------------
|
||||||
|
`#define EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN` | SPI Slave select pin in order to inform that the EEPROM is currently being addressed | _none_
|
||||||
|
`#define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR` | Clock divisor used to divide the peripheral clock to derive the SPI frequency | `64`
|
||||||
|
`#define EXTERNAL_EEPROM_BYTE_COUNT` | Total size of the EEPROM in bytes | 8192
|
||||||
|
`#define EXTERNAL_EEPROM_PAGE_SIZE` | Page size of the EEPROM in bytes, as specified in the datasheet | 32
|
||||||
|
`#define EXTERNAL_EEPROM_ADDRESS_SIZE` | The number of bytes to transmit for the memory location within the EEPROM | 2
|
||||||
|
|
||||||
|
!> There's no way to determine if there is an SPI EEPROM actually responding. Generally, this will result in reads of nothing but zero.
|
||||||
|
|
||||||
|
## Transient Driver configuration :id=transient-eeprom-driver-configuration
|
||||||
|
|
||||||
The only configurable item for the transient EEPROM driver is its size:
|
The only configurable item for the transient EEPROM driver is its size:
|
||||||
|
|
||||||
|
|||||||
@@ -160,10 +160,3 @@ As of now root of its cause is not clear but some build options seem to be relat
|
|||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/266
|
https://github.com/tmk/tmk_keyboard/issues/266
|
||||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## FLIP Doesn't Work
|
|
||||||
### `AtLibUsbDfu.dll` Not Found
|
|
||||||
Remove current driver and reinstall one FLIP provides from DeviceManager.
|
|
||||||
http://imgur.com/a/bnwzy
|
|
||||||
@@ -6,11 +6,11 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown
|
|||||||
|----------|-------------------------------|----------------------------------------------------|
|
|----------|-------------------------------|----------------------------------------------------|
|
||||||
|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|
|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|
||||||
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
||||||
|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` |
|
|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` |
|
||||||
|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
||||||
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
||||||
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
||||||
|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` |
|
|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` |
|
||||||
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|
||||||
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|
||||||
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
||||||
@@ -18,7 +18,7 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown
|
|||||||
|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|
|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|
||||||
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
|
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
|
||||||
|
|
||||||
You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress.
|
You can also chain them, for example `LCTL(LALT(KC_DEL))` or `C(A(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress.
|
||||||
|
|
||||||
# Legacy Content :id=legacy-content
|
# Legacy Content :id=legacy-content
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
|
|||||||
} else {
|
} else {
|
||||||
tap_code(KC_PGUP);
|
tap_code(KC_PGUP);
|
||||||
}
|
}
|
||||||
} else if (index == 1) { /* Second encoder */
|
} else if (index == 1) { /* Second encoder */
|
||||||
if (clockwise) {
|
if (clockwise) {
|
||||||
tap_code(KC_DOWN);
|
tap_code(KC_DOWN);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# HD44780 LCD Displays
|
# HD44780 LCD Displays
|
||||||
|
|
||||||
This is an integration of Peter Fleury's LCD library. This page will explain the basics. [For in depth documentation visit his page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
This is an integration of Peter Fleury's LCD library. This page will explain the basics. [For in depth documentation visit his page.](http://www.peterfleury.epizy.com/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
||||||
|
|
||||||
You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes.
|
You can enable support for HD44780 Displays by setting the `HD44780_ENABLE` flag in your keyboards `rules.mk` to yes.
|
||||||
|
|
||||||
@@ -50,8 +50,8 @@ LCD_DISP_ON_CURSOR_BLINK : display on, cursor on flashing
|
|||||||
````
|
````
|
||||||
This is best done in your keyboards `matrix_init_kb` or your keymaps `matrix_init_user`.
|
This is best done in your keyboards `matrix_init_kb` or your keymaps `matrix_init_user`.
|
||||||
It is advised to clear the display before use.
|
It is advised to clear the display before use.
|
||||||
To do so call `lcd_clrsrc()`.
|
To do so call `lcd_clrscr()`.
|
||||||
|
|
||||||
To now print something to your Display you first call `lcd_gotoxy(column, line)`. To go to the start of the first line you would call `lcd_gotoxy(0, 0)` and then print a string with `lcd_puts("example string")`.
|
To now print something to your Display you first call `lcd_gotoxy(column, line)`. To go to the start of the first line you would call `lcd_gotoxy(0, 0)` and then print a string with `lcd_puts("example string")`.
|
||||||
|
|
||||||
There are more methods available to control the display. [For in depth documentation please visit the linked page.](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
There are more methods available to control the display. [For in depth documentation please visit the linked page.](http://www.peterfleury.epizy.com/doxygen/avr-gcc-libraries/group__pfleury__lcd.html)
|
||||||
@@ -161,11 +161,11 @@ There's also a couple of mod shortcuts you can use:
|
|||||||
|
|
||||||
* `SS_LCTL(string)`
|
* `SS_LCTL(string)`
|
||||||
* `SS_LSFT(string)`
|
* `SS_LSFT(string)`
|
||||||
* `SS_LALT(string)`
|
* `SS_LALT(string)` or `SS_LOPT(string)`
|
||||||
* `SS_LGUI(string)`, `SS_LCMD(string)` or `SS_LWIN(string)`
|
* `SS_LGUI(string)`, `SS_LCMD(string)` or `SS_LWIN(string)`
|
||||||
* `SS_RCTL(string)`
|
* `SS_RCTL(string)`
|
||||||
* `SS_RSFT(string)`
|
* `SS_RSFT(string)`
|
||||||
* `SS_RALT(string)` or `SS_ALGR(string)`
|
* `SS_RALT(string)`, `SS_ROPT(string)` or `SS_ALGR(string)`
|
||||||
* `SS_RGUI(string)`, `SS_RCMD(string)` or `SS_RWIN(string)`
|
* `SS_RGUI(string)`, `SS_RCMD(string)` or `SS_RWIN(string)`
|
||||||
|
|
||||||
These press the respective modifier, send the supplied string and then release the modifier.
|
These press the respective modifier, send the supplied string and then release the modifier.
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Raw HID
|
||||||
|
|
||||||
|
Raw HID allows for bidirectional communication between QMK and the host computer over an HID interface. This has many potential use cases, such as switching keymaps on the fly or changing RGB LED colors and modes.
|
||||||
|
|
||||||
|
There are two main components to getting raw HID working with your keyboard.
|
||||||
|
|
||||||
|
## Keyboard firmware
|
||||||
|
|
||||||
|
The implementation is fairly straightforward for the firmware.
|
||||||
|
In your `rules.mk` add:
|
||||||
|
|
||||||
|
```make
|
||||||
|
RAW_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
In your `keymap.c` include `"raw_hid.h"` and implement the following:
|
||||||
|
|
||||||
|
```C
|
||||||
|
void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||||
|
// Your code goes here. data is the packet received from host.
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The `"raw_hid.h"` header also declares `void raw_hid_send(uint8_t *data, uint8_t length);` which allows sending packets from keyboard to host. As an example, it can also be used for debugging when building your host application by returning all data back to the host.
|
||||||
|
|
||||||
|
```C
|
||||||
|
void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||||
|
raw_hid_send(data, 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`.
|
||||||
|
|
||||||
|
Make sure to flash raw enabled firmware before proceeding with working on the host side.
|
||||||
|
|
||||||
|
## Host (Windows/macOS/Linux)
|
||||||
|
|
||||||
|
This is the more complicated part as it will require some digging.
|
||||||
|
|
||||||
|
To connect your host computer to your keyboard with raw HID you need four pieces of information about your keyboard:
|
||||||
|
|
||||||
|
1. Vendor ID
|
||||||
|
2. Product ID
|
||||||
|
3. Usage Page
|
||||||
|
4. Usage
|
||||||
|
|
||||||
|
The first two can easily be found in your keyboard's `config.h` in the keyboard's main directory under `VENDOR_ID` and `PRODUCT_ID`. **Usage Page** is **`0xFF60`** and **Usage** is **`0x0061`**.
|
||||||
|
|
||||||
|
### Building your host
|
||||||
|
|
||||||
|
You can build your host using any language that has an available HID implementation library if you don't wish to make your own. The ones we know of for popular languages are:
|
||||||
|
|
||||||
|
* Node: [node-hid](https://github.com/node-hid/node-hid).
|
||||||
|
* C: [hidapi](https://github.com/libusb/hidapi).
|
||||||
|
* Java: [purejavahidapi](https://github.com/nyholku/purejavahidapi) and [hid4java](https://github.com/gary-rowe/hid4java).
|
||||||
|
* Python: [pyhidapi](https://pypi.org/project/hid/).
|
||||||
|
|
||||||
|
This is not an exhaustive cross-platform list but should get you started. There are no special requirements for using raw HID so any HID library should work.
|
||||||
|
|
||||||
|
Now that you have all four pieces of information required to open HID interface to your keyboard. All you need to do is use your library's available functions to open the device with its ID parameters.
|
||||||
|
|
||||||
|
Note that Vendor ID and Product ID are not actually required to open the device. They are used only to filter to a specific device out of the many HID devices you have plugged in. Many libraries will give you the option to open the device using Product Name or Manufacturer Name instead, `node-hid` being a prime example. This will create issues for devices with builtin USB Hub or any extra HID interfaces where you will have multiple interfaces with the same name or from the same manufacturer. The Vendor ID together with Product ID create a unique designation to a single interface and will not exhibit this problem. Therefore, even if your library doesn't require you to, it is best to use them to avoid issues.
|
||||||
|
Unlike Vendor ID and Product ID though, Usage Page and Usage are necessary for successful communication.
|
||||||
|
|
||||||
|
It should go without saying that regardless of the library you're using, you should always make sure to close the interface when finished. Depending on the operating system and your particular environment there may be issues connecting to it again afterwards with another client or another instance of the same client if it's not explicitly closed.
|
||||||
@@ -437,12 +437,16 @@ Where `28` is an unused index from `eeconfig.h`.
|
|||||||
|`rgb_matrix_sethsv_noeeprom(h, s, v)` |Set LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) |
|
|`rgb_matrix_sethsv_noeeprom(h, s, v)` |Set LEDs to the given HSV value where `h`/`s`/`v` are between 0 and 255 (not written to EEPROM) |
|
||||||
|
|
||||||
### Query Current Status :id=query-current-status
|
### Query Current Status :id=query-current-status
|
||||||
|Function |Description |
|
|Function |Description |
|
||||||
|-----------------------|-----------------|
|
|---------------------------------|---------------------------|
|
||||||
|`rgb_matrix_get_mode()` |Get current mode |
|
|`rgb_matrix_is_enabled()` |Gets current on/off status |
|
||||||
|`rgb_matrix_get_hue()` |Get current hue |
|
|`rgb_matrix_get_mode()` |Gets current mode |
|
||||||
|`rgb_matrix_get_sat()` |Get current sat |
|
|`rgb_matrix_get_hue()` |Gets current hue |
|
||||||
|`rgb_matrix_get_val()` |Get current val |
|
|`rgb_matrix_get_sat()` |Gets current sat |
|
||||||
|
|`rgb_matrix_get_val()` |Gets current val |
|
||||||
|
|`rgb_matrix_get_hsv()` |Gets hue, sat, and val and returns a [`HSV` structure](https://github.com/qmk/qmk_firmware/blob/7ba6456c0b2e041bb9f97dbed265c5b8b4b12192/quantum/color.h#L56-L61)|
|
||||||
|
|`rgb_matrix_get_speed()` |Gets current speed |
|
||||||
|
|`rgb_matrix_get_suspend_state()` |Gets current suspend state |
|
||||||
|
|
||||||
## Callbacks :id=callbacks
|
## Callbacks :id=callbacks
|
||||||
|
|
||||||
|
|||||||
+60
-10
@@ -94,6 +94,7 @@ if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a n
|
|||||||
|`RGBLIGHT_MODE_STATIC_GRADIENT`| 0,1,..,9 |Static gradient |
|
|`RGBLIGHT_MODE_STATIC_GRADIENT`| 0,1,..,9 |Static gradient |
|
||||||
|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test |
|
|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test |
|
||||||
|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating |
|
|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating |
|
||||||
|
|`RGBLIGHT_MODE_TWINKLE` | 0,1,2,3,4,5 |Twinkle |
|
||||||
|
|
||||||
Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration.
|
Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration.
|
||||||
|
|
||||||
@@ -103,8 +104,8 @@ Note: For versions older than 0.6.117, The mode numbers were written directly. I
|
|||||||
|
|
||||||
Use these defines to add or remove animations from the firmware. When you are running low on flash space, it can be helpful to disable animations you are not using.
|
Use these defines to add or remove animations from the firmware. When you are running low on flash space, it can be helpful to disable animations you are not using.
|
||||||
|
|
||||||
|Define |Default |Description |
|
|Define |Default |Description |
|
||||||
|------------------------------------|-------------|-------------------------------------------------------------------------------------|
|
|------------------------------------|-------------|-------------------------------------------------------------------------|
|
||||||
|`RGBLIGHT_ANIMATIONS` |*Not defined*|Enable all additional animation modes. |
|
|`RGBLIGHT_ANIMATIONS` |*Not defined*|Enable all additional animation modes. |
|
||||||
|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|Enable alternating animation mode. |
|
|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|Enable alternating animation mode. |
|
||||||
|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|Enable breathing animation mode. |
|
|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|Enable breathing animation mode. |
|
||||||
@@ -115,6 +116,7 @@ Use these defines to add or remove animations from the firmware. When you are ru
|
|||||||
|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|Enable RGB test animation mode. |
|
|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|Enable RGB test animation mode. |
|
||||||
|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|Enable snake animation mode. |
|
|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|Enable snake animation mode. |
|
||||||
|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|Enable static gradient mode. |
|
|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|Enable static gradient mode. |
|
||||||
|
|`RGBLIGHT_EFFECT_TWINKLE` |*Not defined*|Enable twinkle animation mode. |
|
||||||
|
|
||||||
### Effect and Animation Settings
|
### Effect and Animation Settings
|
||||||
|
|
||||||
@@ -131,6 +133,8 @@ The following options are used to tweak the various animations:
|
|||||||
|`RGBLIGHT_EFFECT_KNIGHT_OFFSET` |`0` |The number of LEDs to start the "Knight" animation from the start of the strip by |
|
|`RGBLIGHT_EFFECT_KNIGHT_OFFSET` |`0` |The number of LEDs to start the "Knight" animation from the start of the strip by |
|
||||||
|`RGBLIGHT_RAINBOW_SWIRL_RANGE` |`255` |Range adjustment for the rainbow swirl effect to get different swirls |
|
|`RGBLIGHT_RAINBOW_SWIRL_RANGE` |`255` |Range adjustment for the rainbow swirl effect to get different swirls |
|
||||||
|`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation |
|
|`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation |
|
||||||
|
|`RGBLIGHT_EFFECT_TWINKLE_LIFE` |`75` |Adjusts how quickly each LED brightens and dims when twinkling (in animation steps) |
|
||||||
|
|`RGBLIGHT_EFFECT_TWINKLE_PROBABILITY`|`1/127` |Adjusts how likely each LED is to twinkle (on each animation step) |
|
||||||
|
|
||||||
### Example Usage to Reduce Memory Footprint
|
### Example Usage to Reduce Memory Footprint
|
||||||
1. Remove `RGBLIGHT_ANIMATIONS` from `config.h`.
|
1. Remove `RGBLIGHT_ANIMATIONS` from `config.h`.
|
||||||
@@ -168,6 +172,9 @@ const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20};
|
|||||||
// How long (in milliseconds) to wait between animation steps for each of the "Knight" animations
|
// How long (in milliseconds) to wait between animation steps for each of the "Knight" animations
|
||||||
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
|
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31};
|
||||||
|
|
||||||
|
// How long (in milliseconds) to wait between animation steps for each of the "Twinkle" animations
|
||||||
|
const uint8_t RGBLED_TWINKLE_INTERVALS[] PROGMEM = {50, 25, 10};
|
||||||
|
|
||||||
// These control which hues are selected for each of the "Static gradient" modes
|
// These control which hues are selected for each of the "Static gradient" modes
|
||||||
const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64};
|
const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64};
|
||||||
```
|
```
|
||||||
@@ -177,6 +184,10 @@ const uint8_t RGBLED_GRADIENT_RANGES[] PROGMEM = {255, 170, 127, 85, 64};
|
|||||||
By including `#define RGBLIGHT_LAYERS` in your `config.h` file you can enable lighting layers. These make
|
By including `#define RGBLIGHT_LAYERS` in your `config.h` file you can enable lighting layers. These make
|
||||||
it easy to use your underglow LEDs as status indicators to show which keyboard layer is currently active, or the state of caps lock, all without disrupting any animations. [Here's a video](https://youtu.be/uLGE1epbmdY) showing an example of what you can do.
|
it easy to use your underglow LEDs as status indicators to show which keyboard layer is currently active, or the state of caps lock, all without disrupting any animations. [Here's a video](https://youtu.be/uLGE1epbmdY) showing an example of what you can do.
|
||||||
|
|
||||||
|
### Defining Lighting Layers :id=defining-lighting-layers
|
||||||
|
|
||||||
|
By default, 8 layers are possible. This can be expanded to as many as 32 by overriding the definition of `RGBLIGHT_MAX_LAYERS` in `config.h` (e.g. `#define RGBLIGHT_MAX_LAYERS 32`). Please note, if you use a split keyboard, you will need to flash both sides of the split after changing this. Also, increasing the maximum will increase the firmware size, and will slow sync on split keyboards.
|
||||||
|
|
||||||
To define a layer, we modify `keymap.c` to list out LED ranges and the colors we want to overlay on them using an array of `rgblight_segment_t` using the `RGBLIGHT_LAYER_SEGMENTS` macro. We can define multiple layers and enable/disable them independently:
|
To define a layer, we modify `keymap.c` to list out LED ranges and the colors we want to overlay on them using an array of `rgblight_segment_t` using the `RGBLIGHT_LAYER_SEGMENTS` macro. We can define multiple layers and enable/disable them independently:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
@@ -211,8 +222,12 @@ void keyboard_post_init_user(void) {
|
|||||||
rgblight_layers = my_rgb_layers;
|
rgblight_layers = my_rgb_layers;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
Note: For split keyboards with two controllers, both sides need to be flashed when updating the contents of rgblight_layers.
|
||||||
|
|
||||||
Finally, we enable and disable the lighting layers whenever the state of the keyboard changes:
|
### Enabling and disabling lighting layers :id=enabling-lighting-layers
|
||||||
|
|
||||||
|
Everything above just configured the definition of each lighting layer.
|
||||||
|
We can now enable and disable the lighting layers whenever the state of the keyboard changes:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
@@ -228,7 +243,40 @@ bool led_update_user(led_t led_state) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: For split keyboards with two controllers, both sides need to be flashed when updating the contents of rgblight_layers.
|
### Lighting layer blink :id=lighting-layer-blink
|
||||||
|
|
||||||
|
By including `#define RGBLIGHT_LAYER_BLINK` in your `config.h` file you can turn a lighting
|
||||||
|
layer on for a specified duration. Once the specified number of milliseconds has elapsed
|
||||||
|
the layer will be turned off. This is useful, e.g., if you want to acknowledge some
|
||||||
|
action (e.g. toggling some setting):
|
||||||
|
|
||||||
|
```c
|
||||||
|
const rgblight_segment_t PROGMEM _yes_layer[] = RGBLIGHT_LAYER_SEGMENTS( {9, 6, HSV_GREEN} );
|
||||||
|
const rgblight_segment_t PROGMEM _no_layer[] = RGBLIGHT_LAYER_SEGMENTS( {9, 6, HSV_RED} );
|
||||||
|
|
||||||
|
const rgblight_segment_t* const PROGMEM _rgb_layers[] =
|
||||||
|
RGBLIGHT_LAYERS_LIST( _yes_layer, _no_layer );
|
||||||
|
|
||||||
|
void keyboard_post_init_user(void) {
|
||||||
|
rgblight_layers = _rgb_layers;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Note we user post_process_record_user because we want the state
|
||||||
|
// after the flag has been flipped...
|
||||||
|
void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case DEBUG:
|
||||||
|
rgblight_blink_layer(debug_enable ? 0 : 1, 500);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NK_TOGG:
|
||||||
|
case NK_ON:
|
||||||
|
case NK_OFF:
|
||||||
|
rgblight_blink_layer(keymap_config.nkro ? 0 : 1, 500);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
@@ -328,12 +376,14 @@ rgblight_sethsv(HSV_GREEN, 2); // led 2
|
|||||||
|`rgblight_set_layer_state(i, is_on)` |Enable or disable lighting layer `i` based on value of `bool is_on` |
|
|`rgblight_set_layer_state(i, is_on)` |Enable or disable lighting layer `i` based on value of `bool is_on` |
|
||||||
|
|
||||||
#### query
|
#### query
|
||||||
|Function |Description |
|
|Function |Description |
|
||||||
|-----------------------|-----------------|
|
|-----------------------|---------------------------|
|
||||||
|`rgblight_get_mode()` |Get current mode |
|
|`rgblight_is_enabled()`|Gets current on/off status |
|
||||||
|`rgblight_get_hue()` |Get current hue |
|
|`rgblight_get_mode()` |Gets current mode |
|
||||||
|`rgblight_get_sat()` |Get current sat |
|
|`rgblight_get_hue()` |Gets current hue |
|
||||||
|`rgblight_get_val()` |Get current val |
|
|`rgblight_get_sat()` |Gets current sat |
|
||||||
|
|`rgblight_get_val()` |Gets current val |
|
||||||
|
|`rgblight_get_speed()` |Gets current speed |
|
||||||
|
|
||||||
## Colors
|
## Colors
|
||||||
|
|
||||||
|
|||||||
@@ -28,3 +28,4 @@ Note that the array indices are reversed same as the matrix and the values are o
|
|||||||
|`SH_MOFF` |Momentarily turns off swap. |
|
|`SH_MOFF` |Momentarily turns off swap. |
|
||||||
|`SH_TG` |Toggles swap on and off with every key press. |
|
|`SH_TG` |Toggles swap on and off with every key press. |
|
||||||
|`SH_TT` |Toggles with a tap; momentary when held. |
|
|`SH_TT` |Toggles with a tap; momentary when held. |
|
||||||
|
|`SH_OS` |One shot swap hands: toggles while pressed or until next key press. |
|
||||||
@@ -26,7 +26,6 @@ Compatible flashers:
|
|||||||
|
|
||||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI)
|
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI)
|
||||||
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` in QMK (recommended command line)
|
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` in QMK (recommended command line)
|
||||||
* [Atmel's Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (not recommended)
|
|
||||||
|
|
||||||
Flashing sequence:
|
Flashing sequence:
|
||||||
|
|
||||||
|
|||||||
@@ -155,11 +155,3 @@ Pour le moment, l'origine du problème n'est pas comprise, mais certaines option
|
|||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/266
|
https://github.com/tmk/tmk_keyboard/issues/266
|
||||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||||
|
|
||||||
## FLIP ne marche pas
|
|
||||||
|
|
||||||
### `AtLibUsbDfu.dll` Not Found
|
|
||||||
|
|
||||||
Supprimez le pilote actuel et réinstallez celui donné par FLIP dans le gestionnaire de périphériques.
|
|
||||||
|
|
||||||
http://imgur.com/a/bnwzy
|
|
||||||
@@ -26,7 +26,6 @@ Méthodes de flash compatibles :
|
|||||||
|
|
||||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (interface graphique recommandé)
|
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (interface graphique recommandé)
|
||||||
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` avec QMK (outil en ligne de commande recommandé)
|
* [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` avec QMK (outil en ligne de commande recommandé)
|
||||||
* [Atmel's Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (non recommandé)
|
|
||||||
|
|
||||||
Ordre des actions :
|
Ordre des actions :
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ The "easy" way to flash the firmware is using a tool from your host OS:
|
|||||||
|
|
||||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (recommended)
|
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (recommended)
|
||||||
* [Teensy Loader](https://www.pjrc.com/teensy/loader.html)
|
* [Teensy Loader](https://www.pjrc.com/teensy/loader.html)
|
||||||
* [Atmel FLIP](http://www.atmel.com/tools/flip.aspx)
|
|
||||||
|
|
||||||
If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.
|
If you want to program via the command line you can uncomment the ['modifyvm'] lines in the Vagrantfile to enable the USB passthrough into Linux and then program using the command line tools like dfu-util/dfu-programmer or you can install the Teensy CLI version.
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
// Moved pages
|
// Moved pages
|
||||||
'/adding_a_keyboard_to_qmk': '/hardware_keyboard_guidelines',
|
'/adding_a_keyboard_to_qmk': '/hardware_keyboard_guidelines',
|
||||||
'/build_environment_setup': '/getting_started_build_tools',
|
'/build_environment_setup': '/newbs_getting_started',
|
||||||
'/cli_dev_configuration': '/cli_configuration',
|
'/cli_dev_configuration': '/cli_configuration',
|
||||||
'/dynamic_macros': '/feature_dynamic_macros',
|
'/dynamic_macros': '/feature_dynamic_macros',
|
||||||
'/feature_common_shortcuts': '/feature_advanced_keycodes',
|
'/feature_common_shortcuts': '/feature_advanced_keycodes',
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
'/tap_dance': '/feature_tap_dance',
|
'/tap_dance': '/feature_tap_dance',
|
||||||
'/unicode': '/feature_unicode',
|
'/unicode': '/feature_unicode',
|
||||||
'/python_development': '/cli_development',
|
'/python_development': '/cli_development',
|
||||||
|
'/getting_started_build_tools':'/newbs_getting_started',
|
||||||
},
|
},
|
||||||
basePath: '/',
|
basePath: '/',
|
||||||
name: 'QMK Firmware',
|
name: 'QMK Firmware',
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ The following functions can provide basic control of GPIOs and are found in `qua
|
|||||||
| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` |
|
| `writePinLow(pin)` | Set pin level as low, assuming it is an output | `PORTB &= ~(1<<2)` | `palClearLine(pin)` |
|
||||||
| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` |
|
| `writePin(pin, level)` | Set pin level, assuming it is an output | `(level) ? PORTB \|= (1<<2) : PORTB &= ~(1<<2)` | `(level) ? palSetLine(pin) : palClearLine(pin)` |
|
||||||
| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` |
|
| `readPin(pin)` | Returns the level of the pin | `_SFR_IO8(pin >> 4) & _BV(pin & 0xF)` | `palReadLine(pin)` |
|
||||||
|
| `togglePin(pin)` | Invert pin level, assuming it is an output | `PORTB ^= (1<<2)` | `palToggleLine(pin)` |
|
||||||
|
|
||||||
## Advanced Settings :id=advanced-settings
|
## Advanced Settings :id=advanced-settings
|
||||||
|
|
||||||
|
|||||||
@@ -115,12 +115,18 @@ The simplest and quickest way to get things back to normal is to flash only a bo
|
|||||||
|
|
||||||
You can find the stock bootloaders in the [`util/` folder](https://github.com/qmk/qmk_firmware/tree/master/util). Be sure to flash the correct bootloader for your chip:
|
You can find the stock bootloaders in the [`util/` folder](https://github.com/qmk/qmk_firmware/tree/master/util). Be sure to flash the correct bootloader for your chip:
|
||||||
|
|
||||||
* [`atmega32u4`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1_0_0.hex) - Most keyboards, Planck Rev 1-5, Preonic Rev 1-2
|
* **Atmel DFU**
|
||||||
* [`Pro Micro`](https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/avr/bootloaders/caterina/Caterina-promicro16.hex) - The default bootloader for Pro Micro controllers
|
* [ATmega16U4](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega16u4_1.0.1.hex)
|
||||||
* [`at90usb1286`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_at90usb128x_1_0_1.hex) - Planck Light Rev 1
|
* [ATmega32U4](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32u4_1.0.0.hex)
|
||||||
* [`atmega32a`](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_atmega32a_1_0_0.hex) - jj40, and other V-USB/ps2avrGB keyboards
|
* [AT90USB64](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_at90usb64_1.0.0.hex)
|
||||||
|
* [AT90USB128](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_at90usb128_1.0.1.hex)
|
||||||
|
* **Caterina**
|
||||||
|
* [Pro Micro (5V/16MHz)](https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/avr/bootloaders/caterina/Caterina-promicro16.hex)
|
||||||
|
* [Pro Micro (3.3V/8MHz)](https://github.com/sparkfun/Arduino_Boards/blob/master/sparkfun/avr/bootloaders/caterina/Caterina-promicro8.hex)
|
||||||
|
* **BootloadHID (PS2AVRGB)**
|
||||||
|
* [ATmega32A](https://github.com/qmk/qmk_firmware/blob/master/util/bootloader_ps2avrgb_bootloadhid_1.0.1.hex)
|
||||||
|
|
||||||
If you're not sure what your board uses, look in the `rules.mk` file for the keyboard in QMK. The `MCU =` line will have the value you need. It may differ between different versions of the board.
|
If you're not sure what your board uses, look in the `rules.mk` file for the keyboard in QMK. The `MCU` and `BOOTLOADER` lines will have the value you need. It may differ between different versions of the board.
|
||||||
|
|
||||||
### Production Techniques
|
### Production Techniques
|
||||||
|
|
||||||
|
|||||||
@@ -152,10 +152,3 @@ https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
|||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/266
|
https://github.com/tmk/tmk_keyboard/issues/266
|
||||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## FLIP が動作しない
|
|
||||||
### `AtLibUsbDfu.dll` が見つかりません
|
|
||||||
デバイスマネージャから現在のドライバを削除し、FLIP が提供するものを再インストールします。
|
|
||||||
http://imgur.com/a/bnwzy
|
|
||||||
@@ -54,11 +54,11 @@ QMK を使い始めたばかりの場合は、全てを単純にしたいでし
|
|||||||
|----------|-------------------------------|----------------------------------------------------|
|
|----------|-------------------------------|----------------------------------------------------|
|
||||||
| `LCTL(kc)` | `C(kc)` | 左 Control を押しながら `kc` を押します。 |
|
| `LCTL(kc)` | `C(kc)` | 左 Control を押しながら `kc` を押します。 |
|
||||||
| `LSFT(kc)` | `S(kc)` | 左 Shift を押しながら `kc` を押します。 |
|
| `LSFT(kc)` | `S(kc)` | 左 Shift を押しながら `kc` を押します。 |
|
||||||
| `LALT(kc)` | `A(kc)` | 左 Alt を押しながら `kc`を押します。 |
|
| `LALT(kc)` | `A(kc)`, `LOPT(kc)` | 左 Alt を押しながら `kc`を押します。 |
|
||||||
| `LGUI(kc)` | `G(kc)`, `LCMD(kc)`, `LWIN(kc)` | 左 GUI を押しながら `kc` を押します。 |
|
| `LGUI(kc)` | `G(kc)`, `LCMD(kc)`, `LWIN(kc)` | 左 GUI を押しながら `kc` を押します。 |
|
||||||
| `RCTL(kc)` | | 右 Control を押しながら `kc` を押します。 |
|
| `RCTL(kc)` | | 右 Control を押しながら `kc` を押します。 |
|
||||||
| `RSFT(kc)` | | 右 Shift を押しながら `kc` を押します。 |
|
| `RSFT(kc)` | | 右 Shift を押しながら `kc` を押します。 |
|
||||||
| `RALT(kc)` | `ALGR(kc)` | 右 Alt を押しながら `kc` を押します。 |
|
| `RALT(kc)` | `ROPT(kc)`, `ALGR(kc)` | 右 Alt を押しながら `kc` を押します。 |
|
||||||
| `RGUI(kc)` | `RCMD(kc)`, `LWIN(kc)` | 右 GUI を押しながら `kc` を押します。 |
|
| `RGUI(kc)` | `RCMD(kc)`, `LWIN(kc)` | 右 GUI を押しながら `kc` を押します。 |
|
||||||
| `SGUI(kc)` | `SCMD(kc)`, `SWIN(kc)` | 左 Shift と左 GUI を押しながら `kc` を押します。 |
|
| `SGUI(kc)` | `SCMD(kc)`, `SWIN(kc)` | 左 Shift と左 GUI を押しながら `kc` を押します。 |
|
||||||
| `LCA(kc)` | | 左 Control と左 Alt を押しながら `kc` を押します。 |
|
| `LCA(kc)` | | 左 Control と左 Alt を押しながら `kc` を押します。 |
|
||||||
|
|||||||
@@ -0,0 +1,108 @@
|
|||||||
|
# コンボ
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.94:docs/feature_combo.md
|
||||||
|
git diff 0.8.94 HEAD -- docs/feature_combo.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
コンボ機能は、同時押し方式でのカスタムアクション追加機能です。同時に複数のキーを押して、異なる効果を生み出すことができます。例えば、タッピング時間内で `A` と `S` を押すと、代わりに `ESC` が押されます。もっと複雑なタスクを実行させることもできます。
|
||||||
|
|
||||||
|
この機能を有効にするには、`rules.mk` に `COMBO_ENABLE = yes` を追加する必要があります。
|
||||||
|
|
||||||
|
さらに、使用するコンボの数を `config.h` の中で、`#define COMBO_COUNT 1` (1を使用するコンボの数で置き換えます)と書いて、指定する必要があります。
|
||||||
|
<!-- At this time, this is necessary -->
|
||||||
|
|
||||||
|
また、デフォルトでは、コンボのタッピング時間は `TAPPING_TERM` と同じ値に設定されます (ほとんどのキーボードではデフォルトで 200)。ただし、`config.h` で定義することにより異なる値を指定することができます。例えば: `#define COMBO_TERM 300` はコンボのためのタイムアウト時間を 300ms に設定します。
|
||||||
|
|
||||||
|
次に、`keymap.c` ファイルに、`COMBO_END` で終了するキーのシーケンス、およびキーの組み合わせを列挙する構造体、その結果のアクションを定義する必要があります。
|
||||||
|
|
||||||
|
```c
|
||||||
|
const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END};
|
||||||
|
combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
|
||||||
|
```
|
||||||
|
|
||||||
|
これは、A と B のキーを押した場合に、"Escape" を送信します。
|
||||||
|
|
||||||
|
!> このメソッドは[基本的なキーコード](ja/keycodes_basic.md)のみをサポートします。詳細な制御については例を見てください。
|
||||||
|
|
||||||
|
## 例
|
||||||
|
|
||||||
|
リストを追加したい場合は、以下のようなものを使います:
|
||||||
|
|
||||||
|
```c
|
||||||
|
enum combos {
|
||||||
|
AB_ESC,
|
||||||
|
JK_TAB
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END};
|
||||||
|
const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END};
|
||||||
|
|
||||||
|
combo_t key_combos[COMBO_COUNT] = {
|
||||||
|
[AB_ESC] = COMBO(ab_combo, KC_ESC),
|
||||||
|
[JK_TAB] = COMBO(jk_combo, KC_TAB)
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
より複雑な実装として、カスタム処理を追加するために `process_combo_event` 関数を使うことができます。
|
||||||
|
|
||||||
|
```c
|
||||||
|
enum combo_events {
|
||||||
|
ZC_COPY,
|
||||||
|
XV_PASTE
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END};
|
||||||
|
const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END};
|
||||||
|
|
||||||
|
combo_t key_combos[COMBO_COUNT] = {
|
||||||
|
[ZC_COPY] = COMBO_ACTION(copy_combo),
|
||||||
|
[XV_PASTE] = COMBO_ACTION(paste_combo),
|
||||||
|
};
|
||||||
|
|
||||||
|
void process_combo_event(uint8_t combo_index, bool pressed) {
|
||||||
|
switch(combo_index) {
|
||||||
|
case ZC_COPY:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LCTL(KC_C));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case XV_PASTE:
|
||||||
|
if (pressed) {
|
||||||
|
tap_code16(LCTL(KC_V));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
これは、Z と C を押すと Ctrl+C を送信し、X と V を押すと Ctrl+V を送信します。これを変更して、レイヤーの変更、サウンドの再生、設定の変更などを行うこともできます。
|
||||||
|
|
||||||
|
## 追加の設定
|
||||||
|
|
||||||
|
長いコンボあるいはさらに長いコンボを使っている場合、構造体があなたのしていることに対応するのに十分な大きさで無いかもしれないため、問題が発生するかもしれません。
|
||||||
|
|
||||||
|
この場合、`config.h` ファイルに `#define EXTRA_LONG_COMBOS` または `#define EXTRA_EXTRA_LONG_COMBOS` のどちらかを追加することができます。
|
||||||
|
|
||||||
|
`COMBO_ALLOW_ACTION_KEYS` を定義することでアクションキーを有効にすることもできます。
|
||||||
|
|
||||||
|
## キーコード
|
||||||
|
|
||||||
|
その場でコンボ機能を有効、無効および切り替えすることができます。ゲームなどで、一時的にそれらを無効にする必要がある場合に便利です。
|
||||||
|
|
||||||
|
| キーコード | 説明 |
|
||||||
|
|----------|---------------------------------|
|
||||||
|
| `CMB_ON` | コンボ機能をオンにします |
|
||||||
|
| `CMB_OFF` | コンボ機能をオフにします |
|
||||||
|
| `CMB_TOG` | コンボ機能のオンとオフを切り替えます |
|
||||||
|
|
||||||
|
## ユーザコールバック
|
||||||
|
|
||||||
|
キーコードに加えて、状態を設定または状態をチェックするために使うことができる幾つかの関数があります:
|
||||||
|
|
||||||
|
| 関数 | 説明 |
|
||||||
|
|-----------|--------------------------------------------------------------------|
|
||||||
|
| `combo_enable()` | コンボ機能を有効にします |
|
||||||
|
| `combo_disable()` | コンボ機能を無効にし、コンボバッファをクリアします |
|
||||||
|
| `combo_toggle()` | コンボ機能の状態を切り替えます |
|
||||||
|
| `is_combo_enabled()` | コンボ機能の状態(true か false)を返します |
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# コマンド
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.94:docs/feature_command.md
|
||||||
|
git diff 0.8.94 HEAD -- docs/feature_command.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
コマンド(旧称:マジック)は、ファームウェアを書き込んだり、[ブートマジック](ja/feature_bootmagic.md)を使うためにプラグを抜いたりすることなくキーボードの挙動を変更する方法です。この機能と[ブートマジックキーコード](feature_bootmagic.md#keycodes)には多くの重複があります。可能な限り、コマンドでは無くブートマジックキーコードの機能を使うことをお勧めします。
|
||||||
|
|
||||||
|
一部のキーボードではコマンドがデフォルトで無効になっています。その場合、`rules.mk` 内で明示的に有効にする必要があります:
|
||||||
|
|
||||||
|
```make
|
||||||
|
COMMAND_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
## 使用法
|
||||||
|
|
||||||
|
コマンドを使うには、`IS_COMMAND()` マクロで定義されたキーの組み合わせを押し続けます。デフォルトでは、これは「左Shift + 右Shift」です。次に、目的のコマンドに対応するキーを押します。例えば、現在の QMK バージョンを QMK Toolbox コンソールに出力するには、「左Shift + 右Shift + `V`」を押します。
|
||||||
|
|
||||||
|
## 設定
|
||||||
|
|
||||||
|
コマンドのためのキーの割り当てを変更したい場合は、キーボードあるいはキーマップレベルのどちらかで、`config.h` にこれらを `#define` します。ここで割り当てる全てのキーコードは `KC_` 接頭辞を省略する必要があります。
|
||||||
|
|
||||||
|
| 定義 | デフォルト | 説明 |
|
||||||
|
|------------------------------------|--------------------------------|------------------------------------------------|
|
||||||
|
| `IS_COMMAND()` | `(get_mods() == MOD_MASK_SHIFT)` | コマンドをアクティブにするキーの組み合わせ |
|
||||||
|
| `MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS` | `true` | ファンクション行を使ってデフォルトレイヤーを設定 |
|
||||||
|
| `MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS` | `true` | 数字キーでデフォルトレイヤーを設定 |
|
||||||
|
| `MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM` | `false` | `MAGIC_KEY_LAYER0..9` を使ってデフォルトレイヤーを設定 |
|
||||||
|
| `MAGIC_KEY_DEBUG` | `D` | シリアルを介するデバッグの切り替え |
|
||||||
|
| `MAGIC_KEY_DEBUG_MATRIX` | `X` | キーマトリックスのデバッグの切り替え |
|
||||||
|
| `MAGIC_KEY_DEBUG_KBD` | `K` | キーボードのデバッグの切り替え |
|
||||||
|
| `MAGIC_KEY_DEBUG_MOUSE` | `M` | マウスのデバッグの切り替え |
|
||||||
|
| `MAGIC_KEY_CONSOLE` | `C` | コマンドコンソールを有効にする |
|
||||||
|
| `MAGIC_KEY_VERSION` | `V` | コンソールに実行中の QMK バージョンを出力 |
|
||||||
|
| `MAGIC_KEY_STATUS` | `S` | コンソールに現在のキーボードの状態を出力 |
|
||||||
|
| `MAGIC_KEY_HELP` | `H` | コンソールにコマンドのヘルプを出力 |
|
||||||
|
| `MAGIC_KEY_HELP_ALT` | `SLASH` | コンソールにコマンドのヘルプを出力 (代替) |
|
||||||
|
| `MAGIC_KEY_LAYER0` | `0` | レイヤー 0 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER0_ALT` | `GRAVE` | レイヤー 0 をデフォルトレイヤーにする (代替) |
|
||||||
|
| `MAGIC_KEY_LAYER1` | `1` | レイヤー 1 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER2` | `2` | レイヤー 2 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER3` | `3` | レイヤー 3 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER4` | `4` | レイヤー 4 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER5` | `5` | レイヤー 5 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER6` | `6` | レイヤー 6 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER7` | `7` | レイヤー 7 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER8` | `8` | レイヤー 8 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_LAYER9` | `9` | レイヤー 9 をデフォルトレイヤーにする |
|
||||||
|
| `MAGIC_KEY_BOOTLOADER` | `B` | ブートローダにジャンプする |
|
||||||
|
| `MAGIC_KEY_BOOTLOADER_ALT` | `ESC` | ブートローダにジャンプする (代替) |
|
||||||
|
| `MAGIC_KEY_LOCK` | `CAPS` | 何も入力できないようにキーボードをロック |
|
||||||
|
| `MAGIC_KEY_EEPROM` | `E` | 保存された EEPROM 設定をコンソールに出力 |
|
||||||
|
| `MAGIC_KEY_EEPROM_CLEAR` | `BSPACE` | EEPROM をクリア |
|
||||||
|
| `MAGIC_KEY_NKRO` | `N` | N キーロールオーバー (NKRO) の有効・無効を切り替え |
|
||||||
|
| `MAGIC_KEY_SLEEP_LED` | `Z` | コンピュータがスリープの時に LED を切り替え |
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
# DIP スイッチ
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.94:docs/feature_dip_switch.md
|
||||||
|
git diff 0.8.94 HEAD -- docs/feature_dip_switch.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
DIP スイッチは、以下を `rules.mk` に追加することでサポートされます:
|
||||||
|
|
||||||
|
DIP_SWITCH_ENABLE = yes
|
||||||
|
|
||||||
|
さらに、以下を `config.h` に追加します:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define DIP_SWITCH_PINS { B14, A15, A10, B9 }
|
||||||
|
```
|
||||||
|
|
||||||
|
## コールバック
|
||||||
|
|
||||||
|
コールバック関数を `<keyboard>.c` に記述することができます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_kb(uint8_t index, bool active) {
|
||||||
|
dip_switch_update_user(index, active);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
あるいは `keymap.c` に記述することもできます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_user(uint8_t index, bool active) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
if(active) { audio_on(); } else { audio_off(); }
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if(active) { clicky_on(); } else { clicky_off(); }
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if(active) { music_on(); } else { music_off(); }
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (active) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_SONG(plover_song);
|
||||||
|
#endif
|
||||||
|
layer_on(_PLOVER);
|
||||||
|
} else {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_SONG(plover_gb_song);
|
||||||
|
#endif
|
||||||
|
layer_off(_PLOVER);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
更に、より複雑な処理ができるビットマスク関数をサポートします。
|
||||||
|
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_mask_kb(uint32_t state) {
|
||||||
|
dip_switch_update_mask_user(state);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
あるいは `keymap.c` に記述することもできます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_mask_user(uint32_t state) {
|
||||||
|
if (state & (1UL<<0) && state & (1UL<<1)) {
|
||||||
|
layer_on(_ADJUST); // C on esc
|
||||||
|
} else {
|
||||||
|
layer_off(_ADJUST);
|
||||||
|
}
|
||||||
|
if (state & (1UL<<0)) {
|
||||||
|
layer_on(_TEST_A); // A on ESC
|
||||||
|
} else {
|
||||||
|
layer_off(_TEST_A);
|
||||||
|
}
|
||||||
|
if (state & (1UL<<1)) {
|
||||||
|
layer_on(_TEST_B); // B on esc
|
||||||
|
} else {
|
||||||
|
layer_off(_TEST_B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## ハードウェア
|
||||||
|
|
||||||
|
DIP スイッチの片側は MCU のピンへ直接配線し、もう一方の側はグラウンドに配線する必要があります。機能的に同じであるため、どちら側がどちらに接続されているかは問題にはならないはずです。
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
# 動的マクロ: ランタイムでのマクロの記録および再生
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.123:docs/feature_dynamic_macros.md
|
||||||
|
git diff 0.8.123 HEAD -- docs/feature_dynamic_macros.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
QMK はその場で作られた一時的なマクロをサポートします。これらを動的マクロと呼びます。それらはユーザがキーボードから定義し、キーボードのプラグを抜くか再起動すると失われます。
|
||||||
|
|
||||||
|
1つまたは2つのマクロに合計128のキー押下を保存できます。RAM をより多く使用してサイズを増やすことができます。
|
||||||
|
|
||||||
|
有効にするには、最初に `rules.mk` に `DYNAMIC_MACRO_ENABLE = yes` を記述します。そして、以下のキーをキーマップに追加します:
|
||||||
|
|
||||||
|
| キー | Alias | 説明 |
|
||||||
|
|------------------|----------|---------------------------------------------------|
|
||||||
|
| `DYN_REC_START1` | `DM_REC1` | マクロ 1 の記録を開始します |
|
||||||
|
| `DYN_REC_START2` | `DM_REC2` | マクロ 2 の記録を開始します |
|
||||||
|
| `DYN_MACRO_PLAY1` | `DM_PLY1` | マクロ 1 を再生します |
|
||||||
|
| `DYN_MACRO_PLAY2` | `DM_PLY2` | マクロ 2 を再生します |
|
||||||
|
| `DYN_REC_STOP` | `DM_RSTP` | 現在記録中のマクロの記録を終了します。 |
|
||||||
|
|
||||||
|
これが必要な全てです。
|
||||||
|
|
||||||
|
マクロの記録を開始するには、`DYN_REC_START1` または `DYN_REC_START2` のどちらかを押します。
|
||||||
|
|
||||||
|
記録を終了するには、`DYN_REC_STOP` レイヤーボタンを押します。
|
||||||
|
|
||||||
|
マクロを再生するには、`DYN_MACRO_PLAY1` あるいは `DYN_MACRO_PLAY2` のどちらかを押します。
|
||||||
|
|
||||||
|
マクロの一部としてマクロを再生することができます。マクロ 1 を記録中にマクロ 2 を再生、またはその逆も問題ありません。ただし、再帰的なマクロ、つまりマクロ 1 を再生するマクロ 1 は作成しないでください。もしそうしてキーボードが反応しなくなった場合は、キーボードを取り外し再び接続します。これを完全に無効にするには、`config.h` ファイルで `DYNAMIC_MACRO_NO_NESTING` を定義します。
|
||||||
|
|
||||||
|
?> 動的マクロの内部の詳細については、`process_dynamic_macro.h` および `process_dynamic_macro.c` ファイルのコメントを読んでください。
|
||||||
|
|
||||||
|
## カスタマイズ
|
||||||
|
|
||||||
|
ある程度のカスタマイズを可能にするオプションがいくつか追加されています。
|
||||||
|
|
||||||
|
| 定義 | デフォルト | 説明 |
|
||||||
|
|----------------------------|----------------|-----------------------------------------------------------------------------------------------------------------|
|
||||||
|
| `DYNAMIC_MACRO_SIZE` | 128 | 動的マクロが使用できるメモリ量を設定します。これは限られたリソースであり、コントローラに依存します。 |
|
||||||
|
| `DYNAMIC_MACRO_USER_CALL` | *定義なし* | これを定義すると、ユーザの `keymap.c` ファイルを使ってマクロが起動されます。 |
|
||||||
|
| `DYNAMIC_MACRO_NO_NESTING` | *定義なし* | これを定義すると、別のマクロからマクロを呼び出す(入れ子になったマクロ)機能を無効にします。 |
|
||||||
|
|
||||||
|
|
||||||
|
記録中にキーを押すたびに LED が点滅し始めた場合は、マクロバッファにマクロを入れるスペースがもう無いことを意味します。マクロを入れるには、他のマクロ(それらは同じバッファを共有します)を短くするか、`config.h` に `DYNAMIC_MACRO_SIZE` 定義を追加することでバッファを増やします(デフォルト値: 128; ヘッダ内のコメントを読んでください)。
|
||||||
|
|
||||||
|
|
||||||
|
### DYNAMIC_MACRO_USER_CALL
|
||||||
|
|
||||||
|
以前のバージョンの動的マクロをお使いの方へ: 専用の `DYN_REC_STOP` キーを使わずに動的マクロキーへのアクセスに使われるレイヤーモディファイアのみを使って、マクロの記録を終了することもまだ可能です。この動作に戻したい場合は、`#define DYNAMIC_MACRO_USER_CALL` を `config.h` に追加し、以下のスニペットを `process_record_user()` 関数の先頭に記述します:
|
||||||
|
|
||||||
|
```c
|
||||||
|
uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
|
||||||
|
|
||||||
|
if (!process_record_dynamic_macro(macro_kc, record)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### ユーザフック
|
||||||
|
|
||||||
|
カスタム機能とフィードバックオプションを動的マクロ機能に追加するために使うことができるフックが幾つかあります。これによりある程度のカスタマイズが可能になります。
|
||||||
|
|
||||||
|
direction がどのマクロであるかを示すことに注意してください。`1` がマクロ 1、`-1` がマクロ 2、0 がマクロ無しです。
|
||||||
|
|
||||||
|
* `dynamic_macro_record_start_user(void)` - マクロの記録を開始する時に起動されます。
|
||||||
|
* `dynamic_macro_play_user(int8_t direction)` - マクロを再生する時に起動されます。
|
||||||
|
* `dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record)` - マクロの記録中に各キー押下で起動されます。
|
||||||
|
* `dynamic_macro_record_end_user(int8_t direction)` - マクロの記録を停止した時に起動されます。
|
||||||
|
|
||||||
|
さらに、動的マクロ機能が有効な場合にバックライトを点滅させるために `dynamic_macro_led_blink()` を呼び出すことができます。
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
# エンコーダ
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.123:docs/feature_encoders.md
|
||||||
|
git diff 0.8.123 HEAD -- docs/feature_encoders.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
以下を `rules.mk` に追加することで基本的なエンコーダがサポートされます:
|
||||||
|
|
||||||
|
```make
|
||||||
|
ENCODER_ENABLE = yes
|
||||||
|
```
|
||||||
|
|
||||||
|
さらに、以下を `config.h` に追加します:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODERS_PAD_A { B12 }
|
||||||
|
#define ENCODERS_PAD_B { B13 }
|
||||||
|
```
|
||||||
|
|
||||||
|
各 PAD_A/B 変数は配列を定義するため、複数のエンコーダを定義することができます。例えば:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODERS_PAD_A { encoder1a, encoder2a }
|
||||||
|
#define ENCODERS_PAD_B { encoder1b, encoder2b }
|
||||||
|
```
|
||||||
|
|
||||||
|
エンコーダの時計回りの方向が間違っている場合は、A と B のパッド定義を交換することができます。define を使って逆にすることもできます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODER_DIRECTION_FLIP
|
||||||
|
```
|
||||||
|
|
||||||
|
さらに、解像度を同じファイルで指定することができます (デフォルトかつお勧めは4):
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODER_RESOLUTION 4
|
||||||
|
```
|
||||||
|
|
||||||
|
## 分割キーボード
|
||||||
|
|
||||||
|
分割キーボードのそれぞれの側のエンコーダに異なるピン配列を使っている場合、右側のピン配列を以下のように定義することができます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
|
||||||
|
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
|
||||||
|
```
|
||||||
|
|
||||||
|
## コールバック
|
||||||
|
|
||||||
|
コールバック関数を `<keyboard>.c` に記述することができます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void encoder_update_kb(uint8_t index, bool clockwise) {
|
||||||
|
encoder_update_user(index, clockwise);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
あるいは `keymap.c` に記述することもできます:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void encoder_update_user(uint8_t index, bool clockwise) {
|
||||||
|
if (index == 0) { /* First encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_PGDN);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_PGUP);
|
||||||
|
}
|
||||||
|
} else if (index == 1) { /* Second encoder */
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_DOWN);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_UP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## ハードウェア
|
||||||
|
|
||||||
|
エンコーダの A と B の線は MCU に直接配線し、C/common 線はグランドに配線する必要があります。
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
# グレイブエスケープ
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.123:docs/feature_grave_esc.md
|
||||||
|
git diff 0.8.123 HEAD -- docs/feature_grave_esc.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
60% キーボード、またはファンクションキー行の無い他のレイアウトを使っている場合、専用の Escape キーが無いことに気付くでしょう。グレイブエスケープは grave キー (<code>`</code> および `~`) を Escape と共有することができる機能です。
|
||||||
|
|
||||||
|
## 使用法
|
||||||
|
|
||||||
|
キーマップ内の `KC_GRAVE` キー (通常は`1` キーの左)を `KC_GESC` に置き換えます。ほとんどの場合、このキーは押された時に `KC_ESC` を出力します。ただし、Shift あるいは GUI を押したままにすると、代わりに `KC_GRV` を出力します。
|
||||||
|
|
||||||
|
## OS に見えるもの
|
||||||
|
|
||||||
|
メアリーがキーボードで GESC を押すと、OS には KC_ESC 文字が見えます。メアリーが Shift を押しながら GESC を押すと、`~` または Shift された時はバッククォートを出力します。彼女が GUI/CMD/WIN を押したままにすると、1つの <code>`</code> 文字を出力します。
|
||||||
|
|
||||||
|
## キーコード
|
||||||
|
|
||||||
|
| キー | エイリアス | 説明 |
|
||||||
|
|---------|-----------|------------------------------------------------------------------|
|
||||||
|
| `KC_GESC` | `GRAVE_ESC` | 押された場合に Escape。Shift あるいは GUI が押されたままの場合は <code>`</code> |
|
||||||
|
|
||||||
|
### 注意事項
|
||||||
|
|
||||||
|
macOS では、Command+<code>`</code> はデフォルトで "次のウィンドウを操作対象にする" にマップされます。つまりバッククォートを出力しません。さらに、ショートカットがキーボード環境設定で変更された場合でも、ターミナルは常にこのショートカットを認識してウィンドウを切り替えます。
|
||||||
|
|
||||||
|
## 設定
|
||||||
|
|
||||||
|
グレイブエスケープが壊す可能性のあるキーの組み合わせが幾つかあります。その中には、Windows では Control+Shift+Escape、macOSでは Command+Option+Escape があります。これを回避するには、`config.h` で以下のオプションを `#define` することができます:
|
||||||
|
|
||||||
|
| 定義 | 説明 |
|
||||||
|
|--------------------------|-----------------------------------------|
|
||||||
|
| `GRAVE_ESC_ALT_OVERRIDE` | Alt が押された場合、常に Escape を送信する |
|
||||||
|
| `GRAVE_ESC_CTRL_OVERRIDE` | Control が押された場合、常に Escape を送信する |
|
||||||
|
| `GRAVE_ESC_GUI_OVERRIDE` | GUI が押された場合、常に Escape を送信する |
|
||||||
|
| `GRAVE_ESC_SHIFT_OVERRIDE` | Shift が押された場合、常に Escape を送信する |
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
# 触覚フィードバック
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.123:docs/feature_haptic_feedback.md
|
||||||
|
git diff 0.8.123 HEAD -- docs/feature_haptic_feedback.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
## 触覚フィードバック の rules.mk オプション
|
||||||
|
|
||||||
|
現在のところ、`rules.mk` で触覚フィードバック用に以下のオプションを利用可能です:
|
||||||
|
|
||||||
|
`HAPTIC_ENABLE += DRV2605L`
|
||||||
|
|
||||||
|
`HAPTIC_ENABLE += SOLENOID`
|
||||||
|
|
||||||
|
## サポートされる既知のハードウェア
|
||||||
|
|
||||||
|
| 名前 | 説明 |
|
||||||
|
|--------------------|-------------------------------------------------|
|
||||||
|
| [LV061228B-L65-A](https://www.digikey.com/product-detail/en/jinlong-machinery-electronics-inc/LV061228B-L65-A/1670-1050-ND/7732325) | z-axis 2v LRA |
|
||||||
|
| [Mini Motor Disc](https://www.adafruit.com/product/1201) | small 2-5v ERM |
|
||||||
|
|
||||||
|
## 触覚キーコード
|
||||||
|
|
||||||
|
以下のキーコードは、選択した触覚メカニズムに依存して動作するかどうか決まります。
|
||||||
|
|
||||||
|
| 名前 | 説明 |
|
||||||
|
|-----------|-------------------------------------------------------|
|
||||||
|
| `HPT_ON` | 触覚フィードバックをオン |
|
||||||
|
| `HPT_OFF` | 触覚フィードバックをオフ |
|
||||||
|
| `HPT_TOG` | 触覚フィードバックのオン/オフを切り替え |
|
||||||
|
| `HPT_RST` | 触覚フィードバック設定をデフォルトに戻す |
|
||||||
|
| `HPT_FBK` | キー押下またはリリースまたはその両方でフィードバックを切り替え |
|
||||||
|
| `HPT_BUZ` | ソレノイドの振動のオン/オフを切り替え |
|
||||||
|
| `HPT_MODI` | 次の DRV2605L 波形に移動 |
|
||||||
|
| `HPT_MODD` | 前の DRV2605L 波形に移動 |
|
||||||
|
| `HPT_CONT` | 連続触覚モードのオン/オフを切り替え |
|
||||||
|
| `HPT_CONI` | DRV2605L の連続触覚強度を増加 |
|
||||||
|
| `HPT_COND` | DRV2605L の連続触覚強度を減少 |
|
||||||
|
| `HPT_DWLI` | ソレノイドの滞留時間を増加 |
|
||||||
|
| `HPT_DWLD` | ソレノイドの滞留時間を減少 |
|
||||||
|
|
||||||
|
### ソレノイド
|
||||||
|
|
||||||
|
ほとんどの MCU はソレノイドのコイルを駆動するために必要な電流を供給できないため、最初に MOSFET を介してソレノイドを駆動する回路を構築する必要があります。
|
||||||
|
|
||||||
|
[Adafruit が提供する配線図](https://playground.arduino.cc/uploads/Learning/solenoid_driver.pdf)
|
||||||
|
|
||||||
|
|
||||||
|
| 設定 | デフォルト | 説明 |
|
||||||
|
|--------------------------|---------------|-------------------------------------------------------|
|
||||||
|
| `SOLENOID_PIN` | *定義なし* | ソレノイドが接続されているピンを設定する。 |
|
||||||
|
| `SOLENOID_DEFAULT_DWELL` | `12` ms | ソレノイドのデフォルトの滞留時間を設定する。 |
|
||||||
|
| `SOLENOID_MIN_DWELL` | `4` ms | 滞留時間の下限を設定する。 |
|
||||||
|
| `SOLENOID_MAX_DWELL` | `100` ms | 滞留時間の上限を設定する。 |
|
||||||
|
|
||||||
|
?> 滞留時間とは、「プランジャー」が作動したままになる時間です。滞留時間により、ソレノイドの音が変わります。
|
||||||
|
|
||||||
|
ブートローダ実行中に一部のピンが給電されているかもしれず (例えば、STM32F303 チップ上の A13)、そうすると書き込みプロセスの間ずっとソレノイドがオン状態になることに注意してください。これはソレノイドを加熱し損傷を与えるかもしれません。ソレノイドが接続されているピンがブートローダ/DFU 実行中にソレノイドをオンにしていることが分かった場合は、他のピンを選択してください。
|
||||||
|
|
||||||
|
### DRV2605L
|
||||||
|
|
||||||
|
DRV2605Lは i2c プロトコルで制御され、SDA および SCL ピンに接続する必要があります。これらは使用する MCU によって異なります。
|
||||||
|
|
||||||
|
#### フィードバックモータのセットアップ
|
||||||
|
|
||||||
|
このドライバは2つの異なるフィードバックモータをサポートします。選択したモータに基づいて、`config.h` で以下を設定します。
|
||||||
|
|
||||||
|
##### ERM
|
||||||
|
|
||||||
|
偏心回転質量振動モータ (ERM) は偏りのある重りが取り付けられたモータで、駆動信号が取り付けられると偏りのある重りが回転し、正弦波が振動に変換されます。
|
||||||
|
|
||||||
|
```
|
||||||
|
#define FB_ERM_LRA 0
|
||||||
|
#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
|
||||||
|
#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
|
||||||
|
|
||||||
|
/* 特定のモータに最適な設定については、データシートを参照してください。*/
|
||||||
|
#define RATED_VOLTAGE 3
|
||||||
|
#define V_PEAK 5
|
||||||
|
```
|
||||||
|
##### LRA
|
||||||
|
|
||||||
|
線形共振アクチュエータ (LRA、線形バイブレータとしても知られています)は、ERM と異なります。LRA は重りと磁石をバネで吊るしたものとボイスコイルで構成されています。駆動信号が印加されるとされると、重りは単一の軸で振動します (左右または上下)。重りはバネに取り付けられているため、特定の周波数で共振効果があります。この周波数は LRA が最も効率的に動作する箇所です。この周波数の推奨範囲については、モータのデータシートを参照してください。
|
||||||
|
|
||||||
|
```
|
||||||
|
#define FB_ERM_LRA 1
|
||||||
|
#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */
|
||||||
|
#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */
|
||||||
|
|
||||||
|
/* 特定のモータに最適な設定については、データシートを参照してください。*/
|
||||||
|
#define RATED_VOLTAGE 2
|
||||||
|
#define V_PEAK 2.8
|
||||||
|
#define V_RMS 2.0
|
||||||
|
#define V_PEAK 2.1
|
||||||
|
#define F_LRA 205 /* 共振周波数 */
|
||||||
|
```
|
||||||
|
|
||||||
|
#### DRV2605L 波形ライブラリ
|
||||||
|
|
||||||
|
DRV2605L には呼び出して再生できる様々な波形シーケンスのプリロードライブラリが同梱されています。マクロを書く場合、これらの波形は `DRV_pulse(*sequence name or number*)` を使って再生することができます
|
||||||
|
|
||||||
|
データシートの波形シーケンスのリスト
|
||||||
|
|
||||||
|
| seq# | シーケンス名 | seq# | シーケンス名 | seq# | シーケンス名 |
|
||||||
|
|-----|---------------------|-----|-----------------------------------|-----|--------------------------------------|
|
||||||
|
| 1 | strong_click | 43 | lg_dblclick_med_60 | 85 | transition_rampup_med_smooth2 |
|
||||||
|
| 2 | strong_click_60 | 44 | lg_dblsharp_tick | 86 | transition_rampup_short_smooth1 |
|
||||||
|
| 3 | strong_click_30 | 45 | lg_dblsharp_tick_80 | 87 | transition_rampup_short_smooth2 |
|
||||||
|
| 4 | sharp_click | 46 | lg_dblsharp_tick_60 | 88 | transition_rampup_long_sharp1 |
|
||||||
|
| 5 | sharp_click_60 | 47 | buzz | 89 | transition_rampup_long_sharp2 |
|
||||||
|
| 6 | sharp_click_30 | 48 | buzz_80 | 90 | transition_rampup_med_sharp1 |
|
||||||
|
| 7 | soft_bump | 49 | buzz_60 | 91 | transition_rampup_med_sharp2 |
|
||||||
|
| 8 | soft_bump_60 | 50 | buzz_40 | 92 | transition_rampup_short_sharp1 |
|
||||||
|
| 9 | soft_bump_30 | 51 | buzz_20 | 93 | transition_rampup_short_sharp2 |
|
||||||
|
| 10 | dbl_click | 52 | pulsing_strong | 94 | transition_rampdown_long_smooth1_50 |
|
||||||
|
| 11 | dbl_click_60 | 53 | pulsing_strong_80 | 95 | transition_rampdown_long_smooth2_50 |
|
||||||
|
| 12 | trp_click | 54 | pulsing_medium | 96 | transition_rampdown_med_smooth1_50 |
|
||||||
|
| 13 | soft_fuzz | 55 | pulsing_medium_80 | 97 | transition_rampdown_med_smooth2_50 |
|
||||||
|
| 14 | strong_buzz | 56 | pulsing_sharp | 98 | transition_rampdown_short_smooth1_50 |
|
||||||
|
| 15 | alert_750ms | 57 | pulsing_sharp_80 | 99 | transition_rampdown_short_smooth2_50 |
|
||||||
|
| 16 | alert_1000ms | 58 | transition_click | 100 | transition_rampdown_long_sharp1_50 |
|
||||||
|
| 17 | strong_click1 | 59 | transition_click_80 | 101 | transition_rampdown_long_sharp2_50 |
|
||||||
|
| 18 | strong_click2_80 | 60 | transition_click_60 | 102 | transition_rampdown_med_sharp1_50 |
|
||||||
|
| 19 | strong_click3_60 | 61 | transition_click_40 | 103 | transition_rampdown_med_sharp2_50 |
|
||||||
|
| 20 | strong_click4_30 | 62 | transition_click_20 | 104 | transition_rampdown_short_sharp1_50 |
|
||||||
|
| 21 | medium_click1 | 63 | transition_click_10 | 105 | transition_rampdown_short_sharp2_50 |
|
||||||
|
| 22 | medium_click2_80 | 64 | transition_hum | 106 | transition_rampup_long_smooth1_50 |
|
||||||
|
| 23 | medium_click3_60 | 65 | transition_hum_80 | 107 | transition_rampup_long_smooth2_50 |
|
||||||
|
| 24 | sharp_tick1 | 66 | transition_hum_60 | 108 | transition_rampup_med_smooth1_50 |
|
||||||
|
| 25 | sharp_tick2_80 | 67 | transition_hum_40 | 109 | transition_rampup_med_smooth2_50 |
|
||||||
|
| 26 | sharp_tick3_60 | 68 | transition_hum_20 | 110 | transition_rampup_short_smooth1_50 |
|
||||||
|
| 27 | sh_dblclick_str | 69 | transition_hum_10 | 111 | transition_rampup_short_smooth2_50 |
|
||||||
|
| 28 | sh_dblclick_str_80 | 70 | transition_rampdown_long_smooth1 | 112 | transition_rampup_long_sharp1_50 |
|
||||||
|
| 29 | sh_dblclick_str_60 | 71 | transition_rampdown_long_smooth2 | 113 | transition_rampup_long_sharp2_50 |
|
||||||
|
| 30 | sh_dblclick_str_30 | 72 | transition_rampdown_med_smooth1 | 114 | transition_rampup_med_sharp1_50 |
|
||||||
|
| 31 | sh_dblclick_med | 73 | transition_rampdown_med_smooth2 | 115 | transition_rampup_med_sharp2_50 |
|
||||||
|
| 32 | sh_dblclick_med_80 | 74 | transition_rampdown_short_smooth1 | 116 | transition_rampup_short_sharp1_50 |
|
||||||
|
| 33 | sh_dblclick_med_60 | 75 | transition_rampdown_short_smooth2 | 117 | transition_rampup_short_sharp2_50 |
|
||||||
|
| 34 | sh_dblsharp_tick | 76 | transition_rampdown_long_sharp1 | 118 | long_buzz_for_programmatic_stopping |
|
||||||
|
| 35 | sh_dblsharp_tick_80 | 77 | transition_rampdown_long_sharp2 | 119 | smooth_hum1_50 |
|
||||||
|
| 36 | sh_dblsharp_tick_60 | 78 | transition_rampdown_med_sharp1 | 120 | smooth_hum2_40 |
|
||||||
|
| 37 | lg_dblclick_str | 79 | transition_rampdown_med_sharp2 | 121 | smooth_hum3_30 |
|
||||||
|
| 38 | lg_dblclick_str_80 | 80 | transition_rampdown_short_sharp1 | 122 | smooth_hum4_20 |
|
||||||
|
| 39 | lg_dblclick_str_60 | 81 | transition_rampdown_short_sharp2 | 123 | smooth_hum5_10 |
|
||||||
|
| 40 | lg_dblclick_str_30 | 82 | transition_rampup_long_smooth1 | | |
|
||||||
|
| 41 | lg_dblclick_med | 83 | transition_rampup_long_smooth2 | | |
|
||||||
|
| 42 | lg_dblclick_med_80 | 84 | transition_rampup_med_smooth1 | | |
|
||||||
|
### オプションの DRV2605L の定義
|
||||||
|
|
||||||
|
```
|
||||||
|
#define DRV_GREETING *sequence name or number*
|
||||||
|
```
|
||||||
|
触覚フィードバッグが有効な場合、キーボード起動時に特定のシーケンスに合わせて振動します。以下の定義を使って選択することができます:
|
||||||
|
|
||||||
|
```
|
||||||
|
#define DRV_MODE_DEFAULT *sequence name or number*
|
||||||
|
```
|
||||||
|
これにより HPT_RST がアクティブモードとして設定するシーケンスを設定します。未定義の場合、HPT_RST が押された時にモードが 1 に設定されます。
|
||||||
|
|
||||||
|
### DRV2605L 連続触覚モード
|
||||||
|
|
||||||
|
このモードは強さを増減するオプションを使って連続触覚フィードバッグを設定します。
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
# HD44780 LCD ディスプレイ
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.123:docs/feature_hd44780.md
|
||||||
|
git diff 0.8.123 HEAD -- docs/feature_hd44780.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
これは Peter Fleury の LCD ライブラリの統合です。このページは基本について説明します。[詳細なドキュメントについてはこのページをご覧ください](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html) (訳注)原文のリンク先のページは、サービスの終了に伴って削除されています。移行先は (http://www.peterfleury.epizy.com/doxygen/avr-gcc-libraries/group__pfleury__lcd.html) と思われます。
|
||||||
|
|
||||||
|
HD44780 ディスプレイのサポートを有効にするには、キーボードの `rules.mk` の `HD44780_ENABLE` フラグを yes に設定します。
|
||||||
|
|
||||||
|
## 設定
|
||||||
|
|
||||||
|
ディスプレイで使用されるピンとディスプレイの行と列の数を、キーボードの `config.h` に設定する必要があります。
|
||||||
|
|
||||||
|
|
||||||
|
HD44780 のラベルが付いたセクションのコメントを外し、必要に応じてパラメータを変更します。
|
||||||
|
````
|
||||||
|
/*
|
||||||
|
* HD44780 LCD ディスプレイ設定
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LCD_LINES 2 //< ディスプレイの表示行数
|
||||||
|
#define LCD_DISP_LENGTH 16 //< ディスプレイの行ごとの表示文字数
|
||||||
|
#define LCD_IO_MODE 1 //< 0: メモリマップモード 1: IO ポートモード
|
||||||
|
#if LCD_IO_MODE
|
||||||
|
#define LCD_PORT PORTB //< LCD 行のためのポート
|
||||||
|
#define LCD_DATA0_PORT LCD_PORT //< 4ビットデータビット 0 のポート
|
||||||
|
#define LCD_DATA1_PORT LCD_PORT //< 4ビットデータビット 1 のポート
|
||||||
|
#define LCD_DATA2_PORT LCD_PORT //< 4ビットデータビット 2 のポート
|
||||||
|
#define LCD_DATA3_PORT LCD_PORT //< 4ビットデータビット 3 のポート
|
||||||
|
#define LCD_DATA0_PIN 4 //< 4ビットデータビット 0 のピン
|
||||||
|
#define LCD_DATA1_PIN 5 //< 4ビットデータビット 1 のピン
|
||||||
|
#define LCD_DATA2_PIN 6 //< 4ビットデータビット 2 のピン
|
||||||
|
#define LCD_DATA3_PIN 7 //< 4ビットデータビット 3 のピン
|
||||||
|
#define LCD_RS_PORT LCD_PORT //< RS 線のためのポート
|
||||||
|
#define LCD_RS_PIN 3 //< RS 線のためのピン
|
||||||
|
#define LCD_RW_PORT LCD_PORT //< RW 線のためのポート
|
||||||
|
#define LCD_RW_PIN 2 //< RW 線のためのピン
|
||||||
|
#define LCD_E_PORT LCD_PORT //< Enable 線のためのポート
|
||||||
|
#define LCD_E_PIN 1 //< Enable 線のためのピン
|
||||||
|
#endif
|
||||||
|
````
|
||||||
|
|
||||||
|
他のプロパティを設定する必要がある場合は、それらを `quantum/hd44780.h` からコピーし、`config.h` に設定することができます。(訳注)`quantum/hd44780.h` は `drivers/avr/hd44780.h` の間違いではないかと思われます。
|
||||||
|
|
||||||
|
## 使用法
|
||||||
|
|
||||||
|
ディスプレイを初期化するには、以下のパラメータのうちの1つを使って `lcd_init()` を呼び出します:
|
||||||
|
````
|
||||||
|
LCD_DISP_OFF : ディスプレイオフ
|
||||||
|
LCD_DISP_ON : ディスプレイオン、カーソルオフ
|
||||||
|
LCD_DISP_ON_CURSOR : ディスプレイオン、カーソルオン
|
||||||
|
LCD_DISP_ON_CURSOR_BLINK : ディスプレイオン、点滅カーソル
|
||||||
|
````
|
||||||
|
これはキーボードの `matrix_init_kb` またはキーマップの `matrix_init_user` で行うのが最適です。
|
||||||
|
使用前にディスプレイをクリアすることをお勧めします。
|
||||||
|
そのためには、`lcd_clrscr()` を呼びます。
|
||||||
|
|
||||||
|
ディスプレイに何かを表示するには、最初に `lcd_gotoxy(column, line)` を呼びます。最初の行の先頭に移動するには、`lcd_gotoxy(0, 0)` を呼び出し、その後 `lcd_puts("example string")` を使って文字列を出力します。
|
||||||
|
|
||||||
|
ディスプレイを制御することができる、より多くのメソッドがあります。[詳細なドキュメントについてはリンクされたページをご覧ください](http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html) (訳注)原文のリンク先のページは、サービスの終了に伴って削除されています。移行先は (http://www.peterfleury.epizy.com/doxygen/avr-gcc-libraries/group__pfleury__lcd.html) と思われます。
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
# キーロック
|
||||||
|
|
||||||
|
<!---
|
||||||
|
original document: 0.8.134:docs/feature_key_lock.md
|
||||||
|
git diff 0.8.134 HEAD -- docs/feature_key_lock.md | cat
|
||||||
|
-->
|
||||||
|
|
||||||
|
特定のキーを長時間押すことが必要になる場合があります。キーロックは次に押すキーを押したままにします。もう一度押すと、リリースされます。
|
||||||
|
|
||||||
|
いくつかの文を全て大文字で入力する必要があるとしましょう。`KC_LOCK` を押し、次にシフトを押します。これで、シフトは次にタップするまで押していると見なされます。キーロックを Caps Lock と考えることができますが、さらに強力です。
|
||||||
|
|
||||||
|
## 使用法
|
||||||
|
|
||||||
|
最初に `rules.mk` で `KEY_LOCK_ENABLE = yes` を設定することでキーロックを有効にします。次に、キーマップでキーを選択し、それをキーコード `KC_LOCK` に割り当てます。
|
||||||
|
|
||||||
|
## キーコード
|
||||||
|
|
||||||
|
| キーコード | 説明 |
|
||||||
|
|---------|--------------------------------------------------------------|
|
||||||
|
| `KC_LOCK` | キーが再び押されるまで次のキーを押したままにします。 |
|
||||||
|
|
||||||
|
## 注意事項
|
||||||
|
|
||||||
|
キーロックは、標準アクションキーと[ワンショットモディファイア](ja/one_shot_keys.md)キー (例えば、Shift を `OSM(KC_LSFT)` と定義した場合)のみを押し続けることができます。
|
||||||
|
これは、QMK の特殊機能(ワンショットモディファイアを除く)、または `KC_LPRN` のような shift を押されたキーのバージョンは含みません。[基本的なキーコード](ja/keycodes_basic.md)リストにある場合、押したままにすることができます。
|
||||||
|
|
||||||
|
レイヤーの切り替えは、キーロックを解除しません。
|
||||||
@@ -31,7 +31,6 @@ BOOTLOADER = atmel-dfu
|
|||||||
|
|
||||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
|
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (推奨の GUI)
|
||||||
* QMK の [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` (推奨のコマンドライン)
|
* QMK の [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer) / `:dfu` (推奨のコマンドライン)
|
||||||
* [Atmel の Flip](http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip) (非推奨)
|
|
||||||
|
|
||||||
書き込み手順:
|
書き込み手順:
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ Vagrant 以外に、適切なプロバイダがインストールされ、その
|
|||||||
|
|
||||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (推奨)
|
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (推奨)
|
||||||
* [Teensy ローダー](https://www.pjrc.com/teensy/loader.html)
|
* [Teensy ローダー](https://www.pjrc.com/teensy/loader.html)
|
||||||
* [Atmel FLIP](http://www.atmel.com/tools/flip.aspx)
|
|
||||||
|
|
||||||
コマンドラインでプログラムしたい場合は、Vagranfile の ['modifyvm'] 行のコメントを解除して Linux への USB パススルーを有効にし、dfu-util/dfu-programmer のようなコマンドラインツールを使ってプログラムすることができます。あるいは Teensy CLI バージョンをインストールすることができます。
|
コマンドラインでプログラムしたい場合は、Vagranfile の ['modifyvm'] 行のコメントを解除して Linux への USB パススルーを有効にし、dfu-util/dfu-programmer のようなコマンドラインツールを使ってプログラムすることができます。あるいは Teensy CLI バージョンをインストールすることができます。
|
||||||
|
|
||||||
|
|||||||
+7
-6
@@ -175,11 +175,11 @@ See also: [Basic Keycodes](keycodes_basic.md)
|
|||||||
|`KC_EXSEL` | |ExSel |
|
|`KC_EXSEL` | |ExSel |
|
||||||
|`KC_LCTRL` |`KC_LCTL` |Left Control |
|
|`KC_LCTRL` |`KC_LCTL` |Left Control |
|
||||||
|`KC_LSHIFT` |`KC_LSFT` |Left Shift |
|
|`KC_LSHIFT` |`KC_LSFT` |Left Shift |
|
||||||
|`KC_LALT` | |Left Alt |
|
|`KC_LALT` |`KC_LOPT` |Left Alt (Option) |
|
||||||
|`KC_LGUI` |`KC_LCMD`, `KC_LWIN` |Left GUI (Windows/Command/Meta key) |
|
|`KC_LGUI` |`KC_LCMD`, `KC_LWIN` |Left GUI (Windows/Command/Meta key) |
|
||||||
|`KC_RCTRL` |`KC_RCTL` |Right Control |
|
|`KC_RCTRL` |`KC_RCTL` |Right Control |
|
||||||
|`KC_RSHIFT` |`KC_RSFT` |Right Shift |
|
|`KC_RSHIFT` |`KC_RSFT` |Right Shift |
|
||||||
|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) |
|
|`KC_RALT` |`KC_ROPT`, `KC_ALGR` |Right Alt (Option/AltGr) |
|
||||||
|`KC_RGUI` |`KC_RCMD`, `KC_RWIN` |Right GUI (Windows/Command/Meta key) |
|
|`KC_RGUI` |`KC_RCMD`, `KC_RWIN` |Right GUI (Windows/Command/Meta key) |
|
||||||
|`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 |
|
||||||
@@ -378,11 +378,11 @@ See also: [Modifier Keys](feature_advanced_keycodes.md#modifier-keys)
|
|||||||
|----------|-------------------------------|----------------------------------------------------|
|
|----------|-------------------------------|----------------------------------------------------|
|
||||||
|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|
|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|
||||||
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|
||||||
|`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` |
|
|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` |
|
||||||
|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|
||||||
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
|`RCTL(kc)`| |Hold Right Control and press `kc` |
|
||||||
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
|`RSFT(kc)`| |Hold Right Shift and press `kc` |
|
||||||
|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` |
|
|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt and press `kc` |
|
||||||
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|
||||||
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|
||||||
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|
||||||
@@ -401,11 +401,11 @@ See also: [Mod-Tap](mod_tap.md)
|
|||||||
|`MT(mod, kc)`| |`mod` when held, `kc` when tapped |
|
|`MT(mod, kc)`| |`mod` when held, `kc` when tapped |
|
||||||
|`LCTL_T(kc)` |`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
|`LCTL_T(kc)` |`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||||
|`LSFT_T(kc)` |`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
|`LSFT_T(kc)` |`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||||
|`LALT_T(kc)` |`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
|`LALT_T(kc)` |`LOPT_T(kc)`, `ALT_T(kc)`, `OPT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||||
|`LGUI_T(kc)` |`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|
|`LGUI_T(kc)` |`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||||
|`RCTL_T(kc)` | |Right Control when held, `kc` when tapped |
|
|`RCTL_T(kc)` | |Right Control when held, `kc` when tapped |
|
||||||
|`RSFT_T(kc)` | |Right Shift when held, `kc` when tapped |
|
|`RSFT_T(kc)` | |Right Shift when held, `kc` when tapped |
|
||||||
|`RALT_T(kc)` |`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
|`RALT_T(kc)` |`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||||
|`RGUI_T(kc)` |`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
|`RGUI_T(kc)` |`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||||
|`SGUI_T(kc)` |`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
|`SGUI_T(kc)` |`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||||
@@ -531,6 +531,7 @@ See also: [Swap Hands](feature_swap_hands.md)
|
|||||||
|`SH_MOFF` |Momentarily turns off swap. |
|
|`SH_MOFF` |Momentarily turns off swap. |
|
||||||
|`SH_TG` |Toggles swap on and off with every key press. |
|
|`SH_TG` |Toggles swap on and off with every key press. |
|
||||||
|`SH_TT` |Toggles with a tap; momentary when held. |
|
|`SH_TT` |Toggles with a tap; momentary when held. |
|
||||||
|
|`SH_OS` |One shot swap hands: toggle while pressed or until next key press. |
|
||||||
|
|
||||||
## Unicode Support :id=unicode-support
|
## Unicode Support :id=unicode-support
|
||||||
|
|
||||||
|
|||||||
@@ -112,11 +112,11 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07
|
|||||||
|-----------|--------------------|------------------------------------|
|
|-----------|--------------------|------------------------------------|
|
||||||
|`KC_LCTRL` |`KC_LCTL` |Left Control |
|
|`KC_LCTRL` |`KC_LCTL` |Left Control |
|
||||||
|`KC_LSHIFT`|`KC_LSFT` |Left Shift |
|
|`KC_LSHIFT`|`KC_LSFT` |Left Shift |
|
||||||
|`KC_LALT` | |Left Alt |
|
|`KC_LALT` |`KC_LOPT` |Left Alt (Option) |
|
||||||
|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) |
|
|`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) |
|
||||||
|`KC_RCTRL` |`KC_RCTL` |Right Control |
|
|`KC_RCTRL` |`KC_RCTL` |Right Control |
|
||||||
|`KC_RSHIFT`|`KC_RSFT` |Right Shift |
|
|`KC_RSHIFT`|`KC_RSFT` |Right Shift |
|
||||||
|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) |
|
|`KC_RALT` |`KC_ROPT`, `KC_ALGR`|Right Alt (Option/AltGr) |
|
||||||
|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)|
|
|`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)|
|
||||||
|
|
||||||
## International
|
## International
|
||||||
|
|||||||
+15
-3
@@ -71,10 +71,22 @@ On the other hand, you can change `layer_state` to overlay the base layer with o
|
|||||||
|
|
||||||
|
|
||||||
### Layer Precedence and Transparency
|
### Layer Precedence and Transparency
|
||||||
Note that ***higher layer has higher priority on stack of layers***, namely firmware falls down from top layer to bottom to look up keycode. Once it spots keycode other than **`KC_TRNS`**(transparent) on a layer it stops searching and lower layers aren't referred.
|
Note that ***higher layers have higher priority within the stack of layers***. The firmware works its way down from the highest active layers to look up keycodes. Once the firmware locates a keycode other than `KC_TRNS` (transparent) on an active layer, it stops searching, and lower layers aren't referenced.
|
||||||
|
|
||||||
You can place `KC_TRANS` on overlay layer changes just part of layout to fall back on lower or base layer.
|
____________
|
||||||
Key with `KC_TRANS` (`KC_TRNS` and `_______` are the alias) doesn't has its own keycode and refers to lower valid layers for keycode, instead.
|
/ / <--- Higher layer
|
||||||
|
/ KC_TRNS //
|
||||||
|
/___________// <--- Lower layer (KC_A)
|
||||||
|
/___________/
|
||||||
|
|
||||||
|
In the above scenario, the non-transparent keys on the higher layer would be usable, but whenever `KC_TRNS` (or equivalent) is defined, the keycode (`KC_A`) on the lower level would be used.
|
||||||
|
|
||||||
|
**Note:** Valid ways to denote transparency on a given layer:
|
||||||
|
* `KC_TRANSPARENT`
|
||||||
|
* `KC_TRNS` (alias)
|
||||||
|
* `_______` (alias)
|
||||||
|
|
||||||
|
These keycodes allow the processing to fall through to lower layers in search of a non-transparent keycode to process.
|
||||||
|
|
||||||
## Anatomy of a `keymap.c`
|
## Anatomy of a `keymap.c`
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -31,11 +31,11 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations
|
|||||||
|------------|-----------------------------------------------------------------|-------------------------------------------------------|
|
|------------|-----------------------------------------------------------------|-------------------------------------------------------|
|
||||||
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|
||||||
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|
||||||
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|
|`LALT_T(kc)`|`LOPT_T(kc)`, `ALT_T(kc)`, `OPT_T(kc)` |Left Alt when held, `kc` when tapped |
|
||||||
|`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|
|`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|
||||||
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|
||||||
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|
||||||
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
|`RALT_T(kc)`|`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|
||||||
|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|
||||||
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|
||||||
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|
||||||
|
|||||||
@@ -66,9 +66,14 @@ After Homebrew is installed run these commands:
|
|||||||
|
|
||||||
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:
|
||||||
|
|
||||||
* Debian / Ubuntu / Devuan: `apt-get install git python3 && python3 -m pip install qmk`
|
* Debian / Ubuntu / Devuan: `sudo apt install git python3 python3-pip`
|
||||||
* Fedora / Red Hat / CentOS: `yum install git python3 && python3 -m pip install qmk`
|
* Fedora / Red Hat / CentOS: `sudo yum install git python3 python3-pip`
|
||||||
* Arch: `yay -S qmk` (or use any other AUR Helper)
|
* Arch / Manjaro: `sudo pacman -S git python python-pip python-setuptools libffi`
|
||||||
|
|
||||||
|
|
||||||
|
Install the global CLI to bootstrap your system:
|
||||||
|
|
||||||
|
`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`)
|
||||||
|
|
||||||
## 3. Run QMK Setup :id=set-up-qmk
|
## 3. Run QMK Setup :id=set-up-qmk
|
||||||
|
|
||||||
@@ -78,7 +83,13 @@ After installing QMK you can set it up with this command:
|
|||||||
|
|
||||||
In most situations you will want to answer Yes to all of the prompts.
|
In most situations you will want to answer Yes to all of the prompts.
|
||||||
|
|
||||||
?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>` to clone your personal fork. If you don't know what that means you can safely ignore this message.
|
?>**Note on Debian, Ubuntu and their derivatives**:
|
||||||
|
It's possible, that you will get an error saying something like: `bash: qmk: command not found`.
|
||||||
|
This is due to a [bug](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=839155) Debian introduced with their Bash 4.4 release, which removed `$HOME/.local/bin` from the PATH. This bug was later fixed on Debian and Ubuntu.
|
||||||
|
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`
|
||||||
|
|
||||||
|
?> 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
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
# Arm/ChibiOS Early Initialization :id=chibios-early-init
|
||||||
|
|
||||||
|
This page describes a part of QMK that is a somewhat advanced concept, and is only relevant to keyboard designers.
|
||||||
|
|
||||||
|
QMK uses ChibiOS as the underlying layer to support a multitude of Arm-based devices. Each ChibiOS-supported keyboard has a low-level board definition which is responsible for initializing hardware peripherals such as the clocks, and GPIOs.
|
||||||
|
|
||||||
|
Older QMK revisions required duplication of these board definitions inside your keyboard's directory in order to override such early initialization points; this is now abstracted into the following APIs, and allows usage of the board definitions supplied with ChibiOS itself. Check `<qmk_firmware>/lib/chibios/os/hal/boards` for the list of official definitions. If your keyboard needs extra initialization at a very early stage, consider providing keyboard-level overrides of the following APIs:
|
||||||
|
|
||||||
|
## `early_hardware_init_pre()` :id=early-hardware-init-pre
|
||||||
|
|
||||||
|
The function `early_hardware_init_pre` is the earliest possible code that can be executed by a keyboard firmware. This is intended as a replacement for the ChibiOS board definition's `__early_init` function, and is the equivalent of executing at the start of the function.
|
||||||
|
|
||||||
|
This is executed before RAM gets cleared, and before clocks or GPIOs are configured; any delays or preparation using GPIOs is not likely to work at this point. After executing this function, RAM on the MCU may be zero'ed. Assigning values to variables during execution of this function may be overwritten.
|
||||||
|
|
||||||
|
As such, if you wish to override this API consider limiting use to writing to low-level registers. The default implementation of this function can be configured to jump to bootloader if a `RESET` key was pressed, by ensuring `#define EARLY_INIT_PERFORM_BOOTLOADER_JUMP TRUE` is in the keyboard's `config.h` file.
|
||||||
|
|
||||||
|
To implement your own version of this function, in your keyboard's source files:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void early_hardware_init_pre(void) {
|
||||||
|
// do things with registers
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## `early_hardware_init_post()` :id=early-hardware-init-post
|
||||||
|
|
||||||
|
The function `early_hardware_init_post` is the next earliest possible code that can be executed by a keyboard firmware. This is executed after RAM has been cleared, and clocks and GPIOs are configured. This is intended as a replacement for the ChibiOS board definition's `__early_init` function, and is the equivalent of executing at the end of the function.
|
||||||
|
|
||||||
|
Much like `early_hardware_init_pre`, ChibiOS has not yet been initialized either, so the same restrictions on delays and timing apply.
|
||||||
|
|
||||||
|
If you wish to override this API, consider limiting functionality to register writes, variable initialization, and GPIO toggling. The default implementation of this function is to do nothing.
|
||||||
|
|
||||||
|
To implement your own version of this function, in your keyboard's source files:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void early_hardware_init_post(void) {
|
||||||
|
// toggle GPIO pins and write to variables
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## `board_init()` :id=board-init
|
||||||
|
|
||||||
|
The function `board_init` is executed directly after the ChibiOS initialization routines have completed. At this stage, all normal low-level functionality should be available for use (including timers and delays), with the restriction that USB is not yet connected. This is intended as a replacement for the ChibiOS board definition's `boardInit` function.
|
||||||
|
|
||||||
|
The default implementation of this function is to do nothing.
|
||||||
|
|
||||||
|
To implement your own version of this function, in your keyboard's source files:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void board_init(void) {
|
||||||
|
// initialize anything that requires ChibiOS
|
||||||
|
}
|
||||||
|
```
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
# Converting a board to use the Proton C
|
# Converting a board to use the Proton C
|
||||||
|
|
||||||
|
Since the Proton C is a drop-in replacement for a Pro Micro we've made it easy to use. This page documents a handy automated process for converting keyboards, as well as documenting the manual process if you'd like to make use of Proton C features that aren't available on Pro Micros.
|
||||||
|
|
||||||
|
## Automatic Conversion
|
||||||
|
|
||||||
If a board currently supported in QMK uses a Pro Micro (or compatible board) and you want to use the Proton C, you can generate the firmware by appending `CONVERT_TO_PROTON_C=yes` (or `CTPC=yes`) to your make argument, like this:
|
If a board currently supported in QMK uses a Pro Micro (or compatible board) and you want to use the Proton C, you can generate the firmware by appending `CONVERT_TO_PROTON_C=yes` (or `CTPC=yes`) to your make argument, like this:
|
||||||
|
|
||||||
make 40percentclub/mf68:default CTPC=yes
|
make 40percentclub/mf68:default CTPC=yes
|
||||||
@@ -8,13 +12,15 @@ You can add the same argument to your keymap's `rules.mk`, which will accomplish
|
|||||||
|
|
||||||
This exposes the `CONVERT_TO_PROTON_C` flag that you can use in your code with `#ifdef`s, like this:
|
This exposes the `CONVERT_TO_PROTON_C` flag that you can use in your code with `#ifdef`s, like this:
|
||||||
|
|
||||||
#ifdef CONVERT_TO_PROTON_C
|
```c
|
||||||
// Proton C code
|
#ifdef CONVERT_TO_PROTON_C
|
||||||
#else
|
// Proton C code
|
||||||
// Pro Micro code
|
#else
|
||||||
#endif
|
// Pro Micro code
|
||||||
|
#endif
|
||||||
|
```
|
||||||
|
|
||||||
Before being able to compile, you may get some errors about `PORTB/DDRB`, etc not being defined, so you'll need to convert the keyboard's code to use the [GPIO Controls](internals_gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all.
|
If you get errors about `PORTB/DDRB`, etc not being defined, so you'll need to convert the keyboard's code to use the [GPIO Controls](internals_gpio_control.md) that will work for both ARM and AVR. This shouldn't affect the AVR builds at all.
|
||||||
|
|
||||||
The Proton C only has one on-board LED (C13), and by default, the TXLED (D5) is mapped to it. If you want the RXLED (B0) mapped to it instead, add this like to your `config.h`:
|
The Proton C only has one on-board LED (C13), and by default, the TXLED (D5) is mapped to it. If you want the RXLED (B0) mapped to it instead, add this like to your `config.h`:
|
||||||
|
|
||||||
@@ -31,3 +37,54 @@ These are defaults based on what has been implemented for ARM boards.
|
|||||||
| [Backlight](feature_backlight.md) | Forces [task driven PWM](feature_backlight.md#software-pwm-driver) until ARM can provide automatic configuration |
|
| [Backlight](feature_backlight.md) | Forces [task driven PWM](feature_backlight.md#software-pwm-driver) until ARM can provide automatic configuration |
|
||||||
| USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) |
|
| USB Host (e.g. USB-USB converter) | Not supported (USB host code is AVR specific and is not currently supported on ARM) |
|
||||||
| [Split keyboards](feature_split_keyboard.md) | Not supported yet |
|
| [Split keyboards](feature_split_keyboard.md) | Not supported yet |
|
||||||
|
|
||||||
|
## Manual Conversion
|
||||||
|
|
||||||
|
To use the Proton C natively, without having to specify `CTPC=yes`, you need to change the `MCU` line in `rules.mk`:
|
||||||
|
|
||||||
|
```
|
||||||
|
MCU = STM32F303
|
||||||
|
```
|
||||||
|
|
||||||
|
Remove these variables if they exist:
|
||||||
|
|
||||||
|
* `BOOTLOADER`
|
||||||
|
* `EXTRA_FLAGS`
|
||||||
|
|
||||||
|
Finally convert all pin assignments in `config.h` to the stm32 equivalents.
|
||||||
|
|
||||||
|
| Pro Micro Left | Proton C Left | | Proton C Right | Pro Micro Right |
|
||||||
|
|-----------|----------|-|----------|-----------|
|
||||||
|
| `D3` | `A9` | | 5v | RAW (5v) |
|
||||||
|
| `D2` | `A10` | | GND | GND |
|
||||||
|
| GND | GND | | FLASH | RESET |
|
||||||
|
| GND | GND | | 3.3v | VCC <sup>1</sup> |
|
||||||
|
| `D1` | `B7` | | `A2` | `F4` |
|
||||||
|
| `D0` | `B6` | | `A1` | `F5` |
|
||||||
|
| `D4` | `B5` | | `A0` | `F6` |
|
||||||
|
| `C6` | `B4` | | `B8` | `F7` |
|
||||||
|
| `D7` | `B3` | | `B13` | `B1` |
|
||||||
|
| `E6` | `B2` | | `B14` | `B3` |
|
||||||
|
| `B4` | `B1` | | `B15` | `B2` |
|
||||||
|
| `B5` | `B0` | | `B9` | `B6` |
|
||||||
|
| `B0` (RX LED) | `C13` <sup>2</sup> | | `C13` <sup>2</sup> | `D5` (TX LED) |
|
||||||
|
|
||||||
|
You can also make use of several new pins on the extended portion of the Proton C:
|
||||||
|
|
||||||
|
| Left | | Right |
|
||||||
|
|------|-|-------|
|
||||||
|
| `A4`<sup>3</sup> | | `B10` |
|
||||||
|
| `A5`<sup>4</sup> | | `B11` |
|
||||||
|
| `A6` | | `B12` |
|
||||||
|
| `A7` | | `A14`<sup>5</sup> (SWCLK) |
|
||||||
|
| `A8` | | `A13`<sup>5</sup> (SWDIO) |
|
||||||
|
| `A15` | | RESET<sup>6</sup> |
|
||||||
|
|
||||||
|
Notes:
|
||||||
|
|
||||||
|
1. On a Pro Micro VCC can be 3.3v or 5v.
|
||||||
|
2. A Proton C only has one onboard LED, not two like a Pro Micro. The Pro Micro has an RX LED on `D5` and a TX LED on `B0`.
|
||||||
|
3. `A4` is shared with the speaker.
|
||||||
|
4. `A5` is shared with the speaker.
|
||||||
|
5. `A13` and `A14` are used for hardware debugging (SWD). You can also use them for GPIO, but should use them last.
|
||||||
|
6. Short RESET to 3.3v (pull high) to reboot the MCU. This does not enter bootloader mode like a Pro Micro, it only resets the MCU.
|
||||||
@@ -8,7 +8,7 @@ There are actually separate functions that you can use there, depending on what
|
|||||||
|
|
||||||
### `update_tri_layer(x, y, z)`
|
### `update_tri_layer(x, y, z)`
|
||||||
|
|
||||||
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`.
|
The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it turns on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it turns off layer `z`.
|
||||||
|
|
||||||
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this.
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### `update_tri_layer_state(state, x, y, z)`
|
### `update_tri_layer_state(state, x, y, z)`
|
||||||
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from the [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check.
|
||||||
|
|
||||||
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it.
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ An IDE that is popular with many C developers.
|
|||||||
## Firmware
|
## Firmware
|
||||||
The software that controls your MCU.
|
The software that controls your MCU.
|
||||||
|
|
||||||
## FLIP
|
|
||||||
Software provided by Atmel for flashing AVR devices. We generally recommend [QMK Flasher](https://github.com/qmk/qmk_flasher) instead, but for some advanced use cases FLIP is required.
|
|
||||||
|
|
||||||
## git
|
## git
|
||||||
Versioning software used at the command line
|
Versioning software used at the command line
|
||||||
|
|
||||||
|
|||||||
+30
-20
@@ -16,9 +16,26 @@ No special setup is required - just connect the `SS`, `SCK`, `MOSI` and `MISO` p
|
|||||||
You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually.
|
You may use more than one slave select pin, not just the `SS` pin. This is useful when you have multiple devices connected and need to communicate with them individually.
|
||||||
`SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`.
|
`SPI_SS_PIN` can be passed to `spi_start()` to refer to `SS`.
|
||||||
|
|
||||||
## ARM Configuration
|
## ChibiOS/ARM Configuration
|
||||||
|
|
||||||
ARM support for this driver is not ready yet. Check back later!
|
You'll need to determine which pins can be used for SPI -- as an example, STM32 parts generally have multiple SPI peripherals, labeled SPI1, SPI2, SPI3 etc.
|
||||||
|
|
||||||
|
To enable SPI, modify your board's `halconf.h` to enable SPI - both `HAL_USE_SPI` and `SPI_USE_WAIT` should be `TRUE`, and `SPI_SELECT_MODE` should be `SPI_SELECT_MODE_PAD`.
|
||||||
|
Then, modify your board's `mcuconf.h` to enable the SPI peripheral you've chosen -- in the case of using SPI2, modify `STM32_SPI_USE_SPI2` to be `TRUE`.
|
||||||
|
|
||||||
|
As per the AVR configuration, you may select any other standard GPIO as a slave select pin, and can be supplied to `spi_start()`.
|
||||||
|
|
||||||
|
Configuration-wise, you'll need to set up the peripheral as per your MCU's datasheet -- the defaults match the pins for a Proton-C, i.e. STM32F303.
|
||||||
|
|
||||||
|
`config.h` override | Description | Default Value
|
||||||
|
----------------------------|---------------------------------------------------------------|--------------
|
||||||
|
`#define SPI_DRIVER` | SPI peripheral to use - SPI1 => `SPID1`, SPI2 => `SPID2` etc. | `SPID2`
|
||||||
|
`#define SPI_SCK_PIN` | The pin to use for the SCK | `B13`
|
||||||
|
`#define SPI_SCK_PAL_MODE` | The alternate function mode for the SCK pin | `5`
|
||||||
|
`#define SPI_MOSI_PIN` | The pin to use for the MOSI | `B15`
|
||||||
|
`#define SPI_MOSI_PAL_MODE` | The alternate function mode for the MOSI pin | `5`
|
||||||
|
`#define SPI_MISO_PIN` | The pin to use for the MISO | `B14`
|
||||||
|
`#define SPI_MISO_PAL_MODE` | The alternate function mode for the MISO pin | `5`
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
@@ -28,7 +45,7 @@ Initialize the SPI driver. This function must be called only once, before any of
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `void spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint8_t divisor)`
|
### `bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor)`
|
||||||
|
|
||||||
Start an SPI transaction.
|
Start an SPI transaction.
|
||||||
|
|
||||||
@@ -48,12 +65,16 @@ Start an SPI transaction.
|
|||||||
|`2` |Leading edge falling|Sample on leading edge |
|
|`2` |Leading edge falling|Sample on leading edge |
|
||||||
|`3` |Leading edge falling|Sample on trailing edge|
|
|`3` |Leading edge falling|Sample on trailing edge|
|
||||||
|
|
||||||
- `uint8_t divisor`
|
- `uint16_t divisor`
|
||||||
The SPI clock divisor, will be rounded up to the nearest power of two. This number can be calculated by dividing the MCU's clock speed by the desired SPI clock speed. For example, an MCU running at 8 MHz wanting to talk to an SPI device at 4 MHz would set the divisor to `2`.
|
The SPI clock divisor, will be rounded up to the nearest power of two. This number can be calculated by dividing the MCU's clock speed by the desired SPI clock speed. For example, an MCU running at 8 MHz wanting to talk to an SPI device at 4 MHz would set the divisor to `2`.
|
||||||
|
|
||||||
|
#### Return Value
|
||||||
|
|
||||||
|
`false` if the supplied parameters are invalid or the SPI peripheral is already in use, or `true`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `spi_status_t spi_write(uint8_t data, uint16_t timeout)`
|
### `spi_status_t spi_write(uint8_t data)`
|
||||||
|
|
||||||
Write a byte to the selected SPI device.
|
Write a byte to the selected SPI device.
|
||||||
|
|
||||||
@@ -61,8 +82,6 @@ Write a byte to the selected SPI device.
|
|||||||
|
|
||||||
- `uint8_t data`
|
- `uint8_t data`
|
||||||
The byte to write.
|
The byte to write.
|
||||||
- `uint16_t timeout`
|
|
||||||
The amount of time to wait, in milliseconds, before timing out.
|
|
||||||
|
|
||||||
#### Return Value
|
#### Return Value
|
||||||
|
|
||||||
@@ -70,22 +89,17 @@ Write a byte to the selected SPI device.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `spi_status_t spi_read(uint16_t timeout)`
|
### `spi_status_t spi_read(void)`
|
||||||
|
|
||||||
Read a byte from the selected SPI device.
|
Read a byte from the selected SPI device.
|
||||||
|
|
||||||
#### Arguments
|
|
||||||
|
|
||||||
- `uint16_t timeout`
|
|
||||||
The amount of time to wait, in milliseconds, before timing out.
|
|
||||||
|
|
||||||
#### Return Value
|
#### Return Value
|
||||||
|
|
||||||
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device.
|
`SPI_STATUS_TIMEOUT` if the timeout period elapses, or the byte read from the device.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length, uint16_t timeout)`
|
### `spi_status_t spi_transmit(const uint8_t *data, uint16_t length)`
|
||||||
|
|
||||||
Send multiple bytes to the selected SPI device.
|
Send multiple bytes to the selected SPI device.
|
||||||
|
|
||||||
@@ -95,8 +109,6 @@ Send multiple bytes to the selected SPI device.
|
|||||||
A pointer to the data to write from.
|
A pointer to the data to write from.
|
||||||
- `uint16_t length`
|
- `uint16_t length`
|
||||||
The number of bytes to write. Take care not to overrun the length of `data`.
|
The number of bytes to write. Take care not to overrun the length of `data`.
|
||||||
- `uint16_t timeout`
|
|
||||||
The amount of time to wait, in milliseconds, before timing out.
|
|
||||||
|
|
||||||
#### Return Value
|
#### Return Value
|
||||||
|
|
||||||
@@ -104,7 +116,7 @@ Send multiple bytes to the selected SPI device.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### `spi_status_t spi_receive(uint8_t *data, uint16_t length, uint16_t timeout)`
|
### `spi_status_t spi_receive(uint8_t *data, uint16_t length)`
|
||||||
|
|
||||||
Receive multiple bytes from the selected SPI device.
|
Receive multiple bytes from the selected SPI device.
|
||||||
|
|
||||||
@@ -114,12 +126,10 @@ Receive multiple bytes from the selected SPI device.
|
|||||||
A pointer to the buffer to read into.
|
A pointer to the buffer to read into.
|
||||||
- `uint16_t length`
|
- `uint16_t length`
|
||||||
The number of bytes to read. Take care not to overrun the length of `data`.
|
The number of bytes to read. Take care not to overrun the length of `data`.
|
||||||
- `uint16_t timeout`
|
|
||||||
The amount of time to wait, in milliseconds, before timing out.
|
|
||||||
|
|
||||||
#### Return Value
|
#### Return Value
|
||||||
|
|
||||||
`SPI_STATUS_TIMEOUT` if the timeout period elapses, `SPI_STATUS_SUCCESS` on success, or `SPI_STATUS_ERROR` otherwise.
|
`SPI_STATUS_TIMEOUT` if the internal transmission timeout period elapses, `SPI_STATUS_SUCCESS` on success, or `SPI_STATUS_ERROR` otherwise.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,70 @@
|
|||||||
|
# QMK Syllabus
|
||||||
|
|
||||||
|
This page helps you build up your QMK knowledge by introducing the basics first and guiding you to understanding all the concepts you need to know to be proficient with QMK.
|
||||||
|
|
||||||
|
# Beginning Topics
|
||||||
|
|
||||||
|
If you read nothing else you should read the documents in this section. After reading the [Tutorial](newbs.md) you should be able to create a basic keymap, compile it, and flash it to your keyboard. The remaining documents will flesh out your knowledge of these basics.
|
||||||
|
|
||||||
|
* **Learn How To Use QMK Tools**
|
||||||
|
* [Tutorial](newbs.md)
|
||||||
|
* [CLI](cli.md)
|
||||||
|
* [GIT](newbs_git_best_practices.md)
|
||||||
|
* **Learn About Keymaps**
|
||||||
|
* [Layers](feature_layers.md)
|
||||||
|
* [Keycodes](keycodes.md)
|
||||||
|
* The full list of keycodes you can use. Note that some may require knowledge found in the Intermediate or Advanced Topics.
|
||||||
|
* **Configuring IDEs** - Optional
|
||||||
|
* [Eclipse](other_eclipse.md)
|
||||||
|
* [VS Code](other_vscode.md)
|
||||||
|
|
||||||
|
# Intermediate Topics
|
||||||
|
|
||||||
|
These topics start to dig into some of the features that QMK supports. You don't have to read all of these documents, but some of the documents in the Advanced Topics section won't make sense if you skip over some of these.
|
||||||
|
|
||||||
|
* **Learn How To Configure Features**
|
||||||
|
<!-- * Configuration Overview FIXME(skullydazed/anyone): write this document -->
|
||||||
|
* [Audio](feature_audio.md)
|
||||||
|
* Lighting
|
||||||
|
* [Backlight](feature_backlight.md)
|
||||||
|
* [LED Matrix](feature_led_matrix.md)
|
||||||
|
* [RGB Lighting](feature_rgblight.md)
|
||||||
|
* [RGB Matrix](feature_rgb_matrix.md)
|
||||||
|
* [Tap-Hold Configuration](tap_hold.md)
|
||||||
|
* **Learn More About Keymaps**
|
||||||
|
* [Keymaps](keymap.md)
|
||||||
|
* [Custom Functions and Keycodes](custom_quantum_functions.md)
|
||||||
|
* Macros
|
||||||
|
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||||
|
* [Compiled Macros](feature_macros.md)
|
||||||
|
* [Tap Dance](feature_tap_dance.md)
|
||||||
|
* [Combos](feature_combo.md)
|
||||||
|
* [Userspace](feature_userspace.md)
|
||||||
|
|
||||||
|
# Advanced Topics
|
||||||
|
|
||||||
|
Everything below here requires a lot of foundational knowledge. Besides being able to create keymaps using advanced features you should be familiar with using both `config.h` and `rules.mk` to configure options for your keyboard.
|
||||||
|
|
||||||
|
* **Maintaining Keyboards Within QMK**
|
||||||
|
* [Handwiring a Keyboard](hand_wire.md)
|
||||||
|
* [Keyboard Guidelines](hardware_keyboard_guidelines.md)
|
||||||
|
* [info.json Reference](reference_info_json.md)
|
||||||
|
* [Debounce API](feature_debounce_type.md)
|
||||||
|
* **Advanced Features**
|
||||||
|
* [Unicode](feature_unicode.md)
|
||||||
|
* [API](api_overview.md)
|
||||||
|
* [Bootmagic](feature_bootmagic.md)
|
||||||
|
* **Hardware**
|
||||||
|
* [How Keyboards Work](how_keyboards_work.md)
|
||||||
|
* [How A Keyboard Matrix Works](how_a_matrix_works.md)
|
||||||
|
* [Split Keyboards](feature_split_keyboard.md)
|
||||||
|
* [Stenography](feature_stenography.md)
|
||||||
|
* [Pointing Devices](feature_pointing_device.md)
|
||||||
|
* **Core Development**
|
||||||
|
* [Coding Conventions](coding_conventions_c.md)
|
||||||
|
* [Compatible Microcontrollers](compatible_microcontrollers.md)
|
||||||
|
* [Custom Matrix](custom_matrix.md)
|
||||||
|
* [Understanding QMK](understanding_qmk.md)
|
||||||
|
* **CLI Development**
|
||||||
|
* [Coding Conventions](coding_conventions_python.md)
|
||||||
|
* [CLI Development Overview](cli_development.md)
|
||||||
+2
-2
@@ -12,7 +12,7 @@ As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new
|
|||||||
#define PERMISSIVE_HOLD
|
#define PERMISSIVE_HOLD
|
||||||
```
|
```
|
||||||
|
|
||||||
This makes tap and hold keys (like Mod Tap) work better for fast typist, or for high `TAPPING_TERM` settings.
|
This makes tap and hold keys (like Mod Tap) work better for fast typists, or for high `TAPPING_TERM` settings.
|
||||||
|
|
||||||
If you press a Mod Tap key, tap another key (press and release) and then release the Mod Tap key, all within the tapping term, it will output the "tapping" function for both keys.
|
If you press a Mod Tap key, tap another key (press and release) and then release the Mod Tap key, all within the tapping term, it will output the "tapping" function for both keys.
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ To enable this setting, add this to your `config.h`:
|
|||||||
#define IGNORE_MOD_TAP_INTERRUPT
|
#define IGNORE_MOD_TAP_INTERRUPT
|
||||||
```
|
```
|
||||||
|
|
||||||
Similar to Permissive Hold, this alters how the firmware processes input for fast typist. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys.
|
Similar to Permissive Hold, this alters how the firmware processes inputs for fast typists. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys.
|
||||||
|
|
||||||
Setting `Ignore Mod Tap Interrupt` requires holding both keys for the `TAPPING_TERM` to trigger the hold function (the mod).
|
Setting `Ignore Mod Tap Interrupt` requires holding both keys for the `TAPPING_TERM` to trigger the hold function (the mod).
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ In that model you would emulate the input, and expect a certain output from the
|
|||||||
|
|
||||||
# Tracing Variables :id=tracing-variables
|
# Tracing Variables :id=tracing-variables
|
||||||
|
|
||||||
Sometimes you might wonder why a variable gets changed and where, and this can be quite tricky to track down without having a debugger. It's of course possible to manually add print statements to track it, but you can also enable the variable trace feature. This works for both for variables that are changed by the code, and when the variable is changed by some memory corruption.
|
Sometimes you might wonder why a variable gets changed and where, and this can be quite tricky to track down without having a debugger. It's of course possible to manually add print statements to track it, but you can also enable the variable trace feature. This works for both variables that are changed by the code, and when the variable is changed by some memory corruption.
|
||||||
|
|
||||||
To take the feature into use add `VARIABLE_TRACE=x` to the end of you make command. `x` represents the number of variables you want to trace, which is usually 1.
|
To take the feature into use add `VARIABLE_TRACE=x` to the end of you make command. `x` represents the number of variables you want to trace, which is usually 1.
|
||||||
|
|
||||||
|
|||||||
@@ -139,10 +139,3 @@ https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
|
|||||||
|
|
||||||
https://github.com/tmk/tmk_keyboard/issues/266
|
https://github.com/tmk/tmk_keyboard/issues/266
|
||||||
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## FLIP 不工作
|
|
||||||
### `AtLibUsbDfu.dll` 未找到
|
|
||||||
从设备管理器中删除当前驱动程序并在设备管理器重新安装一个FLIP提供的程序。
|
|
||||||
http://imgur.com/a/bnwzy
|
|
||||||
@@ -46,9 +46,6 @@ Français (法国)标准键盘布局。用键盘的前六个字母命名。
|
|||||||
## Firmware(固件)
|
## Firmware(固件)
|
||||||
用来控制单片机的软件。
|
用来控制单片机的软件。
|
||||||
|
|
||||||
## FLIP
|
|
||||||
爱特梅尔(Atmel)提供的AVR器件刷写软件。我们一般推荐 [QMK刷写工具](https://github.com/qmk/qmk_flasher),但是对于一些高级用例,需要FLIP。
|
|
||||||
|
|
||||||
## git
|
## git
|
||||||
命令行版本控制软件
|
命令行版本控制软件
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
tmk_core/protocol
|
tmk_core/protocol
|
||||||
tmk_core/protocol/bluefruit
|
|
||||||
tmk_core/protocol/chibios
|
tmk_core/protocol/chibios
|
||||||
tmk_core/protocol/iwrap
|
tmk_core/protocol/iwrap
|
||||||
tmk_core/protocol/lufa
|
tmk_core/protocol/lufa
|
||||||
|
|||||||
@@ -30,8 +30,8 @@
|
|||||||
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 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) {
|
void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) {
|
||||||
pinMode(RGB_DI_PIN, PinDirectionOutput);
|
setPinOutput(RGB_DI_PIN);
|
||||||
pinMode(RGB_CLK_PIN, PinDirectionOutput);
|
setPinOutput(RGB_CLK_PIN);
|
||||||
|
|
||||||
apa102_send_array((uint8_t *)ledarray, leds)
|
apa102_send_array((uint8_t *)ledarray, leds)
|
||||||
}
|
}
|
||||||
@@ -90,7 +90,7 @@ void apa102_end_frame(uint16_t leds) {
|
|||||||
void apa102_send_byte(uint8_t byte) {
|
void apa102_send_byte(uint8_t byte) {
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
digitalWrite(RGB_DI_PIN, !!(byte & (1 << (7-i)));
|
writePin(RGB_DI_PIN, !!(byte & (1 << (7 - i))));
|
||||||
digitalWrite(RGB_CLK_PIN, PinLevelHigh);
|
writePinHigh(RGB_CLK_PIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+72
-59
@@ -34,6 +34,10 @@
|
|||||||
# define SPI_MISO_PIN B4
|
# define SPI_MISO_PIN B4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_TIMEOUT
|
||||||
|
# define SPI_TIMEOUT 100
|
||||||
|
#endif
|
||||||
|
|
||||||
static pin_t currentSlavePin = NO_PIN;
|
static pin_t currentSlavePin = NO_PIN;
|
||||||
static uint8_t currentSlaveConfig = 0;
|
static uint8_t currentSlaveConfig = 0;
|
||||||
static bool currentSlave2X = false;
|
static bool currentSlave2X = false;
|
||||||
@@ -47,65 +51,74 @@ void spi_init(void) {
|
|||||||
SPCR = (_BV(SPE) | _BV(MSTR));
|
SPCR = (_BV(SPE) | _BV(MSTR));
|
||||||
}
|
}
|
||||||
|
|
||||||
void spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint8_t divisor) {
|
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
||||||
if (currentSlavePin == NO_PIN && slavePin != NO_PIN) {
|
if (currentSlavePin != NO_PIN || slavePin == NO_PIN) {
|
||||||
if (lsbFirst) {
|
return false;
|
||||||
currentSlaveConfig |= _BV(DORD);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (mode) {
|
|
||||||
case 1:
|
|
||||||
currentSlaveConfig |= _BV(CPHA);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
currentSlaveConfig |= _BV(CPOL);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
currentSlaveConfig |= (_BV(CPOL) | _BV(CPHA));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint8_t roundedDivisor = 1;
|
|
||||||
while (roundedDivisor < divisor) {
|
|
||||||
roundedDivisor <<= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (roundedDivisor) {
|
|
||||||
case 16:
|
|
||||||
currentSlaveConfig |= _BV(SPR0);
|
|
||||||
break;
|
|
||||||
case 64:
|
|
||||||
currentSlaveConfig |= _BV(SPR1);
|
|
||||||
break;
|
|
||||||
case 128:
|
|
||||||
currentSlaveConfig |= (_BV(SPR1) | _BV(SPR0));
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
currentSlave2X = true;
|
|
||||||
break;
|
|
||||||
case 8:
|
|
||||||
currentSlave2X = true;
|
|
||||||
currentSlaveConfig |= _BV(SPR0);
|
|
||||||
break;
|
|
||||||
case 32:
|
|
||||||
currentSlave2X = true;
|
|
||||||
currentSlaveConfig |= _BV(SPR1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
SPSR |= currentSlaveConfig;
|
|
||||||
currentSlavePin = slavePin;
|
|
||||||
setPinOutput(currentSlavePin);
|
|
||||||
writePinLow(currentSlavePin);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentSlaveConfig = 0;
|
||||||
|
|
||||||
|
if (lsbFirst) {
|
||||||
|
currentSlaveConfig |= _BV(DORD);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case 1:
|
||||||
|
currentSlaveConfig |= _BV(CPHA);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
currentSlaveConfig |= _BV(CPOL);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
currentSlaveConfig |= (_BV(CPOL) | _BV(CPHA));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t roundedDivisor = 1;
|
||||||
|
while (roundedDivisor < divisor) {
|
||||||
|
roundedDivisor <<= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (roundedDivisor) {
|
||||||
|
case 16:
|
||||||
|
currentSlaveConfig |= _BV(SPR0);
|
||||||
|
break;
|
||||||
|
case 64:
|
||||||
|
currentSlaveConfig |= _BV(SPR1);
|
||||||
|
break;
|
||||||
|
case 128:
|
||||||
|
currentSlaveConfig |= (_BV(SPR1) | _BV(SPR0));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
currentSlave2X = true;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
currentSlave2X = true;
|
||||||
|
currentSlaveConfig |= _BV(SPR0);
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
currentSlave2X = true;
|
||||||
|
currentSlaveConfig |= _BV(SPR1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
SPCR |= currentSlaveConfig;
|
||||||
|
if (currentSlave2X) {
|
||||||
|
SPSR |= _BV(SPI2X);
|
||||||
|
}
|
||||||
|
currentSlavePin = slavePin;
|
||||||
|
setPinOutput(currentSlavePin);
|
||||||
|
writePinLow(currentSlavePin);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_write(uint8_t data, uint16_t timeout) {
|
spi_status_t spi_write(uint8_t data) {
|
||||||
SPDR = data;
|
SPDR = data;
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while (!(SPSR & _BV(SPIF))) {
|
while (!(SPSR & _BV(SPIF))) {
|
||||||
if ((timeout != SPI_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
if ((timer_read() - timeout_timer) >= SPI_TIMEOUT) {
|
||||||
return SPI_STATUS_TIMEOUT;
|
return SPI_STATUS_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,12 +126,12 @@ spi_status_t spi_write(uint8_t data, uint16_t timeout) {
|
|||||||
return SPDR;
|
return SPDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_read(uint16_t timeout) {
|
spi_status_t spi_read() {
|
||||||
SPDR = 0x00; // Dummy
|
SPDR = 0x00; // Dummy
|
||||||
|
|
||||||
uint16_t timeout_timer = timer_read();
|
uint16_t timeout_timer = timer_read();
|
||||||
while (!(SPSR & _BV(SPIF))) {
|
while (!(SPSR & _BV(SPIF))) {
|
||||||
if ((timeout != SPI_TIMEOUT_INFINITE) && ((timer_read() - timeout_timer) >= timeout)) {
|
if ((timer_read() - timeout_timer) >= SPI_TIMEOUT) {
|
||||||
return SPI_STATUS_TIMEOUT;
|
return SPI_STATUS_TIMEOUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,21 +139,21 @@ spi_status_t spi_read(uint16_t timeout) {
|
|||||||
return SPDR;
|
return SPDR;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_transmit(const uint8_t *data, uint16_t length, uint16_t timeout) {
|
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
||||||
spi_status_t status = SPI_STATUS_ERROR;
|
spi_status_t status = SPI_STATUS_ERROR;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = spi_write(data[i], timeout);
|
status = spi_write(data[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_status_t spi_receive(uint8_t *data, uint16_t length, uint16_t timeout) {
|
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
||||||
spi_status_t status = SPI_STATUS_ERROR;
|
spi_status_t status = SPI_STATUS_ERROR;
|
||||||
|
|
||||||
for (uint16_t i = 0; i < length; i++) {
|
for (uint16_t i = 0; i < length; i++) {
|
||||||
status = spi_read(timeout);
|
status = spi_read();
|
||||||
|
|
||||||
if (status > 0) {
|
if (status > 0) {
|
||||||
data[i] = status;
|
data[i] = status;
|
||||||
@@ -155,9 +168,9 @@ void spi_stop(void) {
|
|||||||
setPinOutput(currentSlavePin);
|
setPinOutput(currentSlavePin);
|
||||||
writePinHigh(currentSlavePin);
|
writePinHigh(currentSlavePin);
|
||||||
currentSlavePin = NO_PIN;
|
currentSlavePin = NO_PIN;
|
||||||
|
SPSR &= ~(_BV(SPI2X));
|
||||||
SPCR &= ~(currentSlaveConfig);
|
SPCR &= ~(currentSlaveConfig);
|
||||||
currentSlaveConfig = 0;
|
currentSlaveConfig = 0;
|
||||||
SPSR = 0;
|
|
||||||
currentSlave2X = false;
|
currentSlave2X = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -41,15 +41,15 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
void spi_init(void);
|
void spi_init(void);
|
||||||
|
|
||||||
void spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint8_t divisor);
|
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor);
|
||||||
|
|
||||||
spi_status_t spi_write(uint8_t data, uint16_t timeout);
|
spi_status_t spi_write(uint8_t data);
|
||||||
|
|
||||||
spi_status_t spi_read(uint16_t timeout);
|
spi_status_t spi_read(void);
|
||||||
|
|
||||||
spi_status_t spi_transmit(const uint8_t *data, uint16_t length, uint16_t timeout);
|
spi_status_t spi_transmit(const uint8_t *data, uint16_t length);
|
||||||
|
|
||||||
spi_status_t spi_receive(uint8_t *data, uint16_t length, uint16_t timeout);
|
spi_status_t spi_receive(uint8_t *data, uint16_t length);
|
||||||
|
|
||||||
void spi_stop(void);
|
void spi_stop(void);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "pincontrol.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
enum ssd1306_cmds {
|
enum ssd1306_cmds {
|
||||||
|
|||||||
@@ -0,0 +1,137 @@
|
|||||||
|
/* Copyright 2020 Nick Brassel (tzarc)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "spi_master.h"
|
||||||
|
#include "quantum.h"
|
||||||
|
#include "timer.h"
|
||||||
|
|
||||||
|
static pin_t currentSlavePin = NO_PIN;
|
||||||
|
static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};
|
||||||
|
|
||||||
|
__attribute__((weak)) void spi_init(void) {
|
||||||
|
// Try releasing special pins for a short time
|
||||||
|
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_INPUT);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_INPUT);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_INPUT);
|
||||||
|
|
||||||
|
chThdSleepMilliseconds(10);
|
||||||
|
#if defined(USE_GPIOV1)
|
||||||
|
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||||
|
#else
|
||||||
|
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||||
|
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_ALTERNATE(SPI_MISO_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
||||||
|
if (currentSlavePin != NO_PIN || slavePin == NO_PIN) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16_t roundedDivisor = 2;
|
||||||
|
while (roundedDivisor < divisor) {
|
||||||
|
roundedDivisor <<= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (roundedDivisor < 2 || roundedDivisor > 256) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
spiConfig.cr1 = 0;
|
||||||
|
|
||||||
|
if (lsbFirst) {
|
||||||
|
spiConfig.cr1 |= SPI_CR1_LSBFIRST;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case 0:
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_CPHA;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_CPOL;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_CPHA | SPI_CR1_CPOL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (roundedDivisor) {
|
||||||
|
case 2:
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_0;
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_1;
|
||||||
|
break;
|
||||||
|
case 16:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_1 | SPI_CR1_BR_0;
|
||||||
|
break;
|
||||||
|
case 32:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_2;
|
||||||
|
break;
|
||||||
|
case 64:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_0;
|
||||||
|
break;
|
||||||
|
case 128:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_1;
|
||||||
|
break;
|
||||||
|
case 256:
|
||||||
|
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentSlavePin = slavePin;
|
||||||
|
spiConfig.ssport = PAL_PORT(slavePin);
|
||||||
|
spiConfig.sspad = PAL_PAD(slavePin);
|
||||||
|
|
||||||
|
setPinOutput(slavePin);
|
||||||
|
spiStart(&SPI_DRIVER, &spiConfig);
|
||||||
|
spiSelect(&SPI_DRIVER);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_status_t spi_write(uint8_t data) { return spi_transmit(&data, 1); }
|
||||||
|
|
||||||
|
spi_status_t spi_read(void) {
|
||||||
|
uint8_t data = 0;
|
||||||
|
spi_receive(&data, 1);
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_status_t spi_transmit(const uint8_t *data, uint16_t length) {
|
||||||
|
spiSend(&SPI_DRIVER, length, data);
|
||||||
|
return SPI_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_status_t spi_receive(uint8_t *data, uint16_t length) {
|
||||||
|
spiReceive(&SPI_DRIVER, length, data);
|
||||||
|
return SPI_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
void spi_stop(void) {
|
||||||
|
if (currentSlavePin != NO_PIN) {
|
||||||
|
spiUnselect(&SPI_DRIVER);
|
||||||
|
spiStop(&SPI_DRIVER);
|
||||||
|
currentSlavePin = NO_PIN;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/* Copyright 2020 Nick Brassel (tzarc)
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <ch.h>
|
||||||
|
#include <hal.h>
|
||||||
|
#include <quantum.h>
|
||||||
|
|
||||||
|
#ifndef SPI_DRIVER
|
||||||
|
# define SPI_DRIVER SPID2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_SCK_PIN
|
||||||
|
# define SPI_SCK_PIN B13
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_SCK_PAL_MODE
|
||||||
|
# define SPI_SCK_PAL_MODE 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_MOSI_PIN
|
||||||
|
# define SPI_MOSI_PIN B15
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_MOSI_PAL_MODE
|
||||||
|
# define SPI_MOSI_PAL_MODE 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_MISO_PIN
|
||||||
|
# define SPI_MISO_PIN B14
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef SPI_MISO_PAL_MODE
|
||||||
|
# define SPI_MISO_PAL_MODE 5
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int16_t spi_status_t;
|
||||||
|
|
||||||
|
#define SPI_STATUS_SUCCESS (0)
|
||||||
|
#define SPI_STATUS_ERROR (-1)
|
||||||
|
#define SPI_STATUS_TIMEOUT (-2)
|
||||||
|
|
||||||
|
#define SPI_TIMEOUT_IMMEDIATE (0)
|
||||||
|
#define SPI_TIMEOUT_INFINITE (0xFFFF)
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
void spi_init(void);
|
||||||
|
|
||||||
|
bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor);
|
||||||
|
|
||||||
|
spi_status_t spi_write(uint8_t data);
|
||||||
|
|
||||||
|
spi_status_t spi_read(void);
|
||||||
|
|
||||||
|
spi_status_t spi_transmit(const uint8_t *data, uint16_t length);
|
||||||
|
|
||||||
|
spi_status_t spi_receive(uint8_t *data, uint16_t length);
|
||||||
|
|
||||||
|
void spi_stop(void);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
@@ -20,19 +20,19 @@
|
|||||||
#include "eeprom_driver.h"
|
#include "eeprom_driver.h"
|
||||||
|
|
||||||
uint8_t eeprom_read_byte(const uint8_t *addr) {
|
uint8_t eeprom_read_byte(const uint8_t *addr) {
|
||||||
uint8_t ret;
|
uint8_t ret = 0;
|
||||||
eeprom_read_block(&ret, addr, 1);
|
eeprom_read_block(&ret, addr, 1);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16_t eeprom_read_word(const uint16_t *addr) {
|
uint16_t eeprom_read_word(const uint16_t *addr) {
|
||||||
uint16_t ret;
|
uint16_t ret = 0;
|
||||||
eeprom_read_block(&ret, addr, 2);
|
eeprom_read_block(&ret, addr, 2);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t eeprom_read_dword(const uint32_t *addr) {
|
uint32_t eeprom_read_dword(const uint32_t *addr) {
|
||||||
uint32_t ret;
|
uint32_t ret = 0;
|
||||||
eeprom_read_block(&ret, addr, 4);
|
eeprom_read_block(&ret, addr, 4);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-11
@@ -50,7 +50,7 @@ static inline void init_i2c_if_required(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline void fill_target_address(uint8_t *buffer, const void *addr) {
|
static inline void fill_target_address(uint8_t *buffer, const void *addr) {
|
||||||
intptr_t p = (intptr_t)addr;
|
uintptr_t p = (uintptr_t)addr;
|
||||||
for (int i = 0; i < EXTERNAL_EEPROM_ADDRESS_SIZE; ++i) {
|
for (int i = 0; i < EXTERNAL_EEPROM_ADDRESS_SIZE; ++i) {
|
||||||
buffer[EXTERNAL_EEPROM_ADDRESS_SIZE - 1 - i] = p & 0xFF;
|
buffer[EXTERNAL_EEPROM_ADDRESS_SIZE - 1 - i] = p & 0xFF;
|
||||||
p >>= 8;
|
p >>= 8;
|
||||||
@@ -60,11 +60,19 @@ static inline void fill_target_address(uint8_t *buffer, const void *addr) {
|
|||||||
void eeprom_driver_init(void) {}
|
void eeprom_driver_init(void) {}
|
||||||
|
|
||||||
void eeprom_driver_erase(void) {
|
void eeprom_driver_erase(void) {
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
uint32_t start = timer_read32();
|
||||||
|
#endif
|
||||||
|
|
||||||
uint8_t buf[EXTERNAL_EEPROM_PAGE_SIZE];
|
uint8_t buf[EXTERNAL_EEPROM_PAGE_SIZE];
|
||||||
memset(buf, 0x00, EXTERNAL_EEPROM_PAGE_SIZE);
|
memset(buf, 0x00, EXTERNAL_EEPROM_PAGE_SIZE);
|
||||||
for (intptr_t addr = 0; addr < EXTERNAL_EEPROM_BYTE_COUNT; addr += EXTERNAL_EEPROM_PAGE_SIZE) {
|
for (uint32_t addr = 0; addr < EXTERNAL_EEPROM_BYTE_COUNT; addr += EXTERNAL_EEPROM_PAGE_SIZE) {
|
||||||
eeprom_write_block(buf, (void *)addr, EXTERNAL_EEPROM_PAGE_SIZE);
|
eeprom_write_block(buf, (void *)(uintptr_t)addr, EXTERNAL_EEPROM_PAGE_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
dprintf("EEPROM erase took %ldms to complete\n", ((long)(timer_read32() - start)));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
||||||
@@ -72,8 +80,8 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
|||||||
fill_target_address(complete_packet, addr);
|
fill_target_address(complete_packet, addr);
|
||||||
|
|
||||||
init_i2c_if_required();
|
init_i2c_if_required();
|
||||||
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((intptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE, 100);
|
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE, 100);
|
||||||
i2c_receive(EXTERNAL_EEPROM_I2C_ADDRESS((intptr_t)addr), buf, len, 100);
|
i2c_receive(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), buf, len, 100);
|
||||||
|
|
||||||
#ifdef DEBUG_EEPROM_OUTPUT
|
#ifdef DEBUG_EEPROM_OUTPUT
|
||||||
dprintf("[EEPROM R] 0x%04X: ", ((int)addr));
|
dprintf("[EEPROM R] 0x%04X: ", ((int)addr));
|
||||||
@@ -85,14 +93,14 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||||
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE + EXTERNAL_EEPROM_PAGE_SIZE];
|
uint8_t complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE + EXTERNAL_EEPROM_PAGE_SIZE];
|
||||||
uint8_t *read_buf = (uint8_t *)buf;
|
uint8_t * read_buf = (uint8_t *)buf;
|
||||||
intptr_t target_addr = (intptr_t)addr;
|
uintptr_t target_addr = (uintptr_t)addr;
|
||||||
|
|
||||||
init_i2c_if_required();
|
init_i2c_if_required();
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
intptr_t page_offset = target_addr % EXTERNAL_EEPROM_PAGE_SIZE;
|
uintptr_t page_offset = target_addr % EXTERNAL_EEPROM_PAGE_SIZE;
|
||||||
int write_length = EXTERNAL_EEPROM_PAGE_SIZE - page_offset;
|
int write_length = EXTERNAL_EEPROM_PAGE_SIZE - page_offset;
|
||||||
if (write_length > len) {
|
if (write_length > len) {
|
||||||
write_length = len;
|
write_length = len;
|
||||||
}
|
}
|
||||||
@@ -110,7 +118,7 @@ void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
|||||||
dprintf("\n");
|
dprintf("\n");
|
||||||
#endif // DEBUG_EEPROM_OUTPUT
|
#endif // DEBUG_EEPROM_OUTPUT
|
||||||
|
|
||||||
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((intptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE + write_length, 100);
|
i2c_transmit(EXTERNAL_EEPROM_I2C_ADDRESS((uintptr_t)addr), complete_packet, EXTERNAL_EEPROM_ADDRESS_SIZE + write_length, 100);
|
||||||
wait_ms(EXTERNAL_EEPROM_WRITE_TIME);
|
wait_ms(EXTERNAL_EEPROM_WRITE_TIME);
|
||||||
|
|
||||||
read_buf += write_length;
|
read_buf += write_length;
|
||||||
|
|||||||
@@ -0,0 +1,231 @@
|
|||||||
|
/* Copyright 2020 Nick Brassel (tzarc)
|
||||||
|
*
|
||||||
|
* 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 <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
Note that the implementations of eeprom_XXXX_YYYY on AVR are normally
|
||||||
|
provided by avr-libc. The same functions are reimplemented below and are
|
||||||
|
rerouted to the external SPI equivalent.
|
||||||
|
|
||||||
|
Seemingly, as this is compiled from within QMK, the object file generated
|
||||||
|
during the build overrides the avr-libc implementation during the linking
|
||||||
|
stage.
|
||||||
|
|
||||||
|
On other platforms such as ARM, there are no provided implementations, so
|
||||||
|
there is nothing to override during linkage.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "wait.h"
|
||||||
|
#include "spi_master.h"
|
||||||
|
#include "eeprom.h"
|
||||||
|
#include "eeprom_spi.h"
|
||||||
|
|
||||||
|
#define CMD_WREN 6
|
||||||
|
#define CMD_WRDI 4
|
||||||
|
#define CMD_RDSR 5
|
||||||
|
#define CMD_WRSR 1
|
||||||
|
#define CMD_READ 3
|
||||||
|
#define CMD_WRITE 2
|
||||||
|
|
||||||
|
#define SR_WIP 0x01
|
||||||
|
|
||||||
|
// #define DEBUG_EEPROM_OUTPUT
|
||||||
|
|
||||||
|
#ifndef EXTERNAL_EEPROM_SPI_TIMEOUT
|
||||||
|
# define EXTERNAL_EEPROM_SPI_TIMEOUT 100
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
# include "print.h"
|
||||||
|
#endif // CONSOLE_ENABLE
|
||||||
|
|
||||||
|
static void init_spi_if_required(void) {
|
||||||
|
static int done = 0;
|
||||||
|
if (!done) {
|
||||||
|
spi_init();
|
||||||
|
done = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool spi_eeprom_start(void) { return spi_start(EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN, EXTERNAL_EEPROM_SPI_LSBFIRST, EXTERNAL_EEPROM_SPI_MODE, EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR); }
|
||||||
|
|
||||||
|
static spi_status_t spi_eeprom_wait_while_busy(int timeout) {
|
||||||
|
uint32_t deadline = timer_read32() + timeout;
|
||||||
|
spi_status_t response;
|
||||||
|
do {
|
||||||
|
spi_write(CMD_RDSR);
|
||||||
|
response = spi_read();
|
||||||
|
if (timer_read32() >= deadline) {
|
||||||
|
return SPI_STATUS_TIMEOUT;
|
||||||
|
}
|
||||||
|
} while (response & SR_WIP);
|
||||||
|
return SPI_STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void spi_eeprom_transmit_address(uintptr_t addr) {
|
||||||
|
uint8_t buffer[EXTERNAL_EEPROM_ADDRESS_SIZE];
|
||||||
|
|
||||||
|
for (int i = 0; i < EXTERNAL_EEPROM_ADDRESS_SIZE; ++i) {
|
||||||
|
buffer[EXTERNAL_EEPROM_ADDRESS_SIZE - 1 - i] = addr & 0xFF;
|
||||||
|
addr >>= 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_transmit(buffer, EXTERNAL_EEPROM_ADDRESS_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
void eeprom_driver_init(void) {}
|
||||||
|
|
||||||
|
void eeprom_driver_erase(void) {
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
uint32_t start = timer_read32();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
uint8_t buf[EXTERNAL_EEPROM_PAGE_SIZE];
|
||||||
|
memset(buf, 0x00, EXTERNAL_EEPROM_PAGE_SIZE);
|
||||||
|
for (uint32_t addr = 0; addr < EXTERNAL_EEPROM_BYTE_COUNT; addr += EXTERNAL_EEPROM_PAGE_SIZE) {
|
||||||
|
eeprom_write_block(buf, (void *)(uintptr_t)addr, EXTERNAL_EEPROM_PAGE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef CONSOLE_ENABLE
|
||||||
|
dprintf("EEPROM erase took %ldms to complete\n", ((long)(timer_read32() - start)));
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeprom_read_block(void *buf, const void *addr, size_t len) {
|
||||||
|
init_spi_if_required();
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// Wait for the write-in-progress bit to be cleared
|
||||||
|
bool res = spi_eeprom_start();
|
||||||
|
if (!res) {
|
||||||
|
dprint("failed to start SPI for WIP check\n");
|
||||||
|
memset(buf, 0, len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_status_t response = spi_eeprom_wait_while_busy(EXTERNAL_EEPROM_SPI_TIMEOUT);
|
||||||
|
spi_stop();
|
||||||
|
if (response == SPI_STATUS_TIMEOUT) {
|
||||||
|
dprint("SPI timeout for WIP check\n");
|
||||||
|
memset(buf, 0, len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// Perform read
|
||||||
|
res = spi_eeprom_start();
|
||||||
|
if (!res) {
|
||||||
|
dprint("failed to start SPI for read\n");
|
||||||
|
memset(buf, 0, len);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_write(CMD_READ);
|
||||||
|
spi_eeprom_transmit_address((uintptr_t)addr);
|
||||||
|
spi_receive(buf, len);
|
||||||
|
|
||||||
|
#ifdef DEBUG_EEPROM_OUTPUT
|
||||||
|
dprintf("[EEPROM R] 0x%08lX: ", ((uint32_t)(uintptr_t)addr));
|
||||||
|
for (size_t i = 0; i < len; ++i) {
|
||||||
|
dprintf(" %02X", (int)(((uint8_t *)buf)[i]));
|
||||||
|
}
|
||||||
|
dprintf("\n");
|
||||||
|
#endif // DEBUG_EEPROM_OUTPUT
|
||||||
|
|
||||||
|
spi_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void eeprom_write_block(const void *buf, void *addr, size_t len) {
|
||||||
|
init_spi_if_required();
|
||||||
|
|
||||||
|
bool res;
|
||||||
|
uint8_t * read_buf = (uint8_t *)buf;
|
||||||
|
uintptr_t target_addr = (uintptr_t)addr;
|
||||||
|
|
||||||
|
while (len > 0) {
|
||||||
|
uintptr_t page_offset = target_addr % EXTERNAL_EEPROM_PAGE_SIZE;
|
||||||
|
int write_length = EXTERNAL_EEPROM_PAGE_SIZE - page_offset;
|
||||||
|
if (write_length > len) {
|
||||||
|
write_length = len;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// Wait for the write-in-progress bit to be cleared
|
||||||
|
res = spi_eeprom_start();
|
||||||
|
if (!res) {
|
||||||
|
dprint("failed to start SPI for WIP check\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_status_t response = spi_eeprom_wait_while_busy(EXTERNAL_EEPROM_SPI_TIMEOUT);
|
||||||
|
spi_stop();
|
||||||
|
if (response == SPI_STATUS_TIMEOUT) {
|
||||||
|
dprint("SPI timeout for WIP check\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// Enable writes
|
||||||
|
res = spi_eeprom_start();
|
||||||
|
if (!res) {
|
||||||
|
dprint("failed to start SPI for write-enable\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_write(CMD_WREN);
|
||||||
|
spi_stop();
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// Perform the write
|
||||||
|
res = spi_eeprom_start();
|
||||||
|
if (!res) {
|
||||||
|
dprint("failed to start SPI for write\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef DEBUG_EEPROM_OUTPUT
|
||||||
|
dprintf("[EEPROM W] 0x%08lX: ", ((uint32_t)(uintptr_t)target_addr));
|
||||||
|
for (size_t i = 0; i < write_length; i++) {
|
||||||
|
dprintf(" %02X", (int)(uint8_t)(read_buf[i]));
|
||||||
|
}
|
||||||
|
dprintf("\n");
|
||||||
|
#endif // DEBUG_EEPROM_OUTPUT
|
||||||
|
|
||||||
|
spi_write(CMD_WRITE);
|
||||||
|
spi_eeprom_transmit_address(target_addr);
|
||||||
|
spi_transmit(read_buf, write_length);
|
||||||
|
spi_stop();
|
||||||
|
|
||||||
|
read_buf += write_length;
|
||||||
|
target_addr += write_length;
|
||||||
|
len -= write_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// Disable writes
|
||||||
|
res = spi_eeprom_start();
|
||||||
|
if (!res) {
|
||||||
|
dprint("failed to start SPI for write-disable\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
spi_write(CMD_WRDI);
|
||||||
|
spi_stop();
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/* Copyright 2020 Nick Brassel (tzarc)
|
||||||
|
*
|
||||||
|
* 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
|
||||||
|
|
||||||
|
/*
|
||||||
|
The slave select pin of the EEPROM.
|
||||||
|
This needs to be a normal GPIO pin_t value, such as A7.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN
|
||||||
|
# error "No chip select pin defined -- missing EXTERNAL_EEPROM_SPI_SLAVE_SELECT_PIN"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
The clock divisor for SPI to ensure that the MCU is within the
|
||||||
|
specifications of the EEPROM chip. Generally this will be PCLK divided by
|
||||||
|
the intended divisor -- check your clock settings and the datasheet of
|
||||||
|
your EEPROM.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR
|
||||||
|
# ifdef __AVR__
|
||||||
|
# define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 8
|
||||||
|
# else
|
||||||
|
# define EXTERNAL_EEPROM_SPI_CLOCK_DIVISOR 64
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
The SPI mode to communicate with the EEPROM.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_SPI_MODE
|
||||||
|
# define EXTERNAL_EEPROM_SPI_MODE 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
Whether or not the SPI communication between the MCU and EEPROM should be
|
||||||
|
LSB-first.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_SPI_LSBFIRST
|
||||||
|
# define EXTERNAL_EEPROM_SPI_LSBFIRST false
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
The total size of the EEPROM, in bytes. The EEPROM datasheet will usually
|
||||||
|
specify this value in kbits, and will require conversion to bytes.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_BYTE_COUNT
|
||||||
|
# define EXTERNAL_EEPROM_BYTE_COUNT 8192
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
The page size in bytes of the EEPROM, as specified in the datasheet.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_PAGE_SIZE
|
||||||
|
# define EXTERNAL_EEPROM_PAGE_SIZE 32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
The address size in bytes of the EEPROM. For EEPROMs with <=256 bytes, this
|
||||||
|
will likely be 1. For EEPROMs >256 and <=65536, this will be 2. For EEPROMs
|
||||||
|
>65536, this will likely need to be 4.
|
||||||
|
|
||||||
|
As expected, consult the datasheet for specifics of your EEPROM.
|
||||||
|
*/
|
||||||
|
#ifndef EXTERNAL_EEPROM_ADDRESS_SIZE
|
||||||
|
# define EXTERNAL_EEPROM_ADDRESS_SIZE 2
|
||||||
|
#endif
|
||||||
@@ -479,7 +479,7 @@ void oled_write_ln_P(const char *data, bool invert) {
|
|||||||
void oled_write_raw_P(const char *data, uint16_t size) {
|
void oled_write_raw_P(const char *data, uint16_t size) {
|
||||||
if (size > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE;
|
if (size > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE;
|
||||||
for (uint16_t i = 0; i < size; i++) {
|
for (uint16_t i = 0; i < size; i++) {
|
||||||
uint8_t c = pgm_read_byte(++data);
|
uint8_t c = pgm_read_byte(data++);
|
||||||
if (oled_buffer[i] == c) continue;
|
if (oled_buffer[i] == c) continue;
|
||||||
oled_buffer[i] = c;
|
oled_buffer[i] = c;
|
||||||
oled_dirty |= (1 << (i / OLED_BLOCK_SIZE));
|
oled_dirty |= (1 << (i / OLED_BLOCK_SIZE));
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Time out one shot layers after 3 seconds
|
||||||
|
#define ONESHOT_TIMEOUT 3000
|
||||||
|
|
||||||
|
#define RGBLED_NUM 16
|
||||||
|
|
||||||
|
|
||||||
|
// Undef and redefine default brightness to half of 255
|
||||||
|
#undef RGBLIGHT_LIMIT_VAL
|
||||||
|
#define RGBLIGHT_LIMIT_VAL 128
|
||||||
|
|
||||||
|
#define TAPPING_TERM 200
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
uint16_t copy_paste_timer;
|
||||||
|
uint16_t enter_timer;
|
||||||
|
|
||||||
|
extern rgblight_config_t rgblight_config;
|
||||||
|
|
||||||
|
// Define custom keycodes
|
||||||
|
enum my_keycodes {
|
||||||
|
KC_CCCV = SAFE_RANGE,
|
||||||
|
KC_2ENTER
|
||||||
|
};
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
//Layer 0 - Base Layer (F13 to F24, and One Shot Layer 1,2,3,4)
|
||||||
|
[0] = LAYOUT_ortho_4x4(
|
||||||
|
KC_F13, KC_F14, KC_F15, KC_F16,
|
||||||
|
KC_F17, KC_CCCV, KC_F19, KC_F20,
|
||||||
|
KC_F21, KC_F22, KC_F23, KC_2ENTER,
|
||||||
|
OSL(1), OSL(2), OSL(3), TG(4) //Transparent to let you go between layers
|
||||||
|
),
|
||||||
|
|
||||||
|
[1] = LAYOUT_ortho_4x4(
|
||||||
|
LALT(KC_F13), LALT(KC_F14), LALT(KC_F15), LALT(KC_F16),
|
||||||
|
LALT(KC_F17), LALT(KC_F18), LALT(KC_F19), LALT(KC_F20),
|
||||||
|
LALT(KC_F21), LALT(KC_F22), LALT(KC_F23), LALT(KC_F24),
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
|
||||||
|
),
|
||||||
|
|
||||||
|
//Layer 2 - Shift + Function Key Layer
|
||||||
|
[2] = LAYOUT_ortho_4x4(
|
||||||
|
LSFT(KC_F13), LSFT(KC_F14), LSFT(KC_F15), LSFT(KC_F16),
|
||||||
|
LSFT(KC_F17), LSFT(KC_F18), LSFT(KC_F19), LSFT(KC_F20),
|
||||||
|
LSFT(KC_F21), LSFT(KC_F22), LSFT(KC_F23), LSFT(KC_F24),
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
|
||||||
|
),
|
||||||
|
|
||||||
|
//Layer 3 - Control + Function Key
|
||||||
|
[3] = LAYOUT_ortho_4x4(
|
||||||
|
LCTL(KC_F13), LCTL(KC_F14), LCTL(KC_F15), LCTL(KC_F16),
|
||||||
|
LCTL(KC_F17), LCTL(KC_F18), LCTL(KC_F19), LCTL(KC_F20),
|
||||||
|
LCTL(KC_F21), LCTL(KC_F22), LCTL(KC_F23), LCTL(KC_F24),
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
|
||||||
|
),
|
||||||
|
|
||||||
|
//Layer 4 - Keyboard Lights. Programming and Special Functions
|
||||||
|
[4] = LAYOUT_ortho_4x4(
|
||||||
|
KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLU,
|
||||||
|
RGB_TOG, RGB_MOD, RGB_RMOD, KC_MUTE,
|
||||||
|
TO(0), RESET, EEP_RST, KC_VOLD,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS //Transparent to let you go between layers
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case KC_CCCV: // One key copy/paste
|
||||||
|
if (record->event.pressed) {
|
||||||
|
copy_paste_timer = timer_read();
|
||||||
|
} else {
|
||||||
|
if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy
|
||||||
|
tap_code16(LCTL(KC_C));
|
||||||
|
} else { // Tap, paste
|
||||||
|
tap_code16(LCTL(KC_V));
|
||||||
|
}
|
||||||
|
} return true;
|
||||||
|
case KC_2ENTER:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
enter_timer = timer_read();
|
||||||
|
} else {
|
||||||
|
if (timer_elapsed(enter_timer) > TAPPING_TERM) { // Hold, shift+enter
|
||||||
|
tap_code16(LSFT(KC_ENTER));
|
||||||
|
} else { // Tap, enter
|
||||||
|
tap_code16(KC_F24);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void keyboard_post_init_user(void) {
|
||||||
|
//Enable the LED layers
|
||||||
|
layer_state_set_user(layer_state);
|
||||||
|
}
|
||||||
|
|
||||||
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
|
rgblight_sethsv_noeeprom(HSV_WHITE);
|
||||||
|
switch(get_highest_layer(state)) {
|
||||||
|
case 1:
|
||||||
|
// Green
|
||||||
|
rgblight_enable_noeeprom();
|
||||||
|
rgblight_sethsv_noeeprom(HSV_GREEN);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// Red
|
||||||
|
rgblight_enable_noeeprom();
|
||||||
|
rgblight_sethsv_noeeprom(HSV_RED);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
// Blue
|
||||||
|
rgblight_enable_noeeprom();
|
||||||
|
rgblight_sethsv_noeeprom(HSV_BLUE);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
// Orange
|
||||||
|
rgblight_enable_noeeprom();
|
||||||
|
// rgblight_sethsv_noeeprom(HSV_PURPLE);
|
||||||
|
rgblight_sethsv_noeeprom(HSV_ORANGE);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// White
|
||||||
|
//Read RGB Light State
|
||||||
|
rgblight_config.raw = eeconfig_read_rgblight();
|
||||||
|
//If enabled, set white
|
||||||
|
if (rgblight_config.enable) {
|
||||||
|
rgblight_sethsv_noeeprom(HSV_WHITE);
|
||||||
|
} else { //Otherwise go back to disabled
|
||||||
|
rgblight_disable_noeeprom();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return state;
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Nick B's Super16 keymap
|
||||||
|
|
||||||
|
A modification of the default keymap to include layer indicators with RGB
|
||||||
|
* Added a time out of 3 seconds to 1 shot layers
|
||||||
|
* Reduced brightness to half to reduce power draw
|
||||||
|
* Added a one key copy/paste keycode
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
RGB_MATRIX_ENABLE = no
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// bootloader (first top leftmost key)
|
||||||
|
#define BOOTMAGIC_LITE_ROW 0
|
||||||
|
#define BOOTMAGIC_LITE_COLUMN 1
|
||||||
|
|
||||||
|
|
||||||
|
// Behaviors That Can Be Configured
|
||||||
|
|
||||||
|
|
||||||
|
#define TAPPING_TERM 250
|
||||||
|
// how long before a tap becomes a hold, if set above 500, a key tapped during the tapping term will turn it into a hold too
|
||||||
|
|
||||||
|
#define PERMISSIVE_HOLD
|
||||||
|
// makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the TAPPING_TERM
|
||||||
|
#define IGNORE_MOD_TAP_INTERRUPT
|
||||||
|
// makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the TAPPING_TERM for both keys.
|
||||||
|
|
||||||
|
#define TAPPING_FORCE_HOLD
|
||||||
|
// makes it possible to use a dual role key as modifier shortly after having been tapped (see Hold after tap)
|
||||||
|
// Breaks any Tap Toggle functionality (TT or the One Shot Tap Toggle)
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define TAPPING_TERM_PER_KEY
|
||||||
|
// enables handling for per key TAPPING_TERM settings
|
||||||
|
#define RETRO_TAPPING
|
||||||
|
// tap anyway, even after TAPPING_TERM, if there was no other key interruption between press and release
|
||||||
|
#define TAPPING_TOGGLE 2
|
||||||
|
// how many taps before triggering the toggle
|
||||||
|
#define LEADER_TIMEOUT 300
|
||||||
|
// how long before the leader key times out
|
||||||
|
// If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the LEADER_PER_KEY_TIMING option, which resets the timeout after each key is tapped.
|
||||||
|
#define LEADER_PER_KEY_TIMING
|
||||||
|
// sets the timer for leader key chords to run on each key press rather than overall
|
||||||
|
#define LEADER_KEY_STRICT_KEY_PROCESSING
|
||||||
|
// Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify MT(MOD_CTL, KC_A) if you want to use KC_A.
|
||||||
|
#define ONESHOT_TIMEOUT 300
|
||||||
|
// how long before oneshot times out
|
||||||
|
#define ONESHOT_TAP_TOGGLE 2
|
||||||
|
// how many taps before oneshot toggle is triggered
|
||||||
|
#define QMK_KEYS_PER_SCAN 4
|
||||||
|
// Allows sending more than one key per scan. By default, only one key event gets sent via process_record() per scan. This has little impact on most typing, but if you're doing a lot of chords, or your scan rate is slow to begin with, you can have some delay in processing key events. Each press and release is a separate event. For a keyboard with 1ms or so scan times, even a very fast typist isn't going to produce the 500 keystrokes a second needed to actually get more than a few ms of delay from this. But if you're doing chording on something with 3-4ms scan times? You probably want this.
|
||||||
|
#define COMBO_COUNT 2
|
||||||
|
// Set this to the number of combos that you're using in the Combo feature.
|
||||||
|
#define COMBO_TERM 200
|
||||||
|
// how long for the Combo keys to be detected. Defaults to TAPPING_TERM if not defined.
|
||||||
|
#define TAP_CODE_DELAY 100
|
||||||
|
// Sets the delay between register_code and unregister_code, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds.
|
||||||
|
#define TAP_HOLD_CAPS_DELAY 80
|
||||||
|
// Sets the delay for Tap Hold keys (LT, MT) when using KC_CAPSLOCK keycode, as this has some special handling on MacOS. The value is in milliseconds, and defaults to 80 ms if not defined. For macOS, you may want to set this to 200 or higher.
|
||||||
|
*/
|
||||||
@@ -0,0 +1,246 @@
|
|||||||
|
/* Copyright 2019 Stefano Marago'
|
||||||
|
*
|
||||||
|
* 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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* see jj40/stevexyz for more information
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
enum layers {
|
||||||
|
LAYER_HOME, // home base layer
|
||||||
|
LAYER_FUNC, // function keys and cursors
|
||||||
|
LAYER_NUMSYM, // numbers and other characters
|
||||||
|
LAYER_SYST, // media, mouse and other system keys
|
||||||
|
LAYER_ARROWPAD,
|
||||||
|
LAYER_NUMPAD,
|
||||||
|
LAYER_MEDIAPAD,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum custom_keycodes {
|
||||||
|
CK_TRIPLEZERO = SAFE_RANGE,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LEGEND:
|
||||||
|
*
|
||||||
|
* ,--------------------------------.
|
||||||
|
* | Top row: shifted character |
|
||||||
|
* | Central row: standard char |
|
||||||
|
* | Bottom row: hold modifier |
|
||||||
|
* `--------------------------------'
|
||||||
|
*
|
||||||
|
* "____" means free to be assigned
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Qwerty Home Layer
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | Q | W | E | R | T | Y | U | I | O | P |
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | A | S | D | F | G | H | J | K | L | Enter|
|
||||||
|
* | Shift| FnNav|NumSym| AltGr| OSkey| OSkey| AltGr| FnNav|NumSym| Shift|
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | Z | X | C | V | B | N | M | Space|
|
||||||
|
* | Ctrl | Alt | FnNav|NumSym| Shift| Alt | Ctrl | Shift|
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_HOME] = LAYOUT_ortho_3x10(
|
||||||
|
LT(LAYER_ARROWPAD, KC_Q), LT(LAYER_NUMPAD, KC_W), LT(LAYER_MEDIAPAD, KC_E), KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||||
|
MT(MOD_LSFT, KC_A), LT(LAYER_FUNC, KC_S), LT(LAYER_NUMSYM, KC_D), MT(MOD_RALT, KC_F), MT(MOD_LGUI, KC_G), MT(MOD_RGUI, KC_H), MT(MOD_RALT, KC_J), LT(LAYER_FUNC, KC_K), LT(LAYER_NUMSYM, KC_L), MT(MOD_RSFT, KC_ENT),
|
||||||
|
XXXXXXX, MT(MOD_LCTL, KC_Z), MT(MOD_LALT, KC_X), LT(LAYER_FUNC, KC_C), LT(LAYER_NUMSYM, KC_V), MT(MOD_LSFT, KC_B), MT(MOD_LALT, KC_N), MT(MOD_RCTL, KC_M), MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||||
|
|
||||||
|
/* Function and Navigation Layer
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 |
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | ESC | Home | PgDn | PgUp | End | Left | Down | Up | Right| Baksp|
|
||||||
|
* | Shift| ____ |SysLay| AltGr| OSkey| OSkey| AltGr| ____ |SysLay| Shift|
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | ____ | ____ | | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* | Ctrl | Alt | ____ |SysLay| Shift| Alt | Ctrl | Shift|
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_FUNC] = LAYOUT_ortho_3x10(
|
||||||
|
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
|
||||||
|
MT(MOD_LSFT, KC_ESC), KC_HOME, LT(LAYER_SYST, KC_PGDN), MT(MOD_RALT, KC_PGUP), MT(MOD_LGUI, KC_END), MT(MOD_RGUI, KC_LEFT), MT(MOD_RALT, KC_DOWN), KC_UP, LT(LAYER_SYST, KC_RGHT), MT(MOD_RSFT, KC_BSPC),
|
||||||
|
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, MO(LAYER_SYST), KC_LSFT, KC_LALT, KC_RCTL, MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||||
|
|
||||||
|
/* Number and Symbols Layer
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | ! | @ | # | $ | % | ^ | & | * | ( | ) |
|
||||||
|
* | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 |
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | ~ | _ | + | { | } | | | : | " | |
|
||||||
|
* | TAB | ` | - | = | [ | ] | \ | ; | ' | Del |
|
||||||
|
* | Shift|SysLay| ____ | AltGr| OSkey| OSkey| AltGr|SysLay| ____ | Shift|
|
||||||
|
* ' -----+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | < | > | ? | |
|
||||||
|
* | ____ | ____ | ____ | | , | . | / | ____ |
|
||||||
|
* | Ctrl | Alt |SysLay| ____ | Shift| Alt | Ctrl | Shift|
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_NUMSYM] = LAYOUT_ortho_3x10(
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
|
||||||
|
MT(MOD_LSFT, KC_TAB), LT(LAYER_SYST, KC_GRV), KC_MINS, MT(MOD_RALT, KC_EQL), MT(MOD_LGUI, KC_LBRC), MT(MOD_RGUI, KC_RBRC), MT(MOD_RALT, KC_BSLS), LT(LAYER_SYST, KC_SCLN), KC_QUOT, MT(MOD_RSFT, KC_DEL),
|
||||||
|
XXXXXXX, KC_LCTL, KC_LALT, MO(LAYER_SYST), KC_NO, MT(MOD_LSFT, KC_COMM), MT(MOD_LALT, KC_DOT), MT(MOD_RCTL, KC_SLSH), MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||||
|
|
||||||
|
/* System Layer
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | F11 | F12 | Play | Next |MsWhlU|MsBtn1|OSMenu|SysReq|MsBtn2|Backsp|
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | Caps | Mute | Vol- | Vol+ |MsWhlD|MsLeft|MSDown| MsUp |MsRigh| Ins |
|
||||||
|
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | ____ | ____ | | |PrnScr|ScrLck|Pause | ____ |
|
||||||
|
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
* simplified view (for media and mouse there are dedicated layers)
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | F11 | F12 | | | | |OSMenu|SysReq| |Backsp|
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | Caps | | | | | | | | | Ins |
|
||||||
|
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------+
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | | | | |PrnScr|ScrLck|Pause | |
|
||||||
|
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | Shift|
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_SYST] = LAYOUT_ortho_3x10(
|
||||||
|
KC_F11, KC_F12, KC_MPLY, KC_MNXT, KC_MS_WH_UP, KC_MS_BTN1, KC_APP, KC_SYSREQ, KC_MS_BTN2, KC_BSPC,
|
||||||
|
MT(MOD_LSFT, KC_CAPS), KC_MUTE, KC_VOLD, KC_VOLU, KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, MT(MOD_RSFT, KC_INS),
|
||||||
|
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, MT(MOD_RSFT, KC_SPC), XXXXXXX ),
|
||||||
|
|
||||||
|
/* ArrowPad (mod su Q) /------mouse-------\ /-----cursor-------\
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | | | |MsBtn1| MsUp |MsBtn2| Home | Up | PgUp |Backsp|
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | | | |MsLeft|MsDown|MsRigh| Left | Down | Right| Enter|
|
||||||
|
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | | |MsWhlU|MsDown|MsWhlD| End | Down | PdDn |
|
||||||
|
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_ARROWPAD] = LAYOUT_ortho_3x10(
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_HOME, KC_UP, KC_PGUP, KC_BSPC,
|
||||||
|
KC_LSFT, KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_ENT,
|
||||||
|
XXXXXXX, KC_LCTL, KC_LALT, KC_MS_WH_UP, KC_MS_DOWN, KC_MS_WH_DOWN, KC_END, KC_DOWN, KC_PGDN, XXXXXXX ),
|
||||||
|
|
||||||
|
/* NumPad (mod su W)
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | | | / | * | - |Backsp| 7 | 8 | 9 | 0 |
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | | | | = | + | . | 4 | 5 | 6 | Enter|
|
||||||
|
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | | | | Tab | , | 1 | 2 | 3 |
|
||||||
|
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_NUMPAD] = LAYOUT_ortho_3x10(
|
||||||
|
KC_NO, KC_NO, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_BSPC, KC_7, KC_8, KC_9, KC_0,
|
||||||
|
KC_LSFT, KC_NO, KC_NO, KC_KP_EQUAL, KC_KP_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ENT,
|
||||||
|
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_TAB, KC_COMM, KC_1, KC_2, KC_3, XXXXXXX ),
|
||||||
|
|
||||||
|
/* MediaPad (mod su E)
|
||||||
|
* ,---------------------------------------------------------------------.
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | | | | | | | | Vol+ | | |
|
||||||
|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* |------+------+------+------+-------------+------+------+------+------|
|
||||||
|
* | | | | | | | | | | |
|
||||||
|
* | | | | | | | Prev | Play | Next | |
|
||||||
|
* | Shift| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* '------+------+------+------+------+------|------+------+------+------'
|
||||||
|
* | | | | | | | | |
|
||||||
|
* | | | | | | Mute | Vol- | |
|
||||||
|
* | Ctrl | Alt | ____ | ____ | ____ | ____ | ____ | ____ |
|
||||||
|
* '-------------------------------------------------------'
|
||||||
|
*/
|
||||||
|
[LAYER_MEDIAPAD] = LAYOUT_ortho_3x10(
|
||||||
|
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, KC_NO, KC_NO,
|
||||||
|
KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO,
|
||||||
|
XXXXXXX, KC_LCTL, KC_LALT, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_NO, XXXXXXX ),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
// eeconfig_init(); // reset keyboard to a standard default state; useful when new releases messup with eeprom values
|
||||||
|
// set num lock on at start (for numonly layer to work)
|
||||||
|
if (!host_keyboard_led_state().num_lock) {
|
||||||
|
tap_code(KC_NUMLOCK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
|
switch (keycode) {
|
||||||
|
case CK_TRIPLEZERO:
|
||||||
|
if (record->event.pressed) {
|
||||||
|
SEND_STRING("000");
|
||||||
|
} // else { when released... }
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
void keyboard_pre_init_user(void) {
|
||||||
|
// Call the keyboard pre init code.
|
||||||
|
|
||||||
|
// Set our LED pins as output
|
||||||
|
setPinOutput(D5);
|
||||||
|
setPinOutput(B0);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool led_update_user(led_t led_state) {
|
||||||
|
writePin(D5, !led_state.num_lock);
|
||||||
|
writePin(B0, !led_state.caps_lock);
|
||||||
|
return false; // prevent keyboard from processing state
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# gherkin super micro edition
|
||||||
|
|
||||||
|
With this configuration the "28" layout first experimented on the plank-like jj40 is being ported to a more proper board, leaving just two keys not used.
|
||||||
|
|
||||||
|
For more information please have a look at https://github.com/stevexyz/qmk_firmware/blob/master/keyboards/jj40/keymaps/stevexyz/readme.md
|
||||||
|
|
||||||
|
The image below explain the main layers. In addition to them with q, w and e there are three specific dedicated layers for cursors/mouse, numpad and media.
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Happy hacking!
|
||||||
|
_Stefano
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# Build Options (yes/no)
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # Just bootloader enabled with keys
|
||||||
|
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
|
||||||
|
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||||
|
MIDI_ENABLE = no # MIDI support
|
||||||
|
UNICODE_ENABLE = no # Unicode
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
TAP_DANCE_ENABLE = no
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend (it uses the same timer as BACKLIGHT_ENABLE)
|
||||||
|
|
||||||
|
NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
RGBLIGHT_ENABLE = no
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
#include "drashna.h"
|
#include "drashna.h"
|
||||||
#include "analog.h"
|
#include "analog.h"
|
||||||
#include "pointing_device.h"
|
#include "pointing_device.h"
|
||||||
#include "pincontrol.h"
|
|
||||||
|
|
||||||
#define KC_X0 LT(_FN, KC_ESC)
|
#define KC_X0 LT(_FN, KC_ESC)
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ layer_state_t layer_state_set_user(layer_state_t state) {
|
|||||||
rgblight_sethsv_at( 0, 0, 0, 0);
|
rgblight_sethsv_at( 0, 0, 0, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
rgblight_set_effect_range( 1, 4);
|
rgblight_set_effect_range( 1, 5);
|
||||||
#endif
|
#endif
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
/* USB Device descriptor parameter */
|
/* USB Device descriptor parameter */
|
||||||
#define VENDOR_ID 0xFEED
|
#define VENDOR_ID 0xFEED
|
||||||
#define PRODUCT_ID 0x3060
|
#define PRODUCT_ID 0x36E1
|
||||||
#define DEVICE_VER 0x0007
|
#define DEVICE_VER 0x0007
|
||||||
#define MANUFACTURER Salicylic_Acid
|
#define MANUFACTURER Salicylic_Acid
|
||||||
#define PRODUCT 7skb
|
#define PRODUCT 7skb
|
||||||
@@ -52,9 +52,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define RGB_DI_PIN D3
|
#define RGB_DI_PIN D3
|
||||||
|
|
||||||
#ifndef RGBLED_NUM
|
#ifndef RGBLED_NUM
|
||||||
#define RGBLED_NUM 10
|
#define RGBLED_NUM 12
|
||||||
#define RGBLIGHT_SPLIT
|
#define RGBLIGHT_SPLIT
|
||||||
#define RGBLED_SPLIT { 5, 5 }
|
#define RGBLED_SPLIT { 6, 6 }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define RGBLIGHT_ANIMATIONS
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
|||||||
@@ -105,10 +105,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
//#define NO_ACTION_ONESHOT
|
//#define NO_ACTION_ONESHOT
|
||||||
|
|
||||||
/* disable these deprecated features by default */
|
/* disable these deprecated features by default */
|
||||||
#ifndef LINK_TIME_OPTIMIZATION_ENABLE
|
#define NO_ACTION_MACRO
|
||||||
#define NO_ACTION_MACRO
|
#define NO_ACTION_FUNCTION
|
||||||
#define NO_ACTION_FUNCTION
|
|
||||||
#endif
|
|
||||||
/*
|
/*
|
||||||
* MIDI options
|
* MIDI options
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
/* Copyright 2020 cfbender
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "absinthe.h"
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
/* Copyright 2020 cfbender
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define XXX KC_NO
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
/* This is a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
#define LAYOUT_default( \
|
||||||
|
K00, K10, K01, K11, K02, K12, K03, K13, K04, K14, K05, K15, K06, K16, K07, K17, K08, K18, \
|
||||||
|
K20, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36, K27, K37, K28, K38, \
|
||||||
|
K40, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K46, K56, \
|
||||||
|
K60, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K66, K67, K68, \
|
||||||
|
K80, K81, K82, K83, K76, K86, K87, K77, K88, K78 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08 },\
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18 },\
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28 },\
|
||||||
|
{ XXX, K31, K32, K33, K34, K35, K36, K37, K38 },\
|
||||||
|
{ K40, K41, K42, K43, K44, K45, K46, XXX, XXX },\
|
||||||
|
{ XXX, K51, K52, K53, K54, K55, K56, XXX, XXX },\
|
||||||
|
{ K60, K61, K62, K63, K64, K65, K66, K67, K68 },\
|
||||||
|
{ XXX, K71, K72, K73, K74, K75, K76, K77, K78 },\
|
||||||
|
{ K80, K81, K82, K83, XXX, XXX, K86, K87, K88 } \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define LAYOUT_ansi( \
|
||||||
|
K00, K10, K01, K11, K02, K12, K03, K13, K04, K14, K05, K15, K06, K16, K17, K08, K18, \
|
||||||
|
K20, K21, K31, K22, K32, K23, K33, K24, K34, K25, K35, K26, K36, K27, K37, K28, K38, \
|
||||||
|
K40, K41, K51, K42, K52, K43, K53, K44, K54, K45, K55, K46, K56, \
|
||||||
|
K60, K61, K71, K62, K72, K63, K73, K64, K74, K65, K75, K66, K68, \
|
||||||
|
K80, K81, K82, K83, K85, K76, K86, K87, K77, K88, K78 \
|
||||||
|
) \
|
||||||
|
{ \
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, XXX, K08 },\
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18 },\
|
||||||
|
{ K20, K21, K22, K23, K24, K25, K26, K27, K28 },\
|
||||||
|
{ XXX, K31, K32, K33, K34, K35, K36, K37, K38 },\
|
||||||
|
{ K40, K41, K42, K43, K44, K45, K46, XXX, XXX },\
|
||||||
|
{ XXX, K51, K52, K53, K54, K55, K56, XXX, XXX },\
|
||||||
|
{ K60, K61, K62, K63, K64, K65, K66, XXX, K68 },\
|
||||||
|
{ XXX, K71, K72, K73, K74, K75, K76, K77, K78 },\
|
||||||
|
{ K80, K81, K82, K83, XXX, K85, K86, K87, K88 } \
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 cfbender
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xB00B
|
||||||
|
#define PRODUCT_ID 0xFEED
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER cfbender
|
||||||
|
#define PRODUCT absinthe
|
||||||
|
#define DESCRIPTION An F-row-less TKL
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 9
|
||||||
|
#define MATRIX_COLS 9
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Keyboard Matrix Assignments
|
||||||
|
*
|
||||||
|
* Change this to how you wired your keyboard
|
||||||
|
* COLS: AVR pins used for columns, left to right
|
||||||
|
* ROWS: AVR pins used for rows, top to bottom
|
||||||
|
* DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
|
||||||
|
* ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define MATRIX_ROW_PINS { D2, D1, B6, D4, C6, D7, E6, B4, B5 }
|
||||||
|
#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, D3, D0 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
#define ENCODERS_PAD_A { D5 }
|
||||||
|
#define ENCODERS_PAD_B { B7 }
|
||||||
|
|
||||||
|
#define ENCODER_DIRECTION_FLIP
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||||
|
*/
|
||||||
|
//#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
#define RGB_DI_PIN B0
|
||||||
|
#ifdef RGB_DI_PIN
|
||||||
|
#define RGBLED_NUM 32
|
||||||
|
#define RGBLIGHT_HUE_STEP 8
|
||||||
|
#define RGBLIGHT_SAT_STEP 8
|
||||||
|
#define RGBLIGHT_VAL_STEP 8
|
||||||
|
#define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
|
||||||
|
#define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */
|
||||||
|
/*== all animations enable ==*/
|
||||||
|
// #define RGBLIGHT_ANIMATIONS
|
||||||
|
// /*== or choose animations ==*/
|
||||||
|
#define RGBLIGHT_EFFECT_BREATHING
|
||||||
|
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||||
|
#define RGBLIGHT_EFFECT_RAINBOW_SWIRL
|
||||||
|
// #define RGBLIGHT_EFFECT_SNAKE
|
||||||
|
// #define RGBLIGHT_EFFECT_KNIGHT
|
||||||
|
// #define RGBLIGHT_EFFECT_CHRISTMAS
|
||||||
|
#define RGBLIGHT_EFFECT_STATIC_GRADIENT
|
||||||
|
// #define RGBLIGHT_EFFECT_RGB_TEST
|
||||||
|
// #define RGBLIGHT_EFFECT_ALTERNATING
|
||||||
|
// /*== customize breathing effect ==*/
|
||||||
|
// /*==== (DEFAULT) use fixed table instead of exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_BREATHE_TABLE_SIZE 256 // 256(default) or 128 or 64
|
||||||
|
// /*==== use exp() and sin() ====*/
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1 to 2.7
|
||||||
|
// #define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 0 to 255
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||||
|
//#define MATRIX_HAS_GHOST
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "absinthe",
|
||||||
|
"url": "https://github.com/cfbender/keyboards/tree/master/absinthe",
|
||||||
|
"maintainer": "cfbender",
|
||||||
|
"width": 18.25,
|
||||||
|
"height": 5,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_default": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"Esc", "x":0, "y":0},
|
||||||
|
{"label":"!", "x":1, "y":0},
|
||||||
|
{"label":"@", "x":2, "y":0},
|
||||||
|
{"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0},
|
||||||
|
{"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0},
|
||||||
|
{"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0},
|
||||||
|
{"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0},
|
||||||
|
{"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0},
|
||||||
|
{"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0},
|
||||||
|
{"label":"Insert", "x":15.25, "y":0},
|
||||||
|
{"label":"Home", "x":16.25, "y":0},
|
||||||
|
{"label":"PgUp", "x":17.25, "y":0},
|
||||||
|
{"label":"Tab", "x":0, "y":1, "w":1.5},
|
||||||
|
{"label":"Q", "x":1.5, "y":1},
|
||||||
|
{"label":"W", "x":2.5, "y":1},
|
||||||
|
{"label":"E", "x":3.5, "y":1},
|
||||||
|
{"label":"R", "x":4.5, "y":1},
|
||||||
|
{"label":"T", "x":5.5, "y":1},
|
||||||
|
{"label":"Y", "x":6.5, "y":1},
|
||||||
|
{"label":"U", "x":7.5, "y":1},
|
||||||
|
{"label":"I", "x":8.5, "y":1},
|
||||||
|
{"label":"O", "x":9.5, "y":1},
|
||||||
|
{"label":"P", "x":10.5, "y":1},
|
||||||
|
{"label":"{", "x":11.5, "y":1},
|
||||||
|
{"label":"}", "x":12.5, "y":1},
|
||||||
|
{"label":"Backspace", "x":13.5, "y":1, "w":1.5},
|
||||||
|
{"label":"Delete", "x":15.25, "y":1},
|
||||||
|
{"label":"End", "x":16.25, "y":1},
|
||||||
|
{"label":"PgDn", "x":17.25, "y":1},
|
||||||
|
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"A", "x":1.75, "y":2},
|
||||||
|
{"label":"S", "x":2.75, "y":2},
|
||||||
|
{"label":"D", "x":3.75, "y":2},
|
||||||
|
{"label":"F", "x":4.75, "y":2},
|
||||||
|
{"label":"G", "x":5.75, "y":2},
|
||||||
|
{"label":"H", "x":6.75, "y":2},
|
||||||
|
{"label":"J", "x":7.75, "y":2},
|
||||||
|
{"label":"K", "x":8.75, "y":2},
|
||||||
|
{"label":"L", "x":9.75, "y":2},
|
||||||
|
{"label":":", "x":10.75, "y":2},
|
||||||
|
{"label":"\"", "x":11.75, "y":2},
|
||||||
|
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
|
||||||
|
{"label":"Shift", "x":0, "y":3, "w":2.25},
|
||||||
|
{"label":"Z", "x":2.25, "y":3},
|
||||||
|
{"label":"X", "x":3.25, "y":3},
|
||||||
|
{"label":"C", "x":4.25, "y":3},
|
||||||
|
{"label":"V", "x":5.25, "y":3},
|
||||||
|
{"label":"B", "x":6.25, "y":3},
|
||||||
|
{"label":"N", "x":7.25, "y":3},
|
||||||
|
{"label":"M", "x":8.25, "y":3},
|
||||||
|
{"label":"<", "x":9.25, "y":3},
|
||||||
|
{"label":">", "x":10.25, "y":3},
|
||||||
|
{"label":"?", "x":11.25, "y":3},
|
||||||
|
{"label":"Shift", "x":12.25, "y":3, "w":1.75},
|
||||||
|
{"label":"MO(1)", "x":14, "y":3},
|
||||||
|
{"label":"\u2191", "x":16.25, "y":3},
|
||||||
|
{"label":"Ctrl", "x":0, "y":4, "w":1.5},
|
||||||
|
{"label":"Win", "x":1.5, "y":4},
|
||||||
|
{"label":"Alt", "x":2.5, "y":4, "w":1.5},
|
||||||
|
{"x":4, "y":4, "w":7},
|
||||||
|
{"label":"Alt", "x":11, "y":4, "w":1.5},
|
||||||
|
{"label":"Win", "x":12.5, "y":4},
|
||||||
|
{"label":"Ctrl", "x":13.5, "y":4, "w":1.5},
|
||||||
|
{"label":"\u2190", "x":15.25, "y":4},
|
||||||
|
{"label":"\u2193", "x":16.25, "y":4}, {"label":"\u2192", "x":17.25, "y":4}]
|
||||||
|
},
|
||||||
|
"LAYOUT_ansi": {
|
||||||
|
"layout": [{"label":"Esc", "x":0, "y":0},
|
||||||
|
{"label":"!", "x":1, "y":0},
|
||||||
|
{"label":"@", "x":2, "y":0},
|
||||||
|
{"label":"#", "x":3, "y":0},
|
||||||
|
{"label":"$", "x":4, "y":0},
|
||||||
|
{"label":"%", "x":5, "y":0},
|
||||||
|
{"label":"^", "x":6, "y":0},
|
||||||
|
{"label":"&", "x":7, "y":0},
|
||||||
|
{"label":"*", "x":8, "y":0},
|
||||||
|
{"label":"(", "x":9, "y":0},
|
||||||
|
{"label":")", "x":10, "y":0},
|
||||||
|
{"label":"_", "x":11, "y":0},
|
||||||
|
{"label":"+", "x":12, "y":0},
|
||||||
|
{"label":"Backspace", "x":13, "y":0, "w":2},
|
||||||
|
{"label":"Insert", "x":15.25, "y":0},
|
||||||
|
{"label":"Home", "x":16.25, "y":0},
|
||||||
|
{"label":"PgUp", "x":17.25, "y":0},
|
||||||
|
{"label":"Tab", "x":0, "y":1, "w":1.5},
|
||||||
|
{"label":"Q", "x":1.5, "y":1},
|
||||||
|
{"label":"W", "x":2.5, "y":1},
|
||||||
|
{"label":"E", "x":3.5, "y":1},
|
||||||
|
{"label":"R", "x":4.5, "y":1},
|
||||||
|
{"label":"T", "x":5.5, "y":1},
|
||||||
|
{"label":"Y", "x":6.5, "y":1},
|
||||||
|
{"label":"U", "x":7.5, "y":1},
|
||||||
|
{"label":"I", "x":8.5, "y":1},
|
||||||
|
{"label":"O", "x":9.5, "y":1},
|
||||||
|
{"label":"P", "x":10.5, "y":1},
|
||||||
|
{"label":"{", "x":11.5, "y":1},
|
||||||
|
{"label":"}", "x":12.5, "y":1},
|
||||||
|
{"label":"|", "x":13.5, "y":1, "w":1.5},
|
||||||
|
{"label":"Delete", "x":15.25, "y":1},
|
||||||
|
{"label":"End", "x":16.25, "y":1},
|
||||||
|
{"label":"PgDn", "x":17.25, "y":1},
|
||||||
|
{"label":"Caps Lock", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"A", "x":1.75, "y":2},
|
||||||
|
{"label":"S", "x":2.75, "y":2},
|
||||||
|
{"label":"D", "x":3.75, "y":2},
|
||||||
|
{"label":"F", "x":4.75, "y":2},
|
||||||
|
{"label":"G", "x":5.75, "y":2},
|
||||||
|
{"label":"H", "x":6.75, "y":2},
|
||||||
|
{"label":"J", "x":7.75, "y":2},
|
||||||
|
{"label":"K", "x":8.75, "y":2},
|
||||||
|
{"label":"L", "x":9.75, "y":2},
|
||||||
|
{"label":":", "x":10.75, "y":2},
|
||||||
|
{"label":"\"", "x":11.75, "y":2},
|
||||||
|
{"label":"Enter", "x":12.75, "y":2, "w":2.25},
|
||||||
|
{"label":"Shift", "x":0, "y":3, "w":2.25},
|
||||||
|
{"label":"Z", "x":2.25, "y":3},
|
||||||
|
{"label":"X", "x":3.25, "y":3},
|
||||||
|
{"label":"C", "x":4.25, "y":3},
|
||||||
|
{"label":"V", "x":5.25, "y":3},
|
||||||
|
{"label":"B", "x":6.25, "y":3},
|
||||||
|
{"label":"N", "x":7.25, "y":3},
|
||||||
|
{"label":"M", "x":8.25, "y":3},
|
||||||
|
{"label":"<", "x":9.25, "y":3},
|
||||||
|
{"label":">", "x":10.25, "y":3},
|
||||||
|
{"label":"?", "x":11.25, "y":3},
|
||||||
|
{"label":"Shift", "x":12.25, "y":3, "w":2.75},
|
||||||
|
{"label":"\u2191", "x":16.25, "y":3},
|
||||||
|
{"label":"Ctrl", "x":0, "y":4, "w":1.25},
|
||||||
|
{"label":"Win", "x":1.25, "y":4, "w":1.25},
|
||||||
|
{"label":"Alt", "x":2.5, "y":4, "w":1.25},
|
||||||
|
{"x":3.75, "y":4, "w":6.25},
|
||||||
|
{"label":"Alt", "x":10, "y":4, "w":1.25},
|
||||||
|
{"label":"Win", "x":11.25, "y":4, "w":1.25},
|
||||||
|
{"label":"Menu", "x":12.5, "y":4, "w":1.25},
|
||||||
|
{"label":"Ctrl", "x":13.75, "y":4, "w":1.25},
|
||||||
|
{"label":"\u2190", "x":15.25, "y":4},
|
||||||
|
{"label":"\u2193", "x":16.25, "y":4},
|
||||||
|
{"label":"\u2192", "x":17.25, "y":4}]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
/* Copyright 2020 cfbender
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// place overrides here
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/* Copyright 2020 cfbender
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
[0] = LAYOUT_ansi(
|
||||||
|
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP,
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
|
||||||
|
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||||
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
|
||||||
|
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||||
|
|
||||||
|
[1] = LAYOUT_ansi(
|
||||||
|
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, RGB_TOG, RGB_RMOD, RGB_MOD, RGB_HUD,RGB_HUI,RGB_SAD,RGB_SAI,RGB_VAD,RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_TRNS)
|
||||||
|
};
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# The all ANSI keymap for absinthe
|
||||||
|
|
||||||
|

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

|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
# absinthe
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A budget-friendly F-rowless TKL with a rotary encoder
|
||||||
|
|
||||||
|
* Keyboard Maintainer: [cfbender](https://cfbender.design)
|
||||||
|
* Hardware Supported: Absinthe PCB, Elite-C (for rotary encoder support - alternatively you can use a Pro Micro without an encoder)
|
||||||
|
* Hardware Availability: [GitHub](https://github.com/cfbender/keyboards/tree/master/absinthe)
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make absinthe:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u4
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# ATmega32A bootloadHID
|
||||||
|
# ATmega328P USBasp
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
# If you don't know the bootloader type, then you can specify the
|
||||||
|
# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
|
||||||
|
# Otherwise, delete this section
|
||||||
|
# Teensy halfKay 512
|
||||||
|
# Teensy++ halfKay 1024
|
||||||
|
# Atmel DFU loader 4096
|
||||||
|
# LUFA bootloader 4096
|
||||||
|
# USBaspLoader 2048
|
||||||
|
# OPT_DEFS += -DBOOTLOADER_SIZE=4096
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# change yes to no to disable
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = full # Virtual DIP switch configuration
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys
|
||||||
|
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||||
|
CONSOLE_ENABLE = no # Console for debug
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover
|
||||||
|
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||||
|
RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||||
|
MIDI_ENABLE = no # MIDI support
|
||||||
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
|
AUDIO_ENABLE = no # Audio output on port C6
|
||||||
|
FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
|
||||||
|
HD44780_ENABLE = no # Enable support for HD44780 based LCDs
|
||||||
|
ENCODER_ENABLE = yes
|
||||||
|
RGBLIGHT_ENABLE = yes
|
||||||
|
# EXTRAFLAGS += -flto
|
||||||
@@ -0,0 +1,250 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2020 Gondolindrim
|
||||||
|
|
||||||
|
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 0x4150 //AP for AcheronProject
|
||||||
|
#define PRODUCT_ID 0x454C // EL for Elongate
|
||||||
|
#define DEVICE_VER 0x0001
|
||||||
|
#define MANUFACTURER Acheron Project
|
||||||
|
#define PRODUCT Elongate
|
||||||
|
#define DESCRIPTION Acheron Project Elongate
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 5
|
||||||
|
#define MATRIX_COLS 13
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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 { D3, B7, D5, B5, D6 }
|
||||||
|
#define MATRIX_COL_PINS { F5, F6, F4, F1, F0, B2, B1, C6, B0, B3, E6, D4, B4}
|
||||||
|
//#define UNUSED_PINS
|
||||||
|
|
||||||
|
/* COL2ROW, ROW2COL*/
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||||
|
*/
|
||||||
|
// #define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6
|
||||||
|
|
||||||
|
// #define BACKLIGHT_PIN B7
|
||||||
|
// #define BACKLIGHT_BREATHING
|
||||||
|
// #define BACKLIGHT_LEVELS 3
|
||||||
|
|
||||||
|
#define RGB_DI_PIN D7
|
||||||
|
#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
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||||
|
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||||
|
*/
|
||||||
|
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Force NKRO
|
||||||
|
*
|
||||||
|
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||||
|
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||||
|
* makefile for this to work.)
|
||||||
|
*
|
||||||
|
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||||
|
* until the next keyboard reset.
|
||||||
|
*
|
||||||
|
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||||
|
* fully operational during normal computer usage.
|
||||||
|
*
|
||||||
|
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||||
|
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||||
|
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||||
|
* power-up.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
//#define FORCE_NKRO
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Magic Key Options
|
||||||
|
*
|
||||||
|
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||||
|
* the keyboard. They are best used in combination with the HID Listen program,
|
||||||
|
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||||
|
*
|
||||||
|
* The options below allow the magic key functionality to be changed. This is
|
||||||
|
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* key combination for magic key command */
|
||||||
|
/* defined by default; to change, uncomment and set to the combination you want */
|
||||||
|
// #define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)
|
||||||
|
|
||||||
|
/* control how magic key switches layers */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||||
|
|
||||||
|
/* override magic key keymap */
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||||
|
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||||
|
//#define MAGIC_KEY_HELP H
|
||||||
|
//#define MAGIC_KEY_HELP_ALT SLASH
|
||||||
|
//#define MAGIC_KEY_DEBUG D
|
||||||
|
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||||
|
//#define MAGIC_KEY_DEBUG_KBD K
|
||||||
|
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||||
|
//#define MAGIC_KEY_VERSION V
|
||||||
|
//#define MAGIC_KEY_STATUS S
|
||||||
|
//#define MAGIC_KEY_CONSOLE C
|
||||||
|
//#define MAGIC_KEY_LAYER0 0
|
||||||
|
//#define MAGIC_KEY_LAYER0_ALT GRAVE
|
||||||
|
//#define MAGIC_KEY_LAYER1 1
|
||||||
|
//#define MAGIC_KEY_LAYER2 2
|
||||||
|
//#define MAGIC_KEY_LAYER3 3
|
||||||
|
//#define MAGIC_KEY_LAYER4 4
|
||||||
|
//#define MAGIC_KEY_LAYER5 5
|
||||||
|
//#define MAGIC_KEY_LAYER6 6
|
||||||
|
//#define MAGIC_KEY_LAYER7 7
|
||||||
|
//#define MAGIC_KEY_LAYER8 8
|
||||||
|
//#define MAGIC_KEY_LAYER9 9
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER B
|
||||||
|
//#define MAGIC_KEY_BOOTLOADER_ALT ESC
|
||||||
|
//#define MAGIC_KEY_LOCK CAPS
|
||||||
|
//#define MAGIC_KEY_EEPROM E
|
||||||
|
//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
|
||||||
|
//#define MAGIC_KEY_NKRO N
|
||||||
|
//#define MAGIC_KEY_SLEEP_LED Z
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Feature disable options
|
||||||
|
* These options are also useful to firmware size reduction.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* disable debug print */
|
||||||
|
//#define NO_DEBUG
|
||||||
|
|
||||||
|
/* disable print */
|
||||||
|
//#define NO_PRINT
|
||||||
|
|
||||||
|
/* disable action features */
|
||||||
|
//#define NO_ACTION_LAYER
|
||||||
|
//#define NO_ACTION_TAPPING
|
||||||
|
//#define NO_ACTION_ONESHOT
|
||||||
|
|
||||||
|
/* disable these deprecated features by default */
|
||||||
|
#define NO_ACTION_MACRO
|
||||||
|
#define NO_ACTION_FUNCTION
|
||||||
|
/*
|
||||||
|
* MIDI options
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Prevent use of disabled MIDI features in the keymap */
|
||||||
|
//#define MIDI_ENABLE_STRICT 1
|
||||||
|
|
||||||
|
/* enable basic MIDI features:
|
||||||
|
- MIDI notes can be sent when in Music mode is on
|
||||||
|
*/
|
||||||
|
//#define MIDI_BASIC
|
||||||
|
|
||||||
|
/* enable advanced MIDI features:
|
||||||
|
- MIDI notes can be added to the keymap
|
||||||
|
- Octave shift and transpose
|
||||||
|
- Virtual sustain, portamento, and modulation wheel
|
||||||
|
- etc.
|
||||||
|
*/
|
||||||
|
//#define MIDI_ADVANCED
|
||||||
|
|
||||||
|
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||||
|
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HD44780 LCD Display Configuration
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
#define LCD_LINES 2 //< number of visible lines of the display
|
||||||
|
#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display
|
||||||
|
|
||||||
|
#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode
|
||||||
|
|
||||||
|
#if LCD_IO_MODE
|
||||||
|
#define LCD_PORT PORTB //< port for the LCD lines
|
||||||
|
#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0
|
||||||
|
#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1
|
||||||
|
#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2
|
||||||
|
#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3
|
||||||
|
#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0
|
||||||
|
#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1
|
||||||
|
#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2
|
||||||
|
#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3
|
||||||
|
#define LCD_RS_PORT LCD_PORT //< port for RS line
|
||||||
|
#define LCD_RS_PIN 3 //< pin for RS line
|
||||||
|
#define LCD_RW_PORT LCD_PORT //< port for RW line
|
||||||
|
#define LCD_RW_PIN 2 //< pin for RW line
|
||||||
|
#define LCD_E_PORT LCD_PORT //< port for Enable line
|
||||||
|
#define LCD_E_PIN 1 //< pin for Enable line
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Bootmagic Lite key configuration */
|
||||||
|
// #define BOOTMAGIC_LITE_ROW 0
|
||||||
|
// #define BOOTMAGIC_LITE_COLUMN 0
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
/* Copyright 2020 Gondolindrim
|
||||||
|
*
|
||||||
|
* 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 "elongate.h"
|
||||||
|
bool led_update_kb(led_t led_state) {
|
||||||
|
bool res = led_update_user(led_state);
|
||||||
|
if(res) {
|
||||||
|
writePin(D2, led_state.num_lock);
|
||||||
|
writePin(D1, led_state.caps_lock);
|
||||||
|
writePin(D0, led_state.scroll_lock);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
/* Copyright 2020 Gondolindrim
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
/* This is a shortcut to help you visually see your layout.
|
||||||
|
*
|
||||||
|
* The first section contains all of the arguments representing the physical
|
||||||
|
* layout of the board and position of the Keys.
|
||||||
|
*
|
||||||
|
* The second converts the arguments into a two-dimensional array which
|
||||||
|
* represents the switch matrix.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define KNO KC_NO
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K49, K41, \
|
||||||
|
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1B, K1C, K4A, K42, \
|
||||||
|
K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K4B, K44, \
|
||||||
|
K30, K31, K32, K34, K37, K3A, K3B, K3C, K3D, K4C, K47 \
|
||||||
|
)\
|
||||||
|
{\
|
||||||
|
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, KNO, K1B, K1C }, \
|
||||||
|
{ K20, KNO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \
|
||||||
|
{ K30, K31, K32, KNO, K34, KNO, KNO, K37, KNO, K3A, K3B, K3C, K3D }, \
|
||||||
|
{ KNO, K41, K42, KNO, K44, KNO, KNO, K47, KNO, K49, K4A, K4B, K4C } \
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
{
|
||||||
|
"keyboard_name": "Elongate",
|
||||||
|
"url": "http://gondolindrim.github.io/AcheronDocs/elongate/introduction.html",
|
||||||
|
"maintainer": "Gondolindrim",
|
||||||
|
"width": 15.5,
|
||||||
|
"height": 4.25,
|
||||||
|
"layouts": {
|
||||||
|
"LAYOUT_all": {
|
||||||
|
"layout": [
|
||||||
|
{"label":"Tab", "x":0, "y":0},
|
||||||
|
{"label":"Q", "x":1, "y":0},
|
||||||
|
{"label":"W", "x":2, "y":0},
|
||||||
|
{"label":"E", "x":3, "y":0},
|
||||||
|
{"label":"R", "x":4, "y":0},
|
||||||
|
{"label":"T", "x":5, "y":0},
|
||||||
|
{"label":"Y", "x":6, "y":0},
|
||||||
|
{"label":"U", "x":7, "y":0},
|
||||||
|
{"label":"I", "x":8, "y":0},
|
||||||
|
{"label":"O", "x":9, "y":0},
|
||||||
|
{"label":"P", "x":10, "y":0},
|
||||||
|
{"label":"Backspace", "x":11, "y":0},
|
||||||
|
{"label":"7", "x":12.5, "y":0},
|
||||||
|
{"label":"8", "x":13.5, "y":0},
|
||||||
|
{"label":"9", "x":14.5, "y":0},
|
||||||
|
|
||||||
|
{"label":"Caps Lock", "x":0, "y":1, "w":1.25},
|
||||||
|
{"label":"A", "x":1.25, "y":1},
|
||||||
|
{"label":"S", "x":2.25, "y":1},
|
||||||
|
{"label":"D", "x":3.25, "y":1},
|
||||||
|
{"label":"F", "x":4.25, "y":1},
|
||||||
|
{"label":"G", "x":5.25, "y":1},
|
||||||
|
{"label":"H", "x":6.25, "y":1},
|
||||||
|
{"label":"J", "x":7.25, "y":1},
|
||||||
|
{"label":"K", "x":8.25, "y":1},
|
||||||
|
{"label":"L", "x":9.25, "y":1},
|
||||||
|
{"label":"Enter", "x":10.25, "y":1.75},
|
||||||
|
{"label":"4", "x":12.5, "y":1},
|
||||||
|
{"label":"5", "x":13.5, "y":1},
|
||||||
|
{"label":"6", "x":14.5, "y":1},
|
||||||
|
|
||||||
|
{"label":"Shift", "x":0, "y":2, "w":1.75},
|
||||||
|
{"label":"Z", "x":1.75, "y":2},
|
||||||
|
{"label":"X", "x":2.75, "y":2},
|
||||||
|
{"label":"C", "x":3.75, "y":2},
|
||||||
|
{"label":"V", "x":4.75, "y":2},
|
||||||
|
{"label":"B", "x":5.75, "y":2},
|
||||||
|
{"label":"N", "x":6.75, "y":2},
|
||||||
|
{"label":"M", "x":7.75, "y":2},
|
||||||
|
{"label":"<", "x":8.75, "y":2},
|
||||||
|
{"label":"Fn1", "x":9.75, "y":2},
|
||||||
|
{"label":"Up", "x":11.25, "y":2.25},
|
||||||
|
{"label":"1", "x":12.5, "y":2},
|
||||||
|
{"label":"2", "x":13.5, "y":2},
|
||||||
|
{"label":"3", "x":14.5, "y":2},
|
||||||
|
|
||||||
|
{"label":"Ctrl", "x":0, "y":3, "w":1.25},
|
||||||
|
{"label":"Win", "x":1.25, "y":3},
|
||||||
|
{"label":"Alt", "x":2.25, "y":3, "w":1.25},
|
||||||
|
{"label":"Space/Fn2", "x":3.5, "y":3, "w":2.25},
|
||||||
|
{"label":"Space", "x":6.25, "y":3, "w":2.75},
|
||||||
|
{"label":"Alt", "x":9, "y":3},
|
||||||
|
{"label":"Left", "x":10.25, "y":3.25},
|
||||||
|
{"label":"Down", "x":11.25, "y":3.25},
|
||||||
|
{"label":"Right", "x":12.25, "y":3.25},
|
||||||
|
{"label":"0", "x":13.5, "y":3},
|
||||||
|
{"label":".", "x":14.5, "y":3},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/* Copyright 2020 Gondolindrim
|
||||||
|
*
|
||||||
|
* 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( /* Base */
|
||||||
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_P7, KC_P8, KC_P9,
|
||||||
|
KC_SLCK, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENTER, KC_P4, KC_P5, KC_P6,
|
||||||
|
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, MO(1) , KC_UP, KC_P1, KC_P2, KC_P3,
|
||||||
|
KC_LCTRL, KC_LWIN, KC_LALT, LT(2, KC_SPACE), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_DOT),
|
||||||
|
[1] = LAYOUT( /* Base */
|
||||||
|
KC_F1, KC_F2, KC_F2, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_NLCK, KC_SLCK, KC_CAPS,
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RSHIFT, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_SLSH, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_HOME, KC_PGDN, KC_END , KC_TRNS, KC_TRNS),
|
||||||
|
[2] = LAYOUT( /* Base */
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, RGB_TOG, RGB_MOD, RGB_RMOD, RGB_M_T, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||||
|
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS , KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||||
|
};
|
||||||
Loaded 100 of 1413 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user