Skip to content

Commit

Permalink
Export, document pin configurations
Browse files Browse the repository at this point in the history
I'm intentionally not re-exporting the types used in the deprecated
Config APIs.
  • Loading branch information
mciantyre committed May 27, 2024
1 parent 52e9a7a commit 343e730
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
5 changes: 5 additions & 0 deletions teensy4-pins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

## [0.3.2] - 2024-05-27

Re-export and document configuration APIs available from imxrt-iomuxc.

## [0.3.1] - 2023-02-09

Add Teensy MicroMod pins in the `tmm` module.
Expand Down Expand Up @@ -37,6 +41,7 @@ release. Users should use `from_pads()`.

First release.

[0.3.2]: https://github.com/mciantyre/teensy4-rs/compare/teensy4-pins-0.3.1...teensy4-pins-0.3.2
[0.3.1]: https://github.com/mciantyre/teensy4-rs/compare/teensy4-pins-0.3.0...teensy4-pins-0.3.1
[0.3.0]: https://github.com/mciantyre/teensy4-rs/compare/teensy4-pins-0.2.0...teensy4-pins-0.3.0
[0.2.0]: https://github.com/mciantyre/teensy4-rs/compare/teensy4-pins-0.1.0...teensy4-pins-0.2.0
Expand Down
2 changes: 1 addition & 1 deletion teensy4-pins/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "teensy4-pins"
version = "0.3.1"
version = "0.3.2"
authors.workspace = true
edition.workspace = true
readme = "README.md"
Expand Down
31 changes: 31 additions & 0 deletions teensy4-pins/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@
//! let pins = tmm::from_pads(pads);
//! ```
//!
//! # Pin configuration
//!
//! Once you have your pad resources, you can configure pull ups, pull downs, and other pad
//! characteristics. See the [`Config`] documentation for all supported features. Use
//! [`configure`] to apply the settings.
//!
//! For example, here's a pull down on pin 7 and an pull up, open drain on pin 9:
//!
//! ```no_run
//! use teensy4_pins::{t40, Config, configure, PullKeeper, OpenDrain};
//! # use imxrt_iomuxc::imxrt1060::Pads;
//!
//! const P7_CONFIG: Config = Config::zero()
//! .set_pull_keeper(Some(PullKeeper::Pulldown100k));
//!
//! const P9_CONFIG: Config = Config::zero()
//! .set_pull_keeper(Some(PullKeeper::Pullup22k))
//! .set_open_drain(OpenDrain::Enabled);
//!
//! let pads = // Handle to all processor pads
//! # unsafe { Pads::new() };
//! let mut pins = t40::from_pads(pads);
//!
//! configure(&mut pins.p7, P7_CONFIG);
//! configure(&mut pins.p9, P9_CONFIG);
//! ```
//!
//! # Safety
//!
//! The safe APIs expect to work on the only instance of the processor pads. If you don't have that
Expand All @@ -70,3 +97,7 @@ mod iomuxc {
}

pub use imxrt_iomuxc;

pub use imxrt_iomuxc::{
configure, Config, DriveStrength, Hysteresis, OpenDrain, PullKeeper, SlewRate, Speed,
};

0 comments on commit 343e730

Please sign in to comment.