Skip to content

Commit fe247a9

Browse files
FelixWang47831jhedberg
authored andcommitted
tests: drivers: pwm: pwm_loopback: Enable QTMR test.
Provide kconfig conf file to set timing parameters. Provide overlay file for QTMR channel and pin configuration. Signed-off-by: Felix Wang <[email protected]>
1 parent 8ebc2f4 commit fe247a9

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CONFIG_TEST_PWM_PERIOD_NSEC=10000000
2+
CONFIG_TEST_PWM_PULSE_NSEC=1500000
3+
4+
CONFIG_TEST_PWM_PERIOD_USEC=10000
5+
CONFIG_TEST_PWM_PULSE_USEC=7500
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pinctrl {
8+
qtmr4_timer0_default: qtmr4_timer0_default {
9+
group0 {
10+
pinmux = <&iomuxc_gpio_ad_00_qtimer4_timer0>;
11+
drive-strength = "normal";
12+
slew-rate = "fast";
13+
};
14+
};
15+
16+
qtmr5_timer0_default: qtmr5_timer0_default {
17+
group0 {
18+
pinmux = <&iomuxc_gpio_ad_04_qtimer5_timer0>;
19+
drive-strength = "normal";
20+
slew-rate = "fast";
21+
};
22+
};
23+
};
24+
25+
/* To test this sample, connect
26+
* GPIO_AD_00(J45-15) ---> GPIO_AD_04(J45-5)
27+
*/
28+
29+
/ {
30+
pwm_loopback_0 {
31+
compatible = "test-pwm-loopback";
32+
pwms = <&qtmr4 0 0 PWM_POLARITY_NORMAL>, /* GPIO_AD_00, J45 pin 15, out */
33+
<&qtmr5 0 0 PWM_POLARITY_NORMAL>; /* GPIO_AD_04, J45 pin 5, in */
34+
};
35+
};
36+
37+
&qtmr4 {
38+
compatible = "nxp,qtmr-pwm";
39+
pinctrl-0 = <&qtmr4_timer0_default>;
40+
pinctrl-names = "default";
41+
#pwm-cells = <3>;
42+
prescaler = <128>;
43+
status = "okay";
44+
};
45+
46+
&qtmr5 {
47+
compatible = "nxp,qtmr-pwm";
48+
pinctrl-0 = <&qtmr5_timer0_default>;
49+
pinctrl-names = "default";
50+
#pwm-cells = <3>;
51+
prescaler = <128>;
52+
status = "okay";
53+
};

0 commit comments

Comments
 (0)