@@ -87,6 +87,8 @@ pub mod tpiu;
8787#[ cfg( test) ]
8888mod test;
8989
90+ pub use nvic:: NVIC ;
91+
9092// NOTE the `PhantomData` used in the peripherals proxy is to make them `Send` but *not* `Sync`
9193
9294/// Core peripherals
@@ -131,7 +133,7 @@ pub struct Peripherals {
131133 pub MPU : MPU ,
132134
133135 /// Nested Vector Interrupt Controller
134- pub NVIC : NVIC ,
136+ pub NVIC : nvic :: OwnedRegisterBlock < { nvic :: BASE_ADDRESS } > ,
135137
136138 /// Security Attribution Unit
137139 pub SAU : SAU ,
@@ -213,9 +215,7 @@ impl Peripherals {
213215 MPU : MPU {
214216 _marker : PhantomData ,
215217 } ,
216- NVIC : NVIC {
217- _marker : PhantomData ,
218- } ,
218+ NVIC : nvic:: OwnedRegisterBlock :: new ( ) ,
219219 SAU : SAU {
220220 _marker : PhantomData ,
221221 } ,
@@ -546,34 +546,6 @@ impl ops::Deref for MPU {
546546 }
547547}
548548
549- /// Nested Vector Interrupt Controller
550- pub struct NVIC {
551- _marker : PhantomData < * const ( ) > ,
552- }
553-
554- unsafe impl Send for NVIC { }
555-
556- impl NVIC {
557- /// Pointer to the register block
558- pub const PTR : * const nvic:: RegisterBlock = 0xE000_E100 as * const _ ;
559-
560- /// Returns a pointer to the register block
561- #[ inline( always) ]
562- #[ deprecated( since = "0.7.5" , note = "Use the associated constant `PTR` instead" ) ]
563- pub const fn ptr ( ) -> * const nvic:: RegisterBlock {
564- Self :: PTR
565- }
566- }
567-
568- impl ops:: Deref for NVIC {
569- type Target = self :: nvic:: RegisterBlock ;
570-
571- #[ inline( always) ]
572- fn deref ( & self ) -> & Self :: Target {
573- unsafe { & * Self :: PTR }
574- }
575- }
576-
577549/// Security Attribution Unit
578550pub struct SAU {
579551 _marker : PhantomData < * const ( ) > ,
0 commit comments