diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-04-05 00:20:22 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2024-04-05 00:48:46 +0200 |
| commit | ab85eb4b60cd49ebcd43d2305f42327685f5e5a6 (patch) | |
| tree | 3c385a5703edcd1e791ec1934d3232dc4084ab2b /embassy-nrf/src/ppi/mod.rs | |
| parent | 0e1208947e89ea60bd1b5c85e4deb79efb94d89a (diff) | |
nrf: remove mod sealed.
Diffstat (limited to 'embassy-nrf/src/ppi/mod.rs')
| -rw-r--r-- | embassy-nrf/src/ppi/mod.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/embassy-nrf/src/ppi/mod.rs b/embassy-nrf/src/ppi/mod.rs index f5764b8b7..13f7dcc83 100644 --- a/embassy-nrf/src/ppi/mod.rs +++ b/embassy-nrf/src/ppi/mod.rs | |||
| @@ -210,13 +210,12 @@ unsafe impl Send for Event<'_> {} | |||
| 210 | // ====================== | 210 | // ====================== |
| 211 | // traits | 211 | // traits |
| 212 | 212 | ||
| 213 | pub(crate) mod sealed { | 213 | pub(crate) trait SealedChannel {} |
| 214 | pub trait Channel {} | 214 | pub(crate) trait SealedGroup {} |
| 215 | pub trait Group {} | ||
| 216 | } | ||
| 217 | 215 | ||
| 218 | /// Interface for PPI channels. | 216 | /// Interface for PPI channels. |
| 219 | pub trait Channel: sealed::Channel + Peripheral<P = Self> + Sized + 'static { | 217 | #[allow(private_bounds)] |
| 218 | pub trait Channel: SealedChannel + Peripheral<P = Self> + Sized + 'static { | ||
| 220 | /// Returns the number of the channel | 219 | /// Returns the number of the channel |
| 221 | fn number(&self) -> usize; | 220 | fn number(&self) -> usize; |
| 222 | } | 221 | } |
| @@ -234,7 +233,8 @@ pub trait StaticChannel: Channel + Into<AnyStaticChannel> { | |||
| 234 | } | 233 | } |
| 235 | 234 | ||
| 236 | /// Interface for a group of PPI channels. | 235 | /// Interface for a group of PPI channels. |
| 237 | pub trait Group: sealed::Group + Peripheral<P = Self> + Into<AnyGroup> + Sized + 'static { | 236 | #[allow(private_bounds)] |
| 237 | pub trait Group: SealedGroup + Peripheral<P = Self> + Into<AnyGroup> + Sized + 'static { | ||
| 238 | /// Returns the number of the group. | 238 | /// Returns the number of the group. |
| 239 | fn number(&self) -> usize; | 239 | fn number(&self) -> usize; |
| 240 | /// Convert into a type erased group. | 240 | /// Convert into a type erased group. |
| @@ -254,7 +254,7 @@ pub struct AnyStaticChannel { | |||
| 254 | pub(crate) number: u8, | 254 | pub(crate) number: u8, |
| 255 | } | 255 | } |
| 256 | impl_peripheral!(AnyStaticChannel); | 256 | impl_peripheral!(AnyStaticChannel); |
| 257 | impl sealed::Channel for AnyStaticChannel {} | 257 | impl SealedChannel for AnyStaticChannel {} |
| 258 | impl Channel for AnyStaticChannel { | 258 | impl Channel for AnyStaticChannel { |
| 259 | fn number(&self) -> usize { | 259 | fn number(&self) -> usize { |
| 260 | self.number as usize | 260 | self.number as usize |
| @@ -272,7 +272,7 @@ pub struct AnyConfigurableChannel { | |||
| 272 | pub(crate) number: u8, | 272 | pub(crate) number: u8, |
| 273 | } | 273 | } |
| 274 | impl_peripheral!(AnyConfigurableChannel); | 274 | impl_peripheral!(AnyConfigurableChannel); |
| 275 | impl sealed::Channel for AnyConfigurableChannel {} | 275 | impl SealedChannel for AnyConfigurableChannel {} |
| 276 | impl Channel for AnyConfigurableChannel { | 276 | impl Channel for AnyConfigurableChannel { |
| 277 | fn number(&self) -> usize { | 277 | fn number(&self) -> usize { |
| 278 | self.number as usize | 278 | self.number as usize |
| @@ -287,7 +287,7 @@ impl ConfigurableChannel for AnyConfigurableChannel { | |||
| 287 | #[cfg(not(feature = "nrf51"))] | 287 | #[cfg(not(feature = "nrf51"))] |
| 288 | macro_rules! impl_ppi_channel { | 288 | macro_rules! impl_ppi_channel { |
| 289 | ($type:ident, $number:expr) => { | 289 | ($type:ident, $number:expr) => { |
| 290 | impl crate::ppi::sealed::Channel for peripherals::$type {} | 290 | impl crate::ppi::SealedChannel for peripherals::$type {} |
| 291 | impl crate::ppi::Channel for peripherals::$type { | 291 | impl crate::ppi::Channel for peripherals::$type { |
| 292 | fn number(&self) -> usize { | 292 | fn number(&self) -> usize { |
| 293 | $number | 293 | $number |
| @@ -338,7 +338,7 @@ pub struct AnyGroup { | |||
| 338 | number: u8, | 338 | number: u8, |
| 339 | } | 339 | } |
| 340 | impl_peripheral!(AnyGroup); | 340 | impl_peripheral!(AnyGroup); |
| 341 | impl sealed::Group for AnyGroup {} | 341 | impl SealedGroup for AnyGroup {} |
| 342 | impl Group for AnyGroup { | 342 | impl Group for AnyGroup { |
| 343 | fn number(&self) -> usize { | 343 | fn number(&self) -> usize { |
| 344 | self.number as usize | 344 | self.number as usize |
| @@ -347,7 +347,7 @@ impl Group for AnyGroup { | |||
| 347 | 347 | ||
| 348 | macro_rules! impl_group { | 348 | macro_rules! impl_group { |
| 349 | ($type:ident, $number:expr) => { | 349 | ($type:ident, $number:expr) => { |
| 350 | impl sealed::Group for peripherals::$type {} | 350 | impl SealedGroup for peripherals::$type {} |
| 351 | impl Group for peripherals::$type { | 351 | impl Group for peripherals::$type { |
| 352 | fn number(&self) -> usize { | 352 | fn number(&self) -> usize { |
| 353 | $number | 353 | $number |
