esp32p4/lp_sys/
pad_comp1.rs1#[doc = "Register `PAD_COMP1` reader"]
2pub type R = crate::R<PAD_COMP1_SPEC>;
3#[doc = "Register `PAD_COMP1` writer"]
4pub type W = crate::W<PAD_COMP1_SPEC>;
5#[doc = "Field `DREF_COMP1` reader - pad comp dref"]
6pub type DREF_COMP1_R = crate::FieldReader;
7#[doc = "Field `DREF_COMP1` writer - pad comp dref"]
8pub type DREF_COMP1_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `MODE_COMP1` reader - pad comp mode"]
10pub type MODE_COMP1_R = crate::BitReader;
11#[doc = "Field `MODE_COMP1` writer - pad comp mode"]
12pub type MODE_COMP1_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `XPD_COMP1` reader - pad comp xpd"]
14pub type XPD_COMP1_R = crate::BitReader;
15#[doc = "Field `XPD_COMP1` writer - pad comp xpd"]
16pub type XPD_COMP1_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bits 0:2 - pad comp dref"]
19 #[inline(always)]
20 pub fn dref_comp1(&self) -> DREF_COMP1_R {
21 DREF_COMP1_R::new((self.bits & 7) as u8)
22 }
23 #[doc = "Bit 3 - pad comp mode"]
24 #[inline(always)]
25 pub fn mode_comp1(&self) -> MODE_COMP1_R {
26 MODE_COMP1_R::new(((self.bits >> 3) & 1) != 0)
27 }
28 #[doc = "Bit 4 - pad comp xpd"]
29 #[inline(always)]
30 pub fn xpd_comp1(&self) -> XPD_COMP1_R {
31 XPD_COMP1_R::new(((self.bits >> 4) & 1) != 0)
32 }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37 f.debug_struct("PAD_COMP1")
38 .field("dref_comp1", &format_args!("{}", self.dref_comp1().bits()))
39 .field("mode_comp1", &format_args!("{}", self.mode_comp1().bit()))
40 .field("xpd_comp1", &format_args!("{}", self.xpd_comp1().bit()))
41 .finish()
42 }
43}
44#[cfg(feature = "impl-register-debug")]
45impl core::fmt::Debug for crate::generic::Reg<PAD_COMP1_SPEC> {
46 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
47 core::fmt::Debug::fmt(&self.read(), f)
48 }
49}
50impl W {
51 #[doc = "Bits 0:2 - pad comp dref"]
52 #[inline(always)]
53 #[must_use]
54 pub fn dref_comp1(&mut self) -> DREF_COMP1_W<PAD_COMP1_SPEC> {
55 DREF_COMP1_W::new(self, 0)
56 }
57 #[doc = "Bit 3 - pad comp mode"]
58 #[inline(always)]
59 #[must_use]
60 pub fn mode_comp1(&mut self) -> MODE_COMP1_W<PAD_COMP1_SPEC> {
61 MODE_COMP1_W::new(self, 3)
62 }
63 #[doc = "Bit 4 - pad comp xpd"]
64 #[inline(always)]
65 #[must_use]
66 pub fn xpd_comp1(&mut self) -> XPD_COMP1_W<PAD_COMP1_SPEC> {
67 XPD_COMP1_W::new(self, 4)
68 }
69}
70#[doc = "need_des\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pad_comp1::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 [`pad_comp1::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
71pub struct PAD_COMP1_SPEC;
72impl crate::RegisterSpec for PAD_COMP1_SPEC {
73 type Ux = u32;
74}
75#[doc = "`read()` method returns [`pad_comp1::R`](R) reader structure"]
76impl crate::Readable for PAD_COMP1_SPEC {}
77#[doc = "`write(|w| ..)` method takes [`pad_comp1::W`](W) writer structure"]
78impl crate::Writable for PAD_COMP1_SPEC {
79 type Safety = crate::Unsafe;
80 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
82}
83#[doc = "`reset()` method sets PAD_COMP1 to value 0"]
84impl crate::Resettable for PAD_COMP1_SPEC {
85 const RESET_VALUE: u32 = 0;
86}