rushabhcodes/wireless-split-keyboard

Wireless Split Keyboard — custom routed nRF52840 split PCBs with a printable enclosure

Version
0.4.5
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone rushabhcodes/wireless-split-keyboard  # download the package files into ./wireless-split-keyboard
tsci add rushabhcodes/wireless-split-keyboard    # add it to your project as @tsci/rushabhcodes.wireless-split-keyboard

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

firmware/README.md

# Custom Sofle ZMK boards

Bare nRF52840 QIAA boards: `custom_sofle_left/nrf52840` (BLE central + USB) and `custom_sofle_right/nrf52840` (BLE peripheral). Definitions use the SoC directly. No controller module, nice!nano board, borrowed bootloader or UF2 address offset is involved.

## Build

The tested ZMK revision is `4de313367288aad5aeaa1243890e40dc813f7008`, with its pinned `v4.1.0+zmk-fixes` Zephyr manifest and LVGL module. Use a separate West workspace without spaces in its path. Install West, Zephyr's Python requirements, CMake 3.x and Zephyr SDK 0.17.4 with the `arm-zephyr-eabi` toolchain. The generated boards select minimal libc and LVGL's custom sprintf path because this SDK/Zephyr combination has incompatible Picolibc lock declarations, and Zephyr already maps LVGL formatting to libc.

From an initialized workspace whose ZMK checkout is `WORKSPACE/zmk`:

```sh
cd WORKSPACE/zmk
west config manifest.project-filter -- '-.*,+zephyr,+cmsis,+cmsis_6,+hal_nordic,+lvgl,+zmk-studio-messages,+tinycrypt,+mbedtls'
west update -n -o=--depth=1
west zephyr-export
```

From the keyboard repository, with Bun and West on PATH:

```sh
bun scripts/generate-firmware.ts
scripts/build-firmware.sh /absolute/path/to/WORKSPACE
```

The helper copies this module into the workspace to avoid spaces in CMake paths. Successful builds copy development `.hex`/`.bin`, configurations, DTS and logs into `outputs/firmware`. No flashing occurs.

## Behavior and hardware contract

- `src/pinout.ts` is shared with circuit generation. Regenerate after GPIO changes and rebuild both halves; also update the explicit SPI pinctrl and ADC input bindings in the generator if those peripheral pins change.
- 5×6 COL2ROW matrix per half. Right transform has column offset 6; encoder push is row 4, local column 0. There are 60 matrix positions across both halves.
- Bourns PEC11R-4215K-S0012 encoders use 48 quadrature steps / 24 detents per turn.
- Left encoder controls volume. Right encoder emits mouse-wheel scroll events through ZMK pointing support. Direction and detent count need physical confirmation; no Corax controller board is used.
- Sharp LS011B7DH03 uses the Zephyr `sharp,ls0xx` driver at 160×68, 1 MHz SPI. The driver sets LSB-first and active-high chip select. Its external VCOM thread is requested at 60 Hz; Zephyr 4.1's integer 16 ms period yields approximately 62.5 Hz with 3 µs high pulses, within the panel's 57–70 Hz / 2 µs minimum specification. Verify on a scope.
- Panel supply turns on before display initialization. Deep sleep is disabled until safe DISP/SPI/rail shutdown and wake initialization are implemented. Battery endurance estimates therefore remain assumptions.
- Switched 1 MΩ/1 MΩ battery divider, 1 nF filter, 40 µs ADC acquisition. Confirm leakage and voltage readings on hardware.
- REG1 DCDC enabled, 32.768 kHz crystal selected, initial radio output +4 dBm. Antenna tuning is still required.

## Flash and bring-up

With `CONFIG_USE_DT_CODE_PARTITION=y`, the application links at flash address zero within a 960 KiB application region; 64 KiB at 0xF0000 is reserved for settings. Use a voltage-aware SWD probe after current-limited power-up checks. Confirm target VCC, all DEC nodes, clock startup and reset first. Do not flash an unreviewed bootloader or enable probe power without checking the power path. Development binaries are compile-tested only; no keyboard hardware has been flashed or tested.

USB suspend-current charger control is not implemented. Panel power-down, deep sleep and charge measurements remain release work. See `docs/validation.md` for current evidence and limitations.