File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -615,3 +615,29 @@ impl SCB {
615
615
}
616
616
}
617
617
}
618
+
619
+ const SCB_ICSR_PENDSVSET : u32 = 1 << 28 ;
620
+ const SCB_ICSR_PENDSVCLR : u32 = 1 << 27 ;
621
+
622
+ impl SCB {
623
+ /// Set the PENDSVSET bit in the ICSR register which will pend the PendSV interrupt
624
+ pub fn set_pendsv ( ) {
625
+ unsafe {
626
+ ( * Self :: ptr ( ) ) . icsr . write ( SCB_ICSR_PENDSVSET ) ;
627
+ }
628
+ }
629
+
630
+ /// Check if PENDSVSET bit in the ICSR register is set meaning PendSV interrupt is pending
631
+ pub fn is_pendsv_pending ( ) -> bool {
632
+ unsafe {
633
+ ( * Self :: ptr ( ) ) . icsr . read ( ) & SCB_ICSR_PENDSVSET == SCB_ICSR_PENDSVSET
634
+ }
635
+ }
636
+
637
+ /// Set the PENDSVCLR bit in the ICSR register which will clear a pending PendSV interrupt
638
+ pub fn clear_pendsv ( ) {
639
+ unsafe {
640
+ ( * Self :: ptr ( ) ) . icsr . write ( SCB_ICSR_PENDSVCLR ) ;
641
+ }
642
+ }
643
+ }
You can’t perform that action at this time.
0 commit comments