mirror of
https://github.com/qmk/qmk_firmware
synced 2025-01-04 22:13:04 +00:00
Compare commits
41 Commits
4b2266ffb7
...
7f063c444a
Author | SHA1 | Date | |
---|---|---|---|
|
7f063c444a | ||
|
57f89e5388 | ||
|
53680fa6da | ||
|
fe2200f73a | ||
|
fd0a552fc1 | ||
|
a81f7efe3d | ||
|
c88e43b645 | ||
|
7092b751d9 | ||
|
d7017d7b3b | ||
|
d53e767697 | ||
|
9f0b6d77e1 | ||
|
fbc343dad1 | ||
|
43af4f2ba7 | ||
|
ea28ab5cd2 | ||
|
f5915317ef | ||
|
e176cc6344 | ||
|
a0f23ff2ec | ||
|
e8143c933f | ||
|
5c46bb17d6 | ||
|
41f2eb91ae | ||
|
e0b03ea1ec | ||
|
7367ed305a | ||
|
7d58907550 | ||
|
eec663a993 | ||
|
c95d99264b | ||
|
74930d9876 | ||
|
3648b623bd | ||
|
cc0c8deec8 | ||
|
867d79b1e5 | ||
|
1eb680baf3 | ||
|
684a3dcb7e | ||
|
d1af7b14a3 | ||
|
7fac33afa5 | ||
|
95c3f4ae80 | ||
|
db3a0c5503 | ||
|
8989f16079 | ||
|
8ef8e6eb33 | ||
|
edbe9ab0e0 | ||
|
240d8a771a | ||
|
aea1b355ea | ||
|
26b0526b45 |
8
keyboards/chill/ghoul/chconf.h
Normal file
8
keyboards/chill/ghoul/chconf.h
Normal file
@ -0,0 +1,8 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CH_CFG_ST_RESOLUTION 16
|
||||
#define CH_CFG_ST_FREQUENCY 10000
|
||||
|
||||
#include_next <chconf.h>
|
7
keyboards/chill/ghoul/config.h
Normal file
7
keyboards/chill/ghoul/config.h
Normal file
@ -0,0 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#define BACKLIGHT_PWM_DRIVER PWMD2
|
||||
#define BACKLIGHT_PWM_CHANNEL 2
|
||||
#define BACKLIGHT_PAL_MODE 2
|
7
keyboards/chill/ghoul/halconf.h
Normal file
7
keyboards/chill/ghoul/halconf.h
Normal file
@ -0,0 +1,7 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_PWM TRUE
|
||||
|
||||
#include_next <halconf.h>
|
408
keyboards/chill/ghoul/keyboard.json
Normal file
408
keyboards/chill/ghoul/keyboard.json
Normal file
File diff suppressed because it is too large
Load Diff
24
keyboards/chill/ghoul/keymaps/default/keymap.c
Normal file
24
keyboards/chill/ghoul/keymaps/default/keymap.c
Normal file
@ -0,0 +1,24 @@
|
||||
/* 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_PSCR, KC_SCRL, KC_PAUS,
|
||||
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_BSPC, KC_INS, KC_HOME, KC_PGUP,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
_______, KC_VOLU, KC_VOLD, KC_MUTE, _______, KC_MPRV, KC_MPLY, KC_MSTP, KC_MNXT, _______, _______, _______, KC_SLEP, _______, _______, _______,
|
||||
BL_TOGG, BL_UP, BL_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
11
keyboards/chill/ghoul/mcuconf.h
Normal file
11
keyboards/chill/ghoul/mcuconf.h
Normal file
@ -0,0 +1,11 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#pragma once
|
||||
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_PWM_USE_TIM2
|
||||
#define STM32_PWM_USE_TIM2 TRUE
|
||||
|
||||
#undef STM32_ST_USE_TIMER
|
||||
#define STM32_ST_USE_TIMER 14
|
27
keyboards/chill/ghoul/readme.md
Normal file
27
keyboards/chill/ghoul/readme.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Ghoul TKL
|
||||
|
||||
![image](https://i.imgur.com/Y39mNA4.jpeg)
|
||||
|
||||
A modern replacement PCB for Filco TKLs, adding support for PCB-mount stabilizers and popular alternate layouts. In-switch backlight LEDs are also supported.
|
||||
|
||||
* Keyboard Maintainer: [chillKB](https://github.com/chillKB)
|
||||
* Hardware Supported: Ghoul TKL PCB
|
||||
* Hardware Availability: [Open source on GitHub](https://github.com/chillKB/ghoulTKL)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make chill/ghoul:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make chill/ghoul: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 top left key (usually Escape) and plug in the keyboard
|
||||
* **Physical reset button**: Hold the boot button and tap the reset button on the back of the PCB
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
@ -119,8 +119,7 @@
|
||||
"solid_reactive_multinexus": true,
|
||||
"solid_splash": true,
|
||||
"wave_left_right": true,
|
||||
"wave_up_down": true,
|
||||
"effect_max": true
|
||||
"wave_up_down": true
|
||||
},
|
||||
"layout": [
|
||||
{"matrix":[0, 0], "flags":1, "x":0, "y":0},
|
||||
|
@ -136,8 +136,7 @@
|
||||
"solid_reactive_multinexus": true,
|
||||
"solid_splash": true,
|
||||
"wave_left_right": true,
|
||||
"wave_up_down": true,
|
||||
"effect_max": true
|
||||
"wave_up_down": true
|
||||
},
|
||||
"layout": [
|
||||
{"matrix":[0, 0], "flags":1, "x":0, "y":0},
|
||||
|
6
keyboards/model_f_labs/f62/info.json
Normal file
6
keyboards/model_f_labs/f62/info.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"manufacturer": "Model F Labs",
|
||||
"keyboard_name": "Reproduction IBM F62 Keyboard",
|
||||
"maintainer": "Purdea Andrei",
|
||||
"url": "https://www.modelfkeyboards.com/"
|
||||
}
|
87
keyboards/model_f_labs/f62/keymaps/default/keymap.c
Normal file
87
keyboards/model_f_labs/f62/keymaps/default/keymap.c
Normal file
@ -0,0 +1,87 @@
|
||||
/* Copyright 2022 Matthew J Wolf
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -----
|
||||
* Based on F62_-_HHKB_-_Split_Backspace.json from Joe of Model F Labs
|
||||
*/
|
||||
/* all
|
||||
* - Base
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
|
||||
* │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ + │ \ │ ` │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤
|
||||
* │Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬────│
|
||||
* │Lctl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ # │Ent │
|
||||
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤
|
||||
* │Lsft│ \ │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ Rsft │Fn1│
|
||||
* ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴─┬─┴──┬┴───┴┬───┬─┴───┤
|
||||
* │Caps │GUI│Lalt │ Space │ │Ratl │Nlk│Rctl │
|
||||
* └─────┴───┴─────┴──────────────────────┴────┴─────┴───┴─────┘
|
||||
* - FN1
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
|
||||
* │ ` │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Ins│Del│
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤
|
||||
* │ │ │ │ │ │ │ │ │Psc│Skl│Pau│Up │ │Del │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬────│
|
||||
* │ │Vo-│Vo+│Mut│Ejc│ │Kp*│Kp/│Hom│PGu│Lef│Rgh│ │ │
|
||||
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤
|
||||
* │ │ │ │ │ │ │ │Kp+│Kp-│End│PGd│Dow│ │ │
|
||||
* ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴─┬─┴──┬┴───┴┬───┬─┴───┤
|
||||
* │ │ │ │ Fn2 │ │ │ │ │
|
||||
* └─────┴───┴─────┴──────────────────────┴────┴─────┴───┴─────┘
|
||||
* - FN2
|
||||
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │Dl-│Dl+│ │ │
|
||||
* ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤
|
||||
* │ │ │ │Epr│Res│HPt│ │ │ │ │ │ │ │ │
|
||||
* ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬────│
|
||||
* │ │ │ │Deb│ │ │ │ │ │ │ │ │ │ │
|
||||
* ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┤
|
||||
* │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
|
||||
* ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴─┬─┴──┬┴───┴┬───┬─┴───┤
|
||||
* │ │ │ │ │ │ │ │ │
|
||||
* └─────┴───┴─────┴──────────────────────┴────┴─────┴───┴─────┘
|
||||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum layer_names {
|
||||
_BASE,
|
||||
_FN1,
|
||||
_FN2
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_BASE] = LAYOUT_all(
|
||||
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC,
|
||||
KC_LCTL, 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,
|
||||
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, MO(_FN1),
|
||||
KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, _______, KC_RALT, KC_NUM, KC_RCTL
|
||||
),
|
||||
[_FN1] = LAYOUT_all(
|
||||
KC_GRV, 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_INS, KC_DEL,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, KC_UP, _______, KC_DEL,
|
||||
_______, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______,
|
||||
_______, _______, _______, MO(_FN2), _______, _______, _______, _______
|
||||
),
|
||||
[_FN2] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, HF_DWLD,HF_DWLU, _______, _______,
|
||||
_______, _______, _______, EE_CLR, QK_BOOT, HF_TOGG, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, DB_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
3
keyboards/model_f_labs/f62/keymaps/default/readme.md
Normal file
3
keyboards/model_f_labs/f62/keymaps/default/readme.md
Normal file
@ -0,0 +1,3 @@
|
||||
# A keymap for model_f_labs/f62/$(CONTROLLER)
|
||||
|
||||
Keymap for the HHKB Split Shift and Split Backspace.
|
35
keyboards/model_f_labs/f62/readme.md
Normal file
35
keyboards/model_f_labs/f62/readme.md
Normal file
@ -0,0 +1,35 @@
|
||||
# model_f_labs/f62
|
||||
|
||||
![model_f_labs/f62](https://images2.imgbox.com/e5/97/1hPUzXct_o.jpg)
|
||||
|
||||
A short description of the keyboard/project
|
||||
|
||||
* Keyboard Maintainer: [Purdea Andrei](https://github.com/purdeaandrei)
|
||||
* Build Maintainer: Matthew J Wolf
|
||||
* Hardware Supported: Supports the brand new Model F reproductions from https://www.modelfkeyboards.com/, using the smaller xwhatsit controller developed by wcass.
|
||||
* Hardware Availability: https://www.modelfkeyboards.com/
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make model_f_labs/f62:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
|
||||
## How do you enter the boot loader?
|
||||
|
||||
There are three ways to enter the boot loader.
|
||||
* **Command**: At the same time hold down both shift key and the B key.
|
||||
Left Shift + Right Shift + B
|
||||
* **Keycode in Layout**: Press the key mapped to `QK_BOOT`.
|
||||
The default location is the R key on the second layer.
|
||||
FN + Spacebar + R
|
||||
* **Physical Reset PCB Pad**: Short pads of the PCB.
|
||||
The description and image below are from the
|
||||
Model F Labs manual web page.
|
||||
|
||||
At the very worst you have to open up the keyboard to short PROG on the actual xwhatsit controller (unscrew the 2 controller screws to see the components side of the board, make a connection with a conductive metal object like an uncoated metal paper clip, then connect the USB cable to the controller and within a split second remove the paper clip). Per pandrew: “You might think that a screwdriver is gonna be enough, but due to surface oxidation it is likely not gonna be good enough. I like to use sharp metal tweezers, because they can dig into the pad a little bit, breaking up the surface oxidation, and I can actually be sure it’s shorting. Apply constant strong pressure on the pads while plugging in the keyboard to make sure they’re perfectly shorted. If you hear the windows USB plug-in sound (assuming the sound effect is enabled), then you know you have succeeded. I’ve even seen people tell me they tried everything to short the pads with, and then I asked them to solder the pads together and it suddenly works. There’s something about the size of those pads, or about the fact that they need to be shorted in the perfect moment when the chip leaves reset, that make people think they are perfectly shorted and yet they aren’t. This affects me too, sometimes it takes me up to 3 tries to get it into bootloader mode. Another thing to double check that you are indeed shorting the PROG pad and not the reset pad. I believe in some versions of the wcass controller there is a reset pad on the opposite side of the board. So don’t be like ‘I see some pads, those must be it’, make sure to be shorting the correct ones.” [1]
|
||||
|
||||
![PCB PADS](https://images2.imgbox.com/ef/20/C9zUfX1h_o.jpg)
|
||||
|
||||
1. “Brand New Model F and Beam Spring keyboards manual,” Brand New Model F Keyboards, https://www.modelfkeyboards.com/manual/ (accessed Mar. 16, 2024).
|
2
keyboards/model_f_labs/f62/rules.mk
Normal file
2
keyboards/model_f_labs/f62/rules.mk
Normal file
@ -0,0 +1,2 @@
|
||||
DEFAULT_FOLDER = model_f_labs/f62/wcass
|
||||
# Brand new model f keyboards by default come with the wcass controller.
|
117
keyboards/model_f_labs/f62/wcass/config.h
Normal file
117
keyboards/model_f_labs/f62/wcass/config.h
Normal file
@ -0,0 +1,117 @@
|
||||
/*
|
||||
Copyright 2020 Purdea Andrei
|
||||
Copyright 2021-2023 Matthew J Wolf
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 8
|
||||
#define MATRIX_COLS 9
|
||||
// Note: physical column are 16, but only 11 are ever used. Column 0..9 match the physical column. Column 10 is physical column 15.
|
||||
|
||||
/*
|
||||
* Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
|
||||
*/
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
#define HOLD_ON_OTHER_KEY_PRESS
|
||||
|
||||
/* XWHATSIT CONTROLLER TYPE */
|
||||
#define CONTROLLER_IS_XWHATSIT_MODEL_F_OR_WCASS_MODEL_F
|
||||
|
||||
#define CAPSENSE_KEYBOARD_SETTLE_TIME_US 8
|
||||
#define CAPSENSE_DAC_SETTLE_TIME_US 8
|
||||
#define CAPSENSE_HARDCODED_SAMPLE_TIME 4
|
||||
|
||||
#define CAPSENSE_CAL_ENABLED 1
|
||||
#define CAPSENSE_CAL_DEBUG 0
|
||||
#define CAPSENSE_CAL_INIT_REPS 16
|
||||
#define CAPSENSE_CAL_EACHKEY_REPS 16
|
||||
#define CAPSENSE_CAL_BINS 5
|
||||
#define CAPSENSE_CAL_THRESHOLD_OFFSET 24
|
||||
|
||||
#if !CAPSENSE_CAL_ENABLED
|
||||
#define CAPSENSE_HARDCODED_THRESHOLD 142
|
||||
#endif
|
||||
|
||||
#define CAPSENSE_KEYMAP_COL_TO_PHYSICAL_COL(col) (((col) == 8)?15:(col))
|
||||
|
||||
// By default we set up for support of xwhatsit's solenoid driver board.
|
||||
// Comment out HAPTIC_ENABLE_PIN if you don't have an enable pin:
|
||||
#define HAPTIC_ENABLE_PIN B7
|
||||
// We disable haptic feedbeck during USB low power conditions:
|
||||
#define HAPTIC_OFF_IN_LOW_POWER 1
|
||||
// Change this if you are using a different pin for the solenoid:
|
||||
#define SOLENOID_PIN B6
|
||||
// If you are not using a solenoid then comment out the above, and also in rules.mk, remove "HAPTIC_ENABLE += SOLENOID"
|
||||
// You can also tune the following for your solenoid:
|
||||
#define SOLENOID_DEFAULT_DWELL 4
|
||||
#define SOLENOID_MIN_DWELL 4
|
||||
#define NO_HAPTIC_MOD
|
||||
|
||||
// ----- xwhatsit hardware configuration (type_f) -----
|
||||
|
||||
#define CAPSENSE_DAC_SCLK B1
|
||||
#define CAPSENSE_DAC_DIN B2
|
||||
#define CAPSENSE_DAC_SYNC_N B0
|
||||
#define CAPSENSE_DAC_MAX 1023
|
||||
|
||||
#define CAPSENSE_SHIFT_DIN D4
|
||||
#define CAPSENSE_SHIFT_OE D5
|
||||
#define CAPSENSE_SHIFT_SHCP D7
|
||||
#define CAPSENSE_SHIFT_STCP D6
|
||||
#define CAPSENSE_SHIFT_STCP_IO _SFR_IO_ADDR(PORTD)
|
||||
#define CAPSENSE_SHIFT_STCP_BIT 6
|
||||
|
||||
#define SETUP_ROW_GPIOS() \
|
||||
do { \
|
||||
PORTC |= 0xF0; \
|
||||
PORTD |= 0x0F; \
|
||||
} while (0)
|
||||
|
||||
#define SETUP_UNUSED_PINS() do {} while (0)
|
||||
|
||||
#define CAPSENSE_READ_ROWS_NUMBER_OF_BYTES_PER_SAMPLE 2
|
||||
#define CAPSENSE_READ_ROWS_PIN_1 _SFR_IO_ADDR(PINC)
|
||||
#define CAPSENSE_READ_ROWS_PIN_2 _SFR_IO_ADDR(PIND)
|
||||
#define CAPSENSE_READ_ROWS_ASM_INSTRUCTIONS "in %[dest_row_1], %[ioreg_row_1]\n\tin %[dest_row_2], %[ioreg_row_2]"
|
||||
#define CAPSENSE_READ_ROWS_STORE_TO_ARRAY_INSTRUCTIONS \
|
||||
"st %a[arr]+, %[dest_row_1]" "\n\t" \
|
||||
"st %a[arr]+, %[dest_row_2]"
|
||||
#define CAPSENSE_READ_ROWS_STORE_TO_ARRAY_INSTRUCTIONS_FAKE \
|
||||
"st %a[arr], %[dest_row_1]" "\n\t" \
|
||||
"st %a[arr], %[dest_row_2]"
|
||||
#define CAPSENSE_READ_ROWS_OUTPUT_CONSTRAINTS [dest_row_1] "=&r" (dest_row_1), [dest_row_2] "=&r" (dest_row_2)
|
||||
#define CAPSENSE_READ_ROWS_INPUT_CONSTRAINTS [ioreg_row_1] "I" (CAPSENSE_READ_ROWS_PIN_1), [ioreg_row_2] "I" (CAPSENSE_READ_ROWS_PIN_2)
|
||||
#define CAPSENSE_READ_ROWS_LOCAL_VARS uint8_t dest_row_1, dest_row_2
|
||||
#define CAPSENSE_READ_ROWS_EXTRACT_FROM_ARRAY do { dest_row_1 = array[p0++]; dest_row_2 = array[p0++]; } while (0)
|
||||
|
||||
#if (!defined(CAPSENSE_CONDUCTIVE_PLASTIC_IS_PUSHED_DOWN_ON_KEYPRESS)) && (!defined(CAPSENSE_CONDUCTIVE_PLASTIC_IS_PULLED_UP_ON_KEYPRESS))
|
||||
#define CAPSENSE_CONDUCTIVE_PLASTIC_IS_PUSHED_DOWN_ON_KEYPRESS
|
||||
#endif
|
||||
#define CAPSENSE_KEYMAP_ROW_TO_PHYSICAL_ROW(row) (7-(row))
|
||||
#define CAPSENSE_PHYSICAL_ROW_TO_KEYMAP_ROW(row) (7-(row))
|
||||
#define CAPSENSE_READ_ROWS_VALUE ((dest_row_1 >> 4) | (dest_row_2 << 4))
|
629
keyboards/model_f_labs/f62/wcass/keyboard.json
Normal file
629
keyboards/model_f_labs/f62/wcass/keyboard.json
Normal file
File diff suppressed because it is too large
Load Diff
35
keyboards/model_f_labs/f62/wcass/readme.md
Normal file
35
keyboards/model_f_labs/f62/wcass/readme.md
Normal file
@ -0,0 +1,35 @@
|
||||
# model_f_labs/f62/wcass
|
||||
|
||||
![model_f_labs/f62/wcass](https://images2.imgbox.com/e5/97/1hPUzXct_o.jpg)
|
||||
|
||||
A short description of the keyboard/project
|
||||
|
||||
* Keyboard Maintainer: [Purdea Andrei](https://github.com/purdeaandrei)
|
||||
* Hardware Supported: Supports the brand new Model F reproductions from https://www.modelfkeyboards.com/, using the smaller xwhatsit controller developed by wcass.
|
||||
* Hardware Availability: https://www.modelfkeyboards.com/
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make model_f_labs/f62/wcass:default
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
||||
|
||||
|
||||
## How do you enter the boot loader?
|
||||
|
||||
There are three ways to enter the boot loader.
|
||||
* **Command**: At the same time hold down both shift key and the B key.
|
||||
Left Shift + Right Shift + B
|
||||
* **Keycode in Layout**: Press the key mapped to `QK_BOOT`.
|
||||
The default location is the R key on the second layer.
|
||||
FN + Spacebar + R
|
||||
* **Physical Reset PCB Pad**: Short pads of the PCB.
|
||||
The description and image below are from the
|
||||
Model F Labs manual web page.
|
||||
|
||||
At the very worst you have to open up the keyboard to short PROG on the actual xwhatsit controller (unscrew the 2 controller screws to see the components side of the board, make a connection with a conductive metal object like an uncoated metal paper clip, then connect the USB cable to the controller and within a split second remove the paper clip). Per pandrew: “You might think that a screwdriver is gonna be enough, but due to surface oxidation it is likely not gonna be good enough. I like to use sharp metal tweezers, because they can dig into the pad a little bit, breaking up the surface oxidation, and I can actually be sure it’s shorting. Apply constant strong pressure on the pads while plugging in the keyboard to make sure they’re perfectly shorted. If you hear the windows USB plug-in sound (assuming the sound effect is enabled), then you know you have succeeded. I’ve even seen people tell me they tried everything to short the pads with, and then I asked them to solder the pads together and it suddenly works. There’s something about the size of those pads, or about the fact that they need to be shorted in the perfect moment when the chip leaves reset, that make people think they are perfectly shorted and yet they aren’t. This affects me too, sometimes it takes me up to 3 tries to get it into bootloader mode. Another thing to double check that you are indeed shorting the PROG pad and not the reset pad. I believe in some versions of the wcass controller there is a reset pad on the opposite side of the board. So don’t be like ‘I see some pads, those must be it’, make sure to be shorting the correct ones.” [1]
|
||||
|
||||
![PCB PADS](https://images2.imgbox.com/ef/20/C9zUfX1h_o.jpg)
|
||||
|
||||
1. “Brand New Model F and Beam Spring keyboards manual,” Brand New Model F Keyboards, https://www.modelfkeyboards.com/manual/ (accessed Mar. 16, 2024).
|
||||
|
7
keyboards/model_f_labs/f62/wcass/rules.mk
Normal file
7
keyboards/model_f_labs/f62/wcass/rules.mk
Normal file
@ -0,0 +1,7 @@
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
#HAPTIC_ENABLE = yes
|
||||
HAPTIC_DRIVER = solenoid
|
||||
CUSTOM_MATRIX=lite
|
||||
SRC += xwhatsit_capsense_matrix.c xwhatsit_util_comm.c
|
18
keyboards/model_f_labs/f62/wcass/wcass.c
Normal file
18
keyboards/model_f_labs/f62/wcass/wcass.c
Normal file
@ -0,0 +1,18 @@
|
||||
/* Copyright 2020 Purdea Andrei
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
const char *KEYBOARD_FILENAME = __FILE__; // used by util_comm
|
||||
|
63
keyboards/model_f_labs/post_config.h
Normal file
63
keyboards/model_f_labs/post_config.h
Normal file
@ -0,0 +1,63 @@
|
||||
/* Copyright 2020 Purdea Andrei
|
||||
* Copyright 2021 Matthew J Wolf
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
// This file should be included at the end of each keyboard-specific config.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef MATRIX_CAPSENSE_ROWS
|
||||
# ifdef MATRIX_EXTRA_DIRECT_ROWS
|
||||
# define MATRIX_CAPSENSE_ROWS (MATRIX_ROWS - MATRIX_EXTRA_DIRECT_ROWS)
|
||||
# ifndef MATRIX_EXTRA_DIRECT_COLS
|
||||
# define MATRIX_EXTRA_DIRECT_COLS MATRIX_COLS
|
||||
# endif
|
||||
# else
|
||||
# define MATRIX_CAPSENSE_ROWS MATRIX_ROWS
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef CAPSENSE_CAL_INIT_REPS
|
||||
# define CAPSENSE_CAL_INIT_REPS 16
|
||||
#endif
|
||||
#ifndef CAPSENSE_CAL_EACHKEY_REPS
|
||||
# define CAPSENSE_CAL_EACHKEY_REPS 16
|
||||
#endif
|
||||
|
||||
// Testing Options
|
||||
|
||||
#ifndef CAPSENSE_KEYBOARD_SETTLE_TIME_US
|
||||
# error "Please define CAPSENSE_KEYBOARD_SETTLE_TIME_US in config.h"
|
||||
#endif
|
||||
#ifndef CAPSENSE_DAC_SETTLE_TIME_US
|
||||
# error "Please define CAPSENSE_DAC_SETTLE_TIME_US in config.h"
|
||||
#endif
|
||||
#ifndef CAPSENSE_HARDCODED_SAMPLE_TIME
|
||||
# error "Please define CAPSENSE_HARDCODED_SAMPLE_TIME in config.h"
|
||||
#endif
|
||||
|
||||
#ifndef CAPSENSE_CAL_ENABLED
|
||||
# error "Please define CAPSENSE_CAL_ENABLED as 1/0 in config.h"
|
||||
#endif
|
||||
#ifndef CAPSENSE_CAL_DEBUG
|
||||
# error "Please define CAPSENSE_CAL_DEBUG as 1/0 in config.h"
|
||||
#endif
|
||||
#ifndef CAPSENSE_CAL_BINS
|
||||
# error "Please define CAPSENSE_CAL_BINS in config.h"
|
||||
#endif
|
||||
#ifndef CAPSENSE_CAL_THRESHOLD_OFFSET
|
||||
# error "Please define CAPSENSE_CAL_THRESHOLD_OFFSET in config.h"
|
||||
#endif
|
827
keyboards/model_f_labs/xwhatsit_capsense_matrix.c
Normal file
827
keyboards/model_f_labs/xwhatsit_capsense_matrix.c
Normal file
File diff suppressed because it is too large
Load Diff
69
keyboards/model_f_labs/xwhatsit_capsense_matrix.h
Normal file
69
keyboards/model_f_labs/xwhatsit_capsense_matrix.h
Normal file
@ -0,0 +1,69 @@
|
||||
/* Copyright 2020 Purdea Andrei
|
||||
* Copyright 2021 Matthew J Wolf
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#define nSHDN_BIT 12
|
||||
#define MCP_DAC_GAIN_2X 0
|
||||
#define MCP_DAC_GAIN_1X 1
|
||||
#define nGA_BIT 13
|
||||
#define BUF_BIT 14
|
||||
|
||||
#define TRACKING_TEST_TIME 4
|
||||
// Key 1 is the always non-pressed key under the space bar to the right.
|
||||
#define TRACKING_KEY_1_COL 6
|
||||
#define TRACKING_KEY_1_ROW 4
|
||||
// Key 2 is the always-pressed calibration pad to the far right-bottom of the keyboard. (both on F62 and F77)
|
||||
#define TRACKING_KEY_2_COL 15
|
||||
#define TRACKING_KEY_2_ROW 6
|
||||
// Key 3 is the F key
|
||||
#define TRACKING_KEY_3_COL 2
|
||||
#define TRACKING_KEY_3_ROW 5
|
||||
// Key 4 is the half of the split backspace that is unused if the user has a normal backspace.
|
||||
#define TRACKING_KEY_4_COL 7
|
||||
#define TRACKING_KEY_4_ROW 3
|
||||
// Key 5 is hidden key next to the left shift, which is only used in ISO layouts.
|
||||
#define TRACKING_KEY_5_COL 0
|
||||
#define TRACKING_KEY_5_ROW 7
|
||||
|
||||
#define TRACKING_REPS 16
|
||||
|
||||
#ifndef NO_PRINT
|
||||
# define NRTIMES 64
|
||||
# define TESTATONCE 8
|
||||
# define REPS_V2 15
|
||||
#endif
|
||||
|
||||
#ifndef MATRIX_MANIPULATE_H
|
||||
# define MATRIX_MANIPULATE_H
|
||||
|
||||
# include "quantum.h"
|
||||
|
||||
// Contains stuff used to manipulate the matrix using the util.
|
||||
// These are defined in capsense_matrix.c. This file is not called matrix.h to avoid conflict with qmk-native matrix.h
|
||||
|
||||
extern bool keyboard_scan_enabled;
|
||||
void matrix_scan_raw(matrix_row_t current_matrix[]);
|
||||
extern uint16_t cal_thresholds[CAPSENSE_CAL_BINS];
|
||||
extern matrix_row_t assigned_to_threshold[CAPSENSE_CAL_BINS][MATRIX_CAPSENSE_ROWS];
|
||||
uint16_t measure_middle_keymap_coords(uint8_t col, uint8_t row, uint8_t time, uint8_t reps);
|
||||
void shift_data(uint32_t data, int data_idle, int shcp_idle, int stcp_idle);
|
||||
void dac_write_threshold(uint16_t value);
|
||||
uint8_t test_single(uint8_t col, uint16_t time, uint8_t *interference_ptr);
|
||||
void shift_select_col_no_strobe(uint8_t col);
|
||||
void shift_select_nothing(void);
|
||||
|
||||
#endif
|
210
keyboards/model_f_labs/xwhatsit_util_comm.c
Normal file
210
keyboards/model_f_labs/xwhatsit_util_comm.c
Normal file
@ -0,0 +1,210 @@
|
||||
/* Copyright 2020 Purdea Andrei
|
||||
* Copyright 2021-2022 Matthew J Wolf
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "quantum.h"
|
||||
#include "raw_hid.h"
|
||||
#include "xwhatsit_util_comm.h"
|
||||
#include "xwhatsit_capsense_matrix.h"
|
||||
#include <string.h>
|
||||
#include <platforms/eeprom.h>
|
||||
|
||||
extern const char *KEYBOARD_FILENAME; // This must be defined in keyboard_name.c to equal the filename. This is sent back to the PC-side software for it to determine which keyboard we are using.
|
||||
|
||||
static const uint8_t magic[] = UTIL_COMM_MAGIC;
|
||||
|
||||
// Has well know issues.
|
||||
//#define min(x, y) (((x) < (y))?(x):(y))
|
||||
|
||||
inline int min(int x, int y) {
|
||||
if (x > y) {
|
||||
return y;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
void raw_hid_receive(uint8_t *data, uint8_t length) {
|
||||
if (0 != memcmp(data, magic, sizeof(magic))) {
|
||||
return;
|
||||
}
|
||||
uint8_t response[RAW_EPSIZE];
|
||||
memcpy(response, magic, sizeof(magic));
|
||||
response[2] = UTIL_COMM_RESPONSE_ERROR;
|
||||
switch (data[2]) {
|
||||
case UTIL_COMM_GET_VERSION:
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
response[3] = UTIL_COMM_VERSION_MAJOR;
|
||||
response[4] = UTIL_COMM_VERSION_MID;
|
||||
response[5] = (UTIL_COMM_VERSION_MINOR >> 8) & 0xff;
|
||||
response[6] = (UTIL_COMM_VERSION_MINOR >> 0) & 0xff;
|
||||
break;
|
||||
case UTIL_COMM_DISABLE_KEYBOARD:
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
response[3] = (uint8_t)keyboard_scan_enabled;
|
||||
keyboard_scan_enabled = 0;
|
||||
break;
|
||||
case UTIL_COMM_ENABLE_KEYBOARD:
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
response[3] = (uint8_t)keyboard_scan_enabled;
|
||||
keyboard_scan_enabled = 1;
|
||||
break;
|
||||
case UTIL_COMM_ENTER_BOOTLOADER:
|
||||
keyboard_scan_enabled = 0;
|
||||
wait_ms(10);
|
||||
bootloader_jump();
|
||||
// we should not be reaching the following:
|
||||
wait_ms(10);
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
break;
|
||||
case UTIL_COMM_GET_KEYSTATE:
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
{
|
||||
matrix_row_t current_matrix[MATRIX_ROWS];
|
||||
matrix_scan_raw(current_matrix);
|
||||
char *current_matrix_ptr = (char *)current_matrix;
|
||||
int offset = 0;
|
||||
if (sizeof(current_matrix) > 32 - 3) {
|
||||
offset = data[3];
|
||||
current_matrix_ptr += offset;
|
||||
}
|
||||
memcpy(&response[3], current_matrix_ptr, min(32 - 3, sizeof(current_matrix) - offset));
|
||||
}
|
||||
break;
|
||||
case UTIL_COMM_GET_THRESHOLDS:
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
#if CAPSENSE_CAL_ENABLED
|
||||
response[3] = CAPSENSE_CAL_BINS;
|
||||
{
|
||||
const uint8_t cal_bin = data[3];
|
||||
response[4] = cal_thresholds[cal_bin] & 0xff;
|
||||
response[5] = (cal_thresholds[cal_bin] >> 8) & 0xff;
|
||||
char *assigned_to_threshold_ptr = (char *)assigned_to_threshold[cal_bin];
|
||||
int offset = 0;
|
||||
if (sizeof(assigned_to_threshold[cal_bin]) > 32 - 6) {
|
||||
offset = data[4];
|
||||
assigned_to_threshold_ptr += offset;
|
||||
}
|
||||
memcpy(&response[6], assigned_to_threshold_ptr, min(32 - 6, sizeof(assigned_to_threshold[cal_bin]) - offset));
|
||||
}
|
||||
#else
|
||||
response[3] = 0;
|
||||
response[4] = (CAPSENSE_HARDCODED_THRESHOLD)&0xff;
|
||||
response[5] = ((CAPSENSE_HARDCODED_THRESHOLD) >> 8) & 0xff;
|
||||
#endif
|
||||
break;
|
||||
case UTIL_COMM_GET_KEYBOARD_FILENAME: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
if (data[3] >= strlen(KEYBOARD_FILENAME) + 1) {
|
||||
response[3] = 0;
|
||||
} else {
|
||||
const char *substring = KEYBOARD_FILENAME + data[3];
|
||||
size_t substring_length = strlen(substring) + 1;
|
||||
if (substring_length > RAW_EPSIZE - 3) substring_length = RAW_EPSIZE - 3;
|
||||
memcpy(&response[3], substring, substring_length);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case UTIL_COMM_ERASE_EEPROM: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
uint16_t addr;
|
||||
for (addr = 0; addr < E2END; addr += 1) {
|
||||
eeprom_update_byte((uint8_t *)addr, 0xff);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case UTIL_COMM_GET_SIGNAL_VALUE: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
uint8_t col = data[3];
|
||||
uint8_t row = data[4];
|
||||
uint8_t count = data[5];
|
||||
int i;
|
||||
for (i = 0; i < count; i++) {
|
||||
uint16_t value = measure_middle_keymap_coords(col, row, CAPSENSE_HARDCODED_SAMPLE_TIME, 8);
|
||||
response[3 + i * 2] = value & 0xff;
|
||||
response[3 + i * 2 + 1] = (value >> 8) & 0xff;
|
||||
col += 1;
|
||||
if (col >= MATRIX_COLS) {
|
||||
col -= MATRIX_COLS;
|
||||
row += 1;
|
||||
}
|
||||
if (row >= MATRIX_CAPSENSE_ROWS) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case UTIL_COMM_GET_KEYBOARD_DETAILS: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
response[3] = MATRIX_COLS;
|
||||
response[4] = MATRIX_ROWS;
|
||||
response[5] = GET_KEYBOARD_DETAILS_5;
|
||||
#if defined(CONTROLLER_IS_XWHATSIT_BEAMSPRING_REV_4)
|
||||
response[5] = 1;
|
||||
#elif defined(CONTROLLER_IS_XWHATSIT_MODEL_F_OR_WCASS_MODEL_F)
|
||||
response[5] = 2;
|
||||
#elif defined(CONTROLLER_IS_THROUGH_HOLE_BEAMSPRING)
|
||||
response[5] = 3;
|
||||
#elif defined(CONTROLLER_IS_THROUGH_HOLE_MODEL_F)
|
||||
response[5] = 4;
|
||||
#else
|
||||
response[5] = 0;
|
||||
#endif
|
||||
response[6] = CAPSENSE_KEYBOARD_SETTLE_TIME_US;
|
||||
response[7] = CAPSENSE_DAC_SETTLE_TIME_US;
|
||||
response[8] = CAPSENSE_HARDCODED_SAMPLE_TIME;
|
||||
response[9] = CAPSENSE_CAL_ENABLED;
|
||||
response[10] = CAPSENSE_DAC_MAX & 0xFF;
|
||||
response[11] = (CAPSENSE_DAC_MAX >> 8) & 0xFF;
|
||||
response[12] = MATRIX_CAPSENSE_ROWS;
|
||||
response[13] = 0; // reserved for future
|
||||
response[14] = 0; // reserved for future
|
||||
response[15] = 0; // reserved for future
|
||||
break;
|
||||
}
|
||||
case UTIL_COMM_SHIFT_DATA:
|
||||
case UTIL_COMM_SHIFT_DATA_EXT: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
uint32_t shdata = (((uint32_t)(data[3])) << 0) | (((uint32_t)(data[4])) << 8) | (((uint32_t)(data[5])) << 16) | (((uint32_t)(data[6])) << 24);
|
||||
int data_idle = 0;
|
||||
int shcp_idle = 0;
|
||||
int stcp_idle = 0;
|
||||
if (data[2] == UTIL_COMM_SHIFT_DATA_EXT) {
|
||||
data_idle = data[7];
|
||||
shcp_idle = data[8];
|
||||
stcp_idle = data[9];
|
||||
}
|
||||
shift_data(shdata, data_idle, shcp_idle, stcp_idle);
|
||||
response[3] = readPin(CAPSENSE_SHIFT_DIN);
|
||||
response[4] = readPin(CAPSENSE_SHIFT_SHCP);
|
||||
response[5] = readPin(CAPSENSE_SHIFT_STCP);
|
||||
break;
|
||||
}
|
||||
case UTIL_COMM_SET_DAC_VALUE: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
uint16_t value = data[3] | (((uint16_t)data[4]) << 8);
|
||||
dac_write_threshold(value);
|
||||
break;
|
||||
}
|
||||
case UTIL_COMM_GET_ROW_STATE: {
|
||||
response[2] = UTIL_COMM_RESPONSE_OK;
|
||||
response[3] = test_single(255, 0, NULL);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
raw_hid_send(response, sizeof(response));
|
||||
}
|
59
keyboards/model_f_labs/xwhatsit_util_comm.h
Normal file
59
keyboards/model_f_labs/xwhatsit_util_comm.h
Normal file
@ -0,0 +1,59 @@
|
||||
/* Copyright 2020 Purdea Andrei
|
||||
* Copyright 2021 Matthew J Wolf
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifndef RAW_EPSIZE
|
||||
# define RAW_EPSIZE 32
|
||||
#endif
|
||||
|
||||
# define UTIL_COMM_VERSION_MAJOR 2
|
||||
# define UTIL_COMM_VERSION_MID 0
|
||||
# define UTIL_COMM_VERSION_MINOR 5
|
||||
|
||||
# define UTIL_COMM_MAGIC \
|
||||
{ 0x55, 0xAA }
|
||||
|
||||
enum command {
|
||||
UTIL_COMM_GET_VERSION = 0x11,
|
||||
UTIL_COMM_ENTER_BOOTLOADER,
|
||||
UTIL_COMM_DISABLE_KEYBOARD,
|
||||
UTIL_COMM_ENABLE_KEYBOARD,
|
||||
UTIL_COMM_GET_KEYSTATE,
|
||||
UTIL_COMM_GET_THRESHOLDS,
|
||||
UTIL_COMM_GET_KEYBOARD_FILENAME,
|
||||
UTIL_COMM_ERASE_EEPROM,
|
||||
UTIL_COMM_GET_SIGNAL_VALUE,
|
||||
UTIL_COMM_GET_KEYBOARD_DETAILS,
|
||||
UTIL_COMM_SHIFT_DATA,
|
||||
UTIL_COMM_SET_DAC_VALUE,
|
||||
UTIL_COMM_GET_ROW_STATE,
|
||||
UTIL_COMM_SHIFT_DATA_EXT,
|
||||
};
|
||||
|
||||
enum response { UTIL_COMM_RESPONSE_OK = 0x22, UTIL_COMM_RESPONSE_ERROR };
|
||||
|
||||
#if defined(CONTROLLER_IS_XWHATSIT_BEAMSPRING_REV_4)
|
||||
# define GET_KEYBOARD_DETAILS_5 1
|
||||
#elif defined(CONTROLLER_IS_XWHATSIT_MODEL_F_OR_WCASS_MODEL_F)
|
||||
# define GET_KEYBOARD_DETAILS_5 2
|
||||
#elif defined(CONTROLLER_IS_THROUGH_HOLE_BEAMSPRING)
|
||||
# define GET_KEYBOARD_DETAILS_5 3
|
||||
#elif defined(CONTROLLER_IS_THROUGH_HOLE_MODEL_F)
|
||||
# define GET_KEYBOARD_DETAILS_5 4
|
||||
#else
|
||||
# define GET_KEYBOARD_DETAILS_5 0
|
||||
#endif
|
@ -789,8 +789,8 @@ def _extract_led_config(info_data, keyboard):
|
||||
info_data[feature]['layout'] = ret
|
||||
except Exception as e:
|
||||
_log_warning(info_data, f'led_config: {file.name}: {e}')
|
||||
else:
|
||||
_log_warning(info_data, 'led_config: matrix size required to parse g_led_config')
|
||||
else:
|
||||
_log_warning(info_data, 'led_config: matrix size required to parse g_led_config')
|
||||
|
||||
if info_data[feature].get('layout', None) and not info_data[feature].get('led_count', None):
|
||||
info_data[feature]['led_count'] = len(info_data[feature]['layout'])
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2024 QMK
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2024 QMK
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2024 QMK
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2024 QMK
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright 2024 QMK
|
||||
// Copyright 2025 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
/*******************************************************************************
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user