#[doc = "Reader of register WDTCONFIG0"]
pub type R = crate::R<u32, super::WDTCONFIG0>;
#[doc = "Writer for register WDTCONFIG0"]
pub type W = crate::W<u32, super::WDTCONFIG0>;
#[doc = "Register WDTCONFIG0 `reset()`'s with value 0"]
impl crate::ResetValue for super::WDTCONFIG0 {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Reader of field `WDT_EN`"]
pub type WDT_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_EN`"]
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 = "Reader of field `WDT_STG0`"]
pub type WDT_STG0_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `WDT_STG0`"]
pub struct WDT_STG0_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG0_W<'a> {
#[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 = "Reader of field `WDT_STG1`"]
pub type WDT_STG1_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `WDT_STG1`"]
pub struct WDT_STG1_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG1_W<'a> {
#[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 = "Reader of field `WDT_STG2`"]
pub type WDT_STG2_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `WDT_STG2`"]
pub struct WDT_STG2_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG2_W<'a> {
#[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 = "Reader of field `WDT_STG3`"]
pub type WDT_STG3_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `WDT_STG3`"]
pub struct WDT_STG3_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_STG3_W<'a> {
#[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 = "Reader of field `WDT_EDGE_INT_EN`"]
pub type WDT_EDGE_INT_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_EDGE_INT_EN`"]
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 = "Reader of field `WDT_LEVEL_INT_EN`"]
pub type WDT_LEVEL_INT_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_LEVEL_INT_EN`"]
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 = "Reader of field `WDT_CPU_RESET_LENGTH`"]
pub type WDT_CPU_RESET_LENGTH_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `WDT_CPU_RESET_LENGTH`"]
pub struct WDT_CPU_RESET_LENGTH_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_CPU_RESET_LENGTH_W<'a> {
#[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 << 14)) | (((value as u32) & 0x07) << 14);
self.w
}
}
#[doc = "Reader of field `WDT_SYS_RESET_LENGTH`"]
pub type WDT_SYS_RESET_LENGTH_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `WDT_SYS_RESET_LENGTH`"]
pub struct WDT_SYS_RESET_LENGTH_W<'a> {
w: &'a mut W,
}
impl<'a> WDT_SYS_RESET_LENGTH_W<'a> {
#[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 << 11)) | (((value as u32) & 0x07) << 11);
self.w
}
}
#[doc = "Reader of field `WDT_FLASHBOOT_MOD_EN`"]
pub type WDT_FLASHBOOT_MOD_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_FLASHBOOT_MOD_EN`"]
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 = "Reader of field `WDT_PROCPU_RESET_EN`"]
pub type WDT_PROCPU_RESET_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_PROCPU_RESET_EN`"]
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 = "Reader of field `WDT_APPCPU_RESET_EN`"]
pub type WDT_APPCPU_RESET_EN_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_APPCPU_RESET_EN`"]
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 = "Reader of field `WDT_PAUSE_IN_SLP`"]
pub type WDT_PAUSE_IN_SLP_R = crate::R<bool, bool>;
#[doc = "Write proxy for field `WDT_PAUSE_IN_SLP`"]
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 }
}
}