You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a project based on embedded-hal and embassy for various boards that does async operations.
When doing research I noticed that the embassy-rp crate doesn't expose the channel functionality for setting the duty cycle using embedded-hal.
However rp2040-hal does expose that feature, but doesn't seem to have any ties to embassy, which leads to my issue/questions.
Is there a way for embassy-rp to exposes that or do I have to use rp2040-hal and if so will it work with embassy?
Any potential plans on merging the two?
The text was updated successfully, but these errors were encountered:
These are different HALs/projects with different goals, so it's fine for them to coexist. If there is some functionality you'd like to have exposed (I'm not sure what channel functionality relates to, PWM?), please give some more details and/or raise a PR.
essentially, i want to be able to expose the SetDutyCycle function using the embedded-hal crate as a source of truth for my project that will be using multiple mcus
the problem is in the implementation for PWM as it relates to embassy-rp2040, it directly slices and implements the "channel" control directly to the io vs letting you attach it like the rp-halexample below.
I hope that makes sense, thank you again for your response.
//! # PWM Blink Example//.....omitting some setup configurations and imports #![no_std]#![no_main]use embedded_hal::pwm::SetDutyCycle;fnmain() -> ! {//.....omitting some setup configurations// Output channel B on PWM4 to GPIO 25let channel = &mut pwm.channel_b;
channel.output_to(pins.gpio25);// Infinite loop, fading LED up and downloop{// Ramp brightness upfor i inLOW..=HIGH{
delay.delay_us(8);let _ = channel.set_duty_cycle(i);//<---------HERE}// Ramp brightness downfor i in(LOW..=HIGH).rev(){
delay.delay_us(8);let _ = channel.set_duty_cycle(i);//<----------HERE}
delay.delay_ms(500);}}
Hello All,
I'm building a project based on
embedded-hal
andembassy
for various boards that does async operations.When doing research I noticed that the
embassy-rp
crate doesn't expose thechannel
functionality for setting the duty cycle usingembedded-hal
.However
rp2040-hal
does expose that feature, but doesn't seem to have any ties to embassy, which leads to my issue/questions.Is there a way for
embassy-rp
to exposes that or do I have to userp2040-hal
and if so will it work with embassy?Any potential plans on merging the two?
The text was updated successfully, but these errors were encountered: