Create gk104_q1_ansi keyboard

This commit is contained in:
NaturalZh 2024-02-01 09:34:30 +08:00
parent c635733a7f
commit 5ae58a483e
13 changed files with 1180 additions and 0 deletions

View File

@ -0,0 +1,341 @@
{
"keyboard_name": "GK980 Q1_ANSI_1.0.0",
"rgb_matrix": {
"layout": [
{"matrix": [0, 0], "x": 0, "y": 0, "flags": 4},
{"matrix": [0, 1], "x": 18.2, "y": 0, "flags": 4},
{"matrix": [0, 2], "x": 30.3, "y": 0, "flags": 4},
{"matrix": [0, 3], "x": 52, "y": 0, "flags": 4},
{"matrix": [0, 4], "x": 42.4, "y": 0, "flags": 4},
{"matrix": [0, 5], "x": 69.6, "y": 0, "flags": 4},
{"matrix": [0, 6], "x": 81.7, "y": 0, "flags": 4},
{"matrix": [0, 7], "x": 93.9, "y": 0, "flags": 4},
{"matrix": [0, 8], "x": 106, "y": 0, "flags": 4},
{"matrix": [0, 9], "x": 121.1, "y": 0, "flags": 4},
{"matrix": [0, 10], "x": 133.2, "y": 0, "flags": 4},
{"matrix": [5, 3], "x": 145.3, "y": 0, "flags": 4},
{"matrix": [5, 4], "x": 157.4, "y": 0, "flags": 4},
{"matrix": [0, 12], "x": 187.7, "y": 0, "flags": 4},
{"matrix": [0, 13], "x": 199.8, "y": 0, "flags": 4},
{"matrix": [0, 14], "x": 211.9, "y": 0, "flags": 4},
{"matrix": [6, 13], "x": 224, "y": 0, "flags": 4},
{"matrix": [1, 0], "x": 0, "y": 14.5, "flags": 4},
{"matrix": [1, 1], "x": 12.1, "y": 14.5, "flags": 4},
{"matrix": [1, 2], "x": 24.2, "y": 14.5, "flags": 4},
{"matrix": [1, 3], "x": 36.3, "y": 14.5, "flags": 4},
{"matrix": [1, 4], "x": 48.4, "y": 14.5, "flags": 4},
{"matrix": [1, 5], "x": 60.6, "y": 14.5, "flags": 4},
{"matrix": [1, 6], "x": 72.7, "y": 14.5, "flags": 4},
{"matrix": [1, 7], "x": 84.8, "y": 14.5, "flags": 8},
{"matrix": [1, 8], "x": 96.9, "y": 14.5, "flags": 4},
{"matrix": [1, 9], "x": 109, "y": 14.5, "flags": 4},
{"matrix": [1, 10], "x": 121.1, "y": 14.5, "flags": 4},
{"matrix": [6, 3], "x": 133.2, "y": 14.5, "flags": 4},
{"matrix": [6, 4], "x": 145.3, "y": 14.5, "flags": 4},
{"matrix": [1, 11], "x": 157.4, "y": 14.5, "flags": 4},
{"matrix": [1, 12], "x": 187.7, "y": 14.5, "flags": 4},
{"matrix": [1, 13], "x": 199.8, "y": 14.5, "flags": 4},
{"matrix": [1, 14], "x": 211.9, "y": 14.5, "flags": 4},
{"matrix": [6, 14], "x": 224, "y": 14.5, "flags": 4},
{"matrix": [2, 0], "x": 0, "y": 26.2, "flags": 4},
{"matrix": [2, 1], "x": 18.2, "y": 26.2, "flags": 4},
{"matrix": [2, 2], "x": 30.3, "y": 26.2, "flags": 4},
{"matrix": [2, 3], "x": 42.4, "y": 26.2, "flags": 4},
{"matrix": [2, 4], "x": 54.5, "y": 26.2, "flags": 4},
{"matrix": [2, 5], "x": 66.6, "y": 26.2, "flags": 4},
{"matrix": [2, 6], "x": 78.7, "y": 26.2, "flags": 4},
{"matrix": [2, 7], "x": 90.8, "y": 26.2, "flags": 4},
{"matrix": [2, 8], "x": 102.9, "y": 26.2, "flags": 4},
{"matrix": [2, 9], "x": 115, "y": 26.2, "flags": 4},
{"matrix": [2, 10], "x": 127.2, "y": 26.2, "flags": 4},
{"matrix": [6, 5], "x": 139.3, "y": 26.2, "flags": 4},
{"matrix": [6, 6], "x": 151.4, "y": 26.2, "flags": 4},
{"matrix": [2, 11], "x": 163.5, "y": 26.2, "flags": 4},
{"matrix": [2, 12], "x": 187.7, "y": 26.2, "flags": 4},
{"matrix": [2, 13], "x": 199.8, "y": 26.2, "flags": 4},
{"matrix": [2, 14], "x": 211.9, "y": 26.2, "flags": 4},
{"matrix": [6, 11], "x": 224, "y": 32, "flags": 4},
{"matrix": [3, 0], "x": 0, "y": 37.8, "flags": 4},
{"matrix": [3, 1], "x": 21.2, "y": 37.8, "flags": 4},
{"matrix": [3, 2], "x": 33.3, "y": 37.8, "flags": 4},
{"matrix": [3, 3], "x": 45.4, "y": 37.8, "flags": 4},
{"matrix": [3, 4], "x": 57.5, "y": 37.8, "flags": 4},
{"matrix": [3, 5], "x": 69.6, "y": 37.8, "flags": 4},
{"matrix": [3, 6], "x": 81.7, "y": 37.8, "flags": 4},
{"matrix": [3, 7], "x": 93.9, "y": 37.8, "flags": 4},
{"matrix": [3, 8], "x": 106, "y": 37.8, "flags": 4},
{"matrix": [3, 9], "x": 118.1, "y": 37.8, "flags": 4},
{"matrix": [3, 10], "x": 130.2, "y": 37.8, "flags": 4},
{"matrix": [6, 7], "x": 142.3, "y": 37.8, "flags": 4},
{"matrix": [3, 11], "x": 154.4, "y": 37.8, "flags": 4},
{"matrix": [3, 12], "x": 187.7, "y": 37.8, "flags": 4},
{"matrix": [3, 13], "x": 199.8, "y": 37.8, "flags": 4},
{"matrix": [3, 14], "x": 211.9, "y": 37.8, "flags": 4},
{"matrix": [4, 0], "x": 0, "y": 49.5, "flags": 4},
{"matrix": [4, 1], "x": 27.2, "y": 49.5, "flags": 4},
{"matrix": [4, 2], "x": 39.4, "y": 49.5, "flags": 4},
{"matrix": [4, 3], "x": 51.5, "y": 49.5, "flags": 4},
{"matrix": [4, 4], "x": 63.6, "y": 49.5, "flags": 4},
{"matrix": [4, 5], "x": 75.7, "y": 49.5, "flags": 4},
{"matrix": [4, 6], "x": 87.8, "y": 49.5, "flags": 4},
{"matrix": [4, 7], "x": 99.9, "y": 49.5, "flags": 4},
{"matrix": [4, 8], "x": 112, "y": 49.5, "flags": 4},
{"matrix": [4, 9], "x": 124.1, "y": 49.5, "flags": 4},
{"matrix": [4, 10], "x": 136.2, "y": 49.5, "flags": 4},
{"matrix": [6, 8], "x": 148.3, "y": 49.5, "flags": 4},
{"matrix": [4, 11], "x": 172.6, "y": 49.5, "flags": 4},
{"matrix": [4, 12], "x": 187.7, "y": 49.5, "flags": 4},
{"matrix": [4, 13], "x": 199.8, "y": 49.5, "flags": 4},
{"matrix": [4, 14], "x": 211.9, "y": 49.5, "flags": 4},
{"matrix": [6, 12], "x": 224, "y": 55.3, "flags": 4},
{"matrix": [5, 0], "x": 0, "y": 61.1, "flags": 4},
{"matrix": [5, 1], "x": 15.1, "y": 61.1, "flags": 4},
{"matrix": [6, 1], "x": 30.3, "y": 61.1, "flags": 4},
{"matrix": [6, 0], "x": 45.4, "y": 61.1, "flags": 4},
{"matrix": [5, 5], "x": 68.1, "y": 61.1, "flags": 4},
{"matrix": [5, 6], "x": 90.8, "y": 61.1, "flags": 4},
{"matrix": [5, 9], "x": 121.1, "y": 61.1, "flags": 4},
{"matrix": [5, 7], "x": 133.2, "y": 61.1, "flags": 4},
{"matrix": [5, 10], "x": 145.3, "y": 61.1, "flags": 4},
{"matrix": [6, 9], "x": 160.5, "y": 64, "flags": 4},
{"matrix": [5, 11], "x": 172.6, "y": 64, "flags": 4},
{"matrix": [5, 12], "x": 184.7, "y": 64, "flags": 4},
{"matrix": [5, 13], "x": 199.8, "y": 61.1, "flags": 4},
{"matrix": [5, 14], "x": 211.9, "y": 61.1, "flags": 4}
]
},
"usb": {
"device_version": "1.0.0",
"pid": "0x6098"
},
"layouts": {
"LAYOUT_all": {
"layout": [
{"label": "ESC", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "F1", "matrix": [0, 1], "x": 1.5, "y": 0},
{"label": "F2", "matrix": [0, 2], "x": 2.5, "y": 0},
{"label": "F3", "matrix": [0, 3], "x": 3.5, "y": 0},
{"label": "F4", "matrix": [0, 4], "x": 4.5, "y": 0},
{"label": "F5", "matrix": [0, 5], "x": 5.75, "y": 0},
{"label": "F6", "matrix": [0, 6], "x": 6.75, "y": 0},
{"label": "F7", "matrix": [0, 7], "x": 7.75, "y": 0},
{"label": "F8", "matrix": [0, 8], "x": 8.75, "y": 0},
{"label": "F9", "matrix": [0, 9], "x": 10, "y": 0},
{"label": "F10", "matrix": [0, 10], "x": 11, "y": 0},
{"label": "F11", "matrix": [5, 3], "x": 12, "y": 0},
{"label": "F12", "matrix": [5, 4], "x": 13, "y": 0},
{"label": "Mute", "matrix": [0, 11], "x": 14.25, "y": 0},
{"label": "PgUp", "matrix": [0, 12], "x": 15.5, "y": 0},
{"label": "PgDn", "matrix": [0, 13], "x": 16.5, "y": 0},
{"label": "PB", "matrix": [0, 14], "x": 17.5, "y": 0},
{"label": "PrtSc", "matrix": [6, 13], "x": 18.5, "y": 0},
{"label": "~", "matrix": [1, 0], "x": 0, "y": 1.25},
{"label": "1", "matrix": [1, 1], "x": 1, "y": 1.25},
{"label": "2", "matrix": [1, 2], "x": 2, "y": 1.25},
{"label": "3", "matrix": [1, 3], "x": 3, "y": 1.25},
{"label": "4", "matrix": [1, 4], "x": 4, "y": 1.25},
{"label": "5", "matrix": [1, 5], "x": 5, "y": 1.25},
{"label": "6", "matrix": [1, 6], "x": 6, "y": 1.25},
{"label": "7", "matrix": [1, 7], "x": 7, "y": 1.25},
{"label": "8", "matrix": [1, 8], "x": 8, "y": 1.25},
{"label": "9", "matrix": [1, 9], "x": 9, "y": 1.25},
{"label": "0", "matrix": [1, 10], "x": 10, "y": 1.25},
{"label": "-_", "matrix": [6, 3], "x": 11, "y": 1.25},
{"label": "=+", "matrix": [6, 4], "x": 12, "y": 1.25},
{"label": "BS", "matrix": [1, 11], "x": 13, "y": 1.25, "w": 2},
{"label": "NumLk", "matrix": [1, 12], "x": 15.5, "y": 1.25},
{"label": "P/", "matrix": [1, 13], "x": 16.5, "y": 1.25},
{"label": "P*", "matrix": [1, 14], "x": 17.5, "y": 1.25},
{"label": "P-", "matrix": [6, 14], "x": 18.5, "y": 1.25},
{"label": "Tab", "matrix": [2, 0], "x": 0, "y": 2.25, "w": 1.5},
{"label": "Q", "matrix": [2, 1], "x": 1.5, "y": 2.25},
{"label": "W", "matrix": [2, 2], "x": 2.5, "y": 2.25},
{"label": "E", "matrix": [2, 3], "x": 3.5, "y": 2.25},
{"label": "R", "matrix": [2, 4], "x": 4.5, "y": 2.25},
{"label": "T", "matrix": [2, 5], "x": 5.5, "y": 2.25},
{"label": "Y", "matrix": [2, 6], "x": 6.5, "y": 2.25},
{"label": "U", "matrix": [2, 7], "x": 7.5, "y": 2.25},
{"label": "I", "matrix": [2, 8], "x": 8.5, "y": 2.25},
{"label": "O", "matrix": [2, 9], "x": 9.5, "y": 2.25},
{"label": "P", "matrix": [2, 10], "x": 10.5, "y": 2.25},
{"label": "[", "matrix": [6, 5], "x": 11.5, "y": 2.25},
{"label": "]", "matrix": [6, 6], "x": 12.5, "y": 2.25},
{"label": "|", "matrix": [2, 11], "x": 13.5, "y": 2.25, "w": 1.5},
{"label": "P7", "matrix": [2, 12], "x": 15.5, "y": 2.25},
{"label": "P8", "matrix": [2, 13], "x": 16.5, "y": 2.25},
{"label": "P9", "matrix": [2, 14], "x": 17.5, "y": 2.25},
{"label": "P+", "matrix": [6, 11], "x": 18.5, "y": 2.25, "h": 2.0},
{"label": "Cap", "matrix": [3, 0], "x": 0, "y": 3.25, "w": 1.75},
{"label": "A", "matrix": [3, 1], "x": 1.75, "y": 3.25},
{"label": "S", "matrix": [3, 2], "x": 2.75, "y": 3.25},
{"label": "D", "matrix": [3, 3], "x": 3.75, "y": 3.25},
{"label": "F", "matrix": [3, 4], "x": 4.75, "y": 3.25},
{"label": "G", "matrix": [3, 5], "x": 5.75, "y": 3.25},
{"label": "H", "matrix": [3, 6], "x": 6.75, "y": 3.25},
{"label": "J", "matrix": [3, 7], "x": 7.75, "y": 3.25},
{"label": "K", "matrix": [3, 8], "x": 8.75, "y": 3.25},
{"label": "L", "matrix": [3, 9], "x": 9.75, "y": 3.25},
{"label": ";", "matrix": [3, 10], "x": 10.75, "y": 3.25},
{"label": "'", "matrix": [6, 7], "x": 11.75, "y": 3.25},
{"label": "Ent", "matrix": [3, 11], "x": 12.75, "y": 3.25, "w": 2.25},
{"label": "P4", "matrix": [3, 12], "x": 15.5, "y": 3.25},
{"label": "P5", "matrix": [3, 13], "x": 16.5, "y": 3.25},
{"label": "P6", "matrix": [3, 14], "x": 17.5, "y": 3.25},
{"label": "Shift", "matrix": [4, 0], "x": 0, "y": 4.25, "w": 2.25},
{"label": "Z", "matrix": [4, 1], "x": 2.25, "y": 4.25},
{"label": "X", "matrix": [4, 2], "x": 3.25, "y": 4.25},
{"label": "C", "matrix": [4, 3], "x": 4.25, "y": 4.25},
{"label": "V", "matrix": [4, 4], "x": 5.25, "y": 4.25},
{"label": "B", "matrix": [4, 5], "x": 6.25, "y": 4.25},
{"label": "N", "matrix": [4, 6], "x": 7.25, "y": 4.25},
{"label": "M", "matrix": [4, 7], "x": 8.25, "y": 4.25},
{"label": ",", "matrix": [4, 8], "x": 9.25, "y": 4.25},
{"label": ".", "matrix": [4, 9], "x": 10.25, "y": 4.25},
{"label": "?", "matrix": [4, 10], "x": 11.25, "y": 4.25},
{"label": "Shift", "matrix": [6, 8], "x": 12.25, "y": 4.25, "w": 1.75},
{"label": "Up", "matrix": [4, 11], "x": 14.25, "y": 4.5},
{"label": "P1", "matrix": [4, 12], "x": 15.5, "y": 4.25},
{"label": "P2", "matrix": [4, 13], "x": 16.5, "y": 4.25},
{"label": "P3", "matrix": [4, 14], "x": 17.5, "y": 4.25},
{"label": "PENT", "matrix": [6, 12], "x": 18.5, "y": 4.25, "h": 2.0},
{"label": "Ctrl", "matrix": [5, 0], "x": 0, "y": 5.25, "w": 1.25},
{"label": "Com", "matrix": [5, 1], "x": 1.25, "y": 5.25, "w": 1.25},
{"label": "Alt", "matrix": [6, 1], "x": 2.5, "y": 5.25, "w": 1.25},
{"label": "SPAC1", "matrix": [6, 0], "x": 3.75, "y": 5.25, "w": 3.125, "h": 0.5},
{"label": "SPAC", "matrix": [5, 5], "x": 3.75, "y": 5.75, "w": 6.25, "h":0.5},
{"label": "SPAC2", "matrix": [5, 6], "x": 6.875, "y": 5.25, "w": 3.125, "h":0.5},
{"label": "Alt", "matrix": [5, 9], "x": 10, "y": 5.25},
{"label": "Fn", "matrix": [5, 7], "x": 11, "y": 5.25},
{"label": "Menu", "matrix": [5, 10], "x": 12, "y": 5.25},
{"label": "Left", "matrix": [6, 9], "x": 13.25, "y": 5.5},
{"label": "Down", "matrix": [5, 11], "x": 14.25, "y": 5.5},
{"label": "Right", "matrix": [5, 12], "x": 15.25, "y": 5.5},
{"label": "P0", "matrix": [5, 13], "x": 16.5, "y": 5.25},
{"label": "PDOT", "matrix": [5, 14], "x": 17.5, "y": 5.25}
]
},
"LAYOUT_980_ansi_split_space": {
"layout": [
{"label": "ESC", "matrix": [0, 0], "x": 0, "y": 0},
{"label": "F1", "matrix": [0, 1], "x": 1.5, "y": 0},
{"label": "F2", "matrix": [0, 2], "x": 2.5, "y": 0},
{"label": "F3", "matrix": [0, 3], "x": 3.5, "y": 0},
{"label": "F4", "matrix": [0, 4], "x": 4.5, "y": 0},
{"label": "F5", "matrix": [0, 5], "x": 5.75, "y": 0},
{"label": "F6", "matrix": [0, 6], "x": 6.75, "y": 0},
{"label": "F7", "matrix": [0, 7], "x": 7.75, "y": 0},
{"label": "F8", "matrix": [0, 8], "x": 8.75, "y": 0},
{"label": "F9", "matrix": [0, 9], "x": 10, "y": 0},
{"label": "F10", "matrix": [0, 10], "x": 11, "y": 0},
{"label": "F11", "matrix": [5, 3], "x": 12, "y": 0},
{"label": "F12", "matrix": [5, 4], "x": 13, "y": 0},
{"label": "Mute", "matrix": [0, 11], "x": 14.25, "y": 0},
{"label": "PgUp", "matrix": [0, 12], "x": 15.5, "y": 0},
{"label": "PgDn", "matrix": [0, 13], "x": 16.5, "y": 0},
{"label": "PB", "matrix": [0, 14], "x": 17.5, "y": 0},
{"label": "PrtSc", "matrix": [6, 13], "x": 18.5, "y": 0},
{"label": "~", "matrix": [1, 0], "x": 0, "y": 1.25},
{"label": "1", "matrix": [1, 1], "x": 1, "y": 1.25},
{"label": "2", "matrix": [1, 2], "x": 2, "y": 1.25},
{"label": "3", "matrix": [1, 3], "x": 3, "y": 1.25},
{"label": "4", "matrix": [1, 4], "x": 4, "y": 1.25},
{"label": "5", "matrix": [1, 5], "x": 5, "y": 1.25},
{"label": "6", "matrix": [1, 6], "x": 6, "y": 1.25},
{"label": "7", "matrix": [1, 7], "x": 7, "y": 1.25},
{"label": "8", "matrix": [1, 8], "x": 8, "y": 1.25},
{"label": "9", "matrix": [1, 9], "x": 9, "y": 1.25},
{"label": "0", "matrix": [1, 10], "x": 10, "y": 1.25},
{"label": "-_", "matrix": [6, 3], "x": 11, "y": 1.25},
{"label": "=+", "matrix": [6, 4], "x": 12, "y": 1.25},
{"label": "BS", "matrix": [1, 11], "x": 13, "y": 1.25, "w": 2},
{"label": "NumLk", "matrix": [1, 12], "x": 15.5, "y": 1.25},
{"label": "P/", "matrix": [1, 13], "x": 16.5, "y": 1.25},
{"label": "P*", "matrix": [1, 14], "x": 17.5, "y": 1.25},
{"label": "P-", "matrix": [6, 14], "x": 18.5, "y": 1.25},
{"label": "Tab", "matrix": [2, 0], "x": 0, "y": 2.25, "w": 1.5},
{"label": "Q", "matrix": [2, 1], "x": 1.5, "y": 2.25},
{"label": "W", "matrix": [2, 2], "x": 2.5, "y": 2.25},
{"label": "E", "matrix": [2, 3], "x": 3.5, "y": 2.25},
{"label": "R", "matrix": [2, 4], "x": 4.5, "y": 2.25},
{"label": "T", "matrix": [2, 5], "x": 5.5, "y": 2.25},
{"label": "Y", "matrix": [2, 6], "x": 6.5, "y": 2.25},
{"label": "U", "matrix": [2, 7], "x": 7.5, "y": 2.25},
{"label": "I", "matrix": [2, 8], "x": 8.5, "y": 2.25},
{"label": "O", "matrix": [2, 9], "x": 9.5, "y": 2.25},
{"label": "P", "matrix": [2, 10], "x": 10.5, "y": 2.25},
{"label": "[", "matrix": [6, 5], "x": 11.5, "y": 2.25},
{"label": "]", "matrix": [6, 6], "x": 12.5, "y": 2.25},
{"label": "|", "matrix": [2, 11], "x": 13.5, "y": 2.25, "w": 1.5},
{"label": "P7", "matrix": [2, 12], "x": 15.5, "y": 2.25},
{"label": "P8", "matrix": [2, 13], "x": 16.5, "y": 2.25},
{"label": "P9", "matrix": [2, 14], "x": 17.5, "y": 2.25},
{"label": "P+", "matrix": [6, 11], "x": 18.5, "y": 2.25, "h": 2.0},
{"label": "Cap", "matrix": [3, 0], "x": 0, "y": 3.25, "w": 1.75},
{"label": "A", "matrix": [3, 1], "x": 1.75, "y": 3.25},
{"label": "S", "matrix": [3, 2], "x": 2.75, "y": 3.25},
{"label": "D", "matrix": [3, 3], "x": 3.75, "y": 3.25},
{"label": "F", "matrix": [3, 4], "x": 4.75, "y": 3.25},
{"label": "G", "matrix": [3, 5], "x": 5.75, "y": 3.25},
{"label": "H", "matrix": [3, 6], "x": 6.75, "y": 3.25},
{"label": "J", "matrix": [3, 7], "x": 7.75, "y": 3.25},
{"label": "K", "matrix": [3, 8], "x": 8.75, "y": 3.25},
{"label": "L", "matrix": [3, 9], "x": 9.75, "y": 3.25},
{"label": ";", "matrix": [3, 10], "x": 10.75, "y": 3.25},
{"label": "'", "matrix": [6, 7], "x": 11.75, "y": 3.25},
{"label": "Ent", "matrix": [3, 11], "x": 12.75, "y": 3.25, "w": 2.25},
{"label": "P4", "matrix": [3, 12], "x": 15.5, "y": 3.25},
{"label": "P5", "matrix": [3, 13], "x": 16.5, "y": 3.25},
{"label": "P6", "matrix": [3, 14], "x": 17.5, "y": 3.25},
{"label": "Shift", "matrix": [4, 0], "x": 0, "y": 4.25, "w": 2.25},
{"label": "Z", "matrix": [4, 1], "x": 2.25, "y": 4.25},
{"label": "X", "matrix": [4, 2], "x": 3.25, "y": 4.25},
{"label": "C", "matrix": [4, 3], "x": 4.25, "y": 4.25},
{"label": "V", "matrix": [4, 4], "x": 5.25, "y": 4.25},
{"label": "B", "matrix": [4, 5], "x": 6.25, "y": 4.25},
{"label": "N", "matrix": [4, 6], "x": 7.25, "y": 4.25},
{"label": "M", "matrix": [4, 7], "x": 8.25, "y": 4.25},
{"label": ",", "matrix": [4, 8], "x": 9.25, "y": 4.25},
{"label": ".", "matrix": [4, 9], "x": 10.25, "y": 4.25},
{"label": "?", "matrix": [4, 10], "x": 11.25, "y": 4.25},
{"label": "Shift", "matrix": [6, 8], "x": 12.25, "y": 4.25, "w": 1.75},
{"label": "Up", "matrix": [4, 11], "x": 14.25, "y": 4.5},
{"label": "P1", "matrix": [4, 12], "x": 15.5, "y": 4.25},
{"label": "P2", "matrix": [4, 13], "x": 16.5, "y": 4.25},
{"label": "P3", "matrix": [4, 14], "x": 17.5, "y": 4.25},
{"label": "PENT", "matrix": [6, 12], "x": 18.5, "y": 4.25, "h": 2.0},
{"label": "Ctrl", "matrix": [5, 0], "x": 0, "y": 5.25, "w": 1.25},
{"label": "Com", "matrix": [5, 1], "x": 1.25, "y": 5.25, "w": 1.25},
{"label": "Alt", "matrix": [6, 1], "x": 2.5, "y": 5.25, "w": 1.25},
{"label": "SPAC1", "matrix": [6, 0], "x": 3.75, "y": 5.25, "w": 3.125},
{"label": "SPAC2", "matrix": [5, 6], "x": 6.875, "y": 5.25, "w": 3.125},
{"label": "Alt", "matrix": [5, 9], "x": 10, "y": 5.25},
{"label": "Fn", "matrix": [5, 7], "x": 11, "y": 5.25},
{"label": "Menu", "matrix": [5, 10], "x": 12, "y": 5.25},
{"label": "Left", "matrix": [6, 9], "x": 13.25, "y": 5.5},
{"label": "Down", "matrix": [5, 11], "x": 14.25, "y": 5.5},
{"label": "Right", "matrix": [5, 12], "x": 15.25, "y": 5.5},
{"label": "P0", "matrix": [5, 13], "x": 16.5, "y": 5.25},
{"label": "PDOT", "matrix": [5, 14], "x": 17.5, "y": 5.25}
]
}
}
}

