This commit is contained in:
Dion Dokter 2021-10-11 15:31:25 +02:00
parent 4643727fea
commit 995cd01cbc
6 changed files with 12 additions and 9 deletions

View file

@ -17,7 +17,7 @@ use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin};
use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task};
use crate::timer::Instance as TimerInstance; use crate::timer::Instance as TimerInstance;
use crate::timer::{Frequency, Timer}; use crate::timer::{Frequency, Timer};
use crate::uarte::{Config, Instance as UarteInstance, uarte0}; use crate::uarte::{uarte0, Config, Instance as UarteInstance};
// Re-export SVD variants to allow user to directly set values // Re-export SVD variants to allow user to directly set values
pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity};

View file

@ -79,10 +79,10 @@ pub(crate) use chip::pac;
pub use chip::{peripherals, Peripherals}; pub use chip::{peripherals, Peripherals};
#[cfg(feature = "nrf9160")]
use crate::pac::CLOCK_NS as CLOCK;
#[cfg(not(feature = "nrf9160"))] #[cfg(not(feature = "nrf9160"))]
use crate::pac::CLOCK; use crate::pac::CLOCK;
#[cfg(feature = "nrf9160")]
use crate::pac::CLOCK_NS as CLOCK;
pub mod interrupt { pub mod interrupt {
pub use crate::chip::irqs::*; pub use crate::chip::irqs::*;

View file

@ -18,10 +18,10 @@ use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
use crate::{pac, peripherals}; use crate::{pac, peripherals};
#[cfg(not(feature = "nrf9160"))]
pub(crate) use pac::PPI;
#[cfg(feature = "nrf9160")] #[cfg(feature = "nrf9160")]
pub(crate) use pac::DPPIC_NS as PPI; pub(crate) use pac::DPPIC_NS as PPI;
#[cfg(not(feature = "nrf9160"))]
pub(crate) use pac::PPI;
// ====================== // ======================
// driver // driver

View file

@ -16,7 +16,6 @@ pub(crate) use pac::pwm0;
#[cfg(feature = "nrf9160")] #[cfg(feature = "nrf9160")]
pub(crate) use pac::pwm0_ns as pwm0; pub(crate) use pac::pwm0_ns as pwm0;
#[derive(Debug, Eq, PartialEq, Clone, Copy)] #[derive(Debug, Eq, PartialEq, Clone, Copy)]
pub enum Prescaler { pub enum Prescaler {
Div1, Div1,

View file

@ -16,9 +16,13 @@ pub(crate) use pac::rtc0_ns as rtc0;
fn rtc() -> &'static rtc0::RegisterBlock { fn rtc() -> &'static rtc0::RegisterBlock {
#[cfg(not(feature = "nrf9160"))] #[cfg(not(feature = "nrf9160"))]
unsafe { &*pac::RTC1::ptr() } unsafe {
&*pac::RTC1::ptr()
}
#[cfg(feature = "nrf9160")] #[cfg(feature = "nrf9160")]
unsafe { &*pac::RTC1_NS::ptr() } unsafe {
&*pac::RTC1_NS::ptr()
}
} }
// RTC timekeeping works with something we call "periods", which are time intervals // RTC timekeeping works with something we call "periods", which are time intervals

View file

@ -184,7 +184,7 @@ impl<'d, T: Instance> Twim<'d, T> {
// The PTR field is a full 32 bits wide and accepts the full range // The PTR field is a full 32 bits wide and accepts the full range
// of values. // of values.
w.ptr().bits(buffer.as_mut_ptr() as u32)); w.ptr().bits(buffer.as_mut_ptr() as u32));
r.rxd.maxcnt.write(|w| r.rxd.maxcnt.write(|w|
// We're giving it the length of the buffer, so no danger of // We're giving it the length of the buffer, so no danger of
// accessing invalid memory. We have verified that the length of the // accessing invalid memory. We have verified that the length of the
// buffer fits in an `u8`, so the cast to the type of maxcnt // buffer fits in an `u8`, so the cast to the type of maxcnt