Skip to content

Commit 4793e00

Browse files
quytranpzzcarlescufi
authored andcommitted
boards: renesas: Add configurations to support pwm on EK-RA8D1
Add support for PWM driver on EK-RA8D1 Signed-off-by: Quy Tran <[email protected]>
1 parent 1391355 commit 4793e00

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

boards/renesas/ek_ra8d1/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board:
104104
+--------------+------------+------------------+
105105
| FLASH | on-chip | flash |
106106
+--------------+------------+------------------+
107+
| PWM | on-chip | pwm |
108+
+--------------+------------+------------------+
107109

108110
Other hardware features are currently not supported by the port.
109111

boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,15 @@
2525
<RA_PSEL(RA_PSEL_SPI, 7, 3)>;
2626
};
2727
};
28+
29+
pwm7_default: pwm7_default {
30+
group1 {
31+
/* GTIOC7A */
32+
psels = <RA_PSEL(RA_PSEL_GPT1, 10, 7)>;
33+
};
34+
group2 {
35+
/* GTIOC7B */
36+
psels = <RA_PSEL(RA_PSEL_GPT1, 10, 6)>;
37+
};
38+
};
2839
};

boards/renesas/ek_ra8d1/ek_ra8d1.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,11 @@
124124
};
125125
};
126126
};
127+
128+
&pwm7 {
129+
pinctrl-0 = <&pwm7_default>;
130+
interrupts = <40 1>, <41 1>;
131+
interrupt-names = "gtioca", "overflow";
132+
pinctrl-names = "default";
133+
status = "okay";
134+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* Copyright (c) 2024 Renesas Electronics Corporation
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/pwm/pwm.h>
7+
#include <zephyr/dt-bindings/pwm/ra_pwm.h>
8+
9+
/ {
10+
pwm_loopback_0 {
11+
compatible = "test-pwm-loopback";
12+
/* first index must be a 32-Bit timer */
13+
pwms = <&pwm7 0 0 PWM_POLARITY_NORMAL>,
14+
<&pwm9 0 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&pinctrl {
19+
pwm9_default: pwm9_default {
20+
group1 {
21+
/* GTIOC9A */
22+
psels = <RA_PSEL(RA_PSEL_GPT1, 4, 11)>;
23+
};
24+
group2 {
25+
/* GTIOC9B */
26+
psels = <RA_PSEL(RA_PSEL_GPT1, 4, 10)>;
27+
};
28+
};
29+
};
30+
31+
&pwm9 {
32+
pinctrl-0 = <&pwm9_default>;
33+
pinctrl-names = "default";
34+
interrupts = <50 1>, <51 1>;
35+
interrupt-names = "gtioca", "overflow";
36+
status = "okay";
37+
};

0 commit comments

Comments
 (0)