コンテンツにスキップ

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).

バージョン
0.7.7
ライセンス
MIT OR Apache-2.0
メンテナンス
活発に開発中

コード例

cortex-m はコア周辺(SYST/NVIC/SCB 等)と命令ヘルパを提供します。

WFI でスリープしつつ SysTick を触る
#![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();
}
}

関連 Crates

関連記事