Skip to content

pwm: Update PWM API for dynamic prescaler computation #6958

@erwango

Description

@erwango

As discussed in #5469, current PWM API prevents dynamic prescaler computation.

Indeed, using get_cycles_per_sec in pin_set prevents to adjust PWM prescaler to the requested cycle duration and hence imposes to set it before compilation. Hence PWM application is limited to work in the duration range matching harcoded prescaler value.

I propose to remove function get_cycles_per_sec from API and let driver compute it internally inside pin_set. It seems this function is not used today (not in PWM tests/samples at least).

Drivers should be able to handle directly pwm_pin_set_usec.

Metadata

Metadata

Assignees

Labels

EnhancementChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsarea: PWMPulse Width Modulation

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions