diff options
author | Michael Stapelberg <stapelberg@users.noreply.github.com> | 2021-06-30 00:54:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 08:54:45 +1000 |
commit | f533d9e033e59d1eb98cc61fdb5f01eeccb827de (patch) | |
tree | d42b8e7d67663a1ead3c5f489cb0a8a94ef7278b | |
parent | 76ed98c51d3aaa972410f3e62bbeccb5d80a5c42 (diff) | |
download | qmk_firmware-f533d9e033e59d1eb98cc61fdb5f01eeccb827de.tar.gz qmk_firmware-f533d9e033e59d1eb98cc61fdb5f01eeccb827de.zip |
add kinT kinesis keyboard controller (kint41 variant) (#13333)
fixes https://github.com/kinx-project/kint/issues/5
-rw-r--r-- | keyboards/kinesis/kinesis.h | 3 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/chconf.h | 33 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/config.h | 105 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/kint41.c | 52 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/kint41.h | 92 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/mcuconf.h | 22 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/readme.md | 3 | ||||
-rw-r--r-- | keyboards/kinesis/kint41/rules.mk | 12 |
8 files changed, 322 insertions, 0 deletions
diff --git a/keyboards/kinesis/kinesis.h b/keyboards/kinesis/kinesis.h index 0833992b8..1635c3443 100644 --- a/keyboards/kinesis/kinesis.h +++ b/keyboards/kinesis/kinesis.h | |||
@@ -16,6 +16,9 @@ | |||
16 | #ifdef KEYBOARD_kinesis_kint36 | 16 | #ifdef KEYBOARD_kinesis_kint36 |
17 | #include "kint36.h" | 17 | #include "kint36.h" |
18 | #endif | 18 | #endif |
19 | #ifdef KEYBOARD_kinesis_kint41 | ||
20 | #include "kint41.h" | ||
21 | #endif | ||
19 | 22 | ||
20 | #include "quantum.h" | 23 | #include "quantum.h" |
21 | 24 | ||
diff --git a/keyboards/kinesis/kint41/chconf.h b/keyboards/kinesis/kint41/chconf.h new file mode 100644 index 000000000..0cd253b95 --- /dev/null +++ b/keyboards/kinesis/kint41/chconf.h | |||
@@ -0,0 +1,33 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | /* | ||
18 | * This file was auto-generated by: | ||
19 | * `qmk chibios-confmigrate -i keyboards/kinesis/kint36/chconf.h -r platforms/chibios/common/configs/chconf.h` | ||
20 | */ | ||
21 | |||
22 | #pragma once | ||
23 | |||
24 | #define CH_CFG_ST_TIMEDELTA 0 | ||
25 | |||
26 | #define CH_CFG_TIME_QUANTUM 20 | ||
27 | |||
28 | // One tick (minimum sleep interval) will be 100 μs. This value cannot be | ||
29 | // increased arbitrarily: chSysTimerHandlerI() must be executed in less than one | ||
30 | // tick as per http://forum.chibios.org/viewtopic.php?t=3712#p27851 | ||
31 | #define CH_CFG_ST_FREQUENCY 10000 | ||
32 | |||
33 | #include_next <chconf.h> | ||
diff --git a/keyboards/kinesis/kint41/config.h b/keyboards/kinesis/kint41/config.h new file mode 100644 index 000000000..c041bbeec --- /dev/null +++ b/keyboards/kinesis/kint41/config.h | |||
@@ -0,0 +1,105 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | /* USB Device descriptor parameter */ | ||
20 | #undef VENDOR_ID | ||
21 | #define VENDOR_ID 0x1209 | ||
22 | #undef PRODUCT_ID | ||
23 | #define PRODUCT_ID 0x345C | ||
24 | #undef DEVICE_VER | ||
25 | #define DEVICE_VER 0x0001 | ||
26 | #undef MANUFACTURER | ||
27 | #define MANUFACTURER "https://github.com/stapelberg" | ||
28 | #undef PRODUCT | ||
29 | #define PRODUCT "kinT (kint41)" | ||
30 | |||
31 | /* key matrix size */ | ||
32 | #define MATRIX_ROWS 15 | ||
33 | #define MATRIX_COLS 7 | ||
34 | |||
35 | /* | ||
36 | * Keyboard Matrix Assignments | ||
37 | * | ||
38 | * Change this to how you wired your keyboard | ||
39 | * COLS: AVR pins used for columns, left to right | ||
40 | * ROWS: AVR pins used for rows, top to bottom | ||
41 | * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) | ||
42 | * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) | ||
43 | * | ||
44 | */ | ||
45 | #define MATRIX_ROW_PINS \ | ||
46 | { \ | ||
47 | LINE_PIN8, /* ROW_EQL */ \ | ||
48 | LINE_PIN9, /* ROW_1 */ \ | ||
49 | LINE_PIN10, /* ROW_2 */ \ | ||
50 | LINE_PIN11, /* ROW_3 */ \ | ||
51 | LINE_PIN7, /* ROW_4 */ \ | ||
52 | LINE_PIN16, /* ROW_5 */ \ | ||
53 | LINE_PIN5, /* ROW_6 */ \ | ||
54 | LINE_PIN3, /* ROW_7 */ \ | ||
55 | LINE_PIN4, /* ROW_8 */ \ | ||
56 | LINE_PIN1, /* ROW_9 */ \ | ||
57 | LINE_PIN0, /* ROW_0 */ \ | ||
58 | LINE_PIN2, /* ROW_MIN */ \ | ||
59 | LINE_PIN17, /* ROW_ESC */ \ | ||
60 | LINE_PIN23, /* ROW_F1 */ \ | ||
61 | LINE_PIN21, /* ROW_F2 */ \ | ||
62 | } | ||
63 | |||
64 | #define MATRIX_COL_PINS \ | ||
65 | { \ | ||
66 | LINE_PIN18, /* COL_0 */ \ | ||
67 | LINE_PIN14, /* COL_1 */ \ | ||
68 | LINE_PIN15, /* COL_2 */ \ | ||
69 | LINE_PIN20, /* COL_3 */ \ | ||
70 | LINE_PIN22, /* COL_4 */ \ | ||
71 | LINE_PIN19, /* COL_5 */ \ | ||
72 | LINE_PIN6 /* COL_6 */ \ | ||
73 | } | ||
74 | |||
75 | #define UNUSED_PINS | ||
76 | |||
77 | /* COL2ROW or ROW2COL */ | ||
78 | #define DIODE_DIRECTION COL2ROW | ||
79 | |||
80 | /* Well-worn Cherry MX key switches can bounce for up to 20ms, despite the | ||
81 | * Cherry data sheet specifying 5ms. Because we use the sym_eager_pk debounce | ||
82 | * algorithm, this debounce latency only affects key releases (not key | ||
83 | * presses). */ | ||
84 | #undef DEBOUNCE | ||
85 | #define DEBOUNCE 20 | ||
86 | |||
87 | #define IGNORE_MOD_TAP_INTERRUPT | ||
88 | |||
89 | // Reduce input latency by lowering the USB polling interval | ||
90 | // from its 10ms default to the 125μs minimum that USB 2.x (High Speed) allows: | ||
91 | #define USB_POLLING_INTERVAL_MS 1 | ||
92 | |||
93 | /* We use the i.MX RT1060 high-speed GPIOs (GPIO6-9) which are connected to the | ||
94 | * AHB bus (AHB_CLK_ROOT), which runs at the same speed as the ARM Core Clock, | ||
95 | * i.e. 600 MHz. See MIMXRT1062, page 949, 12.1 Chip-specific GPIO information. | ||
96 | * No additional delay is necessary. */ | ||
97 | |||
98 | // in clock cycles | ||
99 | #define GPIO_INPUT_PIN_DELAY 0 | ||
100 | |||
101 | #define LED_PIN_ON_STATE 0 | ||
102 | #define LED_NUM_LOCK_PIN LINE_PIN26 | ||
103 | #define LED_CAPS_LOCK_PIN LINE_PIN12 | ||
104 | #define LED_SCROLL_LOCK_PIN LINE_PIN25 | ||
105 | #define LED_COMPOSE_PIN LINE_PIN24 | ||
diff --git a/keyboards/kinesis/kint41/kint41.c b/keyboards/kinesis/kint41/kint41.c new file mode 100644 index 000000000..e23a639f9 --- /dev/null +++ b/keyboards/kinesis/kint41/kint41.c | |||
@@ -0,0 +1,52 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | #include "kint41.h" | ||
18 | |||
19 | void matrix_init_kb(void) { | ||
20 | matrix_init_user(); | ||
21 | |||
22 | // Turn on the Teensy 4.x Power LED: | ||
23 | #define LED_POWER LINE_PIN13 | ||
24 | setPinOutput(LED_POWER); | ||
25 | writePinHigh(LED_POWER); | ||
26 | } | ||
27 | |||
28 | // delay_inline sleeps for |cycles| (e.g. sleeping for F_CPU will sleep 1s). | ||
29 | // delay_inline assumes the cycle counter has already been initialized and | ||
30 | // should not be modified, i.e. it is safe to call during keyboard matrix scan. | ||
31 | // | ||
32 | // ChibiOS enables the cycle counter in chcore_v7m.c: | ||
33 | // https://github.com/ChibiOS/ChibiOS/blob/b63023915c304092acb9f33bbab40f3ec07a7f0e/os/common/ports/ARMCMx/chcore_v7m.c#L263 | ||
34 | static void delay_inline(const uint32_t cycles) { | ||
35 | const uint32_t start = DWT->CYCCNT; | ||
36 | while ((DWT->CYCCNT - start) < cycles) { | ||
37 | // busy-loop until time has passed | ||
38 | } | ||
39 | } | ||
40 | |||
41 | void matrix_output_unselect_delay(void) { | ||
42 | // Use the cycle counter to do precise timing in microseconds. The ChibiOS | ||
43 | // thread sleep functions only allow sleep durations starting at 1 tick, which | ||
44 | // is 100μs in our configuration. | ||
45 | |||
46 | // Empirically: e.g. 5μs is not enough, will result in keys that don’t work | ||
47 | // and ghost key presses. 10μs seems to work well. | ||
48 | |||
49 | // 600 cycles at 0.6 cycles/ns == 1μs | ||
50 | const uint32_t cycles_per_us = 600; | ||
51 | delay_inline(10 * cycles_per_us); | ||
52 | } | ||
diff --git a/keyboards/kinesis/kint41/kint41.h b/keyboards/kinesis/kint41/kint41.h new file mode 100644 index 000000000..d427a1c2d --- /dev/null +++ b/keyboards/kinesis/kint41/kint41.h | |||
@@ -0,0 +1,92 @@ | |||
1 | /* Copyright 2020 QMK | ||
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 | #include "quantum.h" | ||
20 | |||
21 | #define ___ KC_NO | ||
22 | |||
23 | // This a shortcut to help you visually see your layout. | ||
24 | // The first section contains all of the arguments as on the physical keyboard | ||
25 | // The second converts the arguments into the 2-D scanned array | ||
26 | |||
27 | #define LAYOUT( \ | ||
28 | kC0, kD0, kE0, kC1, kD1, kE1, kC2, kD2, kE2, \ | ||
29 | k00, k10, k20, k30, k40, k50, \ | ||
30 | k01, k11, k21, k31, k41, k51, \ | ||
31 | k02, k12, k22, k32, k42, k52, \ | ||
32 | k03, k13, k23, k33, k43, k53, \ | ||
33 | k14, k24, k34, k54, \ | ||
34 | k56, k55, \ | ||
35 | k35, \ | ||
36 | k36, k46, k25, \ | ||
37 | \ | ||
38 | kC3, kD3, kE3, kC4, kD4, kE4, kC5, kE5, kD5, \ | ||
39 | k60, k70, k80, k90, kA0, kB0, \ | ||
40 | k61, k71, k81, k91, kA1, kB1, \ | ||
41 | k62, k72, k82, k92, kA2, kB2, \ | ||
42 | k63, k73, k83, k93, kA3, kB3, \ | ||
43 | k64, k84, k94, kA4, \ | ||
44 | k96, k85, \ | ||
45 | k86, \ | ||
46 | k66, k75, k65 \ | ||
47 | ) { \ | ||
48 | { k00, k01, k02, k03, ___, ___, ___ }, \ | ||
49 | { k10, k11, k12, k13, k14, ___, ___ }, \ | ||
50 | { k20, k21, k22, k23, k24, k25, ___ }, \ | ||
51 | { k30, k31, k32, k33, k34, k35, k36 }, \ | ||
52 | { k40, k41, k42, k43, ___, ___, k46 }, \ | ||
53 | { k50, k51, k52, k53, k54, k55, k56 }, \ | ||
54 | { k60, k61, k62, k63, k64, k65, k66 }, \ | ||
55 | { k70, k71, k72, k73, ___, k75, ___ }, \ | ||
56 | { k80, k81, k82, k83, k84, k85, k86 }, \ | ||
57 | { k90, k91, k92, k93, k94, ___, k96 }, \ | ||
58 | { kA0, kA1, kA2, kA3, kA4, ___, ___ }, \ | ||
59 | { kB0, kB1, kB2, kB3, ___, ___, ___ }, \ | ||
60 | { kC0, kC1, kC2, kC3, kC4, kC5, ___ }, \ | ||
61 | { kD0, kD1, kD2, kD3, kD4, kD5, ___ }, \ | ||
62 | { kE0, kE1, kE2, kE3, kE4, kE5, ___ }, \ | ||
63 | } | ||
64 | |||
65 | /* ---------------- LEFT HAND ----------------- ---------------- RIGHT HAND ---------------- */ | ||
66 | #define LAYOUT_pretty( \ | ||
67 | kC0, kD0, kE0, kC1, kD1, kE1, kC2, kD2, kE2, kC3, kD3, kE3, kC4, kD4, kE4, kC5, kE5, kD5, \ | ||
68 | k00, k10, k20, k30, k40, k50, k60, k70, k80, k90, kA0, kB0, \ | ||
69 | k01, k11, k21, k31, k41, k51, k61, k71, k81, k91, kA1, kB1, \ | ||
70 | k02, k12, k22, k32, k42, k52, k62, k72, k82, k92, kA2, kB2, \ | ||
71 | k03, k13, k23, k33, k43, k53, k63, k73, k83, k93, kA3, kB3, \ | ||
72 | k14, k24, k34, k54, k64, k84, k94, kA4, \ | ||
73 | k56, k55, k96, k85, \ | ||
74 | k35, k86, \ | ||
75 | k36, k46, k25, k66, k75, k65 \ | ||
76 | ) { \ | ||
77 | { k00, k01, k02, k03, ___, ___, ___ }, \ | ||
78 | { k10, k11, k12, k13, k14, ___, ___ }, \ | ||
79 | { k20, k21, k22, k23, k24, k25, ___ }, \ | ||
80 | { k30, k31, k32, k33, k34, k35, k36 }, \ | ||
81 | { k40, k41, k42, k43, ___, ___, k46 }, \ | ||
82 | { k50, k51, k52, k53, k54, k55, k56 }, \ | ||
83 | { k60, k61, k62, k63, k64, k65, k66 }, \ | ||
84 | { k70, k71, k72, k73, ___, k75, ___ }, \ | ||
85 | { k80, k81, k82, k83, k84, k85, k86 }, \ | ||
86 | { k90, k91, k92, k93, k94, ___, k96 }, \ | ||
87 | { kA0, kA1, kA2, kA3, kA4, ___, ___ }, \ | ||
88 | { kB0, kB1, kB2, kB3, ___, ___, ___ }, \ | ||
89 | { kC0, kC1, kC2, kC3, kC4, kC5, ___ }, \ | ||
90 | { kD0, kD1, kD2, kD3, kD4, kD5, ___ }, \ | ||
91 | { kE0, kE1, kE2, kE3, kE4, kE5, ___ } \ | ||
92 | } | ||
diff --git a/keyboards/kinesis/kint41/mcuconf.h b/keyboards/kinesis/kint41/mcuconf.h new file mode 100644 index 000000000..1ab5054ff --- /dev/null +++ b/keyboards/kinesis/kint41/mcuconf.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2006..2015 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 | #define MIMXRT1062_MCUCONF | ||
21 | |||
22 | #endif /* _MCUCONF_H_ */ | ||
diff --git a/keyboards/kinesis/kint41/readme.md b/keyboards/kinesis/kint41/readme.md new file mode 100644 index 000000000..90781dc97 --- /dev/null +++ b/keyboards/kinesis/kint41/readme.md | |||
@@ -0,0 +1,3 @@ | |||
1 | # kinesis_kint41 keyboard firmware | ||
2 | |||
3 | Please see https://github.com/kinx-project/kint for details. | ||
diff --git a/keyboards/kinesis/kint41/rules.mk b/keyboards/kinesis/kint41/rules.mk new file mode 100644 index 000000000..4d77da427 --- /dev/null +++ b/keyboards/kinesis/kint41/rules.mk | |||
@@ -0,0 +1,12 @@ | |||
1 | MCU_FAMILY = MIMXRT1062 | ||
2 | MCU_SERIES = MIMXRT1062 | ||
3 | MCU_LDSCRIPT = MIMXRT1062 | ||
4 | MCU_STARTUP = MIMXRT1062 | ||
5 | BOARD = IC_TEENSY_4_1 | ||
6 | MCU = cortex-m4 | ||
7 | ARMV = 7 | ||
8 | |||
9 | # Debounce eagerly (report change immediately), keep per-key timers. We can use | ||
10 | # this because the Cherry MX keyswitches on the Kinesis only produce noise while | ||
11 | # pressed. | ||
12 | DEBOUNCE_TYPE = sym_eager_pk | ||