Skip to content

Commit

Permalink
fixup! fixup! feat(split): Add full-duplex wired split support
Browse files Browse the repository at this point in the history
  • Loading branch information
petejohanson committed Feb 1, 2025
1 parent 81e8d8d commit 6baa960
Show file tree
Hide file tree
Showing 7 changed files with 477 additions and 164 deletions.
20 changes: 20 additions & 0 deletions app/dts/bindings/zmk,wired-split.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2024 The ZMK Contributors
# SPDX-License-Identifier: MIT

description: |
Complete specification of wired split connetion
compatible: "zmk,wired-split"

properties:
device:
type: phandle
required: true
description: The UART device for wired split communication

half-duplex:
type: boolean
description: Enable half-duplex protocol mode.

dir-gpios:
type: phandle-array
21 changes: 18 additions & 3 deletions app/src/split/wired/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ if ZMK_SPLIT_WIRED

choice ZMK_SPLIT_WIRED_UART_MODE_DEFAULT
prompt "Default UART Mode"
default ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_INTERRUPT if SERIAL_SUPPORT_INTERRUPT

config ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_POLLING
bool "Polling Mode"
config ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_ASYNC
bool "Async (DMA) Mode"
depends on SERIAL_SUPPORT_ASYNC
select UART_ASYNC_API

config ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_INTERRUPT
bool "Interrupt Mode"
depends on SERIAL_SUPPORT_INTERRUPT
select UART_INTERRUPT_DRIVEN

config ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_POLLING
bool "Polling Mode"

endchoice

if ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_POLLING
Expand All @@ -20,10 +25,20 @@ config ZMK_SPLIT_WIRED_POLLING_RX_PERIOD

endif

if ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_ASYNC

config ZMK_SPLIT_WIRED_ASYNC_RX_TIMEOUT
int "RX Timeout (in microseconds) before reporting received data"

endif

config ZMK_SPLIT_WIRED_CMD_BUFFER_ITEMS
int "Number of central commands to buffer for TX/RX"

config ZMK_SPLIT_WIRED_EVENT_BUFFER_ITEMS
int "Number of peripheral events to buffer for TX/RX"

config ZMK_SPLIT_WIRED_HALF_DUPLEX_RX_TIMEOUT
int "RX timeout (in ticks) when polling peripheral(s)"

endif
11 changes: 11 additions & 0 deletions app/src/split/wired/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,15 @@ config ZMK_SPLIT_WIRED_POLLING_RX_PERIOD

endif


if ZMK_SPLIT_WIRED_UART_MODE_DEFAULT_ASYNC

config ZMK_SPLIT_WIRED_ASYNC_RX_TIMEOUT
default 100

endif

config ZMK_SPLIT_WIRED_HALF_DUPLEX_RX_TIMEOUT
default 50

endif
Loading

0 comments on commit 6baa960

Please sign in to comment.