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

embassy_rp::pwm::PwmOutput<'d> not found in not found in embassy_rp::pwm #3642

Open
mwerezak opened this issue Dec 11, 2024 · 1 comment
Open

Comments

@mwerezak
Copy link

mwerezak commented Dec 11, 2024

The type is documented for 0.2.0, but isn't actually there.

@mwerezak mwerezak changed the title embassy_rp::pwm::PwmOutput<'d> not found in not found in embassy_rp::pwm embassy_rp::pwm::PwmOutput<'d> not found in not found in embassy_rp::pwm Dec 11, 2024
@vivi202
Copy link
Contributor

vivi202 commented Dec 24, 2024

Hi, you cannot create it because embassy_rp::pwm::PwmOutput<'d>::new() isn't public.
you can use it this way:

    let pwm_ab= Pwm::new_output_ab(p.PWM_SLICE3, p.PIN_6, p.PIN_7, pwm_conf.clone());
    let (pwm_a,pwm_b)=pwm_ab.split();
    pwm_a.set_duty_cycle(dutya);
    pwm_b.set_duty_cycle(dutyb);

if you want to use pwm with single output you'd need to use embassy_rp::pwm::Pwm::new_output_a() or embassy_rp::pwm::Pwm::new_output_b()

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

No branches or pull requests

2 participants