Skip to content

Commit 069325e

Browse files
Merge pull request #273 from Wassasin/nrf9160-twim
Add TWIM1-3 for nrf9160
2 parents ce7b3a9 + 362d3d9 commit 069325e

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

nrf-hal-common/src/twim.rs

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ use core::ops::Deref;
88
use core::sync::atomic::{compiler_fence, Ordering::SeqCst};
99

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

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

8991
/// Disable the instance.
90-
///
92+
///
9193
/// Disabling the instance will switch off the peripheral leading to a
9294
/// considerably lower energy use. However, while the instance is disabled
9395
/// it is not possible to use it for communication. The configuration of
@@ -471,9 +473,28 @@ mod sealed {
471473
impl sealed::Sealed for TWIM0 {}
472474
impl Instance for TWIM0 {}
473475

474-
#[cfg(any(feature = "52832", feature = "52833", feature = "52840"))]
476+
#[cfg(any(
477+
feature = "52832",
478+
feature = "52833",
479+
feature = "52840",
480+
feature = "9160"
481+
))]
475482
mod _twim1 {
476483
use super::*;
477484
impl sealed::Sealed for TWIM1 {}
478485
impl Instance for TWIM1 {}
479486
}
487+
488+
#[cfg(feature = "9160")]
489+
mod _twim2 {
490+
use super::*;
491+
impl sealed::Sealed for TWIM2 {}
492+
impl Instance for TWIM2 {}
493+
}
494+
495+
#[cfg(feature = "9160")]
496+
mod _twim3 {
497+
use super::*;
498+
impl sealed::Sealed for TWIM3 {}
499+
impl Instance for TWIM3 {}
500+
}

0 commit comments

Comments
 (0)