From 63b10405677a8636487dbbd6fe68c38aa5af9fcf Mon Sep 17 00:00:00 2001 From: Marek Pieta Date: Mon, 4 Mar 2024 13:44:16 +0100 Subject: [PATCH] applications: nrf_desktop: Add support for nRF54L PDK The PDK can act as either keyboard or mouse. Jira: NCSDK-26216 Signed-off-by: Marek Pieta Signed-off-by: Pirun Lee --- .../nrf54l15pdk_nrf54l15_cpuapp/app.overlay | 86 ++++++++++++++ .../nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h | 26 +++++ .../buttons_sim_def.h | 26 +++++ .../click_detector_def.h | 23 ++++ .../hid_keyboard_leds_def.h | 23 ++++ .../hid_keyboard_leds_def_keyboard.h | 28 +++++ .../hid_keymap_def.h | 28 +++++ .../hid_keymap_def_keyboard.h | 55 +++++++++ .../led_state_def.h | 40 +++++++ .../port_state_def.h | 25 ++++ .../nrf54l15pdk_nrf54l15_cpuapp/prj.conf | 108 +++++++++++++++++ .../prj_keyboard.conf | 110 ++++++++++++++++++ .../prj_release.conf | 90 ++++++++++++++ applications/nrf_desktop/sample.yaml | 7 +- 14 files changed, 674 insertions(+), 1 deletion(-) create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf create mode 100644 applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay new file mode 100644 index 000000000000..72d898304164 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/app.overlay @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +/* Redefine the partition map. */ +&rram0 { + /delete-node/ partitions; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + app_partition: partition@0 { + label = "application"; + reg = <0x0 0x177000>; + }; + + storage_partition: partition@177000 { + label = "storage"; + reg = <0x177000 0x6000>; + }; + }; +}; + +/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */ +&wdt30 { + status = "okay"; +}; + +/ { + chosen { + zephyr,flash = &rram0; + zephyr,code-partition = &app_partition; + }; + + /* Disable leds and redefine them to align configuration with CAF LEDs requirements. */ + leds { + status = "disabled"; + }; + + gpioled0 { + compatible = "gpio-leds"; + status = "okay"; + label = "LED System State"; + + led0_g: led_0 { + gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>; + label = "Green LED 0"; + }; + }; + + gpioled1 { + compatible = "gpio-leds"; + status = "okay"; + label = "LED Conn State"; + + led1_g: led_1 { + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; + }; + }; + + gpioled2 { + compatible = "gpio-leds"; + status = "okay"; + label = "LED Num Lock"; + + led2_g: led_2 { + gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>; + label = "Green LED 2"; + }; + }; + + gpioled3 { + compatible = "gpio-leds"; + status = "okay"; + label = "LED Caps Lock"; + + led3_g: led_3 { + gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>; + label = "Green LED 3"; + }; + }; +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h new file mode 100644 index 000000000000..6187040060d6 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_def.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +/* This configuration file is included only once from button module and holds + * information about pins forming keyboard matrix. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} buttons_def_include_once; + +static const struct gpio_pin col[] = {}; + +static const struct gpio_pin row[] = { + { .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button0), gpios) }, + { .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button1), gpios) }, + /* GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.x do not support interrupts. + * Because of this, the GPIOs cannot be used by the CAF buttons module. + */ +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h new file mode 100644 index 000000000000..b6a008dc1686 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/buttons_sim_def.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +/* This configuration file is included only once from buttons_sim module + * and holds information about generated button presses sequence. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} buttons_sim_def_include_once; + +const static uint16_t simulated_key_sequence[] = { + KEY_ID(0x00, 0x11), /* N */ + KEY_ID(0x00, 0x12), /* O */ + KEY_ID(0x00, 0x15), /* R */ + KEY_ID(0x00, 0x07), /* D */ + KEY_ID(0x00, 0x0C), /* I */ + KEY_ID(0x00, 0x06), /* C */ + KEY_ID(0x00, 0x2C), /* spacebar */ +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h new file mode 100644 index 000000000000..38a3fee1443b --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/click_detector_def.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +/* This configuration file is included only once from click_detector module + * and holds information about click detector configuration. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} click_detector_def_include_once; + +static const struct click_detector_config click_detector_config[] = { + { + .key_id = CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON, + .consume_button_event = false, + }, +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h new file mode 100644 index 000000000000..445b2f14943e --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "hid_keyboard_leds.h" + +/* This configuration file is included only once from hid_state module and holds + * information about LEDs associated with HID keyboard LEDs report. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} hid_keyboard_leds_def_include_once; + +static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)); +static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF(); + +/* Map HID keyboard LEDs to application LED IDs. */ +static const uint8_t keyboard_led_map[] = { +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h new file mode 100644 index 000000000000..3292b1cb6197 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keyboard_leds_def_keyboard.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "hid_keyboard_leds.h" + +/* This configuration file is included only once from hid_state module and holds + * information about LEDs associated with HID keyboard LEDs report. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} hid_keyboard_leds_def_include_once; + +static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)); +static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF(); + +/* Map HID keyboard LEDs to application LED IDs. */ +static const uint8_t keyboard_led_map[] = { + [HID_KEYBOARD_LEDS_NUM_LOCK] = 2, + [HID_KEYBOARD_LEDS_CAPS_LOCK] = 3, + [HID_KEYBOARD_LEDS_SCROLL_LOCK] = LED_UNAVAILABLE, + [HID_KEYBOARD_LEDS_COMPOSE] = LED_UNAVAILABLE, + [HID_KEYBOARD_LEDS_KANA] = LED_UNAVAILABLE, +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h new file mode 100644 index 000000000000..08cd2cfdae9e --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "hid_keymap.h" +#include + +/* This configuration file is included only once from hid_state module and holds + * information about mapping between buttons and generated reports. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} hid_keymap_def_include_once; + +/* + * HID keymap. The Consumer Control keys are defined in section 15 of + * the HID Usage Tables document under the following URL: + * https://www.usb.org/sites/default/files/hut1_12.pdf + */ +static const struct hid_keymap hid_keymap[] = { + /* Intentionally left empty. nRF54L PDK by default uses all buttons only to control + * generating motion. + */ +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h new file mode 100644 index 000000000000..7720cc8331bc --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/hid_keymap_def_keyboard.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "hid_keymap.h" +#include + +/* This configuration file is included only once from hid_state module and holds + * information about mapping between buttons and generated reports. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} hid_keymap_def_include_once; + +/* + * HID keymap. The Consumer Control keys are defined in section 15 of + * the HID Usage Tables document under the following URL: + * https://www.usb.org/sites/default/files/hut1_12.pdf + */ +static const struct hid_keymap hid_keymap[] = { + { KEY_ID(0x00, 0x00), 0x0004, REPORT_ID_KEYBOARD_KEYS }, /* A */ + + { KEY_ID(0x00, 0x04), 0x0004, REPORT_ID_KEYBOARD_KEYS }, /* A */ + { KEY_ID(0x00, 0x05), 0x0005, REPORT_ID_KEYBOARD_KEYS }, /* B */ + { KEY_ID(0x00, 0x06), 0x0006, REPORT_ID_KEYBOARD_KEYS }, /* C */ + { KEY_ID(0x00, 0x07), 0x0007, REPORT_ID_KEYBOARD_KEYS }, /* D */ + { KEY_ID(0x00, 0x08), 0x0008, REPORT_ID_KEYBOARD_KEYS }, /* E */ + { KEY_ID(0x00, 0x09), 0x0009, REPORT_ID_KEYBOARD_KEYS }, /* F */ + { KEY_ID(0x00, 0x0A), 0x000A, REPORT_ID_KEYBOARD_KEYS }, /* G */ + { KEY_ID(0x00, 0x0B), 0x000B, REPORT_ID_KEYBOARD_KEYS }, /* H */ + { KEY_ID(0x00, 0x0C), 0x000C, REPORT_ID_KEYBOARD_KEYS }, /* I */ + { KEY_ID(0x00, 0x0D), 0x000D, REPORT_ID_KEYBOARD_KEYS }, /* J */ + { KEY_ID(0x00, 0x0E), 0x000E, REPORT_ID_KEYBOARD_KEYS }, /* K */ + { KEY_ID(0x00, 0x0F), 0x000F, REPORT_ID_KEYBOARD_KEYS }, /* L */ + { KEY_ID(0x00, 0x10), 0x0010, REPORT_ID_KEYBOARD_KEYS }, /* M */ + { KEY_ID(0x00, 0x11), 0x0011, REPORT_ID_KEYBOARD_KEYS }, /* N */ + { KEY_ID(0x00, 0x12), 0x0012, REPORT_ID_KEYBOARD_KEYS }, /* O */ + { KEY_ID(0x00, 0x13), 0x0013, REPORT_ID_KEYBOARD_KEYS }, /* P */ + { KEY_ID(0x00, 0x14), 0x0014, REPORT_ID_KEYBOARD_KEYS }, /* Q */ + { KEY_ID(0x00, 0x15), 0x0015, REPORT_ID_KEYBOARD_KEYS }, /* R */ + { KEY_ID(0x00, 0x16), 0x0016, REPORT_ID_KEYBOARD_KEYS }, /* S */ + { KEY_ID(0x00, 0x17), 0x0017, REPORT_ID_KEYBOARD_KEYS }, /* T */ + { KEY_ID(0x00, 0x18), 0x0018, REPORT_ID_KEYBOARD_KEYS }, /* U */ + { KEY_ID(0x00, 0x19), 0x0019, REPORT_ID_KEYBOARD_KEYS }, /* V */ + { KEY_ID(0x00, 0x1A), 0x001A, REPORT_ID_KEYBOARD_KEYS }, /* W */ + { KEY_ID(0x00, 0x1B), 0x001B, REPORT_ID_KEYBOARD_KEYS }, /* X */ + { KEY_ID(0x00, 0x1C), 0x001C, REPORT_ID_KEYBOARD_KEYS }, /* Y */ + { KEY_ID(0x00, 0x1D), 0x001D, REPORT_ID_KEYBOARD_KEYS }, /* Z */ + + { KEY_ID(0x00, 0x2C), 0x002C, REPORT_ID_KEYBOARD_KEYS }, /* spacebar */ +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h new file mode 100644 index 000000000000..7fdac8b5b42f --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/led_state_def.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include "led_state.h" +#include + +/* This configuration file is included only once from led_state module and holds + * information about LED effect associated with each state. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} led_state_def_include_once; + + +/* Map function to LED ID */ +static const uint8_t led_map[LED_ID_COUNT] = { + [LED_ID_SYSTEM_STATE] = 0, + [LED_ID_PEER_STATE] = 1 +}; + +static const struct led_effect led_system_state_effect[LED_SYSTEM_STATE_COUNT] = { + [LED_SYSTEM_STATE_IDLE] = LED_EFFECT_LED_ON(LED_COLOR(200, 200, 200)), + [LED_SYSTEM_STATE_CHARGING] = LED_EFFECT_LED_ON(LED_COLOR(200, 200, 200)), + [LED_SYSTEM_STATE_ERROR] = LED_EFFECT_LED_BLINK(200, LED_COLOR(200, 200, 200)), +}; + +static const struct led_effect led_peer_state_effect[LED_PEER_COUNT][LED_PEER_STATE_COUNT] = { + {[LED_PEER_STATE_DISCONNECTED] = LED_EFFECT_LED_OFF(), + [LED_PEER_STATE_CONNECTED] = LED_EFFECT_LED_ON(LED_COLOR(100, 100, 100)), + [LED_PEER_STATE_PEER_SEARCH] = LED_EFFECT_LED_BREATH(1000, LED_COLOR(100, 100, 100)), + [LED_PEER_STATE_CONFIRM_SELECT] = LED_EFFECT_LED_BLINK(50, LED_COLOR(100, 100, 100)), + [LED_PEER_STATE_CONFIRM_ERASE] = LED_EFFECT_LED_BLINK(25, LED_COLOR(100, 100, 100)), + [LED_PEER_STATE_ERASE_ADV] = LED_EFFECT_LED_BREATH(100, LED_COLOR(100, 100, 100)), + }, +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h new file mode 100644 index 000000000000..30d47da14299 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/port_state_def.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include + +#include "port_state.h" + +/* This configuration file is included only once from board module and holds + * information about default pin states set while board is on and off. + */ + +/* This structure enforces the header file is included only once in the build. + * Violating this requirement triggers a multiple definition error at link time. + */ +const struct {} port_state_def_include_once; + + +static const struct port_state port_state_on[] = { +}; + +static const struct port_state port_state_off[] = { +}; diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf new file mode 100644 index 000000000000..8ae5717df59c --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj.conf @@ -0,0 +1,108 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application Configuration + +CONFIG_DESKTOP_INIT_LOG_MOTION_EVENT=n +CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n +CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n +CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n + +CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y +CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE=y +CONFIG_DESKTOP_DEVICE_PID=0x52DE +CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y + +CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y +CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=0 +CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 +# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.x do not support interrupts. +# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to +# generate motion. +CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=2 +CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 + +CONFIG_CAF_BUTTONS=y +CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y +CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n + +CONFIG_CAF_CLICK_DETECTOR=y + +CONFIG_CAF_LEDS=y + +CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y + +CONFIG_DESKTOP_BLE_PEER_CONTROL=y +CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 +CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y + +CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 +CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y + +CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y +# The nRF54L target does not support DFU yet. +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n + +################################################################################ +# Zephyr Configuration + +# Use code partition defined in the DTS. +CONFIG_USE_DT_CODE_PARTITION=y + +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_ISR_STACK_SIZE=1536 +CONFIG_MAIN_STACK_SIZE=840 +CONFIG_BT_RX_STACK_SIZE=2048 +CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y +CONFIG_BT_HCI_TX_STACK_SIZE=1536 + +CONFIG_BOOT_BANNER=n + +CONFIG_NUM_COOP_PRIORITIES=10 +CONFIG_NUM_PREEMPT_PRIORITIES=11 + +CONFIG_HEAP_MEM_POOL_SIZE=512 + +CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYSTEM_CLOCK_NO_WAIT=y + +CONFIG_HW_STACK_PROTECTION=y +CONFIG_RESET_ON_FATAL_ERROR=n + +CONFIG_GPIO=y + +CONFIG_REBOOT=y + +CONFIG_SPEED_OPTIMIZATIONS=y + +CONFIG_LED=y +CONFIG_LED_GPIO=y + +CONFIG_BT_MAX_PAIRED=2 +CONFIG_BT_ID_MAX=3 + +CONFIG_BT_CTLR_SDC_LLPM=y +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y +CONFIG_BT_CONN_TX_MAX=4 + +################################################################################ + +CONFIG_ASSERT=y +CONFIG_ASSERT_LEVEL=2 + +# nRF54L PDK uses UART for logs. +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_BACKEND_SHOW_COLOR=n +CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BUFFER_SIZE=4096 +CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf new file mode 100644 index 000000000000..c973afaee511 --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_keyboard.conf @@ -0,0 +1,110 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# ZDebug: Keyboard version +# +# This ZDebug build type configuration acts as a keyboard. +# +# Application Configuration + +CONFIG_DESKTOP_INIT_LOG_HID_REPORT_EVENT=n +CONFIG_DESKTOP_INIT_LOG_HID_REPORT_SENT_EVENT=n +CONFIG_CAF_INIT_LOG_KEEP_ALIVE_EVENTS=n + +CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y +CONFIG_DESKTOP_PERIPHERAL_TYPE_KEYBOARD=y +CONFIG_DESKTOP_DEVICE_PID=0x52DD +CONFIG_DESKTOP_HID_BOOT_INTERFACE_KEYBOARD=y +CONFIG_DESKTOP_HID_STATE_HID_KEYMAP_DEF_PATH="hid_keymap_def_keyboard.h" +CONFIG_DESKTOP_HID_STATE_HID_KEYBOARD_LEDS_DEF_PATH="hid_keyboard_leds_def_keyboard.h" +CONFIG_DESKTOP_HID_REPORT_EXPIRATION=10000 +CONFIG_DESKTOP_HID_EVENT_QUEUE_SIZE=60 + +CONFIG_CAF_BUTTONS=y +CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y +CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n + +CONFIG_CAF_CLICK_DETECTOR=y + +CONFIG_CAF_LEDS=y + +CONFIG_DESKTOP_BUTTONS_SIM_ENABLE=y +CONFIG_DESKTOP_BUTTONS_SIM_INTERVAL=100 +CONFIG_DESKTOP_BUTTONS_SIM_LOOP_FOREVER=y +CONFIG_DESKTOP_BUTTONS_SIM_TRIGGER_KEY_ID=0x01 + +CONFIG_DESKTOP_BLE_PEER_CONTROL=y +CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 +CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y + +CONFIG_DESKTOP_BLE_USE_DEFAULT_ID=y + +CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 +CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y + +CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y +# The nRF54L target does not support DFU yet. +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n + +################################################################################ +# Zephyr Configuration + +# Use code partition defined in the DTS. +CONFIG_USE_DT_CODE_PARTITION=y + +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_ISR_STACK_SIZE=1536 +CONFIG_MAIN_STACK_SIZE=840 +CONFIG_BT_RX_STACK_SIZE=2048 +CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y +CONFIG_BT_HCI_TX_STACK_SIZE=1536 + +CONFIG_BOOT_BANNER=n + +CONFIG_NUM_COOP_PRIORITIES=10 +CONFIG_NUM_PREEMPT_PRIORITIES=11 + +CONFIG_HEAP_MEM_POOL_SIZE=4096 + +CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYSTEM_CLOCK_NO_WAIT=y + +CONFIG_HW_STACK_PROTECTION=y +CONFIG_RESET_ON_FATAL_ERROR=n + +CONFIG_GPIO=y +CONFIG_REBOOT=y + +CONFIG_SPEED_OPTIMIZATIONS=y + +CONFIG_LED=y +CONFIG_LED_GPIO=y + +CONFIG_BT_MAX_PAIRED=2 +CONFIG_BT_ID_MAX=3 + +CONFIG_BT_CTLR_SDC_LLPM=y +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y +CONFIG_BT_CONN_TX_MAX=6 + +################################################################################ + +CONFIG_ASSERT=y +CONFIG_ASSERT_LEVEL=2 + +# nRF54L PDK uses UART for logs. +CONFIG_SERIAL=y +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y + +CONFIG_LOG=y +CONFIG_LOG_BACKEND_UART=y +CONFIG_LOG_BACKEND_SHOW_COLOR=n +CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP=n +CONFIG_LOG_MODE_DEFERRED=y +CONFIG_LOG_PRINTK=y +CONFIG_LOG_BUFFER_SIZE=4096 +CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=1024 diff --git a/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf new file mode 100644 index 000000000000..ab877607be9c --- /dev/null +++ b/applications/nrf_desktop/configuration/nrf54l15pdk_nrf54l15_cpuapp/prj_release.conf @@ -0,0 +1,90 @@ +# +# Copyright (c) 2024 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# +################################################################################ +# Application Configuration + +CONFIG_DESKTOP_ROLE_HID_PERIPHERAL=y +CONFIG_DESKTOP_PERIPHERAL_TYPE_MOUSE=y +CONFIG_DESKTOP_DEVICE_PID=0x52DE +CONFIG_DESKTOP_HID_BOOT_INTERFACE_MOUSE=y + +CONFIG_DESKTOP_MOTION_BUTTONS_ENABLE=y +CONFIG_DESKTOP_MOTION_BUTTONS_LEFT_KEY_ID=0 +CONFIG_DESKTOP_MOTION_BUTTONS_RIGHT_KEY_ID=1 +# GPIOs assigned to Button 3 and Button 4 on the PDK v0.2.x do not support interrupts. +# Because of this, the GPIOs are not supported by the CAF buttons module and cannot be used to +# generate motion. +CONFIG_DESKTOP_MOTION_BUTTONS_UP_KEY_ID=2 +CONFIG_DESKTOP_MOTION_BUTTONS_DOWN_KEY_ID=3 + +CONFIG_CAF_BUTTONS=y +CONFIG_CAF_BUTTONS_POLARITY_INVERSED=y +CONFIG_CAF_BUTTONS_PM_KEEP_ALIVE=n + +CONFIG_CAF_CLICK_DETECTOR=y + +CONFIG_CAF_LEDS=y + +CONFIG_DESKTOP_BLE_PEER_CONTROL=y +CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON=0x0000 +CONFIG_DESKTOP_BLE_PEER_ERASE_ON_START=y + +CONFIG_DESKTOP_BLE_SECURITY_FAIL_TIMEOUT_S=10 +CONFIG_DESKTOP_BLE_LOW_LATENCY_LOCK=y + +CONFIG_DESKTOP_WATCHDOG_ENABLE=y +CONFIG_DESKTOP_FAILSAFE_ENABLE=y + +CONFIG_DESKTOP_CONFIG_CHANNEL_ENABLE=y +# The nRF54L target does not support DFU yet. +CONFIG_DESKTOP_CONFIG_CHANNEL_DFU_ENABLE=n + +################################################################################ +# Zephyr Configuration + +# Use code partition defined in the DTS. +CONFIG_USE_DT_CODE_PARTITION=y + +CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=1536 +CONFIG_ISR_STACK_SIZE=1536 +CONFIG_MAIN_STACK_SIZE=840 +CONFIG_BT_RX_STACK_SIZE=2048 +CONFIG_BT_HCI_TX_STACK_SIZE_WITH_PROMPT=y +CONFIG_BT_HCI_TX_STACK_SIZE=1536 + +CONFIG_BOOT_BANNER=n + +CONFIG_NUM_COOP_PRIORITIES=10 +CONFIG_NUM_PREEMPT_PRIORITIES=11 + +CONFIG_HEAP_MEM_POOL_SIZE=512 + +CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 +CONFIG_SYSTEM_CLOCK_NO_WAIT=y + +CONFIG_HW_STACK_PROTECTION=n +CONFIG_RESET_ON_FATAL_ERROR=n + +CONFIG_GPIO=y + +CONFIG_SERIAL=n +CONFIG_CONSOLE=n +CONFIG_UART_CONSOLE=n +CONFIG_USE_SEGGER_RTT=n + +CONFIG_REBOOT=y + +CONFIG_SPEED_OPTIMIZATIONS=y + +CONFIG_LED=y +CONFIG_LED_GPIO=y + +CONFIG_BT_MAX_PAIRED=2 +CONFIG_BT_ID_MAX=3 + +CONFIG_BT_CTLR_SDC_LLPM=y +CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y +CONFIG_BT_CONN_TX_MAX=4 diff --git a/applications/nrf_desktop/sample.yaml b/applications/nrf_desktop/sample.yaml index 8e95a7c782cf..494cb07a572c 100644 --- a/applications/nrf_desktop/sample.yaml +++ b/applications/nrf_desktop/sample.yaml @@ -8,6 +8,7 @@ tests: nrf52dmouse_nrf52832 nrf52kbd_nrf52832 nrf52810dmouse_nrf52810 nrf52820dongle_nrf52820 nrf52833dk_nrf52820 nrf52833dk_nrf52833 nrf52833dongle_nrf52833 nrf52840dk_nrf52840 nrf52840dongle_nrf52840 nrf52840gmouse_nrf52840 nrf5340dk_nrf5340_cpuapp + nrf54l15pdk_nrf54l15_cpuapp integration_platforms: - nrf52dmouse_nrf52832 - nrf52kbd_nrf52832 @@ -20,6 +21,7 @@ tests: - nrf52840dongle_nrf52840 - nrf52840gmouse_nrf52840 - nrf5340dk_nrf5340_cpuapp + - nrf54l15pdk_nrf54l15_cpuapp tags: bluetooth ci_build applications.nrf_desktop.zdebug_wwcb: build_only: true @@ -91,9 +93,10 @@ tests: extra_args: CONF_FILE=prj_dongle.conf applications.nrf_desktop.zdebug_keyboard: build_only: true - platform_allow: nrf52840dk_nrf52840 + platform_allow: nrf52840dk_nrf52840 nrf54l15pdk_nrf54l15_cpuapp integration_platforms: - nrf52840dk_nrf52840 + - nrf54l15pdk_nrf54l15_cpuapp tags: bluetooth ci_build extra_args: CONF_FILE=prj_keyboard.conf applications.nrf_desktop.zdebug_nrf21540ek: @@ -121,6 +124,7 @@ tests: nrf52dmouse_nrf52832 nrf52kbd_nrf52832 nrf52810dmouse_nrf52810 nrf52820dongle_nrf52820 nrf52833dk_nrf52820 nrf52833dk_nrf52833 nrf52833dongle_nrf52833 nrf52840dk_nrf52840 nrf52840dongle_nrf52840 nrf52840gmouse_nrf52840 nrf5340dk_nrf5340_cpuapp + nrf54l15pdk_nrf54l15_cpuapp integration_platforms: - nrf52dmouse_nrf52832 - nrf52kbd_nrf52832 @@ -133,6 +137,7 @@ tests: - nrf52840dongle_nrf52840 - nrf52840gmouse_nrf52840 - nrf5340dk_nrf5340_cpuapp + - nrf54l15pdk_nrf54l15_cpuapp tags: bluetooth ci_build extra_args: CONF_FILE=prj_release.conf applications.nrf_desktop.zrelease_fast_pair.keyboard: