pub struct VectorTable { /* private fields */ }Expand description
Data type for a properly aligned interrupt vector table
The VTOR register can only point to a 128 byte offsets - see Cortex-33 Devices Generic User Guide - so that is our required alignment. The vector table length depends on the number of interrupts the system supports. The first 16 words are defined in the ARM Cortex-M spec. The Cortex-M33 cores on RP235x have 52 interrupts, of which only 47 are wired to external interrupt signals - but the last 6 can be used for software interrupts so leave room for them
Implementations§
Source§impl VectorTable
impl VectorTable
Sourcepub const fn new() -> VectorTable
pub const fn new() -> VectorTable
Create a new vector table. All entries will point to 0 - you must call init() on this to copy the current vector table before setting it as active
Sourcepub fn init(&mut self, ppb: &mut PPB)
pub fn init(&mut self, ppb: &mut PPB)
Initialise our vector table by copying the current table on top of it
Sourcepub fn register_handler(
&mut self,
interrupt_idx: usize,
interrupt_fn: extern "C" fn(),
)
pub fn register_handler( &mut self, interrupt_idx: usize, interrupt_fn: extern "C" fn(), )
Dynamically register a function as being an interrupt handler
Sourcepub unsafe fn set_sp(&mut self, stack_pointer_address: usize)
pub unsafe fn set_sp(&mut self, stack_pointer_address: usize)
Set the stack pointer address in a VectorTable. This will be used on Reset
§Safety
There is no checking whether this is a valid stack pointer address
Trait Implementations§
Source§impl Default for VectorTable
impl Default for VectorTable
Source§fn default() -> VectorTable
fn default() -> VectorTable
Auto Trait Implementations§
impl Freeze for VectorTable
impl RefUnwindSafe for VectorTable
impl Send for VectorTable
impl Sync for VectorTable
impl Unpin for VectorTable
impl UnwindSafe for VectorTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more