mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-07-06 17:05:05 -04:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 58e319b764 | |||
| 21823a69b8 | |||
| c6ef6c580f | |||
| e38f3097cb | |||
| cf93bbb78f | |||
| 9f75ab2c92 | |||
| 5734360a86 | |||
| 0ec0cdde81 | |||
| ee9354d36e | |||
| dd905c9531 | |||
| 963986c475 | |||
| aae4189aa4 | |||
| fd624d016b | |||
| 6741f9dc26 | |||
| f8910d3a60 | |||
| 1d2f52e407 | |||
| 746eff22db | |||
| d36397fdd4 | |||
| 8522bb342d | |||
| 721affff7b | |||
| 4f6c5d2745 | |||
| 92dc82ae08 | |||
| b64014d5df | |||
| 0d401d1182 | |||
| 6ada0933db | |||
| 0515002e7d | |||
| 7f702d2262 | |||
| 6a0e2a8868 | |||
| 90082403de | |||
| cffafbbdc7 | |||
| 55be8f2c2b | |||
| df94ffcc66 | |||
| ee74da3a4d | |||
| 480d808683 | |||
| 62a8db33a3 |
@@ -187,9 +187,9 @@ include $(COMMUNITY_RULES_MK)
|
||||
|
||||
ifneq ($(COMMUNITY_MODULES),)
|
||||
|
||||
$(INTERMEDIATE_OUTPUT)/src/community_config.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES)
|
||||
$(INTERMEDIATE_OUTPUT)/src/community_post_config.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES)
|
||||
@$(SILENT) || printf "$(MSG_GENERATING) $@" | $(AWK_CMD)
|
||||
$(eval CMD=$(QMK_BIN) generate-community-config-h -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_config.h $(KEYMAP_JSON))
|
||||
$(eval CMD=$(QMK_BIN) generate-community-post-config-h -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/community_post_config.h $(KEYMAP_JSON))
|
||||
@$(BUILD_CMD)
|
||||
|
||||
$(INTERMEDIATE_OUTPUT)/src/community_modules.h: $(KEYMAP_JSON) $(DD_CONFIG_FILES)
|
||||
@@ -227,10 +227,10 @@ $(INTERMEDIATE_OUTPUT)/src/split_transaction_id_community_modules.inc: $(KEYMAP_
|
||||
$(eval CMD=$(QMK_BIN) generate-split-transaction-id-community-modules-inc -kb $(KEYBOARD) --quiet --output $(INTERMEDIATE_OUTPUT)/src/split_transaction_id_community_modules.inc $(KEYMAP_JSON))
|
||||
@$(BUILD_CMD)
|
||||
|
||||
COMMUNITY_CONFIG_H = $(INTERMEDIATE_OUTPUT)/src/community_config.h
|
||||
COMMUNITY_POST_CONFIG_H = $(INTERMEDIATE_OUTPUT)/src/community_post_config.h
|
||||
SRC += $(INTERMEDIATE_OUTPUT)/src/community_modules.c
|
||||
|
||||
generated-files: $(INTERMEDIATE_OUTPUT)/src/community_config.h $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(INTERMEDIATE_OUTPUT)/src/community_modules.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h $(INTERMEDIATE_OUTPUT)/src/led_matrix_community_modules.inc $(INTERMEDIATE_OUTPUT)/src/rgb_matrix_community_modules.inc $(INTERMEDIATE_OUTPUT)/src/split_transaction_id_community_modules.inc
|
||||
generated-files: $(INTERMEDIATE_OUTPUT)/src/community_post_config.h $(INTERMEDIATE_OUTPUT)/src/community_modules.h $(INTERMEDIATE_OUTPUT)/src/community_modules.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.c $(INTERMEDIATE_OUTPUT)/src/community_modules_introspection.h $(INTERMEDIATE_OUTPUT)/src/led_matrix_community_modules.inc $(INTERMEDIATE_OUTPUT)/src/rgb_matrix_community_modules.inc $(INTERMEDIATE_OUTPUT)/src/split_transaction_id_community_modules.inc
|
||||
|
||||
endif
|
||||
|
||||
@@ -331,10 +331,6 @@ define config_h_community_module_appender
|
||||
endef
|
||||
$(foreach module,$(COMMUNITY_MODULE_PATHS),$(eval $(call config_h_community_module_appender,$(module))))
|
||||
|
||||
ifneq ($(COMMUNITY_CONFIG_H),)
|
||||
CONFIG_H += $(COMMUNITY_CONFIG_H)
|
||||
endif
|
||||
|
||||
ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","")
|
||||
CONFIG_H += $(KEYBOARD_PATH_5)/config.h
|
||||
endif
|
||||
@@ -376,6 +372,10 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/post_config.h)","")
|
||||
POST_CONFIG_H += $(KEYBOARD_PATH_5)/post_config.h
|
||||
endif
|
||||
|
||||
ifneq ($(COMMUNITY_POST_CONFIG_H),)
|
||||
POST_CONFIG_H += $(COMMUNITY_POST_CONFIG_H)
|
||||
endif
|
||||
|
||||
CONFIG_H += $(INTERMEDIATE_OUTPUT)/src/info_config.h
|
||||
KEYBOARD_SRC += $(INTERMEDIATE_OUTPUT)/src/default_keyboard.c
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ endif
|
||||
|
||||
VALID_STENO_PROTOCOL_TYPES := geminipr txbolt all
|
||||
STENO_PROTOCOL ?= all
|
||||
|
||||
ifeq ($(strip $(STENO_ENABLE)), yes)
|
||||
ifeq ($(filter $(STENO_PROTOCOL),$(VALID_STENO_PROTOCOL_TYPES)),)
|
||||
$(call CATASTROPHIC_ERROR,Invalid STENO_PROTOCOL,STENO_PROTOCOL="$(STENO_PROTOCOL)" is not a valid stenography protocol)
|
||||
|
||||
@@ -45,6 +45,7 @@ GENERIC_FEATURES = \
|
||||
MOUSEKEY \
|
||||
MUSIC \
|
||||
OS_DETECTION \
|
||||
PLOVER_HID \
|
||||
PROGRAMMABLE_BUTTON \
|
||||
REPEAT_KEY \
|
||||
SECURE \
|
||||
|
||||
@@ -63,6 +63,7 @@ OTHER_OPTION_NAMES = \
|
||||
LCD_BACKLIGHT_ENABLE \
|
||||
MACROS_ENABLED \
|
||||
PS2_ENABLE \
|
||||
PLOVER_HID_ENABLE \
|
||||
PS2_MOUSE_ENABLE \
|
||||
PS2_DRIVER \
|
||||
RAW_ENABLE \
|
||||
|
||||
@@ -0,0 +1,265 @@
|
||||
{
|
||||
"ranges": {
|
||||
"0x5A40/0x003F": {
|
||||
"define": "QK_PLOVER_HID"
|
||||
}
|
||||
},
|
||||
"keycodes": {
|
||||
"0x5A40": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_S1"
|
||||
},
|
||||
"0x5A41": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_TL"
|
||||
},
|
||||
"0x5A42": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_KL"
|
||||
},
|
||||
"0x5A43": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_PL"
|
||||
},
|
||||
"0x5A44": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_WL"
|
||||
},
|
||||
"0x5A45": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_HL"
|
||||
},
|
||||
"0x5A46": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_RL"
|
||||
},
|
||||
"0x5A47": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_A"
|
||||
},
|
||||
"0x5A48": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_O"
|
||||
},
|
||||
"0x5A49": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_ST1"
|
||||
},
|
||||
"0x5A4A": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_E"
|
||||
},
|
||||
"0x5A4B": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_U"
|
||||
},
|
||||
"0x5A4C": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_FR"
|
||||
},
|
||||
"0x5A4D": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_RR"
|
||||
},
|
||||
"0x5A4E": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_PR"
|
||||
},
|
||||
"0x5A4F": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_BR"
|
||||
},
|
||||
"0x5A50": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_LR"
|
||||
},
|
||||
"0x5A51": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_GR"
|
||||
},
|
||||
"0x5A52": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_TR"
|
||||
},
|
||||
"0x5A53": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_SR"
|
||||
},
|
||||
"0x5A54": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_DR"
|
||||
},
|
||||
"0x5A55": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_ZR"
|
||||
},
|
||||
"0x5A56": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N1"
|
||||
},
|
||||
"0x5A57": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_S2"
|
||||
},
|
||||
"0x5A58": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_ST2"
|
||||
},
|
||||
"0x5A59": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_ST3"
|
||||
},
|
||||
"0x5A5A": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_ST4"
|
||||
},
|
||||
"0x5A5B": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N2"
|
||||
},
|
||||
"0x5A5C": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N3"
|
||||
},
|
||||
"0x5A5D": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N4"
|
||||
},
|
||||
"0x5A5E": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N5"
|
||||
},
|
||||
"0x5A5F": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N6"
|
||||
},
|
||||
"0x5A60": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N7"
|
||||
},
|
||||
"0x5A61": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N8"
|
||||
},
|
||||
"0x5A62": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_N9"
|
||||
},
|
||||
"0x5A63": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_NA"
|
||||
},
|
||||
"0x5A64": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_NB"
|
||||
},
|
||||
"0x5A65": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_NC"
|
||||
},
|
||||
"0x5A66": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X1"
|
||||
},
|
||||
"0x5A67": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X2"
|
||||
},
|
||||
"0x5A68": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X3"
|
||||
},
|
||||
"0x5A69": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X4"
|
||||
},
|
||||
"0x5A6A": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X5"
|
||||
},
|
||||
"0x5A6B": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X6"
|
||||
},
|
||||
"0x5A6C": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X7"
|
||||
},
|
||||
"0x5A6D": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X8"
|
||||
},
|
||||
"0x5A6E": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X9"
|
||||
},
|
||||
"0x5A6F": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X10"
|
||||
},
|
||||
"0x5A70": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X11"
|
||||
},
|
||||
"0x5A71": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X12"
|
||||
},
|
||||
"0x5A72": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X13"
|
||||
},
|
||||
"0x5A73": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X14"
|
||||
},
|
||||
"0x5A74": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X15"
|
||||
},
|
||||
"0x5A75": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X16"
|
||||
},
|
||||
"0x5A76": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X17"
|
||||
},
|
||||
"0x5A77": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X18"
|
||||
},
|
||||
"0x5A78": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X19"
|
||||
},
|
||||
"0x5A79": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X20"
|
||||
},
|
||||
"0x5A7A": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X21"
|
||||
},
|
||||
"0x5A7B": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X22"
|
||||
},
|
||||
"0x5A7C": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X23"
|
||||
},
|
||||
"0x5A7D": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X24"
|
||||
},
|
||||
"0x5A7E": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X25"
|
||||
},
|
||||
"0x5A7F": {
|
||||
"group": "plover_hid",
|
||||
"key": "PLV_X26"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
// This version exists to signify addition of eeconfig support.
|
||||
}
|
||||
@@ -1741,7 +1741,10 @@
|
||||
"target": "ducky/one2mini/1861st"
|
||||
},
|
||||
"ducky/one2sf": {
|
||||
"target": "ducky/one2sf/1967st"
|
||||
"target": "ducky/one2sf/1967st/ansi"
|
||||
},
|
||||
"ducky/one2sf/1967st": {
|
||||
"target": "ducky/one2sf/1967st/ansi"
|
||||
},
|
||||
"dumbpad": {
|
||||
"target": "dumbpad/v0x"
|
||||
|
||||
@@ -340,6 +340,10 @@ There are a few different ways to set handedness for split keyboards (listed in
|
||||
* `#define SPLIT_TRANSACTION_IDS_USER .....`
|
||||
* Allows for custom data sync with the slave when using the QMK-provided split transport. See [custom data sync between sides](features/split_keyboard#custom-data-sync) for more information.
|
||||
|
||||
* `#define SYSTEM_CONTROL_USAGE_MINIMUM 0x0081`
|
||||
* `#define SYSTEM_CONTROL_USAGE_MAXIMUM 0x008F`
|
||||
* Sets the usage range reported by the System Control collection that `EXTRAKEY_ENABLE` adds. The default range covers the System Control usages QMK can send and stops below the Generic Desktop D-pad usages (`0x90` and up). Raising the maximum into that range makes some hosts detect the keyboard as a gamepad, so only widen it if you need the extra usages and know your host handles them. The minimum must not be greater than the maximum.
|
||||
|
||||
# The `rules.mk` File
|
||||
|
||||
This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features.
|
||||
|
||||
+20
-5
@@ -191,7 +191,9 @@ void eeconfig_init_user_datablock(void);
|
||||
|
||||
:::::
|
||||
|
||||
### Example
|
||||
### Examples
|
||||
|
||||
#### Basic
|
||||
|
||||
This is an example of how to add settings, and read and write it. We're using the user keymap for the example here.
|
||||
|
||||
@@ -215,10 +217,6 @@ typedef struct my_config_t {
|
||||
static my_config_t config;
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
if (!eeconfig_is_user_datablock_valid()) {
|
||||
eeconfig_init_user_datablock();
|
||||
}
|
||||
|
||||
eeconfig_read_user_datablock(&config, 0, sizeof(my_config_t));
|
||||
}
|
||||
|
||||
@@ -240,3 +238,20 @@ void housekeeping_task_user(void) {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Default Values
|
||||
|
||||
Extending the above example, a default value for the datablock can be configured as follows:
|
||||
|
||||
```c
|
||||
void eeconfig_init_user_datablock(void) {
|
||||
my_config_t default_config = {
|
||||
.data = 42,
|
||||
};
|
||||
eeconfig_update_user_datablock(&default_config, 0, sizeof(my_config_t));
|
||||
}
|
||||
```
|
||||
|
||||
::: tip
|
||||
For large datablocks, you might need to manually update in chunks to avoid memory issues.
|
||||
:::
|
||||
|
||||
@@ -16,7 +16,8 @@ These functions allow you to activate layers in various ways. Note that layers a
|
||||
* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](one_shot_keys) for details and additional functionality.
|
||||
* `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa
|
||||
* `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed).
|
||||
* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps.
|
||||
* `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps.
|
||||
* Note: toggling behavior requires that [Quick Tap](tap_hold#quick-tap-term) is enabled (`QUICK_TAP_TERM` not set to `0`), or if `QUICK_TAP_TERM_PER_KEY` is defined, that `get_quick_tap_term()` returns a non-zero value for the `TT` key.
|
||||
|
||||
See also the [Layer Lock key](features/layer_lock), which locks the highest
|
||||
active layer until pressed again.
|
||||
|
||||
@@ -135,28 +135,45 @@ This file defines LED matrix effects in the same form as used with `led_matrix_k
|
||||
|
||||
This file defines RGB matrix effects in the same form as used with `rgb_matrix_kb.inc` and `rgb_matrix_user.inc` (see [Custom RGB Matrix Effects](rgb_matrix#custom-rgb-matrix-effects)). Effect mode names are prepended with `RGB_MATRIX_COMMUNITY_MODULE_`.
|
||||
|
||||
### Custom split keyboard data sync
|
||||
### Additional Customization
|
||||
|
||||
Defines follow the convention, `SPLIT_TRANSACTION_IDS_MODULE_<MODULE>` (see [Custom data sync](split_keyboard#custom-data-sync)).
|
||||
#### Split Keyboard Data Sync
|
||||
|
||||
Defines follow the convention, `SPLIT_TRANSACTION_IDS_MODULE_<MODULE>` (see [Custom data sync](split_keyboard#custom-data-sync)).
|
||||
|
||||
#### Persistent Configuration
|
||||
|
||||
Defines follow the convention, `EECONFIG_MODULE_<MODULE>_DATA_SIZE` and `EECONFIG_MODULE_<MODULE>_DATA_VERSION` (see [Custom Persistent Configuration](../feature_eeprom#datablock)).
|
||||
|
||||
When configured, the following APIs are available:
|
||||
|
||||
| API Format | Example (`hello_world` module) | API Version |
|
||||
|--------------------------------------------|-----------------------------------------------|-------------|
|
||||
| `eeconfig_is_<module>_datablock_valid` | `eeconfig_is_hello_world_datablock_valid` | `1.1.3` |
|
||||
| `eeconfig_read_<module>_datablock` | `eeconfig_read_hello_world_datablock` | `1.1.3` |
|
||||
| `eeconfig_update_<module>_datablock` | `eeconfig_update_hello_world_datablock` | `1.1.3` |
|
||||
| `eeconfig_init_<module>_datablock` | `eeconfig_init_hello_world_datablock` | `1.1.3` |
|
||||
| `eeconfig_read_<module>_datablock_field` | `eeconfig_read_hello_world_datablock_field` | `1.1.3` |
|
||||
| `eeconfig_update_<module>_datablock_field` | `eeconfig_update_hello_world_datablock_field` | `1.1.3` |
|
||||
|
||||
### Compatible APIs
|
||||
|
||||
Community Modules may provide specializations for the following APIs:
|
||||
|
||||
| Base API | API Format | Example (`hello_world` module) | API Version |
|
||||
|----------------------------------|-------------------------------------------|---------------------------------------------|-------------|
|
||||
| `keyboard_pre_init` | `keyboard_pre_init_<module>` | `keyboard_pre_init_hello_world` | `0.1.0` |
|
||||
| `keyboard_post_init` | `keyboard_post_init_<module>` | `keyboard_post_init_hello_world` | `0.1.0` |
|
||||
| `pre_process_record` | `pre_process_record_<module>` | `pre_process_record_hello_world` | `0.1.0` |
|
||||
| `process_record` | `process_record_<module>` | `process_record_hello_world` | `0.1.0` |
|
||||
| `post_process_record` | `post_process_record_<module>` | `post_process_record_hello_world` | `0.1.0` |
|
||||
| `housekeeping_task` | `housekeeping_task_<module>` | `housekeeping_task_hello_world` | `1.0.0` |
|
||||
| `suspend_power_down` | `suspend_power_down_<module>` | `suspend_power_down_hello_world` | `1.0.0` |
|
||||
| `suspend_wakeup_init` | `suspend_wakeup_init_<module>` | `suspend_wakeup_init_hello_world` | `1.0.0` |
|
||||
| `shutdown` | `shutdown_<module>` | `shutdown_hello_world` | `1.0.0` |
|
||||
| `process_detected_host_os` | `process_detected_host_os_<module>` | `process_detected_host_os_hello_world` | `1.0.0` |
|
||||
| `default_layer_state_set` | `default_layer_state_set_<module>` | `default_layer_state_set_hello_world` | `1.1.0` |
|
||||
| `layer_state_set` | `layer_state_set_<module>` | `layer_state_set_hello_world` | `1.1.0` |
|
||||
| Base API | API Format | Example (`hello_world` module) | API Version |
|
||||
|----------------------------------|-------------------------------------------|----------------------------------------------|-------------|
|
||||
| `keyboard_pre_init` | `keyboard_pre_init_<module>` | `keyboard_pre_init_hello_world` | `0.1.0` |
|
||||
| `keyboard_post_init` | `keyboard_post_init_<module>` | `keyboard_post_init_hello_world` | `0.1.0` |
|
||||
| `pre_process_record` | `pre_process_record_<module>` | `pre_process_record_hello_world` | `0.1.0` |
|
||||
| `process_record` | `process_record_<module>` | `process_record_hello_world` | `0.1.0` |
|
||||
| `post_process_record` | `post_process_record_<module>` | `post_process_record_hello_world` | `0.1.0` |
|
||||
| `housekeeping_task` | `housekeeping_task_<module>` | `housekeeping_task_hello_world` | `1.0.0` |
|
||||
| `suspend_power_down` | `suspend_power_down_<module>` | `suspend_power_down_hello_world` | `1.0.0` |
|
||||
| `suspend_wakeup_init` | `suspend_wakeup_init_<module>` | `suspend_wakeup_init_hello_world` | `1.0.0` |
|
||||
| `shutdown` | `shutdown_<module>` | `shutdown_hello_world` | `1.0.0` |
|
||||
| `process_detected_host_os` | `process_detected_host_os_<module>` | `process_detected_host_os_hello_world` | `1.0.0` |
|
||||
| `default_layer_state_set` | `default_layer_state_set_<module>` | `default_layer_state_set_hello_world` | `1.1.0` |
|
||||
| `layer_state_set` | `layer_state_set_<module>` | `layer_state_set_hello_world` | `1.1.0` |
|
||||
| `led_matrix_indicators` | `led_matrix_indicators_<module>` | `led_matrix_indicators_hello_world` | `1.1.0` |
|
||||
| `led_matrix_indicators_advanced` | `led_matrix_indicators_advanced_<module>` | `led_matrix_indicators_advanced_hello_world` | `1.1.0` |
|
||||
| `rgb_matrix_indicators` | `rgb_matrix_indicators_<module>` | `rgb_matrix_indicators_hello_world` | `1.1.0` |
|
||||
@@ -164,7 +181,6 @@ Community Modules may provide specializations for the following APIs:
|
||||
| `pointing_device_init` | `pointing_device_init_<module>` | `pointing_device_init_hello_world` | `1.1.0` |
|
||||
| `pointing_device_task` | `pointing_device_task_<module>` | `pointing_device_task_hello_world` | `1.1.0` |
|
||||
|
||||
|
||||
::: info
|
||||
An unspecified API is disregarded if a Community Module does not provide a specialization for it.
|
||||
:::
|
||||
|
||||
@@ -166,7 +166,7 @@ In your keyboard config.h:
|
||||
|
||||
The `PIO` subsystem is a Raspberry Pi RP2040 specific implementation, using the integrated PIO peripheral and is therefore only available on this MCU.
|
||||
|
||||
There are strict requirements for pin ordering but any pair of GPIO pins can be used. The GPIO used for clock must be directly after data, see the included info.json snippet for an example of correct order.
|
||||
The GPIOs used for clock and data must be consecutive (in either order).
|
||||
|
||||
You may optionally switch the PIO peripheral used with the following define in config.h:
|
||||
```c
|
||||
|
||||
@@ -6,11 +6,12 @@ The [Open Steno Project](https://www.openstenoproject.org/) has built an open-so
|
||||
|
||||
## Steno Support in QMK
|
||||
|
||||
There are three ways that QMK keyboards can support steno, with varying degrees of configuration required:
|
||||
There are four ways that QMK keyboards can support steno, with varying degrees of configuration required:
|
||||
|
||||
1. Plover with [Arpeggiation](https://plover.wiki/index.php/Glossary#Arpeggiate) requires no changes to any keyboard and is supported by QMK as well as any other QWERTY keyboard.
|
||||
2. Plover with [NKRO](https://plover.wiki/index.php/Using_a_standard_keyboard_with_Plover#NKRO). If your keyboard supports NKRO in hardware and you have NKRO enabled as a USB endpoint, you can chord with the keyboard. Many devices will arrive stock like this and will require no changes.
|
||||
3. Steno Machine Protocols. This requires the most configuration, but this has the advantage of allowing you to use your keyboard keys normally (either on another layer or another piece of hardware) without enabling and disabling your steno software.
|
||||
4. Plover HID Protocol. This is a custom HID protocol that Plover can understand, but does not require a COM port. It is robust to device disconnects and saves an interface over the COM-based alternatives.
|
||||
|
||||
## Plover with QWERTY Keyboard {#plover-with-qwerty-keyboard}
|
||||
|
||||
@@ -92,6 +93,22 @@ Examples of steno strokes and the associated packet:
|
||||
- `WAZ` = `10000000 00000010 00100000 00000000 00000000 00000001`
|
||||
- `PHAPBGS` = `10000000 00000101 00100000 00000000 01101010 00000000`
|
||||
|
||||
## Plover HID Protocol {#plover-hid-protocol}
|
||||
|
||||
This mode operates independently of the other Steno "official" machine protocols. Like any other mouse or keyboard, it uses the USB HID protocol to communicate with Plover by sending an 8 byte (64 bit) packet representing a bitfield for all the possible keys on a steno machine plus a number of additional general purpose keys for custom use. This protocol is only understood by Plover as of [5.1.0](https://github.com/opensteno/plover/releases/tag/v5.1.0).
|
||||
|
||||
Add
|
||||
|
||||
```make
|
||||
PLOVER_HID_ENABLE = yes
|
||||
```
|
||||
|
||||
to your `rules.mk` file. This does **not** require `STENO_ENABLE` to be set.
|
||||
|
||||
All of the possible keycodes are defined with the `PLV_` prefix and are available without any additional includes.
|
||||
|
||||
More details can be found here: https://github.com/dnaq/plover-machine-hid
|
||||
|
||||
### Switching protocols on the fly {#switching-protocols-on-the-fly}
|
||||
|
||||
If you wish to switch the serial protocol used to transfer the steno chords without having to recompile your keyboard firmware every time, you can press the `QK_STENO_BOLT` and `QK_STENO_GEMINI` keycodes in order to switch protocols on the fly.
|
||||
|
||||
@@ -375,6 +375,10 @@ In this configuration "hold" takes place **after** tap dance timeout. To achieve
|
||||
|
||||
Tap dance can be used to emulate `MT()` and `LT()` behavior when the tapped code is not a basic keycode. This is useful to send tapped keycodes that normally require `Shift`, such as parentheses or curly braces—or other modified keycodes, such as `Control + X`.
|
||||
|
||||
::: tip
|
||||
For simply sending a non-basic keycode on tap while functioning as a modifier or layer switch on hold, a simpler (and often superior) alternative is to use a Mod-Tap or Layer-Tap key and intercept its tap function in `process_record_user()`. This avoids the complexity of Tap Dance, and allows the key to benefit from advanced Tap-Hold options. See [Intercepting Mod-Taps](../mod_tap#intercepting-mod-taps) for details.
|
||||
:::
|
||||
|
||||
Below your layers and custom keycodes, add the following:
|
||||
|
||||
```c
|
||||
|
||||
+3
-1
@@ -72,9 +72,11 @@ It can also be mitigated by increasing [`TAP_CODE_DELAY`](config_options#behavio
|
||||
|
||||
## Intercepting Mod-Taps
|
||||
|
||||
This technique works for both Mod-Tap (`MT`) and Layer-Tap (`LT`) keys.
|
||||
|
||||
### Changing tap function
|
||||
|
||||
The basic keycode limitation with Mod-Tap can be worked around by intercepting it in `process_record_user`. For example, shifted keycode `KC_DQUO` cannot be used with `MT()` because it is a 16-bit keycode alias of `LSFT(KC_QUOT)`. Modifiers on `KC_DQUO` will be masked by `MT()`. But the following custom code can be used to intercept the "tap" function to manually send `KC_DQUO`:
|
||||
The basic keycode limitation with Mod-Tap and Layer-Tap can be worked around by intercepting it in `process_record_user`. For example, shifted keycode `KC_DQUO` cannot be used with `MT()` because it is a 16-bit keycode alias of `LSFT(KC_QUOT)`. Modifiers on `KC_DQUO` will be masked by `MT()`. But the following custom code can be used to intercept the "tap" function to manually send `KC_DQUO`:
|
||||
|
||||
```c
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
+25
-2
@@ -1,8 +1,12 @@
|
||||
# Tap-Hold Configuration Options
|
||||
|
||||
These options let you modify the behavior of the tap-hold keys, applying primarily to Mod-Tap `MT` and Layer-Tap `LT` keys. They also affect layer tap-toggle `TT`, one-shot `OSM`, `OSL`, and Swap Hands `SH_T`, `SH_TT` keys.
|
||||
|
||||
While Tap-Hold options are fantastic, they are not without their issues. We have tried to configure them with reasonable defaults, but that may still cause issues for some people.
|
||||
|
||||
These options let you modify the behavior of the tap-hold keys.
|
||||
::: info
|
||||
Besides the tapping term, tap-hold options do **not** apply to Tap Dance keys. Tap Dance implements a separate, simpler decision logic to track when keys are tapped vs. held, and it does not support advanced tap-hold configurations like Permissive Hold, Chordal Hold, etc.
|
||||
:::
|
||||
|
||||
## Tapping Term
|
||||
|
||||
@@ -148,6 +152,25 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
||||
|
||||
The reason is that `TAPPING_TERM` is a macro that expands to a constant integer and thus cannot be changed at runtime, whereas `g_tapping_term` is a variable whose value can be changed at runtime. If you want, you can temporarily enable `DYNAMIC_TAPPING_TERM_ENABLE` to find a suitable tapping term value and then disable that feature and revert back to using the classic syntax for per-key tapping term settings. In case you need to access the tapping term from elsewhere in your code, you can use the `GET_TAPPING_TERM(keycode, record)` macro. This macro will expand to whatever is the appropriate access pattern given the current configuration.
|
||||
|
||||
## Configuring Home Row Mods
|
||||
|
||||
"Home row mods" (HRMs) is a popular layout technique where modifiers are placed as Mod-Tap keys on the home row (<kbd>A</kbd>, <kbd>S</kbd>, <kbd>D</kbd>, <kbd>F</kbd> and <kbd>J</kbd>, <kbd>K</kbd>, <kbd>L</kbd>, <kbd>;</kbd>, supposing QWERTY layout). This reduces hand movement and can increase comfort. However, because these keys are also used for fast typing, they are prone to accidental modifier triggers (when rolling keys) or accidental typed letters (when trying to use a modifier).
|
||||
|
||||
There is no single perfect configuration for home row mods, as it depends heavily on your typing speed and habits. However, a good starting point in QMK is (added in your `config.h`):
|
||||
|
||||
```c
|
||||
#define TAPPING_TERM 250
|
||||
#define PERMISSIVE_HOLD // Triggers mod if you tap another key while holding.
|
||||
#define CHORDAL_HOLD // Constrains holds to opposite-hand combinations.
|
||||
// Consider also:
|
||||
// #define FLOW_TAP_TERM 150 // Disables holds when typing quickly.
|
||||
```
|
||||
|
||||
See [Permissive Hold](#permissive-hold), [Chordal Hold](#chordal-hold), and [Flow Tap](#flow-tap) below for details on what they do and how to fine-tune them.
|
||||
|
||||
Additionally, [Speculative Hold](#speculative-hold) is useful to eliminate lag when combining a home row mod with mouse clicks (e.g., Shift + Click), as standard mod-tap keys do not send the modifier until the tap-hold decision is finalized.
|
||||
|
||||
|
||||
## Tap-Or-Hold Decision Modes
|
||||
|
||||
The code which decides between the tap and hold actions of dual-role keys supports three different modes, in increasing order of preference for the hold action:
|
||||
@@ -824,7 +847,7 @@ bool get_speculative_hold(uint16_t keycode, keyrecord_t* record) {
|
||||
}
|
||||
```
|
||||
|
||||
Some operating systems or applications assign actions to tapping a modifier key by itself, e.g., tapping GUI to open a start menu. Because Speculative Hold sometimes sends a lone modifier key press, it can falsely trigger these actions (known as the "flashing mods" problem). How such an input is handled depends on the OS and application, so unfortunately, there is no universal solution.
|
||||
Some operating systems or applications assign actions to tapping a modifier key by itself, e.g., tapping GUI to open a start menu. Because Speculative Hold sends a lone modifier key press in some cases, it can falsely trigger these actions (known as the "flashing mods" problem). How such an input is handled depends on the OS and application, so unfortunately, there is no universal solution.
|
||||
|
||||
To mitigate this issue, you can set `DUMMY_MOD_NEUTRALIZER_KEYCODE` (and optionally `MODS_TO_NEUTRALIZE`) in your `config.h`, as described above for [Retro Tapping](#retro-tapping).
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ bool azoteq_iqs5xx_init(void) {
|
||||
};
|
||||
|
||||
report_mouse_t azoteq_iqs5xx_get_report(report_mouse_t mouse_report) {
|
||||
report_mouse_t temp_report = {0};
|
||||
report_mouse_t temp_report = {.buttons = mouse_report.buttons};
|
||||
|
||||
azoteq_iqs5xx_base_data_t base_data = {0};
|
||||
i2c_status_t status = azoteq_iqs5xx_get_base_data(&base_data);
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
{
|
||||
"board": "GENERIC_RP_RP2040",
|
||||
"bootloader": "rp2040",
|
||||
"diode_direction": "COL2ROW",
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true
|
||||
},
|
||||
"processor": "RP2040",
|
||||
"ps2": {
|
||||
"driver": "vendor",
|
||||
"enabled": true,
|
||||
"mouse_enabled": true
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT_iso": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [5, 0], "x": 0, "y": 0, "w": 0.9, "h": 0.75},
|
||||
{"label": "Mute", "matrix": [4, 10], "x": 0.9, "y": 0, "w": 0.75, "h": 0.5},
|
||||
{"label": "Vol -", "matrix": [3, 10], "x": 1.65, "y": 0, "w": 0.75, "h": 0.5},
|
||||
{"label": "Vol +", "matrix": [2, 10], "x": 2.4, "y": 0, "w": 0.75, "h": 0.5},
|
||||
{"label": "ThinkVantage", "matrix": [5, 10], "x": 3.5, "y": 0, "w": 1.25, "h": 0.5},
|
||||
{"label": "PrtSc", "matrix": [1, 13], "x": 8.9, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "ScrLk", "matrix": [2, 13], "x": 9.8, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "Pause", "matrix": [6, 12], "x": 10.7, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "Insert", "matrix": [0, 9], "x": 12, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "Home", "matrix": [0, 12], "x": 12.9, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "PgUp", "matrix": [0, 11], "x": 13.8, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "F1", "matrix": [0, 1], "x": 0, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F2", "matrix": [0, 2], "x": 0.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F3", "matrix": [3, 2], "x": 1.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F4", "matrix": [5, 2], "x": 2.7, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F5", "matrix": [5, 8], "x": 4, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F6", "matrix": [5, 5], "x": 4.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F7", "matrix": [3, 6], "x": 5.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F8", "matrix": [0, 6], "x": 6.7, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F9", "matrix": [0, 8], "x": 8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F10", "matrix": [1, 8], "x": 8.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F11", "matrix": [1, 10], "x": 9.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F12", "matrix": [1, 9], "x": 10.7, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "Delete", "matrix": [0, 10], "x": 12, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "End", "matrix": [1, 12], "x": 12.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "PgDn", "matrix": [1, 11], "x": 13.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "`\u00ac", "matrix": [0, 0], "x": 0, "y": 1.4},
|
||||
{"label": "1!", "matrix": [1, 0], "x": 1, "y": 1.4},
|
||||
{"label": "2\"", "matrix": [1, 1], "x": 2, "y": 1.4},
|
||||
{"label": "3\u00a3", "matrix": [1, 2], "x": 3, "y": 1.4},
|
||||
{"label": "4$", "matrix": [1, 3], "x": 4, "y": 1.4},
|
||||
{"label": "5%", "matrix": [0, 3], "x": 5, "y": 1.4},
|
||||
{"label": "6^", "matrix": [0, 4], "x": 6, "y": 1.4},
|
||||
{"label": "7&", "matrix": [1, 4], "x": 7, "y": 1.4},
|
||||
{"label": "8*", "matrix": [1, 5], "x": 8, "y": 1.4},
|
||||
{"label": "9(", "matrix": [1, 6], "x": 9, "y": 1.4},
|
||||
{"label": "0)", "matrix": [1, 7], "x": 10, "y": 1.4},
|
||||
{"label": "-_", "matrix": [0, 7], "x": 11, "y": 1.4},
|
||||
{"label": "=+", "matrix": [0, 5], "x": 12, "y": 1.4},
|
||||
{"label": "Bksp", "matrix": [3, 8], "x": 13, "y": 1.4, "w": 2},
|
||||
{"label": "Tab", "matrix": [3, 0], "x": 0, "y": 2.4, "w": 1.5},
|
||||
{"label": "Q", "matrix": [2, 0], "x": 1.5, "y": 2.4},
|
||||
{"label": "W", "matrix": [2, 1], "x": 2.5, "y": 2.4},
|
||||
{"label": "E", "matrix": [2, 2], "x": 3.5, "y": 2.4},
|
||||
{"label": "R", "matrix": [2, 3], "x": 4.5, "y": 2.4},
|
||||
{"label": "T", "matrix": [3, 3], "x": 5.5, "y": 2.4},
|
||||
{"label": "Y", "matrix": [3, 4], "x": 6.5, "y": 2.4},
|
||||
{"label": "U", "matrix": [2, 4], "x": 7.5, "y": 2.4},
|
||||
{"label": "I", "matrix": [2, 5], "x": 8.5, "y": 2.4},
|
||||
{"label": "O", "matrix": [2, 6], "x": 9.5, "y": 2.4},
|
||||
{"label": "P", "matrix": [2, 7], "x": 10.5, "y": 2.4},
|
||||
{"label": "[{", "matrix": [3, 7], "x": 11.5, "y": 2.4},
|
||||
{"label": "]}", "matrix": [3, 5], "x": 12.5, "y": 2.4},
|
||||
{"label": "Caps Lock", "matrix": [3, 1], "x": 0, "y": 3.4, "w": 1.75},
|
||||
{"label": "A", "matrix": [4, 0], "x": 1.75, "y": 3.4},
|
||||
{"label": "S", "matrix": [4, 1], "x": 2.75, "y": 3.4},
|
||||
{"label": "D", "matrix": [4, 2], "x": 3.75, "y": 3.4},
|
||||
{"label": "F", "matrix": [4, 3], "x": 4.75, "y": 3.4},
|
||||
{"label": "G", "matrix": [5, 3], "x": 5.75, "y": 3.4},
|
||||
{"label": "H", "matrix": [5, 4], "x": 6.75, "y": 3.4},
|
||||
{"label": "J", "matrix": [4, 4], "x": 7.75, "y": 3.4},
|
||||
{"label": "K", "matrix": [4, 5], "x": 8.75, "y": 3.4},
|
||||
{"label": "L", "matrix": [4, 6], "x": 9.75, "y": 3.4},
|
||||
{"label": ";:", "matrix": [4, 7], "x": 10.75, "y": 3.4},
|
||||
{"label": "'@", "matrix": [5, 7], "x": 11.75, "y": 3.4},
|
||||
{"label": "#~", "matrix": [6, 7], "x": 12.75, "y": 3.4},
|
||||
{"label": "Enter", "matrix": [6, 8], "x": 13.75, "y": 2.4, "w": 1.25, "h": 2},
|
||||
{"label": "Shift", "matrix": [3, 14], "x": 0, "y": 4.4, "w": 1.25},
|
||||
{"label": "\\|", "matrix": [5, 1], "x": 1.25, "y": 4.4},
|
||||
{"label": "Z", "matrix": [6, 0], "x": 2.25, "y": 4.4},
|
||||
{"label": "X", "matrix": [6, 1], "x": 3.25, "y": 4.4},
|
||||
{"label": "C", "matrix": [6, 2], "x": 4.25, "y": 4.4},
|
||||
{"label": "V", "matrix": [6, 3], "x": 5.25, "y": 4.4},
|
||||
{"label": "B", "matrix": [7, 3], "x": 6.25, "y": 4.4},
|
||||
{"label": "N", "matrix": [7, 4], "x": 7.25, "y": 4.4},
|
||||
{"label": "M", "matrix": [6, 4], "x": 8.25, "y": 4.4},
|
||||
{"label": ",<", "matrix": [6, 5], "x": 9.25, "y": 4.4},
|
||||
{"label": ".>", "matrix": [6, 6], "x": 10.25, "y": 4.4},
|
||||
{"label": "/?", "matrix": [7, 7], "x": 11.25, "y": 4.4},
|
||||
{"label": "Shift", "matrix": [6, 14], "x": 12.25, "y": 4.4, "w": 2.75},
|
||||
{"label": "Fn", "matrix": [4, 9], "x": 0, "y": 5.4},
|
||||
{"label": "Ctrl", "matrix": [0, 15], "x": 1, "y": 5.4, "w": 1.25},
|
||||
{"label": "Left OS", "matrix": [2, 11], "x": 2.25, "y": 5.4, "w": 0.9},
|
||||
{"label": "Alt", "matrix": [5, 13], "x": 3.15, "y": 5.4},
|
||||
{"label": "Space", "matrix": [7, 8], "x": 4.15, "y": 5.4, "w": 5},
|
||||
{"label": "AltGr", "matrix": [7, 13], "x": 9.25, "y": 5.4},
|
||||
{"label": "Menu", "matrix": [4, 11], "x": 10.25, "y": 5.4},
|
||||
{"label": "Ctrl", "matrix": [6, 15], "x": 11.25, "y": 5.4},
|
||||
{"label": "Browser Back", "matrix": [6, 11], "x": 12.25, "y": 5.4, "w": 0.9, "h": 0.75},
|
||||
{"label": "Up", "matrix": [5, 12], "x": 13.15, "y": 5.4, "w": 0.9, "h": 0.75},
|
||||
{"label": "Browser Forward", "matrix": [7, 11], "x": 14.05, "y": 5.4, "w": 0.9, "h": 0.75},
|
||||
{"label": "Left", "matrix": [7, 12], "x": 12.25, "y": 6.15, "w": 0.9, "h": 0.75},
|
||||
{"label": "Down", "matrix": [7, 10], "x": 13.15, "y": 6.15, "w": 0.9, "h": 0.75},
|
||||
{"label": "Right", "matrix": [7, 9], "x": 14.05, "y": 6.15, "w": 0.9, "h": 0.75}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"manufacturer": "Frank Adams",
|
||||
"keyboard_name": "converter/thinkpad_t6x/pico_t61",
|
||||
"maintainer": "Al En",
|
||||
"matrix_pins": {
|
||||
"cols": ["GP27", "GP26", "GP17", "GP14", "GP12", "GP19", "GP18", "GP15", "GP13", "GP6", "GP16", "GP5", "GP28", "GP2", "GP4", "GP3"],
|
||||
"rows": ["GP11", "GP22", "GP10", "GP21", "GP9", "GP20", "GP8", "GP7"]
|
||||
},
|
||||
"ps2": {
|
||||
"clock_pin": "GP0",
|
||||
"data_pin": "GP1"
|
||||
},
|
||||
"url": "https://github.com/thedalles77/USB_Laptop_Keyboard_Controller/tree/master/Example_Keyboards/Pico_T61_Keyboard",
|
||||
"usb": {
|
||||
"device_version": "1.0.0",
|
||||
"pid": "0xBACA",
|
||||
"vid": "0xFEED"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
# converter/thinkpad_t6x/pico_t61
|
||||
|
||||

|
||||
|
||||
This is a converter PCB for Lenovo Thinkpad keyboards from T60, T400 and X200 series, based on the Raspberry Pi Pico W. The QMK implementation here is specific to the converter in the link below. Similar PCB designs to convert a Thinkpad keyboard to USB exist, but they use a different microcontroller and wiring of the keyboard connector with the MCU.
|
||||
|
||||
* Keyboard Maintainer: [Al En](https://github.com/gitaen)
|
||||
* Hardware Supported: The linked converter PCB with keyboards from various Thinkpad models
|
||||
* Hardware Availability: [Custom PCB](https://github.com/thedalles77/USB_Laptop_Keyboard_Controller/tree/master/Example_Keyboards/Pico_T61_Keyboard)
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make converter/thinkpad_t6x/pico_t61:default
|
||||
|
||||
Flashing example for this keyboard:
|
||||
|
||||
make converter/thinkpad_t6x/pico_t61: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 (\`~) and plug in the keyboard
|
||||
* **Physical BOOTSEL button**: Hold down the BOOTSEL button on the Raspberry PiPico W and plug the keyboard
|
||||
* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
|
||||
@@ -2,130 +2,18 @@
|
||||
"manufacturer": "strobo5",
|
||||
"keyboard_name": "converter/thinkpad_t6x/rpi_pico",
|
||||
"maintainer": "strobo5",
|
||||
"board": "GENERIC_RP_RP2040",
|
||||
"bootloader": "rp2040",
|
||||
"diode_direction": "COL2ROW",
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"extrakey": true,
|
||||
"mousekey": true
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["GP7", "GP9", "GP11", "GP13", "GP17", "GP16", "GP14", "GP12", "GP15", "GP8", "GP10", "GP6", "GP4", "GP2", "GP5", "GP3"],
|
||||
"rows": ["GP20", "GP26", "GP22", "GP21", "GP18", "GP19", "GP27", "GP28"]
|
||||
},
|
||||
"processor": "RP2040",
|
||||
"ps2": {
|
||||
"clock_pin": "GP1",
|
||||
"data_pin": "GP0",
|
||||
"driver": "vendor",
|
||||
"enabled": true,
|
||||
"mouse_enabled": true
|
||||
"data_pin": "GP0"
|
||||
},
|
||||
"url": "https://github.com/strobo5/T61_PiPico_Scanner",
|
||||
"usb": {
|
||||
"device_version": "1.0.0",
|
||||
"pid": "0x0000",
|
||||
"vid": "0xFEED"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT_iso": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [5, 0], "x": 0, "y": 0, "w": 0.9, "h": 0.75},
|
||||
{"label": "Mute", "matrix": [4, 10], "x": 0.9, "y": 0, "w": 0.75, "h": 0.5},
|
||||
{"label": "Vol -", "matrix": [3, 10], "x": 1.65, "y": 0, "w": 0.75, "h": 0.5},
|
||||
{"label": "Vol +", "matrix": [2, 10], "x": 2.4, "y": 0, "w": 0.75, "h": 0.5},
|
||||
{"label": "ThinkVantage", "matrix": [5, 10], "x": 3.5, "y": 0, "w": 1.25, "h": 0.5},
|
||||
{"label": "PrtSc", "matrix": [1, 13], "x": 8.9, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "ScrLk", "matrix": [2, 13], "x": 9.8, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "Pause", "matrix": [6, 12], "x": 10.7, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "Insert", "matrix": [0, 9], "x": 12, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "Home", "matrix": [0, 12], "x": 12.9, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "PgUp", "matrix": [0, 11], "x": 13.8, "y": 0, "w": 0.9, "h": 0.65},
|
||||
{"label": "F1", "matrix": [0, 1], "x": 0, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F2", "matrix": [0, 2], "x": 0.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F3", "matrix": [3, 2], "x": 1.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F4", "matrix": [5, 2], "x": 2.7, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F5", "matrix": [5, 8], "x": 4, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F6", "matrix": [5, 5], "x": 4.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F7", "matrix": [3, 6], "x": 5.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F8", "matrix": [0, 6], "x": 6.7, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F9", "matrix": [0, 8], "x": 8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F10", "matrix": [1, 8], "x": 8.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F11", "matrix": [1, 10], "x": 9.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "F12", "matrix": [1, 9], "x": 10.7, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "Delete", "matrix": [0, 10], "x": 12, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "End", "matrix": [1, 12], "x": 12.9, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "PgDn", "matrix": [1, 11], "x": 13.8, "y": 0.75, "w": 0.9, "h": 0.65},
|
||||
{"label": "`\u00ac", "matrix": [0, 0], "x": 0, "y": 1.4},
|
||||
{"label": "1!", "matrix": [1, 0], "x": 1, "y": 1.4},
|
||||
{"label": "2\"", "matrix": [1, 1], "x": 2, "y": 1.4},
|
||||
{"label": "3\u00a3", "matrix": [1, 2], "x": 3, "y": 1.4},
|
||||
{"label": "4$", "matrix": [1, 3], "x": 4, "y": 1.4},
|
||||
{"label": "5%", "matrix": [0, 3], "x": 5, "y": 1.4},
|
||||
{"label": "6^", "matrix": [0, 4], "x": 6, "y": 1.4},
|
||||
{"label": "7&", "matrix": [1, 4], "x": 7, "y": 1.4},
|
||||
{"label": "8*", "matrix": [1, 5], "x": 8, "y": 1.4},
|
||||
{"label": "9(", "matrix": [1, 6], "x": 9, "y": 1.4},
|
||||
{"label": "0)", "matrix": [1, 7], "x": 10, "y": 1.4},
|
||||
{"label": "-_", "matrix": [0, 7], "x": 11, "y": 1.4},
|
||||
{"label": "=+", "matrix": [0, 5], "x": 12, "y": 1.4},
|
||||
{"label": "Bksp", "matrix": [3, 8], "x": 13, "y": 1.4, "w": 2},
|
||||
{"label": "Tab", "matrix": [3, 0], "x": 0, "y": 2.4, "w": 1.5},
|
||||
{"label": "Q", "matrix": [2, 0], "x": 1.5, "y": 2.4},
|
||||
{"label": "W", "matrix": [2, 1], "x": 2.5, "y": 2.4},
|
||||
{"label": "E", "matrix": [2, 2], "x": 3.5, "y": 2.4},
|
||||
{"label": "R", "matrix": [2, 3], "x": 4.5, "y": 2.4},
|
||||
{"label": "T", "matrix": [3, 3], "x": 5.5, "y": 2.4},
|
||||
{"label": "Y", "matrix": [3, 4], "x": 6.5, "y": 2.4},
|
||||
{"label": "U", "matrix": [2, 4], "x": 7.5, "y": 2.4},
|
||||
{"label": "I", "matrix": [2, 5], "x": 8.5, "y": 2.4},
|
||||
{"label": "O", "matrix": [2, 6], "x": 9.5, "y": 2.4},
|
||||
{"label": "P", "matrix": [2, 7], "x": 10.5, "y": 2.4},
|
||||
{"label": "[{", "matrix": [3, 7], "x": 11.5, "y": 2.4},
|
||||
{"label": "]}", "matrix": [3, 5], "x": 12.5, "y": 2.4},
|
||||
{"label": "Caps Lock", "matrix": [3, 1], "x": 0, "y": 3.4, "w": 1.75},
|
||||
{"label": "A", "matrix": [4, 0], "x": 1.75, "y": 3.4},
|
||||
{"label": "S", "matrix": [4, 1], "x": 2.75, "y": 3.4},
|
||||
{"label": "D", "matrix": [4, 2], "x": 3.75, "y": 3.4},
|
||||
{"label": "F", "matrix": [4, 3], "x": 4.75, "y": 3.4},
|
||||
{"label": "G", "matrix": [5, 3], "x": 5.75, "y": 3.4},
|
||||
{"label": "H", "matrix": [5, 4], "x": 6.75, "y": 3.4},
|
||||
{"label": "J", "matrix": [4, 4], "x": 7.75, "y": 3.4},
|
||||
{"label": "K", "matrix": [4, 5], "x": 8.75, "y": 3.4},
|
||||
{"label": "L", "matrix": [4, 6], "x": 9.75, "y": 3.4},
|
||||
{"label": ";:", "matrix": [4, 7], "x": 10.75, "y": 3.4},
|
||||
{"label": "'@", "matrix": [5, 7], "x": 11.75, "y": 3.4},
|
||||
{"label": "#~", "matrix": [6, 7], "x": 12.75, "y": 3.4},
|
||||
{"label": "Enter", "matrix": [6, 8], "x": 13.75, "y": 2.4, "w": 1.25, "h": 2},
|
||||
{"label": "Shift", "matrix": [3, 14], "x": 0, "y": 4.4, "w": 1.25},
|
||||
{"label": "\\|", "matrix": [5, 1], "x": 1.25, "y": 4.4},
|
||||
{"label": "Z", "matrix": [6, 0], "x": 2.25, "y": 4.4},
|
||||
{"label": "X", "matrix": [6, 1], "x": 3.25, "y": 4.4},
|
||||
{"label": "C", "matrix": [6, 2], "x": 4.25, "y": 4.4},
|
||||
{"label": "V", "matrix": [6, 3], "x": 5.25, "y": 4.4},
|
||||
{"label": "B", "matrix": [7, 3], "x": 6.25, "y": 4.4},
|
||||
{"label": "N", "matrix": [7, 4], "x": 7.25, "y": 4.4},
|
||||
{"label": "M", "matrix": [6, 4], "x": 8.25, "y": 4.4},
|
||||
{"label": ",<", "matrix": [6, 5], "x": 9.25, "y": 4.4},
|
||||
{"label": ".>", "matrix": [6, 6], "x": 10.25, "y": 4.4},
|
||||
{"label": "/?", "matrix": [7, 7], "x": 11.25, "y": 4.4},
|
||||
{"label": "Shift", "matrix": [6, 14], "x": 12.25, "y": 4.4, "w": 2.75},
|
||||
{"label": "Fn", "matrix": [4, 9], "x": 0, "y": 5.4},
|
||||
{"label": "Ctrl", "matrix": [0, 15], "x": 1, "y": 5.4, "w": 1.25},
|
||||
{"label": "Left OS", "matrix": [2, 11], "x": 2.25, "y": 5.4, "w": 0.9},
|
||||
{"label": "Alt", "matrix": [5, 13], "x": 3.15, "y": 5.4},
|
||||
{"label": "Space", "matrix": [7, 8], "x": 4.15, "y": 5.4, "w": 5},
|
||||
{"label": "AltGr", "matrix": [7, 13], "x": 9.25, "y": 5.4},
|
||||
{"label": "Menu", "matrix": [4, 11], "x": 10.25, "y": 5.4},
|
||||
{"label": "Ctrl", "matrix": [6, 15], "x": 11.25, "y": 5.4},
|
||||
{"label": "Browser Back", "matrix": [6, 11], "x": 12.25, "y": 5.4, "w": 0.9, "h": 0.75},
|
||||
{"label": "Up", "matrix": [5, 12], "x": 13.15, "y": 5.4, "w": 0.9, "h": 0.75},
|
||||
{"label": "Browser Forward", "matrix": [7, 11], "x": 14.05, "y": 5.4, "w": 0.9, "h": 0.75},
|
||||
{"label": "Left", "matrix": [7, 12], "x": 12.25, "y": 6.15, "w": 0.9, "h": 0.75},
|
||||
{"label": "Down", "matrix": [7, 10], "x": 13.15, "y": 6.15, "w": 0.9, "h": 0.75},
|
||||
{"label": "Right", "matrix": [7, 9], "x": 14.05, "y": 6.15, "w": 0.9, "h": 0.75}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// Copyright 2022 Nick Brassel (@tzarc)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
void bootloader_jump(void) {
|
||||
// TODO: Work out how to jump to LDROM, for now just reset the board.
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
{
|
||||
"keyboard_name": "One 2 SF ANSI",
|
||||
"usb": {
|
||||
"pid": "0x07AF",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"layout_aliases": {
|
||||
"LAYOUT_ansi": "LAYOUT"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4, "y": 0},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5, "y": 0},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6, "y": 0},
|
||||
{"label": "7", "matrix": [0, 7], "x": 7, "y": 0},
|
||||
{"label": "8", "matrix": [0, 8], "x": 8, "y": 0},
|
||||
{"label": "9", "matrix": [0, 9], "x": 9, "y": 0},
|
||||
{"label": "0", "matrix": [0, 10], "x": 10, "y": 0},
|
||||
{"label": "-", "matrix": [0, 11], "x": 11, "y": 0},
|
||||
{"label": "=", "matrix": [0, 12], "x": 12, "y": 0},
|
||||
{"label": "Backspace", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
|
||||
|
||||
{"label": "Delete", "matrix": [0, 14], "x": 15.25, "y": 0},
|
||||
|
||||
{"label": "Tab", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1},
|
||||
{"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1},
|
||||
{"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1},
|
||||
{"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1},
|
||||
{"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1},
|
||||
{"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1},
|
||||
{"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1},
|
||||
{"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1},
|
||||
{"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1},
|
||||
{"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1},
|
||||
{"label": "[", "matrix": [1, 11], "x": 11.5, "y": 1},
|
||||
{"label": "]", "matrix": [1, 12], "x": 12.5, "y": 1},
|
||||
{"label": "\\", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5},
|
||||
|
||||
{"label": "Page Up", "matrix": [1, 14], "x": 15.25, "y": 1},
|
||||
|
||||
{"label": "Caps Lock", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2},
|
||||
{"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2},
|
||||
{"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2},
|
||||
{"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2},
|
||||
{"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2},
|
||||
{"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2},
|
||||
{"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2},
|
||||
{"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2},
|
||||
{"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2},
|
||||
{"label": ";", "matrix": [2, 10], "x": 10.75, "y": 2},
|
||||
{"label": "'", "matrix": [2, 11], "x": 11.75, "y": 2},
|
||||
{"label": "Enter", "matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25},
|
||||
|
||||
{"label": "Page Down", "matrix": [2, 14], "x": 15.25, "y": 2},
|
||||
|
||||
{"label": "Shift", "matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
|
||||
{"label": "Z", "matrix": [3, 2], "x": 2.25, "y": 3},
|
||||
{"label": "X", "matrix": [3, 3], "x": 3.25, "y": 3},
|
||||
{"label": "C", "matrix": [3, 4], "x": 4.25, "y": 3},
|
||||
{"label": "V", "matrix": [3, 5], "x": 5.25, "y": 3},
|
||||
{"label": "B", "matrix": [3, 6], "x": 6.25, "y": 3},
|
||||
{"label": "N", "matrix": [3, 7], "x": 7.25, "y": 3},
|
||||
{"label": "M", "matrix": [3, 8], "x": 8.25, "y": 3},
|
||||
{"label": ",", "matrix": [3, 9], "x": 9.25, "y": 3},
|
||||
{"label": ".", "matrix": [3, 10], "x": 10.25, "y": 3},
|
||||
{"label": "/", "matrix": [3, 11], "x": 11.25, "y": 3},
|
||||
{"label": "Shift", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 2},
|
||||
{"label": "\u2191", "matrix": [3, 13], "x": 14.25, "y": 3},
|
||||
|
||||
{"label": "Ctrl", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
|
||||
{"label": "GUI", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
|
||||
{"label": "Alt", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25},
|
||||
{"label": "Space", "matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25},
|
||||
{"label": "Alt", "matrix": [4, 9], "x": 10, "y": 4},
|
||||
{"label": "Fn", "matrix": [4, 10], "x": 11, "y": 4},
|
||||
{"label": "Ctrl", "matrix": [4, 11], "x": 12, "y": 4, "w": 1.25},
|
||||
{"label": "\u2190", "matrix": [4, 12], "x": 13.25, "y": 4},
|
||||
{"label": "\u2193", "matrix": [4, 13], "x": 14.25, "y": 4},
|
||||
{"label": "\u2192", "matrix": [4, 14], "x": 15.25, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright 2019 /u/KeepItUnder
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
#define GRAVE_ESC_GUI_OVERRIDE
|
||||
#define MK_3_SPEED
|
||||
#define MK_C_OFFSET_UNMOD 400 /* Cursor offset per movement (unmodified) */
|
||||
#define MK_C_INTERVAL_UNMOD 5 /* Time between cursor movements (unmodified) */
|
||||
#define MK_W_OFFSET_UNMOD 100 /* Scroll steps per scroll action (unmodified) */
|
||||
#define MK_W_INTERVAL_UNMOD 10 /* Time between scroll steps (unmodified) */
|
||||
+10
-27
@@ -1,34 +1,17 @@
|
||||
/* Copyright 2019 /u/KeepItUnder
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
// Copyright 2019 /u/KeepItUnder
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// LAYERS
|
||||
enum Layer {
|
||||
_QWERTY = 0, // Standard QWERTY layer
|
||||
_FUNCTION, // Function key layer
|
||||
_COLOUR // RGB key layer
|
||||
_QWERTY,
|
||||
_FUNCTION,
|
||||
_COLOUR
|
||||
};
|
||||
#define _QW _QWERTY
|
||||
#define _FN _FUNCTION
|
||||
#define _CLR _COLOUR
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_ansi(
|
||||
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
[_QWERTY] = LAYOUT(
|
||||
QK_GESC, 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_DEL,
|
||||
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_PGUP,
|
||||
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_PGDN,
|
||||
@@ -36,15 +19,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_FUNCTION] = LAYOUT_ansi(
|
||||
[_FUNCTION] = LAYOUT(
|
||||
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_DEL, _______,
|
||||
_______, MS_BTN1, MS_UP, MS_BTN2, MS_WHLU, _______, KC_INS, _______, KC_UP, KC_PAUS, KC_PGUP, KC_HOME, KC_PSCR, _______, KC_HOME,
|
||||
_______, MS_LEFT, MS_DOWN, MS_RGHT, MS_WHLD, _______, KC_SCRL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, _______, KC_END,
|
||||
_______, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
|
||||
_______, _______, _______, _______, MO(2), _______, _______, _______, _______, _______
|
||||
_______, _______, _______, QK_BOOT, MO(2), _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_COLOUR] = LAYOUT_ansi(
|
||||
[_COLOUR] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
@@ -1,18 +1,5 @@
|
||||
/* Copyright 2020 QMK
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
// Copyright 2020 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -1,19 +1,5 @@
|
||||
/*
|
||||
Copyright 2019 /u/KeepItUnder
|
||||
|
||||
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/>.
|
||||
*/
|
||||
// Copyright 2019 /u/KeepItUnder
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"manufacturer": "Ducky",
|
||||
"maintainer": "f7urry",
|
||||
"bootloader": "custom",
|
||||
"usb": {
|
||||
"vid": "0x445B"
|
||||
},
|
||||
"host": {
|
||||
"default": {
|
||||
"nkro": true
|
||||
}
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B10", "B9", "C13", "C12", "C11", "C10", "C9", "C8", "A15", "A14", "A13", "D0", "D1", "D2", "B15"],
|
||||
"rows": ["D11", "B4", "B5", "B6", "B7"]
|
||||
},
|
||||
"diode_direction": "COL2ROW",
|
||||
"features": {
|
||||
"mousekey": true,
|
||||
"extrakey": true,
|
||||
"nkro": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
{
|
||||
"keyboard_name": "One 2 SF ISO",
|
||||
"usb": {
|
||||
"pid": "0x07AE",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"layout_aliases": {
|
||||
"LAYOUT_iso": "LAYOUT"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4, "y": 0},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5, "y": 0},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6, "y": 0},
|
||||
{"label": "7", "matrix": [0, 7], "x": 7, "y": 0},
|
||||
{"label": "8", "matrix": [0, 8], "x": 8, "y": 0},
|
||||
{"label": "9", "matrix": [0, 9], "x": 9, "y": 0},
|
||||
{"label": "0", "matrix": [0, 10], "x": 10, "y": 0},
|
||||
{"label": "-", "matrix": [0, 11], "x": 11, "y": 0},
|
||||
{"label": "=", "matrix": [0, 12], "x": 12, "y": 0},
|
||||
{"label": "Backspace", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
|
||||
|
||||
{"label": "Delete", "matrix": [0, 14], "x": 15.25, "y": 0},
|
||||
|
||||
{"label": "Tab", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1},
|
||||
{"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1},
|
||||
{"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1},
|
||||
{"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1},
|
||||
{"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1},
|
||||
{"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1},
|
||||
{"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1},
|
||||
{"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1},
|
||||
{"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1},
|
||||
{"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1},
|
||||
{"label": "[", "matrix": [1, 11], "x": 11.5, "y": 1},
|
||||
{"label": "]", "matrix": [1, 12], "x": 12.5, "y": 1},
|
||||
|
||||
{"label": "Page Up", "matrix": [1, 14], "x": 15.25, "y": 1},
|
||||
|
||||
{"label": "Caps Lock", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2},
|
||||
{"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2},
|
||||
{"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2},
|
||||
{"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2},
|
||||
{"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2},
|
||||
{"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2},
|
||||
{"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2},
|
||||
{"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2},
|
||||
{"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2},
|
||||
{"label": ";", "matrix": [2, 10], "x": 10.75, "y": 2},
|
||||
{"label": "'", "matrix": [2, 11], "x": 11.75, "y": 2},
|
||||
{"label": "#", "matrix": [2, 12], "x": 12.75, "y": 2},
|
||||
{"label": "Enter", "matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2},
|
||||
|
||||
{"label": "Page Down", "matrix": [2, 14], "x": 15.25, "y": 2},
|
||||
|
||||
{"label": "Shift", "matrix": [3, 0], "x": 0, "y": 3, "w": 1.25},
|
||||
{"label": "\\", "matrix": [3, 1], "x": 1.25, "y": 3},
|
||||
{"label": "Z", "matrix": [3, 2], "x": 2.25, "y": 3},
|
||||
{"label": "X", "matrix": [3, 3], "x": 3.25, "y": 3},
|
||||
{"label": "C", "matrix": [3, 4], "x": 4.25, "y": 3},
|
||||
{"label": "V", "matrix": [3, 5], "x": 5.25, "y": 3},
|
||||
{"label": "B", "matrix": [3, 6], "x": 6.25, "y": 3},
|
||||
{"label": "N", "matrix": [3, 7], "x": 7.25, "y": 3},
|
||||
{"label": "M", "matrix": [3, 8], "x": 8.25, "y": 3},
|
||||
{"label": ",", "matrix": [3, 9], "x": 9.25, "y": 3},
|
||||
{"label": ".", "matrix": [3, 10], "x": 10.25, "y": 3},
|
||||
{"label": "/", "matrix": [3, 11], "x": 11.25, "y": 3},
|
||||
{"label": "Shift", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 2},
|
||||
{"label": "\u2191", "matrix": [3, 13], "x": 14.25, "y": 3},
|
||||
|
||||
{"label": "Ctrl", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
|
||||
{"label": "GUI", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
|
||||
{"label": "Alt", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25},
|
||||
{"label": "Space", "matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25},
|
||||
{"label": "Alt", "matrix": [4, 9], "x": 10, "y": 4},
|
||||
{"label": "Fn", "matrix": [4, 10], "x": 11, "y": 4},
|
||||
{"label": "Ctrl", "matrix": [4, 11], "x": 12, "y": 4, "w": 1.25},
|
||||
{"label": "\u2190", "matrix": [4, 12], "x": 13.25, "y": 4},
|
||||
{"label": "\u2193", "matrix": [4, 13], "x": 14.25, "y": 4},
|
||||
{"label": "\u2192", "matrix": [4, 14], "x": 15.25, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// Copyright 2019 /u/KeepItUnder
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
#define GRAVE_ESC_GUI_OVERRIDE
|
||||
#define MK_3_SPEED
|
||||
#define MK_C_OFFSET_UNMOD 400 /* Cursor offset per movement (unmodified) */
|
||||
#define MK_C_INTERVAL_UNMOD 5 /* Time between cursor movements (unmodified) */
|
||||
#define MK_W_OFFSET_UNMOD 100 /* Scroll steps per scroll action (unmodified) */
|
||||
#define MK_W_INTERVAL_UNMOD 10 /* Time between scroll steps (unmodified) */
|
||||
+10
-27
@@ -1,34 +1,17 @@
|
||||
/* Copyright 2019 /u/KeepItUnder
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
// Copyright 2019 /u/KeepItUnder
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
// LAYERS
|
||||
enum Layer {
|
||||
_QWERTY = 0, // Standard QWERTY layer
|
||||
_FUNCTION, // Function key layer
|
||||
_COLOUR // RGB key layer
|
||||
_QWERTY,
|
||||
_FUNCTION,
|
||||
_COLOUR
|
||||
};
|
||||
#define _QW _QWERTY
|
||||
#define _FN _FUNCTION
|
||||
#define _CLR _COLOUR
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_iso(
|
||||
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
[_QWERTY] = LAYOUT(
|
||||
QK_GESC, 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_DEL,
|
||||
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_PGUP,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN,
|
||||
@@ -36,15 +19,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_FUNCTION] = LAYOUT_iso(
|
||||
[_FUNCTION] = LAYOUT(
|
||||
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_DEL, _______,
|
||||
_______, MS_BTN1, MS_UP, MS_BTN2, MS_WHLU, _______, KC_INS, _______, KC_UP, KC_PAUS, KC_PGUP, KC_HOME, KC_PSCR, KC_HOME,
|
||||
_______, MS_LEFT, MS_DOWN, MS_RGHT, MS_WHLD, _______, KC_SCRL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_END, _______, _______, KC_END,
|
||||
_______, _______, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
|
||||
_______, _______, _______, _______, MO(2), _______, _______, _______, _______, _______
|
||||
_______, _______, _______, QK_BOOT, MO(2), _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_COLOUR] = LAYOUT_iso(
|
||||
[_COLOUR] = LAYOUT(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
@@ -1,269 +0,0 @@
|
||||
{
|
||||
"keyboard_name": "One 2 SF",
|
||||
"manufacturer": "Ducky",
|
||||
"maintainer": "f7urry",
|
||||
"usb": {
|
||||
"vid": "0x445B",
|
||||
"pid": "0x07AF",
|
||||
"device_version": "0.0.1"
|
||||
},
|
||||
"host": {
|
||||
"default": {
|
||||
"nkro": true
|
||||
}
|
||||
},
|
||||
"matrix_pins": {
|
||||
"cols": ["B10", "B9", "C13", "C12", "C11", "C10", "C9", "C8", "A15", "A14", "A13", "D0", "D1", "D2", "B15", "B8"],
|
||||
"rows": ["D11", "B4", "B5", "B6", "B7"]
|
||||
},
|
||||
"diode_direction": "COL2ROW",
|
||||
"dip_switch": {
|
||||
"matrix_grid": [ [0,14], [1,14], [2,14], [3,14] ]
|
||||
},
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"mousekey": true,
|
||||
"extrakey": true,
|
||||
"nkro": true,
|
||||
"dip_switch": true
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT_all": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4, "y": 0},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5, "y": 0},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6, "y": 0},
|
||||
{"label": "7", "matrix": [0, 7], "x": 7, "y": 0},
|
||||
{"label": "8", "matrix": [0, 8], "x": 8, "y": 0},
|
||||
{"label": "9", "matrix": [0, 9], "x": 9, "y": 0},
|
||||
{"label": "0", "matrix": [0, 10], "x": 10, "y": 0},
|
||||
{"label": "-", "matrix": [0, 11], "x": 11, "y": 0},
|
||||
{"label": "=", "matrix": [0, 12], "x": 12, "y": 0},
|
||||
{"label": "Backspace", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
|
||||
|
||||
{"label": "Delete", "matrix": [0, 14], "x": 15.25, "y": 0},
|
||||
|
||||
{"label": "Tab", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1},
|
||||
{"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1},
|
||||
{"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1},
|
||||
{"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1},
|
||||
{"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1},
|
||||
{"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1},
|
||||
{"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1},
|
||||
{"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1},
|
||||
{"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1},
|
||||
{"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1},
|
||||
{"label": "[", "matrix": [1, 11], "x": 11.5, "y": 1},
|
||||
{"label": "]", "matrix": [1, 12], "x": 12.5, "y": 1},
|
||||
{"label": "\\", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5},
|
||||
|
||||
{"label": "Page Up", "matrix": [1, 14], "x": 15.25, "y": 1},
|
||||
|
||||
{"label": "Caps Lock", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2},
|
||||
{"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2},
|
||||
{"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2},
|
||||
{"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2},
|
||||
{"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2},
|
||||
{"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2},
|
||||
{"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2},
|
||||
{"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2},
|
||||
{"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2},
|
||||
{"label": ";", "matrix": [2, 10], "x": 10.75, "y": 2},
|
||||
{"label": "'", "matrix": [2, 11], "x": 11.75, "y": 2},
|
||||
{"label": "#", "matrix": [2, 12], "x": 12.75, "y": 2},
|
||||
{"label": "Enter", "matrix": [2, 13], "x": 13.75, "y": 2, "w": 1.25},
|
||||
|
||||
{"label": "Page Down", "matrix": [2, 14], "x": 15.25, "y": 2},
|
||||
|
||||
{"label": "Shift", "matrix": [3, 0], "x": 0, "y": 3, "w": 1.25},
|
||||
{"label": "\\", "matrix": [3, 1], "x": 1.25, "y": 3},
|
||||
{"label": "Z", "matrix": [3, 2], "x": 2.25, "y": 3},
|
||||
{"label": "X", "matrix": [3, 3], "x": 3.25, "y": 3},
|
||||
{"label": "C", "matrix": [3, 4], "x": 4.25, "y": 3},
|
||||
{"label": "V", "matrix": [3, 5], "x": 5.25, "y": 3},
|
||||
{"label": "B", "matrix": [3, 6], "x": 6.25, "y": 3},
|
||||
{"label": "N", "matrix": [3, 7], "x": 7.25, "y": 3},
|
||||
{"label": "M", "matrix": [3, 8], "x": 8.25, "y": 3},
|
||||
{"label": ",", "matrix": [3, 9], "x": 9.25, "y": 3},
|
||||
{"label": ".", "matrix": [3, 10], "x": 10.25, "y": 3},
|
||||
{"label": "/", "matrix": [3, 11], "x": 11.25, "y": 3},
|
||||
{"label": "Shift", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 2},
|
||||
{"label": "\u2191", "matrix": [3, 13], "x": 14.25, "y": 3},
|
||||
|
||||
{"label": "Ctrl", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
|
||||
{"label": "GUI", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
|
||||
{"label": "Alt", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25},
|
||||
{"label": "Space", "matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25},
|
||||
{"label": "Alt", "matrix": [4, 9], "x": 10, "y": 4},
|
||||
{"label": "Fn", "matrix": [4, 10], "x": 11, "y": 4},
|
||||
{"label": "Ctrl", "matrix": [4, 11], "x": 12, "y": 4, "w": 1.25},
|
||||
{"label": "\u2190", "matrix": [4, 12], "x": 13.25, "y": 4},
|
||||
{"label": "\u2193", "matrix": [4, 13], "x": 14.25, "y": 4},
|
||||
{"label": "\u2192", "matrix": [4, 14], "x": 15.25, "y": 4}
|
||||
]
|
||||
},
|
||||
"LAYOUT_ansi": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4, "y": 0},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5, "y": 0},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6, "y": 0},
|
||||
{"label": "7", "matrix": [0, 7], "x": 7, "y": 0},
|
||||
{"label": "8", "matrix": [0, 8], "x": 8, "y": 0},
|
||||
{"label": "9", "matrix": [0, 9], "x": 9, "y": 0},
|
||||
{"label": "0", "matrix": [0, 10], "x": 10, "y": 0},
|
||||
{"label": "-", "matrix": [0, 11], "x": 11, "y": 0},
|
||||
{"label": "=", "matrix": [0, 12], "x": 12, "y": 0},
|
||||
{"label": "Backspace", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
|
||||
|
||||
{"label": "Delete", "matrix": [0, 14], "x": 15.25, "y": 0},
|
||||
|
||||
{"label": "Tab", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1},
|
||||
{"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1},
|
||||
{"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1},
|
||||
{"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1},
|
||||
{"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1},
|
||||
{"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1},
|
||||
{"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1},
|
||||
{"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1},
|
||||
{"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1},
|
||||
{"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1},
|
||||
{"label": "[", "matrix": [1, 11], "x": 11.5, "y": 1},
|
||||
{"label": "]", "matrix": [1, 12], "x": 12.5, "y": 1},
|
||||
{"label": "\\", "matrix": [1, 13], "x": 13.5, "y": 1, "w": 1.5},
|
||||
|
||||
{"label": "Page Up", "matrix": [1, 14], "x": 15.25, "y": 1},
|
||||
|
||||
{"label": "Caps Lock", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2},
|
||||
{"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2},
|
||||
{"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2},
|
||||
{"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2},
|
||||
{"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2},
|
||||
{"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2},
|
||||
{"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2},
|
||||
{"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2},
|
||||
{"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2},
|
||||
{"label": ";", "matrix": [2, 10], "x": 10.75, "y": 2},
|
||||
{"label": "'", "matrix": [2, 11], "x": 11.75, "y": 2},
|
||||
{"label": "Enter", "matrix": [2, 13], "x": 12.75, "y": 2, "w": 2.25},
|
||||
|
||||
{"label": "Page Down", "matrix": [2, 14], "x": 15.25, "y": 2},
|
||||
|
||||
{"label": "Shift", "matrix": [3, 0], "x": 0, "y": 3, "w": 2.25},
|
||||
{"label": "Z", "matrix": [3, 2], "x": 2.25, "y": 3},
|
||||
{"label": "X", "matrix": [3, 3], "x": 3.25, "y": 3},
|
||||
{"label": "C", "matrix": [3, 4], "x": 4.25, "y": 3},
|
||||
{"label": "V", "matrix": [3, 5], "x": 5.25, "y": 3},
|
||||
{"label": "B", "matrix": [3, 6], "x": 6.25, "y": 3},
|
||||
{"label": "N", "matrix": [3, 7], "x": 7.25, "y": 3},
|
||||
{"label": "M", "matrix": [3, 8], "x": 8.25, "y": 3},
|
||||
{"label": ",", "matrix": [3, 9], "x": 9.25, "y": 3},
|
||||
{"label": ".", "matrix": [3, 10], "x": 10.25, "y": 3},
|
||||
{"label": "/", "matrix": [3, 11], "x": 11.25, "y": 3},
|
||||
{"label": "Shift", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 2},
|
||||
{"label": "\u2191", "matrix": [3, 13], "x": 14.25, "y": 3},
|
||||
|
||||
{"label": "Ctrl", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
|
||||
{"label": "GUI", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
|
||||
{"label": "Alt", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25},
|
||||
{"label": "Space", "matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25},
|
||||
{"label": "Alt", "matrix": [4, 9], "x": 10, "y": 4},
|
||||
{"label": "Fn", "matrix": [4, 10], "x": 11, "y": 4},
|
||||
{"label": "Ctrl", "matrix": [4, 11], "x": 12, "y": 4, "w": 1.25},
|
||||
{"label": "\u2190", "matrix": [4, 12], "x": 13.25, "y": 4},
|
||||
{"label": "\u2193", "matrix": [4, 13], "x": 14.25, "y": 4},
|
||||
{"label": "\u2192", "matrix": [4, 14], "x": 15.25, "y": 4}
|
||||
]
|
||||
},
|
||||
"LAYOUT_iso": {
|
||||
"layout": [
|
||||
{"label": "Esc", "matrix": [0, 0], "x": 0, "y": 0},
|
||||
{"label": "1", "matrix": [0, 1], "x": 1, "y": 0},
|
||||
{"label": "2", "matrix": [0, 2], "x": 2, "y": 0},
|
||||
{"label": "3", "matrix": [0, 3], "x": 3, "y": 0},
|
||||
{"label": "4", "matrix": [0, 4], "x": 4, "y": 0},
|
||||
{"label": "5", "matrix": [0, 5], "x": 5, "y": 0},
|
||||
{"label": "6", "matrix": [0, 6], "x": 6, "y": 0},
|
||||
{"label": "7", "matrix": [0, 7], "x": 7, "y": 0},
|
||||
{"label": "8", "matrix": [0, 8], "x": 8, "y": 0},
|
||||
{"label": "9", "matrix": [0, 9], "x": 9, "y": 0},
|
||||
{"label": "0", "matrix": [0, 10], "x": 10, "y": 0},
|
||||
{"label": "-", "matrix": [0, 11], "x": 11, "y": 0},
|
||||
{"label": "=", "matrix": [0, 12], "x": 12, "y": 0},
|
||||
{"label": "Backspace", "matrix": [0, 13], "x": 13, "y": 0, "w": 2},
|
||||
|
||||
{"label": "Delete", "matrix": [0, 14], "x": 15.25, "y": 0},
|
||||
|
||||
{"label": "Tab", "matrix": [1, 0], "x": 0, "y": 1, "w": 1.5},
|
||||
{"label": "Q", "matrix": [1, 1], "x": 1.5, "y": 1},
|
||||
{"label": "W", "matrix": [1, 2], "x": 2.5, "y": 1},
|
||||
{"label": "E", "matrix": [1, 3], "x": 3.5, "y": 1},
|
||||
{"label": "R", "matrix": [1, 4], "x": 4.5, "y": 1},
|
||||
{"label": "T", "matrix": [1, 5], "x": 5.5, "y": 1},
|
||||
{"label": "Y", "matrix": [1, 6], "x": 6.5, "y": 1},
|
||||
{"label": "U", "matrix": [1, 7], "x": 7.5, "y": 1},
|
||||
{"label": "I", "matrix": [1, 8], "x": 8.5, "y": 1},
|
||||
{"label": "O", "matrix": [1, 9], "x": 9.5, "y": 1},
|
||||
{"label": "P", "matrix": [1, 10], "x": 10.5, "y": 1},
|
||||
{"label": "[", "matrix": [1, 11], "x": 11.5, "y": 1},
|
||||
{"label": "]", "matrix": [1, 12], "x": 12.5, "y": 1},
|
||||
|
||||
{"label": "Page Up", "matrix": [1, 14], "x": 15.25, "y": 1},
|
||||
|
||||
{"label": "Caps Lock", "matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
|
||||
{"label": "A", "matrix": [2, 1], "x": 1.75, "y": 2},
|
||||
{"label": "S", "matrix": [2, 2], "x": 2.75, "y": 2},
|
||||
{"label": "D", "matrix": [2, 3], "x": 3.75, "y": 2},
|
||||
{"label": "F", "matrix": [2, 4], "x": 4.75, "y": 2},
|
||||
{"label": "G", "matrix": [2, 5], "x": 5.75, "y": 2},
|
||||
{"label": "H", "matrix": [2, 6], "x": 6.75, "y": 2},
|
||||
{"label": "J", "matrix": [2, 7], "x": 7.75, "y": 2},
|
||||
{"label": "K", "matrix": [2, 8], "x": 8.75, "y": 2},
|
||||
{"label": "L", "matrix": [2, 9], "x": 9.75, "y": 2},
|
||||
{"label": ";", "matrix": [2, 10], "x": 10.75, "y": 2},
|
||||
{"label": "'", "matrix": [2, 11], "x": 11.75, "y": 2},
|
||||
{"label": "#", "matrix": [2, 12], "x": 12.75, "y": 2},
|
||||
{"label": "Enter", "matrix": [2, 13], "x": 13.75, "y": 1, "w": 1.25, "h": 2},
|
||||
|
||||
{"label": "Page Down", "matrix": [2, 14], "x": 15.25, "y": 2},
|
||||
|
||||
{"label": "Shift", "matrix": [3, 0], "x": 0, "y": 3, "w": 1.25},
|
||||
{"label": "\\", "matrix": [3, 1], "x": 1.25, "y": 3},
|
||||
{"label": "Z", "matrix": [3, 2], "x": 2.25, "y": 3},
|
||||
{"label": "X", "matrix": [3, 3], "x": 3.25, "y": 3},
|
||||
{"label": "C", "matrix": [3, 4], "x": 4.25, "y": 3},
|
||||
{"label": "V", "matrix": [3, 5], "x": 5.25, "y": 3},
|
||||
{"label": "B", "matrix": [3, 6], "x": 6.25, "y": 3},
|
||||
{"label": "N", "matrix": [3, 7], "x": 7.25, "y": 3},
|
||||
{"label": "M", "matrix": [3, 8], "x": 8.25, "y": 3},
|
||||
{"label": ",", "matrix": [3, 9], "x": 9.25, "y": 3},
|
||||
{"label": ".", "matrix": [3, 10], "x": 10.25, "y": 3},
|
||||
{"label": "/", "matrix": [3, 11], "x": 11.25, "y": 3},
|
||||
{"label": "Shift", "matrix": [3, 12], "x": 12.25, "y": 3, "w": 2},
|
||||
{"label": "\u2191", "matrix": [3, 13], "x": 14.25, "y": 3},
|
||||
|
||||
{"label": "Ctrl", "matrix": [4, 0], "x": 0, "y": 4, "w": 1.25},
|
||||
{"label": "GUI", "matrix": [4, 1], "x": 1.25, "y": 4, "w": 1.25},
|
||||
{"label": "Alt", "matrix": [4, 2], "x": 2.5, "y": 4, "w": 1.25},
|
||||
{"label": "Space", "matrix": [4, 5], "x": 3.75, "y": 4, "w": 6.25},
|
||||
{"label": "Alt", "matrix": [4, 9], "x": 10, "y": 4},
|
||||
{"label": "Fn", "matrix": [4, 10], "x": 11, "y": 4},
|
||||
{"label": "Ctrl", "matrix": [4, 11], "x": 12, "y": 4, "w": 1.25},
|
||||
{"label": "\u2190", "matrix": [4, 12], "x": 13.25, "y": 4},
|
||||
{"label": "\u2193", "matrix": [4, 13], "x": 14.25, "y": 4},
|
||||
{"label": "\u2192", "matrix": [4, 14], "x": 15.25, "y": 4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
# Matrix Diagram for Ducky One 2 SF
|
||||
|
||||
```
|
||||
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐┌───┐
|
||||
│00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0A │0B │0C │0D ││0E │
|
||||
├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤├───┤ ┌─────┐
|
||||
│10 │11 │12 │13 │14 │15 │16 │17 │18 │19 │1A │1B │1C │1D ││1E │ │ │
|
||||
├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤├───┤ ┌──┴┐2D │
|
||||
│20 │21 │22 │23 │24 │25 │26 │27 │28 │29 │2A │2B │2D ││2E │ │2C │ │
|
||||
├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─────┬──┴┼───┘ └───┴────┘
|
||||
│30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3A │3B │3C │3D │ ISO Enter
|
||||
├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴───┬───┼───┼───┐
|
||||
│40 │41 │42 │45 │49 │4A │4B │4C │4D │4E │
|
||||
└────┴────┴────┴────────────────────────┴───┴───┴────┴───┴───┴───┘
|
||||
┌────────┐
|
||||
│30 │ 2.25u LShift
|
||||
└────────┘
|
||||
```
|
||||
@@ -43,7 +43,7 @@
|
||||
#define NUC123_USB_USE_USB0 TRUE
|
||||
#define NUC123_USB_USE_USB1 TRUE
|
||||
|
||||
#define NUC123_SERIAL_USE_UART0 TRUE
|
||||
#define NUC123_SERIAL_USE_UART0 FALSE
|
||||
#define NUC123_SERIAL_CLKSRC NUC123_SERIAL_CLKSRC_HSI
|
||||
|
||||
#define NUC123_MCUCONF
|
||||
|
||||
@@ -2,18 +2,16 @@
|
||||
|
||||
A 65% keyboard by Ducky.
|
||||
|
||||
This firmware was tested on the Ducky One 2 SF 1967ST version.
|
||||
|
||||
* Keyboard Maintainer: [f7urry](https://github.com/f7urry)
|
||||
* Hardware Supported: Ducky One 2 SF RGB (DKON1967ST), NUC123SD4AN0 + MBI5043GP
|
||||
* Only ANSI layout is supported at this time
|
||||
* ISO compiles but is **untested**
|
||||
* VIA still WIP.
|
||||
* RGB LEDs are currently disabled until the driver is merged.
|
||||
* DIP switches are disabled due to hardware incompatibilities
|
||||
|
||||
## Compiling the Firmware:
|
||||
|
||||
make ducky/one2sf/1967st:default
|
||||
make ducky/one2sf/1967st/ansi:default
|
||||
make ducky/one2sf/1967st/iso:default
|
||||
|
||||
## Accessing Bootloader Mode
|
||||
|
||||
@@ -24,11 +22,16 @@ To enter the 1967ST bootloader to flash, boot the keyboard while holding D+L.
|
||||
There are then two ways to flash the keyboard:
|
||||
|
||||
pip install --user nuvoton-isp
|
||||
nuvoisp -f ducky_one2sf_ansi.bin
|
||||
nuvoisp -f ducky_one2sf_1967st_ansi_default.bin
|
||||
|
||||
Alternatively you can use elfmimi's [nu-isp-cli](https://lib.rs/crates/nu-isp-cli) which is more complete than nuvoisp and allows flashing .hex files as well.
|
||||
|
||||
cargo install nu-isp-cli
|
||||
nu-isp-cli flash ducky_one2sf_ansi.bin
|
||||
nu-isp-cli flash ducky_one2sf_1967st_ansi_default.bin
|
||||
|
||||
or
|
||||
|
||||
make ducky/one2sf/1967st/ansi:default:flash
|
||||
make ducky/one2sf/1967st/iso: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).
|
||||
|
||||
@@ -15,3 +15,6 @@ BOARD = NUC123SD4AN0
|
||||
MCU = cortex-m0
|
||||
# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
|
||||
ARMV = 6
|
||||
|
||||
# Needs elevated access to 0416:3f00 on Linux
|
||||
PROGRAM_CMD = nu-isp-cli flash $(BUILD_DIR)/$(TARGET).bin
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
/* Copyright 2019 /u/KeepItUnder
|
||||
*
|
||||
* 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 QMK_KEYBOARD_H
|
||||
|
||||
// LAYERS
|
||||
enum Layer {
|
||||
_QWERTY = 0, // Standard QWERTY layer
|
||||
_FUNCTION, // Function key layer
|
||||
_COLOUR // RGB key layer
|
||||
};
|
||||
#define _QW _QWERTY
|
||||
#define _FN _FUNCTION
|
||||
#define _CLR _COLOUR
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_QWERTY] = LAYOUT_all(
|
||||
// 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
||||
QK_GESC, 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_DEL,
|
||||
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_PGUP,
|
||||
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGDN,
|
||||
KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
[_FUNCTION] = 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_DEL, _______,
|
||||
_______, MS_BTN1, MS_UP, MS_BTN2, MS_WHLU, _______, KC_INS, _______, KC_UP, KC_PAUSE, KC_PGUP, KC_HOME, KC_PSCR, _______, KC_HOME,
|
||||
_______, MS_LEFT, MS_DOWN, MS_RGHT, MS_WHLD, _______, KC_SCRL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_END, _______, _______, KC_END,
|
||||
_______, _______, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______,
|
||||
_______, _______, _______, _______, MO(2), _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
[_COLOUR] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, RM_TOGG, RM_NEXT, RM_HUEU, RM_HUED, RM_SATU, RM_SATD, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
),
|
||||
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright 2026 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {LAYOUT_ortho_1x1(KC_A)};
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
// Customise these values to desired behaviour
|
||||
debug_enable = true;
|
||||
debug_matrix = true;
|
||||
// debug_keyboard=true;
|
||||
// debug_mouse=true;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"config": {
|
||||
"features": {
|
||||
"console": true
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"qmk/nvm_test"
|
||||
]
|
||||
}
|
||||
@@ -26,8 +26,11 @@
|
||||
"resync": true
|
||||
}
|
||||
},
|
||||
"layout_aliases": {
|
||||
"LAYOUT": "LAYOUT_all"
|
||||
},
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"LAYOUT_all": {
|
||||
"layout": [
|
||||
{"matrix": [0, 0], "w": 1.5, "x": 0, "y": 0},
|
||||
{"matrix": [0, 1], "x": 1.5, "y": 0},
|
||||
@@ -69,9 +72,107 @@
|
||||
{"matrix": [3, 0], "w": 1.25, "x": 0, "y": 3},
|
||||
{"matrix": [3, 1], "w": 1.25, "x": 1.25, "y": 3},
|
||||
{"matrix": [3, 2], "w": 1.25, "x": 2.5, "y": 3},
|
||||
{"matrix": [3, 3], "w": 3, "x": 3.75, "y": 3, "h": 0.5},
|
||||
{"matrix": [3, 5], "w": 6, "x": 3.75, "y": 3.5, "h": 0.5},
|
||||
{"matrix": [3, 6], "w": 3, "x": 6.75, "y": 3, "h": 0.5},
|
||||
{"matrix": [3, 3], "w": 2.5, "x": 3.75, "y": 3},
|
||||
{"matrix": [3, 5], "w": 1, "x": 6.25, "y": 3},
|
||||
{"matrix": [3, 6], "w": 2.5, "x": 7.25, "y": 3},
|
||||
{"matrix": [3, 8], "w": 1.25, "x": 9.75, "y": 3},
|
||||
{"matrix": [3, 9], "w": 1.25, "x": 11, "y": 3},
|
||||
{"matrix": [3, 10], "w": 1.25, "x": 12.25, "y": 3}
|
||||
]
|
||||
},
|
||||
|
||||
"LAYOUT_split_space": {
|
||||
"layout": [
|
||||
{"matrix": [0, 0], "w": 1.5, "x": 0, "y": 0},
|
||||
{"matrix": [0, 1], "x": 1.5, "y": 0},
|
||||
{"matrix": [0, 2], "x": 2.5, "y": 0},
|
||||
{"matrix": [0, 3], "x": 3.5, "y": 0},
|
||||
{"matrix": [0, 4], "x": 4.5, "y": 0},
|
||||
{"matrix": [0, 5], "x": 5.5, "y": 0},
|
||||
{"matrix": [0, 6], "x": 6.5, "y": 0},
|
||||
{"matrix": [0, 7], "x": 7.5, "y": 0},
|
||||
{"matrix": [0, 8], "x": 8.5, "y": 0},
|
||||
{"matrix": [0, 9], "x": 9.5, "y": 0},
|
||||
{"matrix": [0, 10], "x": 10.5, "y": 0},
|
||||
{"matrix": [0, 11], "x": 11.5, "y": 0},
|
||||
{"matrix": [3, 11], "x": 12.5, "y": 0},
|
||||
{"matrix": [1, 0], "w": 1.75, "x": 0, "y": 1},
|
||||
{"matrix": [1, 1], "x": 1.75, "y": 1},
|
||||
{"matrix": [1, 2], "x": 2.75, "y": 1},
|
||||
{"matrix": [1, 3], "x": 3.75, "y": 1},
|
||||
{"matrix": [1, 4], "x": 4.75, "y": 1},
|
||||
{"matrix": [1, 5], "x": 5.75, "y": 1},
|
||||
{"matrix": [1, 6], "x": 6.75, "y": 1},
|
||||
{"matrix": [1, 7], "x": 7.75, "y": 1},
|
||||
{"matrix": [1, 8], "x": 8.75, "y": 1},
|
||||
{"matrix": [1, 9], "x": 9.75, "y": 1},
|
||||
{"matrix": [1, 10], "x": 10.75, "y": 1},
|
||||
{"matrix": [1, 11], "w": 1.75, "x": 11.75, "y": 1},
|
||||
{"matrix": [2, 0], "w": 2.25, "x": 0, "y": 2},
|
||||
{"matrix": [2, 1], "x": 2.25, "y": 2},
|
||||
{"matrix": [2, 2], "x": 3.25, "y": 2},
|
||||
{"matrix": [2, 3], "x": 4.25, "y": 2},
|
||||
{"matrix": [2, 4], "x": 5.25, "y": 2},
|
||||
{"matrix": [2, 5], "x": 6.25, "y": 2},
|
||||
{"matrix": [2, 6], "x": 7.25, "y": 2},
|
||||
{"matrix": [2, 7], "x": 8.25, "y": 2},
|
||||
{"matrix": [2, 8], "x": 9.25, "y": 2},
|
||||
{"matrix": [2, 9], "x": 10.25, "y": 2},
|
||||
{"matrix": [2, 10], "x": 11.25, "y": 2},
|
||||
{"matrix": [2, 11], "w": 1.25, "x": 12.25, "y": 2},
|
||||
{"matrix": [3, 0], "w": 1.25, "x": 0, "y": 3},
|
||||
{"matrix": [3, 1], "w": 1.25, "x": 1.25, "y": 3},
|
||||
{"matrix": [3, 2], "w": 1.25, "x": 2.5, "y": 3},
|
||||
{"matrix": [3, 3], "w": 3, "x": 3.75, "y": 3},
|
||||
{"matrix": [3, 6], "w": 3, "x": 6.75, "y": 3},
|
||||
{"matrix": [3, 8], "w": 1.25, "x": 9.75, "y": 3},
|
||||
{"matrix": [3, 9], "w": 1.25, "x": 11, "y": 3},
|
||||
{"matrix": [3, 10], "w": 1.25, "x": 12.25, "y": 3}
|
||||
]
|
||||
},
|
||||
"LAYOUT_full_space": {
|
||||
"layout": [
|
||||
{"matrix": [0, 0], "w": 1.5, "x": 0, "y": 0},
|
||||
{"matrix": [0, 1], "x": 1.5, "y": 0},
|
||||
{"matrix": [0, 2], "x": 2.5, "y": 0},
|
||||
{"matrix": [0, 3], "x": 3.5, "y": 0},
|
||||
{"matrix": [0, 4], "x": 4.5, "y": 0},
|
||||
{"matrix": [0, 5], "x": 5.5, "y": 0},
|
||||
{"matrix": [0, 6], "x": 6.5, "y": 0},
|
||||
{"matrix": [0, 7], "x": 7.5, "y": 0},
|
||||
{"matrix": [0, 8], "x": 8.5, "y": 0},
|
||||
{"matrix": [0, 9], "x": 9.5, "y": 0},
|
||||
{"matrix": [0, 10], "x": 10.5, "y": 0},
|
||||
{"matrix": [0, 11], "x": 11.5, "y": 0},
|
||||
{"matrix": [3, 11], "x": 12.5, "y": 0},
|
||||
{"matrix": [1, 0], "w": 1.75, "x": 0, "y": 1},
|
||||
{"matrix": [1, 1], "x": 1.75, "y": 1},
|
||||
{"matrix": [1, 2], "x": 2.75, "y": 1},
|
||||
{"matrix": [1, 3], "x": 3.75, "y": 1},
|
||||
{"matrix": [1, 4], "x": 4.75, "y": 1},
|
||||
{"matrix": [1, 5], "x": 5.75, "y": 1},
|
||||
{"matrix": [1, 6], "x": 6.75, "y": 1},
|
||||
{"matrix": [1, 7], "x": 7.75, "y": 1},
|
||||
{"matrix": [1, 8], "x": 8.75, "y": 1},
|
||||
{"matrix": [1, 9], "x": 9.75, "y": 1},
|
||||
{"matrix": [1, 10], "x": 10.75, "y": 1},
|
||||
{"matrix": [1, 11], "w": 1.75, "x": 11.75, "y": 1},
|
||||
{"matrix": [2, 0], "w": 2.25, "x": 0, "y": 2},
|
||||
{"matrix": [2, 1], "x": 2.25, "y": 2},
|
||||
{"matrix": [2, 2], "x": 3.25, "y": 2},
|
||||
{"matrix": [2, 3], "x": 4.25, "y": 2},
|
||||
{"matrix": [2, 4], "x": 5.25, "y": 2},
|
||||
{"matrix": [2, 5], "x": 6.25, "y": 2},
|
||||
{"matrix": [2, 6], "x": 7.25, "y": 2},
|
||||
{"matrix": [2, 7], "x": 8.25, "y": 2},
|
||||
{"matrix": [2, 8], "x": 9.25, "y": 2},
|
||||
{"matrix": [2, 9], "x": 10.25, "y": 2},
|
||||
{"matrix": [2, 10], "x": 11.25, "y": 2},
|
||||
{"matrix": [2, 11], "w": 1.25, "x": 12.25, "y": 2},
|
||||
{"matrix": [3, 0], "w": 1.25, "x": 0, "y": 3},
|
||||
{"matrix": [3, 1], "w": 1.25, "x": 1.25, "y": 3},
|
||||
{"matrix": [3, 2], "w": 1.25, "x": 2.5, "y": 3},
|
||||
{"matrix": [3, 5], "w": 6, "x": 3.75, "y": 3},
|
||||
{"matrix": [3, 8], "w": 1.25, "x": 9.75, "y": 3},
|
||||
{"matrix": [3, 9], "w": 1.25, "x": 11, "y": 3},
|
||||
{"matrix": [3, 10], "w": 1.25, "x": 12.25, "y": 3}
|
||||
|
||||
@@ -4,19 +4,19 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT(
|
||||
[0] = LAYOUT_all(
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC,
|
||||
LT(2, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, LT(1, KC_SPC), KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
[1] = LAYOUT_all(
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, QK_BOOT,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LT(2, KC_SPC), KC_HOME, KC_PGDN, KC_END
|
||||
),
|
||||
[2] = LAYOUT(
|
||||
[2] = LAYOUT_all(
|
||||
KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_PGUP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
"diode_direction": "ROW2COL",
|
||||
"features": {
|
||||
"bootmagic": true,
|
||||
"command": false,
|
||||
"console": false,
|
||||
"extrakey": true,
|
||||
"mousekey": true,
|
||||
"nkro": true,
|
||||
|
||||
@@ -221,9 +221,5 @@ void eeconfig_init_kb_datablock(void) {
|
||||
config.idle_rgb_matrix = default_idle_rgb_matrix;
|
||||
|
||||
eeconfig_update_kb_datablock(&config, 0, EECONFIG_KB_DATA_SIZE);
|
||||
|
||||
# if (EECONFIG_USER_DATA_SIZE) > 0
|
||||
eeconfig_init_user_datablock();
|
||||
# endif // EECONFIG_USER_DATA_SIZE
|
||||
#endif // RGB_IDLE_ENABLE
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
{"matrix": [3, 3], "x": 61, "y": 63, "flags": 1},
|
||||
{"matrix": [3, 4], "x": 81, "y": 63, "flags": 1},
|
||||
{"matrix": [3, 5], "x": 101, "y": 63, "flags": 4},
|
||||
{"x": 111, "y": 63, "flags": 4},
|
||||
{"matrix": [3, 5], "x": 111, "y": 63, "flags": 4},
|
||||
{"matrix": [3, 6], "x": 122, "y": 63, "flags": 4},
|
||||
{"matrix": [3, 7], "x": 142, "y": 63, "flags": 1},
|
||||
{"matrix": [3, 8], "x": 162, "y": 63, "flags": 1},
|
||||
|
||||
@@ -86,16 +86,6 @@ void matrix_init_kb(void) {
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
|
||||
// Spacebar has 2 leds 41 & 42, so add 42 to the array here, and 41 will be added
|
||||
// by the default lookup code that runs after this
|
||||
if (row == 3 && column == 5) {
|
||||
led_i[0] = 42;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
__attribute__ ((weak))
|
||||
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
@@ -169,10 +169,154 @@ def _generate_modules_rules(keyboard, filename):
|
||||
return lines
|
||||
|
||||
|
||||
def _module_slugs(modules):
|
||||
return [Path(m).name.lower() for m in modules]
|
||||
|
||||
|
||||
def _render_eeconfig_declarations(modules):
|
||||
lines = []
|
||||
lines.append('')
|
||||
lines.append('// nvm eeconfig')
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#if (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
f'bool eeconfig_is_{module_slug}_datablock_valid(void);',
|
||||
f'uint32_t eeconfig_read_{module_slug}_datablock(void *data, uint32_t offset, uint32_t length) __attribute__((nonnull));',
|
||||
f'uint32_t eeconfig_update_{module_slug}_datablock(const void *data, uint32_t offset, uint32_t length) __attribute__((nonnull));',
|
||||
f'void eeconfig_init_{module_slug}_datablock(void);',
|
||||
f'# define eeconfig_read_{module_slug}_datablock_field(__object, __field) eeconfig_read_{module_slug}_datablock(&(__object.__field), offsetof(typeof(__object), __field), sizeof(__object.__field))',
|
||||
f'# define eeconfig_update_{module_slug}_datablock_field(__object, __field) eeconfig_update_{module_slug}_datablock(&(__object.__field), offsetof(typeof(__object), __field), sizeof(__object.__field))',
|
||||
'',
|
||||
f'bool nvm_eeconfig_is_{module_slug}_datablock_valid(void);',
|
||||
f'uint32_t nvm_eeconfig_read_{module_slug}_datablock(void *data, uint32_t offset, uint32_t length);',
|
||||
f'uint32_t nvm_eeconfig_update_{module_slug}_datablock(const void *data, uint32_t offset, uint32_t length);',
|
||||
f'void nvm_eeconfig_init_{module_slug}_datablock(void);',
|
||||
f'#endif // (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
'',
|
||||
])
|
||||
|
||||
lines.append('typedef struct PACKED {')
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#if (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
f' uint32_t {module_slug}_version;',
|
||||
f' uint8_t {module_slug}[EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE];',
|
||||
f'#endif // (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
])
|
||||
lines.append('} eeprom_modules_t;')
|
||||
lines.append('')
|
||||
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.append(f'#define EECONFIG_MODULE_{module_slug.upper()}_VERSION (uint32_t *)(EECONFIG_MODULES_DATABLOCK + (offsetof(eeprom_modules_t, {module_slug}_version)))')
|
||||
lines.append(f'#define EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK (uint8_t *)(EECONFIG_MODULES_DATABLOCK + (offsetof(eeprom_modules_t, {module_slug})))')
|
||||
lines.append('')
|
||||
|
||||
lines.append('bool eeconfig_is_modules_datablock_valid(void);')
|
||||
lines.append('void eeconfig_init_modules_datablock(void);')
|
||||
lines.append('void eeconfig_prepare_modules_datablocks(void);')
|
||||
lines.append('')
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def _render_eeconfig_implementation(modules):
|
||||
lines = []
|
||||
|
||||
lines.append('')
|
||||
lines.append('// nvm eeconfig')
|
||||
lines.append('#if defined(NVM_DRIVER_EEPROM)')
|
||||
lines.append('# include "nvm_eeprom_eeconfig_internal.h"')
|
||||
lines.append('# include "eeprom.h"')
|
||||
lines.append('#endif // defined(NVM_DRIVER_EEPROM)')
|
||||
lines.append('')
|
||||
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#if (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
f'bool eeconfig_is_{module_slug}_datablock_valid(void) {{ return nvm_eeconfig_is_{module_slug}_datablock_valid(); }}',
|
||||
f'uint32_t eeconfig_read_{module_slug}_datablock(void *data, uint32_t offset, uint32_t length) {{ return nvm_eeconfig_read_{module_slug}_datablock(data, offset, length); }}',
|
||||
f'uint32_t eeconfig_update_{module_slug}_datablock(const void *data, uint32_t offset, uint32_t length) {{ return nvm_eeconfig_update_{module_slug}_datablock(data, offset, length); }}',
|
||||
f'__attribute__((weak)) void eeconfig_init_{module_slug}_datablock(void) {{ nvm_eeconfig_init_{module_slug}_datablock(); }}',
|
||||
'',
|
||||
'# if defined(NVM_DRIVER_EEPROM)',
|
||||
f'bool nvm_eeconfig_is_{module_slug}_datablock_valid(void) {{',
|
||||
f' return eeprom_read_dword(EECONFIG_MODULE_{module_slug.upper()}_VERSION) == (EECONFIG_MODULE_{module_slug.upper()}_DATA_VERSION);',
|
||||
'}',
|
||||
f'uint32_t nvm_eeconfig_read_{module_slug}_datablock(void *data, uint32_t offset, uint32_t length) {{',
|
||||
f' if (eeconfig_is_{module_slug}_datablock_valid()) {{',
|
||||
f' void *ee_start = (void *)(uintptr_t)(EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK + offset);',
|
||||
f' void *ee_end = (void *)(uintptr_t)(EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK + MIN((EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE), offset + length));',
|
||||
' eeprom_read_block(data, ee_start, ee_end - ee_start);',
|
||||
' return ee_end - ee_start;',
|
||||
' } else {',
|
||||
' memset(data, 0, length);',
|
||||
' return length;',
|
||||
' }',
|
||||
'}',
|
||||
f'uint32_t nvm_eeconfig_update_{module_slug}_datablock(const void *data, uint32_t offset, uint32_t length) {{',
|
||||
f' eeprom_update_dword(EECONFIG_MODULE_{module_slug.upper()}_VERSION, (EECONFIG_MODULE_{module_slug.upper()}_DATA_VERSION));',
|
||||
f' void *ee_start = (void *)(uintptr_t)(EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK + offset);',
|
||||
f' void *ee_end = (void *)(uintptr_t)(EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK + MIN((EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE), offset + length));',
|
||||
' eeprom_update_block(data, ee_start, ee_end - ee_start);',
|
||||
' return ee_end - ee_start;',
|
||||
'}',
|
||||
f'void nvm_eeconfig_init_{module_slug}_datablock(void) {{',
|
||||
f' eeprom_update_dword(EECONFIG_MODULE_{module_slug.upper()}_VERSION, (EECONFIG_MODULE_{module_slug.upper()}_DATA_VERSION));',
|
||||
f' void *start = (void *)(uintptr_t)(EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK);',
|
||||
f' void *end = (void *)(uintptr_t)(EECONFIG_MODULE_{module_slug.upper()}_DATABLOCK + (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE));',
|
||||
' long remaining = end - start;',
|
||||
' uint8_t dummy[16] = {0};',
|
||||
f' for (int i = 0; i < EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE; i += sizeof(dummy)) {{',
|
||||
' int this_loop = remaining < sizeof(dummy) ? remaining : sizeof(dummy);',
|
||||
' eeprom_update_block(dummy, start, this_loop);',
|
||||
' start += this_loop;',
|
||||
' remaining -= this_loop;',
|
||||
' }',
|
||||
'}',
|
||||
'# endif // defined(NVM_DRIVER_EEPROM)',
|
||||
f'#endif // (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
'',
|
||||
])
|
||||
|
||||
lines.append('bool eeconfig_is_modules_datablock_valid(void) {')
|
||||
lines.append(' return true')
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#if (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
f' && eeconfig_is_{module_slug}_datablock_valid()',
|
||||
f'#endif // (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
])
|
||||
lines.append(' ;')
|
||||
lines.append('}')
|
||||
lines.append('')
|
||||
|
||||
lines.append('void eeconfig_init_modules_datablock(void) {')
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#if (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
f' eeconfig_init_{module_slug}_datablock();',
|
||||
f'#endif // (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
])
|
||||
lines.append('}')
|
||||
lines.append('')
|
||||
|
||||
lines.append('void eeconfig_prepare_modules_datablocks(void) {')
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#if (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
f' if (!eeconfig_is_{module_slug}_datablock_valid()) {{ eeconfig_init_{module_slug}_datablock(); }}',
|
||||
f'#endif // (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE) > 0',
|
||||
])
|
||||
lines.append('}')
|
||||
lines.append('')
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-e', '--escape', arg_only=True, action='store_true', help="Escape spaces in quiet mode")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rules.mk for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rules.mk for.')
|
||||
@cli.argument('filename', nargs='?', arg_only=True, type=qmk.path.FileType('r'), completer=FilesCompleter('.json'), help='A configurator export JSON to be compiled and flashed or a pre-compiled binary firmware file (bin/hex) to be flashed.')
|
||||
@cli.subcommand('Creates a community_modules_rules_mk from a keymap.json file.')
|
||||
def generate_community_modules_rules_mk(cli):
|
||||
@@ -196,11 +340,11 @@ def generate_community_modules_rules_mk(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_config.h for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_post_config.h for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_config.h from a keymap.json file.')
|
||||
def generate_community_config_h(cli):
|
||||
"""Creates a community_config.h from a keymap.json file
|
||||
@cli.subcommand('Creates a community_post_config.h from a keymap.json file.')
|
||||
def generate_community_post_config_h(cli):
|
||||
"""Creates a community_post_config.h from a keymap.json file
|
||||
"""
|
||||
if cli.args.output and cli.args.output.name == '-':
|
||||
cli.args.output = None
|
||||
@@ -215,20 +359,35 @@ def generate_community_config_h(cli):
|
||||
modules = get_modules(cli.args.keyboard, cli.args.filename)
|
||||
if len(modules) > 0:
|
||||
lines.append('// Split transactions')
|
||||
for module in modules:
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#ifdef SPLIT_TRANSACTION_IDS_MODULE_{Path(module).name.upper()}',
|
||||
f'#ifdef SPLIT_TRANSACTION_IDS_MODULE_{module_slug.upper()}',
|
||||
'# define SPLIT_TRANSACTION_RPC',
|
||||
'#endif',
|
||||
])
|
||||
lines.append('')
|
||||
|
||||
lines.append('// nvm eeconfig')
|
||||
for module_slug in _module_slugs(modules):
|
||||
lines.extend([
|
||||
f'#ifndef EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE',
|
||||
f'# define EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE 0',
|
||||
'#endif',
|
||||
f'#ifndef EECONFIG_MODULE_{module_slug.upper()}_DATA_VERSION',
|
||||
f'# define EECONFIG_MODULE_{module_slug.upper()}_DATA_VERSION (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE)',
|
||||
'#endif',
|
||||
'',
|
||||
])
|
||||
module_size = " + ".join([f'(4 + (EECONFIG_MODULE_{module_slug.upper()}_DATA_SIZE))' for module_slug in _module_slugs(modules)])
|
||||
lines.append(f'#define EECONFIG_MODULE_DATA_SIZE ({module_size})')
|
||||
lines.append('')
|
||||
|
||||
dump_lines(cli.args.output, lines, cli.args.quiet, remove_repeated_newlines=True)
|
||||
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.h for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.h for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules.h from a keymap.json file.')
|
||||
def generate_community_modules_h(cli):
|
||||
@@ -245,6 +404,7 @@ def generate_community_modules_h(cli):
|
||||
'#pragma once',
|
||||
'#include <stdint.h>',
|
||||
'#include <stdbool.h>',
|
||||
'#include <string.h>',
|
||||
'#include <keycodes.h>',
|
||||
'',
|
||||
'#include "compiler_support.h"',
|
||||
@@ -272,6 +432,8 @@ def generate_community_modules_h(cli):
|
||||
lines.extend(_render_api_declarations(api, Path(module).name))
|
||||
lines.append('')
|
||||
|
||||
lines.extend(_render_eeconfig_declarations(modules))
|
||||
|
||||
lines.append('// Core wrapper')
|
||||
for api in api_list:
|
||||
lines.extend(_render_api_declarations(api, 'modules', user_kb=False))
|
||||
@@ -281,7 +443,7 @@ def generate_community_modules_h(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules.c from a keymap.json file.')
|
||||
def generate_community_modules_c(cli):
|
||||
@@ -309,6 +471,8 @@ def generate_community_modules_c(cli):
|
||||
for api in api_list:
|
||||
lines.extend(_render_core_implementation(api, modules))
|
||||
|
||||
lines.extend(_render_eeconfig_implementation(modules))
|
||||
|
||||
dump_lines(cli.args.output, lines, cli.args.quiet, remove_repeated_newlines=True)
|
||||
|
||||
|
||||
@@ -331,7 +495,7 @@ def _generate_include_per_module(cli, include_file_name):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules_introspection.h for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules_introspection.h for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules_introspection.h from a keymap.json file.')
|
||||
def generate_community_modules_introspection_h(cli):
|
||||
@@ -342,7 +506,7 @@ def generate_community_modules_introspection_h(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate community_modules.c for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates a community_modules_introspection.c from a keymap.json file.')
|
||||
def generate_community_modules_introspection_c(cli):
|
||||
@@ -353,7 +517,7 @@ def generate_community_modules_introspection_c(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate led_matrix_community_modules.inc for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate led_matrix_community_modules.inc for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates an led_matrix_community_modules.inc from a keymap.json file.')
|
||||
def generate_led_matrix_community_modules_inc(cli):
|
||||
@@ -364,7 +528,7 @@ def generate_led_matrix_community_modules_inc(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rgb_matrix_community_modules.inc for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate rgb_matrix_community_modules.inc for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates an rgb_matrix_community_modules.inc from a keymap.json file.')
|
||||
def generate_rgb_matrix_community_modules_inc(cli):
|
||||
@@ -375,7 +539,7 @@ def generate_rgb_matrix_community_modules_inc(cli):
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=qmk.path.normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate split_transaction_id_community_modules.inc for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate split_transaction_id_community_modules.inc for.')
|
||||
@cli.argument('filename', nargs='?', type=qmk.path.FileType('r'), arg_only=True, completer=FilesCompleter('.json'), help='Configurator JSON file')
|
||||
@cli.subcommand('Creates an split_transaction_id_community_modules.inc from a keymap.json file.')
|
||||
def generate_split_transaction_id_community_modules_inc(cli):
|
||||
|
||||
@@ -5,32 +5,22 @@ from milc import cli
|
||||
|
||||
from qmk.decorators import automagic_keyboard
|
||||
from qmk.info import info_json
|
||||
from qmk.path import is_keyboard, normpath
|
||||
from qmk.keyboard import keyboard_completer
|
||||
from qmk.path import normpath
|
||||
from qmk.keyboard import keyboard_completer, keyboard_folder
|
||||
from qmk.commands import dump_lines
|
||||
from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE
|
||||
|
||||
|
||||
@cli.argument('-o', '--output', arg_only=True, type=normpath, help='File to write to')
|
||||
@cli.argument('-q', '--quiet', arg_only=True, action='store_true', help="Quiet mode, only output error messages")
|
||||
@cli.argument('-kb', '--keyboard', completer=keyboard_completer, help='Keyboard to generate LUFA Keyboard.h for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, arg_only=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to generate LUFA Keyboard.h for.')
|
||||
@cli.subcommand('Used by the make system to generate LUFA Keyboard.h from info.json', hidden=True)
|
||||
@automagic_keyboard
|
||||
def generate_dfu_header(cli):
|
||||
"""Generates the Keyboard.h file.
|
||||
"""
|
||||
# Determine our keyboard(s)
|
||||
if not cli.config.generate_dfu_header.keyboard:
|
||||
cli.log.error('Missing parameter: --keyboard')
|
||||
cli.subcommands['info'].print_help()
|
||||
return False
|
||||
|
||||
if not is_keyboard(cli.config.generate_dfu_header.keyboard):
|
||||
cli.log.error('Invalid keyboard: "%s"', cli.config.generate_dfu_header.keyboard)
|
||||
return False
|
||||
|
||||
# Build the Keyboard.h file.
|
||||
kb_info_json = dotty(info_json(cli.config.generate_dfu_header.keyboard))
|
||||
kb_info_json = dotty(info_json(cli.args.keyboard))
|
||||
|
||||
keyboard_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once']
|
||||
keyboard_h_lines.append(f'#define MANUFACTURER "{kb_info_json["manufacturer"]}"')
|
||||
|
||||
@@ -14,7 +14,7 @@ from qmk.info import info_json
|
||||
from qmk.json_encoders import InfoJSONEncoder
|
||||
from qmk.json_schema import compile_schema_store
|
||||
from qmk.keyboard import keyboard_completer, keyboard_folder
|
||||
from qmk.path import is_keyboard, normpath
|
||||
from qmk.path import normpath
|
||||
|
||||
|
||||
def pruning_validator(validator_class):
|
||||
@@ -45,7 +45,7 @@ def strip_info_json(kb_info_json):
|
||||
return validator(kb_info_json)
|
||||
|
||||
|
||||
@cli.argument('-kb', '--keyboard', type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.')
|
||||
@cli.argument('-kb', '--keyboard', required=True, type=keyboard_folder, completer=keyboard_completer, help='Keyboard to show info for.')
|
||||
@cli.argument('-km', '--keymap', help='Show the layers for a JSON keymap too.')
|
||||
@cli.argument('-o', '--output', arg_only=True, completer=FilesCompleter, help='Write the output the specified file, overwriting if necessary.')
|
||||
@cli.argument('-ow', '--overwrite', arg_only=True, action='store_true', help='Overwrite the existing info.json. (Overrides the location of --output)')
|
||||
@@ -55,18 +55,8 @@ def strip_info_json(kb_info_json):
|
||||
def generate_info_json(cli):
|
||||
"""Generate an info.json file for a keyboard
|
||||
"""
|
||||
# Determine our keyboard(s)
|
||||
if not cli.config.generate_info_json.keyboard:
|
||||
cli.log.error('Missing parameter: --keyboard')
|
||||
cli.subcommands['info'].print_help()
|
||||
return False
|
||||
|
||||
if not is_keyboard(cli.config.generate_info_json.keyboard):
|
||||
cli.log.error('Invalid keyboard: "%s"', cli.config.generate_info_json.keyboard)
|
||||
return False
|
||||
|
||||
if cli.args.overwrite:
|
||||
output_path = (Path('keyboards') / cli.config.generate_info_json.keyboard / 'info.json').resolve()
|
||||
output_path = (Path('keyboards') / cli.args.keyboard / 'info.json').resolve()
|
||||
|
||||
if cli.args.output:
|
||||
cli.log.warning('Overwriting user supplied --output with %s', output_path)
|
||||
@@ -74,7 +64,7 @@ def generate_info_json(cli):
|
||||
cli.args.output = output_path
|
||||
|
||||
# Build the info.json file
|
||||
kb_info_json = info_json(cli.config.generate_info_json.keyboard)
|
||||
kb_info_json = info_json(cli.args.keyboard)
|
||||
strip_info_json(kb_info_json)
|
||||
info_json_text = json.dumps(kb_info_json, indent=4, cls=InfoJSONEncoder, sort_keys=True)
|
||||
|
||||
|
||||
@@ -17,10 +17,22 @@ def _gen_led_configs(info_data):
|
||||
lines = []
|
||||
|
||||
if 'layout' in info_data.get('rgb_matrix', {}):
|
||||
lines.append('#ifdef RGB_MATRIX_ENABLE')
|
||||
lines.append('#include "rgb_matrix.h"')
|
||||
lines.append('')
|
||||
lines.extend(_gen_led_config(info_data, 'rgb_matrix'))
|
||||
lines.extend(_gen_led_duplicate_config(info_data, 'rgb_matrix'))
|
||||
lines.append('#endif')
|
||||
lines.append('')
|
||||
|
||||
if 'layout' in info_data.get('led_matrix', {}):
|
||||
lines.append('#ifdef LED_MATRIX_ENABLE')
|
||||
lines.append('#include "led_matrix.h"')
|
||||
lines.append('')
|
||||
lines.extend(_gen_led_config(info_data, 'led_matrix'))
|
||||
lines.extend(_gen_led_duplicate_config(info_data, 'led_matrix'))
|
||||
lines.append('#endif')
|
||||
lines.append('')
|
||||
|
||||
return lines
|
||||
|
||||
@@ -45,13 +57,6 @@ def _gen_led_config(info_data, config_type):
|
||||
pos.append(f'{{{led_data.get("x", 0)}, {led_data.get("y", 0)}}}')
|
||||
flags.append(str(led_data.get('flags', 0)))
|
||||
|
||||
if config_type == 'rgb_matrix':
|
||||
lines.append('#ifdef RGB_MATRIX_ENABLE')
|
||||
lines.append('#include "rgb_matrix.h"')
|
||||
elif config_type == 'led_matrix':
|
||||
lines.append('#ifdef LED_MATRIX_ENABLE')
|
||||
lines.append('#include "led_matrix.h"')
|
||||
|
||||
lines.append('__attribute__ ((weak)) led_config_t g_led_config = {')
|
||||
lines.append(' {')
|
||||
for line in matrix:
|
||||
@@ -60,7 +65,51 @@ def _gen_led_config(info_data, config_type):
|
||||
lines.append(f' {{ {", ".join(pos)} }},')
|
||||
lines.append(f' {{ {", ".join(flags)} }},')
|
||||
lines.append('};')
|
||||
lines.append('#endif')
|
||||
lines.append('')
|
||||
|
||||
return lines
|
||||
|
||||
|
||||
def _gen_led_duplicate_config(info_data, config_type):
|
||||
"""Convert duplicate led mappings to map_row_column_to_led_kb implementations"""
|
||||
|
||||
# precompute our map of matrix[r,c] -> [ids]
|
||||
duplicates = False
|
||||
led_map = {}
|
||||
led_layout = info_data[config_type]['layout']
|
||||
for led_index, led_data in enumerate(led_layout):
|
||||
if 'matrix' in led_data:
|
||||
matrix = tuple(led_data['matrix'])
|
||||
led_map[matrix] = [*led_map.get(matrix, []), led_index]
|
||||
duplicates = True
|
||||
|
||||
if not duplicates:
|
||||
return []
|
||||
|
||||
lines = []
|
||||
lines.append(f'uint8_t {config_type}_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {{')
|
||||
|
||||
for matrix, indexes in led_map.items():
|
||||
if len(indexes) > 1:
|
||||
# Match last one wins behavior of _gen_led_config w.r.t. g_led_config matrix generation
|
||||
last_index = indexes[-1]
|
||||
other_indexes = indexes[:-1]
|
||||
|
||||
lines.append(f'#if LED_HITS_TO_REMEMBER < {len(indexes)}')
|
||||
lines.append(f'# pragma message("LED_HITS_TO_REMEMBER is not large enough to handle matrix{list(matrix)} indexes{indexes}")')
|
||||
lines.append('#else')
|
||||
lines.append(f' if (row == {matrix[0]} && column == {matrix[1]}) {{')
|
||||
lines.append(f' // {last_index} will be added by the default lookup code that runs after this')
|
||||
|
||||
for index, led_index in enumerate(other_indexes):
|
||||
lines.append(f' led_i[{index}] = {led_index};')
|
||||
|
||||
lines.append(f' return {len(other_indexes)};')
|
||||
lines.append(' }')
|
||||
lines.append('#endif')
|
||||
|
||||
lines.append(' return 0;')
|
||||
lines.append('}')
|
||||
lines.append('')
|
||||
|
||||
return lines
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
// Copyright 2026 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
||||
|
||||
#define EECONFIG_MODULE_NVM_TEST_DATA_SIZE 4
|
||||
@@ -0,0 +1,56 @@
|
||||
// Copyright 2026 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#include <stdint.h>
|
||||
#include "community_modules.h"
|
||||
#include "debug.h"
|
||||
#include "timer.h"
|
||||
#include "eeconfig.h"
|
||||
|
||||
ASSERT_COMMUNITY_MODULES_MIN_API_VERSION(1, 1, 3);
|
||||
|
||||
typedef struct my_config_t {
|
||||
uint32_t data;
|
||||
} my_config_t;
|
||||
|
||||
static my_config_t config;
|
||||
|
||||
// Helpers required to bind to debounce helper
|
||||
void eeconfig_read_my_config(my_config_t *value) {
|
||||
eeconfig_read_nvm_test_datablock(value, 0, sizeof(my_config_t));
|
||||
}
|
||||
void eeconfig_update_my_config(my_config_t *value) {
|
||||
eeconfig_update_nvm_test_datablock(value, 0, sizeof(my_config_t));
|
||||
}
|
||||
|
||||
EECONFIG_DEBOUNCE_HELPER(my_config, config);
|
||||
|
||||
void eeconfig_init_nvm_test_datablock(void) {
|
||||
my_config_t default_config = {
|
||||
.data = 42,
|
||||
};
|
||||
eeconfig_update_nvm_test_datablock(&default_config, 0, sizeof(my_config_t));
|
||||
}
|
||||
|
||||
void keyboard_post_init_nvm_test(void) {
|
||||
eeconfig_init_my_config();
|
||||
}
|
||||
|
||||
bool process_record_nvm_test(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!record->event.pressed) {
|
||||
config.data += 1;
|
||||
eeconfig_flag_my_config(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void housekeeping_task_nvm_test(void) {
|
||||
eeconfig_flush_my_config(false);
|
||||
|
||||
static uint32_t last_sync = 0;
|
||||
if (timer_elapsed32(last_sync) > 1000) {
|
||||
last_sync = timer_read32();
|
||||
|
||||
dprintf("Config: %ld\n", config.data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"module_name": "Example nvm persistence",
|
||||
"maintainer": "QMK Maintainers",
|
||||
"license": "GPL-2.0-or-later"
|
||||
}
|
||||
+35
-27
@@ -21,8 +21,16 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if PS2_DATA_PIN + 1 != PS2_CLOCK_PIN
|
||||
# error PS/2 clock pin must be data pin + 1!
|
||||
#if PS2_DATA_PIN + 1 == PS2_CLOCK_PIN
|
||||
# define PS2_FIRST_PIN PS2_DATA_PIN
|
||||
# define PS2_DATA_PINDIR_BIT 1
|
||||
# define PS2_CLOCK_PINDIR_BIT 2
|
||||
#elif PS2_DATA_PIN - 1 == PS2_CLOCK_PIN
|
||||
# define PS2_FIRST_PIN PS2_CLOCK_PIN
|
||||
# define PS2_DATA_PINDIR_BIT 2
|
||||
# define PS2_CLOCK_PINDIR_BIT 1
|
||||
#else
|
||||
# error PS/2 clock and data pin must be consecutive!
|
||||
#endif
|
||||
|
||||
static inline void pio_serve_interrupt(void);
|
||||
@@ -50,29 +58,29 @@ OSAL_IRQ_HANDLER(RP_PIO0_IRQ_0_HANDLER) {
|
||||
|
||||
// clang-format off
|
||||
static const uint16_t ps2_program_instructions[] = {
|
||||
// .wrap_target
|
||||
0x00c7, // 0: jmp pin, 7
|
||||
0xe02a, // 1: set x, 10
|
||||
0x2021, // 2: wait 0 pin, 1
|
||||
0x4001, // 3: in pins, 1
|
||||
0x20a1, // 4: wait 1 pin, 1
|
||||
0x0042, // 5: jmp x--, 2
|
||||
0x0000, // 6: jmp 0
|
||||
0x00e9, // 7: jmp !osre, 9
|
||||
0x0000, // 8: jmp 0
|
||||
0xff81, // 9: set pindirs, 1 [31]
|
||||
0xe280, // 10: set pindirs, 0 [2]
|
||||
0xe082, // 11: set pindirs, 2
|
||||
0x2021, // 12: wait 0 pin, 1
|
||||
0xe029, // 13: set x, 9
|
||||
0x6081, // 14: out pindirs, 1
|
||||
0x20a1, // 15: wait 1 pin, 1
|
||||
0x2021, // 16: wait 0 pin, 1
|
||||
0x004e, // 17: jmp x--, 14
|
||||
0xe083, // 18: set pindirs, 3
|
||||
0x2021, // 19: wait 0 pin, 1
|
||||
0x20a1, // 20: wait 1 pin, 1
|
||||
// .wrap
|
||||
// .wrap_target
|
||||
0x00c7, // 0: jmp pin, 7
|
||||
0xe02a, // 1: set x, 10
|
||||
0x2000 | PS2_CLOCK_PIN, // 2: wait 0 gpio, CLK
|
||||
0x4001, // 3: in pins, 1
|
||||
0x2080 | PS2_CLOCK_PIN, // 4: wait 1 gpio, CLK
|
||||
0x0042, // 5: jmp x--, 2
|
||||
0x0000, // 6: jmp 0
|
||||
0x00e9, // 7: jmp !osre, 9
|
||||
0x0000, // 8: jmp 0
|
||||
0xff80 | PS2_DATA_PINDIR_BIT, // 9: set pindirs, DATA [31]
|
||||
0xe280, // 10: set pindirs, 0 [2]
|
||||
0xe080 | PS2_CLOCK_PINDIR_BIT, // 11: set pindirs, CLK
|
||||
0x2000 | PS2_CLOCK_PIN, // 12: wait 0 gpio, CLK
|
||||
0xe029, // 13: set x, 9
|
||||
0x6081, // 14: out pindirs, 1
|
||||
0x2080 | PS2_CLOCK_PIN, // 15: wait 1 gpio, CLK
|
||||
0x2000 | PS2_CLOCK_PIN, // 16: wait 0 gpio, CLK
|
||||
0x004e, // 17: jmp x--, 14
|
||||
0xe083, // 18: set pindirs, 3
|
||||
0x2000 | PS2_CLOCK_PIN, // 19: wait 0 gpio, CLK
|
||||
0x2080 | PS2_CLOCK_PIN, // 20: wait 1 gpio, CLK
|
||||
// .wrap
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
@@ -133,9 +141,9 @@ void ps2_host_init(void) {
|
||||
sm_config_set_wrap(&c, offset + PS2_WRAP_TARGET, offset + PS2_WRAP);
|
||||
|
||||
// Set pindirs to input (output enable is inverted below)
|
||||
pio_sm_set_consecutive_pindirs(pio, state_machine, PS2_DATA_PIN, 2, true);
|
||||
pio_sm_set_consecutive_pindirs(pio, state_machine, PS2_FIRST_PIN, 2, true);
|
||||
sm_config_set_clkdiv(&c, (float)clock_get_hz(clk_sys) / (200.0f * KHZ));
|
||||
sm_config_set_set_pins(&c, PS2_DATA_PIN, 2);
|
||||
sm_config_set_set_pins(&c, PS2_FIRST_PIN, 2);
|
||||
sm_config_set_out_pins(&c, PS2_DATA_PIN, 1);
|
||||
sm_config_set_out_shift(&c, true, true, 10);
|
||||
sm_config_set_in_shift(&c, true, true, 11);
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
# include "connection.h"
|
||||
#endif // CONNECTION_ENABLE
|
||||
|
||||
#ifdef COMMUNITY_MODULES_ENABLE
|
||||
# include "community_modules.h"
|
||||
#endif
|
||||
|
||||
#ifdef VIA_ENABLE
|
||||
bool via_eeprom_is_valid(void);
|
||||
void via_eeprom_set_valid(bool valid);
|
||||
@@ -148,6 +152,10 @@ void eeconfig_init_quantum(void) {
|
||||
eeconfig_init_user_datablock();
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) > 0
|
||||
|
||||
#ifdef COMMUNITY_MODULES_ENABLE
|
||||
eeconfig_init_modules_datablock();
|
||||
#endif // COMMUNITY_MODULES_ENABLE
|
||||
|
||||
#if defined(VIA_ENABLE)
|
||||
// Invalidate VIA eeprom config, and then reset.
|
||||
// Just in case if power is lost mid init, this makes sure that it gets
|
||||
@@ -357,3 +365,21 @@ __attribute__((weak)) void eeconfig_init_user_datablock(void) {
|
||||
nvm_eeconfig_init_user_datablock();
|
||||
}
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) > 0
|
||||
|
||||
void eeconfig_prepare_datablocks(void) {
|
||||
#if (EECONFIG_KB_DATA_SIZE) > 0
|
||||
if (!eeconfig_is_kb_datablock_valid()) {
|
||||
eeconfig_init_kb_datablock();
|
||||
}
|
||||
#endif // (EECONFIG_KB_DATA_SIZE) > 0
|
||||
|
||||
#if (EECONFIG_USER_DATA_SIZE) > 0
|
||||
if (!eeconfig_is_user_datablock_valid()) {
|
||||
eeconfig_init_user_datablock();
|
||||
}
|
||||
#endif // (EECONFIG_USER_DATA_SIZE) > 0
|
||||
|
||||
#ifdef COMMUNITY_MODULES_ENABLE
|
||||
eeconfig_prepare_modules_datablocks();
|
||||
#endif // COMMUNITY_MODULES_ENABLE
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ void eeconfig_init_user(void);
|
||||
void eeconfig_enable(void);
|
||||
void eeconfig_disable(void);
|
||||
|
||||
void eeconfig_prepare_datablocks(void);
|
||||
|
||||
typedef union debug_config_t debug_config_t;
|
||||
void eeconfig_read_debug(debug_config_t *debug_config) __attribute__((nonnull));
|
||||
void eeconfig_update_debug(const debug_config_t *debug_config) __attribute__((nonnull));
|
||||
|
||||
@@ -449,6 +449,8 @@ void quantum_init(void) {
|
||||
|
||||
/* Also initialize layer state to trigger callback functions for layer_state */
|
||||
layer_state_set_kb((layer_state_t)layer_state);
|
||||
|
||||
eeconfig_prepare_datablocks();
|
||||
}
|
||||
|
||||
/** \brief keyboard_init
|
||||
|
||||
+72
-3
@@ -26,11 +26,11 @@
|
||||
#pragma once
|
||||
// clang-format off
|
||||
|
||||
#define QMK_KEYCODES_VERSION "0.0.8"
|
||||
#define QMK_KEYCODES_VERSION_BCD 0x00000008
|
||||
#define QMK_KEYCODES_VERSION "0.0.9"
|
||||
#define QMK_KEYCODES_VERSION_BCD 0x00000009
|
||||
#define QMK_KEYCODES_VERSION_MAJOR 0
|
||||
#define QMK_KEYCODES_VERSION_MINOR 0
|
||||
#define QMK_KEYCODES_VERSION_PATCH 8
|
||||
#define QMK_KEYCODES_VERSION_PATCH 9
|
||||
|
||||
enum qk_keycode_ranges {
|
||||
// Ranges
|
||||
@@ -64,6 +64,8 @@ enum qk_keycode_ranges {
|
||||
QK_SWAP_HANDS_MAX = 0x56FF,
|
||||
QK_TAP_DANCE = 0x5700,
|
||||
QK_TAP_DANCE_MAX = 0x57FF,
|
||||
QK_PLOVER_HID = 0x5A40,
|
||||
QK_PLOVER_HID_MAX = 0x5A7F,
|
||||
QK_MAGIC = 0x7000,
|
||||
QK_MAGIC_MAX = 0x70FF,
|
||||
QK_MIDI = 0x7100,
|
||||
@@ -329,6 +331,70 @@ enum qk_keycode_defines {
|
||||
QK_SWAP_HANDS_OFF = 0x56F4,
|
||||
QK_SWAP_HANDS_ON = 0x56F5,
|
||||
QK_SWAP_HANDS_ONE_SHOT = 0x56F6,
|
||||
PLV_S1 = 0x5A40,
|
||||
PLV_TL = 0x5A41,
|
||||
PLV_KL = 0x5A42,
|
||||
PLV_PL = 0x5A43,
|
||||
PLV_WL = 0x5A44,
|
||||
PLV_HL = 0x5A45,
|
||||
PLV_RL = 0x5A46,
|
||||
PLV_A = 0x5A47,
|
||||
PLV_O = 0x5A48,
|
||||
PLV_ST1 = 0x5A49,
|
||||
PLV_E = 0x5A4A,
|
||||
PLV_U = 0x5A4B,
|
||||
PLV_FR = 0x5A4C,
|
||||
PLV_RR = 0x5A4D,
|
||||
PLV_PR = 0x5A4E,
|
||||
PLV_BR = 0x5A4F,
|
||||
PLV_LR = 0x5A50,
|
||||
PLV_GR = 0x5A51,
|
||||
PLV_TR = 0x5A52,
|
||||
PLV_SR = 0x5A53,
|
||||
PLV_DR = 0x5A54,
|
||||
PLV_ZR = 0x5A55,
|
||||
PLV_N1 = 0x5A56,
|
||||
PLV_S2 = 0x5A57,
|
||||
PLV_ST2 = 0x5A58,
|
||||
PLV_ST3 = 0x5A59,
|
||||
PLV_ST4 = 0x5A5A,
|
||||
PLV_N2 = 0x5A5B,
|
||||
PLV_N3 = 0x5A5C,
|
||||
PLV_N4 = 0x5A5D,
|
||||
PLV_N5 = 0x5A5E,
|
||||
PLV_N6 = 0x5A5F,
|
||||
PLV_N7 = 0x5A60,
|
||||
PLV_N8 = 0x5A61,
|
||||
PLV_N9 = 0x5A62,
|
||||
PLV_NA = 0x5A63,
|
||||
PLV_NB = 0x5A64,
|
||||
PLV_NC = 0x5A65,
|
||||
PLV_X1 = 0x5A66,
|
||||
PLV_X2 = 0x5A67,
|
||||
PLV_X3 = 0x5A68,
|
||||
PLV_X4 = 0x5A69,
|
||||
PLV_X5 = 0x5A6A,
|
||||
PLV_X6 = 0x5A6B,
|
||||
PLV_X7 = 0x5A6C,
|
||||
PLV_X8 = 0x5A6D,
|
||||
PLV_X9 = 0x5A6E,
|
||||
PLV_X10 = 0x5A6F,
|
||||
PLV_X11 = 0x5A70,
|
||||
PLV_X12 = 0x5A71,
|
||||
PLV_X13 = 0x5A72,
|
||||
PLV_X14 = 0x5A73,
|
||||
PLV_X15 = 0x5A74,
|
||||
PLV_X16 = 0x5A75,
|
||||
PLV_X17 = 0x5A76,
|
||||
PLV_X18 = 0x5A77,
|
||||
PLV_X19 = 0x5A78,
|
||||
PLV_X20 = 0x5A79,
|
||||
PLV_X21 = 0x5A7A,
|
||||
PLV_X22 = 0x5A7B,
|
||||
PLV_X23 = 0x5A7C,
|
||||
PLV_X24 = 0x5A7D,
|
||||
PLV_X25 = 0x5A7E,
|
||||
PLV_X26 = 0x5A7F,
|
||||
QK_MAGIC_SWAP_CONTROL_CAPS_LOCK = 0x7000,
|
||||
QK_MAGIC_UNSWAP_CONTROL_CAPS_LOCK = 0x7001,
|
||||
QK_MAGIC_TOGGLE_CONTROL_CAPS_LOCK = 0x7002,
|
||||
@@ -1483,6 +1549,7 @@ enum qk_keycode_defines {
|
||||
#define IS_QK_PERSISTENT_DEF_LAYER(code) ((code) >= QK_PERSISTENT_DEF_LAYER && (code) <= QK_PERSISTENT_DEF_LAYER_MAX)
|
||||
#define IS_QK_SWAP_HANDS(code) ((code) >= QK_SWAP_HANDS && (code) <= QK_SWAP_HANDS_MAX)
|
||||
#define IS_QK_TAP_DANCE(code) ((code) >= QK_TAP_DANCE && (code) <= QK_TAP_DANCE_MAX)
|
||||
#define IS_QK_PLOVER_HID(code) ((code) >= QK_PLOVER_HID && (code) <= QK_PLOVER_HID_MAX)
|
||||
#define IS_QK_MAGIC(code) ((code) >= QK_MAGIC && (code) <= QK_MAGIC_MAX)
|
||||
#define IS_QK_MIDI(code) ((code) >= QK_MIDI && (code) <= QK_MIDI_MAX)
|
||||
#define IS_QK_SEQUENCER(code) ((code) >= QK_SEQUENCER && (code) <= QK_SEQUENCER_MAX)
|
||||
@@ -1509,6 +1576,7 @@ enum qk_keycode_defines {
|
||||
#define IS_MOUSE_KEYCODE(code) ((code) >= QK_MOUSE_CURSOR_UP && (code) <= QK_MOUSE_ACCELERATION_2)
|
||||
#define IS_MODIFIER_KEYCODE(code) ((code) >= KC_LEFT_CTRL && (code) <= KC_RIGHT_GUI)
|
||||
#define IS_SWAP_HANDS_KEYCODE(code) ((code) >= QK_SWAP_HANDS_TOGGLE && (code) <= QK_SWAP_HANDS_ONE_SHOT)
|
||||
#define IS_PLOVER_HID_KEYCODE(code) ((code) >= PLV_S1 && (code) <= PLV_X26)
|
||||
#define IS_MAGIC_KEYCODE(code) ((code) >= QK_MAGIC_SWAP_CONTROL_CAPS_LOCK && (code) <= QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK)
|
||||
#define IS_MIDI_KEYCODE(code) ((code) >= QK_MIDI_ON && (code) <= QK_MIDI_PITCH_BEND_UP)
|
||||
#define IS_SEQUENCER_KEYCODE(code) ((code) >= QK_SEQUENCER_ON && (code) <= QK_SEQUENCER_STEPS_CLEAR)
|
||||
@@ -1535,6 +1603,7 @@ enum qk_keycode_defines {
|
||||
#define MOUSE_KEYCODE_RANGE QK_MOUSE_CURSOR_UP ... QK_MOUSE_ACCELERATION_2
|
||||
#define MODIFIER_KEYCODE_RANGE KC_LEFT_CTRL ... KC_RIGHT_GUI
|
||||
#define SWAP_HANDS_KEYCODE_RANGE QK_SWAP_HANDS_TOGGLE ... QK_SWAP_HANDS_ONE_SHOT
|
||||
#define PLOVER_HID_KEYCODE_RANGE PLV_S1 ... PLV_X26
|
||||
#define MAGIC_KEYCODE_RANGE QK_MAGIC_SWAP_CONTROL_CAPS_LOCK ... QK_MAGIC_TOGGLE_ESCAPE_CAPS_LOCK
|
||||
#define MIDI_KEYCODE_RANGE QK_MIDI_ON ... QK_MIDI_PITCH_BEND_UP
|
||||
#define SEQUENCER_KEYCODE_RANGE QK_SEQUENCER_ON ... QK_SEQUENCER_STEPS_CLEAR
|
||||
|
||||
@@ -55,6 +55,11 @@ int main(void) {
|
||||
raw_hid_task();
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
void plover_hid_task(void);
|
||||
plover_hid_task();
|
||||
#endif
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
void console_task(void);
|
||||
console_task();
|
||||
|
||||
@@ -56,8 +56,14 @@ typedef struct PACKED {
|
||||
|
||||
#define EECONFIG_KB_DATABLOCK ((uint8_t *)(EECONFIG_BASE_SIZE))
|
||||
#define EECONFIG_USER_DATABLOCK ((uint8_t *)((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE)))
|
||||
#define EECONFIG_MODULES_DATABLOCK ((uint8_t *)((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE)))
|
||||
|
||||
// Actual value is injected via the generated community_post_config.h
|
||||
#ifndef EECONFIG_MODULE_DATA_SIZE
|
||||
# define EECONFIG_MODULE_DATA_SIZE 0
|
||||
#endif
|
||||
|
||||
// Size of EEPROM being used, other code can refer to this for available EEPROM
|
||||
#define EECONFIG_SIZE ((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE))
|
||||
#define EECONFIG_SIZE ((EECONFIG_BASE_SIZE) + (EECONFIG_KB_DATA_SIZE) + (EECONFIG_USER_DATA_SIZE) + (EECONFIG_MODULE_DATA_SIZE))
|
||||
|
||||
STATIC_ASSERT((intptr_t)EECONFIG_HANDEDNESS == 14, "EEPROM handedness offset is incorrect");
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/* Copyright 2021 dnaq
|
||||
*
|
||||
* 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 <limits.h>
|
||||
|
||||
#include "plover_hid.h"
|
||||
#include "report.h"
|
||||
#include "host.h"
|
||||
#include "compiler_support.h"
|
||||
|
||||
// The button index handed to plover_hid_update() is `keycode - QK_PLOVER_HID`, so the report's
|
||||
// data field must hold a bit for every keycode in the range or the bit-packing below overflows.
|
||||
STATIC_ASSERT(sizeof(((report_plover_hid_t *)0)->data) * CHAR_BIT >= (QK_PLOVER_HID_MAX - QK_PLOVER_HID + 1), "Plover HID report data too small for the QK_PLOVER_HID keycode range");
|
||||
|
||||
static report_plover_hid_t plover_hid_report = {.report_id = REPORT_ID_PLOVER_HID};
|
||||
static bool plover_hid_report_updated = false;
|
||||
|
||||
void plover_hid_update(uint8_t button, bool pressed) {
|
||||
if (pressed) {
|
||||
plover_hid_report.data[button / 8] |= (1 << (7 - (button % 8)));
|
||||
} else {
|
||||
plover_hid_report.data[button / 8] &= ~(1 << (7 - (button % 8)));
|
||||
}
|
||||
plover_hid_report_updated = true;
|
||||
}
|
||||
|
||||
void plover_hid_task(void) {
|
||||
if (!plover_hid_report_updated) {
|
||||
return;
|
||||
}
|
||||
host_plover_hid_send(&plover_hid_report);
|
||||
plover_hid_report_updated = false;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2019 /u/KeepItUnder
|
||||
/* Copyright 2021 dnaq
|
||||
*
|
||||
* 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
|
||||
@@ -16,10 +16,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
#define GRAVE_ESC_GUI_OVERRIDE
|
||||
#define MK_3_SPEED
|
||||
#define MK_C_OFFSET_UNMOD 400 /* Cursor offset per movement (unmodified) */
|
||||
#define MK_C_INTERVAL_UNMOD 5 /* Time between cursor movements (unmodified) */
|
||||
#define MK_W_OFFSET_UNMOD 100 /* Scroll steps per scroll action (unmodified) */
|
||||
#define MK_W_INTERVAL_UNMOD 10 /* Time between scroll steps (unmodified) */
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
void plover_hid_update(uint8_t button, bool pressed);
|
||||
void plover_hid_task(void);
|
||||
@@ -57,7 +57,11 @@ static inline uint16_t translate_keycode(uint16_t keycode) {
|
||||
|
||||
void cancel_key_lock(void) {
|
||||
watching = false;
|
||||
UNSET_KEY_STATE(0x0);
|
||||
// Clear the full 256-bit state, otherwise every actually-locked key will still be latched.
|
||||
key_state[0] = 0;
|
||||
key_state[1] = 0;
|
||||
key_state[2] = 0;
|
||||
key_state[3] = 0;
|
||||
}
|
||||
|
||||
bool process_key_lock(uint16_t *keycode, keyrecord_t *record) {
|
||||
|
||||
+10
-9
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2019 /u/KeepItUnder
|
||||
/* Copyright 2021 dnaq
|
||||
*
|
||||
* 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
|
||||
@@ -14,12 +14,13 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "process_plover_hid.h"
|
||||
#include "plover_hid.h"
|
||||
|
||||
// place overrides here
|
||||
#define GRAVE_ESC_GUI_OVERRIDE
|
||||
#define MK_3_SPEED
|
||||
#define MK_C_OFFSET_UNMOD 400 /* Cursor offset per movement (unmodified) */
|
||||
#define MK_C_INTERVAL_UNMOD 5 /* Time between cursor movements (unmodified) */
|
||||
#define MK_W_OFFSET_UNMOD 100 /* Scroll steps per scroll action (unmodified) */
|
||||
#define MK_W_INTERVAL_UNMOD 10 /* Time between scroll steps (unmodified) */
|
||||
bool process_plover_hid(uint16_t keycode, keyrecord_t *record) {
|
||||
if (!IS_QK_PLOVER_HID(keycode)) {
|
||||
return true;
|
||||
}
|
||||
plover_hid_update(keycode - QK_PLOVER_HID, record->event.pressed);
|
||||
return false;
|
||||
}
|
||||
+4
-8
@@ -1,4 +1,4 @@
|
||||
/* Copyright 2019 /u/KeepItUnder
|
||||
/* Copyright 2021 dnaq
|
||||
*
|
||||
* 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
|
||||
@@ -16,10 +16,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
// place overrides here
|
||||
#define GRAVE_ESC_GUI_OVERRIDE
|
||||
#define MK_3_SPEED
|
||||
#define MK_C_OFFSET_UNMOD 400 /* Cursor offset per movement (unmodified) */
|
||||
#define MK_C_INTERVAL_UNMOD 5 /* Time between cursor movements (unmodified) */
|
||||
#define MK_W_OFFSET_UNMOD 100 /* Scroll steps per scroll action (unmodified) */
|
||||
#define MK_W_INTERVAL_UNMOD 10 /* Time between scroll steps (unmodified) */
|
||||
#include "quantum.h"
|
||||
|
||||
bool process_plover_hid(uint16_t keycode, keyrecord_t *record);
|
||||
@@ -374,6 +374,9 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||
#if defined(LED_MATRIX_ENABLE)
|
||||
process_led_matrix(keycode, record) &&
|
||||
#endif
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
process_plover_hid(keycode, record) &&
|
||||
#endif
|
||||
#ifdef STENO_ENABLE
|
||||
process_steno(keycode, record) &&
|
||||
#endif
|
||||
|
||||
@@ -95,6 +95,10 @@ extern layer_state_t layer_state;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
# include "process_plover_hid.h"
|
||||
#endif
|
||||
|
||||
#ifdef STENO_ENABLE
|
||||
# include "process_steno.h"
|
||||
#endif
|
||||
|
||||
@@ -45,6 +45,10 @@ uint16_t get_last_keycode(void) {
|
||||
return last_record.keycode;
|
||||
}
|
||||
|
||||
const keyrecord_t* get_last_record(void) {
|
||||
return &last_record;
|
||||
}
|
||||
|
||||
uint8_t get_last_mods(void) {
|
||||
return last_mods;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void set_last_keycode(uint16_t keycode); /**< Sets the last key. */
|
||||
void set_last_mods(uint8_t mods); /**< Sets the last mods. */
|
||||
|
||||
/** @brief Gets the record for the last key. */
|
||||
keyrecord_t* get_last_record(void);
|
||||
const keyrecord_t* get_last_record(void);
|
||||
|
||||
/** @brief Sets keycode and record info for the last key. */
|
||||
void set_last_record(uint16_t keycode, keyrecord_t* record);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
# THIS IS THE DEVELOP BRANCH
|
||||
|
||||
Warning- This is the `develop` branch of QMK Firmware. You may encounter broken code here. Please see [Breaking Changes](https://docs.qmk.fm/#/breaking_changes) for more information.
|
||||
|
||||
# Quantum Mechanical Keyboard Firmware
|
||||
|
||||
[](https://github.com/qmk/qmk_firmware/tags)
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright 2026 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "azoteq_iqs5xx.h"
|
||||
|
||||
static azoteq_iqs5xx_base_data_t mock_base_data;
|
||||
static i2c_status_t mock_read_status = I2C_STATUS_SUCCESS;
|
||||
|
||||
void azoteq_iqs5xx_mock_reset(void) {
|
||||
memset(&mock_base_data, 0, sizeof(mock_base_data));
|
||||
mock_read_status = I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void azoteq_iqs5xx_mock_set_base_data(azoteq_iqs5xx_base_data_t base_data) {
|
||||
mock_base_data = base_data;
|
||||
mock_read_status = I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void i2c_init(void) {}
|
||||
|
||||
i2c_status_t i2c_ping_address(uint8_t address, uint16_t timeout) {
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_read_register16(uint8_t devaddr, uint16_t regaddr, uint8_t *data, uint16_t length, uint16_t timeout) {
|
||||
if (mock_read_status == I2C_STATUS_SUCCESS && data != NULL) {
|
||||
memcpy(data, &mock_base_data, MIN(length, sizeof(mock_base_data)));
|
||||
}
|
||||
return mock_read_status;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_write_register16(uint8_t devaddr, uint16_t regaddr, const uint8_t *data, uint16_t length, uint16_t timeout) {
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
uint8_t pointing_device_handle_buttons(uint8_t buttons, bool pressed, pointing_device_buttons_t button) {
|
||||
if (pressed) {
|
||||
buttons |= 1 << button;
|
||||
} else {
|
||||
buttons &= ~(1 << button);
|
||||
}
|
||||
return buttons;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright 2026 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
#define AZOTEQ_IQS5XX_TPS43
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright 2026 QMK
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
SRC += drivers/sensors/azoteq_iqs5xx.c
|
||||
SRC += tests/pointing/azoteq_iqs5xx/azoteq_iqs5xx_mock.c
|
||||
|
||||
VPATH += $(QUANTUM_DIR)/pointing_device
|
||||
VPATH += drivers/sensors
|
||||
@@ -0,0 +1,54 @@
|
||||
// Copyright 2026 QMK
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
extern "C" {
|
||||
#include "azoteq_iqs5xx.h"
|
||||
|
||||
void azoteq_iqs5xx_mock_reset(void);
|
||||
void azoteq_iqs5xx_mock_set_base_data(azoteq_iqs5xx_base_data_t base_data);
|
||||
}
|
||||
|
||||
class AzoteqIqs5xx : public testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
azoteq_iqs5xx_mock_reset();
|
||||
}
|
||||
};
|
||||
|
||||
TEST_F(AzoteqIqs5xx, PreservesIncomingButtonsWhenReportingMovement) {
|
||||
azoteq_iqs5xx_base_data_t base_data = {0};
|
||||
base_data.number_of_fingers = 1;
|
||||
base_data.x.l = 12;
|
||||
base_data.y.l = 34;
|
||||
azoteq_iqs5xx_mock_set_base_data(base_data);
|
||||
|
||||
report_mouse_t input_report = {0};
|
||||
input_report.buttons = (1 << POINTING_DEVICE_BUTTON1) | (1 << POINTING_DEVICE_BUTTON2);
|
||||
|
||||
report_mouse_t report = azoteq_iqs5xx_get_report(input_report);
|
||||
|
||||
EXPECT_EQ(report.x, 12);
|
||||
EXPECT_EQ(report.y, 34);
|
||||
EXPECT_EQ(report.h, 0);
|
||||
EXPECT_EQ(report.v, 0);
|
||||
EXPECT_EQ(report.buttons, input_report.buttons);
|
||||
}
|
||||
|
||||
TEST_F(AzoteqIqs5xx, CombinesGestureButtonWithIncomingButtons) {
|
||||
azoteq_iqs5xx_base_data_t base_data = {0};
|
||||
base_data.gesture_events_1.two_finger_tap = true;
|
||||
azoteq_iqs5xx_mock_set_base_data(base_data);
|
||||
|
||||
report_mouse_t input_report = {0};
|
||||
input_report.buttons = 1 << POINTING_DEVICE_BUTTON1;
|
||||
|
||||
report_mouse_t report = azoteq_iqs5xx_get_report(input_report);
|
||||
|
||||
EXPECT_EQ(report.x, 0);
|
||||
EXPECT_EQ(report.y, 0);
|
||||
EXPECT_EQ(report.h, 0);
|
||||
EXPECT_EQ(report.v, 0);
|
||||
EXPECT_EQ(report.buttons, input_report.buttons | (1 << POINTING_DEVICE_BUTTON2));
|
||||
}
|
||||
@@ -80,6 +80,10 @@ usb_endpoint_in_t usb_endpoints_in[USB_ENDPOINT_IN_COUNT] = {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined(PLOVER_HID_ENABLE)
|
||||
[USB_ENDPOINT_IN_PLOVER_HID] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_INTR, PLOVER_HID_EPSIZE, PLOVER_HID_IN_EPNUM, PLOVER_HID_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(PLOVER_HID_EPSIZE)),
|
||||
#endif
|
||||
|
||||
#if defined(MIDI_ENABLE)
|
||||
# if defined(USB_ENDPOINTS_ARE_REORDERABLE)
|
||||
[USB_ENDPOINT_IN_MIDI] = QMK_USB_ENDPOINT_IN_SHARED(USB_EP_MODE_TYPE_BULK, MIDI_STREAM_EPSIZE, MIDI_STREAM_IN_EPNUM, MIDI_STREAM_IN_CAPACITY, NULL, NULL),
|
||||
@@ -107,6 +111,10 @@ usb_endpoint_in_lut_t usb_endpoint_interface_lut[TOTAL_INTERFACES] = {
|
||||
[RAW_INTERFACE] = USB_ENDPOINT_IN_RAW,
|
||||
#endif
|
||||
|
||||
#if defined(PLOVER_HID_ENABLE)
|
||||
[PLOVER_HID_INTERFACE] = USB_ENDPOINT_IN_PLOVER_HID,
|
||||
#endif
|
||||
|
||||
#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP)
|
||||
[MOUSE_INTERFACE] = USB_ENDPOINT_IN_MOUSE,
|
||||
#endif
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
# define RAW_OUT_CAPACITY USB_DEFAULT_BUFFER_CAPACITY
|
||||
#endif
|
||||
|
||||
#if !defined(PLOVER_HID_IN_CAPACITY)
|
||||
# define PLOVER_HID_IN_CAPACITY USB_DEFAULT_BUFFER_CAPACITY
|
||||
#endif
|
||||
|
||||
#if !defined(MIDI_STREAM_IN_CAPACITY)
|
||||
# define MIDI_STREAM_IN_CAPACITY USB_DEFAULT_BUFFER_CAPACITY
|
||||
#endif
|
||||
@@ -90,6 +94,10 @@ typedef enum {
|
||||
USB_ENDPOINT_IN_RAW,
|
||||
#endif
|
||||
|
||||
#if defined(PLOVER_HID_ENABLE)
|
||||
USB_ENDPOINT_IN_PLOVER_HID,
|
||||
#endif
|
||||
|
||||
#if defined(MIDI_ENABLE)
|
||||
USB_ENDPOINT_IN_MIDI,
|
||||
#endif
|
||||
@@ -127,6 +135,7 @@ typedef enum {
|
||||
#if defined(RAW_ENABLE)
|
||||
USB_ENDPOINT_OUT_RAW,
|
||||
#endif
|
||||
|
||||
#if defined(MIDI_ENABLE)
|
||||
USB_ENDPOINT_OUT_MIDI,
|
||||
#endif
|
||||
|
||||
@@ -489,6 +489,12 @@ void send_digitizer(report_digitizer_t *report) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void send_plover_hid(report_plover_hid_t *report) {
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
send_report(USB_ENDPOINT_IN_PLOVER_HID, report, sizeof(report_plover_hid_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------
|
||||
* Console functions
|
||||
* ---------------------------------------------------------
|
||||
|
||||
@@ -342,6 +342,14 @@ void host_programmable_button_send(uint32_t data) {
|
||||
|
||||
__attribute__((weak)) void send_programmable_button(report_programmable_button_t *report) {}
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
void host_plover_hid_send(report_plover_hid_t *report) {
|
||||
send_plover_hid(report);
|
||||
}
|
||||
#endif
|
||||
|
||||
__attribute__((weak)) void send_plover_hid(report_plover_hid_t *report) {}
|
||||
|
||||
#ifdef RAW_ENABLE
|
||||
void host_raw_hid_send(uint8_t *data, uint8_t length) {
|
||||
host_driver_t *driver = host_get_active_driver();
|
||||
|
||||
@@ -44,6 +44,7 @@ void host_mouse_send(report_mouse_t *report);
|
||||
void host_system_send(uint16_t usage);
|
||||
void host_consumer_send(uint16_t usage);
|
||||
void host_programmable_button_send(uint32_t data);
|
||||
void host_plover_hid_send(report_plover_hid_t *report);
|
||||
void host_raw_hid_send(uint8_t *data, uint8_t length);
|
||||
|
||||
uint16_t host_last_system_usage(void);
|
||||
|
||||
@@ -37,3 +37,4 @@ typedef struct {
|
||||
void send_joystick(report_joystick_t *report);
|
||||
void send_digitizer(report_digitizer_t *report);
|
||||
void send_programmable_button(report_programmable_button_t *report);
|
||||
void send_plover_hid(report_plover_hid_t *report);
|
||||
|
||||
@@ -347,6 +347,11 @@ void EVENT_USB_Device_ConfigurationChanged(void) {
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint((RAW_OUT_EPNUM | ENDPOINT_DIR_OUT), EP_TYPE_INTERRUPT, RAW_EPSIZE, 1);
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
/* Setup plover HID endpoints */
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint((PLOVER_HID_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, PLOVER_HID_EPSIZE, 1);
|
||||
#endif
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
/* Setup console endpoint */
|
||||
ConfigSuccess &= Endpoint_ConfigureEndpoint((CONSOLE_IN_EPNUM | ENDPOINT_DIR_IN), EP_TYPE_INTERRUPT, CONSOLE_EPSIZE, 1);
|
||||
@@ -571,6 +576,12 @@ void send_digitizer(report_digitizer_t *report) {
|
||||
#endif
|
||||
}
|
||||
|
||||
void send_plover_hid(report_plover_hid_t *report) {
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
send_report(PLOVER_HID_IN_EPNUM, report, sizeof(report_plover_hid_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* sendchar
|
||||
******************************************************************************/
|
||||
|
||||
@@ -44,6 +44,11 @@ enum hid_report_ids {
|
||||
|
||||
#define IS_VALID_REPORT_ID(id) ((id) >= REPORT_ID_ALL && (id) <= REPORT_ID_COUNT)
|
||||
|
||||
// Plover HID has its own dedicated interface rather than the shared endpoint, so its report ID
|
||||
// is fixed by the protocol at 0x50 ('P') and is intentionally NOT a member of enum
|
||||
// hid_report_ids above (which only enumerates shared-endpoint reports up to REPORT_ID_COUNT).
|
||||
#define REPORT_ID_PLOVER_HID 0x50
|
||||
|
||||
/* Mouse buttons */
|
||||
#define MOUSE_BTN_MASK(n) (1 << (n))
|
||||
enum mouse_buttons {
|
||||
@@ -193,6 +198,11 @@ typedef struct {
|
||||
uint32_t usage;
|
||||
} PACKED report_programmable_button_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t report_id; // REPORT_ID_PLOVER_HID
|
||||
uint8_t data[8];
|
||||
} PACKED report_plover_hid_t;
|
||||
|
||||
#ifdef MOUSE_EXTENDED_REPORT
|
||||
# define MOUSE_REPORT_XY_MIN (INT16_MIN + 1)
|
||||
# define MOUSE_REPORT_XY_MAX INT16_MAX
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "report.h"
|
||||
#include "usb_descriptor.h"
|
||||
#include "usb_descriptor_common.h"
|
||||
#include "compiler_support.h"
|
||||
|
||||
#ifdef JOYSTICK_ENABLE
|
||||
# include "joystick.h"
|
||||
@@ -370,10 +371,10 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = {
|
||||
HID_RI_USAGE(8, 0x80), // System Control
|
||||
HID_RI_COLLECTION(8, 0x01), // Application
|
||||
HID_RI_REPORT_ID(8, REPORT_ID_SYSTEM),
|
||||
HID_RI_USAGE_MINIMUM(8, 0x01), // Pointer
|
||||
HID_RI_USAGE_MAXIMUM(16, 0x00B7), // System Display LCD Autoscale
|
||||
HID_RI_LOGICAL_MINIMUM(8, 0x01),
|
||||
HID_RI_LOGICAL_MAXIMUM(16, 0x00B7),
|
||||
HID_RI_USAGE_MINIMUM(16, SYSTEM_CONTROL_USAGE_MINIMUM),
|
||||
HID_RI_USAGE_MAXIMUM(16, SYSTEM_CONTROL_USAGE_MAXIMUM),
|
||||
HID_RI_LOGICAL_MINIMUM(16, SYSTEM_CONTROL_USAGE_MINIMUM),
|
||||
HID_RI_LOGICAL_MAXIMUM(16, SYSTEM_CONTROL_USAGE_MAXIMUM),
|
||||
HID_RI_REPORT_COUNT(8, 1),
|
||||
HID_RI_REPORT_SIZE(8, 16),
|
||||
HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE),
|
||||
@@ -478,6 +479,28 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM RawReport[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
const USB_Descriptor_HIDReport_Datatype_t PROGMEM PloverReport[] = {
|
||||
HID_RI_USAGE_PAGE(16, 0xFF50), //
|
||||
HID_RI_USAGE(16, 0x4C56), // Vendor Defined (0xff P L V)
|
||||
HID_RI_COLLECTION(8, 0x01), // Application
|
||||
HID_RI_REPORT_ID(8, REPORT_ID_PLOVER_HID),
|
||||
HID_RI_LOGICAL_MINIMUM(8, 0),
|
||||
HID_RI_LOGICAL_MAXIMUM(8, 1),
|
||||
HID_RI_REPORT_SIZE(8, 1),
|
||||
HID_RI_REPORT_COUNT(8, 0x40),
|
||||
HID_RI_USAGE_PAGE(8, 0x0A), // Usage Page: Ordinal
|
||||
HID_RI_USAGE_MINIMUM(8, 0),
|
||||
HID_RI_USAGE_MAXIMUM(8, 0x3F),
|
||||
HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE),
|
||||
HID_RI_END_COLLECTION(0),
|
||||
};
|
||||
|
||||
// The Plover HID report is sent with sizeof(report_plover_hid_t), but the endpoint and descriptor
|
||||
// are sized with PLOVER_HID_EPSIZE; they must match or reports get truncated/padded.
|
||||
STATIC_ASSERT(sizeof(report_plover_hid_t) == PLOVER_HID_EPSIZE, "report_plover_hid_t size must match PLOVER_HID_EPSIZE");
|
||||
#endif
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = {
|
||||
HID_RI_USAGE_PAGE(16, 0xFF31), // Vendor Defined (PJRC Teensy compatible)
|
||||
@@ -643,6 +666,46 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = {
|
||||
},
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
/*
|
||||
* Plover HID
|
||||
*/
|
||||
.Plover_Interface = {
|
||||
.Header = {
|
||||
.Size = sizeof(USB_Descriptor_Interface_t),
|
||||
.Type = DTYPE_Interface
|
||||
},
|
||||
.InterfaceNumber = PLOVER_HID_INTERFACE,
|
||||
.AlternateSetting = 0x00,
|
||||
.TotalEndpoints = 1,
|
||||
.Class = HID_CSCP_HIDClass,
|
||||
.SubClass = HID_CSCP_NonBootSubclass,
|
||||
.Protocol = HID_CSCP_NonBootProtocol,
|
||||
.InterfaceStrIndex = NO_DESCRIPTOR
|
||||
},
|
||||
.Plover_HID = {
|
||||
.Header = {
|
||||
.Size = sizeof(USB_HID_Descriptor_HID_t),
|
||||
.Type = HID_DTYPE_HID
|
||||
},
|
||||
.HIDSpec = VERSION_BCD(1, 1, 1),
|
||||
.CountryCode = 0x00,
|
||||
.TotalReportDescriptors = 1,
|
||||
.HIDReportType = HID_DTYPE_Report,
|
||||
.HIDReportLength = sizeof(PloverReport)
|
||||
},
|
||||
.Plover_INEndpoint = {
|
||||
.Header = {
|
||||
.Size = sizeof(USB_Descriptor_Endpoint_t),
|
||||
.Type = DTYPE_Endpoint
|
||||
},
|
||||
.EndpointAddress = (ENDPOINT_DIR_IN | PLOVER_HID_IN_EPNUM),
|
||||
.Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA),
|
||||
.EndpointSize = PLOVER_HID_EPSIZE,
|
||||
.PollingIntervalMS = 0x01
|
||||
},
|
||||
#endif
|
||||
|
||||
#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP)
|
||||
/*
|
||||
* Mouse
|
||||
@@ -1285,6 +1348,14 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
case PLOVER_HID_INTERFACE:
|
||||
Address = &ConfigurationDescriptor.Plover_HID;
|
||||
Size = sizeof(USB_HID_Descriptor_HID_t);
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
case CONSOLE_INTERFACE:
|
||||
Address = &ConfigurationDescriptor.Console_HID;
|
||||
@@ -1342,6 +1413,14 @@ uint16_t get_usb_descriptor(const uint16_t wValue, const uint16_t wIndex, const
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
case PLOVER_HID_INTERFACE:
|
||||
Address = &PloverReport;
|
||||
Size = sizeof(PloverReport);
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONSOLE_ENABLE
|
||||
case CONSOLE_INTERFACE:
|
||||
Address = &ConsoleReport;
|
||||
|
||||
@@ -78,6 +78,13 @@ typedef struct {
|
||||
USB_Descriptor_Endpoint_t Raw_OUTEndpoint;
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
// Plover HID Interface
|
||||
USB_Descriptor_Interface_t Plover_Interface;
|
||||
USB_HID_Descriptor_HID_t Plover_HID;
|
||||
USB_Descriptor_Endpoint_t Plover_INEndpoint;
|
||||
#endif
|
||||
|
||||
#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP)
|
||||
// Mouse HID Interface
|
||||
USB_Descriptor_Interface_t Mouse_Interface;
|
||||
@@ -164,6 +171,10 @@ enum usb_interfaces {
|
||||
RAW_INTERFACE,
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
PLOVER_HID_INTERFACE,
|
||||
#endif
|
||||
|
||||
#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP)
|
||||
MOUSE_INTERFACE,
|
||||
#endif
|
||||
@@ -227,6 +238,10 @@ enum usb_endpoints {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
PLOVER_HID_IN_EPNUM = NEXT_EPNUM,
|
||||
#endif
|
||||
|
||||
#ifdef SHARED_EP_ENABLE
|
||||
SHARED_IN_EPNUM = NEXT_EPNUM,
|
||||
#endif
|
||||
@@ -287,6 +302,7 @@ enum usb_endpoints {
|
||||
#define SHARED_EPSIZE 32
|
||||
#define MOUSE_EPSIZE 16
|
||||
#define RAW_EPSIZE 32
|
||||
#define PLOVER_HID_EPSIZE 9
|
||||
#define CONSOLE_EPSIZE 32
|
||||
#define MIDI_STREAM_EPSIZE 64
|
||||
#define CDC_NOTIFICATION_EPSIZE 8
|
||||
|
||||
@@ -16,12 +16,28 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "compiler_support.h"
|
||||
|
||||
// Prefix string literal with L for descriptors
|
||||
#define USBCONCAT(a, b) a##b
|
||||
#define USBSTR(s) USBCONCAT(L, s)
|
||||
|
||||
#define HID_VALUE_16(v) ((uint8_t)(v & 0xFF)), ((uint8_t)(v >> 8))
|
||||
|
||||
/////////////////////
|
||||
// System Control usage range
|
||||
//
|
||||
// Keep this below the Generic Desktop D-pad usages (0x90 and up). If the range
|
||||
// reaches them, hosts like Steam see the D-pad and treat the keyboard as a gamepad.
|
||||
|
||||
#ifndef SYSTEM_CONTROL_USAGE_MINIMUM
|
||||
# define SYSTEM_CONTROL_USAGE_MINIMUM 0x0081 // System Power Down
|
||||
#endif
|
||||
#ifndef SYSTEM_CONTROL_USAGE_MAXIMUM
|
||||
# define SYSTEM_CONTROL_USAGE_MAXIMUM 0x008F // System Warm Restart
|
||||
#endif
|
||||
STATIC_ASSERT(SYSTEM_CONTROL_USAGE_MINIMUM <= SYSTEM_CONTROL_USAGE_MAXIMUM, "SYSTEM_CONTROL_USAGE_MINIMUM must not be greater than SYSTEM_CONTROL_USAGE_MAXIMUM");
|
||||
|
||||
/////////////////////
|
||||
// RAW Usage page and ID configuration
|
||||
|
||||
|
||||
@@ -68,6 +68,10 @@ enum usb_interfaces {
|
||||
RAW_INTERFACE,
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
PLOVER_HID_INTERFACE,
|
||||
#endif
|
||||
|
||||
#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP)
|
||||
SHARED_INTERFACE,
|
||||
#endif
|
||||
@@ -87,6 +91,10 @@ STATIC_ASSERT(TOTAL_INTERFACES <= MAX_INTERFACES, "There are not enough availabl
|
||||
# error Mouse/Extra Keys share an endpoint with Console. Please disable one of the two.
|
||||
#endif
|
||||
|
||||
#if defined(PLOVER_HID_ENABLE) && defined(RAW_ENABLE)
|
||||
# error Plover HID shares an endpoint with Raw HID. Please disable one of the two.
|
||||
#endif
|
||||
|
||||
static report_keyboard_t keyboard_report_sent;
|
||||
|
||||
static void send_report_fragment(uint8_t endpoint, void *data, size_t size) {
|
||||
@@ -281,6 +289,14 @@ void send_programmable_button(report_programmable_button_t *report) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#define PLOVER_HID_EPSIZE 9
|
||||
|
||||
void send_plover_hid(report_plover_hid_t *report) {
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
send_report(4, report, sizeof(report_plover_hid_t));
|
||||
#endif
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------*
|
||||
* Request from host *
|
||||
*------------------------------------------------------------------*/
|
||||
@@ -586,18 +602,18 @@ const PROGMEM uchar shared_hid_report[] = {
|
||||
|
||||
#ifdef EXTRAKEY_ENABLE
|
||||
// Extrakeys report descriptor
|
||||
0x05, 0x01, // Usage Page (Generic Desktop)
|
||||
0x09, 0x80, // Usage (System Control)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
0x85, REPORT_ID_SYSTEM, // Report ID
|
||||
0x19, 0x01, // Usage Minimum (Pointer)
|
||||
0x2A, 0xB7, 0x00, // Usage Maximum (System Display LCD Autoscale)
|
||||
0x15, 0x01, // Logical Minimum
|
||||
0x26, 0xB7, 0x00, // Logical Maximum
|
||||
0x95, 0x01, // Report Count (1)
|
||||
0x75, 0x10, // Report Size (16)
|
||||
0x81, 0x00, // Input (Data, Array, Absolute)
|
||||
0xC0, // End Collection
|
||||
0x05, 0x01, // Usage Page (Generic Desktop)
|
||||
0x09, 0x80, // Usage (System Control)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
0x85, REPORT_ID_SYSTEM, // Report ID
|
||||
0x1A, HID_VALUE_16(SYSTEM_CONTROL_USAGE_MINIMUM), // Usage Minimum
|
||||
0x2A, HID_VALUE_16(SYSTEM_CONTROL_USAGE_MAXIMUM), // Usage Maximum
|
||||
0x16, HID_VALUE_16(SYSTEM_CONTROL_USAGE_MINIMUM), // Logical Minimum
|
||||
0x26, HID_VALUE_16(SYSTEM_CONTROL_USAGE_MAXIMUM), // Logical Maximum
|
||||
0x95, 0x01, // Report Count (1)
|
||||
0x75, 0x10, // Report Size (16)
|
||||
0x81, 0x00, // Input (Data, Array, Absolute)
|
||||
0xC0, // End Collection
|
||||
|
||||
0x05, 0x0C, // Usage Page (Consumer)
|
||||
0x09, 0x01, // Usage (Consumer Control)
|
||||
@@ -771,6 +787,26 @@ const PROGMEM uchar raw_hid_report[] = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef PLOVER_HID_ENABLE
|
||||
// clang-format off
|
||||
const PROGMEM uchar plover_hid_report[] = {
|
||||
0x06, 0x50, 0xFF, // Usage Page (Vendor Defined)
|
||||
0x0A, 0x56, 0x4C, // Usage (Vendor Defined) (0xff P L V)
|
||||
0xA1, 0x01, // Collection (Application)
|
||||
0x85, REPORT_ID_PLOVER_HID, // Report ID
|
||||
0x15, 0x00, // Logical Minimum (0)
|
||||
0x25, 0x01, // Logical Maximum (1)
|
||||
0x75, 0x01, // Report Size (1)
|
||||
0x95, 0x40, // Report Count (43)
|
||||
0x05, 0x0A, // Usage Page: Ordinal
|
||||
0x19, 0x00, // Usage Minimum
|
||||
0x29, 0x3F, // Usage Maximum (63)
|
||||
0x81, 0x02, // Output (Data, Variable, Absolute)
|
||||
0xC0 // End Collection
|
||||
};
|
||||
// clang-format on
|
||||
#endif
|
||||
|
||||
#if defined(CONSOLE_ENABLE)
|
||||
const PROGMEM uchar console_hid_report[] = {
|
||||
0x06, 0x31, 0xFF, // Usage Page (Vendor Defined - PJRC Teensy compatible)
|
||||
@@ -963,6 +999,46 @@ const PROGMEM usbConfigurationDescriptor_t usbConfigurationDescriptor = {
|
||||
},
|
||||
# endif
|
||||
|
||||
# if defined(PLOVER_HID_ENABLE)
|
||||
/*
|
||||
* Plover HID
|
||||
*/
|
||||
.ploverInterface = {
|
||||
.header = {
|
||||
.bLength = sizeof(usbInterfaceDescriptor_t),
|
||||
.bDescriptorType = USBDESCR_INTERFACE
|
||||
},
|
||||
.bInterfaceNumber = PLOVER_HID_INTERFACE,
|
||||
.bAlternateSetting = 0x00,
|
||||
.bNumEndpoints = 1,
|
||||
.bInterfaceClass = 0x03,
|
||||
.bInterfaceSubClass = 0x00,
|
||||
.bInterfaceProtocol = 0x00,
|
||||
.iInterface = 0x00
|
||||
},
|
||||
.ploverHID = {
|
||||
.header = {
|
||||
.bLength = sizeof(usbHIDDescriptor_t),
|
||||
.bDescriptorType = USBDESCR_HID
|
||||
},
|
||||
.bcdHID = 0x0101,
|
||||
.bCountryCode = 0x00,
|
||||
.bNumDescriptors = 1,
|
||||
.bDescriptorType = USBDESCR_HID_REPORT,
|
||||
.wDescriptorLength = sizeof(plover_hid_report)
|
||||
},
|
||||
.ploverINEndpoint = {
|
||||
.header = {
|
||||
.bLength = sizeof(usbEndpointDescriptor_t),
|
||||
.bDescriptorType = USBDESCR_ENDPOINT
|
||||
},
|
||||
.bEndpointAddress = (USBRQ_DIR_DEVICE_TO_HOST | USB_CFG_EP4_NUMBER),
|
||||
.bmAttributes = 0x03,
|
||||
.wMaxPacketSize = PLOVER_HID_EPSIZE,
|
||||
.bInterval = 0x01
|
||||
},
|
||||
# endif
|
||||
|
||||
# ifdef SHARED_EP_ENABLE
|
||||
/*
|
||||
* Shared
|
||||
@@ -1140,6 +1216,13 @@ USB_PUBLIC usbMsgLen_t usbFunctionDescriptor(struct usbRequest *rq) {
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(PLOVER_HID_ENABLE)
|
||||
case PLOVER_HID_INTERFACE:
|
||||
usbMsgPtr = (usbMsgPtr_t)plover_hid_report;
|
||||
len = sizeof(plover_hid_report);
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef SHARED_EP_ENABLE
|
||||
case SHARED_INTERFACE:
|
||||
usbMsgPtr = (usbMsgPtr_t)shared_hid_report;
|
||||
|
||||
@@ -104,6 +104,12 @@ typedef struct usbConfigurationDescriptor {
|
||||
usbEndpointDescriptor_t rawOUTEndpoint;
|
||||
#endif
|
||||
|
||||
#if defined(PLOVER_HID_ENABLE)
|
||||
usbInterfaceDescriptor_t ploverInterface;
|
||||
usbHIDDescriptor_t ploverHID;
|
||||
usbEndpointDescriptor_t ploverINEndpoint;
|
||||
#endif
|
||||
|
||||
#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP)
|
||||
usbInterfaceDescriptor_t sharedInterface;
|
||||
usbHIDDescriptor_t sharedHID;
|
||||
|
||||
Reference in New Issue
Block a user