nRF Desktop: Application-specific Kconfig options

The nRF Desktop introduces Kconfig options that you can use to simplify an application configuration. You can use these options to select a device role and to automatically apply a default configuration suitable for the selected role.

Note

Part of the default configuration is applied by modifying the default values of Kconfig options. Changing configuration in menuconfig does not automatically adjust user-configurable values to the new defaults. So, you must update those values manually. For more information, see the Stuck symbols in menuconfig and guiconfig section on the Kconfig - Tips and Best Practices in the Zephyr documentation.

The default Kconfig option values are automatically updated if configuration changes are applied directly in the configuration files.

HID configuration

The nRF Desktop application introduces application-specific configuration options related to HID device configuration. These options are defined in Kconfig.hid.

The options define the nRF Desktop device role. The device role can be either a HID dongle (CONFIG_DESKTOP_ROLE_HID_DONGLE) or a HID peripheral (CONFIG_DESKTOP_ROLE_HID_PERIPHERAL). The HID peripheral role can also specify a peripheral type:

Each role automatically implies the nRF Desktop modules needed for the role. For example, HID state module is automatically enabled for the HID peripheral role.

By default, the nRF Desktop devices use a predefined format of HID reports. The common HID report map is defined in the configuration/common/hid_report_desc.c file. The selected role implies a set of related HID reports. For example, HID mouse automatically enables support for HID mouse report. If you select other HID device peripheral type, you need to explicitly define the set of HID reports in the configuration.

Apart from this, you can specify the supported HID boot protocol interface as one of the following:

HID device identifiers

The nRF Desktop application defines the following common device identifiers:

These Kconfig options determine the default values of device identifiers used for:

Note

Apart from the mentioned common device identifiers, the nRF Desktop application defines an application-specific string representing device generation (CONFIG_DESKTOP_DEVICE_GENERATION). The generation allows to distinguish configurations that use the same board and bootloader, but are not interoperable. The value can be read through the Configuration channel.

Debug configuration

The nRF Desktop application introduces application-specific configuration options related to the debug configuration. These options are defined in the Kconfig.debug file.

The CONFIG_DESKTOP_LOG Kconfig option enables support for logging in the nRF Desktop application. This option overlays Kconfig option defaults from the Logging subsystem to align them with the nRF Desktop requirements. The nRF Desktop configuration uses SEGGER J-Link RTT as the Logging subsystem backend.

The CONFIG_DESKTOP_SHELL Kconfig option enables support for CLI in the nRF Desktop application. This option overlays Kconfig option defaults from the Shell subsystem to align them with the nRF Desktop requirements. The nRF Desktop configuration uses SEGGER J-Link RTT as the Shell subsystem backend. If both shell and logging are enabled, logger uses shell as the logging backend.

See the Kconfig.debug file content for details.

Default common configuration

The nRF Desktop application aligns the configuration with the nRF Desktop use case by overlaying Kconfig defaults and selecting or implying the required Kconfig options. Among others, the Kconfig Application Event Manager and Common Application Framework options are selected to ensure that they are enabled. The CONFIG_DESKTOP_SETTINGS_LOADER and CONFIG_DESKTOP_POWER_MANAGER are implied to enable the Settings loader module and Power manager module modules, respectively. See the Kconfig.defaults file for details related to the default common configuration.

Bluetooth configuration

The nRF Desktop application introduces application-specific configuration options related to Bluetooth connectivity configuration. These options are defined in Kconfig.ble file.

The CONFIG_DESKTOP_BT Kconfig option enables support for Bluetooth connectivity in the nRF Desktop application. The option is enabled by default.

The nRF Desktop Bluetooth peripheral configuration (CONFIG_DESKTOP_BT_PERIPHERAL) is automatically enabled for the nRF Desktop HID peripheral role (CONFIG_DESKTOP_ROLE_HID_PERIPHERAL). The nRF Desktop Bluetooth central configuration (CONFIG_DESKTOP_BT_CENTRAL) is automatically enabled for the nRF Desktop HID dongle role (CONFIG_DESKTOP_ROLE_HID_DONGLE)

The nRF Desktop Bluetooth configuration options perform the following:

  • Imply Bluetooth-related application modules that are required for the selected device role.

  • Select required functionalities in Zephyr’s Bluetooth stack.

  • Overlay Bluetooth Kconfig option defaults to align them with the nRF Desktop use case.

See Kconfig.ble file content for details. See the nRF Desktop: Bluetooth for more information about Bluetooth support in nRF Desktop application.

CAF configuration

The nRF Desktop application overlays the defaults of the Common Application Framework related Kconfig options to align them with the nRF Desktop use case. The files that apply the overlays are located in the src/modules directory and are named Kconfig.caf_module_name.default. For example, the Kconfig defaults of CAF: Settings loader module are overlayed in the src/modules/Kconfig.caf_settings_loader.default.