avr_mcu/
lib.rs

1//! Information about every AVR microcontroller.
2//!
3//! # Device representation
4//!
5//! The API consists of a set of types that represent information about each
6//! microcontroller. The top-level type is [`Mcu`](struct.Mcu.html), modelling
7//! a single microcontroller.
8//!
9//! # Retrieving microcontroller information
10//!
11//! It is possible to look up information for a specific MCU, or all of them at once.
12//!
13//! ## Getting information for the current target
14//!
15//! In a lot of cases, we only care about the target microcontroller.
16//!
17//! ```nodoc
18//! let mcu = avr_mcu::current::mcu().unwrap();
19//! println!("Device: {}", mcu.device.name);
20//! ```
21//!
22//! # Behind-the-hood
23//!
24//! This crate embeds a set of "packfiles" released by Atmel. These are XML
25//! specifications containing all of the information exposed by this crate.
26//!
27//! You can see a list of all packfiles [here](https://github.com/avr-rust/avr-mcu/tree/master/packs).
28//!
29//! A build script takes these packfiles and persists them as data structures in Rust.
30//!
31//! # Examples
32//!
33//! ```nodoc
34//! for mcu in avr_mcu::microcontrollers() {
35//!     println!("Device: {}", mcu.device.name);
36//! }
37//! ```
38
39extern crate xmltree;
40#[macro_use]
41extern crate lazy_static;
42
43pub use self::load::{microcontroller, microcontroller_names, microcontrollers};
44pub use self::model::*;
45
46mod extra_info;
47mod load;
48mod model;
49mod pack;
50
51pub mod current;