#[doc = "Register `WDTCONFIG0` reader"]
pub struct R(crate::R<WDTCONFIG0_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<WDTCONFIG0_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::convert::From<crate::R<WDTCONFIG0_SPEC>> for R {
fn from(reader: crate::R<WDTCONFIG0_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Register `WDTCONFIG0` writer"]
pub struct W(crate::W<WDTCONFIG0_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<WDTCONFIG0_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl core::convert::From<crate::W<WDTCONFIG0_SPEC>> for W {
fn from(writer: crate::W<WDTCONFIG0_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `WDT_EN` reader - "]
pub struct WDT_EN_R(crate::FieldReader<bool, bool>);
impl WDT_EN_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_EN` writer - "]
pub struct WDT_EN_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_EN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 31)) | (((value as u32) & 0x01) << 31);
self.w
}
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum WDT_STG0_A {
#[doc = "0: Disabled"]
DISABLE = 0,
#[doc = "1: Trigger an interrupt"]
INTERRUPT = 1,
#[doc = "2: Reset CPU core"]
RESETCPU = 2,
#[doc = "3: Reset System, but not RTC"]
RESETSYSTEM = 3,
#[doc = "4: Reset System & RTC"]
RESETRTC = 4,
}
impl From<WDT_STG0_A> for u8 {
#[inline(always)]
fn from(variant: WDT_STG0_A) -> Self {
variant as _
}
}
#[doc = "Field `WDT_STG0` reader - "]
pub struct WDT_STG0_R(crate::FieldReader<u8, WDT_STG0_A>);
impl WDT_STG0_R {
pub(crate) fn new(bits: u8) -> Self {
WDT_STG0_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> crate::Variant<u8, WDT_STG0_A> {
use crate::Variant::*;
match self.bits {
0 => Val(WDT_STG0_A::DISABLE),
1 => Val(WDT_STG0_A::INTERRUPT),
2 => Val(WDT_STG0_A::RESETCPU),
3 => Val(WDT_STG0_A::RESETSYSTEM),
4 => Val(WDT_STG0_A::RESETRTC),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `DISABLE`"]
#[inline(always)]
pub fn is_disable(&self) -> bool {
**self == WDT_STG0_A::DISABLE
}
#[doc = "Checks if the value of the field is `INTERRUPT`"]
#[inline(always)]
pub fn is_interrupt(&self) -> bool {
**self == WDT_STG0_A::INTERRUPT
}
#[doc = "Checks if the value of the field is `RESETCPU`"]
#[inline(always)]
pub fn is_reset_cpu(&self) -> bool {
**self == WDT_STG0_A::RESETCPU
}
#[doc = "Checks if the value of the field is `RESETSYSTEM`"]
#[inline(always)]
pub fn is_reset_system(&self) -> bool {
**self == WDT_STG0_A::RESETSYSTEM
}
#[doc = "Checks if the value of the field is `RESETRTC`"]
#[inline(always)]
pub fn is_reset_rtc(&self) -> bool {
**self == WDT_STG0_A::RESETRTC
}
}
impl core::ops::Deref for WDT_STG0_R {
type Target = crate::FieldReader<u8, WDT_STG0_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_STG0` writer - "]
pub struct WDT_STG0_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG0_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WDT_STG0_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Disabled"]
#[inline(always)]
pub fn disable(self) -> &'a mut W {
self.variant(WDT_STG0_A::DISABLE)
}
#[doc = "Trigger an interrupt"]
#[inline(always)]
pub fn interrupt(self) -> &'a mut W {
self.variant(WDT_STG0_A::INTERRUPT)
}
#[doc = "Reset CPU core"]
#[inline(always)]
pub fn reset_cpu(self) -> &'a mut W {
self.variant(WDT_STG0_A::RESETCPU)
}
#[doc = "Reset System, but not RTC"]
#[inline(always)]
pub fn reset_system(self) -> &'a mut W {
self.variant(WDT_STG0_A::RESETSYSTEM)
}
#[doc = "Reset System & RTC"]
#[inline(always)]
pub fn reset_rtc(self) -> &'a mut W {
self.variant(WDT_STG0_A::RESETRTC)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 28)) | (((value as u32) & 0x07) << 28);
self.w
}
}
#[doc = ""]
pub type WDT_STG1_A = WDT_STG0_A;
#[doc = "Field `WDT_STG1` reader - "]
pub type WDT_STG1_R = WDT_STG0_R;
#[doc = "Field `WDT_STG1` writer - "]
pub struct WDT_STG1_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG1_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WDT_STG1_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Disabled"]
#[inline(always)]
pub fn disable(self) -> &'a mut W {
self.variant(WDT_STG1_A::DISABLE)
}
#[doc = "Trigger an interrupt"]
#[inline(always)]
pub fn interrupt(self) -> &'a mut W {
self.variant(WDT_STG1_A::INTERRUPT)
}
#[doc = "Reset CPU core"]
#[inline(always)]
pub fn reset_cpu(self) -> &'a mut W {
self.variant(WDT_STG1_A::RESETCPU)
}
#[doc = "Reset System, but not RTC"]
#[inline(always)]
pub fn reset_system(self) -> &'a mut W {
self.variant(WDT_STG1_A::RESETSYSTEM)
}
#[doc = "Reset System & RTC"]
#[inline(always)]
pub fn reset_rtc(self) -> &'a mut W {
self.variant(WDT_STG1_A::RESETRTC)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 25)) | (((value as u32) & 0x07) << 25);
self.w
}
}
#[doc = ""]
pub type WDT_STG2_A = WDT_STG0_A;
#[doc = "Field `WDT_STG2` reader - "]
pub type WDT_STG2_R = WDT_STG0_R;
#[doc = "Field `WDT_STG2` writer - "]
pub struct WDT_STG2_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG2_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WDT_STG2_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Disabled"]
#[inline(always)]
pub fn disable(self) -> &'a mut W {
self.variant(WDT_STG2_A::DISABLE)
}
#[doc = "Trigger an interrupt"]
#[inline(always)]
pub fn interrupt(self) -> &'a mut W {
self.variant(WDT_STG2_A::INTERRUPT)
}
#[doc = "Reset CPU core"]
#[inline(always)]
pub fn reset_cpu(self) -> &'a mut W {
self.variant(WDT_STG2_A::RESETCPU)
}
#[doc = "Reset System, but not RTC"]
#[inline(always)]
pub fn reset_system(self) -> &'a mut W {
self.variant(WDT_STG2_A::RESETSYSTEM)
}
#[doc = "Reset System & RTC"]
#[inline(always)]
pub fn reset_rtc(self) -> &'a mut W {
self.variant(WDT_STG2_A::RESETRTC)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 22)) | (((value as u32) & 0x07) << 22);
self.w
}
}
#[doc = ""]
pub type WDT_STG3_A = WDT_STG0_A;
#[doc = "Field `WDT_STG3` reader - "]
pub type WDT_STG3_R = WDT_STG0_R;
#[doc = "Field `WDT_STG3` writer - "]
pub struct WDT_STG3_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG3_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WDT_STG3_A) -> &'a mut W {
unsafe { self.bits(variant.into()) }
}
#[doc = "Disabled"]
#[inline(always)]
pub fn disable(self) -> &'a mut W {
self.variant(WDT_STG3_A::DISABLE)
}
#[doc = "Trigger an interrupt"]
#[inline(always)]
pub fn interrupt(self) -> &'a mut W {
self.variant(WDT_STG3_A::INTERRUPT)
}
#[doc = "Reset CPU core"]
#[inline(always)]
pub fn reset_cpu(self) -> &'a mut W {
self.variant(WDT_STG3_A::RESETCPU)
}
#[doc = "Reset System, but not RTC"]
#[inline(always)]
pub fn reset_system(self) -> &'a mut W {
self.variant(WDT_STG3_A::RESETSYSTEM)
}
#[doc = "Reset System & RTC"]
#[inline(always)]
pub fn reset_rtc(self) -> &'a mut W {
self.variant(WDT_STG3_A::RESETRTC)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 19)) | (((value as u32) & 0x07) << 19);
self.w
}
}
#[doc = "Field `WDT_EDGE_INT_EN` reader - "]
pub struct WDT_EDGE_INT_EN_R(crate::FieldReader<bool, bool>);
impl WDT_EDGE_INT_EN_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_EDGE_INT_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_EDGE_INT_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_EDGE_INT_EN` writer - "]
pub struct WDT_EDGE_INT_EN_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_EDGE_INT_EN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 18)) | (((value as u32) & 0x01) << 18);
self.w
}
}
#[doc = "Field `WDT_LEVEL_INT_EN` reader - "]
pub struct WDT_LEVEL_INT_EN_R(crate::FieldReader<bool, bool>);
impl WDT_LEVEL_INT_EN_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_LEVEL_INT_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_LEVEL_INT_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_LEVEL_INT_EN` writer - "]
pub struct WDT_LEVEL_INT_EN_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_LEVEL_INT_EN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 17)) | (((value as u32) & 0x01) << 17);
self.w
}
}
#[doc = "\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum WDT_CPU_RESET_LENGTH_A {
#[doc = "0: 100ns"]
T100NS = 0,
#[doc = "1: 200ns"]
T200NS = 1,
#[doc = "2: 300ns"]
T300NS = 2,
#[doc = "3: 400ns"]
T400NS = 3,
#[doc = "4: 500ns"]
T500NS = 4,
#[doc = "5: 800ns"]
T800NS = 5,
#[doc = "6: 1600ns"]
T1600NS = 6,
#[doc = "7: 3200ns"]
T3200NS = 7,
}
impl From<WDT_CPU_RESET_LENGTH_A> for u8 {
#[inline(always)]
fn from(variant: WDT_CPU_RESET_LENGTH_A) -> Self {
variant as _
}
}
#[doc = "Field `WDT_CPU_RESET_LENGTH` reader - "]
pub struct WDT_CPU_RESET_LENGTH_R(crate::FieldReader<u8, WDT_CPU_RESET_LENGTH_A>);
impl WDT_CPU_RESET_LENGTH_R {
pub(crate) fn new(bits: u8) -> Self {
WDT_CPU_RESET_LENGTH_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> WDT_CPU_RESET_LENGTH_A {
match self.bits {
0 => WDT_CPU_RESET_LENGTH_A::T100NS,
1 => WDT_CPU_RESET_LENGTH_A::T200NS,
2 => WDT_CPU_RESET_LENGTH_A::T300NS,
3 => WDT_CPU_RESET_LENGTH_A::T400NS,
4 => WDT_CPU_RESET_LENGTH_A::T500NS,
5 => WDT_CPU_RESET_LENGTH_A::T800NS,
6 => WDT_CPU_RESET_LENGTH_A::T1600NS,
7 => WDT_CPU_RESET_LENGTH_A::T3200NS,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `T100NS`"]
#[inline(always)]
pub fn is_t100ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T100NS
}
#[doc = "Checks if the value of the field is `T200NS`"]
#[inline(always)]
pub fn is_t200ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T200NS
}
#[doc = "Checks if the value of the field is `T300NS`"]
#[inline(always)]
pub fn is_t300ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T300NS
}
#[doc = "Checks if the value of the field is `T400NS`"]
#[inline(always)]
pub fn is_t400ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T400NS
}
#[doc = "Checks if the value of the field is `T500NS`"]
#[inline(always)]
pub fn is_t500ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T500NS
}
#[doc = "Checks if the value of the field is `T800NS`"]
#[inline(always)]
pub fn is_t800ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T800NS
}
#[doc = "Checks if the value of the field is `T1600NS`"]
#[inline(always)]
pub fn is_t1600ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T1600NS
}
#[doc = "Checks if the value of the field is `T3200NS`"]
#[inline(always)]
pub fn is_t3200ns(&self) -> bool {
**self == WDT_CPU_RESET_LENGTH_A::T3200NS
}
}
impl core::ops::Deref for WDT_CPU_RESET_LENGTH_R {
type Target = crate::FieldReader<u8, WDT_CPU_RESET_LENGTH_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_CPU_RESET_LENGTH` writer - "]
pub struct WDT_CPU_RESET_LENGTH_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_CPU_RESET_LENGTH_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WDT_CPU_RESET_LENGTH_A) -> &'a mut W {
self.bits(variant.into())
}
#[doc = "100ns"]
#[inline(always)]
pub fn t100ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T100NS)
}
#[doc = "200ns"]
#[inline(always)]
pub fn t200ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T200NS)
}
#[doc = "300ns"]
#[inline(always)]
pub fn t300ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T300NS)
}
#[doc = "400ns"]
#[inline(always)]
pub fn t400ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T400NS)
}
#[doc = "500ns"]
#[inline(always)]
pub fn t500ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T500NS)
}
#[doc = "800ns"]
#[inline(always)]
pub fn t800ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T800NS)
}
#[doc = "1600ns"]
#[inline(always)]
pub fn t1600ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T1600NS)
}
#[doc = "3200ns"]
#[inline(always)]
pub fn t3200ns(self) -> &'a mut W {
self.variant(WDT_CPU_RESET_LENGTH_A::T3200NS)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 14)) | (((value as u32) & 0x07) << 14);
self.w
}
}
#[doc = ""]
pub type WDT_SYS_RESET_LENGTH_A = WDT_CPU_RESET_LENGTH_A;
#[doc = "Field `WDT_SYS_RESET_LENGTH` reader - "]
pub type WDT_SYS_RESET_LENGTH_R = WDT_CPU_RESET_LENGTH_R;
#[doc = "Field `WDT_SYS_RESET_LENGTH` writer - "]
pub struct WDT_SYS_RESET_LENGTH_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_SYS_RESET_LENGTH_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: WDT_SYS_RESET_LENGTH_A) -> &'a mut W {
self.bits(variant.into())
}
#[doc = "100ns"]
#[inline(always)]
pub fn t100ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T100NS)
}
#[doc = "200ns"]
#[inline(always)]
pub fn t200ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T200NS)
}
#[doc = "300ns"]
#[inline(always)]
pub fn t300ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T300NS)
}
#[doc = "400ns"]
#[inline(always)]
pub fn t400ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T400NS)
}
#[doc = "500ns"]
#[inline(always)]
pub fn t500ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T500NS)
}
#[doc = "800ns"]
#[inline(always)]
pub fn t800ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T800NS)
}
#[doc = "1600ns"]
#[inline(always)]
pub fn t1600ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T1600NS)
}
#[doc = "3200ns"]
#[inline(always)]
pub fn t3200ns(self) -> &'a mut W {
self.variant(WDT_SYS_RESET_LENGTH_A::T3200NS)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x07 << 11)) | (((value as u32) & 0x07) << 11);
self.w
}
}
#[doc = "Field `WDT_FLASHBOOT_MOD_EN` reader - "]
pub struct WDT_FLASHBOOT_MOD_EN_R(crate::FieldReader<bool, bool>);
impl WDT_FLASHBOOT_MOD_EN_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_FLASHBOOT_MOD_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_FLASHBOOT_MOD_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_FLASHBOOT_MOD_EN` writer - "]
pub struct WDT_FLASHBOOT_MOD_EN_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_FLASHBOOT_MOD_EN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 10)) | (((value as u32) & 0x01) << 10);
self.w
}
}
#[doc = "Field `WDT_PROCPU_RESET_EN` reader - "]
pub struct WDT_PROCPU_RESET_EN_R(crate::FieldReader<bool, bool>);
impl WDT_PROCPU_RESET_EN_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_PROCPU_RESET_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_PROCPU_RESET_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_PROCPU_RESET_EN` writer - "]
pub struct WDT_PROCPU_RESET_EN_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_PROCPU_RESET_EN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 9)) | (((value as u32) & 0x01) << 9);
self.w
}
}
#[doc = "Field `WDT_APPCPU_RESET_EN` reader - "]
pub struct WDT_APPCPU_RESET_EN_R(crate::FieldReader<bool, bool>);
impl WDT_APPCPU_RESET_EN_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_APPCPU_RESET_EN_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_APPCPU_RESET_EN_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_APPCPU_RESET_EN` writer - "]
pub struct WDT_APPCPU_RESET_EN_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_APPCPU_RESET_EN_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 8)) | (((value as u32) & 0x01) << 8);
self.w
}
}
#[doc = "Field `WDT_PAUSE_IN_SLP` reader - "]
pub struct WDT_PAUSE_IN_SLP_R(crate::FieldReader<bool, bool>);
impl WDT_PAUSE_IN_SLP_R {
pub(crate) fn new(bits: bool) -> Self {
WDT_PAUSE_IN_SLP_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for WDT_PAUSE_IN_SLP_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `WDT_PAUSE_IN_SLP` writer - "]
pub struct WDT_PAUSE_IN_SLP_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_PAUSE_IN_SLP_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 7)) | (((value as u32) & 0x01) << 7);
self.w
}
}
impl R {
#[doc = "Bit 31"]
#[inline(always)]
pub fn wdt_en(&self) -> WDT_EN_R {
WDT_EN_R::new(((self.bits >> 31) & 0x01) != 0)
}
#[doc = "Bits 28:30"]
#[inline(always)]
pub fn wdt_stg0(&self) -> WDT_STG0_R {
WDT_STG0_R::new(((self.bits >> 28) & 0x07) as u8)
}
#[doc = "Bits 25:27"]
#[inline(always)]
pub fn wdt_stg1(&self) -> WDT_STG1_R {
WDT_STG1_R::new(((self.bits >> 25) & 0x07) as u8)
}
#[doc = "Bits 22:24"]
#[inline(always)]
pub fn wdt_stg2(&self) -> WDT_STG2_R {
WDT_STG2_R::new(((self.bits >> 22) & 0x07) as u8)
}
#[doc = "Bits 19:21"]
#[inline(always)]
pub fn wdt_stg3(&self) -> WDT_STG3_R {
WDT_STG3_R::new(((self.bits >> 19) & 0x07) as u8)
}
#[doc = "Bit 18"]
#[inline(always)]
pub fn wdt_edge_int_en(&self) -> WDT_EDGE_INT_EN_R {
WDT_EDGE_INT_EN_R::new(((self.bits >> 18) & 0x01) != 0)
}
#[doc = "Bit 17"]
#[inline(always)]
pub fn wdt_level_int_en(&self) -> WDT_LEVEL_INT_EN_R {
WDT_LEVEL_INT_EN_R::new(((self.bits >> 17) & 0x01) != 0)
}
#[doc = "Bits 14:16"]
#[inline(always)]
pub fn wdt_cpu_reset_length(&self) -> WDT_CPU_RESET_LENGTH_R {
WDT_CPU_RESET_LENGTH_R::new(((self.bits >> 14) & 0x07) as u8)
}
#[doc = "Bits 11:13"]
#[inline(always)]
pub fn wdt_sys_reset_length(&self) -> WDT_SYS_RESET_LENGTH_R {
WDT_SYS_RESET_LENGTH_R::new(((self.bits >> 11) & 0x07) as u8)
}
#[doc = "Bit 10"]
#[inline(always)]
pub fn wdt_flashboot_mod_en(&self) -> WDT_FLASHBOOT_MOD_EN_R {
WDT_FLASHBOOT_MOD_EN_R::new(((self.bits >> 10) & 0x01) != 0)
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn wdt_procpu_reset_en(&self) -> WDT_PROCPU_RESET_EN_R {
WDT_PROCPU_RESET_EN_R::new(((self.bits >> 9) & 0x01) != 0)
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn wdt_appcpu_reset_en(&self) -> WDT_APPCPU_RESET_EN_R {
WDT_APPCPU_RESET_EN_R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bit 7"]
#[inline(always)]
pub fn wdt_pause_in_slp(&self) -> WDT_PAUSE_IN_SLP_R {
WDT_PAUSE_IN_SLP_R::new(((self.bits >> 7) & 0x01) != 0)
}
}
impl W {
#[doc = "Bit 31"]
#[inline(always)]
pub fn wdt_en(&mut self) -> WDT_EN_W {
WDT_EN_W { w: self }
}
#[doc = "Bits 28:30"]
#[inline(always)]
pub fn wdt_stg0(&mut self) -> WDT_STG0_W {
WDT_STG0_W { w: self }
}
#[doc = "Bits 25:27"]
#[inline(always)]
pub fn wdt_stg1(&mut self) -> WDT_STG1_W {
WDT_STG1_W { w: self }
}
#[doc = "Bits 22:24"]
#[inline(always)]
pub fn wdt_stg2(&mut self) -> WDT_STG2_W {
WDT_STG2_W { w: self }
}
#[doc = "Bits 19:21"]
#[inline(always)]
pub fn wdt_stg3(&mut self) -> WDT_STG3_W {
WDT_STG3_W { w: self }
}
#[doc = "Bit 18"]
#[inline(always)]
pub fn wdt_edge_int_en(&mut self) -> WDT_EDGE_INT_EN_W {
WDT_EDGE_INT_EN_W { w: self }
}
#[doc = "Bit 17"]
#[inline(always)]
pub fn wdt_level_int_en(&mut self) -> WDT_LEVEL_INT_EN_W {
WDT_LEVEL_INT_EN_W { w: self }
}
#[doc = "Bits 14:16"]
#[inline(always)]
pub fn wdt_cpu_reset_length(&mut self) -> WDT_CPU_RESET_LENGTH_W {
WDT_CPU_RESET_LENGTH_W { w: self }
}
#[doc = "Bits 11:13"]
#[inline(always)]
pub fn wdt_sys_reset_length(&mut self) -> WDT_SYS_RESET_LENGTH_W {
WDT_SYS_RESET_LENGTH_W { w: self }
}
#[doc = "Bit 10"]
#[inline(always)]
pub fn wdt_flashboot_mod_en(&mut self) -> WDT_FLASHBOOT_MOD_EN_W {
WDT_FLASHBOOT_MOD_EN_W { w: self }
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn wdt_procpu_reset_en(&mut self) -> WDT_PROCPU_RESET_EN_W {
WDT_PROCPU_RESET_EN_W { w: self }
}
#[doc = "Bit 8"]
#[inline(always)]
pub fn wdt_appcpu_reset_en(&mut self) -> WDT_APPCPU_RESET_EN_W {
WDT_APPCPU_RESET_EN_W { w: self }
}
#[doc = "Bit 7"]
#[inline(always)]
pub fn wdt_pause_in_slp(&mut self) -> WDT_PAUSE_IN_SLP_W {
WDT_PAUSE_IN_SLP_W { w: self }
}
#[doc = "Writes raw bits to the register."]
pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "RTC_CNTL_WDTCONFIG0\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [wdtconfig0](index.html) module"]
pub struct WDTCONFIG0_SPEC;
impl crate::RegisterSpec for WDTCONFIG0_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [wdtconfig0::R](R) reader structure"]
impl crate::Readable for WDTCONFIG0_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [wdtconfig0::W](W) writer structure"]
impl crate::Writable for WDTCONFIG0_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets WDTCONFIG0 to value 0"]
impl crate::Resettable for WDTCONFIG0_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}