esp32p4/hp_sys_clkrst/
hpcore_wdt_reset_source0.rs

1#[doc = "Register `HPCORE_WDT_RESET_SOURCE0` reader"]
2pub type R = crate::R<HPCORE_WDT_RESET_SOURCE0_SPEC>;
3#[doc = "Register `HPCORE_WDT_RESET_SOURCE0` writer"]
4pub type W = crate::W<HPCORE_WDT_RESET_SOURCE0_SPEC>;
5#[doc = "Field `HPCORE0_WDT_RESET_SOURCE_SEL` reader - 1'b0: use wdt0 to reset hpcore0, 1'b1: use wdt1 to reset hpcore0"]
6pub type HPCORE0_WDT_RESET_SOURCE_SEL_R = crate::BitReader;
7#[doc = "Field `HPCORE0_WDT_RESET_SOURCE_SEL` writer - 1'b0: use wdt0 to reset hpcore0, 1'b1: use wdt1 to reset hpcore0"]
8pub type HPCORE0_WDT_RESET_SOURCE_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `HPCORE1_WDT_RESET_SOURCE_SEL` reader - 1'b0: use wdt0 to reset hpcore1, 1'b1: use wdt1 to reset hpcore1"]
10pub type HPCORE1_WDT_RESET_SOURCE_SEL_R = crate::BitReader;
11#[doc = "Field `HPCORE1_WDT_RESET_SOURCE_SEL` writer - 1'b0: use wdt0 to reset hpcore1, 1'b1: use wdt1 to reset hpcore1"]
12pub type HPCORE1_WDT_RESET_SOURCE_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - 1'b0: use wdt0 to reset hpcore0, 1'b1: use wdt1 to reset hpcore0"]
15    #[inline(always)]
16    pub fn hpcore0_wdt_reset_source_sel(&self) -> HPCORE0_WDT_RESET_SOURCE_SEL_R {
17        HPCORE0_WDT_RESET_SOURCE_SEL_R::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - 1'b0: use wdt0 to reset hpcore1, 1'b1: use wdt1 to reset hpcore1"]
20    #[inline(always)]
21    pub fn hpcore1_wdt_reset_source_sel(&self) -> HPCORE1_WDT_RESET_SOURCE_SEL_R {
22        HPCORE1_WDT_RESET_SOURCE_SEL_R::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("HPCORE_WDT_RESET_SOURCE0")
29            .field(
30                "hpcore0_wdt_reset_source_sel",
31                &format_args!("{}", self.hpcore0_wdt_reset_source_sel().bit()),
32            )
33            .field(
34                "hpcore1_wdt_reset_source_sel",
35                &format_args!("{}", self.hpcore1_wdt_reset_source_sel().bit()),
36            )
37            .finish()
38    }
39}
40#[cfg(feature = "impl-register-debug")]
41impl core::fmt::Debug for crate::generic::Reg<HPCORE_WDT_RESET_SOURCE0_SPEC> {
42    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
43        core::fmt::Debug::fmt(&self.read(), f)
44    }
45}
46impl W {
47    #[doc = "Bit 0 - 1'b0: use wdt0 to reset hpcore0, 1'b1: use wdt1 to reset hpcore0"]
48    #[inline(always)]
49    #[must_use]
50    pub fn hpcore0_wdt_reset_source_sel(
51        &mut self,
52    ) -> HPCORE0_WDT_RESET_SOURCE_SEL_W<HPCORE_WDT_RESET_SOURCE0_SPEC> {
53        HPCORE0_WDT_RESET_SOURCE_SEL_W::new(self, 0)
54    }
55    #[doc = "Bit 1 - 1'b0: use wdt0 to reset hpcore1, 1'b1: use wdt1 to reset hpcore1"]
56    #[inline(always)]
57    #[must_use]
58    pub fn hpcore1_wdt_reset_source_sel(
59        &mut self,
60    ) -> HPCORE1_WDT_RESET_SOURCE_SEL_W<HPCORE_WDT_RESET_SOURCE0_SPEC> {
61        HPCORE1_WDT_RESET_SOURCE_SEL_W::new(self, 1)
62    }
63}
64#[doc = "Reserved\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`hpcore_wdt_reset_source0::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`hpcore_wdt_reset_source0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
65pub struct HPCORE_WDT_RESET_SOURCE0_SPEC;
66impl crate::RegisterSpec for HPCORE_WDT_RESET_SOURCE0_SPEC {
67    type Ux = u32;
68}
69#[doc = "`read()` method returns [`hpcore_wdt_reset_source0::R`](R) reader structure"]
70impl crate::Readable for HPCORE_WDT_RESET_SOURCE0_SPEC {}
71#[doc = "`write(|w| ..)` method takes [`hpcore_wdt_reset_source0::W`](W) writer structure"]
72impl crate::Writable for HPCORE_WDT_RESET_SOURCE0_SPEC {
73    type Safety = crate::Unsafe;
74    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
75    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
76}
77#[doc = "`reset()` method sets HPCORE_WDT_RESET_SOURCE0 to value 0x02"]
78impl crate::Resettable for HPCORE_WDT_RESET_SOURCE0_SPEC {
79    const RESET_VALUE: u32 = 0x02;
80}