forked from kofal.net/zmk
refactor(split): Refactor split code for extension Extract central/peripheral code to allow for plugging in alternate transports, instead of tying all split logic to BT. feat(split): Add full-duplex wired split support * Depends on full-duplex hardware UART for communication. * Supports all existing central commands/peripheral events, including sensors/inputs from peripherals. * Only one wired split peripheral supported (for now) * Relies on chosen `zmk,split-uart` referencing the UART device. docs: Add wired split config docs. Migrate split to its own dedicated config file, and add details on wired split config. Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com> fix: Properly override stack size on RP2040 Move the system work queue stack size override on RP2040 ouf of a `ZMK_BLE` conditional so it is properly applied generally for that SoC. --------- Co-authored-by: Nicolas Munnich <98408764+Nick-Munnich@users.noreply.github.com>
49 lines
1.3 KiB
C
49 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2025 The ZMK Contributors
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <zephyr/bluetooth/addr.h>
|
|
#include <zmk/behavior.h>
|
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE)
|
|
|
|
#include <zmk/ble.h>
|
|
#define BLE_PERIPHERAL_COUNT ZMK_SPLIT_BLE_PERIPHERAL_COUNT
|
|
|
|
#else
|
|
|
|
#define BLE_PERIPHERAL_COUNT 0
|
|
|
|
#endif
|
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_WIRED)
|
|
#define WIRED_PERIPHERAL_COUNT 1
|
|
#else
|
|
#define WIRED_PERIPHERAL_COUNT 0
|
|
#endif
|
|
|
|
#define ZMK_SPLIT_CENTRAL_PERIPHERAL_COUNT MAX(BLE_PERIPHERAL_COUNT, WIRED_PERIPHERAL_COUNT)
|
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS)
|
|
#include <zmk/hid_indicators_types.h>
|
|
#endif // IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS)
|
|
|
|
int zmk_split_central_invoke_behavior(uint8_t source, struct zmk_behavior_binding *binding,
|
|
struct zmk_behavior_binding_event event, bool state);
|
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS)
|
|
|
|
int zmk_split_central_update_hid_indicator(zmk_hid_indicators_t indicators);
|
|
|
|
#endif // IS_ENABLED(CONFIG_ZMK_SPLIT_PERIPHERAL_HID_INDICATORS)
|
|
|
|
#if IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING)
|
|
|
|
int zmk_split_central_get_peripheral_battery_level(uint8_t source, uint8_t *level);
|
|
|
|
#endif // IS_ENABLED(CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING)
|