Registry / other / atsamd21-hal

atsamd21-hal

JSON →
library0.3.1rscratesunverified

HAL and Peripheral access API for ATSAMD21 microcontrollers.

# Cargo.toml [dependencies] atsamd21-hal = "0.3.1"
INSTALL
IMPORT
SIG · ATSAMD21-HAL
A
atsamd21-hal
otherrustv0.3.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

atsamd21_hal
use atsamd21_hal::prelude::*;

Initialize clocks and delay on ATSAMD21.

use atsamd21_hal::prelude::*; use atsamd21_hal::clock::GenericClockController; use atsamd21_hal::delay::Delay; use atsamd21_hal::pac::Peripherals; fn main() -> ! { let mut peripherals = Peripherals::take().unwrap(); let clocks = GenericClockController::with_internal_32kosc( peripherals.GCLK, peripherals.PM, peripherals.SYSCTRL, &mut peripherals.NVMCTRL, ); let mut delay = Delay::new(peripherals.SYSTICK, &clocks); loop { delay.delay_ms(1000u16); } }
Debug
Known issues
gotchaRequires specific microcontroller target and may need custom linker script.
fix
Ensure you are compiling for the correct ARM Cortex-M0+ target and have proper memory layout.
affects: >=0.3.0
Upgrade
Version history
0.3.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
14
Meta
2
OpenAI (training)
1
Resources
atsamd21-hal — cargo add atsamd21-hal · libregistry