Skip to content

Commit 59dbbb3

Browse files
duynguyenxacarlescufi
authored andcommitted
drivers: pwm: Initial support for PWM driver on RA8
Add PWM driver code support for RA8. This support is using GPT HW Signed-off-by: Duy Phuong Hoang. Nguyen <[email protected]>
1 parent 6f95a50 commit 59dbbb3

File tree

13 files changed

+861
-0
lines changed

13 files changed

+861
-0
lines changed

boards/renesas/ek_ra8m1/doc/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ The below features are currently supported on Zephyr OS for EK-RA8M1 board:
106106
+-----------+------------+----------------------+
107107
| FLASH | on-chip | flash |
108108
+-----------+------------+----------------------+
109+
| PWM | on-chip | pwm |
110+
+-----------+------------+----------------------+
109111

110112
Other hardware features are currently not supported by the port.
111113

boards/renesas/ek_ra8m1/ek_ra8m1-pinctrl.dtsi

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,15 @@
5353
<RA_PSEL(RA_PSEL_SPI, 4, 13)>;
5454
};
5555
};
56+
57+
pwm7_default: pwm7_default {
58+
group1 {
59+
/* GTIOC7A */
60+
psels = <RA_PSEL(RA_PSEL_GPT1, 6, 3)>;
61+
};
62+
group2 {
63+
/* GTIOC7B */
64+
psels = <RA_PSEL(RA_PSEL_GPT1, 6, 2)>;
65+
};
66+
};
5667
};

boards/renesas/ek_ra8m1/ek_ra8m1.dts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,12 @@ mikrobus_serial: &uart3 {};
167167

168168
&spi1 {
169169
pinctrl-0 = <&spi1_default>;
170+
};
171+
172+
&pwm7 {
173+
pinctrl-0 = <&pwm7_default>;
174+
interrupts = <40 1>, <41 1>;
175+
interrupt-names = "gtioca", "overflow";
170176
pinctrl-names = "default";
171177
status = "okay";
172178
};

drivers/pwm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ zephyr_library_sources_ifdef(CONFIG_PWM_NUMAKER pwm_numaker.c)
4444
zephyr_library_sources_ifdef(CONFIG_PWM_NXP_FLEXIO pwm_nxp_flexio.c)
4545
zephyr_library_sources_ifdef(CONFIG_PWM_NXP_S32_EMIOS pwm_nxp_s32_emios.c)
4646
zephyr_library_sources_ifdef(CONFIG_PWM_ENE_KB1200 pwm_ene_kb1200.c)
47+
zephyr_library_sources_ifdef(CONFIG_PWM_RENESAS_RA8 pwm_renesas_ra8.c)
4748

4849
zephyr_library_sources_ifdef(CONFIG_USERSPACE pwm_handlers.c)
4950
zephyr_library_sources_ifdef(CONFIG_PWM_CAPTURE pwm_capture.c)

drivers/pwm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,6 @@ source "drivers/pwm/Kconfig.nxp_flexio"
108108

109109
source "drivers/pwm/Kconfig.ene"
110110

111+
source "drivers/pwm/Kconfig.renesas_ra8"
112+
111113
endif # PWM

drivers/pwm/Kconfig.renesas_ra8

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024 Renesas Electronics Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config PWM_RENESAS_RA8
5+
bool "Renesas RA8 PWM driver"
6+
default y
7+
depends on DT_HAS_RENESAS_RA8_PWM_ENABLED
8+
select USE_RA_FSP_GPT
9+
help
10+
Enable Renesas RA8 PWM Driver.

0 commit comments

Comments
 (0)