Skip to content

drivers: pwm: extend API to support interrupts #93275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

javlands
Copy link
Contributor

@javlands javlands commented Jul 17, 2025

  • Extend the pwm API to also support pwm interrupts.
  • Implement pwm interrupts for the SAM controllers

@zephyrbot zephyrbot added platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM) area: PWM Pulse Width Modulation labels Jul 17, 2025
@pdgendt pdgendt assigned henrikbrixandersen and anangl and unassigned nandojve Jul 17, 2025
Extend the PWM API to support interrupts, as some
controllers allow interrupts if e.g., a pwm period
has ended or a fault occured.

Signed-off-by: Jaro Van Landschoot <[email protected]>
@javlands javlands force-pushed the pwm-interrupts branch 2 times, most recently from aa08572 to 49349f4 Compare July 17, 2025 14:46
Copy link
Contributor

@pdgendt pdgendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update tests/drivers/build_all/pwm/testcase.yaml with:

diff --git a/tests/drivers/build_all/pwm/testcase.yaml b/tests/drivers/build_all/pwm/testcase.yaml
index 34156300b5d..270637d4625 100644
--- a/tests/drivers/build_all/pwm/testcase.yaml
+++ b/tests/drivers/build_all/pwm/testcase.yaml
@@ -43,6 +43,8 @@ tests:
     platform_allow:
       - sam_e70_xplained/same70q21
       - sam_v71_xult/samv71q21b
+    extra_configs:
+      - CONFIG_PWM_INTERRUPT=y
   drivers.pwm.stm32.build:
     platform_allow: disco_l475_iot1
   drivers.pwm.xec.build:

javlands added 2 commits July 18, 2025 16:47
The SAM4S pwm supports several interrupts. This commit
implements the interrupts when a channel period has ended
or a fault event has occured.

Signed-off-by: Jaro Van Landschoot <[email protected]>
Add the pwm interrupt functions of the sam pwm driver to the
build all test.

Signed-off-by: Jaro Van Landschoot <[email protected]>
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: PWM Pulse Width Modulation platform: Microchip SAM Microchip SAM Platform (formerly Atmel SAM)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants