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

Add TWIM1-3 for nrf9160 #273

Merged
merged 1 commit into from
Dec 16, 2020
Merged
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
27 changes: 24 additions & 3 deletions nrf-hal-common/src/twim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use core::ops::Deref;
use core::sync::atomic::{compiler_fence, Ordering::SeqCst};

#[cfg(feature = "9160")]
use crate::pac::{twim0_ns as twim0, TWIM0_NS as TWIM0};
use crate::pac::{
twim0_ns as twim0, TWIM0_NS as TWIM0, TWIM1_NS as TWIM1, TWIM2_NS as TWIM2, TWIM3_NS as TWIM3,
};

#[cfg(not(feature = "9160"))]
use crate::pac::{twim0, TWIM0};
Expand Down Expand Up @@ -87,7 +89,7 @@ where
}

/// Disable the instance.
///
///
/// Disabling the instance will switch off the peripheral leading to a
/// considerably lower energy use. However, while the instance is disabled
/// it is not possible to use it for communication. The configuration of
Expand Down Expand Up @@ -471,9 +473,28 @@ mod sealed {
impl sealed::Sealed for TWIM0 {}
impl Instance for TWIM0 {}

#[cfg(any(feature = "52832", feature = "52833", feature = "52840"))]
#[cfg(any(
feature = "52832",
feature = "52833",
feature = "52840",
feature = "9160"
))]
mod _twim1 {
use super::*;
impl sealed::Sealed for TWIM1 {}
impl Instance for TWIM1 {}
}

#[cfg(feature = "9160")]
mod _twim2 {
use super::*;
impl sealed::Sealed for TWIM2 {}
impl Instance for TWIM2 {}
}

#[cfg(feature = "9160")]
mod _twim3 {
use super::*;
impl sealed::Sealed for TWIM3 {}
impl Instance for TWIM3 {}
}