View File

@ -0,0 +1,33 @@
// Copyright 2023 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_all(
KC_ESC, 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_MUTE, KC_SCRL, KC_PAUS, KC_HOME, KC_END,
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_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_MENU, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT
),
[1] = LAYOUT_all(
_______, KC_F14, KC_F15, G(KC_TAB), KC_WSCH, G(C(KC_S)), KC_SLEP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, G(KC_SPC), RCS(KC_SPC), G(RCS(KC_4)), KC_PGUP, KC_PGDN,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_RMOD, RGB_MOD, KC_DEL, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT,
_______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_VAD, RGB_SPI, KC_P0, KC_PDOT
),
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI), ENCODER_CCW_CW(C(KC_WH_D), C(KC_WH_U))},
[1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI), ENCODER_CCW_CW(C(KC_WH_D), C(KC_WH_U))}
};
#endif

View File

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes

View File

@ -0,0 +1,175 @@
// Copyright 2023 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H
int FN_WIN = 0;
int FN_MAC = 0;
int L_WIN = 0;
int L_MAC = 0;
enum layer_names {
_WIN,
_MAC,
_WIN_INDEX,
_MAC_INDEX
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_WIN] = LAYOUT_all(
KC_ESC, 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_MUTE, KC_DEL, KC_PGUP, KC_PGDN, KC_PSCR,
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_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_WIN_INDEX), KC_APP, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT
),
[_MAC] = LAYOUT_all(
KC_ESC, KC_F14, KC_F15, C(KC_UP), G(KC_D), G(KC_SPC), LAG(KC_EJCT), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_DEL, KC_PGUP, KC_PGDN, KC_PSCR,
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_BSPC, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_P7, KC_P8, KC_P9, KC_PPLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT,
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RCMD, MO(_MAC_INDEX), KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT
),
[_WIN_INDEX] = LAYOUT_all(
_______, KC_F14, KC_F15, G(KC_TAB), KC_WSCH, G(C(KC_S)), KC_SLEP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, G(KC_SPC), RCS(KC_SPC), G(RCS(KC_4)), KC_HOME, KC_END,
_______, _______, _______, _______, _______, _______, TO(_WIN), TO(_MAC), _______, _______, RGB_TOG, RGB_RMOD, RGB_MOD, KC_DEL, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT,
KC_LCTL, KC_LGUI, KC_LALT, _______, _______, _______, KC_RALT, _______, KC_APP, RGB_SPD, RGB_VAD, RGB_SPI, KC_P0, KC_PDOT
),
[_MAC_INDEX] = LAYOUT_all(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, G(KC_SPC), RCS(KC_SPC), G(RCS(KC_4)), KC_HOME, KC_END,
_______, _______, _______, _______, _______, _______, TO(_WIN), TO(_MAC), _______, _______, RGB_TOG, RGB_RMOD, RGB_MOD, KC_DEL, KC_NUM, KC_PSLS, KC_PAST, KC_PMNS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PPLS,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT,
KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, KC_RCMD, _______, KC_RALT, RGB_SPD, RGB_VAD, RGB_SPI, KC_P0, KC_PDOT
)
};
#if defined(ENCODER_MAP_ENABLE)
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
[_WIN] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(RGB_SPD, RGB_SPI),ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(C(KC_WH_D), C(KC_WH_U))},
[_MAC] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(G(KC_MINS), G(KC_EQL)), ENCODER_CCW_CW(RGB_SPD, RGB_SPI),ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(C(KC_WH_D), C(KC_WH_U))},
[_WIN_INDEX] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(C(KC_MINS), C(KC_EQL)), ENCODER_CCW_CW(RGB_SPD, RGB_SPI),ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(C(KC_WH_D), C(KC_WH_U))},
[_MAC_INDEX] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(G(KC_MINS), G(KC_EQL)), ENCODER_CCW_CW(RGB_SPD, RGB_SPI),ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(C(KC_WH_D), C(KC_WH_U))}
};
#endif
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
switch (get_highest_layer(layer_state)) {
case 2:{
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
} break;
case 3:{
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
} break;
case 0:{
if (L_WIN) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}else{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
}
} break;
case 1:{
if (L_MAC) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
}else{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}
} break;
default:{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}
}
return true;
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) {
return false;
}
switch (keycode) {
# ifdef RGB_MATRIX_ENABLE
case RGB_TOG:
if (record->event.pressed) {
switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_set_color_all(0, 0, 0);
} break;
default: {
rgb_matrix_set_flags(LED_FLAG_ALL);
} break;
}
}
return false;
case RGB_VAI:
rgb_matrix_set_flags(LED_FLAG_ALL);
return true;
# endif
case TO(0):
if (record->event.pressed) {
L_WIN = 1;
set_single_persistent_default_layer(0); // Save default layer 0 to eeprom
} else {
L_WIN = 0;
}
return true; // continue all further processing of this key
case MO(2):
if (record->event.pressed) {
FN_WIN = 1;
} else {
FN_WIN = 0;
}
return true; // continue all further processing of this key
case TO(1):
if (record->event.pressed) {
L_MAC = 1;
set_single_persistent_default_layer(1); //Save default layer 1 to eeprom
} else {
L_MAC = 0;
}
return true; // continue all further processing of this key
case MO(3):
if (record->event.pressed) {
FN_MAC = 1;
} else {
FN_MAC = 0;
}
return true; // continue all further processing of this key
default:
return true;
}
}

