1
0

Compare commits

..

310 Commits
v2.9 ... master

Author SHA1 Message Date
db5137e2c7 Upload files to 'keyboard/feegle' 2021-10-14 16:35:52 +00:00
8a1e9ec2df Upload files to 'keyboard/express2' 2020-10-06 17:46:14 +00:00
7301345109 Upload files to 'keyboard/express2' 2020-10-06 17:46:00 +00:00
9e34ba5da3 Upload files to 'keyboard/60percent09' 2020-09-29 20:16:51 +00:00
a1b3d28e44 Upload files to 'keyboard/60percent09' 2020-09-29 20:16:43 +00:00
4fe77389f9 Upload files to 'keyboard/feegle' 2020-09-29 20:16:15 +00:00
1bd9c4a37a Upload files to 'keyboard/feegle' 2020-09-29 20:15:42 +00:00
19102a6ad6 Update 'keyboard/toshi/readme.md' 2020-09-24 19:38:23 +00:00
aca116baad Update 'keyboard/toshi/readme.md' 2020-09-24 19:37:21 +00:00
cbbbd99af0 Upload files to 'keyboard/toshi' 2020-09-24 19:36:29 +00:00
a195f44349 Upload files to 'keyboard/toshi' 2020-09-24 19:35:58 +00:00
d8eb05ccac Upload files to 'keyboard/toshi' 2020-09-24 19:35:05 +00:00
756a19288e Update 'keyboard/express/actionmap_gherkin.c' 2020-09-02 01:56:04 +00:00
027c7cb6e0 Update 'keyboard/express/actionmap_gherkin.c' 2020-09-02 01:42:23 +00:00
8a068cb321 Update 'keyboard/express/actionmap_gherkin.c' 2020-09-02 01:40:03 +00:00
9d4ad6a08d Upload files to 'keyboard/express' 2020-08-12 18:02:34 +00:00
e2142c83dd Add 'keyboard/express/Makefile' 2020-08-12 18:02:17 +00:00
51a1e56e29 Upload files to 'keyboard/aardvark' 2020-08-05 21:53:40 +00:00
1a16bb2555 Upload files to 'keyboard/aardvark' 2020-08-05 21:53:18 +00:00
c1d969f0aa Upload files to 'keyboard/aardvark' 2020-08-05 21:52:40 +00:00
d700728b06 Add 'keyboard/aardvark/Makefile' 2020-08-05 21:52:12 +00:00
di0ib
6782b554a6
Add files via upload 2019-05-30 08:10:43 -10:00
di0ib
0f6cd2d37a
Delete temp.txt 2019-05-30 08:10:02 -10:00
di0ib
5d8b516905
Delete temp.txt 2019-05-30 08:09:48 -10:00
di0ib
3ba13e1f2f
Add files via upload 2019-05-30 08:09:27 -10:00
di0ib
e2de372ca8
Add files via upload 2019-05-30 08:09:02 -10:00
di0ib
7641b241e8
Create temp.txt 2019-05-30 08:08:44 -10:00
di0ib
1c1ca7387b
Create temp.txt 2019-05-30 08:08:15 -10:00
di0ib
3ce5e88937
Update actionmap_common.h 2019-04-26 08:29:03 -10:00
di0ib
5199a30aae
Add files via upload 2019-03-08 18:35:06 -10:00
di0ib
821f2538b1
Create Makefile 2019-03-08 18:34:41 -10:00
di0ib
9661543a62
Update readme.md 2019-03-06 07:39:39 -10:00
di0ib
fa006e81b8
Add files via upload 2018-05-05 17:15:53 -10:00
di0ib
18c257ad37
Create Makefile 2018-05-05 17:15:29 -10:00
di0ib
bcd8e2cd90 Merge branch 'master' of https://github.com/di0ib/tmk_keyboard 2018-04-19 09:07:41 -10:00
di0ib
f0807dab49 contraption 2018-04-19 09:07:24 -10:00
di0ib
8ac3b382d2
Update matrix.c 2018-04-14 08:53:59 -10:00
di0ib
8168810036
Update matrix.c 2018-04-13 19:19:21 -10:00
di0ib
4dab703eb2 halfhalf
Half and Half split keyboard
2018-04-13 13:04:11 -10:00
di0ib
741b569b93 5x5x9
Modular 225 key keyboard
2018-04-13 12:45:18 -10:00
di0ib
83e40feac8
Add files via upload 2018-04-11 14:49:34 -10:00
di0ib
44f42f6acf
Create readme.md 2018-04-11 14:48:58 -10:00
di0ib
b1f20b0dc7
Add files via upload 2018-04-09 20:03:14 -10:00
di0ib
f20a487dba
Create readme.md 2018-04-09 20:02:37 -10:00
di0ib
9f5ebacd45
Update instructions.md 2018-04-02 12:55:35 -10:00
di0ib
1bb852c16b
Update instructions.md 2018-04-02 12:54:49 -10:00
di0ib
dc7e44bf55
Update instructions.md 2018-04-02 12:53:52 -10:00
di0ib
b647b2deef
Update matrix.c 2018-03-21 07:52:44 -10:00
di0ib
1d655f387f
Add files via upload 2018-03-16 18:01:12 -10:00
di0ib
add158e567
Create Makefile 2018-03-16 18:00:46 -10:00
di0ib
486e53189f
Add files via upload 2018-03-11 17:58:10 -10:00
di0ib
e255ea3d35
Create readme.md 2018-03-11 17:57:38 -10:00
di0ib
dc0e244fc8
Update matrix.c 2018-03-10 18:06:01 -10:00
di0ib
eecfb98bf2
5x5 2018-03-01 08:22:42 -10:00
di0ib
cea2464e3b
Create Makefile 2018-03-01 08:22:13 -10:00
di0ib
5f2c420c16
Add files via upload 2018-01-03 12:10:34 -10:00
di0ib
b68d2af9d7
Create readme.md 2018-01-03 12:09:33 -10:00
di0ib
c5a3efdb17 Add files via upload 2017-10-22 05:33:10 -10:00
di0ib
7bddeb995f Add files via upload 2017-10-08 06:03:10 -10:00
di0ib
36c5a8f8ca 5x5 2017-09-17 13:55:22 -10:00
di0ib
9c5db97f32 Add files via upload 2017-09-17 09:59:50 -10:00
di0ib
482833f799 Update readme.md 2017-09-17 09:59:11 -10:00
di0ib
e2c8bb726e Create readme.md 2017-09-17 09:58:51 -10:00
di0ib
848b32c620 Add files via upload 2017-09-12 18:20:31 -10:00
di0ib
0300a92fc2 6lit 2017-09-12 18:16:15 -10:00
di0ib
870695d2f4 Add files via upload 2017-09-04 20:34:43 -10:00
di0ib
21d8a47e4d foobar rgb underglow 2017-09-04 20:29:55 -10:00
di0ib
02054bf45f Add files via upload 2017-08-29 15:32:47 -10:00
di0ib
4f6d666995 Merge branch 'master' of https://github.com/di0ib/tmk_keyboard 2017-08-29 15:28:00 -10:00
di0ib
51915f9b27 foobar 2017-08-29 15:27:55 -10:00
di0ib
458cd5b484 Update readme.md 2017-08-28 08:53:21 -10:00
di0ib
5ef404d0e7 Merge branch 'master' of https://github.com/di0ib/tmk_keyboard 2017-08-25 16:50:35 -10:00
di0ib
269468b3c0 outrigger 2017-08-25 16:50:16 -10:00
di0ib
f88f828e8b Add files via upload 2017-06-13 09:01:30 -10:00
di0ib
1fd6779b78 Create readme.md 2017-06-13 09:00:39 -10:00
di0ib
0738eb7fcf Merge branch 'master' of https://github.com/di0ib/tmk_keyboard 2017-06-11 06:59:10 -10:00
di0ib
8c1bca8fbf double gherkin 2017-06-11 06:58:54 -10:00
di0ib
7d4eec8263 Add files via upload 2017-06-06 13:57:41 -10:00
di0ib
f300327391 Update readme.md 2017-03-31 07:56:31 -10:00
di0ib
8b519690ad Update readme.md 2017-03-31 07:55:34 -10:00
di0ib
5a6bd8a7f6 Update readme.md 2017-03-30 19:05:20 -10:00
di0ib
2b1ab493f5 Update readme.md 2017-03-30 19:04:51 -10:00
di0ib
ff60175a71 Update readme.md 2017-03-30 19:04:21 -10:00
di0ib
fbb6ea65d1 Update readme.md 2017-03-30 19:03:50 -10:00
di0ib
ac70ea56ae Update readme.md 2017-03-30 19:03:16 -10:00
di0ib
965ee2b423 Update readme.md 2017-03-30 19:02:48 -10:00
di0ib
89c779ce5a Update readme.md 2017-03-30 19:02:21 -10:00
di0ib
2ee4c6dfa3 Update readme.md 2017-03-30 19:01:47 -10:00
di0ib
5b371647ea Bilimbi RGB 2017-03-19 19:30:07 -10:00
di0ib
34562a2225 bilimbi readme
update
2017-02-17 19:03:40 -10:00
di0ib
7b004f37db bilimbi readme
update
2017-02-17 19:00:21 -10:00
di0ib
9ecc354605 bilimbi readme
updated
2017-02-17 18:56:53 -10:00
di0ib
dbdc5d30d0 bilimbi readme 2017-02-17 18:54:37 -10:00
di0ib
3de36bdea5 bilimbi PCB files 2017-02-17 18:47:08 -10:00
di0ib
126dbd2f2b Merge remote-tracking branch 'refs/remotes/tmk/master' 2017-02-17 06:31:29 -10:00
di0ib
cf7db01afc bilimbi 2017-02-16 19:57:33 -10:00
tmk
0575b3db2e adb_usb: Use MODS_TAP_KEY action for Power key
- MODS_TAP_KEY(MOD_NONE, KC_POWER) allows Power on tap and commands on hold
2017-02-03 08:55:28 +09:00
tmk
300628e5dc core: Add MOD_NONE to mods_bit enum 2017-02-03 08:54:17 +09:00
tmk
778dc7fe08 Merge branch 'kl27z' 2017-01-26 21:43:15 +09:00
tmk
2d0e02efe0 Add keyboard/kl27z_kbd 2017-01-26 21:26:07 +09:00
tmk
657193dd6c Fix filename and Makefile 2017-01-26 21:26:07 +09:00
tmk
9ea5931785 Add pinout on README 2017-01-26 21:26:07 +09:00
tmk
c7a79ff47e Add kl27z_onekey project initial files 2017-01-26 21:26:07 +09:00
tmk
0de581ee82 hhkb: Fix startup of rn42 #407
- Enable build option INTERRUPT_CONTROL_ENDPOINT of LUFA
- Shorten LED blink at startup
2017-01-25 14:32:13 +09:00
tmk
cefaa07bb7 hhkb: Update binary 2017-01-23 10:16:47 +09:00
tmk
b5875f5648 hhkb: Update binaries 2017-01-23 10:07:46 +09:00
di0ib
a7b205dd5c Merge branch 'master' of https://github.com/di0ib/tmk_keyboard 2017-01-14 17:57:11 -10:00
di0ib
5cff692d79 Merge remote-tracking branch 'refs/remotes/tmk/master' 2017-01-14 17:56:30 -10:00
tmk
badbd1099b adb_usb: Update binary 2017-01-14 15:53:36 +09:00
tmk
530818b2ab alps64: Change keymap 2017-01-11 14:28:32 +09:00
tmk
c0f0909051 core: Fix LAYER_MODS() and LAYER_TAP()
- LAYER_MODS() accepts either left or right modifiers
- LAYER_TAP() can use modifier as tap key, related to #422
2017-01-11 10:30:47 +09:00
tmk
be80ed2ef3 core: Cancel removing IS_ANY() at c98e89f
IS_ANY() is used in usb_usb
2017-01-05 21:17:29 +09:00
tmk
39aeb1f7a2 hhkb: update firmware binaries 2017-01-04 13:02:23 +09:00
tmk
c98e89f2d5 core: Modifiers can be used as tap key Fix #422 2017-01-04 12:51:13 +09:00
di0ib
d600905b1c Update readme.md 2017-01-03 11:38:28 -10:00
di0ib
84c0245dc8 Update readme.md 2017-01-03 11:38:04 -10:00
di0ib
8b04b7c1b0 Update readme.md 2016-12-31 10:06:01 -10:00
di0ib
35b683e5b8 Update readme.md 2016-12-31 10:05:31 -10:00
di0ib
80a57c0e99 Update readme.md 2016-12-31 09:53:50 -10:00
di0ib
f671ff8c73 Update readme.md 2016-12-31 09:53:07 -10:00
di0ib
c0f9649e7c BOM update 2016-12-31 09:36:24 -10:00
di0ib
44ed692394 Update readme.md 2016-12-28 19:04:16 -10:00
di0ib
c6f07db4ce Update readme.md 2016-12-28 19:03:32 -10:00
di0ib
2b24fcbfe3 gherkin rgb 2016-12-28 16:49:24 -10:00
tmk
2e464737aa hhkb: Move functions which communicate with RN42 2016-12-26 12:15:39 +09:00
tmk
f4a20304e4 hhkb: Pin setting for power saving 2016-12-21 13:53:20 +09:00
tmk
1713aaa6ff sun_usb: Fix keymap code 2016-12-21 11:06:47 +09:00
Aristeu Rozanski
5036662151 sun_usb: support US ESC key
Model 5 can also have ESC button between HELP and F1.
2016-12-21 09:14:34 +09:00
tmk
525e42f6bc Merge pull request #416 from louisrousseau/master
adb_usb/matrix.c : changed size of handler_id from uint16_t to uint8_t
2016-12-20 16:30:26 +09:00
tmk
d5689296ab core: Fix for ChibiOS update #411 2016-12-20 15:16:34 +09:00
Louis Rousseau
cccd4186f4 adb_usb/matrix.c : changed size of handler_id from uint16_t to uint8_t 2016-12-19 01:51:11 -05:00
tmk
8727b9645f adb_usb: Fix keymap macro 2016-12-18 08:05:03 +09:00
di0ib
90b4de1539 added BOM 2016-12-14 16:56:58 -10:00
tmk
1cc704c126 Merge branch 'adb_led_fix' 2016-12-10 14:54:18 +09:00
tmk
af667a0550 adb_usb: set_led at startup 2016-12-10 14:50:20 +09:00
tmk
62e92645e6 sun_usb: Turn out LED after matrix init 2016-12-10 13:10:33 +09:00
tmk
74019c8e41 Merge commit '22b6e15a179031afb7c3534cf7b109b0668b602c' 2016-12-10 10:29:51 +09:00
tmk
22b6e15a17 Squashed 'tmk_core/' changes from 8da1898..e5f9940
e5f9940 Merge commit '1bc3dd200b023cecf063a0cb3ba347f77f6d759d' into core_update
da03c50 Add note for L/R side bit being ignored
e80f3c1 Add in basic documentation for Macro system
35e8a76 core: Swap position of PEQL and PENT in unimap
00751f1 Merge pull request #406 from 39aldo39/patch-1
e50d7de V-USB remote wakeup
4340997 core: Fix typo in definition AC_g
958144d core: Debug print for system and consumer keys
e7e1030 core: Fix sleep_led
0866323 core: Change matrix_init and matrix_print
0dbf73d core: Add matrix_clear() and default impl.
3202ca3 core: Add suspend mode options
4cda3aa core: Fix suspend/wake for converters #386
4e15247 core: LUFA_DEBUG_SUART for serial debug
b9cf8e7 core: Fix mechanical locking supoort #390
12aa0fd Merge branch 'nemith-master'
fccb3fa core: Fix OPT_DEFS for mbed build
2e2d2c8 Merge branch 'master' of github.com:leizzer/tmk_keyboard
f1d3634 Change .gitignore for ChibiOS
3aab802 core: Fix build config in protocol.mk
5e43da0 core: Add short names in unimap
7a56998 core: Fix dfu wait in rules.mk
6d9c500 Merge branch 'mediakey-fix'
08382ac core: Fix 'make dfu' message
78cb04e Fix OS X Recognizing keyboard as Mouse/Tablet
a114714 core: 'make dfu' waits for bootloader to start
d0a8f13 core: Fix unimap UNIMAP_NO case
e17abef core: Change lufa NKRO report size 16 to 32 bytes
375b20f core: Fix common.mk for build options
394fdff core: Fix unimap layout comment
912326c core: Add unimap support
00f4011 core: Fix doc/keymap.md for new keymap framework
ddbd7b4 core: Add default implemenation of keymap read
671cacc core: action codes are action_t struct now
b4fdb27 core: Change chibios repo directory names
7daed10 core: Fix keycode.txt
90399d7 core: Fix USB remote wakeup on ATmega32U2 #361
3677e84 usb_usb: Add multiple keyboard support
54d5b26 core: Fix Logical Maximum in report descriptor
bd0d372 core: Fix LUFA report descriptor
95327b5 Merge pull request #355 from papodaca/XT
62bf548 core: change API of adb.c to accept device address
3097c9e Fix function name in host.h
836e209 Merge branch 'core_split_160522'
3918ea2 Merge commit '20b787fc1284176834cbe7ca2134e4b36bec5828'
7f87b11 core: Add comment of register 3 of ADB
ef6478a core: Add adb_host_talk()
5c665b4 update macro names in bluefruit
4f2c5bf Merge commit '71381457fa1311dfa0b58ba882a96db740640871'
53a9c08 Merge pull request #321 from njbair/master
f08a656 core: Fix media/consumer keys
d526de8 Clean up wording in keymap example
0bb3dbb Clarify layer precedence
d915c75 clarify layer documentation
72070d4 ps2_usb: Fix for VUSB configuration
170e2dc Mostly working. Is unstable, will emit bad codes after a while.
c8e45b5 core: Actionmap support
aabaa24 Codes appear to be detected correctly, the break codes are broken.

