cortex-m — Crate 詳細
cortex-m
Mature no_std
ARM Cortex-M 向けの低レベルアクセス crate。NVIC/SCB/SysTick などの CPU コア周辺機能にアクセスし、割り込み制御や低電力命令(WFI)などを提供します。
Low-level access to ARM Cortex-M core peripherals and instructions (NVIC, SCB, SysTick, asm helpers).
コード例
cortex-m はコア周辺(SYST/NVIC/SCB 等)と命令ヘルパを提供します。
#![no_std]#![no_main]
use cortex_m::peripheral::Peripherals;use cortex_m_rt::entry;use {defmt_rtt as _, panic_probe as _};
#[entry]fn main() -> ! { let mut cp = Peripherals::take().unwrap(); cp.SYST.disable_counter();
defmt::info!("sleeping..."); loop { cortex_m::asm::wfi(); }}