esp32p4/lp_ana/
int_raw.rs

1#[doc = "Register `INT_RAW` reader"]
2pub type R = crate::R<INT_RAW_SPEC>;
3#[doc = "Register `INT_RAW` writer"]
4pub type W = crate::W<INT_RAW_SPEC>;
5#[doc = "Field `VDDBAT_CHARGE_UPVOLTAGE` reader - need_des"]
6pub type VDDBAT_CHARGE_UPVOLTAGE_R = crate::BitReader;
7#[doc = "Field `VDDBAT_CHARGE_UPVOLTAGE` writer - need_des"]
8pub type VDDBAT_CHARGE_UPVOLTAGE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `VDDBAT_CHARGE_UNDERVOLTAGE` reader - need_des"]
10pub type VDDBAT_CHARGE_UNDERVOLTAGE_R = crate::BitReader;
11#[doc = "Field `VDDBAT_CHARGE_UNDERVOLTAGE` writer - need_des"]
12pub type VDDBAT_CHARGE_UNDERVOLTAGE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `VDDBAT_UPVOLTAGE` reader - need_des"]
14pub type VDDBAT_UPVOLTAGE_R = crate::BitReader;
15#[doc = "Field `VDDBAT_UPVOLTAGE` writer - need_des"]
16pub type VDDBAT_UPVOLTAGE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `VDDBAT_UNDERVOLTAGE` reader - need_des"]
18pub type VDDBAT_UNDERVOLTAGE_R = crate::BitReader;
19#[doc = "Field `VDDBAT_UNDERVOLTAGE` writer - need_des"]
20pub type VDDBAT_UNDERVOLTAGE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `BOD_MODE0` reader - need_des"]
22pub type BOD_MODE0_R = crate::BitReader;
23#[doc = "Field `BOD_MODE0` writer - need_des"]
24pub type BOD_MODE0_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 27 - need_des"]
27    #[inline(always)]
28    pub fn vddbat_charge_upvoltage(&self) -> VDDBAT_CHARGE_UPVOLTAGE_R {
29        VDDBAT_CHARGE_UPVOLTAGE_R::new(((self.bits >> 27) & 1) != 0)
30    }
31    #[doc = "Bit 28 - need_des"]
32    #[inline(always)]
33    pub fn vddbat_charge_undervoltage(&self) -> VDDBAT_CHARGE_UNDERVOLTAGE_R {
34        VDDBAT_CHARGE_UNDERVOLTAGE_R::new(((self.bits >> 28) & 1) != 0)
35    }
36    #[doc = "Bit 29 - need_des"]
37    #[inline(always)]
38    pub fn vddbat_upvoltage(&self) -> VDDBAT_UPVOLTAGE_R {
39        VDDBAT_UPVOLTAGE_R::new(((self.bits >> 29) & 1) != 0)
40    }
41    #[doc = "Bit 30 - need_des"]
42    #[inline(always)]
43    pub fn vddbat_undervoltage(&self) -> VDDBAT_UNDERVOLTAGE_R {
44        VDDBAT_UNDERVOLTAGE_R::new(((self.bits >> 30) & 1) != 0)
45    }
46    #[doc = "Bit 31 - need_des"]
47    #[inline(always)]
48    pub fn bod_mode0(&self) -> BOD_MODE0_R {
49        BOD_MODE0_R::new(((self.bits >> 31) & 1) != 0)
50    }
51}
52#[cfg(feature = "impl-register-debug")]
53impl core::fmt::Debug for R {
54    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
55        f.debug_struct("INT_RAW")
56            .field(
57                "vddbat_charge_upvoltage",
58                &format_args!("{}", self.vddbat_charge_upvoltage().bit()),
59            )
60            .field(
61                "vddbat_charge_undervoltage",
62                &format_args!("{}", self.vddbat_charge_undervoltage().bit()),
63            )
64            .field(
65                "vddbat_upvoltage",
66                &format_args!("{}", self.vddbat_upvoltage().bit()),
67            )
68            .field(
69                "vddbat_undervoltage",
70                &format_args!("{}", self.vddbat_undervoltage().bit()),
71            )
72            .field("bod_mode0", &format_args!("{}", self.bod_mode0().bit()))
73            .finish()
74    }
75}
76#[cfg(feature = "impl-register-debug")]
77impl core::fmt::Debug for crate::generic::Reg<INT_RAW_SPEC> {
78    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
79        core::fmt::Debug::fmt(&self.read(), f)
80    }
81}
82impl W {
83    #[doc = "Bit 27 - need_des"]
84    #[inline(always)]
85    #[must_use]
86    pub fn vddbat_charge_upvoltage(&mut self) -> VDDBAT_CHARGE_UPVOLTAGE_W<INT_RAW_SPEC> {
87        VDDBAT_CHARGE_UPVOLTAGE_W::new(self, 27)
88    }
89    #[doc = "Bit 28 - need_des"]
90    #[inline(always)]
91    #[must_use]
92    pub fn vddbat_charge_undervoltage(&mut self) -> VDDBAT_CHARGE_UNDERVOLTAGE_W<INT_RAW_SPEC> {
93        VDDBAT_CHARGE_UNDERVOLTAGE_W::new(self, 28)
94    }
95    #[doc = "Bit 29 - need_des"]
96    #[inline(always)]
97    #[must_use]
98    pub fn vddbat_upvoltage(&mut self) -> VDDBAT_UPVOLTAGE_W<INT_RAW_SPEC> {
99        VDDBAT_UPVOLTAGE_W::new(self, 29)
100    }
101    #[doc = "Bit 30 - need_des"]
102    #[inline(always)]
103    #[must_use]
104    pub fn vddbat_undervoltage(&mut self) -> VDDBAT_UNDERVOLTAGE_W<INT_RAW_SPEC> {
105        VDDBAT_UNDERVOLTAGE_W::new(self, 30)
106    }
107    #[doc = "Bit 31 - need_des"]
108    #[inline(always)]
109    #[must_use]
110    pub fn bod_mode0(&mut self) -> BOD_MODE0_W<INT_RAW_SPEC> {
111        BOD_MODE0_W::new(self, 31)
112    }
113}
114#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`int_raw::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 [`int_raw::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
115pub struct INT_RAW_SPEC;
116impl crate::RegisterSpec for INT_RAW_SPEC {
117    type Ux = u32;
118}
119#[doc = "`read()` method returns [`int_raw::R`](R) reader structure"]
120impl crate::Readable for INT_RAW_SPEC {}
121#[doc = "`write(|w| ..)` method takes [`int_raw::W`](W) writer structure"]
122impl crate::Writable for INT_RAW_SPEC {
123    type Safety = crate::Unsafe;
124    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
125    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
126}
127#[doc = "`reset()` method sets INT_RAW to value 0"]
128impl crate::Resettable for INT_RAW_SPEC {
129    const RESET_VALUE: u32 = 0;
130}