git-subtree-dir: tmk_core
git-subtree-split: e5f994033cbc8700745ac0c6d12772820492eed0
2016-12-10 10:29:51 +09:00
di0ib
bb7df0cb7f fourtytwo 2016-12-08 19:14:03 -10:00
di0ib
68d0bd2de0 pcb images 2016-12-07 11:58:27 -10:00
di0ib
6029e9d6f4 add images 2016-12-07 11:58:08 -10:00
di0ib
fe9e783ff7 Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-12-06 19:32:50 -10:00
di0ib
7b5e3fbd25 update keymap 2016-12-06 19:32:25 -10:00
di0ib
f7ff3326e0 nano 2016-12-06 18:59:02 -10:00
tmk
4105939349 Merge pull request #414 from tanant/macro_documentation
Update documentation for Macro function and action_layer_mods
2016-12-06 04:51:14 +09:00
Anthony
a499c19cd0 Add note for L/R side bit being ignored 2016-12-04 16:46:43 +11:00
Anthony
a6a6d4ab49 Add in basic documentation for Macro system 2016-12-04 16:46:42 +11:00
di0ib
749994176b assembled image 2016-11-29 09:09:13 -10:00
di0ib
976434220e gerber 2016-11-29 09:08:14 -10:00
di0ib
10ed4ceb6b Create readme.md 2016-11-29 09:07:45 -10:00
tmk
a88ad58342 core: Swap position of PEQL and PENT in unimap 2016-11-30 00:15:12 +09:00
tmk
ec60203fd7 ps2_usb: Support for hidden switch in model M 2016-11-30 00:15:12 +09:00
tmk
a6f725d2bc Merge pull request #406 from 39aldo39/patch-1
core: Fix typo in definition AC_g
2016-11-29 22:53:31 +09:00
tmk
611a9388f9 Merge pull request #410 from erikpe/master
phantom: Fix compile error and incorrectly aligned ISO layout
2016-11-29 22:52:48 +09:00
tmk
7ecbdf3b41 Merge pull request #409 from luizribeiro/vusb-remote-wakeup
V-USB remote wakeup
2016-11-29 22:49:43 +09:00
di0ib
7eeeee5bda gherkin pcb 2016-11-28 19:51:33 -10:00
Erik Pettersson
ed538bdeb4 Fix error in media layer for phantom iso keymap. 2016-11-28 13:19:50 +01:00
Luiz Ribeiro
391c979be7 V-USB remote wakeup 2016-11-27 15:33:42 -05:00
Erik Pettersson
d14f72e2f7 Fix to make phantom board compile 2016-11-26 09:58:21 +01:00
di0ib
0193c4a592 readme updated 2016-11-17 14:16:42 -10:00
di0ib
2b297a03bb kwark 1.1 gerbers 2016-11-17 14:13:12 -10:00
di0ib
0133725f07 images 2016-11-16 10:19:33 -10:00
Aldo Gunsing
54a1934607 core: Fix typo in definition AC_g 2016-11-14 23:30:06 +01:00
di0ib
98225c31a6 gherkin 2016-11-12 20:31:25 -10:00
di0ib
5b05207b69 gerbers 2016-11-11 06:20:33 -10:00
di0ib
94fca00ca0 images updated 2016-11-09 18:22:01 -10:00
di0ib
247b72f40e update readme 2016-11-09 18:11:46 -10:00
di0ib
a92ed59319 keymap update 2016-11-09 17:39:25 -10:00
di0ib
38870d02ec Flanck 3.0 gerbers 2016-11-02 16:32:30 -10:00
di0ib
5b05922917 update readme 2016-11-01 07:42:18 -10:00
di0ib
014dda9bcd updated images 2016-11-01 07:39:48 -10:00
di0ib
fcd7278e3c images 2016-11-01 07:39:16 -10:00
di0ib
eb8a6cd4bf mf68 2016-11-01 07:35:01 -10:00
di0ib
8244820f44 add images to readme.md 2016-10-26 08:06:56 -10:00
di0ib
86907f1c10 gnap 2.0 files 2016-10-26 08:00:45 -10:00
di0ib
9f0a35e29e 2.0 readme 2016-10-26 07:57:24 -10:00
di0ib
9531f5f5bc added license 2016-10-24 16:19:41 -10:00
di0ib
ed20c38cf0 typo 2016-10-24 12:18:24 -10:00
di0ib
0e0ec178c2 Added CC BY-SA 4.0 license to gerber files 2016-10-24 12:18:06 -10:00
di0ib
4f43b1b2e0 pcb changes 2016-10-24 09:07:05 -10:00
di0ib
56aae31c3e pcb images 2016-10-24 09:05:54 -10:00
di0ib
57481f760f gnap gerbers 2016-10-24 09:04:37 -10:00
di0ib
530605b106 pcb readme 2016-10-24 08:58:42 -10:00
di0ib
4f08187275 update keymap 2016-10-23 19:09:53 -10:00
di0ib
bcf7b7d4e1 Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-10-23 00:09:37 -10:00
di0ib
ffd33c9d27 Revert "Revert "keymp updated""
This reverts commit ab79a8b6b9477e05ad947a7d0b4911d5a2974f4b.
2016-10-22 20:45:42 -10:00
di0ib
e7e1aaa20b Revert "keymp updated"
This reverts commit a75cb2ed50e92f0db2ea86a7189227e58bce5b6d.
2016-10-22 20:45:41 -10:00
di0ib
9abc4b89d9 keymp updated 2016-10-22 20:45:41 -10:00
tmk
093bfd6901 alps64: unimap definition 2016-10-21 15:52:53 +09:00
tmk
03afc07161 hhkb: Change unimap files 2016-10-21 14:28:53 +09:00
di0ib
75e2d62f58 EasyEDA info 2016-10-20 12:12:02 -10:00
di0ib
61b54bd6ee Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-10-19 19:36:03 -10:00
di0ib
3b816b9593 pro micro LEDs as capslock indicator 2016-10-19 19:34:17 -10:00
di0ib
63724f441e kwark bootloader 2016-10-19 16:08:28 -10:00
di0ib
ccbd31cd7e kwark pcb 2016-10-19 15:59:53 -10:00
di0ib
2853e56106 kwark 1.0 2016-10-19 15:52:15 -10:00
tmk
51326077b0 usb_usb: Restore LED state when plugging keyboard 2016-10-18 15:10:43 +09:00
tmk
ec06a3f9f5 core: Debug print for system and consumer keys 2016-10-18 14:34:47 +09:00
tmk
6b34906bba alps64: Add unimap support 2016-10-12 20:23:02 +09:00
tmk
5969d6267f core: Fix sleep_led 2016-10-12 14:35:53 +09:00
tmk
e7b8da47ce hhkb: Update binary 2016-10-09 13:29:45 +09:00
di0ib
6c9ad11f12 Merge branch 'master' of https://github.com/di0ib/tmk_keyboard 2016-10-08 00:03:54 -10:00
di0ib
757b054c44 Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-10-08 00:03:46 -10:00
tmk
f699291e2a Merge branch 'matrix-fix' 2016-10-08 13:15:00 +09:00
tmk
1ad31539a6 Fix matrix.c to use new default impl. 2016-10-08 13:14:06 +09:00
tmk
f57d834f13 core: Change matrix_init and matrix_print 2016-10-08 13:13:48 +09:00
tmk
cb9480877d onkey: Fix keymap.c 2016-10-08 11:02:34 +09:00
tmk
8b509aa111 Fix Makefile for NKRO comment 2016-10-07 10:58:54 +09:00
tmk
024f0c8d38 Merge branch 'matrix-clear' 2016-10-05 14:02:52 +09:00
tmk
124bafe9f3 Fix matrix_clear() for new matrix API 2016-10-05 14:00:48 +09:00
tmk
f76a786b93 core: Add matrix_clear() and default impl. 2016-10-05 13:55:56 +09:00
di0ib
bf39006e88 update function keys 2016-10-04 11:08:11 -10:00
di0ib
28e6220738 update function keys 2016-10-04 11:07:31 -10:00
tmk
1a7d1f9f4d ps2_usb: Use standby mode in suspend 2016-10-04 16:08:06 +09:00
tmk
8f969d6544 core: Add suspend mode options 2016-10-04 16:05:18 +09:00
tmk
9818d54d26 core: Fix suspend/wake for converters #386 2016-10-04 16:02:24 +09:00
tmk
435a1d3341 ps2_usb: Fix set led status at startup 2016-10-04 10:21:57 +09:00
tmk
350897112b ps2_usb: Add setting for suart debug 2016-10-04 10:21:46 +09:00
di0ib
8401fd892f fn layer update 2016-10-03 11:46:54 -10:00
di0ib
dfb110d14a fn layer update 2016-10-03 11:44:57 -10:00
tmk
8758035677 core: LUFA_DEBUG_SUART for serial debug 2016-10-03 13:10:53 +09:00
di0ib
8d7f811a80 Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-10-02 12:15:09 -10:00
di0ib
f7fabd63e2 makefiles updated 2016-09-30 16:21:57 -10:00
di0ib
91dbfbbeb1 update for action_t 2016-09-30 16:11:28 -10:00
di0ib
f442303e33 update actions 2016-09-30 15:55:43 -10:00
tmk
5e97fd78cb ibm4707_usb: unimap 2016-09-30 12:36:27 +09:00
di0ib
b3210fb530 flanck
flanck with WS2812B support
2016-09-25 20:01:51 -10:00
tmk
e5598487e6 adb_usb: Fix unimap 2016-09-26 09:02:52 +09:00
tmk
88c95615b9 core: Fix mechanical locking supoort #390 2016-09-26 08:51:45 +09:00
di0ib
9c2699fba6 teensy readme updated 2016-09-25 11:41:31 -10:00
di0ib
335e6ff933 i75 Teensy LC 2016-09-25 11:38:02 -10:00
di0ib
2ffe783587 Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-09-25 10:54:46 -10:00
di0ib
b362afb90c i75, cleanup keymaps
added i75
2016-09-25 08:39:29 -10:00
tmk
b9a1cd21e1 Merge branch 'nemith-master' 2016-09-24 11:35:34 +09:00
tmk
0523b4fd8e infinity: Add Makefiles and fix for INFINITY_LED 2016-09-24 11:30:57 +09:00
tmk
d356afb930 core: Fix OPT_DEFS for mbed build 2016-09-24 11:29:21 +09:00
tmk
c7651089f2 Merge branch 'master' of https://github.com/nemith/tmk_keyboard into nemith-master 2016-09-24 11:00:31 +09:00
tmk
66b088e30e Merge pull request #385 from leizzer/master
Teensy Chibios changes to gitignore and instructions
2016-09-24 10:39:28 +09:00
tmk
8e83ad537e Merge pull request #389 from tmk/sun_usb_command_fix
sun_usb: Fix command help #387
2016-09-24 10:21:08 +09:00
tmk
f88a0f7f06 sun_usb: Fix command help #387 2016-09-24 10:18:05 +09:00
leizzer
b25faf875e fix folder name 2016-09-22 02:09:27 -03:00
leizzer
be9c293574 Update teensy_lc_onekey instructions 2016-09-22 01:55:13 -03:00
leizzer
112cadb188 Merge branch 'master' of github.com:leizzer/tmk_keyboard 2016-09-22 01:40:53 -03:00
leizzer
d13a1d5076 Change .gitignore for ChibiOS
I changed the gitignore file to match the chibios.mk declaration.
Also it will be easier, you just clone ChibiOS and ChibiOS-Contrib and
you don't have to rename nothing.
2016-09-22 01:38:26 -03:00
tmk
e21e6164ef ps2_usb: Change unimap 2016-09-19 13:21:50 +09:00
di0ib
5425f57f57 update keymap 2016-09-18 10:51:29 -10:00
di0ib
4aa10b36ba Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-09-18 10:51:16 -10:00
di0ib
f700d01c6f make flashbin
output binary file for LUFA mass storage bootloader
2016-09-17 08:36:48 -10:00
di0ib
fe97a8eba0 cleanup spacing 2016-09-17 08:22:27 -10:00
di0ib
0448cf3394 cleanup 2016-09-16 20:32:56 -10:00
di0ib
2bf5c97afa Update readme 2016-09-16 20:29:44 -10:00
di0ib
37d06ecbb7 GNAP keyboard
GNAP dual controller dual matrix reactive LED
2016-09-16 20:25:48 -10:00
tmk
fa32e4d870 Merge branch 'ps2_unimap' 2016-09-17 12:02:46 +09:00
tmk
f27e1bc7cf ps2_usb: Add unimap 2016-09-17 11:53:20 +09:00
tmk
5ee5b6bd7e ps2_usb: Change Makefiles 2016-09-17 11:44:54 +09:00
tmk
1c1f7b14e3 core: Fix build config in protocol.mk 2016-09-16 11:47:12 +09:00
di0ib
d3d1814e6d Merge remote-tracking branch 'refs/remotes/tmk/master' 2016-09-13 07:27:06 -10:00
tmk
1610250cc3 m0110_usb: Fix target name in Makefiles 2016-09-13 04:33:48 +09:00
tmk
9b17e27605 m0110_usb: Add unimap 2016-09-13 04:22:26 +09:00
tmk
c7fd5fcfb4 adb_usb: Change unimap 2016-09-12 12:26:03 +09:00
tmk
85534a747f hhkb: Add binary for bluetooth controller 2016-09-12 10:09:45 +09:00
tmk
659ae2375e usb_usb: Revert name of keymap macro 2016-09-10 12:12:26 +09:00
tmk
e957c1c6f1 usb_usb: Orgnize keymap files 2016-09-10 11:44:59 +09:00
tmk
71a2c1280d Merge branch 'next-unimap' 2016-09-09 14:26:50 +09:00
tmk
9b42a33648 next_usb: Add unimap 2016-09-09 11:26:33 +09:00
tmk
13eab4d9df next_usb: Change keymap 2016-09-09 11:25:21 +09:00
tmk
03007a59da core: Add short names in unimap 2016-09-09 11:24:44 +09:00
tmk
bd68c71e20 core: Fix dfu wait in rules.mk 2016-09-09 09:27:57 +09:00
tmk
dcf10457a7 hhkb: Fix unimap 2016-09-09 00:50:32 +09:00
tmk
e6d1975ea9 Merge branch 'mediakey-fix' 2016-09-08 14:45:35 +09:00
tmk
4703afac2f core: Fix 'make dfu' message 2016-09-08 14:45:12 +09:00
Travis La Marr
b2d791804d Fix OS X Recognizing keyboard as Mouse/Tablet
Modified the LUFA USB HID Descriptor to change the logical/usage
minimums for System Control from 0x01 (Mouse) to 0x81 (System Power
Down), this fixes OS X recognizing the Planck as having a mouse and
tablet, even with mousekeys off.
2016-09-08 14:35:21 +09:00
tmk
e5acff0312 core: 'make dfu' waits for bootloader to start
jackhumbert/qmk_firmware@0b8c448
2016-09-08 13:52:59 +09:00
tmk
384562bc8a core: Fix unimap UNIMAP_NO case 2016-09-08 13:18:05 +09:00
tmk
144a048393 usb_usb: Change keymap 2016-09-07 16:04:25 +09:00
tmk
d119bba0b7 Merge branch 'nkro32' 2016-09-07 11:00:14 +09:00
tmk
e754e11b42 hhkb: Enable NKRO for jp 2016-09-07 09:53:02 +09:00
tmk
61cad24a87 core: Change lufa NKRO report size 16 to 32 bytes 2016-09-07 05:50:25 +09:00
tmk
d46651b1a9 usb_usb: Fix unimap layout 2016-09-02 14:11:30 +09:00
tmk
7d0294ab8f Change gitignore for unimap hex files 2016-09-02 13:48:20 +09:00
tmk
fef48a3da5 usb_usb: Add unimap 2016-09-02 13:45:47 +09:00
tmk
765d82e8b1 core: Fix common.mk for build options 2016-08-31 16:40:32 +09:00
tmk
d96f295106 hhkb: Organize Makefiles for unimap 2016-08-31 16:40:04 +09:00
tmk
6bc7bab6a5 core: Fix unimap layout comment 2016-08-30 12:49:59 +09:00
tmk
ab02ffd09e hhkb: Add unimap for hhkb 2016-08-30 12:49:27 +09:00
tmk
81a0d94660 hhkb: Change unimap hex file name 2016-08-30 11:38:37 +09:00
tmk
39d4f923cd Merge branch 'unimap' 2016-08-30 11:22:14 +09:00
tmk
8027dc51f4 adb_usb: Fix keypad and media keys of unimap 2016-08-30 11:18:42 +09:00
tmk
4ace8711ca adb_usb: Add hex files for unimap editor 2016-08-29 15:16:56 +09:00
tmk
22a48dab7b adb_usb: Change Makfiles 2016-08-29 14:46:56 +09:00
tmk
42dfaa3a39 adb_usb: Fix capslock of unimap 2016-08-29 14:38:38 +09:00
tmk
935c426932 Add unimap firmware hex file 2016-08-29 13:54:44 +09:00
tmk
8ceb86bc2f hhkb: Add unimap_jp 2016-08-29 13:54:44 +09:00
tmk
1eec163213 adb_usb: Add unimap_plain 2016-08-29 13:54:44 +09:00
tmk
e84a5981e3 core: Add unimap support 2016-08-29 13:54:44 +09:00
tmk
1b5266cb6e core: Fix doc/keymap.md for new keymap framework 2016-08-29 13:54:44 +09:00
tmk
7b31d1b9d9 Remove keymap read code from project directories 2016-08-29 13:54:44 +09:00
tmk
19dca3def8 core: Add default implemenation of keymap read 2016-08-29 13:54:44 +09:00
tmk
c04b6bec89 Fix: Use action_t in keymap files 2016-08-29 13:54:44 +09:00
tmk
e5cb8469af core: action codes are action_t struct now 2016-08-29 13:54:44 +09:00
tmk
9839bb83d9 core: Change chibios repo directory names 2016-08-08 13:35:11 +09:00
di0ib
d654df2102 STM planck 2016-07-30 17:35:45 -10:00
tmk
bd0f670345 core: Fix keycode.txt 2016-07-31 02:00:26 +09:00
di0ib
91d31dc392 TV44 and Planck 2016-07-29 21:01:43 -10:00
Brandon Bennett
ee2c18f0cd Add support for Infinity 60% 1.1a
The newest version of the Infinity keyboard has a slightly different
matrix and LED support.

This just adds support for the matrix.

Flashed and tested on my IC60 1.1a.
2016-07-22 00:16:23 -06:00
tmk
2983af4f9a Merge pull request #365 from p3lim/patch-1
README missing link
2016-06-23 14:08:18 +09:00
Adrian L Lange
38ab23568e README missing link 2016-06-22 13:51:19 +02:00
tmk
e590b64703 Update orphan/README.md 2016-06-22 12:54:14 +09:00
tmk
649151cbeb Merge branch 'orphans' 2016-06-22 11:37:24 +09:00
tmk
885e7adb18 Move some projects to 'orphan' directory 2016-06-22 11:32:37 +09:00
936 changed files with 89814 additions and 3401 deletions

2
.gitignore vendored
View File