View File

@ -0,0 +1,2 @@
VIA_ENABLE = yes
ENCODER_MAP_ENABLE = yes

View File

@ -0,0 +1,2 @@
CUSTOM_MATRIX = lite
SRC += matrix.c

View File

@ -0,0 +1,29 @@
// Copyright 2023 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define MAC_PIN C13
#define DEBOUNCE 10
#ifdef ENCODER_ENABLE
# define ENCODER_MAP_KEY_DELAY 20
#endif
#ifdef RGB_MATRIX_ENABLE
# define AW20216S_CS_PIN_1 B12
# define AW20216S_CS_PIN_2 B11
// Hardware enable lines may be connected to the same pin
# define AW20216S_EN_PIN_1 B5
# define AW20216S_EN_PIN_2 B5
# define NUM_LOCK_INDEX 31
# define WIN_MOD_INDEX 23
# define MAC_MOD_INDEX 24
# define WIN_LOCK_INDEX 75
# define SCR_LOCK_INDEX 14
# define SDB B5
# define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#endif // RGB_MATRIX_ENABLE

View File

@ -0,0 +1,9 @@
// Copyright 2023 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
#include_next <halconf.h>

View File

@ -0,0 +1,80 @@
{
"manufacturer": "skyloong",
"maintainer": "NaturalZh",
"bootloader": "stm32duino",
"build": {
"debounce_type": "asym_eager_defer_pk"
},
"eeprom": {
"wear_leveling": {
"backing_size": 4096
}
},
"encoder": {
"rotary": [
{"pin_a": "A1", "pin_b": "A0", "resolution": 2},
{"pin_a": "A3", "pin_b": "A2", "resolution": 2},
{"pin_a": "A4", "pin_b": "B0", "resolution": 2},
{"pin_a": "B3", "pin_b": "B1", "resolution": 2},
{"pin_a": "B10", "pin_b": "B4", "resolution": 2}
]
},
"features": {
"bootmagic": true,
"command": true,
"console": false,
"encoder": true,
"extrakey": true,
"mousekey": true,
"nkro": true,
"rgb_matrix": true
},
"indicators": {
"num_lock": "C15",
"on_state": 1,
"caps_lock": "C14"
},
"matrix_pins": {
"cols": [null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
"rows": ["A8", "A9", "A10", "A15", "B6", "B7","B9"]
},
"processor": "STM32F103",
"rgb_matrix": {
"animations": {
"band_spiral_val": true,
"breathing": true,
"cycle_all": true,
"cycle_left_right": true,
"cycle_out_in": true,
"cycle_out_in_dual": true,
"cycle_pinwheel": true,
"cycle_spiral": true,
"cycle_up_down": true,
"digital_rain": true,
"dual_beacon": true,
"jellybean_raindrops": true,
"pixel_rain": true,
"rainbow_moving_chevron": true,
"raindrops": true,
"solid_reactive_multinexus": true,
"solid_reactive_multiwide": true,
"solid_reactive_simple": true,
"solid_splash": true,
"splash": true,
"typing_heatmap": true
},
"driver": "aw20216",
"hue_steps": 20,
"max_brightness": 200,
"sat_steps": 20,
"speed_steps": 20,
"val_steps": 20,
"sleep": true
},
"url": "https://www.skyloong.vip",
"usb": {
"max_power": 380,
"vid": "0x1EA7"
}
}

View File

@ -0,0 +1,166 @@
// Copyright 2023 NaturaZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
//Matrix read rows set col:DIODE_DIRECTION == ROW2COL
#include "quantum.h"
#include "debounce.h"
#define ReadDelayTime 120
#define ClockTime 15
#define MATRIX_INPUT_PRESSED_STATE 0
#define HC595_ST_PIN A6
#define HC595_SH_PIN A5
#define HC595_DS_PIN A7 //定义74HC595的串口数据输入端
/* matrix state(1:on, 0:off) */
extern matrix_row_t raw_matrix[MATRIX_ROWS]; // raw values
extern matrix_row_t matrix[MATRIX_ROWS]; // debounced values
pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
// user-defined overridable functions
__attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter);
static inline void select_delay(uint16_t n) {
while (n-- > 0) {
asm volatile("nop" ::: "memory");
};
}
static inline void setPinOutput_writeLow(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
setPinOutput(pin);
writePinLow(pin);
}
}
static inline void setPinOutput_writeHigh(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
setPinOutput(pin);
writePinHigh(pin);
}
}
static inline void setPinInputHigh_atomic(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
setPinInputHigh(pin);
}
}
static inline uint8_t readMatrixPin(pin_t pin) {
if (pin != NO_PIN) {
return (readPin(pin) == MATRIX_INPUT_PRESSED_STATE) ? 0 : 1;
} else {
return 1;
}
}
static inline void clockPulse(uint16_t n) {
writePinHigh(HC595_SH_PIN);
writePinHigh(HC595_ST_PIN);
select_delay(n);
writePinLow(HC595_SH_PIN);
writePinLow(HC595_ST_PIN);
}
// matrix code
static bool select_col(uint8_t col) {
setPinOutput_writeHigh(HC595_DS_PIN);
for (uint8_t m = 0; m <= col; m++) {
if(m == 0){
writePinLow(HC595_DS_PIN);
}else{
writePinHigh(HC595_DS_PIN);
}
clockPulse(ClockTime);
}
return true;
}
static void unselect_col(uint8_t col) {
uint8_t x = (MATRIX_COLS - col);
setPinOutput_writeHigh(HC595_DS_PIN);
for (uint8_t y = 0; y < x ; y++) {
clockPulse(ClockTime);
}
}
static void unselect_cols(void) {
setPinOutput_writeLow(HC595_SH_PIN);
setPinOutput_writeLow(HC595_ST_PIN);
setPinOutput_writeHigh(HC595_DS_PIN);
for (uint8_t x = 0; x < MATRIX_COLS; x++) {
clockPulse(ClockTime);
}
}
__attribute__((weak)) void matrix_init_pins(void) {
unselect_cols();
for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
if (row_pins[x] != NO_PIN) {
setPinInputHigh_atomic(row_pins[x]);
}
}
}
__attribute__((weak)) void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col, matrix_row_t row_shifter) {
bool key_pressed = false;
// Select col
if (!select_col(current_col)) { // select col
return; // skip NO_PIN col
}
matrix_output_select_delay();
// For each row...
for (uint8_t row_index = 0; row_index < MATRIX_ROWS; row_index++) {
// Check row pin state
if (readMatrixPin(row_pins[row_index]) == 0) {
// Pin LO, set col bit
current_matrix[row_index] |= row_shifter;
key_pressed = true;
} else {
// Pin HI, clear col bit
current_matrix[row_index] &= ~row_shifter;
}
}
// Unselect col
unselect_col(current_col);
matrix_output_unselect_delay(current_col, key_pressed); // wait for all Row signals to go HIGH
}
void matrix_init_custom(void) {
// initialize key pins
matrix_init_pins();
// initialize matrix state: all keys off
memset(matrix, 0, sizeof(matrix));
memset(raw_matrix, 0, sizeof(raw_matrix));
debounce_init(MATRIX_ROWS);
matrix_init_kb();
}
bool matrix_scan_custom(matrix_row_t current_matrix[]) {
matrix_row_t curr_matrix[MATRIX_ROWS] = {0};
// Set col, read rows
matrix_row_t row_shifter = MATRIX_ROW_SHIFTER;
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++, row_shifter <<= 1) {
matrix_read_rows_on_col(curr_matrix, current_col, row_shifter);
}
bool changed = memcmp(raw_matrix, curr_matrix, sizeof(curr_matrix)) != 0;
if (changed) memcpy(raw_matrix, curr_matrix, sizeof(curr_matrix));
changed = debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
matrix_scan_kb();
return (uint8_t)changed;
}

