Skip to content

Commit

Permalink
Merge branch 'main' into feat/support_remote_wakeup
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoboGu authored Dec 13, 2024
2 parents 5c6200b + eca629b commit 91cc5f9
Show file tree
Hide file tree
Showing 30 changed files with 2,158 additions and 82 deletions.
209 changes: 209 additions & 0 deletions docs/src/images/tap_hold.drawio

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions docs/src/keyboard_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ If your keys are directly connected to the microcontroller pins, set `matrix_typ

If your pin requires a pull-up resistor and the button press pulls the pin low, set `direct_pin_low_active` to true. Conversely, set it to false if your pin requires a pull-down resistor and the button press pulls the pin high.

Currently, col2row is used as the default matrix type. If you want to use row2col matrix, you should edit your `Cargo.toml`, disable the default feature as the following:

```toml
# Cargo.toml
rmk = { version = "0.4", default-features = false, features = ["nrf52840_ble"] }
```

Here is an example for rp2040.
```toml
matrix_type = "direct_pin"
Expand Down Expand Up @@ -172,6 +179,25 @@ adjust = 3
```
In this example, when both layers 1 (`upper`) and 2 (`lower`) are active, layer 3 (`adjust`) will also be enabled.

#### Tap Hold

In the `tap_hold` sub-table, you can configure the following parameters:

- `enable_hrm`: Enables or disables HRM (Home Row Mod) mode. When enabled, the `prior_idle_time` setting becomes functional. Defaults to `false`.
- `prior_idle_time`: If the previous non-modifier key is released within this period before pressing the current tap-hold key, the tap action for the tap-hold behavior will be triggered. This parameter is effective only when enable_hrm is set to `true`. Defaults to 120ms.
- `hold_timeout`: Defines the duration a tap-hold key must be pressed to determine hold behavior. If tap-hold key is released within this time, the key is recognized as a "tap". Holding it beyond this duration triggers the "hold" action. Defaults to 250ms.
- `post_wait_time`: Adds an additional delay after releasing a tap-hold key to check if any keys pressed during the `hold_timeout` are released. This helps accommodate fast typing scenarios where some keys may not be fully released during a hold. Defaults to 50ms

The following are the typical configurations:

```toml
[behavior]
# Enable HRM
tap_hold = { enable_hrm = true, prior_idle_time = "120ms", hold_timeout = "250ms", post_wait_time = "50ms"}
# Disable HRM, you can safely ignore any fields if you don't want to change them
tap_hold = { enable_hrm = false, hold_timeout = "200ms" }
```

#### One Shot

In the `one_shot` sub-table you can define how long OSM or OSL will wait before releasing the modifier/layer with the `timeout` option, default is one second.
Expand Down
18 changes: 17 additions & 1 deletion docs/src/split_keyboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,23 @@ input_pins = ["P1_11", "P1_10"]
output_pins = ["P0_30"]
```

When using split, the input/output pins defined in `[matrix]` section is not valid anymore. Instead, the input/output pins of split boards are defined in `[split.central.matrix]` and `[split.peripheral.matrix]`. The contents of the split matrix configuration is the same as for `[matrix]`. This means each peripheral and central keyboard also supports `direct_pin`. The rows/cols in `[matrix]` section is the total number of rows/cols of the whole keyboard.
When using split, the input/output pins defined in `[matrix]` section is not valid anymore. Instead, the input/output pins of split boards are defined in `[split.central.matrix]` and `[split.peripheral.matrix]`. The contents of the split matrix configuration is the same as for `[matrix]`. This means each peripheral and central keyboard also supports `direct_pin`.

The rows/cols in `[layout]` section is the total number of rows/cols of the whole keyboard. For each split(central and peripherals), rows/cols/row_offset/col_offset should be defined to indicate the current split's position in the whole keyboard's layout. Suppose we have a 2-row + 5-col split, the left(central) is 2\*2, and the right(peripheral) is 2\*3, the positions should be defined as:

```toml
[split.central]
rows = 2 # The number of rows in central
cols = 2 # The number of cols in central
row_offset = 0 # The row offset, for central(left) it's 0
col_offset = 0 # The col offset, for central(left) it's 0

[[split.peripheral]]
rows = 2 # The number of rows in the peripheral
cols = 3 # The number of cols in the peripheral
row_offset = 0 # The row offset of the peripheral, peripheral starts from row 0, so the offset is 0
col_offset = 2 # The col offset of the peripheral. Central has 2 cols, so the col_offset should be 2 for the peripheral
```

If you're using BLE, `ble_addr` is required for both central and peripheral. Each device needs a `ble_addr`.

Expand Down
3 changes: 3 additions & 0 deletions examples/use_config/nrf52840_ble_split/keyboard.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ keymap = [
[ble]
enabled = true

[behavior]
tap_hold = { enable_hrm = true, prior_idle_time = "120ms", hold_timeout = "250ms", post_wait_time = "50ms"}

[split]
connection = "ble"

Expand Down
8 changes: 8 additions & 0 deletions examples/use_rust/py32f07x/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[target.'cfg(all(target_arch = "arm", target_os = "none"))']
runner = "probe-rs run --chip PY32F072xB"

[build]
target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+

[env]
DEFMT_LOG = "debug"
Loading

0 comments on commit 91cc5f9

Please sign in to comment.