@ -12,3 +12,5 @@ tags
build/ build/
*.bak *.bak
.DS_Store .DS_Store
!converter/*/binary/*.hex
!keyboard/*/binary/*.hex

View File

@ -1,12 +1,22 @@
TMK Keyboard Firmware Collection TMK Keyboard Firmware Collection
================================ ================================
This is a keyboard firmware with some useful features for Atmel AVR controller. This repository includes keyboard and converter firmware projects built with [`tmk_core`][tmk_core] keyboard library.
Source code is available here: <http://github.com/tmk/tmk_keyboard> The latest source code is available here: <http://github.com/tmk/tmk_keyboard>
Updates Updates
------- -------
#### 2017/01/11
Changed action code for `ACTION_LAYER_MODS` and this may cause incompatibility with existent shared URL and downloaded firmwware of keymap editor. If you are using the action you just have to redefine it on keymap editor. Existent keymap code should not suffer.
#### 2016/06/26
Keymap framework was updated. `fn_actions[]` should be defined as `action_t` instead of `uint16_t`. And default code for keymap handling is now included in core you just need define `uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]` and `action_t fn_actions[]`.
#### 2016/06/22
Some projects were moved from `converter` and `keyboard` to `orphan` directory. Those might be removed in some future but you will be able to access them with `orphans` tag. See <https://github.com/tmk/tmk_keyboard/issues/173>
#### 2016/02/10 #### 2016/02/10
core: flabbergast's Chibios protocol was merged from <https://github.com/flabbergast/tmk_keyboard/tree/chibios> (@72b1668). See [tmk_core/protocol/chibios/README.md](tmk_core/protocol/chibios/README.md). Chibios protocol supports Cortex-M such as STM32 and Kinetis. core: flabbergast's Chibios protocol was merged from <https://github.com/flabbergast/tmk_keyboard/tree/chibios> (@72b1668). See [tmk_core/protocol/chibios/README.md](tmk_core/protocol/chibios/README.md). Chibios protocol supports Cortex-M such as STM32 and Kinetis.
@ -19,28 +29,6 @@ In `Makefile` you need to set `TMK_DIR` to indicate core library location now.
Features
--------
These features can be used in your keyboard.
* Multi-layer Keymap - Multiple keyboard layouts with layer switching
* Mouse key - Mouse control with keyboard
* System Control Key - Power Down, Sleep, Wake Up and USB Remote Wake up
* Media Control Key - Volume Down/Up, Mute, Next/Prev track, Play, Stop and etc
* USB NKRO - 120 keys(+ 8 modifiers) simultaneously
* PS/2 mouse support - PS/2 mouse(TrackPoint) as composite device
* Keyboard protocols - PS/2, ADB, M0110, Sun and other old keyboard protocols
* User Function - Customizable function of key with writing code
* Macro - Very primitive at this time
* Keyboard Tricks - Oneshot modifier and modifier with tapping feature
* Debug Console - Messages for debug and interaction with firmware
* Virtual DIP Switch - Configurations stored EEPROM(Boot Magic)
* Locking CapsLock - Mechanical switch support for CapsLock
* Breathing Sleep LED - Sleep indicator with charm during USB suspend
* Backlight - Control backlight levels
Projects Projects
-------- --------
You can find some keyboard specific projects under `converter` and `keyboard` directory. You can find some keyboard specific projects under `converter` and `keyboard` directory.
@ -54,32 +42,23 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
* [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k] * [x68k_usb](converter/x68k_usb/) - [Sharp X68000 keyboard to USB][GH_x68k]
* [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?) * [sun_usb](converter/sun_usb/) - [Sun] to USB(type4, 5 and 3?)
* [pc98_usb](converter/pc98_usb/) - [PC98] to USB * [pc98_usb](converter/pc98_usb/) - [PC98] to USB
* [usb_usb](converter/usb_usb/) - USB to USB(experimental) * [usb_usb](converter/usb_usb/) - [USB to USB][GH_usb]
* [ascii_usb](converter/ascii_usb/) - ASCII(Serial console terminal) to USB * [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard to USB][GH_ibm4704]
* [ibm4704_usb](converter/ibm4704_usb) - [IBM 4704 keyboard Converter][GH_ibm4704] * [next_usb](converter/next_usb) - NeXT(Non-ADB) to USB, contributed by [BCG](https://github.com/bgould) and based on [Adafruit's work](https://learn.adafruit.com/usb-next-keyboard-with-arduino-micro/overview)
### keyboard ### keyboard
* [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] **my main board** * [hhkb](keyboard/hhkb/) - [Happy Hacking Keyboard pro][GH_hhkb] **my main board**
* [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board** * [alps64](keyboard/alps64/) - [Alps64 PCB](https://geekhack.org/index.php?topic=69740.0)
* [hbkb](keyboard/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod) * [hbkb](keyboard/hbkb/) - [Happy Buckling spring keyboard][GH_hbkb](IBM Model M 60% mod)
* [hid_liber](keyboard/hid_liber/) - [HID liberation][HID_liber] controller (by alaricljs)
* [phantom](keyboard/phantom/) - [Phantom] keyboard (by Tranquilite)
* [IIgs_Standard](keyboard/IIgs/) - Apple [IIGS] keyboard mod(by JeffreySung)
* [macway](keyboard/macway/) - [Compact keyboard mod][GH_macway] [retired]
* [KMAC](keyboard/kmac/) - Korean custom keyboard
* [Lightsaber](keyboard/lightsaber/) - Korean custom keyboard
* [Infinity](keyboard/infinity/) - Massdrop [Infinity keyboard][Infinity] * [Infinity](keyboard/infinity/) - Massdrop [Infinity keyboard][Infinity]
* [NerD](keyboard/nerd/) - Korean custom keyboard * [gh60](keyboard/gh60/) - [GH60] DIY 60% keyboard [prototype][GH60_proto] **my second board**
* [KittenPaw](keyboard/kitten_paw) - Custom Majestouch controller * [onekey](keyboard/onekey/) - Simple one key keyboard example
* [Lightpad](keyboard/lightpad) - Korean custom keypad
* [ghost_squid](keyboard/ghost_squid/) - [The Ghost Squid][ghost_squid] controller for [Cooler Master QuickFire XT][cmxt]
### Projects based tmk_keyboard or tmk_core
### External projects using tmk_keyboard https://github.com/tmk/tmk_keyboard/wiki/TMK-Based-Projects
* [ErgoDox_cub-uanic][cub-uanic] - Split Ergonomic Keyboard [ErgoDox][ergodox_org]
* [mcdox][mcdox_tmk] - [mcdox][mcdox]
[GH_macway]: http://geekhack.org/showwiki.php?title=Island:11930
[GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047 [GH_hhkb]: http://geekhack.org/showwiki.php?title=Island:12047
[GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618 [GH_ps2]: http://geekhack.org/showwiki.php?title=Island:14618
[GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290 [GH_adb]: http://geekhack.org/showwiki.php?title=Island:14290
@ -90,20 +69,12 @@ You can find some keyboard specific projects under `converter` and `keyboard` di
[GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060 [GH_x68k]: http://geekhack.org/showwiki.php?title=Island:29060
[GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483 [GH_hbkb]: http://geekhack.org/showwiki.php?title=Island:29483
[GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0 [GH_ibm4704]: http://geekhack.org/index.php?topic=54706.0
[HID_liber]: http://deskthority.net/wiki/HID_Liberation_Device_-_DIY_Instructions
[Phantom]: http://geekhack.org/index.php?topic=26742
[GH60]: http://geekhack.org/index.php?topic=34959 [GH60]: http://geekhack.org/index.php?topic=34959
[GH60_proto]: http://geekhack.org/index.php?topic=37570.0 [GH60_proto]: http://geekhack.org/index.php?topic=37570.0
[PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801 [PC98]: http://en.wikipedia.org/wiki/NEC_PC-9801
[Sun]: http://en.wikipedia.org/wiki/Sun-3 [Sun]: http://en.wikipedia.org/wiki/Sun-3
[IIGS]: http://en.wikipedia.org/wiki/Apple_IIGS
[Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit [Infinity]: https://www.massdrop.com/buy/infinity-keyboard-kit
[ghost_squid]: http://deskthority.net/wiki/Costar_replacement_controllers#The_Ghost_Squid [tmk_core]: https://github.com/tmk/tmk_core
[cmxt]: http://gaming.coolermaster.com/en/products/keyboards/quickfirext/
[ergodox_org]: http://ergodox.org/
[cub-uanic]: https://github.com/cub-uanic/tmk_keyboard/tree/master/keyboard/ergodox
[mcdox]: https://github.com/DavidMcEwan/mcdox
[mcdox_tmk]: https://github.com/DavidMcEwan/tmk_keyboard/tree/master/keyboard/mcdox
@ -131,7 +102,7 @@ Magic Commands
-------------- --------------
To see help press `Magic` + `H`. To see help press `Magic` + `H`.
`Magic` key combination is `LShift` + `RShift` in many project, but `Power` key on ADB converter. `Magic` key combination is `LShift` + `RShift` in many projects, but `Power` key on ADB converter.
`Magic` keybind can be vary on each project, check `config.h` in project directory. `Magic` keybind can be vary on each project, check `config.h` in project directory.
Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed. Following commands can be also executed with `Magic` + key. In console mode `Magic` keybind is not needed.
@ -214,15 +185,21 @@ ync option tries to keep switch state consistent with keyboard LED state.
Start Your Own Project Start Your Own Project
----------------------- -----------------------
**TBD** 1. Add `tmk_core` into your repository using `git submodule` or `git subtree`.
2. Copy files from `tmk_keybaord` or other project similar to yours
3. Edit those files to support your keyboard.
See these as examples.
- https://github.com/tmk/infinity_ergodox
- https://github.com/tmk/whitefox
Debugging Debugging
-------- --------
Use PJRC's `hid_listen` to see debug messages. You can use the tool for debug even if firmware use LUFA stack. Use PJRC's `hid_listen` to see debug messages. You can use xprintf() to display debug info, see `tmk_core/common/xprintf.h`.
You can use xprintf() to display debug info on `hid_listen`, see `tmk_core/common/xprintf.h`. - https://www.pjrc.com/teensy/hid_listen.html
@ -236,6 +213,13 @@ Files and Directories
Contribution
------------
- Report bugs in github **[Issues](https://github.com/tmk/tmk_keyboard/issues)**.
- Pull requets are also welcomed.
Coding Style Coding Style
------------- -------------
- Doesn't use Tab to indent, use 4-spaces instead. - Doesn't use Tab to indent, use 4-spaces instead.

View File

@ -1,64 +1,17 @@
#----------------------------------------------------------------------------
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
# Target file name (without extension). # Target file name (without extension).
TARGET = adb_usb_lufa TARGET ?= adb_usb
# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = . TARGET_DIR ?= .
# project specific files # project specific files
SRC = keymap_common.c \ SRC ?= matrix.c \
matrix.c \
led.c \ led.c \
adb.c adb.c
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_plain.c $(SRC)
endif
CONFIG_H = config.h CONFIG_H = config.h
@ -66,7 +19,7 @@ CONFIG_H = config.h
# atmega32u4 Teensy2.0 # atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1 # atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2 # atemga32u2 TMK Converter rev.2
MCU = atmega32u2 MCU ?= atmega32u2
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
@ -79,14 +32,14 @@ MCU = atmega32u2
# does not *change* the processor frequency - it should merely be updated to # does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000 F_CPU ?= 16000000
# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
@ -99,7 +52,7 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -125,6 +78,9 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover #NKRO_ENABLE = yes # USB Nkey Rollover
ADB_MOUSE_ENABLE = yes ADB_MOUSE_ENABLE = yes
#UNIMAP_ENABLE = yes
#ACTIONMAP_ENABLE = yes # Use 16bit actionmap instead of 8bit keymap
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
# ADB Mice need acceleration for todays much bigger screens. # ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8 OPT_DEFS += -DADB_MOUSE_MAXACC=8
@ -133,6 +89,26 @@ OPT_DEFS += -DADB_MOUSE_MAXACC=8
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax #EXTRALDFLAGS = -Wl,--relax
#
# Keymap file
#
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else
ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE)_plain.c $(SRC)
endif
# Search Path # Search Path
VPATH += $(TARGET_DIR) VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR) VPATH += $(TMK_DIR)

View File

@ -1,143 +1,3 @@
#---------------------------------------------------------------------------- TARGET = adb_usb_rev1
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
# Target file name (without extension).
TARGET = adb_usb_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# project specific files
SRC = keymap_common.c \
matrix.c \
led.c \
adb.c
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_ansi.c $(SRC)
endif
CONFIG_H = config.h
# MCU name
# atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2
MCU = atmega32u4 MCU = atmega32u4
include Makefile
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover
ADB_MOUSE_ENABLE = yes
# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -1,143 +1,3 @@
#---------------------------------------------------------------------------- TARGET = adb_usb_teensy
# On command line:
#
# make all = Make software.
#
# make clean = Clean out built project files.
#
# make coff = Convert ELF to AVR COFF.
#
# make extcoff = Convert ELF to AVR Extended COFF.
#
# make program = Download the hex file to the device.
# Please customize your programmer settings(PROGRAM_CMD)
#
# make teensy = Download the hex file to the device, using teensy_loader_cli.
# (must have teensy_loader_cli installed).
#
# make dfu = Download the hex file to the device, using dfu-programmer (must
# have dfu-programmer installed).
#
# make flip = Download the hex file to the device, using Atmel FLIP (must
# have Atmel FLIP installed).
#
# make dfu-ee = Download the eeprom file to the device, using dfu-programmer
# (must have dfu-programmer installed).
#
# make flip-ee = Download the eeprom file to the device, using Atmel FLIP
# (must have Atmel FLIP installed).
#
# make debug = Start either simulavr or avarice as specified for debugging,
# with avr-gdb or avr-insight as the front end for debugging.
#
# make filename.s = Just compile filename.c into the assembler code only.
#
# make filename.i = Create a preprocessed source file for use in submitting
# bug reports to the GCC project.
#
# To rebuild project do "make clean" then "make all".
#----------------------------------------------------------------------------
# Target file name (without extension).
TARGET = adb_usb_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# project specific files
SRC = keymap_common.c \
matrix.c \
led.c \
adb.c
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_ansi.c $(SRC)
endif
CONFIG_H = config.h
# MCU name
# atmega32u4 Teensy2.0
# atemga32u4 TMK Converter rev.1
# atemga32u2 TMK Converter rev.2
MCU = atmega32u4 MCU = atmega32u4
include Makefile
# Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the
# processor frequency in Hz. You can then use this symbol in your source code to
# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
# automatically to create a 32-bit value in your source code.
#
# This will be an integer division of F_USB below, as it is sourced by
# F_USB after it has run through any CPU prescalers. Note that this value
# does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate
# software delays.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096 for TMK Converter rev.1/rev.2
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=512
# Build Options
# comment out to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover
ADB_MOUSE_ENABLE = yes
# ADB Mice need acceleration for todays much bigger screens.
OPT_DEFS += -DADB_MOUSE_MAXACC=8
# Optimize size but this may cause error "relocation truncated to fit"
#EXTRALDFLAGS = -Wl,--relax
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -0,0 +1,5 @@
TARGET = adb_usb_rev1_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u4
include Makefile

View File

@ -0,0 +1,5 @@
TARGET = adb_usb_rev2_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u2
include Makefile

View File

@ -1,10 +1,10 @@
ADB to USB keyboard converter ADB to USB keyboard converter
============================= =============================
This firmware converts Apple ADB keyboard protocol to USB. You can use TMK Converter, PJRC Teensy2.0 and other USB AVR MCU(ATMega32U4, AT90USB64/128 or etc) for this. But binary size is probably more than 10KB and it won't fit into 8K flash. This firmware converts Apple ADB keyboard protocol to USB, you can use it to plug old ADB keyboard into modern computer. It works on TMK ADB-USB Converter, PJRC Teensy2.0 and other USB AVR MCU(ATMega32U4, AT90USB64/128 or etc) and needs more than 10KB flash at least.
Discuss: http://geekhack.org/showwiki.php?title=Island:14290 Discuss here: http://geekhack.org/showwiki.php?title=Island:14290
TMK Converter: https://geekhack.org/index.php?topic=72052.0 You can buy a TMK converter here: https://geekhack.org/index.php?topic=72052.0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -40,10 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define LOCKING_RESYNC_ENABLE #define LOCKING_RESYNC_ENABLE
/* legacy keymap support */
#define USE_LEGACY_KEYMAP
/* ADB port setting */ /* ADB port setting */
#define ADB_PORT PORTD #define ADB_PORT PORTD
#define ADB_PIN PIND #define ADB_PIN PIND

View File

@ -12,5 +12,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
@ -29,10 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keymap.h" #include "keymap.h"
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];
/* Common layout: ANSI+ISO /* Common layout: ANSI+ISO
* ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------. * ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr|
@ -230,7 +225,7 @@ extern const uint16_t fn_actions[];
K36,K3A,K37, K31, K3B,K3C,K3D, K52, K41,K4C \ K36,K3A,K37, K31, K3B,K3C,K3D, K52, K41,K4C \
) { \ ) { \
{ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
{ KC_##K08, KC_##K09, KC_##K0A KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \ { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F }, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
{ KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \

View File

@ -53,6 +53,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_BSLS), [0] = ACTION_LAYER_TAP_KEY(1, KC_BSLS),
}; };

View File

@ -12,5 +12,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -36,7 +36,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_GRV), [0] = ACTION_LAYER_TAP_KEY(1, KC_GRV),
[1] = ACTION_LAYER_TAP_KEY(1, KC_BSLS), [1] = ACTION_LAYER_TAP_KEY(1, KC_BSLS),
}; };

View File

@ -29,46 +29,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "matrix.h" #include "matrix.h"
#include "report.h" #include "report.h"
#include "host.h" #include "host.h"
#include "led.h"
#if (MATRIX_COLS > 16)
# error "MATRIX_COLS must not exceed 16"
#endif
#if (MATRIX_ROWS > 255)
# error "MATRIX_ROWS must not exceed 255"
#endif
static bool has_media_keys = false; static bool has_media_keys = false;
static bool is_iso_layout = false; static bool is_iso_layout = false;
static bool is_modified = false;
static report_mouse_t mouse_report = {}; static report_mouse_t mouse_report = {};
// matrix state buffer(1:on, 0:off) // matrix state buffer(1:on, 0:off)
#if (MATRIX_COLS <= 8) static matrix_row_t matrix[MATRIX_ROWS];
static uint8_t matrix[MATRIX_ROWS];
#else
static uint16_t matrix[MATRIX_ROWS];
#endif
#ifdef MATRIX_HAS_GHOST
static bool matrix_has_ghost_in_row(uint8_t row);
#endif
static void register_key(uint8_t key); static void register_key(uint8_t key);
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void) void matrix_init(void)
{ {
// LED on // LED on
@ -90,7 +65,7 @@ void matrix_init(void)
// Determine ISO keyboard by handler id // Determine ISO keyboard by handler id
// http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c?v=4.4#L815 // http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c?v=4.4#L815
uint16_t handler_id = adb_host_talk(ADB_ADDR_KEYBOARD, ADB_REG_3); uint8_t handler_id = (uint8_t) adb_host_talk(ADB_ADDR_KEYBOARD, ADB_REG_3);
switch (handler_id) { switch (handler_id) {
case 0x04: case 0x05: case 0x07: case 0x09: case 0x0D: case 0x04: case 0x05: case 0x07: case 0x09: case 0x0D:
case 0x11: case 0x14: case 0x19: case 0x1D: case 0xC1: case 0x11: case 0x14: case 0x19: case 0x1D: case 0xC1:
@ -127,6 +102,8 @@ void matrix_init(void)
// initialize matrix state: all keys off // initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
led_set(host_keyboard_leds());
debug_enable = true; debug_enable = true;
//debug_matrix = true; //debug_matrix = true;
//debug_keyboard = true; //debug_keyboard = true;
@ -208,8 +185,6 @@ uint8_t matrix_scan(void)
uint16_t codes; uint16_t codes;
uint8_t key0, key1; uint8_t key0, key1;
is_modified = false;
codes = extra_key; codes = extra_key;
extra_key = 0xFFFF; extra_key = 0xFFFF;
@ -328,93 +303,12 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline inline
bool matrix_has_ghost(void) matrix_row_t matrix_get_row(uint8_t row)
{
#ifdef MATRIX_HAS_GHOST
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix_has_ghost_in_row(i))
return true;
}
#endif
return false;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline
#if (MATRIX_COLS <= 8)
uint8_t matrix_get_row(uint8_t row)
#else
uint16_t matrix_get_row(uint8_t row)
#endif
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
if (!debug_matrix) return;
#if (MATRIX_COLS <= 8)
print("r/c 01234567\n");
#else
print("r/c 0123456789ABCDEF\n");
#endif
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
#if (MATRIX_COLS <= 8)
pbin_reverse(matrix_get_row(row));
#else
pbin_reverse16(matrix_get_row(row));
#endif
#ifdef MATRIX_HAS_GHOST
if (matrix_has_ghost_in_row(row)) {
print(" <ghost");
}
#endif
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
#if (MATRIX_COLS <= 8)
count += bitpop(matrix[i]);
#else
count += bitpop16(matrix[i]);
#endif
}
return count;
}
#ifdef MATRIX_HAS_GHOST
inline
static bool matrix_has_ghost_in_row(uint8_t row)
{
// no ghost exists in case less than 2 keys on
if (((matrix[row] - 1) & matrix[row]) == 0)
return false;
// ghost exists in case same state as other row
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
if (i != row && (matrix[i] & matrix[row]) == matrix[row])
return true;
}
return false;
}
#endif
inline inline
static void register_key(uint8_t key) static void register_key(uint8_t key)
{ {
@ -426,5 +320,4 @@ static void register_key(uint8_t key)
} else { } else {
matrix[row] |= (1<<col); matrix[row] |= (1<<col);
} }
is_modified = true;
} }

View File

@ -0,0 +1,213 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
/* Apple Extended Keyboard Common layout: ANSI+ISO
* ,---. .---------------. ,---------------. ,---------------. ,-----------. ,---------------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|F24|
* `---' `---------------' `---------------' `---------------' `-----------' `---------------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shif|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent|
* |Ctrl |Alt |Gui | Space |Gui |Alt |Ctrl | |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------'
* Command = Gui
* Option = Alt
* Power key = F24
* Mic = F13(Adjustable keyboard)
*/
// http://lxr.free-electrons.com/source/drivers/macintosh/adbhid.c
// http://opensource.apple.com//source/IOHIDFamily/IOHIDFamily-701.20.10/IOHIDFamily/Cosmo_USB2ADB.c
// http://m0115.web.fc2.com/m0115.jpg
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
// Position(unimap) ADB scan code(matrix)
// ---------------------------------------------
{
UNIMAP_A, // 0x00
UNIMAP_S, // 0x01
UNIMAP_D, // 0x02
UNIMAP_F, // 0x03
UNIMAP_H, // 0x04
UNIMAP_G, // 0x05
UNIMAP_Z, // 0x06
UNIMAP_X, // 0x07
},
{
UNIMAP_C, // 0x08
UNIMAP_V, // 0x09
UNIMAP_NONUS_BSLASH, // 0x0A
UNIMAP_B, // 0x0B
UNIMAP_Q, // 0x0C
UNIMAP_W, // 0x0D
UNIMAP_E, // 0x0E
UNIMAP_R, // 0x0F
},
{
UNIMAP_Y, // 0x10
UNIMAP_T, // 0x11
UNIMAP_1, // 0x12
UNIMAP_2, // 0x13
UNIMAP_3, // 0x14
UNIMAP_4, // 0x15
UNIMAP_6, // 0x16
UNIMAP_5, // 0x17
},
{
UNIMAP_EQUAL, // 0x18
UNIMAP_9, // 0x19
UNIMAP_7, // 0x1A
UNIMAP_MINUS, // 0x1B
UNIMAP_8, // 0x1C
UNIMAP_0, // 0x1D
UNIMAP_RBRACKET, // 0x1E
UNIMAP_O, // 0x1F
},
{
UNIMAP_U, // 0x20
UNIMAP_LBRACKET, // 0x21
UNIMAP_I, // 0x22
UNIMAP_P, // 0x23
UNIMAP_ENTER, // 0x24
UNIMAP_L, // 0x25
UNIMAP_J, // 0x26
UNIMAP_QUOTE, // 0x27
},
{
UNIMAP_K, // 0x28
UNIMAP_SCOLON, // 0x29
UNIMAP_BSLASH, // 0x2A
UNIMAP_COMMA, // 0x2B
UNIMAP_SLASH, // 0x2C
UNIMAP_N, // 0x2D
UNIMAP_M, // 0x2E
UNIMAP_DOT, // 0x2F
},
{
UNIMAP_TAB, // 0x30
UNIMAP_SPACE, // 0x31
UNIMAP_GRAVE, // 0x32
UNIMAP_BSPACE, // 0x33
UNIMAP_KP_ENTER, // 0x34
UNIMAP_ESCAPE, // 0x35
UNIMAP_LCTRL, // 0x36
UNIMAP_LGUI, // 0x37
},
{
UNIMAP_LSHIFT, // 0x38
UNIMAP_CAPSLOCK, // 0x39
UNIMAP_LALT, // 0x3A
UNIMAP_LEFT, // 0x3B
UNIMAP_RIGHT, // 0x3C
UNIMAP_DOWN, // 0x3D
UNIMAP_UP, // 0x3E
UNIMAP_F23, // 0x3F FN?
},
{
UNIMAP_F17, // 0x40
UNIMAP_KP_DOT, // 0x41
UNIMAP_F13, // 0x42 Mic(Adjustable keyboard)
UNIMAP_KP_MINUS, // 0x43 ADB keypad asterisk(top right)
UNIMAP_NO, // 0x44
UNIMAP_KP_COMMA, // 0x45 ADB keypad plus
UNIMAP_NO, // 0x46
UNIMAP_NUMLOCK, // 0x47
},
{
UNIMAP_VOLUME_UP, // 0x48 Vol Up(Adjustable keyboard)
UNIMAP_VOLUME_DOWN, // 0x49 Vol Down(Adjustable keyboard)
UNIMAP_VOLUME_MUTE, // 0x4A Vol Mute(Adjustable keyboard)
UNIMAP_KP_ASTERISK, // 0x4B ADB keypad slash(between equal and asterisk)
UNIMAP_KP_ENTER, // 0x4C
UNIMAP_NO, // 0x4D
UNIMAP_KP_PLUS, // 0x4E ADB keypad minus
UNIMAP_F18, // 0x4F
},
{
UNIMAP_F19, // 0x50
UNIMAP_KP_SLASH, // 0x51 ADB keypad equal(next to clear/numlock)
UNIMAP_KP_0, // 0x52
UNIMAP_KP_1, // 0x53
UNIMAP_KP_2, // 0x54
UNIMAP_KP_3, // 0x55
UNIMAP_KP_4, // 0x56
UNIMAP_KP_5, // 0x57
},
{
UNIMAP_KP_6, // 0x58
UNIMAP_KP_7, // 0x59
UNIMAP_F20, // 0x5A
UNIMAP_KP_8, // 0x5B
UNIMAP_KP_9, // 0x5C
UNIMAP_JYEN, // 0x5D
UNIMAP_RO, // 0x5E
UNIMAP_KP_COMMA, // 0x5F
},
{
UNIMAP_F5, // 0x60
UNIMAP_F6, // 0x61
UNIMAP_F7, // 0x62
UNIMAP_F3, // 0x63
UNIMAP_F8, // 0x64
UNIMAP_F9, // 0x65
UNIMAP_MHEN, // 0x66
UNIMAP_F11, // 0x67
},
{
UNIMAP_HENK, // 0x68
UNIMAP_PSCREEN, // 0x69
UNIMAP_F16, // 0x6A
UNIMAP_SCROLLLOCK, // 0x6B
UNIMAP_NO, // 0x6C
UNIMAP_F10, // 0x6D
UNIMAP_APPLICATION, // 0x6E compose
UNIMAP_F12, // 0x6F
},
{
UNIMAP_NO, // 0x70
UNIMAP_PAUSE, // 0x71
UNIMAP_INSERT, // 0x72
UNIMAP_HOME, // 0x73
UNIMAP_PGUP, // 0x74
UNIMAP_DELETE, // 0x75
UNIMAP_F4, // 0x76
UNIMAP_END, // 0x77
},
{
UNIMAP_F2, // 0x78
UNIMAP_PGDOWN, // 0x79
UNIMAP_F1, // 0x7A
UNIMAP_RSHIFT, // 0x7B
UNIMAP_RALT, // 0x7C
UNIMAP_RCTRL, // 0x7D
UNIMAP_RGUI, // 0x7E
UNIMAP_F24, // 0x7F power key
}
};
#endif

