-
Notifications
You must be signed in to change notification settings - Fork 168
Add STIR register to NVIC peripheral #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
#[cfg(not(armv6m))] | ||
use volatile_register::RO; | ||
use volatile_register::RW; | ||
use volatile_register::{RW, WO}; | ||
|
||
use interrupt::Nr; | ||
use peripheral::NVIC; | ||
|
@@ -65,9 +65,30 @@ pub struct RegisterBlock { | |
/// so convenient byte-sized representation wouldn't work on that | ||
/// architecture. | ||
pub ipr: [RW<u32>; 8], | ||
|
||
#[cfg(not(armv6m))] | ||
reserved5: [u32; 208], | ||
|
||
#[cfg(armv6m)] | ||
reserved5: [u32; 696], | ||
|
||
/// Software Trigger Interrupt | ||
pub stir: WO<u32>, | ||
} | ||
|
||
impl NVIC { | ||
/// Request an IRQ in software | ||
pub fn req_irq<I>(&mut self, interrupt: I) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this method should be renamed to I think this method should include a comment similar to what's included in the ARM documentation:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
in particular the comment should mention that this method is similar to |
||
where | ||
I: Nr, | ||
{ | ||
let nr = interrupt.nr(); | ||
|
||
unsafe { | ||
self.stir.write(nr as u32); | ||
} | ||
} | ||
|
||
/// Clears `interrupt`'s pending state | ||
pub fn clear_pending<I>(&mut self, interrupt: I) | ||
where | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
STIR is not present on ARMv6-M so this needs
#[cfg(not(armv6m))]
.