1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Low level access to Cortex-M processors
//!
//! This crate provides:
//!
//! - Access to core peripherals like NVIC, SCB and SysTick.
//! - Access to core registers like CONTROL, MSP and PSR.
//! - Interrupt manipulation mechanisms
//! - Safe wrappers around Cortex-M specific instructions like `bkpt`
//!
//! # Requirements
//!
//! To use this crate on the stable or beta channel `arm-none-eabi-gcc` needs to be installed and
//! available in your `$PATH`.
//!
//! # Optional features
//!
//! ## `inline-asm`
//!
//! When this feature is enabled the implementation of all the functions inside the `asm` and
//! `register` modules use inline assembly (`asm!`) instead of external assembly (FFI into separate
//! assembly files compiled using `arm-none-eabi-gcc`). The advantages the enabling `inline-asm`
//! are:
//!
//! - Reduced overhead. FFI eliminates the possibility of inlining so all operations include a
//! function call overhead when `inline-asm` is not enabled.
//!
//! - `arm-none-eabi-gcc` is not required for building this crate.
//!
//! - Some of the `register` API only becomes available only when `inline-asm` is enabled. Check the
//! API docs for details.
//!
//! The disadvantage is that `inline-asm` requires a nightly toolchain.
//!
//! ## `const-fn`
//!
//! Enabling this feature turns the `Mutex.new` constructor into a `const fn`.
//!
//! This feature requires a nightly toolchain.

#![cfg_attr(feature = "inline-asm", feature(asm))]
#![deny(missing_docs)]
#![deny(warnings)]
#![no_std]

extern crate aligned;
extern crate bare_metal;
extern crate volatile_register;

#[macro_use]
mod macros;

pub mod asm;
pub mod interrupt;
#[cfg(not(armv6m))]
pub mod itm;
pub mod peripheral;
pub mod register;

pub use peripheral::Peripherals;