View File

@ -0,0 +1,47 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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 "unimap_common.h"
#define AC_FN0 ACTION_LAYER_TAP_KEY(1, KC_GRV)
#define AC_FN1 ACTION_LAYER_TAP_KEY(1, KC_BSLS)
#define AC_PKEY ACTION_MODS_TAP_KEY(MOD_NONE, KC_POWER)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
UNIMAP(
MPLY,NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, PKEY,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,
FN0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, INS, HOME,PGUP, NLCK,PEQL,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, DEL, END, PGDN, P7, P8, P9, PMNS,
LCAP,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PPLS,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT,NO, SPC, NO, NO, RALT,RGUI,NO, RCTL, LEFT,DOWN,RGHT, P0, PDOT,NO
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
TRNS,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
),
};

View File

@ -1,25 +1,36 @@
# Target file name (without extension). # Target file name (without extension).
TARGET = ibm4704_usb TARGET ?= ibm4704_usb
# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = . TARGET_DIR ?= .
# project specific files # project specific files
SRC = keymap_common.c \ SRC ?= matrix.c \
matrix.c \
led.c \ led.c \
protocol/ibm4704.c protocol/ibm4704.c
ifdef KEYMAP #
SRC := keymap_$(KEYMAP).c $(SRC) # Keymap file
#
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else else
SRC := keymap_plain.c $(SRC) ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE)_plain.c $(SRC)
endif endif
CONFIG_H = config.h CONFIG_H ?= config.h
# MCU name # MCU name
@ -37,14 +48,14 @@ MCU ?= atmega32u2
# does not *change* the processor frequency - it should merely be updated to # does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000 F_CPU ?= 16000000
# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
@ -57,7 +68,7 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -69,18 +80,19 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Atmel DFU loader 4096 # Atmel DFU loader 4096
# LUFA bootloader 4096 # LUFA bootloader 4096
# USBaspLoader 2048 # USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096 BOOTLOADER_SIZE ?= 4096
OPT_DEFS += -DBOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA NKRO_ENABLE ?= no # USB Nkey Rollover
# Search Path # Search Path

View File

@ -1,5 +1,6 @@
# TMK Converter rev.1 # TMK Converter rev.1
# which looks like this: # which looks like this:
# https://github.com/tmk/keyboard_converter#pcb-rev1 # https://github.com/tmk/keyboard_converter#pcb-rev1
TARGET = ibm4704_usb_rev1
MCU = atmega32u4 MCU = atmega32u4
include Makefile include Makefile

View File

@ -1,6 +1,6 @@
# TMK Converter rev.2 # TMK Converter rev.2
# which looks like this: # which looks like this:
# https://github.com/tmk/keyboard_converter#pcb-rev2 # https://github.com/tmk/keyboard_converter#pcb-rev2
TARGET = ibm4704_usb_rev2
MCU = atmega32u2 MCU = atmega32u2
include Makefile include Makefile

View File

@ -0,0 +1,7 @@
TARGET = ibm4704_usb_rev1_alps_unimap
MCU = atmega32u4
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
OPT_DEFS += -DIBM4704_ALPS
include Makefile

View File

@ -0,0 +1,7 @@
TARGET = ibm4704_usb_rev2_alps_unimap
MCU = atmega32u2
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
OPT_DEFS += -DIBM4704_ALPS
include Makefile

View File

@ -0,0 +1,7 @@
TARGET = ibm4704_usb_rev1_unimap
MCU = atmega32u4
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
#OPT_DEFS += -DIBM4704_ALPS
include Makefile

View File

@ -0,0 +1,7 @@
TARGET = ibm4704_usb_rev2_unimap
MCU = atmega32u2
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
#OPT_DEFS += -DIBM4704_ALPS
include Makefile

View File

@ -1,12 +1,14 @@
IBM 4704 to USB keyboard converter IBM 4704 to USB keyboard converter
================================== ==================================
This firmware converts IBM 4704 keyboard protocol to USB HID. This firmware converts IBM 4704 keyboard protocol to USB HID.
Keyboard initialization process takes a few seconds at start up. **You may need to plug USB cable after hooking up your keyboard to the converter.**
Keyboard initialization process takes a few seconds at start up. During that you will hear buzzer from the keyboard. **You need to plug USB cable after hooking up your keyboard to the converter.** TMK Converter for IBM4704 is available here: https://geekhack.org/index.php?topic=72052.0
Update Update
------ ------
- 2016/09/30 Unimap editor support
- 2015/09/07 Added keymap for Alps 102-key. Thanks, tai @ geekhack! - 2015/09/07 Added keymap for Alps 102-key. Thanks, tai @ geekhack!
- 2015/05/05 Added keymaps for 107-key, 77-key and 50-key. Thanks, orihalcon @ geekhack! - 2015/05/05 Added keymaps for 107-key, 77-key and 50-key. Thanks, orihalcon @ geekhack!
- 2015/05/19 Fixed a protocol handling bug. - 2015/05/19 Fixed a protocol handling bug.
@ -63,17 +65,17 @@ Just run `make`:
$ make -f <makefile> $ make -f <makefile>
For TMK Converter rev.1 use `Makefile.tmk_rev1` as makefile: For TMK Converter rev.1 use `Makefile.rev1` as makefile:
$ make -f Makefile.tmk_rev1 $ make -f Makefile.rev1
For TMK Converter rev.2 use `Makefile.tmk_rev2` as makefile: For TMK Converter rev.2 use `Makefile.rev2` as makefile:
$ make -f Makefile.tmk_rev2 $ make -f Makefile.rev2
To select keymap: To select keymap:
$ make -f <makefile> KEYMAP=[plain|...] $ make -f <makefile> KEYMAP=[plain|alsp102key|...]
To indentify your TMK Converter revision see [this](https://github.com/tmk/keyboard_converter#pcb-revisions). To indentify your TMK Converter revision see [this](https://github.com/tmk/keyboard_converter#pcb-revisions).

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -45,6 +45,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
@ -29,11 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keymap.h" #include "keymap.h"
// 32*8(256) byte array which converts PS/2 code into USB code
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];
/* 107-key */ /* 107-key */
#define KEYMAP( \ #define KEYMAP( \
K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \ K46,K64, K00,K18,K19,K1A,K10,K11,K12,K08,K09,K0A,K0F,K1F,K0D,K0C,K0E, K6A,K6B,K6C, K47,K48,K49,K4A, \

View File

@ -60,7 +60,7 @@ enum macro_id {
ALT_TAB, ALT_TAB,
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN), [1] = ACTION_LAYER_TAP_KEY(2, KC_SCLN),
[2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH), [2] = ACTION_LAYER_TAP_KEY(3, KC_SLASH),

View File

@ -45,6 +45,6 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -29,7 +29,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static void matrix_make(uint8_t code); static void matrix_make(uint8_t code);
static void matrix_break(uint8_t code); static void matrix_break(uint8_t code);
static void matrix_clear(void);
/* /*
@ -53,18 +52,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define COL(code) (code&0x07) #define COL(code) (code&0x07)
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
static void enable_break(void) static void enable_break(void)
{ {
print("Enable break: "); print("Enable break: ");
@ -121,28 +108,12 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
xprintf("%02X: %08b\n", row, bitrev(matrix_get_row(row)));
}
}
inline inline
static void matrix_make(uint8_t code) static void matrix_make(uint8_t code)
{ {
@ -155,8 +126,7 @@ static void matrix_break(uint8_t code)
matrix[ROW(code)] &= ~(1<<COL(code)); matrix[ROW(code)] &= ~(1<<COL(code));
} }
inline void matrix_clear(void)
static void matrix_clear(void)
{ {
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
} }

View File

@ -0,0 +1,45 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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 "unimap_trans.h"
#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
UNIMAP(
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS,
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, FN0, LEFT,DOWN,RGHT, P0, PDOT,PEQL
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
GRV, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
),
};

View File

@ -0,0 +1,113 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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/>.
*/
#ifndef UNIMAP_TRNAS_H
#define UNIMAP_TRNAS_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = { // 16*8
#ifndef IBM4704_ALPS
/* IBM4740 Capcitive models(62-key/77-key/107-key)
* ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
* | F1| F2| | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|BSp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | F3| F4| |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| +|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | F5| F6| |Caps | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| |PrS|ScL|Pau| | 4| 5| 6|KP,|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | F7| F8| |Shif| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |F11| Up|F12| | 1| 2| 3|Ent|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | F9|F10| |Ctrl |Gui|Alt | Space |Alt* |Gui|Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|KP=|
* `-------' `-----------------------------------------------------------' `-----------' `---------------'
* scan codes
* ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
* | 46| 64| | 00| 18| 19| 1A| 10| 11| 12| 08| 09| 0A| 0F| 1F| 0D| 0C| 0E| | 6A| 6B| 6C| | 47| 48| 49| 4A|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | 56| 66| | 04 | 05| 06| 13| 14| 15| 16| 17| 01| 02| 03| 1B| 1C| 1D| | 6D| 6E| 6F| | 4B| 4C| 4D| 4E|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | 71| 77| | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2A| 2B| 2C| 2D| | 70| 65| 72| | 50| 51| 52| 53|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | 44| 45| | 30 | 3E| 32| 33| 34| 35| 36| 37| 38| 39| 3A| 3B| 3C| 3D| | 74| 75| 76| | 5E| 58| 59| 5A|
* |-------| |-----------------------------------------------------------| |-----------| |---------------|
* | 54| 55| | 31 | 41| 3F | 40 | *3F | 42| 2F | | 78| 67| 79| | 5B| 5C| 5D| 57|
* `-------' `-----------------------------------------------------------' `-----------' `---------------'
* Both Alt keys spit same scan code 3F.
*/
{ UNIMAP_GRV, UNIMAP_I, UNIMAP_O, UNIMAP_P, UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_NO }, // 00-07
{ UNIMAP_7, UNIMAP_8, UNIMAP_9, UNIMAP_NO, UNIMAP_JYEN, UNIMAP_EQL, UNIMAP_BSPC, UNIMAP_0 }, // 08-0F
{ UNIMAP_4, UNIMAP_5, UNIMAP_6, UNIMAP_E, UNIMAP_R, UNIMAP_T, UNIMAP_Y, UNIMAP_U }, // 10-17
{ UNIMAP_1, UNIMAP_2, UNIMAP_3, UNIMAP_LBRC, UNIMAP_RBRC, UNIMAP_BSLS, UNIMAP_NO, UNIMAP_MINS }, // 18-1F
{ UNIMAP_CAPS, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_H, UNIMAP_J }, // 20-27
{ UNIMAP_K, UNIMAP_L, UNIMAP_SCLN, UNIMAP_QUOT, UNIMAP_NUHS, UNIMAP_ENT, UNIMAP_NO, UNIMAP_RCTL }, // 28-2F
{ UNIMAP_LSFT, UNIMAP_LCTL, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_N, }, // 30-37
{ UNIMAP_M, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_RO, UNIMAP_RSFT, UNIMAP_NUBS, UNIMAP_LALT }, // 38-3F
{ UNIMAP_SPC, UNIMAP_LGUI, UNIMAP_RGUI, UNIMAP_NO, UNIMAP_F7, UNIMAP_F8, UNIMAP_F1, UNIMAP_NLCK }, // 40-47
{ UNIMAP_PSLS, UNIMAP_PAST, UNIMAP_PMNS, UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PPLS, UNIMAP_NO }, // 48-4F
{ UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_PCMM, UNIMAP_F9, UNIMAP_F10, UNIMAP_F3, UNIMAP_PEQL }, // 50-57
{ UNIMAP_P2, UNIMAP_P3, UNIMAP_PENT, UNIMAP_ESC, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_P1, UNIMAP_NO }, // 58-5F
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_F2, UNIMAP_SLCK, UNIMAP_F4, UNIMAP_DOWN }, // 60-67
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_INS, UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_DEL, UNIMAP_END, UNIMAP_PGDN }, // 68-6F
{ UNIMAP_PSCR, UNIMAP_F5, UNIMAP_PAUS, UNIMAP_NO, UNIMAP_F11, UNIMAP_UP, UNIMAP_F12, UNIMAP_F6 }, // 70-77
{ UNIMAP_LEFT, UNIMAP_RGHT, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO } // 78-7F
#else
/* IBM4740 Alps models(102-key)
* ,---------------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|BSp| F1| |Ins|Hom|PgU| |NmL| /| *| -|
* |---------------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| F2| |Del|End|PgD| | 7| 8| 9| +|
* |---------------------------------------------------------------| |-----------| |---------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| F3| |PrS|ScL|Pau| | 4| 5| 6|KP,|
* |---------------------------------------------------------------| |-----------| |---------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /| RO|Shift | F4| |F11| Up|F12| | 1| 2| 3|Ent|
* |---------------------------------------------------------------| |-----------| |---------------|
* |Ctrl |Gui|Alt | Space |Alt |Gui| Ctrl | |Lef|Dow|Rig| |Esc| 0|KP.|KP=|
* `---------------------------------------------------------------' `-----------' `---------------'
* ,---------------------------------------------------------------. ,-----------. ,---------------.
* | 00| 0F| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E| | 44| 45| 46| | 43| 41| 42| 4A|
* |---------------------------------------------------------------| |-----------| |---------------|
* | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 1C| 1D | 1E| | 54| 55| 56| | 50| 51| 52| 5A|
* |---------------------------------------------------------------| |-----------| |---------------|
* | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2A| 2B| 2C| 2D | 2E| | 64| 65| 66| | 60| 61| 62| 6B|
* |---------------------------------------------------------------| |-----------| |---------------|
* | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3A| 3B| 3C| 3D | 3E| | 74| 75| 76| | 70| 71| 72| 7B|
* |---------------------------------------------------------------| |-----------| |---------------|
* | 31 | 47| 3F | 40 | 4F | 48| 2F | | 77| 67| 57| | 73| 63| 53| 4E|
* `---------------------------------------------------------------' `-----------' `---------------'
*/
{ UNIMAP_GRV, UNIMAP_2, UNIMAP_3, UNIMAP_4, UNIMAP_5, UNIMAP_6, UNIMAP_7, UNIMAP_8 }, // 00-07
{ UNIMAP_9, UNIMAP_0, UNIMAP_MINS, UNIMAP_EQL, UNIMAP_JYEN, UNIMAP_BSPC, UNIMAP_F1, UNIMAP_1 }, // 08-0F
{ UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_E, UNIMAP_R, UNIMAP_T, UNIMAP_Y, UNIMAP_U }, // 10-17
{ UNIMAP_I, UNIMAP_O, UNIMAP_P, UNIMAP_LBRC, UNIMAP_RBRC, UNIMAP_BSLS, UNIMAP_F2, UNIMAP_NO }, // 18-1F
{ UNIMAP_CAPS, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_H, UNIMAP_J }, // 20-27
{ UNIMAP_K, UNIMAP_L, UNIMAP_SCLN, UNIMAP_QUOT, UNIMAP_NUHS, UNIMAP_ENT, UNIMAP_F3, UNIMAP_RCTL }, // 28-2F
{ UNIMAP_LSFT, UNIMAP_LCTL, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_N }, // 30-37
{ UNIMAP_M, UNIMAP_COMM, UNIMAP_DOT, UNIMAP_SLSH, UNIMAP_RO, UNIMAP_RSFT, UNIMAP_F4, UNIMAP_LALT }, // 38-3F
{ UNIMAP_SPC, UNIMAP_PSLS, UNIMAP_PAST, UNIMAP_NLCK, UNIMAP_INS, UNIMAP_HOME, UNIMAP_PGUP, UNIMAP_LGUI }, // 40-47
{ UNIMAP_RGUI, UNIMAP_NO, UNIMAP_PMNS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PEQL, UNIMAP_RALT }, // 48-4F
{ UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PDOT, UNIMAP_DEL, UNIMAP_END, UNIMAP_PGDN, UNIMAP_RGHT }, // 50-57
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_PPLS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, }, // 58-5F
{ UNIMAP_P4, UNIMAP_P5, UNIMAP_P6, UNIMAP_P0, UNIMAP_PSCR, UNIMAP_SLCK, UNIMAP_PAUS, UNIMAP_DOWN }, // 60-67
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PCMM, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, }, // 68-6F
{ UNIMAP_P1, UNIMAP_P2, UNIMAP_P3, UNIMAP_ESC, UNIMAP_F11, UNIMAP_UP, UNIMAP_F12, UNIMAP_LEFT }, // 70-77
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_PENT, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, } // 78-7F
#endif
};
#endif

View File

@ -1,32 +1,41 @@
# Target file name (without extension). # Target file name (without extension).
TARGET = m0110_lufa TARGET ?= m0110_usb
# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = . TARGET_DIR ?= .
# keyboard dependent files # keyboard dependent files
SRC = matrix.c \ SRC ?= matrix.c \
led.c \ led.c \
keymap_common.c \
m0110.c m0110.c
# To use own keymap file run make like: make keymap=hasu #
ifdef KEYMAP # Keymap file
SRC += keymap_$(KEYMAP).c #
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else else
SRC += keymap_default.c ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE).c $(SRC)
endif endif
CONFIG_H = config.h CONFIG_H ?= config.h
# MCU name, you MUST set this to match the board you are using # MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt # type "make clean" after changing this, so all files will be rebuilt
MCU = atmega32u2 # TMK converter rev2 MCU ?= atmega32u2
#MCU = atmega32u4 # TMK converter rev1
# Processor frequency. # Processor frequency.
@ -34,14 +43,14 @@ MCU = atmega32u2 # TMK converter rev2
# so your program will run at the correct speed. You should also set this # so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many # variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here. # examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000 F_CPU ?= 16000000
# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
@ -54,7 +63,7 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task # Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -70,19 +79,19 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options # Build Options
# *Comment out* to disable the options. # *Comment out* to disable the options.
# #
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) #BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE ?= yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #SLEEP_LED_ENABLE ?= yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA #NKRO_ENABLE ?= yes # USB Nkey Rollover
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor #KEYMAP_SECTION_ENABLE ?= yes # fixed address keymap for keymap editor
#---------------- Programming Options -------------------------- #---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex PROGRAM_CMD ?= teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path # Search Path

View File

@ -0,0 +1,3 @@
TARGET = m0110_usb_rev1
MCU = atmega32u4
include Makefile

View File

@ -0,0 +1,3 @@
TARGET = m0110_usb_rev2
MCU = atmega32u2
include Makefile

View File

@ -1,98 +0,0 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = matrix.c \
led.c \
keymap_common.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif
CONFIG_H = config.h
# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
#MCU = at90usb162 # Teensy 1.0
MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0
# Processor frequency.
# Normally the first thing your program should do is set the clock prescaler,
# so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=512
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -1,96 +0,0 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = matrix.c \
led.c \
keymap_common.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif
CONFIG_H = config.h
# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
#MCU = atmega32u2 # TMK converter rev2
MCU = atmega32u4 # TMK converter rev1
# Processor frequency.
# Normally the first thing your program should do is set the clock prescaler,
# so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -1,96 +0,0 @@
# Target file name (without extension).
TARGET = m0110_lufa
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = matrix.c \
led.c \
keymap_common.c \
m0110.c
# To use own keymap file run make like: make keymap=hasu
ifdef KEYMAP
SRC += keymap_$(KEYMAP).c
else
SRC += keymap_default.c
endif
CONFIG_H = config.h
# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
MCU = atmega32u2 # TMK converter rev2
#MCU = atmega32u4 # TMK converter rev1
# Processor frequency.
# Normally the first thing your program should do is set the clock prescaler,
# so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
#
# LUFA specific
#
# Target architecture (see library "Board Types" documentation).
ARCH = AVR8
# Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may
# differ from F_CPU if prescaling is used on the latter, and is required as the
# raw input clock is fed directly to the PLL sections of the AVR for high speed
# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
# at the end, this will be done automatically to create a 32-bit value in your
# source code.
#
# If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU)
# Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Boot Section Size in bytes
# Teensy halfKay 512
# Atmel DFU loader 4096
# LUFA bootloader 4096
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
#KEYMAP_SECTION_ENABLE = yes # fixed address keymap for keymap editor
#---------------- Programming Options --------------------------
PROGRAM_CMD = teensy_loader_cli -mmcu=$(MCU) -w -v $(TARGET).hex
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol/lufa.mk
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -0,0 +1,6 @@
TARGET = m0110_usb_rev1_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u4
#OPT_DEFS = -DM0110_INTL
include Makefile

