#avr #mcu #io #constants #pins

avr-mcu

Pragmatic structures for all AVR microcontrollers

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

#706 in Embedded development

Download history 117/week @ 2023-10-18 128/week @ 2023-10-25 119/week @ 2023-11-01 151/week @ 2023-11-08 94/week @ 2023-11-15 122/week @ 2023-11-22 145/week @ 2023-11-29 80/week @ 2023-12-06 113/week @ 2023-12-13 122/week @ 2023-12-20 87/week @ 2023-12-27 93/week @ 2024-01-03 114/week @ 2024-01-10 110/week @ 2024-01-17 116/week @ 2024-01-24 99/week @ 2024-01-31

455 downloads per month
Used in 4 crates

MIT license

3.5MB
764 lines

avr-mcu

Crates.io Build Status license

Pragmatic access to AVR chip information.

Documentation

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);
}

Dependencies