Skip to content

Commit 1391355

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

File tree

4 files changed

+58
-0
lines changed

4 files changed

+58
-0
lines changed

boards/renesas/mck_ra8t1/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ The below features are currently supported on Zephyr OS for MCB-RA8T1 board:
102102
+--------------+------------+----------------------+
103103
| FLASH | on-chip | flash |
104104
+--------------+------------+----------------------+
105+
| PWM | on-chip | pwm |
106+
+--------------+------------+----------------------+
105107

106108
Other hardware features are currently not supported by the port.
107109

boards/renesas/mck_ra8t1/mck_ra8t1-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, 2, 4)>;
2626
};
2727
};
28+
29+
pwm2_default: pwm2_default {
30+
group1 {
31+
/* GTIOC2A */
32+
psels = <RA_PSEL(RA_PSEL_GPT1, 1, 13)>;
33+
};
34+
group2 {
35+
/* GTIOC2B */
36+
psels = <RA_PSEL(RA_PSEL_GPT1, 1, 14)>;
37+
};
38+
};
2839
};

boards/renesas/mck_ra8t1/mck_ra8t1.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,11 @@
118118
};
119119
};
120120
};
121+
122+
&pwm2 {
123+
pinctrl-0 = <&pwm2_default>;
124+
interrupts = <40 1>, <41 1>;
125+
interrupt-names = "gtioca", "overflow";
126+
pinctrl-names = "default";
127+
status = "okay";
128+
};
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 = <&pwm2 0 0 PWM_POLARITY_NORMAL>,
14+
<&pwm5 0 0 PWM_POLARITY_NORMAL>;
15+
};
16+
};
17+
18+
&pinctrl {
19+
pwm5_default: pwm5_default {
20+
group1 {
21+
/* GTIOC5A */
22+
psels = <RA_PSEL(RA_PSEL_GPT1, 1, 15)>;
23+
};
24+
group2 {
25+
/* GTIOC5B */
26+
psels = <RA_PSEL(RA_PSEL_GPT1, 6, 9)>;
27+
};
28+
};
29+
};
30+
31+
&pwm5 {
32+
pinctrl-0 = <&pwm5_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)