View File

@ -0,0 +1,6 @@
TARGET = m0110_usb_rev2_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
MCU = atmega32u2
#OPT_DEFS = -DM0110_INTL
include Makefile

View File

@ -4,7 +4,7 @@ This firmware converts the protocol of Apple Macintosh keyboard **M0110**, **M01
Read README of top directory too. Read README of top directory too.
Pictures of **M0110 + M0120** and **M0110A**. Pictures of **M0110 + M0120** and **M0110A** with [TMK converter].
![M0110+M0120](http://i.imgur.com/dyvXb2Tm.jpg) ![M0110+M0120](http://i.imgur.com/dyvXb2Tm.jpg)
![M0110A](http://i.imgur.com/HuHOEoHm.jpg) ![M0110A](http://i.imgur.com/HuHOEoHm.jpg)
@ -21,25 +21,25 @@ Update
- 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now. - 2013/09: Change port again, it uses inversely `PD0` for data and `PD1` for clock line now.
- 2014/06: Change keymaps - 2014/06: Change keymaps
- 2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c) - 2015/03: Add support for "International"(ISO) keyboard(keymap_intl.c)
- 2016/09: Unimap support - keymap editor on web browser
Building Hardware Hardware
----------------- --------
You need [TMK converter] or AVR dev board like PJRC [Teensy]. Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`. You can buy preassembled [TMK converter] or make yourown with AVR dev board like PJRC [Teensy].
[![M0110 Converter](http://i.imgur.com/4G2ZOegm.jpg)](http://i.imgur.com/4G2ZOeg.jpg) Port of the MCU `PD1` is assigned to `CLOCK` line and `PD0` to `DATA` by default, you can change pin configuration with editing `config.h`.
[![M0110 Converter](http://i.imgur.com/yEp2eRim.jpg)](http://i.imgur.com/yEp2eRi.jpg)
### 4P4C phone handset cable ### 4P4C phone handset cable
Note that original cable used with Mac is **straight** while phone handset cable is **crossover**. Note that original cable used with Mac is **straight** while phone handset cable is **crossover**.
<http://en.wikipedia.org/wiki/Modular_connector#4P4C> <http://en.wikipedia.org/wiki/Modular_connector#4P4C>
Close-up picture of handset cable. You can see one end of plug has reverse color codes against the other. Click to enlarge.
[![4P4C cable](http://i.imgur.com/3S9P1mYm.jpg?1)](http://i.imgur.com/3S9P1mY.jpg?1)
[Teensy]: http://www.pjrc.com/teensy/ [Teensy]: http://www.pjrc.com/teensy/
[TMK converter]: https://github.com/tmk/keyboard_converter [TMK converter]: https://geekhack.org/index.php?topic=72052.0
### Socket Pinout ### Socket Pinout
@ -60,16 +60,19 @@ To compile firmware you need AVR GCC. You can edit *Makefile* and *config.h* to
$ git clone git://github.com/tmk/tmk_keyboard.git (or download source) $ git clone git://github.com/tmk/tmk_keyboard.git (or download source)
$ cd m0110_usb $ cd m0110_usb
$ make -f Makefile.rev2 clean $ make -f Makefile.rev2 clean
$ make -f Makefile.rev2 [KEYMAP={default|intl|spacefn|hasu}] $ make -f Makefile.rev2 [KEYMAP={intl|spacefn}]
Use `Maefile.tmk_rev1` for TMK converter Rev.1, `Makefile.teensy` for Teensy instead. Use `Maefile.rev1` for TMK converter rev.1 and Teensy(ATMega32u4), instead.
Keymap Keymap
------ ------
To create your own keymap copy existent keymap file to `keymap_name.c` and edit it. To create your own keymap copy existent keymap file to `keymap_<name>.c` and edit it. You can build with `make -f Makefile.rev2 KEYMAP=<name>`.
Or you can edit keymap on web browser and download firmware.
http://www.tmk-kbd.com/tmk_keyboard/editor/
Debug Debug

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -98,9 +98,9 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
* Fn action definition * Fn action definition
*/ */
#ifdef KEYMAP_SECTION_ENABLE #ifdef KEYMAP_SECTION_ENABLE
const uint16_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = { const action_t fn_actions[] __attribute__ ((section (".keymap.fn_actions"))) = {
#else #else
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
#endif #endif
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_MOMENTARY(2), [1] = ACTION_LAYER_MOMENTARY(2),

View File

@ -15,15 +15,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <stdint.h> #include <stdint.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "keymap.h" #include "keymap.h"
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS];
extern const uint16_t fn_actions[];
/* Common layout for M0110 and M0110A /* Common layout for M0110 and M0110A
* This keymap works with both keyboards. As you can see, the M0110A is * This keymap works with both keyboards. As you can see, the M0110A is
* a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110 * a superset of M0110 keyboard, only one exception is 'Enter'(34) of M0110
@ -45,7 +40,7 @@ extern const uint16_t fn_actions[];
* ,---------------------------------------------------------. ,---------------. * ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E| * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
* |-----------------------------------------------------' | |---------------| * |-----------------------------------------------------' | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
@ -58,7 +53,7 @@ extern const uint16_t fn_actions[];
* ,---------------------------------------------------------. ,---------------. * ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66| * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
@ -99,7 +94,7 @@ extern const uint16_t fn_actions[];
* ,---------------------------------------------------------. ,---------------. * ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62| * | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 10| 11| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E| * | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |------------------------------------------------------, | |---------------| * |------------------------------------------------------, | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66| * | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------| * |---------------------------------------------------------| |---------------|

View File

@ -1,87 +0,0 @@
/*
Copyright 2014 Jun Wako <wakojun@gmail.com>
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 "keycode.h"
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default:
* M0110
* ,---------------------------------------------------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backs|
* |---------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |---------------------------------------------------------|
* |Ctrl | A| S| D| F| G| H| J| K| L| Fn| '|Return|
* |---------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| ,| Fn|Shift |
* `---------------------------------------------------------'
* |Fn |alt | Fn |Gui |Fn |
* `-----------------------------------------------'
*/
[0] = KEYMAP(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, NLCK,EQL, PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN1, UP, P1, P2, P3, PENT,
FN0, LALT, FN2, LGUI,BSLS,LEFT,RGHT,DOWN, P0, PDOT
),
// IJKL cursor
[1] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, HOME,LEFT,DOWN,RGHT,END, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, NO, PGUP, P1, P2, P3, PENT,
TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
// HJKL cursor
[2] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,NO, NO, NO, NO, NO, HOME,PGDN,UP, PGUP,END, NO, NO, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, TRNS, PGUP, P1, P2, P3, PENT,
TRNS,LALT, SPC, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
// Mousekey
[3] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,BTN1,NO, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT,
NO, LALT, TRNS, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
// Mousekey
[4] = KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, NLCK,EQL, PSLS,PAST,
CAPS,Q, W, E, R, T, WH_L,WH_D,MS_U,WH_U,WH_R,WBAK,WFWD, P7, P8, P9, PMNS,
LCTL,VOLD,VOLU,MUTE,NO, NO, BTN2,MS_L,MS_D,MS_R,TRNS,NO, ENT, P4, P5, P6, PPLS,
LSFT,Z, X, C, V, B, BTN2,BTN1,BTN4,BTN5,NO, PGUP, P1, P2, P3, PENT,
NO, LALT, BTN1, LGUI,BSLS,HOME,END, PGDN, P0, PDOT
),
};
/*
* Fn action definition
*/
const uint16_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1),
[1] = ACTION_LAYER_TAP_KEY(2, KC_SLASH),
[2] = ACTION_LAYER_TAP_KEY(3, KC_SPACE),
[3] = ACTION_LAYER_TAP_KEY(4, KC_SCOLON),
};

View File

@ -68,6 +68,6 @@ const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_MOMENTARY(1), [0] = ACTION_LAYER_MOMENTARY(1),
}; };

View File

@ -65,7 +65,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
* Fn action definition * Fn action definition
*/ */
const uint16_t fn_actions[] PROGMEM = { const action_t fn_actions[] PROGMEM = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

View File

@ -46,18 +46,6 @@ static uint8_t _matrix0[MATRIX_ROWS];
static void register_key(uint8_t key); static void register_key(uint8_t key);
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void) void matrix_init(void)
{ {
m0110_init(); m0110_init();
@ -95,48 +83,12 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline
bool matrix_has_ghost(void)
{
return false;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}
inline inline
static void register_key(uint8_t key) static void register_key(uint8_t key)
{ {

View File

@ -0,0 +1,48 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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 "unimap_trans.h"
#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
#define AC_FN1 ACTION_LAYER_TAP_KEY(1, KC_BSLS)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
UNIMAP(
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, NO, NO, NO, NLCK,PEQL,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, FN1, NO, NO, NO, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PPLS,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, NO, UP, P1, P2, P3, PENT,
NO, LGUI,LALT,NO, SPC, NO, NO, NO, FN0, NO, NO, LEFT,DOWN,RGHT, P0, PDOT,NO
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
NO, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
),
};

View File

@ -0,0 +1,244 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
/* M0110A scan codes
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| | | 59| 5B| 5C| 4E|
* |-----------------------------------------------------' | |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| 4D| | 53| 54| 55| |
* `---------------------------------------------------------' |-----------| 4C|
* | 3A| 37| 31 | 2A| 46| 42| 48| | 52| 41| |
* `---------------------------------------------------------' `---------------'
*
* M0110 + M0120 scan codes
* ,---------------------------------------------------------. ,---------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33| | 47| 68| 6D| 62|
* |---------------------------------------------------------| |---------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A| | 59| 5B| 5C| 4E|
* |---------------------------------------------------------| |---------------|
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| | 56| 57| 58| 66|
* |---------------------------------------------------------| |---------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 38| | 53| 54| 55| |
* `---------------------------------------------------------' |-----------| 4C|
* | 3A| 37| 31 | 34| 3A| | 52| 41| |
* `------------------------------------------------' `---------------'
*
* International M0110
* https://en.wikipedia.org/wiki/File:Apple_Macintosh_Plus_Keyboard.jpg
* Probably International keyboard layout of M0110A doesn't exist.
* ,---------------------------------------------------------.
* | 32| 12| 13| 14| 15| 17| 16| 1A| 1C| 19| 1D| 1B| 18| 33|
* |---------------------------------------------------------|
* | 30| 0C| 0D| 0E| 0F| 11| 10| 20| 22| 1F| 23| 21| 1E| 2A|
* |------------------------------------------------------, |
* | 39| 00| 01| 02| 03| 05| 04| 26| 28| 25| 29| 27| 24| |
* |---------------------------------------------------------|
* | 38| 06| 07| 08| 09| 0B| 2D| 2E| 2B| 2F| 2C| 0A| 38|
* `---------------------------------------------------------'
* | 3A| 37| 34 | 31| 3A|
* `------------------------------------------------'
*/
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
// Position(unimap) scan code(matrix)
// ---------------------------------------------
{
UNIMAP_A, // 0x00
UNIMAP_S, // 0x01
UNIMAP_D, // 0x02
UNIMAP_F, // 0x03
UNIMAP_H, // 0x04
UNIMAP_G, // 0x05
#ifdef M0110_INTL
UNIMAP_NONUS_BSLASH, // 0x06
UNIMAP_Z, // 0x07
},
{
UNIMAP_X, // 0x08
UNIMAP_C, // 0x09
UNIMAP_SLASH, // 0x0A
UNIMAP_V, // 0x0B
#else
UNIMAP_Z, // 0x06
UNIMAP_X, // 0x07
},
{
UNIMAP_C, // 0x08
UNIMAP_V, // 0x09
UNIMAP_NO, // 0x0A
UNIMAP_B, // 0x0B
#endif
UNIMAP_Q, // 0x0C
UNIMAP_W, // 0x0D
UNIMAP_E, // 0x0E
UNIMAP_R, // 0x0F
},
{
UNIMAP_Y, // 0x10
UNIMAP_T, // 0x11
UNIMAP_1, // 0x12
UNIMAP_2, // 0x13
UNIMAP_3, // 0x14
UNIMAP_4, // 0x15
UNIMAP_6, // 0x16
UNIMAP_5, // 0x17
},
{
UNIMAP_EQUAL, // 0x18
UNIMAP_9, // 0x19
UNIMAP_7, // 0x1A
UNIMAP_MINUS, // 0x1B
UNIMAP_8, // 0x1C
UNIMAP_0, // 0x1D
UNIMAP_RBRACKET, // 0x1E
UNIMAP_O, // 0x1F
},
{
UNIMAP_U, // 0x20
UNIMAP_LBRACKET, // 0x21
UNIMAP_I, // 0x22
UNIMAP_P, // 0x23
#ifdef M0110_INTL
UNIMAP_NONUS_HASH, // 0x24
#else
UNIMAP_ENTER, // 0x24
#endif
UNIMAP_L, // 0x25
UNIMAP_J, // 0x26
UNIMAP_QUOTE, // 0x27
},
{
UNIMAP_K, // 0x28
UNIMAP_SCOLON, // 0x29
#ifdef M0110_INTL
UNIMAP_ENTER, // 0x2A
UNIMAP_M, // 0x2B
UNIMAP_DOT, // 0x2C
UNIMAP_B, // 0x2D
UNIMAP_N, // 0x2E
UNIMAP_COMMA, // 0x2F
#else
UNIMAP_BSLASH, // 0x2A
UNIMAP_COMMA, // 0x2B
UNIMAP_SLASH, // 0x2C
UNIMAP_N, // 0x2D
UNIMAP_M, // 0x2E
UNIMAP_DOT, // 0x2F
#endif
},
{
UNIMAP_TAB, // 0x30
#ifdef M0110_INTL
UNIMAP_RGUI, // 0x31
#else
UNIMAP_SPACE, // 0x31
#endif
UNIMAP_GRAVE, // 0x32
UNIMAP_BSPACE, // 0x33
#ifdef M0110_INTL
UNIMAP_SPACE, // 0x34
#else
UNIMAP_RGUI, // 0x34
#endif
UNIMAP_NO, // 0x35
UNIMAP_NO, // 0x36
UNIMAP_LGUI, // 0x37
},
{
UNIMAP_LSHIFT, // 0x38
UNIMAP_CAPSLOCK, // 0x39
UNIMAP_LALT, // 0x3A
UNIMAP_NO, // 0x3B
UNIMAP_NO, // 0x3C
UNIMAP_NO, // 0x3D
UNIMAP_NO, // 0x3E
UNIMAP_NO, // 0x3F
},
{
UNIMAP_NO, // 0x40
UNIMAP_KP_DOT, // 0x41
UNIMAP_RIGHT, // 0x42
UNIMAP_NO, // 0x43
UNIMAP_NO, // 0x44
UNIMAP_NO, // 0x45
UNIMAP_LEFT, // 0x46
UNIMAP_NUMLOCK, // 0x47
},
{
UNIMAP_DOWN, // 0x48
UNIMAP_NO, // 0x49
UNIMAP_NO, // 0x4A
UNIMAP_NO, // 0x4B
UNIMAP_KP_ENTER, // 0x4C
UNIMAP_UP, // 0x4D
UNIMAP_KP_PLUS, // 0x4E keypad minus
UNIMAP_NO, // 0x4F
},
{
UNIMAP_NO, // 0x50
UNIMAP_NO, // 0x51
UNIMAP_KP_0, // 0x52
UNIMAP_KP_1, // 0x53
UNIMAP_KP_2, // 0x54
UNIMAP_KP_3, // 0x55
UNIMAP_KP_4, // 0x56
UNIMAP_KP_5, // 0x57
},
{
UNIMAP_KP_6, // 0x58
UNIMAP_KP_7, // 0x59
UNIMAP_NO, // 0x5A
UNIMAP_KP_8, // 0x5B
UNIMAP_KP_9, // 0x5C
UNIMAP_NO, // 0x5D
UNIMAP_NO, // 0x5E
UNIMAP_NO, // 0x5F
},
{
UNIMAP_NO, // 0x60
UNIMAP_NO, // 0x61
UNIMAP_KP_MINUS, // 0x62 keypad asterisk
UNIMAP_NO, // 0x63
UNIMAP_NO, // 0x64
UNIMAP_NO, // 0x65
UNIMAP_KP_COMMA, // 0x66
UNIMAP_NO, // 0x67
},
{
UNIMAP_KP_SLASH, // 0x68 keypad equal
UNIMAP_NO, // 0x69
UNIMAP_NO, // 0x6A
UNIMAP_NO, // 0x6B
UNIMAP_NO, // 0x6C
UNIMAP_KP_ASTERISK, // 0x6D keypad slash
UNIMAP_NO, // 0x6E compose
UNIMAP_NO, // 0x6F
},
};
#endif

View File

