Skip to content
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

Add function to enable multiple PWM slices at the same time #667

Conversation

jlpettersson
Copy link
Contributor

@jlpettersson jlpettersson commented Aug 8, 2023

This is needed to be able to have e.g. 3 PWM slices that are in phase, but may use different duty cycles.

Example usage: pwm_slices.enable_simultaneous(0b0000_0111);

Demo

Phases between slices before this fix, using

    pwm0.enable();
    pwm1.enable();

IMG-6377

Phases between slices after this fix, using

pwm_slices.enable_simultaneous(0b0000_0111);

IMG-6378

This is needed to be able to have e.g. 3 PWM slices that are in phase,
but may use different duty cycles.

Example usage: `pwm_slices.enable_simultaneous(0b0000_0111);`
@jlpettersson jlpettersson marked this pull request as ready for review August 8, 2023 16:24
rp2040-hal/src/pwm/mod.rs Outdated Show resolved Hide resolved
@jlpettersson
Copy link
Contributor Author

jlpettersson commented Aug 8, 2023

@jannic I made the mistake to use GitHub GUI to apply your suggestions. That did not end well. So I ended up with creating a new PR for this change, #668

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants