Skip to content

Commit 6aa8df3

Browse files
MarekPietanordicjm
authored andcommitted
applications: nrf_desktop: Add nRF54L10 support
nRF54L10 is emulated on nRF54L15 DK. Jira: NCSDK-30311 Signed-off-by: Marek Pieta <[email protected]>
1 parent b6e825b commit 6aa8df3

32 files changed

+1371
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "app_common.dtsi"
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */
8+
&cpuapp_rram {
9+
reg = < 0x0 DT_SIZE_K(1022) >;
10+
};
11+
12+
/ {
13+
/* Disable pwmleds and redefine them to align configuration with CAF LEDs requirements.
14+
* The configuration needs to match the used board revision.
15+
*/
16+
/delete-node/ pwmleds;
17+
18+
pwmleds0 {
19+
compatible = "pwm-leds";
20+
status = "okay";
21+
22+
pwm_led0: led_pwm_0 {
23+
status = "okay";
24+
pwms = <&pwm20 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
25+
label = "LED System State";
26+
};
27+
};
28+
29+
pwmleds1 {
30+
compatible = "pwm-leds";
31+
status = "okay";
32+
33+
pwm_led1: led_pwm_1 {
34+
status = "okay";
35+
pwms = <&pwm21 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
36+
label = "LED Conn State";
37+
};
38+
};
39+
40+
pwmleds2 {
41+
compatible = "pwm-leds";
42+
status = "okay";
43+
44+
pwm_led2: led_pwm_2 {
45+
status = "okay";
46+
pwms = <&pwm22 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
47+
label = "LED Num Lock";
48+
};
49+
};
50+
};
51+
52+
&pwm20 {
53+
status = "okay";
54+
pinctrl-0 = <&pwm20_default_alt>;
55+
pinctrl-1 = <&pwm20_sleep_alt>;
56+
pinctrl-names = "default", "sleep";
57+
};
58+
59+
&pwm21 {
60+
status = "okay";
61+
pinctrl-0 = <&pwm21_default_alt>;
62+
pinctrl-1 = <&pwm21_sleep_alt>;
63+
pinctrl-names = "default", "sleep";
64+
};
65+
66+
&pwm22 {
67+
status = "okay";
68+
pinctrl-0 = <&pwm22_default_alt>;
69+
pinctrl-1 = <&pwm22_sleep_alt>;
70+
pinctrl-names = "default", "sleep";
71+
};
72+
73+
&pinctrl {
74+
pwm20_default_alt: pwm20_default_alt {
75+
group1 {
76+
psels = <NRF_PSEL(PWM_OUT0, 2, 9)>;
77+
};
78+
};
79+
80+
pwm20_sleep_alt: pwm20_sleep_alt {
81+
group1 {
82+
psels = <NRF_PSEL(PWM_OUT0, 2, 9)>;
83+
low-power-enable;
84+
};
85+
};
86+
87+
pwm21_default_alt: pwm21_default_alt {
88+
group1 {
89+
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
90+
};
91+
};
92+
93+
pwm21_sleep_alt: pwm21_sleep_alt {
94+
group1 {
95+
psels = <NRF_PSEL(PWM_OUT0, 1, 10)>;
96+
low-power-enable;
97+
};
98+
};
99+
100+
pwm22_default_alt: pwm22_default_alt {
101+
group1 {
102+
psels = <NRF_PSEL(PWM_OUT0, 2, 7)>;
103+
};
104+
};
105+
106+
pwm22_sleep_alt: pwm22_sleep_alt {
107+
group1 {
108+
psels = <NRF_PSEL(PWM_OUT0, 2, 7)>;
109+
low-power-enable;
110+
};
111+
};
112+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "app_common.dtsi"
8+
9+
/* For nRF54L, watchdog status is disabled by default. Needs to be enabled in DTS overlay. */
10+
&wdt31 {
11+
status = "okay";
12+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include <caf/gpio_pins.h>
8+
9+
/* This configuration file is included only once from button module and holds
10+
* information about pins forming keyboard matrix.
11+
*/
12+
13+
/* This structure enforces the header file is included only once in the build.
14+
* Violating this requirement triggers a multiple definition error at link time.
15+
*/
16+
const struct {} buttons_def_include_once;
17+
18+
static const struct gpio_pin col[] = {};
19+
20+
static const struct gpio_pin row[] = {
21+
{ .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button0), gpios) },
22+
{ .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button1), gpios) },
23+
{ .port = 1, .pin = DT_GPIO_PIN(DT_NODELABEL(button2), gpios) },
24+
{ .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button3), gpios) },
25+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include <caf/key_id.h>
8+
9+
/* This configuration file is included only once from buttons_sim module
10+
* and holds information about generated button presses sequence.
11+
*/
12+
13+
/* This structure enforces the header file is included only once in the build.
14+
* Violating this requirement triggers a multiple definition error at link time.
15+
*/
16+
const struct {} buttons_sim_def_include_once;
17+
18+
const static uint16_t simulated_key_sequence[] = {
19+
KEY_ID(0x00, 0x11), /* N */
20+
KEY_ID(0x00, 0x12), /* O */
21+
KEY_ID(0x00, 0x15), /* R */
22+
KEY_ID(0x00, 0x07), /* D */
23+
KEY_ID(0x00, 0x0C), /* I */
24+
KEY_ID(0x00, 0x06), /* C */
25+
KEY_ID(0x00, 0x2C), /* spacebar */
26+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include <caf/click_detector.h>
8+
9+
/* This configuration file is included only once from click_detector module
10+
* and holds information about click detector configuration.
11+
*/
12+
13+
/* This structure enforces the header file is included only once in the build.
14+
* Violating this requirement triggers a multiple definition error at link time.
15+
*/
16+
const struct {} click_detector_def_include_once;
17+
18+
static const struct click_detector_config click_detector_config[] = {
19+
#if CONFIG_DESKTOP_BLE_PEER_CONTROL
20+
{
21+
.key_id = CONFIG_DESKTOP_BLE_PEER_CONTROL_BUTTON,
22+
.consume_button_event = false,
23+
},
24+
#endif /* CONFIG_DESKTOP_BLE_PEER_CONTROL */
25+
};
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "hid_keyboard_leds.h"
8+
9+
/* This configuration file is included only once from hid_state module and holds
10+
* information about LEDs associated with HID keyboard LEDs report.
11+
*/
12+
13+
/* This structure enforces the header file is included only once in the build.
14+
* Violating this requirement triggers a multiple definition error at link time.
15+
*/
16+
const struct {} hid_keyboard_leds_def_include_once;
17+
18+
static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255));
19+
static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF();
20+
21+
/* Map HID keyboard LEDs to application LED IDs. */
22+
static const uint8_t keyboard_led_map[] = {
23+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "hid_keyboard_leds.h"
8+
9+
/* This configuration file is included only once from hid_state module and holds
10+
* information about LEDs associated with HID keyboard LEDs report.
11+
*/
12+
13+
/* This structure enforces the header file is included only once in the build.
14+
* Violating this requirement triggers a multiple definition error at link time.
15+
*/
16+
const struct {} hid_keyboard_leds_def_include_once;
17+
18+
/* On the nRF54L10 SoC, you can only use the **GPIO1** port for PWM hardware peripheral output.
19+
* Because of that, on the DK PCA10156 revision v0.8.1, **LED 0** and **LED 2** cannot be used for
20+
* PWM output.
21+
*
22+
* You can still use these LEDs with the PWM LED driver, but you must set the LED color to
23+
* ``LED_COLOR(255, 255, 255)`` or ``LED_COLOR(0, 0, 0)``. This ensures the PWM peripheral is not
24+
* used for the mentioned LEDs.
25+
*/
26+
static const struct led_effect keyboard_led_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255));
27+
static const struct led_effect keyboard_led_off = LED_EFFECT_LED_OFF();
28+
29+
/* Map HID keyboard LEDs to application LED IDs. */
30+
static const uint8_t keyboard_led_map[] = {
31+
[HID_KEYBOARD_LEDS_NUM_LOCK] = 2,
32+
[HID_KEYBOARD_LEDS_CAPS_LOCK] = LED_UNAVAILABLE,
33+
[HID_KEYBOARD_LEDS_SCROLL_LOCK] = LED_UNAVAILABLE,
34+
[HID_KEYBOARD_LEDS_COMPOSE] = LED_UNAVAILABLE,
35+
[HID_KEYBOARD_LEDS_KANA] = LED_UNAVAILABLE,
36+
};
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "hid_keymap.h"
8+
#include <caf/key_id.h>
9+
10+
/* This configuration file is included only once from hid_state module and holds
11+
* information about mapping between buttons and generated reports.
12+
*/
13+
14+
/* This structure enforces the header file is included only once in the build.
15+
* Violating this requirement triggers a multiple definition error at link time.
16+
*/
17+
const struct {} hid_keymap_def_include_once;
18+
19+
/*
20+
* HID keymap. The Consumer Control keys are defined in section 15 of
21+
* the HID Usage Tables document under the following URL:
22+
* https://www.usb.org/sites/default/files/hut1_12.pdf
23+
*/
24+
static const struct hid_keymap hid_keymap[] = {
25+
/* Intentionally left empty. nRF54L DK by default uses all buttons only to control
26+
* generating motion.
27+
*/
28+
};
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "hid_keymap.h"
8+
#include <caf/key_id.h>
9+
10+
/* This configuration file is included only once from hid_state module and holds
11+
* information about mapping between buttons and generated reports.
12+
*/
13+
14+
/* This structure enforces the header file is included only once in the build.
15+
* Violating this requirement triggers a multiple definition error at link time.
16+
*/
17+
const struct {} hid_keymap_def_include_once;
18+
19+
/*
20+
* HID keymap. The Consumer Control keys are defined in section 15 of
21+
* the HID Usage Tables document under the following URL:
22+
* https://www.usb.org/sites/default/files/hut1_12.pdf
23+
*/
24+
static const struct hid_keymap hid_keymap[] = {
25+
{ KEY_ID(0x00, 0x00), 0x0004, REPORT_ID_KEYBOARD_KEYS }, /* A */
26+
{ KEY_ID(0x00, 0x01), 0x0005, REPORT_ID_KEYBOARD_KEYS }, /* B */
27+
{ KEY_ID(0x00, 0x02), 0x00E1, REPORT_ID_KEYBOARD_KEYS }, /* left shift */
28+
29+
{ KEY_ID(0x00, 0x04), 0x0004, REPORT_ID_KEYBOARD_KEYS }, /* A */
30+
{ KEY_ID(0x00, 0x05), 0x0005, REPORT_ID_KEYBOARD_KEYS }, /* B */
31+
{ KEY_ID(0x00, 0x06), 0x0006, REPORT_ID_KEYBOARD_KEYS }, /* C */
32+
{ KEY_ID(0x00, 0x07), 0x0007, REPORT_ID_KEYBOARD_KEYS }, /* D */
33+
{ KEY_ID(0x00, 0x08), 0x0008, REPORT_ID_KEYBOARD_KEYS }, /* E */
34+
{ KEY_ID(0x00, 0x09), 0x0009, REPORT_ID_KEYBOARD_KEYS }, /* F */
35+
{ KEY_ID(0x00, 0x0A), 0x000A, REPORT_ID_KEYBOARD_KEYS }, /* G */
36+
{ KEY_ID(0x00, 0x0B), 0x000B, REPORT_ID_KEYBOARD_KEYS }, /* H */
37+
{ KEY_ID(0x00, 0x0C), 0x000C, REPORT_ID_KEYBOARD_KEYS }, /* I */
38+
{ KEY_ID(0x00, 0x0D), 0x000D, REPORT_ID_KEYBOARD_KEYS }, /* J */
39+
{ KEY_ID(0x00, 0x0E), 0x000E, REPORT_ID_KEYBOARD_KEYS }, /* K */
40+
{ KEY_ID(0x00, 0x0F), 0x000F, REPORT_ID_KEYBOARD_KEYS }, /* L */
41+
{ KEY_ID(0x00, 0x10), 0x0010, REPORT_ID_KEYBOARD_KEYS }, /* M */
42+
{ KEY_ID(0x00, 0x11), 0x0011, REPORT_ID_KEYBOARD_KEYS }, /* N */
43+
{ KEY_ID(0x00, 0x12), 0x0012, REPORT_ID_KEYBOARD_KEYS }, /* O */
44+
{ KEY_ID(0x00, 0x13), 0x0013, REPORT_ID_KEYBOARD_KEYS }, /* P */
45+
{ KEY_ID(0x00, 0x14), 0x0014, REPORT_ID_KEYBOARD_KEYS }, /* Q */
46+
{ KEY_ID(0x00, 0x15), 0x0015, REPORT_ID_KEYBOARD_KEYS }, /* R */
47+
{ KEY_ID(0x00, 0x16), 0x0016, REPORT_ID_KEYBOARD_KEYS }, /* S */
48+
{ KEY_ID(0x00, 0x17), 0x0017, REPORT_ID_KEYBOARD_KEYS }, /* T */
49+
{ KEY_ID(0x00, 0x18), 0x0018, REPORT_ID_KEYBOARD_KEYS }, /* U */
50+
{ KEY_ID(0x00, 0x19), 0x0019, REPORT_ID_KEYBOARD_KEYS }, /* V */
51+
{ KEY_ID(0x00, 0x1A), 0x001A, REPORT_ID_KEYBOARD_KEYS }, /* W */
52+
{ KEY_ID(0x00, 0x1B), 0x001B, REPORT_ID_KEYBOARD_KEYS }, /* X */
53+
{ KEY_ID(0x00, 0x1C), 0x001C, REPORT_ID_KEYBOARD_KEYS }, /* Y */
54+
{ KEY_ID(0x00, 0x1D), 0x001D, REPORT_ID_KEYBOARD_KEYS }, /* Z */
55+
56+
{ KEY_ID(0x00, 0x2C), 0x002C, REPORT_ID_KEYBOARD_KEYS }, /* spacebar */
57+
};

0 commit comments

Comments
 (0)