@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "util.h" #include "util.h"
#include "keymap.h" #include "keymap.h"
@ -56,7 +55,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = { const uint8_t PROGMEM fn_layer[] = {
0, // Fn0 0, // Fn0
0, // Fn1 0, // Fn1
0, // Fn2 0, // Fn2
@ -69,7 +68,7 @@ static const uint8_t PROGMEM fn_layer[] = {
// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details. // See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = { const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0 KC_NO, // Fn0
KC_NO, // Fn1 KC_NO, // Fn1
KC_NO, // Fn2 KC_NO, // Fn2
@ -81,7 +80,7 @@ static const uint8_t PROGMEM fn_keycode[] = {
}; };
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: default /* 0: default
* ,---. ,------------------------, ,------------------------. ,---------. * ,---. ,------------------------, ,------------------------. ,---------.
* |Pow| | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------. * |Pow| | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10| | F11| F12| ,-----------.
@ -107,19 +106,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LALT,CAPS,LALT, SPC, ERAS, RALT,RGUI,RCTL, PGDN, TAB, LEFT,DOWN,RGHT LALT,CAPS,LALT, SPC, ERAS, RALT,RGUI,RCTL, PGDN, TAB, LEFT,DOWN,RGHT
), ),
}; };
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}
uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}
uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

View File

@ -47,20 +47,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) ((code>>3)&0xF) #define ROW(code) ((code>>3)&0xF)
#define COL(code) (code&0x07) #define COL(code) (code&0x07)
static bool is_modified = false;
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void) void matrix_init(void)
{ {
@ -74,8 +60,6 @@ void matrix_init(void)
uint8_t matrix_scan(void) uint8_t matrix_scan(void)
{ {
is_modified = false;
uint8_t code; uint8_t code;
code = news_recv(); code = news_recv();
if (code == 0) { if (code == 0) {
@ -87,56 +71,18 @@ uint8_t matrix_scan(void)
// break code // break code
if (matrix_is_on(ROW(code), COL(code))) { if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code)); matrix[ROW(code)] &= ~(1<<COL(code));
is_modified = true;
} }
} else { } else {
// make code // make code
if (!matrix_is_on(ROW(code), COL(code))) { if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= (1<<COL(code)); matrix[ROW(code)] |= (1<<COL(code));
is_modified = true;
} }
} }
return code; return code;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline
bool matrix_has_ghost(void)
{
return false;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}

View File

@ -1,18 +1,36 @@
# Target file name (without extension). # Target file name (without extension).
TARGET = next_usb TARGET ?= next_usb
# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = . TARGET_DIR ?= .
# keyboard dependent files # keyboard dependent files
SRC = keymap.c \ SRC ?= matrix.c \
matrix.c \
led.c led.c
CONFIG_H = config.h CONFIG_H ?= config.h
#
# Keymap file
#
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
KEYMAP_FILE = unimap
else
ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE).c $(SRC)
endif
# MCU name, you MUST set this to match the board you are using # MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt # type "make clean" after changing this, so all files will be rebuilt
@ -20,7 +38,7 @@ CONFIG_H = config.h
#MCU = atmega32u4 # Teensy 2.0 #MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0 #MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0 #MCU = at90usb1286 # Teensy++ 2.0
MCU = atmega32u2 # TMK converter MCU ?= atmega32u2 # TMK converter
# Processor frequency. # Processor frequency.
@ -28,14 +46,14 @@ MCU = atmega32u2 # TMK converter
# so your program will run at the correct speed. You should also set this # so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many # variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here. # examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000 F_CPU ?= 16000000
# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
@ -48,7 +66,7 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task(+60)
#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT #OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -67,11 +85,11 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
# *Comment out* to disable the options. # *Comment out* to disable the options.
# #
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) #BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys MOUSEKEY_ENABLE ?= yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control EXTRAKEY_ENABLE ?= yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE = yes # USB Nkey Rollover #NKRO_ENABLE ?= yes # USB Nkey Rollover
SRC += next_kbd.c SRC += next_kbd.c

View File

@ -0,0 +1,4 @@
TARGET = next_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
@ -59,7 +58,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include "keycode.h" #include "keycode.h"
// 32*8(256) byte array which converts PS/2 code into USB code // 32*8(256) byte array which converts PS/2 code into USB code
static const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
ACTION_LAYER_MOMENTARY(1), // FN0 - left command key ACTION_LAYER_MOMENTARY(1), // FN0 - left command key
ACTION_LAYER_MOMENTARY(1), // FN1 - right command key ACTION_LAYER_MOMENTARY(1), // FN1 - right command key
ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash ACTION_KEY(KC_BSLS), // FN2 - number pad slash & backslash
@ -116,62 +115,50 @@ static const uint16_t PROGMEM fn_actions[] = {
} }
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Layer 0: default /* Layer 0: default
* ,-----------------------------------------------------------. ,-----------. ,---------------. * ,-----------------------------------------------------------. ,-----------. ,---------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS | |Ins|Ref|Hom| |` | =| /| *| * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS | |VoU|Mut|PgU| | `| \| /| *|
* |-----------------------------------------------------------| |-----------| |---------------| * |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |Del| |End| | 7| 8| 9| -| * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| | |VoD| |PgD| | 7| 8| 9| -|
* |-----------------------------------------------------' | `---' `---' |-----------|---| * |-----------------------------------------------------' | `---' `---' |-----------|---|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +| * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +|
* |-----------------------------------------------------------| ,---. |---------------| * |-----------------------------------------------------------| ,---. |---------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| | * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent| * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
* |Fn0 |Alt | Space |LGui |Fn1 | |Lef|Dow|Rig| | 0| .| | * |LAlt |LGui | Space |FN0 |RAlt | |Lef|Dow|Rig| | 0| .| |
* `-----------------------------------------------------------' `-----------' `---------------' * `-----------------------------------------------------------' `-----------' `---------------'
*/ */
KEYMAP( KEYMAP(
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, WREF,HOME, GRV, FN3, FN2, PAST, ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, VOLU,MUTE,PGUP, GRV, BSLS,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,NO, DEL, END, P7, P8, P9, PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, VOLD, PGDN, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, LSFT, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3,
FN0, LALT, SPC, LGUI,FN1, LEFT,DOWN,RGHT, P0, PDOT,PENT LALT,LGUI, SPC, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,PENT
), ),
/* Layer 1: extra keys /* Layer 1: HHKB like
* ,-----------------------------------------------------------. ,-----------. ,---------------. * ,-----------------------------------------------------------. ,-----------. ,---------------.
* |Grv| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| BS | |VUp|VMu|PgU| |` | =| /| *| * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | | | | | |Num| | | |
* |-----------------------------------------------------------| |-----------| |---------------| * |-----------------------------------------------------------| |-----------| |---------------|
* |Tab |Pau| W| E| R| T| Y| U| I| O|PSc| \| ]| | |VDn| |PgD| | 7| 8| 9| -| * |Caps | \| | | | | | |Psc|Slk|Pau|Up |Ins| | | | | | | | | | |
* |-----------------------------------------------------' | `---' `---' |-----------|---| * |-----------------------------------------------------' | `---' `---' |-----------|---|
* |Ctrl | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| +| * | |VoD|VoU|Mut| | | *| /|Hom|PgU|Lef|Rig| | | | | | |
* |-----------------------------------------------------------| ,---. |---------------| * |-----------------------------------------------------------| ,---. |---------------|
* |Shift |UND|CUT|COP|PST| B| N| M| ,| .| /|Shift | |Up | | 1| 2| 3| | * | |UND|CUT|COP|PST| | +| -|End|PgD|Dow| | |PgU| | | | | |
* |-----------------------------------------------------------| ,-----------. |-----------|Ent| * |-----------------------------------------------------------| ,-----------. |-----------| |
* |Fn0 |Alt | Space |RGui |Fn1 | |Lef|Dow|Rig| | 0| .| | * | | | | | | |Hom|PgD|End| | | | |
* `-----------------------------------------------------------' `-----------' `---------------' * `-----------------------------------------------------------' `-----------' `---------------'
*/ */
KEYMAP( KEYMAP(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, VOLU,MUTE,PGUP, TRNS,TRNS,TRNS,TRNS, GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, TRNS,TRNS,TRNS, NLCK,TRNS,TRNS,TRNS,
TRNS,PAUS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,FN3, BSLS,TRNS, VOLD, PGDN, BTN1,MS_U,BTN2,WH_U, CAPS,BSLS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, MS_L,MS_D,MS_R,WH_D, TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS, FN4, FN5, FN6, FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS, TRNS,TRNS,TRNS, TRNS, FN4, FN5, FN6, FN7, TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS, PGUP, TRNS,TRNS,TRNS,
TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS TRNS,TRNS, TRNS, TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
) )
}; };
/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
}
/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
return (action_t){ .code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]) };
}

View File

@ -66,20 +66,6 @@ static uint8_t matrix[MATRIX_ROWS];
static bool is_modified = false; static bool is_modified = false;
/* number of matrix rows */
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
/* number of matrix columns */
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
#ifndef NEXT_KBD_LED1_ON #ifndef NEXT_KBD_LED1_ON
#define NEXT_KBD_LED1_ON #define NEXT_KBD_LED1_ON
#endif #endif
@ -227,19 +213,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
/* whether modified from previous scan. used after matrix_scan. */
bool matrix_is_modified()
{
return is_modified;
}
/* whether a switch is on */
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
/* matrix state on row */ /* matrix state on row */
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
@ -247,11 +220,6 @@ uint8_t matrix_get_row(uint8_t row)
return matrix[row]; return matrix[row];
} }
/* print matrix for debug */
void matrix_print(void)
{
}
inline inline
static void matrix_make(uint8_t code) static void matrix_make(uint8_t code)
{ {

View File

@ -0,0 +1,50 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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 "unimap_trans.h"
#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
// Undo, Cut, Copy and Paste
#define AC__UND ACTION_MODS_KEY(MOD_LCTL, KC_Z)
#define AC__CUT ACTION_MODS_KEY(MOD_LCTL, KC_X)
#define AC__CPY ACTION_MODS_KEY(MOD_LCTL, KC_C)
#define AC__PST ACTION_MODS_KEY(MOD_LCTL, KC_V)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
UNIMAP(
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO, NO,
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NO, BSPC, VOLU,MUTE,PGUP, GRV, BSLS,PSLS,PAST,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, VOLD,NO, PGDN, P7, P8, P9, PMNS,
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NO, ENT, P4, P5, P6, PPLS,
LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, NO, RSFT, UP, P1, P2, P3, PENT,
LALT,LGUI,NO, NO, SPC, NO, NO, NO, NO, FN0, RALT, LEFT,DOWN,RGHT, P0, PDOT,NO
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, NLCK,TRNS,TRNS,TRNS,
CAPS,BSLS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,_UND,_CUT,_CPY,_PST,TRNS,PPLS,PMNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS, TRNS,TRNS
),
};

View File

@ -0,0 +1,86 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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/>.
*/
#ifndef UNIMAP_COMMON_H
#define UNIMAP_COMMON_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
/* Mapping to Universal keyboard layout
*
* Universal keyboard layout
* ,-----------------------------------------------.
* |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Retn| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent|
* |-----------------------------------------------------------| ,-----------. |---------------|
* |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|KP=|
* `-----------------------------------------------------------' `-----------' `---------------'
*
* NeXT Matrix(Scan code)
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | 49| 4A| 4B| 4C| 4D| 50| 4F| 4E| 1E| 1F| 20| 1D| 1C| 1B | | 1A| 58| 19| | 26| 27| 28| 25|
* |-----------------------------------------------------------| |-----------| |---------------|
* | 41 | 42| 43| 44| 45| 48| 47| 46| 06| 07| 08| 05| 04| 03 | | 02| | 01| | 21| 22| 23| 24|
* |-----------------------------------------------------------| `---' `---' |-----------|---|
* | 57 | 39| 3A| 3B| 3C| 3D| 40| 3F| 3E| 2D| 2C| 2B| 2A | | 12| 18| 13| 15|
* |-----------------------------------------------------------| ,---. |---------------|
* | 56 | 31| 32| 33| 34| 35| 37| 36| 2E| 2F| 30| 55 | | 16| | 11| 17| 14| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* | 52 | 54 | 38 | 53 | 51 | | 09| 0F| 10| |0B | 0C| 0D|
* `-----------------------------------------------------------' `-----------' `---------------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BSpc | |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del| |PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `---' `---' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| Shift | |Up | | 1| 2| 3| |
* |-----------------------------------------------------------| ,-----------. |-----------| |
* |LCtl |Gui | Space | App | RCtl| |Lef|Dow|Rig| | 0 | .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*/
// Matrix 12 * 8
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
{ UNIMAP_NO, UNIMAP_PGDN, UNIMAP_DEL, UNIMAP_BSLS, UNIMAP_RBRC, UNIMAP_LBRC, UNIMAP_I, UNIMAP_O }, // 0x00-07
{ UNIMAP_P, UNIMAP_LEFT, UNIMAP_NO, UNIMAP_P0, UNIMAP_PDOT, UNIMAP_PENT, UNIMAP_NO, UNIMAP_DOWN }, // 0x08-0F
{ UNIMAP_RGHT, UNIMAP_P1, UNIMAP_P4, UNIMAP_P6, UNIMAP_P3, UNIMAP_PCMM, UNIMAP_UP, UNIMAP_P2 }, // 0x10-17
{ UNIMAP_P5, UNIMAP_PGUP, UNIMAP_INS, UNIMAP_BSPC, UNIMAP_EQL, UNIMAP_MINS, UNIMAP_8, UNIMAP_9 }, // 0x18-1f
{ UNIMAP_0, UNIMAP_P7, UNIMAP_P8, UNIMAP_P9, UNIMAP_PPLS, UNIMAP_PMNS, UNIMAP_NLCK, UNIMAP_PSLS }, // 0x20-27
{ UNIMAP_PAST, UNIMAP_NO, UNIMAP_ENT, UNIMAP_QUOT, UNIMAP_SCLN, UNIMAP_L, UNIMAP_COMM, UNIMAP_DOT }, // 0x28-2f
{ UNIMAP_SLSH, UNIMAP_Z, UNIMAP_X, UNIMAP_C, UNIMAP_V, UNIMAP_B, UNIMAP_M, UNIMAP_N }, // 0x30-37
{ UNIMAP_SPC, UNIMAP_A, UNIMAP_S, UNIMAP_D, UNIMAP_F, UNIMAP_G, UNIMAP_K, UNIMAP_J }, // 0x38-3f
{ UNIMAP_H, UNIMAP_TAB, UNIMAP_Q, UNIMAP_W, UNIMAP_E, UNIMAP_R, UNIMAP_U, UNIMAP_Y }, // 0x40-47
{ UNIMAP_T, UNIMAP_GRV, UNIMAP_1, UNIMAP_2, UNIMAP_3, UNIMAP_4, UNIMAP_7, UNIMAP_6 }, // 0x48-4f
{ UNIMAP_5, UNIMAP_RCTL, UNIMAP_LCTL, UNIMAP_APP, UNIMAP_LGUI, UNIMAP_RSFT, UNIMAP_LSFT, UNIMAP_CAPS }, // 0x50-57
{ UNIMAP_HOME, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO } // 0x58-5f
};
#endif

View File

@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "action.h" #include "action.h"
#include "action_macro.h" #include "action_macro.h"
@ -72,7 +71,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
,---------------------------------------------------------------. ,---------------------------------------------------------------.
| 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E| | 60| 61| 62| 63| 64| 65| 66| 67| 68| 69| 6A| 6B| 36| 37| 3F| 3E|
@ -114,7 +113,6 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT LGUI, LALT, LCTL, LSFT, SPC, SPC, RALT
), ),
}; };
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
/* /*
* Macro definition * Macro definition
@ -163,7 +161,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
/* /*
* Fn actions * Fn actions
*/ */
static const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
ACTION_LAYER_TAP_TOGGLE(0), // FN0 ACTION_LAYER_TAP_TOGGLE(0), // FN0
ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1 ACTION_LAYER_TAP_KEY(1, KC_SLASH), // FN1
ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2 ACTION_LAYER_TAP_KEY(2, KC_SCLN), // FN2
@ -172,37 +170,3 @@ static const uint16_t PROGMEM fn_actions[] = {
ACTION_MACRO(RBRACKET), // FN5 ACTION_MACRO(RBRACKET), // FN5
ACTION_MACRO(DUMMY), // FN6 ACTION_MACRO(DUMMY), // FN6
}; };
/*
* No need to edit.
*/
#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, keypos_t key)
{
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
// fall back to layer 0
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}
/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
action_t action;
if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
} else {
action.code = ACTION_NO;
}
return action;
}

View File

@ -46,20 +46,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) ((code>>3)&0xF) #define ROW(code) ((code>>3)&0xF)
#define COL(code) (code&0x07) #define COL(code) (code&0x07)
static bool is_modified = false;
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
static void pc98_inhibit_repeat(void) static void pc98_inhibit_repeat(void)
{ {
@ -128,8 +114,6 @@ void matrix_init(void)
uint8_t matrix_scan(void) uint8_t matrix_scan(void)
{ {
is_modified = false;
uint16_t code; uint16_t code;
PC98_RDY_PORT |= (1<<PC98_RDY_BIT); PC98_RDY_PORT |= (1<<PC98_RDY_BIT);
_delay_us(30); _delay_us(30);
@ -156,56 +140,18 @@ if (code == 0x60) {
// break code // break code
if (matrix_is_on(ROW(code), COL(code))) { if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code)); matrix[ROW(code)] &= ~(1<<COL(code));
is_modified = true;
} }
} else { } else {
// make code // make code
if (!matrix_is_on(ROW(code), COL(code))) { if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= (1<<COL(code)); matrix[ROW(code)] |= (1<<COL(code));
is_modified = true;
} }
} }
return code; return code;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline
bool matrix_has_ghost(void)
{
return false;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}

View File

@ -1,32 +1,39 @@
#
# Makefile for Teensy
#
# Target file name (without extension). # Target file name (without extension).
TARGET = ps2_usb_lufa TARGET ?= ps2_usb
# Directory common source filess exist # Directory common source filess exist
TMK_DIR = ../../tmk_core TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = . TARGET_DIR ?= .
# project specific files # project specific files
SRC = keymap_common.c \ SRC ?= matrix.c \
matrix.c \
led.c led.c
ifdef KEYMAP #
SRC := keymap_$(KEYMAP).c $(SRC) # Keymap file
#
ifdef UNIMAP_ENABLE
KEYMAP_FILE = unimap
else else
SRC := keymap_plain.c $(SRC) ifdef ACTIONMAP_ENABLE
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE)_plain.c $(SRC)
endif endif
CONFIG_H = config.h CONFIG_H ?= config.h
# MCU name # MCU name
#MCU = at90usb1287 MCU ?= atmega32u2
MCU = atmega32u4
# Processor frequency. # Processor frequency.
# This will define a symbol, F_CPU, in all source code files equal to the # This will define a symbol, F_CPU, in all source code files equal to the
@ -39,14 +46,14 @@ MCU = atmega32u4
# does not *change* the processor frequency - it should merely be updated to # does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000 F_CPU ?= 16000000
# #
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
@ -59,11 +66,14 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task(+60) # Interrupt driven control endpoint task
# Not work with suart debug
#OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT #OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# This improves response of keyboard when wakeup
OPT_DEFS += -DSUSPEND_MODE_STANDBY
# Boot Section Size in *bytes* # Boot Section Size in *bytes*
# Teensy halfKay 512 # Teensy halfKay 512
@ -71,25 +81,26 @@ F_USB = $(F_CPU)
# Atmel DFU loader 4096 # Atmel DFU loader 4096
# LUFA bootloader 4096 # LUFA bootloader 4096
# USBaspLoader 2048 # USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=512 BOOTLOADER_SIZE ?= 4096
OPT_DEFS += -DBOOTLOADER_SIZE=$(BOOTLOADER_SIZE)
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE ?= no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE ?= yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE ?= yes # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA NKRO_ENABLE ?= yes # USB Nkey Rollover
# PS/2 Options # PS/2 Options
# #
#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened) #PS2_USE_USART ?= yes # uses hardware USART engine for PS/2 signal receive(recomened)
PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin PS2_USE_INT ?= yes # uses external interrupt for falling edge of PS/2 clock pin
#PS2_USE_BUSYWAIT = yes # uses primitive reference code #PS2_USE_BUSYWAIT ?= yes # uses primitive reference code
# Optimize size but this may cause error "relocation truncated to fit" # Optimize size but this may cause error "relocation truncated to fit"

View File

@ -10,7 +10,6 @@ OBJDIR = ./build
OBJECTS = \ OBJECTS = \
$(OBJDIR)/protocol/ps2_busywait.o \ $(OBJDIR)/protocol/ps2_busywait.o \
$(OBJDIR)/protocol/ps2_io_mbed.o \ $(OBJDIR)/protocol/ps2_io_mbed.o \
$(OBJDIR)/./keymap_common.o \
$(OBJDIR)/./matrix.o \ $(OBJDIR)/./matrix.o \
$(OBJDIR)/./led.o \ $(OBJDIR)/./led.o \
$(OBJDIR)/./main.o $(OBJDIR)/./main.o

View File

@ -1,75 +0,0 @@
# Target file name (without extension).
TARGET = ps2_usb_pjrc
# Directory common source filess exist
TMK_DIR = ../../tmk_core
# Directory keyboard dependent files exist
TARGET_DIR = .
# keyboard dependent files
SRC = keymap_common.c \
matrix.c \
led.c
ifdef KEYMAP
SRC := keymap_$(KEYMAP).c $(SRC)
else
SRC := keymap_plain.c $(SRC)
endif
CONFIG_H = config.h
# MCU name, you MUST set this to match the board you are using
# type "make clean" after changing this, so all files will be rebuilt
#MCU = at90usb162 # Teensy 1.0
MCU = atmega32u4 # Teensy 2.0
#MCU = at90usb646 # Teensy++ 1.0
#MCU = at90usb1286 # Teensy++ 2.0
# Processor frequency.
# Normally the first thing your program should do is set the clock prescaler,
# so your program will run at the correct speed. You should also set this
# variable to same clock speed. The _delay_ms() macro uses this, and many
# examples use this variable to calculate timings. Do not add a "UL" here.
F_CPU = 16000000
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 1024
# Atmel DFU loader 4096
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
# Build Options
# *Comment out* to disable the options.
#
#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys
EXTRAKEY_ENABLE = yes # Audio control and System control
CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover
# PS/2 Options
#
#PS2_USE_USART = yes # uses hardware USART engine for PS/2 signal receive(recomened)
#PS2_USE_INT = yes # uses external interrupt for falling edge of PS/2 clock pin
PS2_USE_BUSYWAIT = yes # uses primitive reference code
# Search Path
VPATH += $(TARGET_DIR)
VPATH += $(TMK_DIR)
include $(TMK_DIR)/protocol.mk
include $(TMK_DIR)/protocol/pjrc.mk
include $(TMK_DIR)/common.mk
include $(TMK_DIR)/rules.mk

View File

@ -0,0 +1,17 @@
TARGET ?= ps2_usb_rev1
MCU = atmega32u4
CONFIG_H = config_rev1.h
BOOTLOADER_SIZE = 4096
BOOTMAGIC_ENABLE ?= no
MOUSEKEY_ENABLE ?= yes
EXTRAKEY_ENABLE ?= yes
CONSOLE_ENABLE ?= yes
COMMAND_ENABLE ?= yes
NKRO_ENABLE ?= yes
PS2_USE_USART = yes
PS2_USE_INT = no
PS2_USE_BUSYWAIT = no
include Makefile

View File

@ -0,0 +1,17 @@
TARGET ?= ps2_usb_rev2
MCU = atmega32u2
CONFIG_H = config_rev2.h
BOOTLOADER_SIZE = 4096
BOOTMAGIC_ENABLE ?= no
MOUSEKEY_ENABLE ?= no
EXTRAKEY_ENABLE ?= yes
CONSOLE_ENABLE ?= yes
COMMAND_ENABLE ?= yes
NKRO_ENABLE ?= yes
PS2_USE_USART = no
PS2_USE_INT = yes
PS2_USE_BUSYWAIT = no
include Makefile

View File

@ -0,0 +1,5 @@
TARGET = ps2_usb_rev1_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
include Makefile.rev1

View File

@ -0,0 +1,6 @@
TARGET = ps2_usb_rev2_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
#LUFA_DEBUG_SUART = yes
include Makefile.rev2

View File

@ -8,8 +8,7 @@ TMK_DIR = ../../tmk_core
TARGET_DIR = . TARGET_DIR = .
# keyboard dependent files # keyboard dependent files
SRC = keymap_common.c \ SRC = matrix.c \
matrix.c \
led.c led.c
ifdef KEYMAP ifdef KEYMAP

View File

