Closed Token-Thinker closed 1 week ago
from the rp-hal side they said they don't see any plans on merging the two.
thoughts from embassy maintainers? - https://github.com/rp-rs/rp-hal/issues/816
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.
@lulf
that makes sense as i was reading more into it.
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-hal
example 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;
fn main() -> ! {
//.....omitting some setup configurations
// Output channel B on PWM4 to GPIO 25
let channel = &mut pwm.channel_b;
channel.output_to(pins.gpio25);
// Infinite loop, fading LED up and down
loop {
// Ramp brightness up
for i in LOW..=HIGH {
delay.delay_us(8);
let _ = channel.set_duty_cycle(i); //<---------HERE
}
// Ramp brightness down
for 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 theembassy-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?