Add port for gpiote task ouput pins on 52833 and 52840
@@ -361,6 +361,15 @@ fn config_channel_task_pin<P: GpioteOutputPin>(
TaskOutPolarity::Clear => w.polarity().hi_to_lo(),
TaskOutPolarity::Toggle => w.polarity().toggle(),
};
+
+ #[cfg(any(feature = "52833", feature = "52840"))]
+ {
+ match pin.port() {
+ Port::Port0 => w.port().clear_bit(),
+ Port::Port1 => w.port().set_bit(),
+ };
+ }
+
unsafe { w.psel().bits(pin.pin()) }
});
}
@@ -421,16 +430,23 @@ impl GpioteInputPin for Pin<Input<Floating>> {
/// Trait to represent task output pin.
pub trait GpioteOutputPin {
fn pin(&self) -> u8;
+ fn port(&self) -> Port;
}
impl GpioteOutputPin for Pin<Output<OpenDrain>> {
fn pin(&self) -> u8 {
self.pin()
}
+ fn port(&self) -> Port {
+ self.port()
+ }
}
impl GpioteOutputPin for Pin<Output<PushPull>> {
fn pin(&self) -> u8 {
self.pin()
}
+ fn port(&self) -> Port {
+ self.port()
+ }
}
