14 releases
Uses old Rust 2015
0.3.5 | Jan 27, 2021 |
---|---|
0.3.4 | Aug 5, 2020 |
0.3.3 | Jul 24, 2020 |
0.3.0 | May 2, 2020 |
0.1.0 | Aug 29, 2017 |
#1610 in Embedded development
167 downloads per month
Used in 4 crates
3.5MB
764 lines
avr-mcu
Pragmatic access to AVR chip information.
Purpose
This library has been written to be used by other AVR libraries to generate code (such as IO-related compile time constants).
This crate can be compiled an run on all architectures, including x86 and AVR.
lib.rs
:
Information about every AVR microcontroller.
Device representation
The API consists of a set of types that represent information about each
microcontroller. The top-level type is Mcu
, modelling
a single microcontroller.
Retrieving microcontroller information
It is possible to look up information for a specific MCU, or all of them at once.
Getting information for the current target
In a lot of cases, we only care about the target microcontroller.
let mcu = avr_mcu::current::mcu().unwrap();
println!("Device: {}", mcu.device.name);
Behind-the-hood
This crate embeds a set of "packfiles" released by Atmel. These are XML specifications containing all of the information exposed by this crate.
You can see a list of all packfiles here.
A build script takes these packfiles and persists them as data structures in Rust.
Examples
for mcu in avr_mcu::microcontrollers() {
println!("Device: {}", mcu.device.name);
}