Skip to content

Commit

Permalink
boards: renesas: Add configurations to support pwm on EK-RA8D1
Browse files Browse the repository at this point in the history
Add support for PWM driver on EK-RA8D1

Signed-off-by: Quy Tran <[email protected]>
  • Loading branch information
quytranpzz authored and carlescufi committed Oct 11, 2024
1 parent 1391355 commit 4793e00
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boards/renesas/ek_ra8d1/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ The below features are currently supported on Zephyr OS for EK-RA8D1 board:
+--------------+------------+------------------+
| FLASH | on-chip | flash |
+--------------+------------+------------------+
| PWM | on-chip | pwm |
+--------------+------------+------------------+

Other hardware features are currently not supported by the port.

Expand Down
11 changes: 11 additions & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@
<RA_PSEL(RA_PSEL_SPI, 7, 3)>;
};
};

pwm7_default: pwm7_default {
group1 {
/* GTIOC7A */
psels = <RA_PSEL(RA_PSEL_GPT1, 10, 7)>;
};
group2 {
/* GTIOC7B */
psels = <RA_PSEL(RA_PSEL_GPT1, 10, 6)>;
};
};
};
8 changes: 8 additions & 0 deletions boards/renesas/ek_ra8d1/ek_ra8d1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,11 @@
};
};
};

&pwm7 {
pinctrl-0 = <&pwm7_default>;
interrupts = <40 1>, <41 1>;
interrupt-names = "gtioca", "overflow";
pinctrl-names = "default";
status = "okay";
};
37 changes: 37 additions & 0 deletions tests/drivers/pwm/pwm_loopback/boards/ek_ra8d1.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright (c) 2024 Renesas Electronics Corporation
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pwm/pwm.h>
#include <zephyr/dt-bindings/pwm/ra_pwm.h>

/ {
pwm_loopback_0 {
compatible = "test-pwm-loopback";
/* first index must be a 32-Bit timer */
pwms = <&pwm7 0 0 PWM_POLARITY_NORMAL>,
<&pwm9 0 0 PWM_POLARITY_NORMAL>;
};
};

&pinctrl {
pwm9_default: pwm9_default {
group1 {
/* GTIOC9A */
psels = <RA_PSEL(RA_PSEL_GPT1, 4, 11)>;
};
group2 {
/* GTIOC9B */
psels = <RA_PSEL(RA_PSEL_GPT1, 4, 10)>;
};
};
};

&pwm9 {
pinctrl-0 = <&pwm9_default>;
pinctrl-names = "default";
interrupts = <50 1>, <51 1>;
interrupt-names = "gtioca", "overflow";
status = "okay";
};

0 comments on commit 4793e00

Please sign in to comment.