Initial support for nrf9160
This commit is contained in:
@ -10,7 +10,11 @@ use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
|
||||
use gpio::pin_cnf::DRIVE_A;
|
||||
|
||||
use crate::pac;
|
||||
|
||||
#[cfg(not(feature = "nrf9160"))]
|
||||
use crate::pac::p0 as gpio;
|
||||
#[cfg(feature = "nrf9160")]
|
||||
use crate::pac::p0_ns as gpio;
|
||||
|
||||
use self::sealed::Pin as _;
|
||||
|
||||
@ -299,7 +303,10 @@ pub(crate) mod sealed {
|
||||
fn block(&self) -> &gpio::RegisterBlock {
|
||||
unsafe {
|
||||
match self.pin_port() / 32 {
|
||||
#[cfg(not(feature = "nrf9160"))]
|
||||
0 => &*pac::P0::ptr(),
|
||||
#[cfg(feature = "nrf9160")]
|
||||
0 => &*pac::P0_NS::ptr(),
|
||||
#[cfg(any(feature = "nrf52833", feature = "nrf52840"))]
|
||||
1 => &*pac::P1::ptr(),
|
||||
_ => unreachable_unchecked(),
|
||||
|
Reference in New Issue
Block a user