#avr #pin #constants #mcu #io

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

#1480 in Embedded development

Download history 67/week @ 2024-02-26 66/week @ 2024-03-04 85/week @ 2024-03-11 87/week @ 2024-03-18 68/week @ 2024-03-25 113/week @ 2024-04-01 59/week @ 2024-04-08 72/week @ 2024-04-15 88/week @ 2024-04-22 86/week @ 2024-04-29 49/week @ 2024-05-06 54/week @ 2024-05-13 70/week @ 2024-05-20 48/week @ 2024-05-27 62/week @ 2024-06-03 45/week @ 2024-06-10

232 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