#![allow(clippy::identity_op)]
#![allow(clippy::module_inception)]
#![allow(clippy::derivable_impls)]
#[allow(unused_imports)]
use crate::common::sealed;
#[allow(unused_imports)]
use crate::common::*;
#[doc = r"CPU Control Registers"]
unsafe impl ::core::marker::Send for super::CpuCtrlNs {}
unsafe impl ::core::marker::Sync for super::CpuCtrlNs {}
impl super::CpuCtrlNs {
#[allow(unused)]
#[inline(always)]
pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
self.ptr
}
#[doc = "CPU Lockup Control Register"]
#[inline(always)]
pub const fn cpulckupcr(
&self,
) -> &'static crate::common::Reg<self::Cpulckupcr_SPEC, crate::common::RW> {
unsafe {
crate::common::Reg::<self::Cpulckupcr_SPEC, crate::common::RW>::from_ptr(
self._svd2pac_as_ptr().add(48usize),
)
}
}
#[doc = "CPU Non-secure Function Lock Control Register"]
#[inline(always)]
pub const fn cpulockcrns(
&self,
) -> &'static crate::common::Reg<self::Cpulockcrns_SPEC, crate::common::RW> {
unsafe {
crate::common::Reg::<self::Cpulockcrns_SPEC, crate::common::RW>::from_ptr(
self._svd2pac_as_ptr().add(1280usize),
)
}
}
#[doc = "CPU Control Register Protection Register"]
#[inline(always)]
pub const fn cpucrpt(
&self,
) -> &'static crate::common::Reg<self::Cpucrpt_SPEC, crate::common::RW> {
unsafe {
crate::common::Reg::<self::Cpucrpt_SPEC, crate::common::RW>::from_ptr(
self._svd2pac_as_ptr().add(2112usize),
)
}
}
}
#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cpulckupcr_SPEC;
impl crate::sealed::RegSpec for Cpulckupcr_SPEC {
type DataType = u8;
}
#[doc = "CPU Lockup Control Register"]
pub type Cpulckupcr = crate::RegValueT<Cpulckupcr_SPEC>;
impl Cpulckupcr {
#[doc = "Operation after detection of CPU lockup"]
#[inline(always)]
pub fn oad(
self,
) -> crate::common::RegisterField<
0,
0x1,
1,
0,
cpulckupcr::Oad,
cpulckupcr::Oad,
Cpulckupcr_SPEC,
crate::common::RW,
> {
crate::common::RegisterField::<
0,
0x1,
1,
0,
cpulckupcr::Oad,
cpulckupcr::Oad,
Cpulckupcr_SPEC,
crate::common::RW,
>::from_register(self, 0)
}
}
impl ::core::default::Default for Cpulckupcr {
#[inline(always)]
fn default() -> Cpulckupcr {
<crate::RegValueT<Cpulckupcr_SPEC> as RegisterValue<_>>::new(0)
}
}
pub mod cpulckupcr {
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
pub struct Oad_SPEC;
pub type Oad = crate::EnumBitfieldStruct<u8, Oad_SPEC>;
impl Oad {
#[doc = "Non-maskable Interrupt"]
pub const _0: Self = Self::new(0);
#[doc = "CPU Lockup reset"]
pub const _1: Self = Self::new(1);
}
}
#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cpulockcrns_SPEC;
impl crate::sealed::RegSpec for Cpulockcrns_SPEC {
type DataType = u8;
}
#[doc = "CPU Non-secure Function Lock Control Register"]
pub type Cpulockcrns = crate::RegValueT<Cpulockcrns_SPEC>;
impl Cpulockcrns {
#[inline(always)]
pub fn lcknsvtor(
self,
) -> crate::common::RegisterFieldBool<0, 1, 0, Cpulockcrns_SPEC, crate::common::RW> {
crate::common::RegisterFieldBool::<0,1,0,Cpulockcrns_SPEC,crate::common::RW>::from_register(self,0)
}
#[doc = "Disable writes to registers that are associated with the Non-secure MPU region from software or from a debug agent connected to the processor:"]
#[inline(always)]
pub fn lcknsmpu(
self,
) -> crate::common::RegisterFieldBool<1, 1, 0, Cpulockcrns_SPEC, crate::common::RW> {
crate::common::RegisterFieldBool::<1,1,0,Cpulockcrns_SPEC,crate::common::RW>::from_register(self,0)
}
}
impl ::core::default::Default for Cpulockcrns {
#[inline(always)]
fn default() -> Cpulockcrns {
<crate::RegValueT<Cpulockcrns_SPEC> as RegisterValue<_>>::new(0)
}
}
#[doc(hidden)]
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cpucrpt_SPEC;
impl crate::sealed::RegSpec for Cpucrpt_SPEC {
type DataType = u16;
}
#[doc = "CPU Control Register Protection Register"]
pub type Cpucrpt = crate::RegValueT<Cpucrpt_SPEC>;
impl Cpucrpt {
#[doc = "Protection of register"]
#[inline(always)]
pub fn protect(
self,
) -> crate::common::RegisterField<
0,
0x1,
1,
0,
cpucrpt::Protect,
cpucrpt::Protect,
Cpucrpt_SPEC,
crate::common::RW,
> {
crate::common::RegisterField::<
0,
0x1,
1,
0,
cpucrpt::Protect,
cpucrpt::Protect,
Cpucrpt_SPEC,
crate::common::RW,
>::from_register(self, 0)
}
#[doc = "The KEY\\[7:0\\] bits enable or disable writing to the PROTECT bit."]
#[inline(always)]
pub fn key(
self,
) -> crate::common::RegisterField<8, 0xff, 1, 0, u8, u8, Cpucrpt_SPEC, crate::common::W> {
crate::common::RegisterField::<8,0xff,1,0,u8,u8,Cpucrpt_SPEC,crate::common::W>::from_register(self,0)
}
}
impl ::core::default::Default for Cpucrpt {
#[inline(always)]
fn default() -> Cpucrpt {
<crate::RegValueT<Cpucrpt_SPEC> as RegisterValue<_>>::new(0)
}
}
pub mod cpucrpt {
#[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
pub struct Protect_SPEC;
pub type Protect = crate::EnumBitfieldStruct<u8, Protect_SPEC>;
impl Protect {
#[doc = "Writing to CPULCKUPCR register is permitted."]
pub const _0: Self = Self::new(0);
#[doc = "Writing to CPULCKUPCR register is not permitted. Read access is permitted."]
pub const _1: Self = Self::new(1);
}
}