diff --git a/embassy-rp/src/pwm.rs b/embassy-rp/src/pwm.rs index d0e89f250..5aab3ff4f 100644 --- a/embassy-rp/src/pwm.rs +++ b/embassy-rp/src/pwm.rs @@ -129,7 +129,7 @@ impl<'d, T: Slice> Pwm<'d, T> { #[inline] pub fn new_output_a( inner: impl Peripheral

+ 'd, - a: impl Peripheral

> + 'd, + a: impl Peripheral

> + 'd, config: Config, ) -> Self { into_ref!(a); @@ -140,7 +140,7 @@ impl<'d, T: Slice> Pwm<'d, T> { #[inline] pub fn new_output_b( inner: impl Peripheral

+ 'd, - b: impl Peripheral

> + 'd, + b: impl Peripheral

> + 'd, config: Config, ) -> Self { into_ref!(b); @@ -151,8 +151,8 @@ impl<'d, T: Slice> Pwm<'d, T> { #[inline] pub fn new_output_ab( inner: impl Peripheral

+ 'd, - a: impl Peripheral

> + 'd, - b: impl Peripheral

> + 'd, + a: impl Peripheral

> + 'd, + b: impl Peripheral

> + 'd, config: Config, ) -> Self { into_ref!(a, b); @@ -163,7 +163,7 @@ impl<'d, T: Slice> Pwm<'d, T> { #[inline] pub fn new_input( inner: impl Peripheral

+ 'd, - b: impl Peripheral

> + 'd, + b: impl Peripheral

> + 'd, mode: InputMode, config: Config, ) -> Self { @@ -175,8 +175,8 @@ impl<'d, T: Slice> Pwm<'d, T> { #[inline] pub fn new_output_input( inner: impl Peripheral

+ 'd, - a: impl Peripheral

> + 'd, - b: impl Peripheral

> + 'd, + a: impl Peripheral

> + 'd, + b: impl Peripheral

> + 'd, mode: InputMode, config: Config, ) -> Self { @@ -336,43 +336,43 @@ slice!(PWM_SLICE6, 6); slice!(PWM_SLICE7, 7); /// PWM Channel A. -pub trait PwmChannelA: GpioPin {} +pub trait ChannelAPin: GpioPin {} /// PWM Channel B. -pub trait PwmChannelB: GpioPin {} +pub trait ChannelBPin: GpioPin {} -macro_rules! impl_channel { +macro_rules! impl_pin { ($pin:ident, $channel:ident, $kind:ident) => { impl $kind for peripherals::$pin {} }; } -impl_channel!(PIN_0, PWM_SLICE0, PwmChannelA); -impl_channel!(PIN_1, PWM_SLICE0, PwmChannelB); -impl_channel!(PIN_2, PWM_SLICE1, PwmChannelA); -impl_channel!(PIN_3, PWM_SLICE1, PwmChannelB); -impl_channel!(PIN_4, PWM_SLICE2, PwmChannelA); -impl_channel!(PIN_5, PWM_SLICE2, PwmChannelB); -impl_channel!(PIN_6, PWM_SLICE3, PwmChannelA); -impl_channel!(PIN_7, PWM_SLICE3, PwmChannelB); -impl_channel!(PIN_8, PWM_SLICE4, PwmChannelA); -impl_channel!(PIN_9, PWM_SLICE4, PwmChannelB); -impl_channel!(PIN_10, PWM_SLICE5, PwmChannelA); -impl_channel!(PIN_11, PWM_SLICE5, PwmChannelB); -impl_channel!(PIN_12, PWM_SLICE6, PwmChannelA); -impl_channel!(PIN_13, PWM_SLICE6, PwmChannelB); -impl_channel!(PIN_14, PWM_SLICE7, PwmChannelA); -impl_channel!(PIN_15, PWM_SLICE7, PwmChannelB); -impl_channel!(PIN_16, PWM_SLICE0, PwmChannelA); -impl_channel!(PIN_17, PWM_SLICE0, PwmChannelB); -impl_channel!(PIN_18, PWM_SLICE1, PwmChannelA); -impl_channel!(PIN_19, PWM_SLICE1, PwmChannelB); -impl_channel!(PIN_20, PWM_SLICE2, PwmChannelA); -impl_channel!(PIN_21, PWM_SLICE2, PwmChannelB); -impl_channel!(PIN_22, PWM_SLICE3, PwmChannelA); -impl_channel!(PIN_23, PWM_SLICE3, PwmChannelB); -impl_channel!(PIN_24, PWM_SLICE4, PwmChannelA); -impl_channel!(PIN_25, PWM_SLICE4, PwmChannelB); -impl_channel!(PIN_26, PWM_SLICE5, PwmChannelA); -impl_channel!(PIN_27, PWM_SLICE5, PwmChannelB); -impl_channel!(PIN_28, PWM_SLICE6, PwmChannelA); -impl_channel!(PIN_29, PWM_SLICE6, PwmChannelB); +impl_pin!(PIN_0, PWM_SLICE0, ChannelAPin); +impl_pin!(PIN_1, PWM_SLICE0, ChannelBPin); +impl_pin!(PIN_2, PWM_SLICE1, ChannelAPin); +impl_pin!(PIN_3, PWM_SLICE1, ChannelBPin); +impl_pin!(PIN_4, PWM_SLICE2, ChannelAPin); +impl_pin!(PIN_5, PWM_SLICE2, ChannelBPin); +impl_pin!(PIN_6, PWM_SLICE3, ChannelAPin); +impl_pin!(PIN_7, PWM_SLICE3, ChannelBPin); +impl_pin!(PIN_8, PWM_SLICE4, ChannelAPin); +impl_pin!(PIN_9, PWM_SLICE4, ChannelBPin); +impl_pin!(PIN_10, PWM_SLICE5, ChannelAPin); +impl_pin!(PIN_11, PWM_SLICE5, ChannelBPin); +impl_pin!(PIN_12, PWM_SLICE6, ChannelAPin); +impl_pin!(PIN_13, PWM_SLICE6, ChannelBPin); +impl_pin!(PIN_14, PWM_SLICE7, ChannelAPin); +impl_pin!(PIN_15, PWM_SLICE7, ChannelBPin); +impl_pin!(PIN_16, PWM_SLICE0, ChannelAPin); +impl_pin!(PIN_17, PWM_SLICE0, ChannelBPin); +impl_pin!(PIN_18, PWM_SLICE1, ChannelAPin); +impl_pin!(PIN_19, PWM_SLICE1, ChannelBPin); +impl_pin!(PIN_20, PWM_SLICE2, ChannelAPin); +impl_pin!(PIN_21, PWM_SLICE2, ChannelBPin); +impl_pin!(PIN_22, PWM_SLICE3, ChannelAPin); +impl_pin!(PIN_23, PWM_SLICE3, ChannelBPin); +impl_pin!(PIN_24, PWM_SLICE4, ChannelAPin); +impl_pin!(PIN_25, PWM_SLICE4, ChannelBPin); +impl_pin!(PIN_26, PWM_SLICE5, ChannelAPin); +impl_pin!(PIN_27, PWM_SLICE5, ChannelBPin); +impl_pin!(PIN_28, PWM_SLICE6, ChannelAPin); +impl_pin!(PIN_29, PWM_SLICE6, ChannelBPin);