cortex-m 0.7.8

Low level access to Cortex-M processors
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Main Stack Pointer Limit Register

use core::arch::asm;

/// Reads the CPU register
#[inline]
pub fn read() -> u32 {
    let r;
    unsafe { asm!("mrs {}, MSPLIM", out(reg) r, options(nomem, nostack, preserves_flags)) };
    r
}

/// Writes `bits` to the CPU register
#[inline]
pub unsafe fn write(bits: u32) {
    unsafe { asm!("msr MSPLIM, {}", in(reg) bits, options(nomem, nostack, preserves_flags)) };
}