aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/usb/mod.rs
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-04-05 00:20:22 +0200
committerDario Nieuwenhuis <[email protected]>2024-04-05 00:48:46 +0200
commitab85eb4b60cd49ebcd43d2305f42327685f5e5a6 (patch)
tree3c385a5703edcd1e791ec1934d3232dc4084ab2b /embassy-nrf/src/usb/mod.rs
parent0e1208947e89ea60bd1b5c85e4deb79efb94d89a (diff)
nrf: remove mod sealed.
Diffstat (limited to 'embassy-nrf/src/usb/mod.rs')
-rw-r--r--embassy-nrf/src/usb/mod.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/embassy-nrf/src/usb/mod.rs b/embassy-nrf/src/usb/mod.rs
index e26b49db3..09cf87e97 100644
--- a/embassy-nrf/src/usb/mod.rs
+++ b/embassy-nrf/src/usb/mod.rs
@@ -793,23 +793,20 @@ impl Allocator {
793 } 793 }
794} 794}
795 795
796pub(crate) mod sealed { 796pub(crate) trait SealedInstance {
797 use super::*; 797 fn regs() -> &'static pac::usbd::RegisterBlock;
798
799 pub trait Instance {
800 fn regs() -> &'static pac::usbd::RegisterBlock;
801 }
802} 798}
803 799
804/// USB peripheral instance. 800/// USB peripheral instance.
805pub trait Instance: Peripheral<P = Self> + sealed::Instance + 'static + Send { 801#[allow(private_bounds)]
802pub trait Instance: Peripheral<P = Self> + SealedInstance + 'static + Send {
806 /// Interrupt for this peripheral. 803 /// Interrupt for this peripheral.
807 type Interrupt: interrupt::typelevel::Interrupt; 804 type Interrupt: interrupt::typelevel::Interrupt;
808} 805}
809 806
810macro_rules! impl_usb { 807macro_rules! impl_usb {
811 ($type:ident, $pac_type:ident, $irq:ident) => { 808 ($type:ident, $pac_type:ident, $irq:ident) => {
812 impl crate::usb::sealed::Instance for peripherals::$type { 809 impl crate::usb::SealedInstance for peripherals::$type {
813 fn regs() -> &'static pac::usbd::RegisterBlock { 810 fn regs() -> &'static pac::usbd::RegisterBlock {
814 unsafe { &*pac::$pac_type::ptr() } 811 unsafe { &*pac::$pac_type::ptr() }
815 } 812 }