Initial support for nrf9160

This commit is contained in:
Dion Dokter
2021-10-11 10:39:38 +02:00
parent 009b77c1b9
commit 20674f7126
16 changed files with 458 additions and 87 deletions

View File

@ -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(),