From 41c9d810967c3be71df9c3727660ce968756ce34 Mon Sep 17 00:00:00 2001
From: Cem Aksoylar <caksoylar@gmail.com>
Date: Sun, 3 Jul 2022 14:48:09 -0700
Subject: [PATCH] fix(docs): Update config docs for split Kconfig refactor

---
 docs/docs/config/system.md            | 51 +++++++++++++++------------
 docs/docs/development/new-behavior.md |  4 +--
 2 files changed, 31 insertions(+), 24 deletions(-)

diff --git a/docs/docs/config/system.md b/docs/docs/config/system.md
index af7bced5..4784339c 100644
--- a/docs/docs/config/system.md
+++ b/docs/docs/config/system.md
@@ -64,28 +64,19 @@ Exactly zero or one of the following options may be set to `y`. The first is use
 See [Zephyr's Bluetooth stack architecture documentation](https://docs.zephyrproject.org/latest/guides/bluetooth/bluetooth-arch.html)
 for more information on configuring Bluetooth.
 
-| Config                                                | Type | Description                                                             | Default |
-| ----------------------------------------------------- | ---- | ----------------------------------------------------------------------- | ------- |
-| `CONFIG_BT`                                           | bool | Enable Bluetooth support                                                |         |
-| `CONFIG_BT_MAX_CONN`                                  | int  | Maximum number of simultaneous Bluetooth connections                    | 5       |
-| `CONFIG_BT_MAX_PAIRED`                                | int  | Maximum number of paired Bluetooth devices                              | 5       |
-| `CONFIG_ZMK_BLE`                                      | bool | Enable ZMK as a Bluetooth keyboard                                      |         |
-| `CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START`                 | bool | Clears all bond information from the keyboard on startup                | n       |
-| `CONFIG_ZMK_BLE_CONSUMER_REPORT_QUEUE_SIZE`           | int  | Max number of consumer HID reports to queue for sending over BLE        | 5       |
-| `CONFIG_ZMK_BLE_KEYBOARD_REPORT_QUEUE_SIZE`           | int  | Max number of keyboard HID reports to queue for sending over BLE        | 20      |
-| `CONFIG_ZMK_BLE_INIT_PRIORITY`                        | int  | BLE init priority                                                       | 50      |
-| `CONFIG_ZMK_BLE_THREAD_PRIORITY`                      | int  | Priority of the BLE notify thread                                       | 5       |
-| `CONFIG_ZMK_BLE_THREAD_STACK_SIZE`                    | int  | Stack size of the BLE notify thread                                     | 512     |
-| `CONFIG_ZMK_BLE_PASSKEY_ENTRY`                        | bool | Experimental: require typing passkey from host to pair BLE connection   | n       |
-| `CONFIG_ZMK_SPLIT`                                    | bool | Enable split keyboard support                                           | n       |
-| `CONFIG_ZMK_SPLIT_BLE`                                | bool | Use BLE to communicate between split keyboard halves                    | y       |
-| `CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL`                   | bool | `y` for central device, `n` for peripheral                              |         |
-| `CONFIG_ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE`    | int  | Max number of key state events to queue when received from peripherals  | 5       |
-| `CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_STACK_SIZE`   | int  | Stack size of the BLE split central write thread                        | 512     |
-| `CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE`   | int  | Max number of behavior run events to queue to send to the peripheral(s) | 5       |
-| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE`          | int  | Stack size of the BLE split peripheral notify thread                    | 650     |
-| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_PRIORITY`            | int  | Priority of the BLE split peripheral notify thread                      | 5       |
-| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_POSITION_QUEUE_SIZE` | int  | Max number of key state events to queue to send to the central          | 10      |
+| Config                                      | Type | Description                                                           | Default |
+| ------------------------------------------- | ---- | --------------------------------------------------------------------- | ------- |
+| `CONFIG_BT`                                 | bool | Enable Bluetooth support                                              |         |
+| `CONFIG_BT_MAX_CONN`                        | int  | Maximum number of simultaneous Bluetooth connections                  | 5       |
+| `CONFIG_BT_MAX_PAIRED`                      | int  | Maximum number of paired Bluetooth devices                            | 5       |
+| `CONFIG_ZMK_BLE`                            | bool | Enable ZMK as a Bluetooth keyboard                                    |         |
+| `CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START`       | bool | Clears all bond information from the keyboard on startup              | n       |
+| `CONFIG_ZMK_BLE_CONSUMER_REPORT_QUEUE_SIZE` | int  | Max number of consumer HID reports to queue for sending over BLE      | 5       |
+| `CONFIG_ZMK_BLE_KEYBOARD_REPORT_QUEUE_SIZE` | int  | Max number of keyboard HID reports to queue for sending over BLE      | 20      |
+| `CONFIG_ZMK_BLE_INIT_PRIORITY`              | int  | BLE init priority                                                     | 50      |
+| `CONFIG_ZMK_BLE_THREAD_PRIORITY`            | int  | Priority of the BLE notify thread                                     | 5       |
+| `CONFIG_ZMK_BLE_THREAD_STACK_SIZE`          | int  | Stack size of the BLE notify thread                                   | 512     |
+| `CONFIG_ZMK_BLE_PASSKEY_ENTRY`              | bool | Experimental: require typing passkey from host to pair BLE connection | n       |
 
 Note that `CONFIG_BT_MAX_CONN` and `CONFIG_BT_MAX_PAIRED` should be set to the same value. On a split keyboard they should only be set for the central and must be set to one greater than the desired number of bluetooth profiles.
 
@@ -95,3 +86,19 @@ Note that `CONFIG_BT_MAX_CONN` and `CONFIG_BT_MAX_PAIRED` should be set to the s
 | ------------------------ | ---- | ---------------------------------------- | ------- |
 | `CONFIG_ZMK_USB_LOGGING` | bool | Enable USB CDC ACM logging for debugging | n       |
 | `CONFIG_ZMK_LOG_LEVEL`   | int  | Log level for ZMK debug messages         | 4       |
+
+### Split keyboards
+
+Following split keyboard settings are defined in [zmk/app/src/split/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/src/split/Kconfig) (generic) and [zmk/app/src/split/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/src/split/bluetooth/Kconfig) (bluetooth).
+
+| Config                                                | Type | Description                                                             | Default |
+| ----------------------------------------------------- | ---- | ----------------------------------------------------------------------- | ------- |
+| `CONFIG_ZMK_SPLIT`                                    | bool | Enable split keyboard support                                           | n       |
+| `CONFIG_ZMK_SPLIT_BLE`                                | bool | Use BLE to communicate between split keyboard halves                    | y       |
+| `CONFIG_ZMK_SPLIT_ROLE_CENTRAL`                       | bool | `y` for central device, `n` for peripheral                              |         |
+| `CONFIG_ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE`    | int  | Max number of key state events to queue when received from peripherals  | 5       |
+| `CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_STACK_SIZE`   | int  | Stack size of the BLE split central write thread                        | 512     |
+| `CONFIG_ZMK_BLE_SPLIT_CENTRAL_SPLIT_RUN_QUEUE_SIZE`   | int  | Max number of behavior run events to queue to send to the peripheral(s) | 5       |
+| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE`          | int  | Stack size of the BLE split peripheral notify thread                    | 650     |
+| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_PRIORITY`            | int  | Priority of the BLE split peripheral notify thread                      | 5       |
+| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_POSITION_QUEUE_SIZE` | int  | Max number of key state events to queue to send to the central          | 10      |
diff --git a/docs/docs/development/new-behavior.md b/docs/docs/development/new-behavior.md
index 782dc010..af98613e 100644
--- a/docs/docs/development/new-behavior.md
+++ b/docs/docs/development/new-behavior.md
@@ -347,8 +347,8 @@ endif()
 For behaviors that do not require central locality, the following options for updating `app/CmakeLists.txt` also exist:
 
 - Behavior applies to unibody, or central or peripheral half of keyboard: place `target_sources(app PRIVATE <behavior_name>.c)` line _before_ `if ((NOT CONFIG_ZMK_SPLIT) OR CONFIG_ZMK_SPLIT_ROLE_CENTRAL)`
-- Behavior applies to _only_ central half of split keyboard: place `target_sources(app PRIVATE <behavior_name>.c)` after `if (CONFIG_ZMK_SPLIT_BLE AND CONFIG_ZMK_SPLIT_ROLE_CENTRAL)`
-- Behavior applies to _only_ peripheral half of split keyboard: place `target_sources(app PRIVATE <behavior_name>.c)` after `if (CONFIG_ZMK_SPLIT_BLE AND (NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL))`
+- Behavior applies to _only_ central half of split keyboard: place `target_sources(app PRIVATE <behavior_name>.c)` after `if (CONFIG_ZMK_SPLIT AND CONFIG_ZMK_SPLIT_ROLE_CENTRAL)`
+- Behavior applies to _only_ peripheral half of split keyboard: place `target_sources(app PRIVATE <behavior_name>.c)` after `if (CONFIG_ZMK_SPLIT AND (NOT CONFIG_ZMK_SPLIT_ROLE_CENTRAL))`
 - Behavior requires certain condition in a keyboard's `.conf` file to be met: use `target_sources_ifdef(CONFIG_<Configuration Requirement> app PRIVATE <behavior_name>.c)` instead of `target_sources(<behavior_name>.c)`
 
 ### Defining common use-cases for the behavior (`.dtsi`) (Optional)