@ -5,36 +5,30 @@ This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set
Connect Wires Connect Wires
------------- -------------
In case of Teensy2.0(ATMega32U4):
1. Connect **Vcc** and **GND**. 1. Connect **Vcc** and **GND**.
2. Connect **Clock** and **Data** line. 2. Connect **Clock** and **Data** line.
- **Interrupt**: **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible) - **Interrupt**: **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible)
- **Busywait**: **Clock** is on `PD1` and **Data** on `PD0`. - **Busywait**: **Clock** is on `PD1` and **Data** on `PD0`.
- **USART**: **Clock** is on `PD5` and **Data** on `PD2`. - **USART**: **Clock** is on `PD5` and **Data** on `PD2`.
3. Optionally you need pull-up resistor. 1K-10K Ohm is OK. 3. You need pull-up resistors. 1K-10K Ohm would be fine.
To change pin configuration edit **config.h** and **Makefile**. To change pin configuration edit **config.h** and **Makefile**.
Build Firmware Build Firmware
-------------- --------------
For **PJRC Teensy** just run `make`: For **TMK converter Rev.2**:
$ make clean $ make -f Makefile.rev2 clean
$ make $ make -f Makefile.rev2 KEYMAP=plain
To select keymap: To program firmware push the button on converter and run:
$ make clean $ make -f Makefile.rev2 KEYMAP=plain dfu
$ make KEYMAP=[plain|jis|spacefn|...]
After that you will find HEX file `ps2_usb_lufa.hex` in current directory.
- For **TMK converter Rev.1** use `make -f Makefile.tmk_rev1` instead of `make` and HEX file is `ps2_usb_tmk_rev1.hex`. - For **TMK converter Rev.1** use `make -f Makefile.rev1` instead.
- To select keymap use `jis`, `spacefn` or your own in place of `plain`.
- For **TMK converter Rev.2** use `make -f Makefile.tmk_rev2` instead of `make` and HEX file is `ps2_usb_tmk_rev2.hex`.
Keymap Keymap

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* key combination for command */ /* key combination for command */
#define IS_COMMAND() ( \ #define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \
) )
@ -61,7 +61,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
* PS/2 Pin interrupt * PS/2 Pin interrupt
*/ */
#ifdef PS2_USE_INT #ifdef PS2_USE_INT
#if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) #if defined(__AVR_ATmega16U4__) || defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega32U2__)
/* uses INT1 for clock line(ATMega32U4) */ /* uses INT1 for clock line(ATMega32U4) */
#define PS2_CLOCK_PORT PORTD #define PS2_CLOCK_PORT PORTD
#define PS2_CLOCK_PIN PIND #define PS2_CLOCK_PIN PIND

View File

@ -36,7 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* key combination for command */ /* key combination for command */
#define IS_COMMAND() ( \ #define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \
) )

View File

@ -35,7 +35,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* key combination for command */ /* key combination for command */
#define IS_COMMAND() ( \ #define IS_COMMAND() ( \
keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \
keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) \
) )
@ -82,4 +83,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PS2_INT_VECT INT1_vect #define PS2_INT_VECT INT1_vect
#endif #endif
#ifdef LUFA_DEBUG_SUART
# define SUART_OUT_DDR DDRD
# define SUART_OUT_PORT PORTD
# define SUART_OUT_BIT 4
# define SUART_IN_DDR DDRD
# define SUART_IN_PIN PIND
# define SUART_IN_BIT 4
#endif
#endif #endif

View File

@ -28,25 +28,55 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keymap.h" #include "keymap.h"
// 32*8(256) byte array which converts PS/2 code into USB code /* ,-----------------------------------------------.
extern const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; * |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
extern const uint16_t fn_actions[]; * ,---. |-----------------------------------------------| ,-----------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| ^a|Entr| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent|
* |-----------------------------------------------------------| ,-----------. |---------------|
* |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | #| 0| .|KP=|
* `-----------------------------------------------------------' `-----------' `---------------'
*
* PS/2 scan codes
* http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
* ,-----------------------------------------------.
* | 08| 10| 18| 20| 28| 30| 38| 40| 48| 50| 57| 5F|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* | 76| | 05| 06| 04| 0C| 03| 0B| 83| 0A| 01| 09| 78| 07| | FC| 7E| FE| | A1| B2| A3|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | 0E| 16| 1E| 26| 25| 2E| 36| 3D| 3E| 46| 45| 4E| 55| 6A| 66| | F0| EC| FD| | 77| CA| 7C| 7B|
* |-----------------------------------------------------------| |-----------| |---------------|
* | 0D | 15| 1D| 24| 2D| 2C| 35| 3C| 43| 44| 4D| 54| 5B| 5D | | F1| E9| FA| | 6C| 75| 7D| 79|
* |-----------------------------------------------------------| `-----------' |---------------|
* | 58 | 1C| 1B| 23| 2B| 34| 33| 3B| 42| 4B| 4C| 52| ^a| 5A | | 6B| 73| 74| 6D|
* |-----------------------------------------------------------| ,---. |---------------|
* | 12 | 61| 1A| 22| 21| 2A| 32| 31| 3A| 41| 49| 4A| 51| 59 | | F5| | 69| 72| 7A| DA|
* |-----------------------------------------------------------| ,-----------. |---------------|
* | 14| 9F| 11| 67 | 29 | 64 | 13 | 91| A7| AF| 94| | EB| F2| F4| | 68|70 | 71| 63|
* `-----------------------------------------------------------' `-----------' `---------------'
* ^a ISO hash key uses identical scancode 5D to US backslash.
* 51, 63, 68, 6D: hidden keys in IBM model M
*/
/* All keys */ /* All keys */
#define KEYMAP_ALL( \ #define KEYMAP_ALL( \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, KA1,KB2,KA3, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \
K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K6D, \
K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \
K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, K68,K70,K71,K63, \
\ \
K61, /* for European ISO */ \
K51, K13, K6A, K64, K67, /* for Japanese JIS */ \
K08, K10, K18, K20, K28, K30, K38, K40, K48, K50, K57, K5F, /* F13-24 */ \
KB7, KBF, KDE, /* System Power, Sleep, Wake */ \ KB7, KBF, KDE, /* System Power, Sleep, Wake */ \
KA3, KB2, KA1, /* Mute, Volume Up, Volume Down */ \
KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */ \ KCD, K95, KBB, KB4, KD0, /* Next, Previous, Stop, Pause, Media Select */ \
KC8, KAB, KC0, /* Mail, Calculator, My Computer */ \ KC8, KAB, KC0, /* Mail, Calculator, My Computer */ \
K90, KBA, KB8, KB0, /* WWW Search, Home, Back, Forward */ \ K90, KBA, KB8, KB0, /* WWW Search, Home, Back, Forward */ \
@ -64,8 +94,8 @@ extern const uint16_t fn_actions[];
{ KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \ { KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_NO }, \
{ KC_##K50, KC_##K51, KC_##K52, KC_NO, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \ { KC_##K50, KC_##K51, KC_##K52, KC_NO, KC_##K54, KC_##K55, KC_NO, KC_##K57 }, \
{ KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_##K5D, KC_NO, KC_##K5F }, \ { KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_NO, KC_##K5D, KC_NO, KC_##K5F }, \
{ KC_NO, KC_##K61, KC_NO, KC_NO, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \ { KC_NO, KC_##K61, KC_NO, KC_##K63, KC_##K64, KC_NO, KC_##K66, KC_##K67 }, \
{ KC_NO, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_NO, KC_NO, KC_NO }, \ { KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_NO, KC_NO }, \
{ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \ { KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74, KC_##K75, KC_##K76, KC_##K77 }, \
{ KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \ { KC_##K78, KC_##K79, KC_##K7A, KC_##K7B, KC_##K7C, KC_##K7D, KC_##K7E, KC_NO }, \
{ KC_NO, KC_NO, KC_NO, KC_##K83, KC_NO, KC_NO, KC_NO, KC_NO }, \ { KC_NO, KC_NO, KC_NO, KC_##K83, KC_NO, KC_NO, KC_NO, KC_NO }, \
@ -86,6 +116,31 @@ extern const uint16_t fn_actions[];
{ KC_NO, KC_NO, KC_##KFA, KC_NO, KC_##KFC, KC_##KFD, KC_##KFE, KC_NO }, \ { KC_NO, KC_NO, KC_##KFA, KC_NO, KC_##KFC, KC_##KFD, KC_##KFE, KC_NO }, \
} }
#define KEYMAP_FULL( \
K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, KA1,KB2,KA3, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K6D, \
K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \
K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, K68,K70,K71,K63 \
) \
KEYMAP_ALL( \
K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, KA1,KB2,KA3, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K6D, \
K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \
K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, K68,K70,K71,K63, \
\
SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
MAIL, CALCULATOR, MY_COMPUTER, \
WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
)
/* US layout */ /* US layout */
#define KEYMAP( \ #define KEYMAP( \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \
@ -95,23 +150,14 @@ extern const uint16_t fn_actions[];
K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \
) \ ) \
KEYMAP_ALL( \ KEYMAP_FULL( \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, VOLD,VOLU,MUTE, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,JPY,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \
K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,PCMM,\
K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ K12,NUBS,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, RO, K59, KF5, K69,K72,K7A,KDA, \
\ K14,K9F,K11,MHEN, K29, HENK,KANA,K91,KA7,KAF,K94, KEB,KF2,KF4, PWR,K70,K71,PEQL \
NUBS, \
RO, KANA, JYEN, HENK, MHEN, \
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \
SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \
MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
MAIL, CALCULATOR, MY_COMPUTER, \
WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
) )
/* ISO layout */ /* ISO layout */
@ -123,23 +169,14 @@ KEYMAP_ALL( \
K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \
K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \
) \ ) \
KEYMAP_ALL( \ KEYMAP_FULL( \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, VOLD,VOLU,MUTE, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,JPY,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \
K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,PCMM,\
K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, RO, K59, KF5, K69,K72,K7A,KDA, \
\ K14,K9F,K11,MHEN, K29, HENK,KANA,K91,KA7,KAF,K94, KEB,KF2,KF4, PWR,K70,K71,PEQL \
K61, \
RO, KANA, JYEN, HENK, MHEN, \
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \
SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \
MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
MAIL, CALCULATOR, MY_COMPUTER, \
WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
) )
/* JIS layout */ /* JIS layout */
@ -151,23 +188,14 @@ KEYMAP_ALL( \
K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \ K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A,K51, K59, KF5, K69,K72,K7A, \
K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \ K14,K9F,K11, K67,K29,K64,K13, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA \
) \ ) \
KEYMAP_ALL( \ KEYMAP_FULL( \
K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, \ F13,F14,F15,F16,F17,F18,F19,F20,F21,F22,F23,F24, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \ K76,K05,K06,K04,K0C,K03,K0B,K83,K0A,K01,K09,K78,K07, KFC,K7E,KFE, VOLD,VOLU,MUTE, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B,K5D, KF1,KE9,KFA, K6C,K75,K7D, \ K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K6A,K66, KF0,KEC,KFD, K77,KCA,K7C,K7B, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,K79, \ K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5D, KF1,KE9,KFA, K6C,K75,K7D,K79, \
K12,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, KF5, K69,K72,K7A, \ K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K5A, K6B,K73,K74,PCMM,\
K14,K9F,K11, K29, K91,KA7,KAF,K94, KEB,KF2,KF4, K70, K71,KDA, \ K12,NUBS,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, KF5, K69,K72,K7A,KDA, \
\ K14,K9F,K11,K67, K29, K64,K13,K91,KA7,KAF,K94, KEB,KF2,KF4, PWR,K70,K71,PEQL \
NUBS, \
K51, K13, K6A, K64, K67, \
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, \
SYSTEM_POWER, SYSTEM_SLEEP, SYSTEM_WAKE, \
AUDIO_MUTE, AUDIO_VOL_UP, AUDIO_VOL_DOWN, \
MEDIA_NEXT_TRACK, MEDIA_PREV_TRACK, MEDIA_STOP, MEDIA_PLAY_PAUSE, MEDIA_SELECT, \
MAIL, CALCULATOR, MY_COMPUTER, \
WWW_SEARCH, WWW_HOME, WWW_BACK, WWW_FORWARD, \
WWW_STOP, WWW_REFRESH, WWW_FAVORITES \
) )
#endif #endif

View File

@ -30,5 +30,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -28,5 +28,5 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
}; };

View File

@ -54,7 +54,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
}; };
const uint16_t PROGMEM fn_actions[] = { const action_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE),
[1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde
}; };

View File

@ -22,15 +22,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h" #include "util.h"
#include "debug.h" #include "debug.h"
#include "ps2.h" #include "ps2.h"
#include "host.h"
#include "led.h"
#include "matrix.h" #include "matrix.h"
static void matrix_make(uint8_t code); static void matrix_make(uint8_t code);
static void matrix_break(uint8_t code); static void matrix_break(uint8_t code);
static void matrix_clear(void);
#ifdef MATRIX_HAS_GHOST
static bool matrix_has_ghost_in_row(uint8_t row);
#endif
/* /*
@ -69,18 +67,6 @@ static uint8_t matrix[MATRIX_ROWS];
static bool is_modified = false; static bool is_modified = false;
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void) void matrix_init(void)
{ {
debug_enable = true; debug_enable = true;
@ -215,6 +201,12 @@ uint8_t matrix_scan(void)
print("Overrun\n"); print("Overrun\n");
state = INIT; state = INIT;
break; break;
case 0xAA: // Self-test passed
case 0xFC: // Self-test failed
printf("BAT %s\n", (code == 0xAA) ? "OK" : "NG");
led_set(host_keyboard_leds());
state = INIT;
break;
default: // normal key make default: // normal key make
if (code < 0x80) { if (code < 0x80) {
matrix_make(code); matrix_make(code);
@ -390,23 +382,6 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline
bool matrix_has_ghost(void)
{
#ifdef MATRIX_HAS_GHOST
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix_has_ghost_in_row(i))
return true;
}
#endif
return false;
}
inline inline
bool matrix_is_on(uint8_t row, uint8_t col) bool matrix_is_on(uint8_t row, uint8_t col)
{ {
@ -419,21 +394,6 @@ uint8_t matrix_get_row(uint8_t row)
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
#ifdef MATRIX_HAS_GHOST
if (matrix_has_ghost_in_row(row)) {
print(" <ghost");
}
#endif
print("\n");
}
}
uint8_t matrix_key_count(void) uint8_t matrix_key_count(void)
{ {
uint8_t count = 0; uint8_t count = 0;
@ -443,23 +403,6 @@ uint8_t matrix_key_count(void)
return count; return count;
} }
#ifdef MATRIX_HAS_GHOST
inline
static bool matrix_has_ghost_in_row(uint8_t row)
{
// no ghost exists in case less than 2 keys on
if (((matrix[row] - 1) & matrix[row]) == 0)
return false;
// ghost exists in case same state as other row
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
if (i != row && (matrix[i] & matrix[row]) == matrix[row])
return true;
}
return false;
}
#endif
inline inline
static void matrix_make(uint8_t code) static void matrix_make(uint8_t code)
@ -479,8 +422,7 @@ static void matrix_break(uint8_t code)
} }
} }
inline void matrix_clear(void)
static void matrix_clear(void)
{ {
for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00;
} }

View File

@ -0,0 +1,45 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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 "unimap_trans.h"
#define AC_FN0 ACTION_LAYER_MOMENTARY(1)
#ifdef KEYMAP_SECTION_ENABLE
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
#else
const action_t actionmaps[][UNIMAP_ROWS][UNIMAP_COLS] PROGMEM = {
#endif
UNIMAP_PS2(
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS,
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PCMM,
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT,
LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,FN0, RCTL, LEFT,DOWN,RGHT, NUHS,P0, PDOT,PEQL
),
UNIMAP(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,
GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, INS, DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, INS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,VOLD,VOLU,MUTE,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,LEFT,RGHT, TRNS, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,END, PGDN,DOWN, TRNS,TRNS, PGUP, TRNS,TRNS,TRNS,TRNS,
TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, HOME,PGDN,END, TRNS,TRNS,TRNS,TRNS
),
};

View File

@ -0,0 +1,120 @@
/*
Copyright 2016 Jun Wako <wakojun@gmail.com>
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/>.
*/
#ifndef UNIMAP_TRNAS_H
#define UNIMAP_TRNAS_H
#include <stdint.h>
#include <avr/pgmspace.h>
#include "unimap.h"
#define UNIMAP_PS2( \
K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \
K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K01,K02,K03, \
K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K74,K2A, K49,K4A,K4B, K53,K54,K55,K56, \
K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, \
K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K28, K5C,K5D,K5E,K66, \
K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K58, \
K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K32,K62,K63,K67 \
) UNIMAP ( \
K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \
K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K01,K02,K03, \
K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K74,K2A, K49,K4A,K4B, K53,K54,K55,K56, \
K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, \
K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,K66, \
K79,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K75,K7D, K52, K59,K5A,K5B,K58, \
K78,K7B,K7A,K77, K2C, K76,K00,K7E,K7F,K65,K7C, K50,K51,K4F, K62,K63,K67 \
)
/* Mapping to Universal keyboard layout
*
* Universal keyboard layout
* ,-----------------------------------------------.
* |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -|
* |-----------------------------------------------------------| |-----------| |---------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +|
* |-----------------------------------------------------------| `-----------' |---------------|
* |CapsL | A| S| D| F| G| H| J| K| L| ;| '| ^a|Retn| | 4| 5| 6|KP,|
* |-----------------------------------------------------------| ,---. |---------------|
* |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|KP=|
* |-----------------------------------------------------------| ,-----------. |---------------|
* |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | #| 0| .|Ent|
* `-----------------------------------------------------------' `-----------' `---------------'
*
* PS/2 scan codes
* http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf
* ,-----------------------------------------------.
* | 08| 10| 18| 20| 28| 30| 38| 40| 48| 50| 57| 5F|
* ,---. |-----------------------------------------------| ,-----------. ,-----------.
* | 76| | 05| 06| 04| 0C| 03| 0B| 83| 0A| 01| 09| 78| 07| | FC| 7E| FE| | A1| B2| A3|
* `---' `-----------------------------------------------' `-----------' `-----------'
* ,-----------------------------------------------------------. ,-----------. ,---------------.
* | 0E| 16| 1E| 26| 25| 2E| 36| 3D| 3E| 46| 45| 4E| 55| 6A| 66| | F0| EC| FD| | 77| CA| 7C| 7B|
* |-----------------------------------------------------------| |-----------| |---------------|
* | 0D | 15| 1D| 24| 2D| 2C| 35| 3C| 43| 44| 4D| 54| 5B| 5D | | F1| E9| FA| | 6C| 75| 7D| 79|
* |-----------------------------------------------------------| `-----------' |---------------|
* | 58 | 1C| 1B| 23| 2B| 34| 33| 3B| 42| 4B| 4C| 52| ^a| 5A | | 6B| 73| 74| 6D|
* |-----------------------------------------------------------| ,---. |---------------|
* | 12 | 61| 1A| 22| 21| 2A| 32| 31| 3A| 41| 49| 4A| 51| 59 | | F5| | 69| 72| 7A| DA|
* |-----------------------------------------------------------| ,-----------. |---------------|
* | 14| 9F| 11| 67 | 29 | 64 | 13 | 91| A7| AF| 94| | EB| F2| F4| | 68| 70| 71| 63|
* `-----------------------------------------------------------' `-----------' `---------------'
* ^a: ISO hash key uses identical scancode 5D to US backslash.
* 51, 63, 68, 6D: hidden keys in IBM model M
*/
const uint8_t PROGMEM unimap_trans[MATRIX_ROWS][MATRIX_COLS] = {
{ UNIMAP_NO, UNIMAP_F9, UNIMAP_NO, UNIMAP_F5, UNIMAP_F3, UNIMAP_F1, UNIMAP_F2, UNIMAP_F12 }, /* 00-07 */
{ UNIMAP_F13, UNIMAP_F10, UNIMAP_F8, UNIMAP_F6, UNIMAP_F4, UNIMAP_TAB, UNIMAP_GRV, UNIMAP_NO }, /* 08-0F */
{ UNIMAP_F14, UNIMAP_LALT, UNIMAP_LSHIFT,UNIMAP_KANA, UNIMAP_LCTL, UNIMAP_Q, UNIMAP_1, UNIMAP_NO }, /* 10-17 */
{ UNIMAP_F15, UNIMAP_NO, UNIMAP_Z, UNIMAP_S, UNIMAP_A, UNIMAP_W, UNIMAP_2, UNIMAP_NO }, /* 18-1F */
{ UNIMAP_F16, UNIMAP_C, UNIMAP_X, UNIMAP_D, UNIMAP_E, UNIMAP_4, UNIMAP_3, UNIMAP_NO }, /* 20-27 */
{ UNIMAP_F17, UNIMAP_SPACE, UNIMAP_V, UNIMAP_F, UNIMAP_T, UNIMAP_R, UNIMAP_5, UNIMAP_NO }, /* 28-2F */
{ UNIMAP_F18, UNIMAP_N, UNIMAP_B, UNIMAP_H, UNIMAP_G, UNIMAP_Y, UNIMAP_6, UNIMAP_NO }, /* 30-37 */
{ UNIMAP_F19, UNIMAP_NO, UNIMAP_M, UNIMAP_J, UNIMAP_U, UNIMAP_7, UNIMAP_8, UNIMAP_NO }, /* 38-3F */
{ UNIMAP_F20, UNIMAP_COMMA, UNIMAP_K, UNIMAP_I, UNIMAP_O, UNIMAP_0, UNIMAP_9, UNIMAP_NO }, /* 40-47 */
{ UNIMAP_F21, UNIMAP_DOT, UNIMAP_SLASH, UNIMAP_L, UNIMAP_SCOLON,UNIMAP_P, UNIMAP_MINUS, UNIMAP_NO }, /* 48-4F */
{ UNIMAP_F22, UNIMAP_RO, UNIMAP_QUOTE, UNIMAP_NO, UNIMAP_LBRC, UNIMAP_EQUAL, UNIMAP_NO, UNIMAP_F23 }, /* 50-57 */
{ UNIMAP_CAPS, UNIMAP_RSHIFT,UNIMAP_ENTER, UNIMAP_RBRC, UNIMAP_NO, UNIMAP_BSLASH,UNIMAP_NO, UNIMAP_F24 }, /* 58-5F */
{ UNIMAP_NO, UNIMAP_NUBS, UNIMAP_NO, UNIMAP_PEQL, UNIMAP_HENK, UNIMAP_NO, UNIMAP_BSPACE,UNIMAP_MHEN }, /* 60-67 */
{ UNIMAP_NUHS, UNIMAP_P1, UNIMAP_JYEN, UNIMAP_P4, UNIMAP_P7, UNIMAP_PCMM, UNIMAP_NO, UNIMAP_NO }, /* 68-6F */
{ UNIMAP_P0, UNIMAP_PDOT, UNIMAP_P2, UNIMAP_P5, UNIMAP_P6, UNIMAP_P8, UNIMAP_ESC, UNIMAP_NLCK }, /* 70-77 */
{ UNIMAP_F11, UNIMAP_PPLS, UNIMAP_P3, UNIMAP_PMNS, UNIMAP_PAST, UNIMAP_P9, UNIMAP_SLCK, UNIMAP_NO }, /* 78-7F */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_F7, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 80-87 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 88-8F */
{ UNIMAP_NO, UNIMAP_RALT, UNIMAP_NO, UNIMAP_NO, UNIMAP_RCTRL, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* 90-97 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_LGUI }, /* 98-9F */
{ UNIMAP_NO, UNIMAP_VOLD, UNIMAP_NO, UNIMAP_MUTE, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_RGUI }, /* A0-A7 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_APP }, /* A8-AF */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_VOLU, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* B0-B7 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* B8-BF */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* C0-C7 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_PSLS, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* C8-CF */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* D0-D7 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_PENT, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* D8-DF */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* E0-E7 */
{ UNIMAP_NO, UNIMAP_END, UNIMAP_NO, UNIMAP_LEFT, UNIMAP_HOME, UNIMAP_NO, UNIMAP_NO, UNIMAP_NO }, /* E8-EF */
{ UNIMAP_INS, UNIMAP_DEL, UNIMAP_DOWN, UNIMAP_NO, UNIMAP_RIGHT, UNIMAP_UP, UNIMAP_NO, UNIMAP_NO }, /* F0-F7 */
{ UNIMAP_NO, UNIMAP_NO, UNIMAP_PGDOWN,UNIMAP_NO, UNIMAP_PSCR, UNIMAP_PGUP, UNIMAP_PAUSE, UNIMAP_NO }, /* F8-FF */
};
#endif

