Update gpiote.rs

Adding these changes enables us to define a channel using a mutable reference to `GPIOTE_CH(n)`, similar to how we can do with other drivers.
So instead of using:
```rust
let freq_in = InputChannel::new(
    p.GPIOTE_CH0,
    Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
    embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
we can use:
```rust
let freq_in = InputChannel::new(
    &mut p.GPIOTE_CH0,
    Input::new(&mut p.P0_19, embassy_nrf::gpio::Pull::Up),
    embassy_nrf::gpiote::InputChannelPolarity::HiToLo,
);
```
This commit is contained in:
Ardelean Călin Petru 2022-11-22 16:56:04 +02:00 committed by GitHub
parent ca4f615b25
commit a074cd0625
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -419,6 +419,12 @@ macro_rules! impl_channel {
$number as usize
}
}
impl sealed::Channel for &mut peripherals::$type {}
impl Channel for &mut peripherals::$type {
fn number(&self) -> usize {
$number as usize
}
}
};
}