-
Notifications
You must be signed in to change notification settings - Fork 7.6k
driver: pwm: create ambiq pwm driver #92214
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
base: main
Are you sure you want to change the base?
Conversation
cc16812
to
fb928ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for Ambiq PWM via both TIMER and CTIMER peripherals, including driver implementations, device tree bindings, and board/sample overlays.
- Introduce two new PWM drivers (
pwm_ambiq_timer
andpwm_ambiq_ctimer
) with full Zephyr driver API implementations - Add DTS binding schemas (
ambiq,timer-pwm.yaml
,ambiq,ctimer-pwm.yaml
) and include<zephyr/dt-bindings/pwm/pwm.h>
in Ambiq SoC DTS files - Update Kconfig, CMakeLists, and board/sample overlays to enable and test the new PWM controllers
Reviewed Changes
Copilot reviewed 51 out of 51 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
drivers/pwm/pwm_ambiq_timer.c | Implements TIMER-based PWM driver and init logic |
drivers/pwm/pwm_ambiq_ctimer.c | Implements CTIMER-based PWM driver and init logic |
dts/bindings/pwm/ambiq,timer-pwm.yaml | Defines binding schema for ambiq,timer-pwm |
dts/bindings/pwm/ambiq,ctimer-pwm.yaml | Defines binding schema for ambiq,ctimer-pwm |
drivers/pwm/Kconfig.ambiq_timer | Adds Kconfig entries for both Ambiq PWM drivers |
drivers/pwm/CMakeLists.txt | Registers new PWM drivers in build |
dts/arm/ambiq/ambiq_apollo510.dtsi | Includes PWM DTS entries under timer@… nodes |
fb928ca
to
923d9ac
Compare
923d9ac
to
0aa7d0e
Compare
0aa7d0e
to
181b0e2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEVICE_API
already provides const struct
181b0e2
to
be33d2a
Compare
c7d67cd
to
8db324d
Compare
@kartben please help to review this PR, thank you! |
It looks reasonable but would be good to have PWM people review as I know close to nothing about PWM :) |
@AlessandroLuo Also, it's highly unlikely this can make the cut for tomorrow's feature freeze given this will have been in review for less than two days by then. Release managers might allow exceptions though :) |
8a7a1fe
8a7a1fe
to
42bdc29
Compare
42bdc29
to
cf5eae2
Compare
Restructured counter and timer. CTimer/Timer is now parent to pwm and counter. Created PWM driver and tied to pwm and pwm-led Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
Move clk-source from pwm to timer change associated files to match Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
check for max number of children in timer. Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
changed variable names from timer to ctimer Signed-off-by: Hao Luo <hluo@ambiq.com>
This commit adds support for Apollo510 pwm driver Signed-off-by: Hao Luo <hluo@ambiq.com>
cf5eae2
to
cfaf1a2
Compare
|
This PR adds a new Ambiq PWM driver based on the on-chip timer/ctimer peripherals and integrates it into Zephyr’s build and DT infrastructure.