View File

@ -18,7 +18,7 @@ bool command_extra(uint8_t code)
print("Home: Toggle Bell\n"); print("Home: Toggle Bell\n");
print("End: Toggle Click\n"); print("End: Toggle Click\n");
print("PgUp: LED all On\n"); print("PgUp: LED all On\n");
print("PgDown: LED all On\n"); print("PgDown: LED all Off\n");
print("Insert: Layout\n"); print("Insert: Layout\n");
print("Delete: Reset\n"); print("Delete: Reset\n");
return false; return false;

View File

@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "util.h" #include "util.h"
#include "keymap.h" #include "keymap.h"
@ -27,7 +26,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Sun type 5 keyboard /* Sun type 5 keyboard
,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------. ,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------.
| 76 | | | | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30| | 76 | | 0F| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30|
`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------'
,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------.
| 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47| | 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47|
@ -42,7 +41,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
`-------' `-----------------------------------------------------------' `-----------' `---------------' `-------' `-----------------------------------------------------------' `-----------' `---------------'
*/ */
#define KEYMAP( \ #define KEYMAP( \
K76, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \ K76, K0F, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \
K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \ K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \
K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \ K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \
K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \
@ -50,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
K5F,K61, K77,K13, K78, K73, K79, K74, K75, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \ K5F,K61, K77,K13, K78, K73, K79, K74, K75, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \
) { \ ) { \
{ KC_NO, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \ { KC_NO, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07 }, \
{ KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_NO, }, \ { KC_##K08, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F,}, \
{ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \ { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17 }, \
{ KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \ { KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F }, \
{ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \ { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27 }, \
@ -77,17 +76,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K0D,K14,K6E, \ K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K0D,K14,K6E, \
K77,K13, K78, K79, K7A,K43,K62,K18,K1B,K1C \ K77,K13, K78, K79, K7A,K43,K62,K18,K1B,K1C \
) KEYMAP( \ ) KEYMAP( \
HELP, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,K30, \ HELP, NO, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,K30, \
K01, AGAIN, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C, K34, K60, K62, PSLS,PAST,PMNS, \ K01, AGAIN, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C, K34, K60, K62, PSLS,PAST,PMNS, \
MENU, UNDO, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42, K4A, K7B, P7, P8, P9, PPLS, \ MENU, UNDO, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42, K4A, K7B, P7, P8, P9, PPLS, \
SELECT, K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, P4, P5, P6, \ SELECT, K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, P4, P5, P6, \
EXECUTE,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, P1, P2, P3, PENT, \ EXECUTE,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, P1, P2, P3, PENT, \
FIND, K61, K77,K13, K78, HENK, K79, MHEN, KANA, K7A,K43,K0D, K18, K1B, K1C, P0, PDOT \ FIND, K61, K77,K13, K78, HENK, K79, MHEN, KANA, K7A,K43,K0D, K18, K1B, K1C, P0, PDOT \
) )
// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = { const uint8_t PROGMEM fn_layer[] = {
2, // Fn0 2, // Fn0
3, // Fn1 3, // Fn1
4, // Fn2 4, // Fn2
@ -100,7 +99,7 @@ static const uint8_t PROGMEM fn_layer[] = {
// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details. // See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = { const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0 KC_NO, // Fn0
KC_SCLN, // Fn1 KC_SCLN, // Fn1
KC_SLSH, // Fn2 KC_SLSH, // Fn2
@ -112,7 +111,7 @@ static const uint8_t PROGMEM fn_keycode[] = {
}; };
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* /*
KEYMAP( KEYMAP(
HELP, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,PWR, HELP, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10,F11,F12, PSCR,SLCK,PAUS, MUTE,VOLD,VOLU,PWR,
@ -174,19 +173,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT CAPS,LALT,LGUI, BTN1, RGUI,RALT,NO, LEFT,DOWN,RGHT
), ),
}; };
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}
uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}
uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

View File

@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "util.h" #include "util.h"
#include "keymap.h" #include "keymap.h"
@ -155,19 +154,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
*/ */
}; };
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}
uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}
uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

View File

@ -24,6 +24,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "matrix.h" #include "matrix.h"
#include "debug.h" #include "debug.h"
#include "protocol/serial.h" #include "protocol/serial.h"
#include "led.h"
#include "host.h"
/* /*
@ -46,20 +48,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) ((code>>3)&0xF) #define ROW(code) ((code>>3)&0xF)
#define COL(code) (code&0x07) #define COL(code) (code&0x07)
static bool is_modified = false;
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void) void matrix_init(void)
{ {
@ -87,13 +75,13 @@ void matrix_init(void)
} }
} }
print(" Done\n"); print(" Done\n");
PORTD &= ~(1<<6);
return; return;
} }
uint8_t matrix_scan(void) uint8_t matrix_scan(void)
{ {
is_modified = false;
uint8_t code; uint8_t code;
code = serial_recv(); code = serial_recv();
if (!code) return 0; if (!code) return 0;
@ -131,56 +119,18 @@ uint8_t matrix_scan(void)
// break code // break code
if (matrix_is_on(ROW(code), COL(code))) { if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code)); matrix[ROW(code)] &= ~(1<<COL(code));
is_modified = true;
} }
} else { } else {
// make code // make code
if (!matrix_is_on(ROW(code), COL(code))) { if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= (1<<COL(code)); matrix[ROW(code)] |= (1<<COL(code));
is_modified = true;
} }
} }
return code; return code;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline
bool matrix_has_ghost(void)
{
return false;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}

View File

@ -70,7 +70,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = yes # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE = yes # Commands for debug and configuration
#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend #SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
#NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA #NKRO_ENABLE = yes # USB Nkey Rollover
# #

View File

@ -17,7 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <avr/pgmspace.h>
#include "keycode.h" #include "keycode.h"
#include "print.h" #include "print.h"
#include "debug.h" #include "debug.h"
@ -102,7 +101,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
} }
// Assign Fn key(0-7) to a layer to which switch with the Fn key pressed. // Assign Fn key(0-7) to a layer to which switch with the Fn key pressed.
static const uint8_t PROGMEM fn_layer[] = { const uint8_t PROGMEM fn_layer[] = {
0, // Fn0 0, // Fn0
0, // Fn1 0, // Fn1
0, // Fn2 0, // Fn2
@ -115,7 +114,7 @@ static const uint8_t PROGMEM fn_layer[] = {
// Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer. // Assign Fn key(0-7) to a keycode sent when release Fn key without use of the layer.
// See layer.c for details. // See layer.c for details.
static const uint8_t PROGMEM fn_keycode[] = { const uint8_t PROGMEM fn_keycode[] = {
KC_NO, // Fn0 KC_NO, // Fn0
KC_NO, // Fn1 KC_NO, // Fn1
KC_NO, // Fn2 KC_NO, // Fn2
@ -127,7 +126,7 @@ static const uint8_t PROGMEM fn_keycode[] = {
}; };
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: default /* 0: default
* ,---. ,---------------. ,---------------. ,---------------. ,-----------. * ,---. ,---------------. ,---------------. ,---------------. ,-----------.
* |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau|
@ -198,19 +197,3 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
), ),
*/ */
}; };
uint8_t keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t col)
{
return pgm_read_byte(&keymaps[(layer)][(row)][(col)]);
}
uint8_t keymap_fn_layer(uint8_t index)
{
return pgm_read_byte(&fn_layer[index]);
}
uint8_t keymap_fn_keycode(uint8_t index)
{
return pgm_read_byte(&fn_keycode[index]);
}

View File

@ -28,9 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
static void matrix_make(uint8_t code); static void matrix_make(uint8_t code);
static void matrix_break(uint8_t code); static void matrix_break(uint8_t code);
#ifdef MATRIX_HAS_GHOST
static bool matrix_has_ghost_in_row(uint8_t row);
#endif
/* /*
@ -49,20 +46,6 @@ static uint8_t matrix[MATRIX_ROWS];
#define ROW(code) (code>>3) #define ROW(code) (code>>3)
#define COL(code) (code&0x07) #define COL(code) (code&0x07)
static bool is_modified = false;
inline
uint8_t matrix_rows(void)
{
return MATRIX_ROWS;
}
inline
uint8_t matrix_cols(void)
{
return MATRIX_COLS;
}
void matrix_init(void) void matrix_init(void)
{ {
@ -93,8 +76,6 @@ uint8_t matrix_scan(void)
F0, F0,
} state = RESET; } state = RESET;
is_modified = false;
uint8_t code; uint8_t code;
if ((code = ps2_host_recv())) { if ((code = ps2_host_recv())) {
debug("r"); debug_hex(code); debug(" "); debug("r"); debug_hex(code); debug(" ");
@ -172,83 +153,17 @@ uint8_t matrix_scan(void)
return 1; return 1;
} }
bool matrix_is_modified(void)
{
return is_modified;
}
inline
bool matrix_has_ghost(void)
{
#ifdef MATRIX_HAS_GHOST
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
if (matrix_has_ghost_in_row(i))
return true;
}
#endif
return false;
}
inline
bool matrix_is_on(uint8_t row, uint8_t col)
{
return (matrix[row] & (1<<col));
}
inline inline
uint8_t matrix_get_row(uint8_t row) uint8_t matrix_get_row(uint8_t row)
{ {
return matrix[row]; return matrix[row];
} }
void matrix_print(void)
{
print("\nr/c 01234567\n");
for (uint8_t row = 0; row < matrix_rows(); row++) {
phex(row); print(": ");
pbin_reverse(matrix_get_row(row));
#ifdef MATRIX_HAS_GHOST
if (matrix_has_ghost_in_row(row)) {
print(" <ghost");
}
#endif
print("\n");
}
}
uint8_t matrix_key_count(void)
{
uint8_t count = 0;
for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
count += bitpop(matrix[i]);
}
return count;
}
#ifdef MATRIX_HAS_GHOST
inline
static bool matrix_has_ghost_in_row(uint8_t row)
{
// no ghost exists in case less than 2 keys on
if (((matrix[row] - 1) & matrix[row]) == 0)
return false;
// ghost exists in case same state as other row
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
if (i != row && (matrix[i] & matrix[row]) == matrix[row])
return true;
}
return false;
}
#endif
inline inline
static void matrix_make(uint8_t code) static void matrix_make(uint8_t code)
{ {
if (!matrix_is_on(ROW(code), COL(code))) { if (!matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] |= 1<<COL(code); matrix[ROW(code)] |= 1<<COL(code);
is_modified = true;
} }
} }
@ -257,6 +172,5 @@ static void matrix_break(uint8_t code)
{ {
if (matrix_is_on(ROW(code), COL(code))) { if (matrix_is_on(ROW(code), COL(code))) {
matrix[ROW(code)] &= ~(1<<COL(code)); matrix[ROW(code)] &= ~(1<<COL(code));
is_modified = true;
} }
} }

View File

@ -39,15 +39,15 @@
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
# Target file name (without extension). # Target file name (without extension).
TARGET = usb_usb TARGET ?= usb_usb
TMK_DIR = ../../tmk_core TMK_DIR ?= ../../tmk_core
# Directory keyboard dependent files exist # Directory keyboard dependent files exist
TARGET_DIR = . TARGET_DIR ?= .
# MCU name # MCU name
MCU = atmega32u4 MCU ?= atmega32u4
# Processor frequency. # Processor frequency.
@ -61,7 +61,7 @@ MCU = atmega32u4
# does not *change* the processor frequency - it should merely be updated to # does not *change* the processor frequency - it should merely be updated to
# reflect the processor speed set externally so that the code can use accurate # reflect the processor speed set externally so that the code can use accurate
# software delays. # software delays.
F_CPU = 16000000 F_CPU ?= 16000000
@ -69,7 +69,7 @@ F_CPU = 16000000
# LUFA specific # LUFA specific
# #
# Target architecture (see library "Board Types" documentation). # Target architecture (see library "Board Types" documentation).
ARCH = AVR8 ARCH ?= AVR8
# Input clock frequency. # Input clock frequency.
# This will define a symbol, F_USB, in all source code files equal to the # This will define a symbol, F_USB, in all source code files equal to the
# input clock frequency (before any prescaling is performed) in Hz. This value may # input clock frequency (before any prescaling is performed) in Hz. This value may
@ -81,7 +81,7 @@ ARCH = AVR8
# #
# If no clock division is performed on the input clock inside the AVR (via the # If no clock division is performed on the input clock inside the AVR (via the
# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
F_USB = $(F_CPU) F_USB ?= $(F_CPU)
# Interrupt driven control endpoint task # Interrupt driven control endpoint task
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
@ -90,11 +90,11 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
# Build Options # Build Options
# comment out to disable the options. # comment out to disable the options.
# #
MOUSEKEY_ENABLE = yes # Mouse keys MOUSEKEY_ENABLE ?= yes # Mouse keys
EXTRAKEY_ENABLE = yes # Media control and System control EXTRAKEY_ENABLE ?= yes # Media control and System control
CONSOLE_ENABLE = yes # Console for debug CONSOLE_ENABLE ?= yes # Console for debug
#COMMAND_ENABLE = yes # Commands for debug and configuration #COMMAND_ENABLE ?= yes # Commands for debug and configuration
#NKRO_ENABLE = yes # USB Nkey Rollover #NKRO_ENABLE ?= yes # USB Nkey Rollover
# Boot Section Size in bytes # Boot Section Size in bytes
# Teensy halfKay 512 # Teensy halfKay 512
@ -108,18 +108,28 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096
#OPT_DEFS += -DNO_ACTION_LAYER #OPT_DEFS += -DNO_ACTION_LAYER
#OPT_DEFS += -DNO_ACTION_MACRO #OPT_DEFS += -DNO_ACTION_MACRO
SRC = \ SRC ?= usb_usb.cpp \
keymap_common.c \
usb_usb.cpp \
main.cpp main.cpp
ifdef KEYMAP #
SRC := keymap_$(KEYMAP).c $(SRC) # Keymap file
#
ifeq (yes,$(strip $(UNIMAP_ENABLE)))
KEYMAP_FILE = unimap
else else
SRC := keymap.c $(SRC) ifeq (yes,$(strip $(ACTIONMAP_ENABLE)))
KEYMAP_FILE = actionmap
else
KEYMAP_FILE = keymap
endif
endif
ifdef KEYMAP
SRC := $(KEYMAP_FILE)_$(KEYMAP).c $(SRC)
else
SRC := $(KEYMAP_FILE).c $(SRC)
endif endif
CONFIG_H = config.h CONFIG_H ?= config.h

View File

@ -0,0 +1,5 @@
TARGET = usb_usb_unimap
UNIMAP_ENABLE = yes
KEYMAP_SECTION_ENABLE = yes
#LUFA_DEBUG = yes
include Makefile

View File

@ -1,21 +1,31 @@
USB to USB keyboard protocol converter USB to USB keyboard protocol converter
====================================== ======================================
See for detail and discussion.
https://geekhack.org/index.php?topic=69169.0
Hardware requirement Hardware requirement
-------------------- --------------------
Arduino Leonardo There are two options.
http://arduino.cc/en/Main/ArduinoBoardLeonardo
Circuit@Home USB Host Shield 2.0 ### TMK USB-USB Converter
You can buy a fully assembled converter from me here.
https://geekhack.org/index.php?topic=69169.0
### Arduino Leonardo + Circuit@Home USB Host Shield 2.0
Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be better, you won't need even soldering iron.
http://arduino.cc/en/Main/ArduinoBoardLeonardo
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/ https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-2-0-for-arduino-assembled/
Buying Arduino Leonardo and USB Host Shield 2.0(from Circuit@home) will be the easiest way, you won't need even soldering iron. Other compatible boards like Arduino's Shield will also work well but I think Sparkfun's needs to be modified.
Arduino's Shield will also work well but I think Sparkfun's needs to be modified.
http://arduino.cc/en/Main/ArduinoUSBHostShield http://arduino.cc/en/Main/ArduinoUSBHostShield
https://www.sparkfun.com/products/9947 https://www.sparkfun.com/products/9947
Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing. Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with some fixes on signal/power routing.
https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini https://www.circuitsathome.com/products-page/arduino-shields/usb-host-shield-for-arduino-pro-mini
https://www.sparkfun.com/products/12587 https://www.sparkfun.com/products/12587
https://www.pjrc.com/teensy/td_libs_USBHostShield.html https://www.pjrc.com/teensy/td_libs_USBHostShield.html
@ -24,6 +34,8 @@ Also Pro Micro 3.3V(not Mini) or Teensy with mini host shield will work with som
Build firmware Build firmware
-------------- --------------
Build.
$ git clone git://github.com/tmk/tmk_keyboard.git $ git clone git://github.com/tmk/tmk_keyboard.git
$ cd tmk_keyboard $ cd tmk_keyboard
$ git submodule init $ git submodule init
@ -31,7 +43,12 @@ Build firmware
$ cd converter/usb_usb $ cd converter/usb_usb
$ make $ make
Program converter. Push reset button on Leonardo before run this command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0. And Program converter. Push button on TMK converter and just run this.
$ make dfu
In case of Leonardo push reset button then run command. Serial port name(COM17) depends your system. On Linux I got /dev/ttyACM0.
$ DEV=COM17 make program $ DEV=COM17 make program
or or
@ -42,15 +59,24 @@ Program converter. Push reset button on Leonardo before run this command. Serial
Limitation Limitation
---------- ----------
Only supports 'HID Boot protocol'. Only supports 'HID Boot protocol'.
Not support keyboard LED yet.
Note that the converter can host only USB "boot protocol" keyboard(6KRO) and not NKRO, it is possible to support NKRO keyboard but you will need to write HID report parser for that. Every NKRO keyboard can have different HID report and it is difficult to support all kind of NKRO keyboards in the market. Note that the converter can host only USB "boot protocol" keyboard(6KRO), not NKRO, it is possible to support NKRO keyboard but you will need to write HID report parser for that. Every NKRO keyboard can have different HID report and it is difficult to support all kind of NKRO keyboards in the market.
Keymap editor
-------------
You can editor keymap and download firmware with web brwoser.
- http://www.tmk-kbd.com/tmk_keyboard/editor/unimap/?usb_usb
Update Update
------ ------
2014/12/11 Added Hub support(confirmed with HHKB pro2) 2014/12/11 Added Hub support(confirmed with HHKB pro2)
2016/09/10 Unimap editor support
2016/10/18 Fix LED state at startup

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