pub type R = crate::R<CTRLrs>;
pub type W = crate::W<CTRLrs>;
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum WDOGRMODE {
Disabled = 0,
Limited = 1,
Extended = 2,
Full = 4,
}
impl From<WDOGRMODE> for u8 {
#[inline(always)]
fn from(variant: WDOGRMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for WDOGRMODE {
type Ux = u8;
}
impl crate::IsEnum for WDOGRMODE {}
pub type WdogrmodeR = crate::FieldReader<WDOGRMODE>;
impl WdogrmodeR {
#[inline(always)]
pub const fn variant(&self) -> Option<WDOGRMODE> {
match self.bits {
0 => Some(WDOGRMODE::Disabled),
1 => Some(WDOGRMODE::Limited),
2 => Some(WDOGRMODE::Extended),
4 => Some(WDOGRMODE::Full),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == WDOGRMODE::Disabled
}
#[inline(always)]
pub fn is_limited(&self) -> bool {
*self == WDOGRMODE::Limited
}
#[inline(always)]
pub fn is_extended(&self) -> bool {
*self == WDOGRMODE::Extended
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == WDOGRMODE::Full
}
}
pub type WdogrmodeW<'a, REG> = crate::FieldWriter<'a, REG, 3, WDOGRMODE>;
impl<'a, REG> WdogrmodeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(WDOGRMODE::Disabled)
}
#[inline(always)]
pub fn limited(self) -> &'a mut crate::W<REG> {
self.variant(WDOGRMODE::Limited)
}
#[inline(always)]
pub fn extended(self) -> &'a mut crate::W<REG> {
self.variant(WDOGRMODE::Extended)
}
#[inline(always)]
pub fn full(self) -> &'a mut crate::W<REG> {
self.variant(WDOGRMODE::Full)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum LOCKUPRMODE {
Disabled = 0,
Limited = 1,
Extended = 2,
Full = 4,
}
impl From<LOCKUPRMODE> for u8 {
#[inline(always)]
fn from(variant: LOCKUPRMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for LOCKUPRMODE {
type Ux = u8;
}
impl crate::IsEnum for LOCKUPRMODE {}
pub type LockuprmodeR = crate::FieldReader<LOCKUPRMODE>;
impl LockuprmodeR {
#[inline(always)]
pub const fn variant(&self) -> Option<LOCKUPRMODE> {
match self.bits {
0 => Some(LOCKUPRMODE::Disabled),
1 => Some(LOCKUPRMODE::Limited),
2 => Some(LOCKUPRMODE::Extended),
4 => Some(LOCKUPRMODE::Full),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == LOCKUPRMODE::Disabled
}
#[inline(always)]
pub fn is_limited(&self) -> bool {
*self == LOCKUPRMODE::Limited
}
#[inline(always)]
pub fn is_extended(&self) -> bool {
*self == LOCKUPRMODE::Extended
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == LOCKUPRMODE::Full
}
}
pub type LockuprmodeW<'a, REG> = crate::FieldWriter<'a, REG, 3, LOCKUPRMODE>;
impl<'a, REG> LockuprmodeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(LOCKUPRMODE::Disabled)
}
#[inline(always)]
pub fn limited(self) -> &'a mut crate::W<REG> {
self.variant(LOCKUPRMODE::Limited)
}
#[inline(always)]
pub fn extended(self) -> &'a mut crate::W<REG> {
self.variant(LOCKUPRMODE::Extended)
}
#[inline(always)]
pub fn full(self) -> &'a mut crate::W<REG> {
self.variant(LOCKUPRMODE::Full)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SYSRMODE {
Disabled = 0,
Limited = 1,
Extended = 2,
Full = 4,
}
impl From<SYSRMODE> for u8 {
#[inline(always)]
fn from(variant: SYSRMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for SYSRMODE {
type Ux = u8;
}
impl crate::IsEnum for SYSRMODE {}
pub type SysrmodeR = crate::FieldReader<SYSRMODE>;
impl SysrmodeR {
#[inline(always)]
pub const fn variant(&self) -> Option<SYSRMODE> {
match self.bits {
0 => Some(SYSRMODE::Disabled),
1 => Some(SYSRMODE::Limited),
2 => Some(SYSRMODE::Extended),
4 => Some(SYSRMODE::Full),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == SYSRMODE::Disabled
}
#[inline(always)]
pub fn is_limited(&self) -> bool {
*self == SYSRMODE::Limited
}
#[inline(always)]
pub fn is_extended(&self) -> bool {
*self == SYSRMODE::Extended
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == SYSRMODE::Full
}
}
pub type SysrmodeW<'a, REG> = crate::FieldWriter<'a, REG, 3, SYSRMODE>;
impl<'a, REG> SysrmodeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(SYSRMODE::Disabled)
}
#[inline(always)]
pub fn limited(self) -> &'a mut crate::W<REG> {
self.variant(SYSRMODE::Limited)
}
#[inline(always)]
pub fn extended(self) -> &'a mut crate::W<REG> {
self.variant(SYSRMODE::Extended)
}
#[inline(always)]
pub fn full(self) -> &'a mut crate::W<REG> {
self.variant(SYSRMODE::Full)
}
}
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum PINRMODE {
Disabled = 0,
Limited = 1,
Extended = 2,
Full = 4,
}
impl From<PINRMODE> for u8 {
#[inline(always)]
fn from(variant: PINRMODE) -> Self {
variant as _
}
}
impl crate::FieldSpec for PINRMODE {
type Ux = u8;
}
impl crate::IsEnum for PINRMODE {}
pub type PinrmodeR = crate::FieldReader<PINRMODE>;
impl PinrmodeR {
#[inline(always)]
pub const fn variant(&self) -> Option<PINRMODE> {
match self.bits {
0 => Some(PINRMODE::Disabled),
1 => Some(PINRMODE::Limited),
2 => Some(PINRMODE::Extended),
4 => Some(PINRMODE::Full),
_ => None,
}
}
#[inline(always)]
pub fn is_disabled(&self) -> bool {
*self == PINRMODE::Disabled
}
#[inline(always)]
pub fn is_limited(&self) -> bool {
*self == PINRMODE::Limited
}
#[inline(always)]
pub fn is_extended(&self) -> bool {
*self == PINRMODE::Extended
}
#[inline(always)]
pub fn is_full(&self) -> bool {
*self == PINRMODE::Full
}
}
pub type PinrmodeW<'a, REG> = crate::FieldWriter<'a, REG, 3, PINRMODE>;
impl<'a, REG> PinrmodeW<'a, REG>
where
REG: crate::Writable + crate::RegisterSpec,
REG::Ux: From<u8>,
{
#[inline(always)]
pub fn disabled(self) -> &'a mut crate::W<REG> {
self.variant(PINRMODE::Disabled)
}
#[inline(always)]
pub fn limited(self) -> &'a mut crate::W<REG> {
self.variant(PINRMODE::Limited)
}
#[inline(always)]
pub fn extended(self) -> &'a mut crate::W<REG> {
self.variant(PINRMODE::Extended)
}
#[inline(always)]
pub fn full(self) -> &'a mut crate::W<REG> {
self.variant(PINRMODE::Full)
}
}
pub type ResetstateR = crate::FieldReader;
pub type ResetstateW<'a, REG> = crate::FieldWriter<'a, REG, 2>;
impl R {
#[inline(always)]
pub fn wdogrmode(&self) -> WdogrmodeR {
WdogrmodeR::new((self.bits & 7) as u8)
}
#[inline(always)]
pub fn lockuprmode(&self) -> LockuprmodeR {
LockuprmodeR::new(((self.bits >> 4) & 7) as u8)
}
#[inline(always)]
pub fn sysrmode(&self) -> SysrmodeR {
SysrmodeR::new(((self.bits >> 8) & 7) as u8)
}
#[inline(always)]
pub fn pinrmode(&self) -> PinrmodeR {
PinrmodeR::new(((self.bits >> 12) & 7) as u8)
}
#[inline(always)]
pub fn resetstate(&self) -> ResetstateR {
ResetstateR::new(((self.bits >> 24) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("CTRL")
.field("wdogrmode", &self.wdogrmode())
.field("lockuprmode", &self.lockuprmode())
.field("sysrmode", &self.sysrmode())
.field("pinrmode", &self.pinrmode())
.field("resetstate", &self.resetstate())
.finish()
}
}
impl W {
#[inline(always)]
pub fn wdogrmode(&mut self) -> WdogrmodeW<'_, CTRLrs> {
WdogrmodeW::new(self, 0)
}
#[inline(always)]
pub fn lockuprmode(&mut self) -> LockuprmodeW<'_, CTRLrs> {
LockuprmodeW::new(self, 4)
}
#[inline(always)]
pub fn sysrmode(&mut self) -> SysrmodeW<'_, CTRLrs> {
SysrmodeW::new(self, 8)
}
#[inline(always)]
pub fn pinrmode(&mut self) -> PinrmodeW<'_, CTRLrs> {
PinrmodeW::new(self, 12)
}
#[inline(always)]
pub fn resetstate(&mut self) -> ResetstateW<'_, CTRLrs> {
ResetstateW::new(self, 24)
}
}
pub struct CTRLrs;
impl crate::RegisterSpec for CTRLrs {
type Ux = u32;
}
impl crate::Readable for CTRLrs {}
impl crate::Writable for CTRLrs {
type Safety = crate::Unsafe;
}
impl crate::Resettable for CTRLrs {
const RESET_VALUE: u32 = 0x4224;
}