aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn M Daly <jmdaly@gmail.com>2019-06-01 17:37:32 -0400
committerDrashna Jaelre <drashna@live.com>2019-06-01 14:37:32 -0700
commit02b3fadbac6c68940e1bf141397d5d7cb87a6928 (patch)
treec66a90f355afb9fce2250cf975714e982c59eda6
parent912b6a591643990cca5d4b795bdcc2ad9f172b2f (diff)
downloadqmk_firmware-02b3fadbac6c68940e1bf141397d5d7cb87a6928.tar.gz
qmk_firmware-02b3fadbac6c68940e1bf141397d5d7cb87a6928.zip
[Keyboard] Initial firmware and keymaps for the CO60 PCB (#5959)
* Add: Initial firmware and keymaps for the CO60 PCB * Apply suggestions from code review Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Co-Authored-By: Drashna Jaelre <drashna@live.com> Co-Authored-By: fauxpark <fauxpark@gmail.com> * Update: Address reviewer comments * Apply suggestions from code review Co-Authored-By: Drashna Jaelre <drashna@live.com> * Update: Reviewer changes
-rw-r--r--keyboards/handwired/co60/info.json38
-rw-r--r--keyboards/handwired/co60/keymaps/all_keys/config.h20
-rw-r--r--keyboards/handwired/co60/keymaps/all_keys/keymap.c48
-rw-r--r--keyboards/handwired/co60/keymaps/all_keys/readme.md5
-rw-r--r--keyboards/handwired/co60/keymaps/default/config.h19
-rw-r--r--keyboards/handwired/co60/keymaps/default/keymap.c54
-rw-r--r--keyboards/handwired/co60/keymaps/default/readme.md1
-rw-r--r--keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h21
-rw-r--r--keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c137
-rw-r--r--keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md6
-rw-r--r--keyboards/handwired/co60/readme.md26
-rw-r--r--keyboards/handwired/co60/rev1/config.h161
-rw-r--r--keyboards/handwired/co60/rev1/rev1.c46
-rw-r--r--keyboards/handwired/co60/rev1/rev1.h127
-rw-r--r--keyboards/handwired/co60/rev1/rules.mk70
-rw-r--r--keyboards/handwired/co60/rev6/chconf.h520
-rw-r--r--keyboards/handwired/co60/rev6/config.h60
-rw-r--r--keyboards/handwired/co60/rev6/halconf.h388
-rw-r--r--keyboards/handwired/co60/rev6/led.c240
-rw-r--r--keyboards/handwired/co60/rev6/led_custom.h22
-rw-r--r--keyboards/handwired/co60/rev6/mcuconf.h257
-rw-r--r--keyboards/handwired/co60/rev6/rev6.c39
-rw-r--r--keyboards/handwired/co60/rev6/rev6.h146
-rw-r--r--keyboards/handwired/co60/rev6/rules.mk59
-rw-r--r--keyboards/handwired/co60/rev7/chconf.h520
-rw-r--r--keyboards/handwired/co60/rev7/config.h70
-rw-r--r--keyboards/handwired/co60/rev7/halconf.h388
-rw-r--r--keyboards/handwired/co60/rev7/led.c242
-rw-r--r--keyboards/handwired/co60/rev7/led_custom.h22
-rw-r--r--keyboards/handwired/co60/rev7/mcuconf.h257
-rw-r--r--keyboards/handwired/co60/rev7/rev7.c39
-rw-r--r--keyboards/handwired/co60/rev7/rev7.h146
-rw-r--r--keyboards/handwired/co60/rev7/rules.mk59
33 files changed, 4253 insertions, 0 deletions
diff --git a/keyboards/handwired/co60/info.json b/keyboards/handwired/co60/info.json
new file mode 100644
index 000000000..46f369f92
--- /dev/null
+++ b/keyboards/handwired/co60/info.json
@@ -0,0 +1,38 @@
1{
2 "keyboard_name": "CO60",
3 "url": "https://github.com/jmdaly/CO60",
4 "maintainer": "qmk",
5 "width": 15,
6 "height": 5,
7 "layouts": {
8 "LAYOUT_all": {
9 "key_count": 68,
10 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"LSpace", "x":3.75, "y":4, "w":2.25}, {"label":"Fn", "x":6, "y":4, "w":1.25}, {"label":"RSpace", "x":7.25, "y":4, "w":2.75}, {"label":"Alt", "x":10, "y":4, "w":1}, {"label":"Win", "x":11, "y":4, "w":1}, {"label":"Menu", "x":12, "y":4, "w":1}, {"label":"Ctrl", "x":13, "y":4, "w":1}, {"label":"Fn", "x":14, "y":4, "w":1}]
11 },
12 "LAYOUT_60_ansi": {
13 "key_count": 61,
14 "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
15 },
16 "LAYOUT_60_ansi_split_bs_rshift": {
17 "key_count": 63,
18 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0, "w":1}, {"label":"Del", "x":14, "y":0, "w":1}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3, "w":1}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
19 },
20 "LAYOUT_60_iso": {
21 "key_count": 62,
22 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}]
23 },
24 "LAYOUT_60_hhkb": {
25 "key_count": 60,
26 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75},{"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"label":"Space", "x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}]
27 },
28 "LAYOUT_60_hhkb_split_space": {
29 "key_count": 62,
30 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75},{"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"label":"LSpace", "x":4, "y":4, "w":2.75}, {"label":"Fn", "x":6.75, "y":4, "w":1.5}, {"label":"RSpace", "x":8.25, "y":4, "w":2.75}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}]
31 },
32 "LAYOUT_60_hhkb_split_625u_space": {
33 "key_count": 63,
34 "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75},{"label":"Fn", "x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"LSpace", "x":3.75, "y":4, "w":2.25}, {"label":"Fn", "x":6, "y":4, "w":1.25}, {"label":"RSpace", "x":7.25, "y":4, "w":2.75}, {"label":"Menu", "x":10, "y":4, "w":1.25}, {"label":"Alt", "x":11.25, "y":4, "w":1.25}, {"label":"Win", "x":12.5, "y":4}]
35 }
36 }
37}
38
diff --git a/keyboards/handwired/co60/keymaps/all_keys/config.h b/keyboards/handwired/co60/keymaps/all_keys/config.h
new file mode 100644
index 000000000..a68c5c746
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/all_keys/config.h
@@ -0,0 +1,20 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19
20// place overrides here
diff --git a/keyboards/handwired/co60/keymaps/all_keys/keymap.c b/keyboards/handwired/co60/keymaps/all_keys/keymap.c
new file mode 100644
index 000000000..797b7ece3
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/all_keys/keymap.c
@@ -0,0 +1,48 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18
19enum co60_layers {
20 _L1,
21 _L2
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 [_L1] = LAYOUT_all( /* Base */
26 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_DEL,
27 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
28 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT,
29 KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LSFT,
30 KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, KC_HOME, KC_END, KC_INS, KC_RALT, KC_RGUI, KC_RIGHT, KC_RCTL
31 )
32};
33
34void matrix_init_user(void) {
35
36}
37
38void matrix_scan_user(void) {
39
40}
41
42bool process_record_user(uint16_t keycode, keyrecord_t *record) {
43 return true;
44}
45
46void led_set_user(uint8_t usb_led) {
47
48}
diff --git a/keyboards/handwired/co60/keymaps/all_keys/readme.md b/keyboards/handwired/co60/keymaps/all_keys/readme.md
new file mode 100644
index 000000000..0e472f235
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/all_keys/readme.md
@@ -0,0 +1,5 @@
1# Keymap that uses all possible switches
2
3This is in part to test all of the switches,
4but also it may be useful if anyone ever makes a
5layout that requires all switch positions.
diff --git a/keyboards/handwired/co60/keymaps/default/config.h b/keyboards/handwired/co60/keymaps/default/config.h
new file mode 100644
index 000000000..124091cc5
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/default/config.h
@@ -0,0 +1,19 @@
1/* Copyright 2018 John M Daly
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19// place overrides here
diff --git a/keyboards/handwired/co60/keymaps/default/keymap.c b/keyboards/handwired/co60/keymaps/default/keymap.c
new file mode 100644
index 000000000..35151c421
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/default/keymap.c
@@ -0,0 +1,54 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum co60_layers {
19 _L1,
20 _L2
21};
22
23const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
24 [_L1] = LAYOUT_60_ansi( /* Base */
25 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
26 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
27 KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
28 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
29 KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_L2), KC_RCTL
30 ),
31 [_L2] = LAYOUT_60_ansi( /* Base */
32 RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV,
33 _______, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_INSERT,
34 _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_HOME, KC_END, _______,
35 _______, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDOWN, _______,
36 _______, _______, _______, _______, _______, _______, _______, _______
37 )
38};
39
40void matrix_init_user(void) {
41
42}
43
44void matrix_scan_user(void) {
45
46}
47
48bool process_record_user(uint16_t keycode, keyrecord_t *record) {
49 return true;
50}
51
52void led_set_user(uint8_t usb_led) {
53
54}
diff --git a/keyboards/handwired/co60/keymaps/default/readme.md b/keyboards/handwired/co60/keymaps/default/readme.md
new file mode 100644
index 000000000..eb8ba49e3
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for co60 \ No newline at end of file
diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h
new file mode 100644
index 000000000..c88fbc29d
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/config.h
@@ -0,0 +1,21 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#pragma once
18
19#define LEADER_TIMEOUT 300
20
21// place overrides here
diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c
new file mode 100644
index 000000000..0f19f9fbe
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/keymap.c
@@ -0,0 +1,137 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include QMK_KEYBOARD_H
17
18enum co60_layers {
19 _L1,
20 _L2,
21 _L3
22};
23
24const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
25 // Default base layer. Except for the bottom row, this
26 // is close to a standard HHKB layout.
27 [_L1] = LAYOUT_60_hhkb_split_625u_space( /* Base */
28 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
29 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
30 CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
31 KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(_L3),
32 KC_LALT, KC_LGUI, KC_ENT, MO(_L3), KC_SPC, KC_LEAD, KC_RGUI, KC_RALT
33 ),
34 // My preferred base layout. This doesn't match the caps
35 // on my boards, so I don't make it default.
36 [_L2] = LAYOUT_60_hhkb_split_625u_space( /* Base */
37 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL,
38 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
39 CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
40 KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, MO(_L3),
41 KC_LALT, KC_LGUI, KC_ENT, MO(_L3), KC_SPC, KC_LEAD, KC_RGUI, KC_RALT
42 ),
43 [_L3] = LAYOUT_60_hhkb_split_625u_space( /* Function */
44 RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______,
45 BL_BRTG, BL_TOGG, BL_INC, BL_DEC, BL_ON, BL_OFF, _______, _______, _______, _______, _______, KC_PGUP, KC_INSERT, KC_DEL,
46 _______, RGB_TOG, RGB_MOD, RGB_RMOD, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_HOME, KC_END, _______,
47 _______, BL_DEC, _______, _______, _______, _______, _______, DF(_L1), DF(_L2), _______, KC_PGDOWN, _______, _______,
48 _______, _______, _______, _______, _______, _______, _______, _______
49 )
50};
51
52void matrix_init_user(void) {
53
54}
55
56LEADER_EXTERNS();
57
58void matrix_scan_user(void) {
59
60 LEADER_DICTIONARY() {
61 leading = false;
62 leader_end();
63
64 // Close a program in i3wm
65 SEQ_ONE_KEY(KC_Q) {
66 register_code(KC_LGUI);
67 register_code(KC_LSHIFT);
68 register_code(KC_Q);
69 unregister_code(KC_Q);
70 unregister_code(KC_LSHIFT);
71 unregister_code(KC_LGUI);
72 }
73 // Exit i3wm
74 SEQ_ONE_KEY(KC_E) {
75 register_code(KC_LGUI);
76 register_code(KC_LSHIFT);
77 register_code(KC_E);
78 unregister_code(KC_E);
79 unregister_code(KC_LSHIFT);
80 unregister_code(KC_LGUI);
81 }
82 // Copy selected text in suckless terminal
83 SEQ_ONE_KEY(KC_C) {
84 register_code(KC_LCTL);
85 register_code(KC_LSHIFT);
86 register_code(KC_C);
87 unregister_code(KC_C);
88 unregister_code(KC_LSHIFT);
89 unregister_code(KC_LCTL);
90 }
91 // Paste text in suckless terminal
92 SEQ_ONE_KEY(KC_V) {
93 register_code(KC_LCTL);
94 register_code(KC_LSHIFT);
95 register_code(KC_V);
96 unregister_code(KC_V);
97 unregister_code(KC_LSHIFT);
98 unregister_code(KC_LCTL);
99 }
100 // FZF shortcut to fuzzy switch directories
101 SEQ_ONE_KEY(KC_D) {
102 register_code(KC_LALT);
103 register_code(KC_C);
104 unregister_code(KC_C);
105 unregister_code(KC_LALT);
106 }
107 // Send keys to bring up fuzzy process kill
108 SEQ_ONE_KEY(KC_K) {
109 SEND_STRING("kill " SS_TAP(X_TAB));
110 }
111 // Send keys to start neovim and fuzzy search for filename
112 SEQ_ONE_KEY(KC_T) {
113 SEND_STRING("nvim ");
114 register_code(KC_LCTL);
115 register_code(KC_T);
116 unregister_code(KC_T);
117 unregister_code(KC_LCTL);
118 }
119 // Switch between windows in tmux
120 SEQ_ONE_KEY(KC_L) {
121 register_code(KC_LCTL);
122 register_code(KC_B);
123 unregister_code(KC_B);
124 unregister_code(KC_LCTL);
125 register_code(KC_L);
126 unregister_code(KC_L);
127 }
128 }
129}
130
131bool process_record_user(uint16_t keycode, keyrecord_t *record) {
132 return true;
133}
134
135void led_set_user(uint8_t usb_led) {
136
137}
diff --git a/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md
new file mode 100644
index 000000000..032fc85f9
--- /dev/null
+++ b/keyboards/handwired/co60/keymaps/jmdaly_hhkb_split_space/readme.md
@@ -0,0 +1,6 @@
1# The split-space HHKB keymap for co60
2
3This keymap implements a modified MX HHKB layout, but in addition to 7u space,
4this layout supports a number of split spacebar bottom rows. The full set of
5layout options is found
6[here](http://www.keyboard-layout-editor.com/#/gists/b488496b3a71c8192113c07e298be340).
diff --git a/keyboards/handwired/co60/readme.md b/keyboards/handwired/co60/readme.md
new file mode 100644
index 000000000..2a649ea9b
--- /dev/null
+++ b/keyboards/handwired/co60/readme.md
@@ -0,0 +1,26 @@
1# co60
2
3The CO60 is a 60% PCB that aims to meet the following goals:
4
5* Switches oriented such that the LEDs are South-facing, for
6 compatibility with Cherry profile keycaps.
7* USB Type-C support in both A to C and C to C configurations.
8* QMK support.
9* A variety of split spacebar configurations, including split 6.25U
10 space and split 7U space.
11* ESD protection circuitry, including data line protection and a
12 polyfuse on the VCC line.
13* Support for per-switch LED backlighting.
14* Fits in standard 60% keyboard cases.
15
16More info on the project, including all of the design files, can be found [here](https://github.com/jmdaly/CO60).
17
18Keyboard Maintainer: [jmdaly](https://github.com/jmdaly)
19Hardware Supported: Supports the CO60 PCB rev1, rev6, rev7
20Hardware Availability: Through group buys.
21
22Make example for this keyboard (after setting up your build environment):
23
24 make handwired/co60/rev7:default
25
26See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/handwired/co60/rev1/config.h b/keyboards/handwired/co60/rev1/config.h
new file mode 100644
index 000000000..4d5140daf
--- /dev/null
+++ b/keyboards/handwired/co60/rev1/config.h
@@ -0,0 +1,161 @@
1/*
2Copyright 2018 John M Daly <jmdaly@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001
26#define MANUFACTURER John M Daly
27#define PRODUCT CO60
28#define DESCRIPTION An open hardware sixty percent PCB
29
30/* key matrix size */
31#define MATRIX_ROWS 5
32#define MATRIX_COLS 15
33
34/*
35 * Keyboard Matrix Assignments
36 *
37 * Change this to how you wired your keyboard
38 * COLS: AVR pins used for columns, left to right
39 * ROWS: AVR pins used for rows, top to bottom
40 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
41 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
42 *
43*/
44#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 }
45#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B2, B5, B4, D7, D6, B3, B0 }
46#define UNUSED_PINS
47
48/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
49#define DIODE_DIRECTION COL2ROW
50
51#ifdef __AVR__
52#define BACKLIGHT_PIN B7
53#define BACKLIGHT_BREATHING
54#endif
55#define BACKLIGHT_LEVELS 3
56
57
58/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
59#define DEBOUNCE 5
60
61/* define if matrix has ghost (lacks anti-ghosting diodes) */
62//#define MATRIX_HAS_GHOST
63
64/* number of backlight levels */
65
66/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
67// #define LOCKING_SUPPORT_ENABLE
68/* Locking resynchronize hack */
69#define LOCKING_RESYNC_ENABLE
70
71/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
72 * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
73 */
74// #define GRAVE_ESC_CTRL_OVERRIDE
75
76/*
77 * Force NKRO
78 *
79 * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
80 * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
81 * makefile for this to work.)
82 *
83 * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
84 * until the next keyboard reset.
85 *
86 * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
87 * fully operational during normal computer usage.
88 *
89 * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
90 * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
91 * bootmagic, NKRO mode will always be enabled until it is toggled again during a
92 * power-up.
93 *
94 */
95//#define FORCE_NKRO
96
97/*
98 * Magic Key Options
99 *
100 * Magic keys are hotkey commands that allow control over firmware functions of
101 * the keyboard. They are best used in combination with the HID Listen program,
102 * found here: https://www.pjrc.com/teensy/hid_listen.html
103 *
104 * The options below allow the magic key functionality to be changed. This is
105 * useful if your keyboard/keypad is missing keys and you want magic key support.
106 *
107 */
108
109/* control how magic key switches layers */
110//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
111//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
112//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
113
114/* override magic key keymap */
115//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
116//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
117//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
118//#define MAGIC_KEY_HELP1 H
119//#define MAGIC_KEY_HELP2 SLASH
120//#define MAGIC_KEY_DEBUG D
121//#define MAGIC_KEY_DEBUG_MATRIX X
122//#define MAGIC_KEY_DEBUG_KBD K
123//#define MAGIC_KEY_DEBUG_MOUSE M
124//#define MAGIC_KEY_VERSION V
125//#define MAGIC_KEY_STATUS S
126//#define MAGIC_KEY_CONSOLE C
127//#define MAGIC_KEY_LAYER0_ALT1 ESC
128//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
129//#define MAGIC_KEY_LAYER0 0
130//#define MAGIC_KEY_LAYER1 1
131//#define MAGIC_KEY_LAYER2 2
132//#define MAGIC_KEY_LAYER3 3
133//#define MAGIC_KEY_LAYER4 4
134//#define MAGIC_KEY_LAYER5 5
135//#define MAGIC_KEY_LAYER6 6
136//#define MAGIC_KEY_LAYER7 7
137//#define MAGIC_KEY_LAYER8 8
138//#define MAGIC_KEY_LAYER9 9
139//#define MAGIC_KEY_BOOTLOADER PAUSE
140//#define MAGIC_KEY_LOCK CAPS
141//#define MAGIC_KEY_EEPROM E
142//#define MAGIC_KEY_NKRO N
143//#define MAGIC_KEY_SLEEP_LED Z
144
145/*
146 * Feature disable options
147 * These options are also useful to firmware size reduction.
148 */
149
150/* disable debug print */
151//#define NO_DEBUG
152
153/* disable print */
154//#define NO_PRINT
155
156/* disable action features */
157//#define NO_ACTION_LAYER
158//#define NO_ACTION_TAPPING
159//#define NO_ACTION_ONESHOT
160//#define NO_ACTION_MACRO
161//#define NO_ACTION_FUNCTION
diff --git a/keyboards/handwired/co60/rev1/rev1.c b/keyboards/handwired/co60/rev1/rev1.c
new file mode 100644
index 000000000..abdfa884d
--- /dev/null
+++ b/keyboards/handwired/co60/rev1/rev1.c
@@ -0,0 +1,46 @@
1/* Copyright 2018 John M Daly
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "rev1.h"
17
18__attribute__ ((weak))
19void matrix_init_kb(void) {
20 // put your keyboard start-up code here
21 // runs once when the firmware starts up
22
23 matrix_init_user();
24}
25
26__attribute__ ((weak))
27void matrix_scan_kb(void) {
28 // put your looping keyboard code here
29 // runs every cycle (a lot)
30
31 matrix_scan_user();
32}
33
34bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
35 // put your per-action keyboard code here
36 // runs for every action, just before processing by the firmware
37
38 return process_record_user(keycode, record);
39}
40
41__attribute__ ((weak))
42void led_set_kb(uint8_t usb_led) {
43 // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
44
45 led_set_user(usb_led);
46}
diff --git a/keyboards/handwired/co60/rev1/rev1.h b/keyboards/handwired/co60/rev1/rev1.h
new file mode 100644
index 000000000..3cf6a853f
--- /dev/null
+++ b/keyboards/handwired/co60/rev1/rev1.h
@@ -0,0 +1,127 @@
1/* Copyright 2018 John M Daly
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19
20// This a shortcut to help you visually see your layout.
21// The following is a layout that uses all available switch positions.
22// The first section contains all of the arguments
23// The second converts the arguments into a two-dimensional array
24#define LAYOUT_all( \
25 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
26 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
27 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
28 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
29 K400, K401, K402, K404, K406, K408, K410, K411, K412, K413, K414 \
30) \
31{ \
32 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
33 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
34 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
35 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
36 { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 }, \
37}
38
39#define LAYOUT_60_ansi( \
40 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
41 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
42 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
43 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
44 K400, K401, K402, K406, K410, K411, K413, K414 \
45) \
46{ \
47 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
48 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
49 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
50 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
51 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
52}
53
54#define LAYOUT_60_ansi_split_bs_rshift( \
55 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
56 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
57 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
58 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
59 K400, K401, K402, K406, K410, K411, K413, K414 \
60) \
61{ \
62 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
63 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
64 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
65 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
66 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
67}
68
69#define LAYOUT_60_iso( \
70 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
71 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
72 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
73 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
74 K400, K401, K402, K406, K410, K411, K413, K414 \
75) \
76{ \
77 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
78 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
79 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
80 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
81 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
82}
83
84#define LAYOUT_60_hhkb( \
85 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
86 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
87 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
88 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
89 K401, K402, K406, K411, K413 \
90) \
91{ \
92 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
93 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
94 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
95 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
96 { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \
97}
98
99#define LAYOUT_60_hhkb_split_space( \
100 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
101 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
102 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
103 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
104 K401, K402, K404, K406, K408, K411, K413 \
105) \
106{ \
107 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
108 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
109 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
110 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
111 { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \
112}
113
114#define LAYOUT_60_hhkb_split_625u_space( \
115 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
116 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
117 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
118 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
119 K401, K402, K404, K406, K408, K410, K411, K413 \
120) \
121{ \
122 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
123 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
124 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
125 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
126 { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, KC_NO }, \
127}
diff --git a/keyboards/handwired/co60/rev1/rules.mk b/keyboards/handwired/co60/rev1/rules.mk
new file mode 100644
index 000000000..31ce6cbe4
--- /dev/null
+++ b/keyboards/handwired/co60/rev1/rules.mk
@@ -0,0 +1,70 @@
1# MCU name
2MCU = atmega32u4
3
4# Processor frequency.
5# This will define a symbol, F_CPU, in all source code files equal to the
6# processor frequency in Hz. You can then use this symbol in your source code to
7# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
8# automatically to create a 32-bit value in your source code.
9#
10# This will be an integer division of F_USB below, as it is sourced by
11# F_USB after it has run through any CPU prescalers. Note that this value
12# does not *change* the processor frequency - it should merely be updated to
13# reflect the processor speed set externally so that the code can use accurate
14# software delays.
15F_CPU = 16000000
16
17
18#
19# LUFA specific
20#
21# Target architecture (see library "Board Types" documentation).
22ARCH = AVR8
23
24# Input clock frequency.
25# This will define a symbol, F_USB, in all source code files equal to the
26# input clock frequency (before any prescaling is performed) in Hz. This value may
27# differ from F_CPU if prescaling is used on the latter, and is required as the
28# raw input clock is fed directly to the PLL sections of the AVR for high speed
29# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
30# at the end, this will be done automatically to create a 32-bit value in your
31# source code.
32#
33# If no clock division is performed on the input clock inside the AVR (via the
34# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
35F_USB = $(F_CPU)
36
37# Interrupt driven control endpoint task(+60)
38OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
39
40# Bootloader selection
41# Teensy halfkay
42# Pro Micro caterina
43# Atmel DFU atmel-dfu
44# LUFA DFU lufa-dfu
45# QMK DFU qmk-dfu
46# atmega32a bootloadHID
47BOOTLOADER = atmel-dfu
48
49# Build Options
50# change yes to no to disable
51#
52BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
53MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
54EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
55CONSOLE_ENABLE = no # Console for debug(+400)
56COMMAND_ENABLE = no # Commands for debug and configuration
57# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
58SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
59# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
60NKRO_ENABLE = yes # USB Nkey Rollover
61BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
62MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
63UNICODE_ENABLE = no # Unicode
64BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
65AUDIO_ENABLE = no # Audio output on port C6
66FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
67LEADER_ENABLE = yes # Turn on leader support
68
69# Layouts supported by this PCB:
70LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift 60_hhkb
diff --git a/keyboards/handwired/co60/rev6/chconf.h b/keyboards/handwired/co60/rev6/chconf.h
new file mode 100644
index 000000000..1d9f12ff1
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/chconf.h
@@ -0,0 +1,520 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 100000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 2
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 0
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/** @} */
109
110/*===========================================================================*/
111/**
112 * @name Performance options
113 * @{
114 */
115/*===========================================================================*/
116
117/**
118 * @brief OS optimization.
119 * @details If enabled then time efficient rather than space efficient code
120 * is used when two possible implementations exist.
121 *
122 * @note This is not related to the compiler optimization options.
123 * @note The default is @p TRUE.
124 */
125#define CH_CFG_OPTIMIZE_SPEED TRUE
126
127/** @} */
128
129/*===========================================================================*/
130/**
131 * @name Subsystem options
132 * @{
133 */
134/*===========================================================================*/
135
136/**
137 * @brief Time Measurement APIs.
138 * @details If enabled then the time measurement APIs are included in
139 * the kernel.
140 *
141 * @note The default is @p TRUE.
142 */
143#define CH_CFG_USE_TM TRUE
144
145/**
146 * @brief Threads registry APIs.
147 * @details If enabled then the registry APIs are included in the kernel.
148 *
149 * @note The default is @p TRUE.
150 */
151#define CH_CFG_USE_REGISTRY TRUE
152
153/**
154 * @brief Threads synchronization APIs.
155 * @details If enabled then the @p chThdWait() function is included in
156 * the kernel.
157 *
158 * @note The default is @p TRUE.
159 */
160#define CH_CFG_USE_WAITEXIT TRUE
161
162/**
163 * @brief Semaphores APIs.
164 * @details If enabled then the Semaphores APIs are included in the kernel.
165 *
166 * @note The default is @p TRUE.
167 */
168#define CH_CFG_USE_SEMAPHORES TRUE
169
170/**
171 * @brief Semaphores queuing mode.
172 * @details If enabled then the threads are enqueued on semaphores by
173 * priority rather than in FIFO order.
174 *
175 * @note The default is @p FALSE. Enable this if you have special
176 * requirements.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
180
181/**
182 * @brief Mutexes APIs.
183 * @details If enabled then the mutexes APIs are included in the kernel.
184 *
185 * @note The default is @p TRUE.
186 */
187#define CH_CFG_USE_MUTEXES TRUE
188
189/**
190 * @brief Enables recursive behavior on mutexes.
191 * @note Recursive mutexes are heavier and have an increased
192 * memory footprint.
193 *
194 * @note The default is @p FALSE.
195 * @note Requires @p CH_CFG_USE_MUTEXES.
196 */
197#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
198
199/**
200 * @brief Conditional Variables APIs.
201 * @details If enabled then the conditional variables APIs are included
202 * in the kernel.
203 *
204 * @note The default is @p TRUE.
205 * @note Requires @p CH_CFG_USE_MUTEXES.
206 */
207#define CH_CFG_USE_CONDVARS TRUE
208
209/**
210 * @brief Conditional Variables APIs with timeout.
211 * @details If enabled then the conditional variables APIs with timeout
212 * specification are included in the kernel.
213 *
214 * @note The default is @p TRUE.
215 * @note Requires @p CH_CFG_USE_CONDVARS.
216 */
217#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
218
219/**
220 * @brief Events Flags APIs.
221 * @details If enabled then the event flags APIs are included in the kernel.
222 *
223 * @note The default is @p TRUE.
224 */
225#define CH_CFG_USE_EVENTS TRUE
226
227/**
228 * @brief Events Flags APIs with timeout.
229 * @details If enabled then the events APIs with timeout specification
230 * are included in the kernel.
231 *
232 * @note The default is @p TRUE.
233 * @note Requires @p CH_CFG_USE_EVENTS.
234 */
235#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
236
237/**
238 * @brief Synchronous Messages APIs.
239 * @details If enabled then the synchronous messages APIs are included
240 * in the kernel.
241 *
242 * @note The default is @p TRUE.
243 */
244#define CH_CFG_USE_MESSAGES TRUE
245
246/**
247 * @brief Synchronous Messages queuing mode.
248 * @details If enabled then messages are served by priority rather than in
249 * FIFO order.
250 *
251 * @note The default is @p FALSE. Enable this if you have special
252 * requirements.
253 * @note Requires @p CH_CFG_USE_MESSAGES.
254 */
255#define CH_CFG_USE_MESSAGES_PRIORITY TRUE
256
257/**
258 * @brief Mailboxes APIs.
259 * @details If enabled then the asynchronous messages (mailboxes) APIs are
260 * included in the kernel.
261 *
262 * @note The default is @p TRUE.
263 * @note Requires @p CH_CFG_USE_SEMAPHORES.
264 */
265#define CH_CFG_USE_MAILBOXES TRUE
266
267/**
268 * @brief Core Memory Manager APIs.
269 * @details If enabled then the core memory manager APIs are included
270 * in the kernel.
271 *
272 * @note The default is @p TRUE.
273 */
274#define CH_CFG_USE_MEMCORE TRUE
275
276/**
277 * @brief Heap Allocator APIs.
278 * @details If enabled then the memory heap allocator APIs are included
279 * in the kernel.
280 *
281 * @note The default is @p TRUE.
282 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
283 * @p CH_CFG_USE_SEMAPHORES.
284 * @note Mutexes are recommended.
285 */
286#define CH_CFG_USE_HEAP TRUE
287
288/**
289 * @brief Memory Pools Allocator APIs.
290 * @details If enabled then the memory pools allocator APIs are included
291 * in the kernel.
292 *
293 * @note The default is @p TRUE.
294 */
295#define CH_CFG_USE_MEMPOOLS TRUE
296
297/**
298 * @brief Dynamic Threads APIs.
299 * @details If enabled then the dynamic threads creation APIs are included
300 * in the kernel.
301 *
302 * @note The default is @p TRUE.
303 * @note Requires @p CH_CFG_USE_WAITEXIT.
304 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
305 */
306#define CH_CFG_USE_DYNAMIC TRUE
307
308/** @} */
309
310/*===========================================================================*/
311/**
312 * @name Debug options
313 * @{
314 */
315/*===========================================================================*/
316
317/**
318 * @brief Debug option, kernel statistics.
319 *
320 * @note The default is @p FALSE.
321 */
322#define CH_DBG_STATISTICS FALSE
323
324/**
325 * @brief Debug option, system state check.
326 * @details If enabled the correct call protocol for system APIs is checked
327 * at runtime.
328 *
329 * @note The default is @p FALSE.
330 */
331#define CH_DBG_SYSTEM_STATE_CHECK FALSE
332
333/**
334 * @brief Debug option, parameters checks.
335 * @details If enabled then the checks on the API functions input
336 * parameters are activated.
337 *
338 * @note The default is @p FALSE.
339 */
340#define CH_DBG_ENABLE_CHECKS FALSE
341
342/**
343 * @brief Debug option, consistency checks.
344 * @details If enabled then all the assertions in the kernel code are
345 * activated. This includes consistency checks inside the kernel,
346 * runtime anomalies and port-defined checks.
347 *
348 * @note The default is @p FALSE.
349 */
350#define CH_DBG_ENABLE_ASSERTS FALSE
351
352/**
353 * @brief Debug option, trace buffer.
354 * @details If enabled then the trace buffer is activated.
355 *
356 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
357 */
358#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
359
360/**
361 * @brief Trace buffer entries.
362 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
363 * different from @p CH_DBG_TRACE_MASK_DISABLED.
364 */
365#define CH_DBG_TRACE_BUFFER_SIZE 128
366
367/**
368 * @brief Debug option, stack checks.
369 * @details If enabled then a runtime stack check is performed.
370 *
371 * @note The default is @p FALSE.
372 * @note The stack check is performed in a architecture/port dependent way.
373 * It may not be implemented or some ports.
374 * @note The default failure mode is to halt the system with the global
375 * @p panic_msg variable set to @p NULL.
376 */
377#define CH_DBG_ENABLE_STACK_CHECK TRUE
378
379/**
380 * @brief Debug option, stacks initialization.
381 * @details If enabled then the threads working area is filled with a byte
382 * value when a thread is created. This can be useful for the
383 * runtime measurement of the used stack.
384 *
385 * @note The default is @p FALSE.
386 */
387#define CH_DBG_FILL_THREADS FALSE
388
389/**
390 * @brief Debug option, threads profiling.
391 * @details If enabled then a field is added to the @p thread_t structure that
392 * counts the system ticks occurred while executing the thread.
393 *
394 * @note The default is @p FALSE.
395 * @note This debug option is not currently compatible with the
396 * tickless mode.
397 */
398#define CH_DBG_THREADS_PROFILING FALSE
399
400/** @} */
401
402/*===========================================================================*/
403/**
404 * @name Kernel hooks
405 * @{
406 */
407/*===========================================================================*/
408
409/**
410 * @brief Threads descriptor structure extension.
411 * @details User fields added to the end of the @p thread_t structure.
412 */
413#define CH_CFG_THREAD_EXTRA_FIELDS \
414 /* Add threads custom fields here.*/
415
416/**
417 * @brief Threads initialization hook.
418 * @details User initialization code added to the @p chThdInit() API.
419 *
420 * @note It is invoked from within @p chThdInit() and implicitly from all
421 * the threads creation APIs.
422 */
423#define CH_CFG_THREAD_INIT_HOOK(tp) { \
424 /* Add threads initialization code here.*/ \
425}
426
427/**
428 * @brief Threads finalization hook.
429 * @details User finalization code added to the @p chThdExit() API.
430 */
431#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
432 /* Add threads finalization code here.*/ \
433}
434
435/**
436 * @brief Context switch hook.
437 * @details This hook is invoked just before switching between threads.
438 */
439#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
440 /* Context switch code here.*/ \
441}
442
443/**
444 * @brief ISR enter hook.
445 */
446#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
447 /* IRQ prologue code here.*/ \
448}
449
450/**
451 * @brief ISR exit hook.
452 */
453#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
454 /* IRQ epilogue code here.*/ \
455}
456
457/**
458 * @brief Idle thread enter hook.
459 * @note This hook is invoked within a critical zone, no OS functions
460 * should be invoked from here.
461 * @note This macro can be used to activate a power saving mode.
462 */
463#define CH_CFG_IDLE_ENTER_HOOK() { \
464 /* Idle-enter code here.*/ \
465}
466
467/**
468 * @brief Idle thread leave hook.
469 * @note This hook is invoked within a critical zone, no OS functions
470 * should be invoked from here.
471 * @note This macro can be used to deactivate a power saving mode.
472 */
473#define CH_CFG_IDLE_LEAVE_HOOK() { \
474 /* Idle-leave code here.*/ \
475}
476
477/**
478 * @brief Idle Loop hook.
479 * @details This hook is continuously invoked by the idle thread loop.
480 */
481#define CH_CFG_IDLE_LOOP_HOOK() { \
482 /* Idle loop code here.*/ \
483}
484
485/**
486 * @brief System tick event hook.
487 * @details This hook is invoked in the system tick handler immediately
488 * after processing the virtual timers queue.
489 */
490#define CH_CFG_SYSTEM_TICK_HOOK() { \
491 /* System tick event code here.*/ \
492}
493
494/**
495 * @brief System halt hook.
496 * @details This hook is invoked in case to a system halting error before
497 * the system is halted.
498 */
499#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
500 /* System halt code here.*/ \
501}
502
503/**
504 * @brief Trace hook.
505 * @details This hook is invoked each time a new record is written in the
506 * trace buffer.
507 */
508#define CH_CFG_TRACE_HOOK(tep) { \
509 /* Trace code here.*/ \
510}
511
512/** @} */
513
514/*===========================================================================*/
515/* Port-specific settings (override port settings defaulted in chcore.h). */
516/*===========================================================================*/
517
518#endif /* CHCONF_H */
519
520/** @} */
diff --git a/keyboards/handwired/co60/rev6/config.h b/keyboards/handwired/co60/rev6/config.h
new file mode 100644
index 000000000..b1ab99fd9
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/config.h
@@ -0,0 +1,60 @@
1/*
2 * Copyright 2019 John M Daly <jmdaly@gmail.com>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17#pragma once
18
19#include "config_common.h"
20
21/* USB Device descriptor parameter */
22#define VENDOR_ID 0xFEED
23#define PRODUCT_ID 0x0000
24#define DEVICE_VER 0x0001
25#define MANUFACTURER John M Daly
26#define PRODUCT CO60 rev6
27#define DESCRIPTION An open hardware sixty percent PCB
28
29/* Address for jumping to bootloader on STM32 chips. */
30/* It is chip dependent, the correct number can be looked up here:
31 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
32 */
33#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800
34
35/* key matrix size */
36#define MATRIX_ROWS 5
37#define MATRIX_COLS 15
38
39/* ROWS: Top to bottom, COLS: Left to right
40*/
41#define MATRIX_ROW_PINS { B0, B1, B2, A15, A10 }
42#define MATRIX_COL_PINS { A2, A3, A6, B14, B15, A8, A9, A7, B3, B4, C14, C15, C13, B5, B6 }
43
44/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
45#define DIODE_DIRECTION COL2ROW
46
47/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
48#define DEBOUNCE 5
49
50/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
51#define LOCKING_SUPPORT_ENABLE
52/* Locking resynchronize hack */
53#define LOCKING_RESYNC_ENABLE
54
55/* Backlight configuration
56 * Backlight LEDs on B8
57 */
58#define BACKLIGHT_LEVELS 24
59#define BACKLIGHT_BREATHING
60#define BREATHING_PERIOD 6
diff --git a/keyboards/handwired/co60/rev6/halconf.h b/keyboards/handwired/co60/rev6/halconf.h
new file mode 100644
index 000000000..5e5d70219
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/halconf.h
@@ -0,0 +1,388 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC TRUE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT TRUE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C FALSE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM TRUE
115#endif
116
117/**
118 * @brief Enables the QSPI subsystem.
119 */
120#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
121#define HAL_USE_QSPI FALSE
122#endif
123
124/**
125 * @brief Enables the RTC subsystem.
126 */
127#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
128#define HAL_USE_RTC FALSE
129#endif
130
131/**
132 * @brief Enables the SDC subsystem.
133 */
134#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
135#define HAL_USE_SDC FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL subsystem.
140 */
141#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL FALSE
143#endif
144
145/**
146 * @brief Enables the SERIAL over USB subsystem.
147 */
148#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
149#define HAL_USE_SERIAL_USB TRUE
150#endif
151
152/**
153 * @brief Enables the SPI subsystem.
154 */
155#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
156#define HAL_USE_SPI FALSE
157#endif
158
159/**
160 * @brief Enables the UART subsystem.
161 */
162#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
163#define HAL_USE_UART FALSE
164#endif
165
166/**
167 * @brief Enables the USB subsystem.
168 */
169#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
170#define HAL_USE_USB TRUE
171#endif
172
173/**
174 * @brief Enables the WDG subsystem.
175 */
176#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
177#define HAL_USE_WDG FALSE
178#endif
179
180/*===========================================================================*/
181/* ADC driver related settings. */
182/*===========================================================================*/
183
184/**
185 * @brief Enables synchronous APIs.
186 * @note Disabling this option saves both code and data space.
187 */
188#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
189#define ADC_USE_WAIT TRUE
190#endif
191
192/**
193 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
194 * @note Disabling this option saves both code and data space.
195 */
196#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
197#define ADC_USE_MUTUAL_EXCLUSION TRUE
198#endif
199
200/*===========================================================================*/
201/* CAN driver related settings. */
202/*===========================================================================*/
203
204/**
205 * @brief Sleep mode related APIs inclusion switch.
206 */
207#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
208#define CAN_USE_SLEEP_MODE TRUE
209#endif
210
211/*===========================================================================*/
212/* I2C driver related settings. */
213/*===========================================================================*/
214
215/**
216 * @brief Enables the mutual exclusion APIs on the I2C bus.
217 */
218#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
219#define I2C_USE_MUTUAL_EXCLUSION TRUE
220#endif
221
222/*===========================================================================*/
223/* MAC driver related settings. */
224/*===========================================================================*/
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
230#define MAC_USE_ZERO_COPY FALSE
231#endif
232
233/**
234 * @brief Enables an event sources for incoming packets.
235 */
236#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
237#define MAC_USE_EVENTS TRUE
238#endif
239
240/*===========================================================================*/
241/* MMC_SPI driver related settings. */
242/*===========================================================================*/
243
244/**
245 * @brief Delays insertions.
246 * @details If enabled this options inserts delays into the MMC waiting
247 * routines releasing some extra CPU time for the threads with
248 * lower priority, this may slow down the driver a bit however.
249 * This option is recommended also if the SPI driver does not
250 * use a DMA channel and heavily loads the CPU.
251 */
252#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
253#define MMC_NICE_WAITING TRUE
254#endif
255
256/*===========================================================================*/
257/* SDC driver related settings. */
258/*===========================================================================*/
259
260/**
261 * @brief Number of initialization attempts before rejecting the card.
262 * @note Attempts are performed at 10mS intervals.
263 */
264#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
265#define SDC_INIT_RETRY 100
266#endif
267
268/**
269 * @brief Include support for MMC cards.
270 * @note MMC support is not yet implemented so this option must be kept
271 * at @p FALSE.
272 */
273#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
274#define SDC_MMC_SUPPORT FALSE
275#endif
276
277/**
278 * @brief Delays insertions.
279 * @details If enabled this options inserts delays into the MMC waiting
280 * routines releasing some extra CPU time for the threads with
281 * lower priority, this may slow down the driver a bit however.
282 */
283#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
284#define SDC_NICE_WAITING TRUE
285#endif
286
287/*===========================================================================*/
288/* SERIAL driver related settings. */
289/*===========================================================================*/
290
291/**
292 * @brief Default bit rate.
293 * @details Configuration parameter, this is the baud rate selected for the
294 * default configuration.
295 */
296#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
297#define SERIAL_DEFAULT_BITRATE 38400
298#endif
299
300/**
301 * @brief Serial buffers size.
302 * @details Configuration parameter, you can change the depth of the queue
303 * buffers depending on the requirements of your application.
304 * @note The default is 16 bytes for both the transmission and receive
305 * buffers.
306 */
307#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
308#define SERIAL_BUFFERS_SIZE 16
309#endif
310
311/*===========================================================================*/
312/* SERIAL_USB driver related setting. */
313/*===========================================================================*/
314
315/**
316 * @brief Serial over USB buffers size.
317 * @details Configuration parameter, the buffer size must be a multiple of
318 * the USB data endpoint maximum packet size.
319 * @note The default is 256 bytes for both the transmission and receive
320 * buffers.
321 */
322#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
323#define SERIAL_USB_BUFFERS_SIZE 1
324#endif
325
326/**
327 * @brief Serial over USB number of buffers.
328 * @note The default is 2 buffers.
329 */
330#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
331#define SERIAL_USB_BUFFERS_NUMBER 2
332#endif
333
334/*===========================================================================*/
335/* SPI driver related settings. */
336/*===========================================================================*/
337
338/**
339 * @brief Enables synchronous APIs.
340 * @note Disabling this option saves both code and data space.
341 */
342#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
343#define SPI_USE_WAIT TRUE
344#endif
345
346/**
347 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
348 * @note Disabling this option saves both code and data space.
349 */
350#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
351#define SPI_USE_MUTUAL_EXCLUSION TRUE
352#endif
353
354/*===========================================================================*/
355/* UART driver related settings. */
356/*===========================================================================*/
357
358/**
359 * @brief Enables synchronous APIs.
360 * @note Disabling this option saves both code and data space.
361 */
362#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
363#define UART_USE_WAIT FALSE
364#endif
365
366/**
367 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
368 * @note Disabling this option saves both code and data space.
369 */
370#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
371#define UART_USE_MUTUAL_EXCLUSION FALSE
372#endif
373
374/*===========================================================================*/
375/* USB driver related settings. */
376/*===========================================================================*/
377
378/**
379 * @brief Enables synchronous APIs.
380 * @note Disabling this option saves both code and data space.
381 */
382#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
383#define USB_USE_WAIT TRUE
384#endif
385
386#endif /* HALCONF_H */
387
388/** @} */
diff --git a/keyboards/handwired/co60/rev6/led.c b/keyboards/handwired/co60/rev6/led.c
new file mode 100644
index 000000000..fe28ce2e8
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/led.c
@@ -0,0 +1,240 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19#include "led_custom.h"
20#include "rev6.h"
21#include "printf.h"
22
23static void breathing_callback(PWMDriver *pwmp);
24
25static PWMConfig pwmCFG = {
26 0xFFFF, /* PWM clock frequency */
27 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
28 NULL, /* No Callback */
29 {
30 {PWM_OUTPUT_DISABLED, NULL},
31 {PWM_OUTPUT_DISABLED, NULL},
32 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */
33 {PWM_OUTPUT_DISABLED, NULL}
34 },
35 0, /* HW dependent part.*/
36 0
37};
38
39static PWMConfig pwmCFG_breathing = {
40 0xFFFF, /* 10kHz PWM clock frequency */
41 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
42 breathing_callback, /* Breathing Callback */
43 {
44 {PWM_OUTPUT_DISABLED, NULL},
45 {PWM_OUTPUT_DISABLED, NULL},
46 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */
47 {PWM_OUTPUT_DISABLED, NULL}
48 },
49 0, /* HW dependent part.*/
50 0
51};
52
53// See http://jared.geek.nz/2013/feb/linear-led-pwm
54static uint16_t cie_lightness(uint16_t v) {
55 if (v <= 5243) // if below 8% of max
56 return v / 9; // same as dividing by 900%
57 else {
58 uint32_t y = (((uint32_t)v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
59 // to get a useful result with integer division, we shift left in the expression above
60 // and revert what we've done again after squaring.
61 y = y * y * y >> 8;
62 if (y > 0xFFFFUL) // prevent overflow
63 return 0xFFFFU;
64 else
65 return (uint16_t)y;
66 }
67}
68
69void backlight_init_ports(void) {
70 palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(2));
71 pwmStart(&PWMD4, &pwmCFG);
72 if (kb_backlight_config.enable) {
73 if (kb_backlight_config.breathing) {
74 breathing_enable();
75 } else {
76 backlight_set(kb_backlight_config.level);
77 }
78 } else {
79 backlight_set(0);
80 }
81}
82
83void backlight_set(uint8_t level) {
84 uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t)level / BACKLIGHT_LEVELS));
85 if (level == 0) {
86 // Turn backlight off
87 // Disable channel 3 on PWM4
88 pwmDisableChannel(&PWMD4, 2);
89 } else {
90 // Turn backlight on
91 if (!is_breathing()) {
92 // Enable channel 3 on PWM4
93 pwmEnableChannel(&PWMD4, 2, PWM_FRACTION_TO_WIDTH(&PWMD4, 0xFFFF, duty));
94 }
95 }
96}
97
98uint8_t backlight_tick = 0;
99
100void backlight_task(void) {
101}
102
103#define BREATHING_NO_HALT 0
104#define BREATHING_HALT_OFF 1
105#define BREATHING_HALT_ON 2
106#define BREATHING_STEPS 128
107
108static uint8_t breathing_period = BREATHING_PERIOD;
109static uint8_t breathing_halt = BREATHING_NO_HALT;
110static uint16_t breathing_counter = 0;
111
112bool is_breathing(void) {
113 return PWMD4.config == &pwmCFG_breathing;
114}
115
116#define breathing_min() do {breathing_counter = 0;} while (0)
117#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0)
118
119
120void breathing_interrupt_enable(void){
121 pwmStop(&PWMD4);
122 pwmStart(&PWMD4, &pwmCFG_breathing);
123 chSysLockFromISR();
124 pwmEnablePeriodicNotification(&PWMD4);
125 pwmEnableChannelI(
126 &PWMD4,
127 2,
128 PWM_FRACTION_TO_WIDTH(
129 &PWMD4,
130 0xFFFF,
131 0xFFFF
132 )
133 );
134 chSysUnlockFromISR();
135}
136
137void breathing_interrupt_disable(void){
138 pwmStop(&PWMD4);
139 pwmStart(&PWMD4, &pwmCFG);
140}
141
142void breathing_enable(void)
143{
144 breathing_counter = 0;
145 breathing_halt = BREATHING_NO_HALT;
146 breathing_interrupt_enable();
147}
148
149void breathing_pulse(void)
150{
151 if (kb_backlight_config.level == 0)
152 breathing_min();
153 else
154 breathing_max();
155 breathing_halt = BREATHING_HALT_ON;
156 breathing_interrupt_enable();
157}
158
159void breathing_disable(void)
160{
161 breathing_interrupt_disable();
162 // Restore backlight level
163 backlight_set(kb_backlight_config.level);
164}
165
166void breathing_self_disable(void)
167{
168 if (kb_backlight_config.level == 0)
169 breathing_halt = BREATHING_HALT_OFF;
170 else
171 breathing_halt = BREATHING_HALT_ON;
172}
173
174void breathing_toggle(void) {
175 if (is_breathing()){
176 breathing_disable();
177 } else {
178 breathing_enable();
179 }
180}
181
182void breathing_period_set(uint8_t value)
183{
184 if (!value)
185 value = 1;
186 breathing_period = value;
187}
188
189void breathing_period_default(void) {
190 breathing_period_set(BREATHING_PERIOD);
191}
192
193void breathing_period_inc(void)
194{
195 breathing_period_set(breathing_period+1);
196}
197
198void breathing_period_dec(void)
199{
200 breathing_period_set(breathing_period-1);
201}
202
203/* To generate breathing curve in python:
204 * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
205 */
206static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
207
208// Use this before the cie_lightness function.
209static inline uint16_t scale_backlight(uint16_t v) {
210 return v / BACKLIGHT_LEVELS * kb_backlight_config.level;
211}
212
213static void breathing_callback(PWMDriver *pwmp)
214{
215 (void)pwmp;
216 uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS;
217 // resetting after one period to prevent ugly reset at overflow.
218 breathing_counter = (breathing_counter + 1) % (breathing_period * 256);
219 uint8_t index = breathing_counter / interval % BREATHING_STEPS;
220
221 if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
222 ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
223 {
224 breathing_interrupt_disable();
225 }
226
227 uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256));
228
229 chSysLockFromISR();
230 pwmEnableChannelI(
231 &PWMD4,
232 2,
233 PWM_FRACTION_TO_WIDTH(
234 &PWMD4,
235 0xFFFF,
236 duty
237 )
238 );
239 chSysUnlockFromISR();
240}
diff --git a/keyboards/handwired/co60/rev6/led_custom.h b/keyboards/handwired/co60/rev6/led_custom.h
new file mode 100644
index 000000000..96c4d0c2b
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/led_custom.h
@@ -0,0 +1,22 @@
1/*
2 * Copyright 2019 John M Daly <jmdaly@gmail.com>
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20void backlight_task(void);
21void breathing_interrupt_disable(void);
22void breathing_interrupt_enable(void);
diff --git a/keyboards/handwired/co60/rev6/mcuconf.h b/keyboards/handwired/co60/rev6/mcuconf.h
new file mode 100644
index 000000000..69bf9185d
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/mcuconf.h
@@ -0,0 +1,257 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef MCUCONF_H
18#define MCUCONF_H
19
20/*
21 * STM32F3xx drivers configuration.
22 * The following settings override the default settings present in
23 * the various device driver implementation headers.
24 * Note that the settings for each driver only have effect if the whole
25 * driver is enabled in halconf.h.
26 *
27 * IRQ priorities:
28 * 15...0 Lowest...Highest.
29 *
30 * DMA priorities:
31 * 0...3 Lowest...Highest.
32 */
33
34#define STM32F3xx_MCUCONF
35
36/*
37 * HAL driver system settings.
38 */
39#define STM32_NO_INIT FALSE
40#define STM32_PVD_ENABLE FALSE
41#define STM32_PLS STM32_PLS_LEV0
42#define STM32_HSI_ENABLED TRUE
43#define STM32_LSI_ENABLED TRUE
44#define STM32_HSE_ENABLED TRUE
45#define STM32_LSE_ENABLED FALSE
46#define STM32_SW STM32_SW_PLL
47#define STM32_PLLSRC STM32_PLLSRC_HSE
48#define STM32_PREDIV_VALUE 1
49#define STM32_PLLMUL_VALUE 9
50#define STM32_HPRE STM32_HPRE_DIV1
51#define STM32_PPRE1 STM32_PPRE1_DIV2
52#define STM32_PPRE2 STM32_PPRE2_DIV2
53#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
54#define STM32_ADC12PRES STM32_ADC12PRES_DIV1
55#define STM32_ADC34PRES STM32_ADC34PRES_DIV1
56#define STM32_USART1SW STM32_USART1SW_PCLK
57#define STM32_USART2SW STM32_USART2SW_PCLK
58#define STM32_USART3SW STM32_USART3SW_PCLK
59#define STM32_UART4SW STM32_UART4SW_PCLK
60#define STM32_UART5SW STM32_UART5SW_PCLK
61#define STM32_I2C1SW STM32_I2C1SW_SYSCLK
62#define STM32_I2C2SW STM32_I2C2SW_SYSCLK
63#define STM32_TIM1SW STM32_TIM1SW_PCLK2
64#define STM32_TIM8SW STM32_TIM8SW_PCLK2
65#define STM32_RTCSEL STM32_RTCSEL_LSI
66#define STM32_USB_CLOCK_REQUIRED TRUE
67#define STM32_USBPRE STM32_USBPRE_DIV1P5
68
69#undef STM32_HSE_BYPASS
70// #error "oh no"
71// #endif
72
73/*
74 * ADC driver system settings.
75 */
76#define STM32_ADC_DUAL_MODE FALSE
77#define STM32_ADC_COMPACT_SAMPLES FALSE
78#define STM32_ADC_USE_ADC1 FALSE
79#define STM32_ADC_USE_ADC2 FALSE
80#define STM32_ADC_USE_ADC3 FALSE
81#define STM32_ADC_USE_ADC4 FALSE
82#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
83#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
84#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
85#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
86#define STM32_ADC_ADC1_DMA_PRIORITY 2
87#define STM32_ADC_ADC2_DMA_PRIORITY 2
88#define STM32_ADC_ADC3_DMA_PRIORITY 2
89#define STM32_ADC_ADC4_DMA_PRIORITY 2
90#define STM32_ADC_ADC12_IRQ_PRIORITY 5
91#define STM32_ADC_ADC3_IRQ_PRIORITY 5
92#define STM32_ADC_ADC4_IRQ_PRIORITY 5
93#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5
94#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5
95#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5
96#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5
97#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
98#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
99
100/*
101 * CAN driver system settings.
102 */
103#define STM32_CAN_USE_CAN1 FALSE
104#define STM32_CAN_CAN1_IRQ_PRIORITY 11
105
106/*
107 * DAC driver system settings.
108 */
109#define STM32_DAC_DUAL_MODE FALSE
110#define STM32_DAC_USE_DAC1_CH1 TRUE
111#define STM32_DAC_USE_DAC1_CH2 TRUE
112#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
113#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
114#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
115#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
116
117/*
118 * EXT driver system settings.
119 */
120#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
121#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
122#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
123#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
124#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
125#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
126#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
127#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
128#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
129#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
130#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
131#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
132#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6
133#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6
134#define STM32_EXT_EXTI33_IRQ_PRIORITY 6
135
136/*
137 * GPT driver system settings.
138 */
139#define STM32_GPT_USE_TIM1 FALSE
140#define STM32_GPT_USE_TIM2 FALSE
141#define STM32_GPT_USE_TIM3 FALSE
142#define STM32_GPT_USE_TIM4 FALSE
143#define STM32_GPT_USE_TIM6 TRUE
144#define STM32_GPT_USE_TIM7 TRUE
145#define STM32_GPT_USE_TIM8 TRUE
146#define STM32_GPT_TIM1_IRQ_PRIORITY 7
147#define STM32_GPT_TIM2_IRQ_PRIORITY 7
148#define STM32_GPT_TIM3_IRQ_PRIORITY 7
149#define STM32_GPT_TIM4_IRQ_PRIORITY 7
150#define STM32_GPT_TIM6_IRQ_PRIORITY 7
151#define STM32_GPT_TIM7_IRQ_PRIORITY 7
152#define STM32_GPT_TIM8_IRQ_PRIORITY 7
153
154/*
155 * I2C driver system settings.
156 */
157#define STM32_I2C_USE_I2C1 FALSE
158#define STM32_I2C_USE_I2C2 FALSE
159#define STM32_I2C_BUSY_TIMEOUT 50
160#define STM32_I2C_I2C1_IRQ_PRIORITY 10
161#define STM32_I2C_I2C2_IRQ_PRIORITY 10
162#define STM32_I2C_USE_DMA TRUE
163#define STM32_I2C_I2C1_DMA_PRIORITY 1
164#define STM32_I2C_I2C2_DMA_PRIORITY 1
165#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
166
167/*
168 * ICU driver system settings.
169 */
170#define STM32_ICU_USE_TIM1 FALSE
171#define STM32_ICU_USE_TIM2 FALSE
172#define STM32_ICU_USE_TIM3 FALSE
173#define STM32_ICU_USE_TIM4 FALSE
174#define STM32_ICU_USE_TIM8 FALSE
175#define STM32_ICU_TIM1_IRQ_PRIORITY 7
176#define STM32_ICU_TIM2_IRQ_PRIORITY 7
177#define STM32_ICU_TIM3_IRQ_PRIORITY 7
178#define STM32_ICU_TIM4_IRQ_PRIORITY 7
179#define STM32_ICU_TIM8_IRQ_PRIORITY 7
180
181/*
182 * PWM driver system settings.
183 */
184#define STM32_PWM_USE_ADVANCED FALSE
185#define STM32_PWM_USE_TIM1 FALSE
186#define STM32_PWM_USE_TIM2 FALSE
187#define STM32_PWM_USE_TIM3 FALSE
188#define STM32_PWM_USE_TIM4 TRUE
189#define STM32_PWM_USE_TIM8 FALSE
190#define STM32_PWM_TIM1_IRQ_PRIORITY 7
191#define STM32_PWM_TIM2_IRQ_PRIORITY 7
192#define STM32_PWM_TIM3_IRQ_PRIORITY 7
193#define STM32_PWM_TIM4_IRQ_PRIORITY 7
194#define STM32_PWM_TIM8_IRQ_PRIORITY 7
195
196/*
197 * SERIAL driver system settings.
198 */
199#define STM32_SERIAL_USE_USART1 FALSE
200#define STM32_SERIAL_USE_USART2 TRUE
201#define STM32_SERIAL_USE_USART3 FALSE
202#define STM32_SERIAL_USE_UART4 FALSE
203#define STM32_SERIAL_USE_UART5 FALSE
204#define STM32_SERIAL_USART1_PRIORITY 12
205#define STM32_SERIAL_USART2_PRIORITY 12
206#define STM32_SERIAL_USART3_PRIORITY 12
207#define STM32_SERIAL_UART4_PRIORITY 12
208#define STM32_SERIAL_UART5_PRIORITY 12
209
210/*
211 * SPI driver system settings.
212 */
213#define STM32_SPI_USE_SPI1 FALSE
214#define STM32_SPI_USE_SPI2 FALSE
215#define STM32_SPI_USE_SPI3 FALSE
216#define STM32_SPI_SPI1_DMA_PRIORITY 1
217#define STM32_SPI_SPI2_DMA_PRIORITY 1
218#define STM32_SPI_SPI3_DMA_PRIORITY 1
219#define STM32_SPI_SPI1_IRQ_PRIORITY 10
220#define STM32_SPI_SPI2_IRQ_PRIORITY 10
221#define STM32_SPI_SPI3_IRQ_PRIORITY 10
222#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
223
224/*
225 * ST driver system settings.
226 */
227#define STM32_ST_IRQ_PRIORITY 8
228#define STM32_ST_USE_TIMER 2
229
230/*
231 * UART driver system settings.
232 */
233#define STM32_UART_USE_USART1 FALSE
234#define STM32_UART_USE_USART2 FALSE
235#define STM32_UART_USE_USART3 FALSE
236#define STM32_UART_USART1_IRQ_PRIORITY 12
237#define STM32_UART_USART2_IRQ_PRIORITY 12
238#define STM32_UART_USART3_IRQ_PRIORITY 12
239#define STM32_UART_USART1_DMA_PRIORITY 0
240#define STM32_UART_USART2_DMA_PRIORITY 0
241#define STM32_UART_USART3_DMA_PRIORITY 0
242#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
243
244/*
245 * USB driver system settings.
246 */
247#define STM32_USB_USE_USB1 TRUE
248#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
249#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
250#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
251
252/*
253 * WDG driver system settings.
254 */
255#define STM32_WDG_USE_IWDG FALSE
256
257#endif /* MCUCONF_H */
diff --git a/keyboards/handwired/co60/rev6/rev6.c b/keyboards/handwired/co60/rev6/rev6.c
new file mode 100644
index 000000000..f597513b1
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/rev6.c
@@ -0,0 +1,39 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "rev6.h"
17
18#include "backlight.h"
19#include "led.h"
20#include "printf.h"
21
22backlight_levels_config_t kb_backlight_config = {
23 .enable = true,
24 .breathing = true,
25 .level = BACKLIGHT_LEVELS
26};
27
28uint8_t *o_fb;
29
30uint16_t counterst = 0;
31
32void matrix_init_kb(void) {
33 matrix_init_user();
34 backlight_init_ports();
35}
36
37void matrix_scan_kb(void) {
38 matrix_scan_user();
39}
diff --git a/keyboards/handwired/co60/rev6/rev6.h b/keyboards/handwired/co60/rev6/rev6.h
new file mode 100644
index 000000000..7d11f19d3
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/rev6.h
@@ -0,0 +1,146 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19
20// This a shortcut to help you visually see your layout.
21// The following is a layout that uses all available switch positions.
22// The first section contains all of the arguments
23// The second converts the arguments into a two-dimensional array
24#define LAYOUT_all( \
25 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
26 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
27 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
28 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
29 K400, K401, K402, K404, K406, K408, K410, K411, K412, K413, K414 \
30) \
31{ \
32 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
33 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
34 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
35 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
36 { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 }, \
37}
38
39#define LAYOUT_60_ansi( \
40 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
41 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
42 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
43 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
44 K400, K401, K402, K406, K410, K411, K413, K414 \
45) \
46{ \
47 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
48 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
49 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
50 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
51 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
52}
53
54#define LAYOUT_60_ansi_split_bs_rshift( \
55 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
56 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
57 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
58 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
59 K400, K401, K402, K406, K410, K411, K413, K414 \
60) \
61{ \
62 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
63 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
64 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
65 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
66 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
67}
68
69#define LAYOUT_60_iso( \
70 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
71 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
72 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
73 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
74 K400, K401, K402, K406, K410, K411, K413, K414 \
75) \
76{ \
77 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
78 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
79 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
80 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
81 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
82}
83
84#define LAYOUT_60_hhkb( \
85 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
86 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
87 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
88 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
89 K401, K402, K406, K411, K413 \
90) \
91{ \
92 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
93 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
94 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
95 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
96 { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \
97}
98
99#define LAYOUT_60_hhkb_split_space( \
100 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
101 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
102 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
103 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
104 K401, K402, K404, K406, K408, K411, K413 \
105) \
106{ \
107 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
108 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
109 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
110 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
111 { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \
112}
113
114#define LAYOUT_60_hhkb_split_625u_space( \
115 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
116 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
117 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
118 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
119 K401, K402, K404, K406, K408, K410, K411, K413 \
120) \
121{ \
122 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
123 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
124 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
125 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
126 { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, KC_NO }, \
127}
128
129// Backlighting
130typedef union {
131 uint8_t raw;
132 struct {
133 bool enable :1;
134 bool breathing : 1;
135 uint8_t level :6;
136 };
137} backlight_levels_config_t;
138
139extern backlight_levels_config_t kb_backlight_config;
140extern bool kb_backlight_breathing;
141
142void backlight_init_ports(void);
143void backlight_set(uint8_t level);
144bool is_breathing(void);
145void breathing_enable(void);
146void breathing_disable(void);
diff --git a/keyboards/handwired/co60/rev6/rules.mk b/keyboards/handwired/co60/rev6/rules.mk
new file mode 100644
index 000000000..dba41e12b
--- /dev/null
+++ b/keyboards/handwired/co60/rev6/rules.mk
@@ -0,0 +1,59 @@
1# project specific files
2
3## chip/board settings
4# - the next two should match the directories in
5# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
6MCU_FAMILY = STM32
7MCU_SERIES = STM32F3xx
8
9# Linker script to use
10# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
11# or <this_dir>/ld/
12MCU_LDSCRIPT = STM32F303xC
13
14# Startup code to use
15# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
16MCU_STARTUP = stm32f3xx
17
18# Board: it should exist either in <chibios>/os/hal/boards/
19# or <this_dir>/boards
20BOARD = GENERIC_STM32_F303XC
21
22# Cortex version
23MCU = cortex-m4
24
25# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
26ARMV = 7
27
28USE_FPU = yes
29
30# Vector table for application
31# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
32# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
33# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
34
35# Options to pass to dfu-util when flashing
36DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
37DFU_SUFFIX_ARGS = -v 0483 -p df11
38
39# Code for backlight breathing:
40SRC += led.c
41
42# Build Options
43# comment out to disable the options.
44#
45BACKLIGHT_ENABLE = yes
46BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
47MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
48EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
49CONSOLE_ENABLE = no # Console for debug(+400)
50COMMAND_ENABLE = no # Commands for debug and configuration
51NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
52AUDIO_ENABLE = no
53RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality
54MIDI_ENABLE = no # MIDI controls
55UNICODE_ENABLE = no # Unicode
56BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
57LEADER_ENABLE = yes
58
59LAYOUTS += 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb
diff --git a/keyboards/handwired/co60/rev7/chconf.h b/keyboards/handwired/co60/rev7/chconf.h
new file mode 100644
index 000000000..1d9f12ff1
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/chconf.h
@@ -0,0 +1,520 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/chconf.h
19 * @brief Configuration file template.
20 * @details A copy of this file must be placed in each project directory, it
21 * contains the application specific kernel settings.
22 *
23 * @addtogroup config
24 * @details Kernel related settings and hooks.
25 * @{
26 */
27
28#ifndef CHCONF_H
29#define CHCONF_H
30
31#define _CHIBIOS_RT_CONF_
32
33/*===========================================================================*/
34/**
35 * @name System timers settings
36 * @{
37 */
38/*===========================================================================*/
39
40/**
41 * @brief System time counter resolution.
42 * @note Allowed values are 16 or 32 bits.
43 */
44#define CH_CFG_ST_RESOLUTION 32
45
46/**
47 * @brief System tick frequency.
48 * @details Frequency of the system timer that drives the system ticks. This
49 * setting also defines the system tick time unit.
50 */
51#define CH_CFG_ST_FREQUENCY 100000
52
53/**
54 * @brief Time delta constant for the tick-less mode.
55 * @note If this value is zero then the system uses the classic
56 * periodic tick. This value represents the minimum number
57 * of ticks that is safe to specify in a timeout directive.
58 * The value one is not valid, timeouts are rounded up to
59 * this value.
60 */
61#define CH_CFG_ST_TIMEDELTA 2
62
63/** @} */
64
65/*===========================================================================*/
66/**
67 * @name Kernel parameters and options
68 * @{
69 */
70/*===========================================================================*/
71
72/**
73 * @brief Round robin interval.
74 * @details This constant is the number of system ticks allowed for the
75 * threads before preemption occurs. Setting this value to zero
76 * disables the preemption for threads with equal priority and the
77 * round robin becomes cooperative. Note that higher priority
78 * threads can still preempt, the kernel is always preemptive.
79 * @note Disabling the round robin preemption makes the kernel more compact
80 * and generally faster.
81 * @note The round robin preemption is not supported in tickless mode and
82 * must be set to zero in that case.
83 */
84#define CH_CFG_TIME_QUANTUM 0
85
86/**
87 * @brief Managed RAM size.
88 * @details Size of the RAM area to be managed by the OS. If set to zero
89 * then the whole available RAM is used. The core memory is made
90 * available to the heap allocator and/or can be used directly through
91 * the simplified core memory allocator.
92 *
93 * @note In order to let the OS manage the whole RAM the linker script must
94 * provide the @p __heap_base__ and @p __heap_end__ symbols.
95 * @note Requires @p CH_CFG_USE_MEMCORE.
96 */
97#define CH_CFG_MEMCORE_SIZE 0
98
99/**
100 * @brief Idle thread automatic spawn suppression.
101 * @details When this option is activated the function @p chSysInit()
102 * does not spawn the idle thread. The application @p main()
103 * function becomes the idle thread and must implement an
104 * infinite loop.
105 */
106#define CH_CFG_NO_IDLE_THREAD FALSE
107
108/** @} */
109
110/*===========================================================================*/
111/**
112 * @name Performance options
113 * @{
114 */
115/*===========================================================================*/
116
117/**
118 * @brief OS optimization.
119 * @details If enabled then time efficient rather than space efficient code
120 * is used when two possible implementations exist.
121 *
122 * @note This is not related to the compiler optimization options.
123 * @note The default is @p TRUE.
124 */
125#define CH_CFG_OPTIMIZE_SPEED TRUE
126
127/** @} */
128
129/*===========================================================================*/
130/**
131 * @name Subsystem options
132 * @{
133 */
134/*===========================================================================*/
135
136/**
137 * @brief Time Measurement APIs.
138 * @details If enabled then the time measurement APIs are included in
139 * the kernel.
140 *
141 * @note The default is @p TRUE.
142 */
143#define CH_CFG_USE_TM TRUE
144
145/**
146 * @brief Threads registry APIs.
147 * @details If enabled then the registry APIs are included in the kernel.
148 *
149 * @note The default is @p TRUE.
150 */
151#define CH_CFG_USE_REGISTRY TRUE
152
153/**
154 * @brief Threads synchronization APIs.
155 * @details If enabled then the @p chThdWait() function is included in
156 * the kernel.
157 *
158 * @note The default is @p TRUE.
159 */
160#define CH_CFG_USE_WAITEXIT TRUE
161
162/**
163 * @brief Semaphores APIs.
164 * @details If enabled then the Semaphores APIs are included in the kernel.
165 *
166 * @note The default is @p TRUE.
167 */
168#define CH_CFG_USE_SEMAPHORES TRUE
169
170/**
171 * @brief Semaphores queuing mode.
172 * @details If enabled then the threads are enqueued on semaphores by
173 * priority rather than in FIFO order.
174 *
175 * @note The default is @p FALSE. Enable this if you have special
176 * requirements.
177 * @note Requires @p CH_CFG_USE_SEMAPHORES.
178 */
179#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE
180
181/**
182 * @brief Mutexes APIs.
183 * @details If enabled then the mutexes APIs are included in the kernel.
184 *
185 * @note The default is @p TRUE.
186 */
187#define CH_CFG_USE_MUTEXES TRUE
188
189/**
190 * @brief Enables recursive behavior on mutexes.
191 * @note Recursive mutexes are heavier and have an increased
192 * memory footprint.
193 *
194 * @note The default is @p FALSE.
195 * @note Requires @p CH_CFG_USE_MUTEXES.
196 */
197#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE
198
199/**
200 * @brief Conditional Variables APIs.
201 * @details If enabled then the conditional variables APIs are included
202 * in the kernel.
203 *
204 * @note The default is @p TRUE.
205 * @note Requires @p CH_CFG_USE_MUTEXES.
206 */
207#define CH_CFG_USE_CONDVARS TRUE
208
209/**
210 * @brief Conditional Variables APIs with timeout.
211 * @details If enabled then the conditional variables APIs with timeout
212 * specification are included in the kernel.
213 *
214 * @note The default is @p TRUE.
215 * @note Requires @p CH_CFG_USE_CONDVARS.
216 */
217#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE
218
219/**
220 * @brief Events Flags APIs.
221 * @details If enabled then the event flags APIs are included in the kernel.
222 *
223 * @note The default is @p TRUE.
224 */
225#define CH_CFG_USE_EVENTS TRUE
226
227/**
228 * @brief Events Flags APIs with timeout.
229 * @details If enabled then the events APIs with timeout specification
230 * are included in the kernel.
231 *
232 * @note The default is @p TRUE.
233 * @note Requires @p CH_CFG_USE_EVENTS.
234 */
235#define CH_CFG_USE_EVENTS_TIMEOUT TRUE
236
237/**
238 * @brief Synchronous Messages APIs.
239 * @details If enabled then the synchronous messages APIs are included
240 * in the kernel.
241 *
242 * @note The default is @p TRUE.
243 */
244#define CH_CFG_USE_MESSAGES TRUE
245
246/**
247 * @brief Synchronous Messages queuing mode.
248 * @details If enabled then messages are served by priority rather than in
249 * FIFO order.
250 *
251 * @note The default is @p FALSE. Enable this if you have special
252 * requirements.
253 * @note Requires @p CH_CFG_USE_MESSAGES.
254 */
255#define CH_CFG_USE_MESSAGES_PRIORITY TRUE
256
257/**
258 * @brief Mailboxes APIs.
259 * @details If enabled then the asynchronous messages (mailboxes) APIs are
260 * included in the kernel.
261 *
262 * @note The default is @p TRUE.
263 * @note Requires @p CH_CFG_USE_SEMAPHORES.
264 */
265#define CH_CFG_USE_MAILBOXES TRUE
266
267/**
268 * @brief Core Memory Manager APIs.
269 * @details If enabled then the core memory manager APIs are included
270 * in the kernel.
271 *
272 * @note The default is @p TRUE.
273 */
274#define CH_CFG_USE_MEMCORE TRUE
275
276/**
277 * @brief Heap Allocator APIs.
278 * @details If enabled then the memory heap allocator APIs are included
279 * in the kernel.
280 *
281 * @note The default is @p TRUE.
282 * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or
283 * @p CH_CFG_USE_SEMAPHORES.
284 * @note Mutexes are recommended.
285 */
286#define CH_CFG_USE_HEAP TRUE
287
288/**
289 * @brief Memory Pools Allocator APIs.
290 * @details If enabled then the memory pools allocator APIs are included
291 * in the kernel.
292 *
293 * @note The default is @p TRUE.
294 */
295#define CH_CFG_USE_MEMPOOLS TRUE
296
297/**
298 * @brief Dynamic Threads APIs.
299 * @details If enabled then the dynamic threads creation APIs are included
300 * in the kernel.
301 *
302 * @note The default is @p TRUE.
303 * @note Requires @p CH_CFG_USE_WAITEXIT.
304 * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS.
305 */
306#define CH_CFG_USE_DYNAMIC TRUE
307
308/** @} */
309
310/*===========================================================================*/
311/**
312 * @name Debug options
313 * @{
314 */
315/*===========================================================================*/
316
317/**
318 * @brief Debug option, kernel statistics.
319 *
320 * @note The default is @p FALSE.
321 */
322#define CH_DBG_STATISTICS FALSE
323
324/**
325 * @brief Debug option, system state check.
326 * @details If enabled the correct call protocol for system APIs is checked
327 * at runtime.
328 *
329 * @note The default is @p FALSE.
330 */
331#define CH_DBG_SYSTEM_STATE_CHECK FALSE
332
333/**
334 * @brief Debug option, parameters checks.
335 * @details If enabled then the checks on the API functions input
336 * parameters are activated.
337 *
338 * @note The default is @p FALSE.
339 */
340#define CH_DBG_ENABLE_CHECKS FALSE
341
342/**
343 * @brief Debug option, consistency checks.
344 * @details If enabled then all the assertions in the kernel code are
345 * activated. This includes consistency checks inside the kernel,
346 * runtime anomalies and port-defined checks.
347 *
348 * @note The default is @p FALSE.
349 */
350#define CH_DBG_ENABLE_ASSERTS FALSE
351
352/**
353 * @brief Debug option, trace buffer.
354 * @details If enabled then the trace buffer is activated.
355 *
356 * @note The default is @p CH_DBG_TRACE_MASK_DISABLED.
357 */
358#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED
359
360/**
361 * @brief Trace buffer entries.
362 * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is
363 * different from @p CH_DBG_TRACE_MASK_DISABLED.
364 */
365#define CH_DBG_TRACE_BUFFER_SIZE 128
366
367/**
368 * @brief Debug option, stack checks.
369 * @details If enabled then a runtime stack check is performed.
370 *
371 * @note The default is @p FALSE.
372 * @note The stack check is performed in a architecture/port dependent way.
373 * It may not be implemented or some ports.
374 * @note The default failure mode is to halt the system with the global
375 * @p panic_msg variable set to @p NULL.
376 */
377#define CH_DBG_ENABLE_STACK_CHECK TRUE
378
379/**
380 * @brief Debug option, stacks initialization.
381 * @details If enabled then the threads working area is filled with a byte
382 * value when a thread is created. This can be useful for the
383 * runtime measurement of the used stack.
384 *
385 * @note The default is @p FALSE.
386 */
387#define CH_DBG_FILL_THREADS FALSE
388
389/**
390 * @brief Debug option, threads profiling.
391 * @details If enabled then a field is added to the @p thread_t structure that
392 * counts the system ticks occurred while executing the thread.
393 *
394 * @note The default is @p FALSE.
395 * @note This debug option is not currently compatible with the
396 * tickless mode.
397 */
398#define CH_DBG_THREADS_PROFILING FALSE
399
400/** @} */
401
402/*===========================================================================*/
403/**
404 * @name Kernel hooks
405 * @{
406 */
407/*===========================================================================*/
408
409/**
410 * @brief Threads descriptor structure extension.
411 * @details User fields added to the end of the @p thread_t structure.
412 */
413#define CH_CFG_THREAD_EXTRA_FIELDS \
414 /* Add threads custom fields here.*/
415
416/**
417 * @brief Threads initialization hook.
418 * @details User initialization code added to the @p chThdInit() API.
419 *
420 * @note It is invoked from within @p chThdInit() and implicitly from all
421 * the threads creation APIs.
422 */
423#define CH_CFG_THREAD_INIT_HOOK(tp) { \
424 /* Add threads initialization code here.*/ \
425}
426
427/**
428 * @brief Threads finalization hook.
429 * @details User finalization code added to the @p chThdExit() API.
430 */
431#define CH_CFG_THREAD_EXIT_HOOK(tp) { \
432 /* Add threads finalization code here.*/ \
433}
434
435/**
436 * @brief Context switch hook.
437 * @details This hook is invoked just before switching between threads.
438 */
439#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \
440 /* Context switch code here.*/ \
441}
442
443/**
444 * @brief ISR enter hook.
445 */
446#define CH_CFG_IRQ_PROLOGUE_HOOK() { \
447 /* IRQ prologue code here.*/ \
448}
449
450/**
451 * @brief ISR exit hook.
452 */
453#define CH_CFG_IRQ_EPILOGUE_HOOK() { \
454 /* IRQ epilogue code here.*/ \
455}
456
457/**
458 * @brief Idle thread enter hook.
459 * @note This hook is invoked within a critical zone, no OS functions
460 * should be invoked from here.
461 * @note This macro can be used to activate a power saving mode.
462 */
463#define CH_CFG_IDLE_ENTER_HOOK() { \
464 /* Idle-enter code here.*/ \
465}
466
467/**
468 * @brief Idle thread leave hook.
469 * @note This hook is invoked within a critical zone, no OS functions
470 * should be invoked from here.
471 * @note This macro can be used to deactivate a power saving mode.
472 */
473#define CH_CFG_IDLE_LEAVE_HOOK() { \
474 /* Idle-leave code here.*/ \
475}
476
477/**
478 * @brief Idle Loop hook.
479 * @details This hook is continuously invoked by the idle thread loop.
480 */
481#define CH_CFG_IDLE_LOOP_HOOK() { \
482 /* Idle loop code here.*/ \
483}
484
485/**
486 * @brief System tick event hook.
487 * @details This hook is invoked in the system tick handler immediately
488 * after processing the virtual timers queue.
489 */
490#define CH_CFG_SYSTEM_TICK_HOOK() { \
491 /* System tick event code here.*/ \
492}
493
494/**
495 * @brief System halt hook.
496 * @details This hook is invoked in case to a system halting error before
497 * the system is halted.
498 */
499#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \
500 /* System halt code here.*/ \
501}
502
503/**
504 * @brief Trace hook.
505 * @details This hook is invoked each time a new record is written in the
506 * trace buffer.
507 */
508#define CH_CFG_TRACE_HOOK(tep) { \
509 /* Trace code here.*/ \
510}
511
512/** @} */
513
514/*===========================================================================*/
515/* Port-specific settings (override port settings defaulted in chcore.h). */
516/*===========================================================================*/
517
518#endif /* CHCONF_H */
519
520/** @} */
diff --git a/keyboards/handwired/co60/rev7/config.h b/keyboards/handwired/co60/rev7/config.h
new file mode 100644
index 000000000..1ccc12ad4
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/config.h
@@ -0,0 +1,70 @@
1/*
2Copyright 2019 John M Daly <jmdaly@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001
26#define MANUFACTURER John M Daly
27#define PRODUCT CO60 rev7
28#define DESCRIPTION An open hardware sixty percent PCB
29
30/* Address for jumping to bootloader on STM32 chips. */
31/* It is chip dependent, the correct number can be looked up here:
32 * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
33 */
34#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800
35
36/* key matrix size */
37#define MATRIX_ROWS 5
38#define MATRIX_COLS 15
39
40/* ROWS: Top to bottom, COLS: Left to right
41*/
42#define MATRIX_ROW_PINS { A8, A2, B13, B2, B10 }
43#define MATRIX_COL_PINS { A10, A9, A3, A4, A5, A6, B0, B1, A15, B3, B4, B5, C13, C14, C15 }
44#define UNUSED_PINS
45
46/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
47#define DIODE_DIRECTION COL2ROW
48
49/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
50#define DEBOUNCE 5
51
52/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
53#define LOCKING_SUPPORT_ENABLE
54/* Locking resynchronize hack */
55#define LOCKING_RESYNC_ENABLE
56
57/* Backlight configuration
58 * Backlight LEDs on B8
59 */
60#define BACKLIGHT_LEVELS 24
61#define BACKLIGHT_BREATHING
62#define BREATHING_PERIOD 6
63
64#define RGBLIGHT_ANIMATIONS
65
66#define RGBLED_NUM 16
67#define RGB_DI_PIN A7
68#define DRIVER_LED_TOTAL RGBLED_NUM
69
70#define RGB_MATRIX_KEYPRESSES
diff --git a/keyboards/handwired/co60/rev7/halconf.h b/keyboards/handwired/co60/rev7/halconf.h
new file mode 100644
index 000000000..5e5d70219
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/halconf.h
@@ -0,0 +1,388 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17/**
18 * @file templates/halconf.h
19 * @brief HAL configuration header.
20 * @details HAL configuration file, this file allows to enable or disable the
21 * various device drivers from your application. You may also use
22 * this file in order to override the device drivers default settings.
23 *
24 * @addtogroup HAL_CONF
25 * @{
26 */
27
28#ifndef HALCONF_H
29#define HALCONF_H
30
31#include "mcuconf.h"
32
33/**
34 * @brief Enables the PAL subsystem.
35 */
36#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__)
37#define HAL_USE_PAL TRUE
38#endif
39
40/**
41 * @brief Enables the ADC subsystem.
42 */
43#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__)
44#define HAL_USE_ADC FALSE
45#endif
46
47/**
48 * @brief Enables the CAN subsystem.
49 */
50#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__)
51#define HAL_USE_CAN FALSE
52#endif
53
54/**
55 * @brief Enables the DAC subsystem.
56 */
57#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__)
58#define HAL_USE_DAC TRUE
59#endif
60
61/**
62 * @brief Enables the EXT subsystem.
63 */
64#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__)
65#define HAL_USE_EXT FALSE
66#endif
67
68/**
69 * @brief Enables the GPT subsystem.
70 */
71#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
72#define HAL_USE_GPT TRUE
73#endif
74
75/**
76 * @brief Enables the I2C subsystem.
77 */
78#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
79#define HAL_USE_I2C FALSE
80#endif
81
82/**
83 * @brief Enables the I2S subsystem.
84 */
85#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__)
86#define HAL_USE_I2S FALSE
87#endif
88
89/**
90 * @brief Enables the ICU subsystem.
91 */
92#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__)
93#define HAL_USE_ICU FALSE
94#endif
95
96/**
97 * @brief Enables the MAC subsystem.
98 */
99#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__)
100#define HAL_USE_MAC FALSE
101#endif
102
103/**
104 * @brief Enables the MMC_SPI subsystem.
105 */
106#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__)
107#define HAL_USE_MMC_SPI FALSE
108#endif
109
110/**
111 * @brief Enables the PWM subsystem.
112 */
113#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
114#define HAL_USE_PWM TRUE
115#endif
116
117/**
118 * @brief Enables the QSPI subsystem.
119 */
120#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__)
121#define HAL_USE_QSPI FALSE
122#endif
123
124/**
125 * @brief Enables the RTC subsystem.
126 */
127#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__)
128#define HAL_USE_RTC FALSE
129#endif
130
131/**
132 * @brief Enables the SDC subsystem.
133 */
134#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__)
135#define HAL_USE_SDC FALSE
136#endif
137
138/**
139 * @brief Enables the SERIAL subsystem.
140 */
141#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__)
142#define HAL_USE_SERIAL FALSE
143#endif
144
145/**
146 * @brief Enables the SERIAL over USB subsystem.
147 */
148#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__)
149#define HAL_USE_SERIAL_USB TRUE
150#endif
151
152/**
153 * @brief Enables the SPI subsystem.
154 */
155#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__)
156#define HAL_USE_SPI FALSE
157#endif
158
159/**
160 * @brief Enables the UART subsystem.
161 */
162#if !defined(HAL_USE_UART) || defined(__DOXYGEN__)
163#define HAL_USE_UART FALSE
164#endif
165
166/**
167 * @brief Enables the USB subsystem.
168 */
169#if !defined(HAL_USE_USB) || defined(__DOXYGEN__)
170#define HAL_USE_USB TRUE
171#endif
172
173/**
174 * @brief Enables the WDG subsystem.
175 */
176#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__)
177#define HAL_USE_WDG FALSE
178#endif
179
180/*===========================================================================*/
181/* ADC driver related settings. */
182/*===========================================================================*/
183
184/**
185 * @brief Enables synchronous APIs.
186 * @note Disabling this option saves both code and data space.
187 */
188#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__)
189#define ADC_USE_WAIT TRUE
190#endif
191
192/**
193 * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs.
194 * @note Disabling this option saves both code and data space.
195 */
196#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
197#define ADC_USE_MUTUAL_EXCLUSION TRUE
198#endif
199
200/*===========================================================================*/
201/* CAN driver related settings. */
202/*===========================================================================*/
203
204/**
205 * @brief Sleep mode related APIs inclusion switch.
206 */
207#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__)
208#define CAN_USE_SLEEP_MODE TRUE
209#endif
210
211/*===========================================================================*/
212/* I2C driver related settings. */
213/*===========================================================================*/
214
215/**
216 * @brief Enables the mutual exclusion APIs on the I2C bus.
217 */
218#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
219#define I2C_USE_MUTUAL_EXCLUSION TRUE
220#endif
221
222/*===========================================================================*/
223/* MAC driver related settings. */
224/*===========================================================================*/
225
226/**
227 * @brief Enables an event sources for incoming packets.
228 */
229#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__)
230#define MAC_USE_ZERO_COPY FALSE
231#endif
232
233/**
234 * @brief Enables an event sources for incoming packets.
235 */
236#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
237#define MAC_USE_EVENTS TRUE
238#endif
239
240/*===========================================================================*/
241/* MMC_SPI driver related settings. */
242/*===========================================================================*/
243
244/**
245 * @brief Delays insertions.
246 * @details If enabled this options inserts delays into the MMC waiting
247 * routines releasing some extra CPU time for the threads with
248 * lower priority, this may slow down the driver a bit however.
249 * This option is recommended also if the SPI driver does not
250 * use a DMA channel and heavily loads the CPU.
251 */
252#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__)
253#define MMC_NICE_WAITING TRUE
254#endif
255
256/*===========================================================================*/
257/* SDC driver related settings. */
258/*===========================================================================*/
259
260/**
261 * @brief Number of initialization attempts before rejecting the card.
262 * @note Attempts are performed at 10mS intervals.
263 */
264#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__)
265#define SDC_INIT_RETRY 100
266#endif
267
268/**
269 * @brief Include support for MMC cards.
270 * @note MMC support is not yet implemented so this option must be kept
271 * at @p FALSE.
272 */
273#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__)
274#define SDC_MMC_SUPPORT FALSE
275#endif
276
277/**
278 * @brief Delays insertions.
279 * @details If enabled this options inserts delays into the MMC waiting
280 * routines releasing some extra CPU time for the threads with
281 * lower priority, this may slow down the driver a bit however.
282 */
283#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__)
284#define SDC_NICE_WAITING TRUE
285#endif
286
287/*===========================================================================*/
288/* SERIAL driver related settings. */
289/*===========================================================================*/
290
291/**
292 * @brief Default bit rate.
293 * @details Configuration parameter, this is the baud rate selected for the
294 * default configuration.
295 */
296#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__)
297#define SERIAL_DEFAULT_BITRATE 38400
298#endif
299
300/**
301 * @brief Serial buffers size.
302 * @details Configuration parameter, you can change the depth of the queue
303 * buffers depending on the requirements of your application.
304 * @note The default is 16 bytes for both the transmission and receive
305 * buffers.
306 */
307#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__)
308#define SERIAL_BUFFERS_SIZE 16
309#endif
310
311/*===========================================================================*/
312/* SERIAL_USB driver related setting. */
313/*===========================================================================*/
314
315/**
316 * @brief Serial over USB buffers size.
317 * @details Configuration parameter, the buffer size must be a multiple of
318 * the USB data endpoint maximum packet size.
319 * @note The default is 256 bytes for both the transmission and receive
320 * buffers.
321 */
322#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__)
323#define SERIAL_USB_BUFFERS_SIZE 1
324#endif
325
326/**
327 * @brief Serial over USB number of buffers.
328 * @note The default is 2 buffers.
329 */
330#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__)
331#define SERIAL_USB_BUFFERS_NUMBER 2
332#endif
333
334/*===========================================================================*/
335/* SPI driver related settings. */
336/*===========================================================================*/
337
338/**
339 * @brief Enables synchronous APIs.
340 * @note Disabling this option saves both code and data space.
341 */
342#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__)
343#define SPI_USE_WAIT TRUE
344#endif
345
346/**
347 * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs.
348 * @note Disabling this option saves both code and data space.
349 */
350#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
351#define SPI_USE_MUTUAL_EXCLUSION TRUE
352#endif
353
354/*===========================================================================*/
355/* UART driver related settings. */
356/*===========================================================================*/
357
358/**
359 * @brief Enables synchronous APIs.
360 * @note Disabling this option saves both code and data space.
361 */
362#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__)
363#define UART_USE_WAIT FALSE
364#endif
365
366/**
367 * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs.
368 * @note Disabling this option saves both code and data space.
369 */
370#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__)
371#define UART_USE_MUTUAL_EXCLUSION FALSE
372#endif
373
374/*===========================================================================*/
375/* USB driver related settings. */
376/*===========================================================================*/
377
378/**
379 * @brief Enables synchronous APIs.
380 * @note Disabling this option saves both code and data space.
381 */
382#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__)
383#define USB_USE_WAIT TRUE
384#endif
385
386#endif /* HALCONF_H */
387
388/** @} */
diff --git a/keyboards/handwired/co60/rev7/led.c b/keyboards/handwired/co60/rev7/led.c
new file mode 100644
index 000000000..13f8d9860
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/led.c
@@ -0,0 +1,242 @@
1/*
2Copyright 2012 Jun Wako <wakojun@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#include "hal.h"
19#include "led_custom.h"
20#include "rev7.h"
21#include "printf.h"
22
23static void breathing_callback(PWMDriver *pwmp);
24
25static PWMConfig pwmCFG = {
26 0xFFFF, /* PWM clock frequency */
27 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
28 NULL, /* No Callback */
29 {
30 {PWM_OUTPUT_DISABLED, NULL},
31 {PWM_OUTPUT_DISABLED, NULL},
32 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */
33 {PWM_OUTPUT_DISABLED, NULL}
34 },
35 0, /* HW dependent part.*/
36 0
37};
38
39static PWMConfig pwmCFG_breathing = {
40 0xFFFF, /* 10kHz PWM clock frequency */
41 256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
42 breathing_callback, /* Breathing Callback */
43 {
44 {PWM_OUTPUT_DISABLED, NULL},
45 {PWM_OUTPUT_DISABLED, NULL},
46 {PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 3 */
47 {PWM_OUTPUT_DISABLED, NULL}
48 },
49 0, /* HW dependent part.*/
50 0
51};
52
53// See http://jared.geek.nz/2013/feb/linear-led-pwm
54static uint16_t cie_lightness(uint16_t v) {
55 if (v <= 5243) // if below 8% of max
56 return v / 9; // same as dividing by 900%
57 else {
58 uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
59 // to get a useful result with integer division, we shift left in the expression above
60 // and revert what we've done again after squaring.
61 y = y * y * y >> 8;
62 if (y > 0xFFFFUL) // prevent overflow
63 return 0xFFFFU;
64 else
65 return (uint16_t) y;
66 }
67}
68
69
70void backlight_init_ports(void) {
71 palSetPadMode(GPIOB, 8, PAL_MODE_ALTERNATE(2));
72 pwmStart(&PWMD4, &pwmCFG);
73 if(kb_backlight_config.enable){
74 if(kb_backlight_config.breathing){
75 breathing_enable();
76 } else{
77 backlight_set(kb_backlight_config.level);
78 }
79 } else {
80 backlight_set(0);
81 }
82}
83
84void backlight_set(uint8_t level) {
85 uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS));
86 if (level == 0) {
87 // Turn backlight off
88 // Disable channel 3 on PWM4
89 pwmDisableChannel(&PWMD4, 2);
90 } else {
91 // Turn backlight on
92 if(!is_breathing()){
93 // Enable channel 3 on PWM4
94 pwmEnableChannel(&PWMD4, 2, PWM_FRACTION_TO_WIDTH(&PWMD4,0xFFFF,duty));
95 }
96 }
97}
98
99
100uint8_t backlight_tick = 0;
101
102void backlight_task(void) {
103}
104
105#define BREATHING_NO_HALT 0
106#define BREATHING_HALT_OFF 1
107#define BREATHING_HALT_ON 2
108#define BREATHING_STEPS 128
109
110static uint8_t breathing_period = BREATHING_PERIOD;
111static uint8_t breathing_halt = BREATHING_NO_HALT;
112static uint16_t breathing_counter = 0;
113
114bool is_breathing(void) {
115 return PWMD4.config == &pwmCFG_breathing;
116}
117
118#define breathing_min() do {breathing_counter = 0;} while (0)
119#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0)
120
121
122void breathing_interrupt_enable(void){
123 pwmStop(&PWMD4);
124 pwmStart(&PWMD4, &pwmCFG_breathing);
125 chSysLockFromISR();
126 pwmEnablePeriodicNotification(&PWMD4);
127 pwmEnableChannelI(
128 &PWMD4,
129 2,
130 PWM_FRACTION_TO_WIDTH(
131 &PWMD4,
132 0xFFFF,
133 0xFFFF
134 )
135 );
136 chSysUnlockFromISR();
137}
138
139void breathing_interrupt_disable(void){
140 pwmStop(&PWMD4);
141 pwmStart(&PWMD4, &pwmCFG);
142}
143
144void breathing_enable(void)
145{
146 breathing_counter = 0;
147 breathing_halt = BREATHING_NO_HALT;
148 breathing_interrupt_enable();
149}
150
151void breathing_pulse(void)
152{
153 if (kb_backlight_config.level == 0)
154 breathing_min();
155 else
156 breathing_max();
157 breathing_halt = BREATHING_HALT_ON;
158 breathing_interrupt_enable();
159}
160
161void breathing_disable(void)
162{
163 breathing_interrupt_disable();
164 // Restore backlight level
165 backlight_set(kb_backlight_config.level);
166}
167
168void breathing_self_disable(void)
169{
170 if (kb_backlight_config.level == 0)
171 breathing_halt = BREATHING_HALT_OFF;
172 else
173 breathing_halt = BREATHING_HALT_ON;
174}
175
176void breathing_toggle(void) {
177 if (is_breathing()){
178 breathing_disable();
179 } else {
180 breathing_enable();
181 }
182}
183
184void breathing_period_set(uint8_t value)
185{
186 if (!value)
187 value = 1;
188 breathing_period = value;
189}
190
191void breathing_period_default(void) {
192 breathing_period_set(BREATHING_PERIOD);
193}
194
195void breathing_period_inc(void)
196{
197 breathing_period_set(breathing_period+1);
198}
199
200void breathing_period_dec(void)
201{
202 breathing_period_set(breathing_period-1);
203}
204
205/* To generate breathing curve in python:
206 * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
207 */
208static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
209
210// Use this before the cie_lightness function.
211static inline uint16_t scale_backlight(uint16_t v) {
212 return v / BACKLIGHT_LEVELS * kb_backlight_config.level;
213}
214
215static void breathing_callback(PWMDriver *pwmp)
216{
217 (void)pwmp;
218 uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS;
219 // resetting after one period to prevent ugly reset at overflow.
220 breathing_counter = (breathing_counter + 1) % (breathing_period * 256);
221 uint8_t index = breathing_counter / interval % BREATHING_STEPS;
222
223 if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
224 ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
225 {
226 breathing_interrupt_disable();
227 }
228
229 uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256));
230
231 chSysLockFromISR();
232 pwmEnableChannelI(
233 &PWMD4,
234 2,
235 PWM_FRACTION_TO_WIDTH(
236 &PWMD4,
237 0xFFFF,
238 duty
239 )
240 );
241 chSysUnlockFromISR();
242}
diff --git a/keyboards/handwired/co60/rev7/led_custom.h b/keyboards/handwired/co60/rev7/led_custom.h
new file mode 100644
index 000000000..56e723db8
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/led_custom.h
@@ -0,0 +1,22 @@
1/*
2Copyright 2019 John M Daly <jmdaly@gmail.com>
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20void backlight_task(void);
21void breathing_interrupt_disable(void);
22void breathing_interrupt_enable(void);
diff --git a/keyboards/handwired/co60/rev7/mcuconf.h b/keyboards/handwired/co60/rev7/mcuconf.h
new file mode 100644
index 000000000..69bf9185d
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/mcuconf.h
@@ -0,0 +1,257 @@
1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef MCUCONF_H
18#define MCUCONF_H
19
20/*
21 * STM32F3xx drivers configuration.
22 * The following settings override the default settings present in
23 * the various device driver implementation headers.
24 * Note that the settings for each driver only have effect if the whole
25 * driver is enabled in halconf.h.
26 *
27 * IRQ priorities:
28 * 15...0 Lowest...Highest.
29 *
30 * DMA priorities:
31 * 0...3 Lowest...Highest.
32 */
33
34#define STM32F3xx_MCUCONF
35
36/*
37 * HAL driver system settings.
38 */
39#define STM32_NO_INIT FALSE
40#define STM32_PVD_ENABLE FALSE
41#define STM32_PLS STM32_PLS_LEV0
42#define STM32_HSI_ENABLED TRUE
43#define STM32_LSI_ENABLED TRUE
44#define STM32_HSE_ENABLED TRUE
45#define STM32_LSE_ENABLED FALSE
46#define STM32_SW STM32_SW_PLL
47#define STM32_PLLSRC STM32_PLLSRC_HSE
48#define STM32_PREDIV_VALUE 1
49#define STM32_PLLMUL_VALUE 9
50#define STM32_HPRE STM32_HPRE_DIV1
51#define STM32_PPRE1 STM32_PPRE1_DIV2
52#define STM32_PPRE2 STM32_PPRE2_DIV2
53#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
54#define STM32_ADC12PRES STM32_ADC12PRES_DIV1
55#define STM32_ADC34PRES STM32_ADC34PRES_DIV1
56#define STM32_USART1SW STM32_USART1SW_PCLK
57#define STM32_USART2SW STM32_USART2SW_PCLK
58#define STM32_USART3SW STM32_USART3SW_PCLK
59#define STM32_UART4SW STM32_UART4SW_PCLK
60#define STM32_UART5SW STM32_UART5SW_PCLK
61#define STM32_I2C1SW STM32_I2C1SW_SYSCLK
62#define STM32_I2C2SW STM32_I2C2SW_SYSCLK
63#define STM32_TIM1SW STM32_TIM1SW_PCLK2
64#define STM32_TIM8SW STM32_TIM8SW_PCLK2
65#define STM32_RTCSEL STM32_RTCSEL_LSI
66#define STM32_USB_CLOCK_REQUIRED TRUE
67#define STM32_USBPRE STM32_USBPRE_DIV1P5
68
69#undef STM32_HSE_BYPASS
70// #error "oh no"
71// #endif
72
73/*
74 * ADC driver system settings.
75 */
76#define STM32_ADC_DUAL_MODE FALSE
77#define STM32_ADC_COMPACT_SAMPLES FALSE
78#define STM32_ADC_USE_ADC1 FALSE
79#define STM32_ADC_USE_ADC2 FALSE
80#define STM32_ADC_USE_ADC3 FALSE
81#define STM32_ADC_USE_ADC4 FALSE
82#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
83#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
84#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
85#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
86#define STM32_ADC_ADC1_DMA_PRIORITY 2
87#define STM32_ADC_ADC2_DMA_PRIORITY 2
88#define STM32_ADC_ADC3_DMA_PRIORITY 2
89#define STM32_ADC_ADC4_DMA_PRIORITY 2
90#define STM32_ADC_ADC12_IRQ_PRIORITY 5
91#define STM32_ADC_ADC3_IRQ_PRIORITY 5
92#define STM32_ADC_ADC4_IRQ_PRIORITY 5
93#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5
94#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5
95#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5
96#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5
97#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
98#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1
99
100/*
101 * CAN driver system settings.
102 */
103#define STM32_CAN_USE_CAN1 FALSE
104#define STM32_CAN_CAN1_IRQ_PRIORITY 11
105
106/*
107 * DAC driver system settings.
108 */
109#define STM32_DAC_DUAL_MODE FALSE
110#define STM32_DAC_USE_DAC1_CH1 TRUE
111#define STM32_DAC_USE_DAC1_CH2 TRUE
112#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10
113#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10
114#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2
115#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2
116
117/*
118 * EXT driver system settings.
119 */
120#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
121#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
122#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
123#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
124#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
125#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
126#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
127#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
128#define STM32_EXT_EXTI17_IRQ_PRIORITY 6
129#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
130#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
131#define STM32_EXT_EXTI20_IRQ_PRIORITY 6
132#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6
133#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6
134#define STM32_EXT_EXTI33_IRQ_PRIORITY 6
135
136/*
137 * GPT driver system settings.
138 */
139#define STM32_GPT_USE_TIM1 FALSE
140#define STM32_GPT_USE_TIM2 FALSE
141#define STM32_GPT_USE_TIM3 FALSE
142#define STM32_GPT_USE_TIM4 FALSE
143#define STM32_GPT_USE_TIM6 TRUE
144#define STM32_GPT_USE_TIM7 TRUE
145#define STM32_GPT_USE_TIM8 TRUE
146#define STM32_GPT_TIM1_IRQ_PRIORITY 7
147#define STM32_GPT_TIM2_IRQ_PRIORITY 7
148#define STM32_GPT_TIM3_IRQ_PRIORITY 7
149#define STM32_GPT_TIM4_IRQ_PRIORITY 7
150#define STM32_GPT_TIM6_IRQ_PRIORITY 7
151#define STM32_GPT_TIM7_IRQ_PRIORITY 7
152#define STM32_GPT_TIM8_IRQ_PRIORITY 7
153
154/*
155 * I2C driver system settings.
156 */
157#define STM32_I2C_USE_I2C1 FALSE
158#define STM32_I2C_USE_I2C2 FALSE
159#define STM32_I2C_BUSY_TIMEOUT 50
160#define STM32_I2C_I2C1_IRQ_PRIORITY 10
161#define STM32_I2C_I2C2_IRQ_PRIORITY 10
162#define STM32_I2C_USE_DMA TRUE
163#define STM32_I2C_I2C1_DMA_PRIORITY 1
164#define STM32_I2C_I2C2_DMA_PRIORITY 1
165#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
166
167/*
168 * ICU driver system settings.
169 */
170#define STM32_ICU_USE_TIM1 FALSE
171#define STM32_ICU_USE_TIM2 FALSE
172#define STM32_ICU_USE_TIM3 FALSE
173#define STM32_ICU_USE_TIM4 FALSE
174#define STM32_ICU_USE_TIM8 FALSE
175#define STM32_ICU_TIM1_IRQ_PRIORITY 7
176#define STM32_ICU_TIM2_IRQ_PRIORITY 7
177#define STM32_ICU_TIM3_IRQ_PRIORITY 7
178#define STM32_ICU_TIM4_IRQ_PRIORITY 7
179#define STM32_ICU_TIM8_IRQ_PRIORITY 7
180
181/*
182 * PWM driver system settings.
183 */
184#define STM32_PWM_USE_ADVANCED FALSE
185#define STM32_PWM_USE_TIM1 FALSE
186#define STM32_PWM_USE_TIM2 FALSE
187#define STM32_PWM_USE_TIM3 FALSE
188#define STM32_PWM_USE_TIM4 TRUE
189#define STM32_PWM_USE_TIM8 FALSE
190#define STM32_PWM_TIM1_IRQ_PRIORITY 7
191#define STM32_PWM_TIM2_IRQ_PRIORITY 7
192#define STM32_PWM_TIM3_IRQ_PRIORITY 7
193#define STM32_PWM_TIM4_IRQ_PRIORITY 7
194#define STM32_PWM_TIM8_IRQ_PRIORITY 7
195
196/*
197 * SERIAL driver system settings.
198 */
199#define STM32_SERIAL_USE_USART1 FALSE
200#define STM32_SERIAL_USE_USART2 TRUE
201#define STM32_SERIAL_USE_USART3 FALSE
202#define STM32_SERIAL_USE_UART4 FALSE
203#define STM32_SERIAL_USE_UART5 FALSE
204#define STM32_SERIAL_USART1_PRIORITY 12
205#define STM32_SERIAL_USART2_PRIORITY 12
206#define STM32_SERIAL_USART3_PRIORITY 12
207#define STM32_SERIAL_UART4_PRIORITY 12
208#define STM32_SERIAL_UART5_PRIORITY 12
209
210/*
211 * SPI driver system settings.
212 */
213#define STM32_SPI_USE_SPI1 FALSE
214#define STM32_SPI_USE_SPI2 FALSE
215#define STM32_SPI_USE_SPI3 FALSE
216#define STM32_SPI_SPI1_DMA_PRIORITY 1
217#define STM32_SPI_SPI2_DMA_PRIORITY 1
218#define STM32_SPI_SPI3_DMA_PRIORITY 1
219#define STM32_SPI_SPI1_IRQ_PRIORITY 10
220#define STM32_SPI_SPI2_IRQ_PRIORITY 10
221#define STM32_SPI_SPI3_IRQ_PRIORITY 10
222#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
223
224/*
225 * ST driver system settings.
226 */
227#define STM32_ST_IRQ_PRIORITY 8
228#define STM32_ST_USE_TIMER 2
229
230/*
231 * UART driver system settings.
232 */
233#define STM32_UART_USE_USART1 FALSE
234#define STM32_UART_USE_USART2 FALSE
235#define STM32_UART_USE_USART3 FALSE
236#define STM32_UART_USART1_IRQ_PRIORITY 12
237#define STM32_UART_USART2_IRQ_PRIORITY 12
238#define STM32_UART_USART3_IRQ_PRIORITY 12
239#define STM32_UART_USART1_DMA_PRIORITY 0
240#define STM32_UART_USART2_DMA_PRIORITY 0
241#define STM32_UART_USART3_DMA_PRIORITY 0
242#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
243
244/*
245 * USB driver system settings.
246 */
247#define STM32_USB_USE_USB1 TRUE
248#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
249#define STM32_USB_USB1_HP_IRQ_PRIORITY 13
250#define STM32_USB_USB1_LP_IRQ_PRIORITY 14
251
252/*
253 * WDG driver system settings.
254 */
255#define STM32_WDG_USE_IWDG FALSE
256
257#endif /* MCUCONF_H */
diff --git a/keyboards/handwired/co60/rev7/rev7.c b/keyboards/handwired/co60/rev7/rev7.c
new file mode 100644
index 000000000..3d0964d89
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/rev7.c
@@ -0,0 +1,39 @@
1/* Copyright 2019 John M Daly <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#include "rev7.h"
17
18#include "backlight.h"
19#include "led.h"
20#include "printf.h"
21
22backlight_levels_config_t kb_backlight_config = {
23 .enable = true,
24 .breathing = true,
25 .level = BACKLIGHT_LEVELS
26};
27
28uint8_t *o_fb;
29
30uint16_t counterst = 0;
31
32void matrix_init_kb(void) {
33 matrix_init_user();
34 backlight_init_ports();
35}
36
37void matrix_scan_kb(void) {
38 matrix_scan_user();
39}
diff --git a/keyboards/handwired/co60/rev7/rev7.h b/keyboards/handwired/co60/rev7/rev7.h
new file mode 100644
index 000000000..4ab2b8d72
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/rev7.h
@@ -0,0 +1,146 @@
1/* Copyright 2019 Jack Humbert <jmdaly@gmail.com>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16#pragma once
17
18#include "quantum.h"
19
20// This a shortcut to help you visually see your layout.
21// The following is a layout that uses all available switch positions.
22// The first section contains all of the arguments
23// The second converts the arguments into a two-dimensional array
24#define LAYOUT_all( \
25 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
26 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
27 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
28 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
29 K400, K401, K402, K404, K406, K408, K410, K411, K412, K413, K414 \
30) \
31{ \
32 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
33 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
34 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
35 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
36 { K400, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 }, \
37}
38
39#define LAYOUT_60_ansi( \
40 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
41 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
42 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
43 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
44 K400, K401, K402, K406, K410, K411, K413, K414 \
45) \
46{ \
47 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
48 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
49 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
50 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
51 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
52}
53
54#define LAYOUT_60_ansi_split_bs_rshift( \
55 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
56 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
57 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
58 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
59 K400, K401, K402, K406, K410, K411, K413, K414 \
60) \
61{ \
62 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
63 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
64 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
65 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
66 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
67}
68
69#define LAYOUT_60_iso( \
70 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \
71 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \
72 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \
73 K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \
74 K400, K401, K402, K406, K410, K411, K413, K414 \
75) \
76{ \
77 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \
78 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \
79 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
80 { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \
81 { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 }, \
82}
83
84#define LAYOUT_60_hhkb( \
85 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
86 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
87 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
88 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
89 K401, K402, K406, K411, K413 \
90) \
91{ \
92 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
93 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
94 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
95 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
96 { KC_NO, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \
97}
98
99#define LAYOUT_60_hhkb_split_space( \
100 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
101 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
102 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
103 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
104 K401, K402, K404, K406, K408, K411, K413 \
105) \
106{ \
107 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
108 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
109 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
110 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
111 { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO }, \
112}
113
114#define LAYOUT_60_hhkb_split_625u_space( \
115 K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \
116 K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
117 K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
118 K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \
119 K401, K402, K404, K406, K408, K410, K411, K413 \
120) \
121{ \
122 { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
123 { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
124 { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214 }, \
125 { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \
126 { KC_NO, K401, K402, KC_NO, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, KC_NO }, \
127}
128
129// Backlighting
130typedef union {
131 uint8_t raw;
132 struct {
133 bool enable :1;
134 bool breathing : 1;
135 uint8_t level :6;
136 };
137} backlight_levels_config_t;
138
139extern backlight_levels_config_t kb_backlight_config;
140extern bool kb_backlight_breathing;
141
142void backlight_init_ports(void);
143void backlight_set(uint8_t level);
144bool is_breathing(void);
145void breathing_enable(void);
146void breathing_disable(void);
diff --git a/keyboards/handwired/co60/rev7/rules.mk b/keyboards/handwired/co60/rev7/rules.mk
new file mode 100644
index 000000000..6e0b3856a
--- /dev/null
+++ b/keyboards/handwired/co60/rev7/rules.mk
@@ -0,0 +1,59 @@
1# project specific files
2
3## chip/board settings
4# - the next two should match the directories in
5# <chibios>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
6MCU_FAMILY = STM32
7MCU_SERIES = STM32F3xx
8
9# Linker script to use
10# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
11# or <this_dir>/ld/
12MCU_LDSCRIPT = STM32F303xC
13
14# Startup code to use
15# - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
16MCU_STARTUP = stm32f3xx
17
18# Board: it should exist either in <chibios>/os/hal/boards/
19# or <this_dir>/boards
20BOARD = GENERIC_STM32_F303XC
21
22# Cortex version
23MCU = cortex-m4
24
25# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
26ARMV = 7
27
28USE_FPU = yes
29
30# Vector table for application
31# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
32# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
33# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000
34
35# Options to pass to dfu-util when flashing
36DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave
37DFU_SUFFIX_ARGS = -v 0483 -p df11
38
39# Code for backlight breathing:
40SRC += led.c
41
42# Build Options
43# comment out to disable the options.
44#
45BACKLIGHT_ENABLE = yes
46BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
47MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
48EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
49CONSOLE_ENABLE = no # Console for debug(+400)
50COMMAND_ENABLE = no # Commands for debug and configuration
51NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
52AUDIO_ENABLE = no
53RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality
54MIDI_ENABLE = no # MIDI controls
55UNICODE_ENABLE = no # Unicode
56BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
57LEADER_ENABLE = yes
58
59LAYOUTS = 60_ansi 60_ansi_split_bs_rshift 60_iso 60_hhkb