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
60
61
62
63
64
65
66
67
68
69
70
71
72
//! Hardware pins for the Teensy 4.0, 4.1 and MicroMod boards
//!
//! `teensy4-pins` is designed to the [`imxrt-iomuxc`] crate. The pins API constrains
//! the processor pads to the ones that are available on the Teensy 4.0, 4.1 and MicroMod. It also
//! exposes type aliases that simplify pin identification in the type system.
//!
//! [`imxrt-iomuxc`]: https://docs.rs/imxrt-iomuxc/0.1/imxrt_iomuxc/
//!
//! Note that this pin API is optional. You are free to configure the pins using the
//! pad identifiers, instead of the physical pin identifiers. Pads are available directly
//! from the `imxrt-iomuxc` crate.
//!
//! # Teensy 4.0
//!
//! To acquire Teensy 4.0 pins, call `t40::from_pads` and provide all
//! of the processor pads:
//!
//! ```
//! use teensy4_pins::t40;
//! # use imxrt_iomuxc::imxrt1060::Pads;
//!
//! let pads = // Handle to all processor pads
//!     # unsafe { Pads::new() };
//! let pins = t40::from_pads(pads);
//! ```
//!
//! # Teensy 4.1
//!
//! The approach is the same as the Teensy 4.0, replacing `t40` with `t41`:
//!
//! ```
//! use teensy4_pins::t41;
//! # use imxrt_iomuxc::imxrt1060::Pads;
//!
//! let pads = // Handle to all processor pads
//!     # unsafe { Pads::new() };
//! let pins = t41::from_pads(pads);
//! ```
//!
//! # Teensy MicroMod
//!
//! The approach is the same as the Teensy 4.0, replacing `t40` with `tmm`:
//!
//! ```
//! use teensy4_pins::tmm;
//! # use imxrt_iomuxc::imxrt1060::Pads;
//!
//! let pads = // Handle to all processor pads
//!     # unsafe { Pads::new() };
//! let pins = tmm::from_pads(pads);
//! ```
//!
//! # Safety
//!
//! The safe APIs expect to work on the only instance of the processor pads. If you don't have that
//! available, or you need more flexibility, use the unsafe [`t40::Pin::new`](t40::Pins::new()),
//! [`t41::Pins::new`](t41::Pins::new()), or [`tmm::Pins::new`](tmm::Pins::new()) constructor methods
//! to create an instance that may be aliasing another handle to the pads or pins.

#![no_std]

pub mod common;
pub mod t40;
pub mod t41;
pub mod tmm;

mod iomuxc {
    pub use imxrt_iomuxc::imxrt1060::*;
    pub use imxrt_iomuxc::ErasedPad;
}

pub use imxrt_iomuxc;