View File

@ -0,0 +1,16 @@
// Copyright 2023 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include_next <mcuconf.h>
#undef STM32_SPI_USE_SPI2
#define STM32_SPI_USE_SPI2 TRUE
#undef STM32_SPI_USE_DMA
#define STM32_SPI_USE_DMA TRUE
#undef STM32_SPI_USE_SPI1
#define STM32_SPI_USE_SPI1 TRUE

View File

@ -0,0 +1,293 @@
// Copyright 2023 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later
#include "quantum.h"
#define MAC_OFF 0x1A //disable mac layer indicator on LED display
#define MAC_ON 0x3B //enable mac layer indicator on LED diaplay
uint8_t IND = 0; //buffer of LED Display
#if defined(RGB_MATRIX_ENABLE) /*&& defined(CAPS_LOCK_INDEX)*/
const aw20216s_led_t PROGMEM g_aw20216s_leds[AW20216S_LED_COUNT] = {
/* Each AW20216 channel is controlled by a register at some offset between 0x00
* and 0xD7 inclusive.
* See drivers/awinic/aw20216.h for the mapping between register offsets and
* driver pin locations.
* driver
* | R location
* | | G location
* | | | B location
* | | | | */
{0, CS1_SW1, CS2_SW1, CS3_SW1},
{0, CS1_SW3, CS2_SW3, CS3_SW3},
{0, CS1_SW4, CS2_SW4, CS3_SW4},
{0, CS1_SW5, CS2_SW5, CS3_SW5},
{0, CS1_SW6, CS2_SW6, CS3_SW6},
{0, CS1_SW7, CS2_SW7, CS3_SW7},
{0, CS1_SW8, CS2_SW8, CS3_SW8},
{0, CS1_SW9, CS2_SW9, CS3_SW9},
{0, CS1_SW10, CS2_SW10, CS3_SW10},
{0, CS1_SW11, CS2_SW11, CS3_SW11},
{0, CS1_SW12, CS2_SW12, CS3_SW12},
{0, CS10_SW2, CS11_SW2, CS12_SW2},
{0, CS10_SW3, CS11_SW3, CS12_SW3},
//encoder no led
{0, CS10_SW5, CS11_SW5, CS12_SW5},
{0, CS10_SW6, CS11_SW6, CS12_SW6},
{0, CS10_SW7, CS11_SW7, CS12_SW7},
{0, CS10_SW8, CS11_SW8, CS12_SW8},
{0, CS4_SW1, CS5_SW1, CS6_SW1},
{0, CS4_SW2, CS5_SW2, CS6_SW2},
{0, CS4_SW3, CS5_SW3, CS6_SW3},
{0, CS4_SW4, CS5_SW4, CS6_SW4},
{0, CS4_SW5, CS5_SW5, CS6_SW5},
{0, CS4_SW6, CS5_SW6, CS6_SW6},
{0, CS4_SW7, CS5_SW7, CS6_SW7},
{0, CS4_SW8, CS5_SW8, CS6_SW8},
{0, CS4_SW9, CS5_SW9, CS6_SW9},
{0, CS4_SW10, CS5_SW10, CS6_SW10},
{0, CS4_SW11, CS5_SW11, CS6_SW11},
{0, CS4_SW12, CS5_SW12, CS6_SW12},
{0, CS13_SW2, CS14_SW2, CS15_SW2},
{0, CS13_SW3, CS14_SW3, CS15_SW3},
{0, CS13_SW4, CS14_SW4, CS15_SW4},
{0, CS13_SW5, CS14_SW5, CS15_SW5},
{0, CS13_SW6, CS14_SW6, CS15_SW6},
{0, CS13_SW7, CS14_SW7, CS15_SW7},
{0, CS7_SW1, CS8_SW1, CS9_SW1},
{0, CS7_SW2, CS8_SW2, CS9_SW2},
{0, CS7_SW3, CS8_SW3, CS9_SW3},
{0, CS7_SW4, CS8_SW4, CS9_SW4},
{0, CS7_SW5, CS8_SW5, CS9_SW5},
{0, CS7_SW6, CS8_SW6, CS9_SW6},
{0, CS7_SW7, CS8_SW7, CS9_SW7},
{0, CS7_SW8, CS8_SW8, CS9_SW8},
{0, CS7_SW9, CS8_SW9, CS9_SW9},
{0, CS7_SW10, CS8_SW10, CS9_SW10},
{0, CS7_SW11, CS8_SW11, CS9_SW11},
{0, CS7_SW12, CS8_SW12, CS9_SW12},
{0, CS16_SW2, CS17_SW2, CS18_SW2},
{0, CS16_SW3, CS17_SW3, CS18_SW3},
{0, CS16_SW4, CS17_SW4, CS18_SW4},
{0, CS16_SW5, CS17_SW5, CS18_SW5},
{0, CS16_SW6, CS17_SW6, CS18_SW6},
{0, CS16_SW7, CS17_SW7, CS18_SW7},
{1, CS1_SW1, CS2_SW1, CS3_SW1},
{1, CS1_SW2, CS2_SW2, CS3_SW2},
{1, CS1_SW3, CS2_SW3, CS3_SW3},
{1, CS1_SW4, CS2_SW4, CS3_SW4},
{1, CS1_SW5, CS2_SW5, CS3_SW5},
{1, CS1_SW6, CS2_SW6, CS3_SW6},
{1, CS1_SW7, CS2_SW7, CS3_SW7},
{1, CS1_SW8, CS2_SW8, CS3_SW8},
{1, CS1_SW9, CS2_SW9, CS3_SW9},
{1, CS1_SW10, CS2_SW10, CS3_SW10},
{1, CS1_SW11, CS2_SW11, CS3_SW11},
{1, CS1_SW12, CS2_SW12, CS3_SW12},
{1, CS10_SW3, CS11_SW3, CS12_SW3},
{1, CS10_SW4, CS11_SW4, CS12_SW4},
{1, CS10_SW5, CS11_SW5, CS12_SW5},
{1, CS10_SW6, CS11_SW6, CS12_SW6},
{1, CS4_SW1, CS5_SW1, CS6_SW1},
{1, CS4_SW2, CS5_SW2, CS6_SW2},
{1, CS4_SW3, CS5_SW3, CS6_SW3},
{1, CS4_SW4, CS5_SW4, CS6_SW4},
{1, CS4_SW5, CS5_SW5, CS6_SW5},
{1, CS4_SW6, CS5_SW6, CS6_SW6},
{1, CS4_SW7, CS5_SW7, CS6_SW7},
{1, CS4_SW8, CS5_SW8, CS6_SW8},
{1, CS4_SW9, CS5_SW9, CS6_SW9},
{1, CS4_SW10, CS5_SW10, CS6_SW10},
{1, CS4_SW11, CS5_SW11, CS6_SW11},
{1, CS13_SW2, CS14_SW2, CS15_SW2},
{1, CS13_SW3, CS14_SW3, CS15_SW3},
{1, CS13_SW4, CS14_SW4, CS15_SW4},
{1, CS13_SW5, CS14_SW5, CS15_SW5},
{1, CS13_SW6, CS14_SW6, CS15_SW6},
{1, CS13_SW7, CS14_SW7, CS15_SW7},
{1, CS7_SW1, CS8_SW1, CS9_SW1},
{1, CS7_SW2, CS8_SW2, CS9_SW2},
{1, CS7_SW3, CS8_SW3, CS9_SW3},
{1, CS7_SW5, CS8_SW5, CS9_SW5},
{1, CS7_SW6, CS8_SW6, CS9_SW6},
{1, CS7_SW8, CS8_SW8, CS9_SW8},
{1, CS7_SW10, CS8_SW10, CS9_SW10},
{1, CS7_SW11, CS8_SW11, CS9_SW11},
{1, CS7_SW12, CS8_SW12, CS9_SW12},
{1, CS16_SW2, CS17_SW2, CS18_SW2},
{1, CS16_SW3, CS17_SW3, CS18_SW3},
{1, CS16_SW4, CS17_SW4, CS18_SW4},
{1, CS16_SW5, CS17_SW5, CS18_SW5},
{1, CS16_SW6, CS17_SW6, CS18_SW6}
};
#endif
void suspend_power_down_kb() {
# ifdef RGB_MATRIX_ENABLE
writePinLow(SDB);
# endif
writePinLow(MAC_PIN);
suspend_power_down_user();
}
void suspend_wakeup_init_kb() {
# ifdef RGB_MATRIX_ENABLE
writePinHigh(SDB);
# endif
suspend_wakeup_init_user();
}
bool shutdown_kb(bool jump_to_bootloader) {
writePinLow(SDB);
return shutdown_user(jump_to_bootloader);
}
layer_state_t default_layer_state_set_kb(layer_state_t state) {
switch (get_highest_layer(state)) {
case 0:
writePinLow(MAC_PIN);
IND =& MAC_OFF;
serial_to_parallel(IND);
break;
case 1:
writePinHigh(MAC_PIN);
IND =|| MAC_ON;
serial_to_parallel(IND);
break;
}
return state;
}
bool rgb_matrix_indicators_advanced_kb(uint8_t led_min, uint8_t led_max) {
if (!rgb_matrix_indicators_advanced_user(led_min, led_max)) {
return false;
}
if (host_keyboard_led_state().caps_lock) {
RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_INDEX, 255, 255, 255);
} else {
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(CAPS_LOCK_INDEX, 0, 0, 0);
}
}
switch (get_highest_layer(layer_state)) {
case 2:{
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
} break;
case 3:{
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
} break;
case 0:{
if (L_WIN) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}else{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
}
} break;
case 1:{
if (L_MAC) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
}else{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}
} break;
default:{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}
}
return false;
}
void board_init(void) {
// JTAG-DP Disabled and SW-DP Disabled
AFIO->MAPR = (AFIO->MAPR & ~AFIO_MAPR_SWJ_CFG_Msk) | AFIO_MAPR_SWJ_CFG_DISABLE;
# ifdef RGB_MATRIX_ENABLE
setPinOutput(SDB);
writePinHigh(SDB);
# endif
setPinOutput(MAC_PIN);
writePinHigh(MAC_PIN);
}
/*
LED display driver
*/
#define ClockTime 15
#define HC595_ST_PIN A6 //74HC595 storage register clock input
#define HC595_SH_PIN A5 //74HC595 shift register clock input
#define HC595_DS A7 // 74HC595 serial data input
static inline void setPinOutput_writeLow(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
setPinOutput(pin);
writePinLow(pin);
}
}
static inline void setPinOutput_writeHigh(pin_t pin) {
ATOMIC_BLOCK_FORCEON {
setPinOutput(pin);
writePinHigh(pin);
}
}
static inline void select_delay(uint16_t n) {
while (n-- > 0) {
asm volatile("nop" ::: "memory");
};
}
static inline void clockPulse(uint16_t n) {
writePinHigh(HC595_SH_PIN);
writePinHigh(HC595_ST_PIN);
select_delay(n);
writePinLow(HC595_SH_PIN);
writePinLow(HC595_ST_PIN);
}
void serial_to_parallel(uint8_t data) { // 串口转并口函数
setPinOutput_writeLow(HC595_DS);
setPinOutput_writeLow(HC595_SH_PIN);
setPinOutput_writeLow(HC595_ST_PIN);
for(uint8_t i = 0; i < 8; i++) { // 循环8次每次输出一位数据
HC595_DS = (data & 0x01); // 将最低位写入串口数据输入端
clockPulse(ClockTime);
data >>= 1; // 将数据右移一位,准备输出下一位数据
}
}

View File

@ -0,0 +1,33 @@
# GK980 Q1 Keyboard
![GK980 Q1](https://i.imgur.com/TYx22dhh.jpg)
## The PCB features:
* QMK & VIA compatibility
* RGB Matrix backlight
* Use PTIR switches instead of mechanical switches to increase the service life and reliability of switches.
The following is the QMK Firmware for the Destop 87% keylayout - designed by Dongguan Jizhi Electronic Technology Co., Ltd
* Keyboard Maintainer: [JZ-Skyloong](https://github.com/JZ-skyloong)
* Hardware Supported: DestopPCB for Skyloong keylayout 85%, STM32F103C8T6
* Hardware Availability: http://www.skyloong.com.cn https://skyloong.vip
Make example for this keyboard (after setting up your build environment):
make skyloong/gk980/q1:default
Flashing example for this keyboard:
make skyloong/gk980/q1:default:flash
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
## Bootloader
Enter the bootloader in 3 ways:
* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available