Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: separate pad configurations from the HAL #73

Merged
merged 6 commits into from
Jul 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,5 @@ jobs:
run: cd imxrt-hal && cargo fmt --all -- --check
- name: Run clippy (${{ matrix.feature }}) for HAL
run: cd imxrt-hal && cargo clippy --features ${{ matrix.feature }} -- -D warnings
- name: Run tests for iomuxc crates
run: cargo test --package=imxrt-iomuxc --package=imxrt-iomuxc-build --package=imxrt106x-iomuxc
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
[workspace]

members = [
"imxrt-ral",
"imxrt-hal"
"imxrt-hal",

"imxrt-iomuxc",
"imxrt-iomuxc/imxrt-iomuxc-build",
"imxrt-iomuxc/imxrt106x-iomuxc",
]
12 changes: 11 additions & 1 deletion imxrt-hal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ nb = "0.1.2"
void = { version = "1.0.2", default-features = false }
log = "0.4.8"

[dependencies.imxrt-iomuxc]
version = "0.1.0"
path = "../imxrt-iomuxc"

# TODO this will be exposed by a 106x-specific HAL. We're
# exposing it here for backwards compatibility.
[dependencies.imxrt106x-iomuxc]
path = "../imxrt-iomuxc/imxrt106x-iomuxc"
optional = true

[lib]
bench = false

Expand All @@ -34,7 +44,7 @@ default = ["embedded-hal/unproven"] # Allows us to access the new digital pin tr
#imxrt1051 = ["imxrt-ral/imxrt1051"]
#imxrt1052 = ["imxrt-ral/imxrt1052"]
#imxrt1061 = ["imxrt-ral/imxrt1061"]
imxrt1062 = ["imxrt-ral/imxrt1062"]
imxrt1062 = ["imxrt-ral/imxrt1062", "imxrt106x-iomuxc"]
#imxrt1064 = ["imxrt-ral/imxrt1064"]
rtic = ["imxrt-ral/rtic"]
rt = ["imxrt-ral/rt"]
Expand Down
8 changes: 4 additions & 4 deletions imxrt-hal/src/dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
//! );
//!
//! let mut spi4 = spi4_builder.build(
//! peripherals.iomuxc.gpio_b0_02.alt3(),
//! peripherals.iomuxc.gpio_b0_01.alt3(),
//! peripherals.iomuxc.gpio_b0_03.alt3(),
//! peripherals.iomuxc.b0.p02,
//! peripherals.iomuxc.b0.p01,
//! peripherals.iomuxc.b0.p03,
//! );
//!
//! spi4.enable_chip_select_0(peripherals.iomuxc.gpio_b0_00.alt3());
//! spi4.enable_chip_select_0(peripherals.iomuxc.b0.p00);
//!
//! // Set the SPI clock speed, if desired...
//!
Expand Down
8 changes: 4 additions & 4 deletions imxrt-hal/src/dma/peripheral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ mod private {
pub trait Sealed {}

use crate::uart;
impl<M> Sealed for uart::UART<M> where M: uart::module::Module {}
impl<M> Sealed for uart::Rx<M> where M: uart::module::Module {}
impl<M> Sealed for uart::Tx<M> where M: uart::module::Module {}
impl<M> Sealed for uart::UART<M> where M: crate::iomuxc::consts::Unsigned {}
impl<M> Sealed for uart::Rx<M> where M: crate::iomuxc::consts::Unsigned {}
impl<M> Sealed for uart::Tx<M> where M: crate::iomuxc::consts::Unsigned {}

use crate::spi;
impl<M> Sealed for spi::SPI<M> where M: spi::module::Module {}
impl<M> Sealed for spi::SPI<M> where M: crate::iomuxc::consts::Unsigned {}
}

#[derive(Clone, Copy)]
Expand Down
Loading