esp32p4/gpio/
func_in_sel_cfg.rs

1#[doc = "Register `FUNC%s_IN_SEL_CFG` reader"]
2pub type R = crate::R<FUNC_IN_SEL_CFG_SPEC>;
3#[doc = "Register `FUNC%s_IN_SEL_CFG` writer"]
4pub type W = crate::W<FUNC_IN_SEL_CFG_SPEC>;
5#[doc = "Field `IN_SEL` reader - set this value: s=0-56: connect GPIO\\[s\\] to this port. s=0x3F: set this port always high level. s=0x3E: set this port always low level."]
6pub type IN_SEL_R = crate::FieldReader;
7#[doc = "Field `IN_SEL` writer - set this value: s=0-56: connect GPIO\\[s\\] to this port. s=0x3F: set this port always high level. s=0x3E: set this port always low level."]
8pub type IN_SEL_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `IN_INV_SEL` reader - set this bit to invert input signal. 1:invert. 0:not invert."]
10pub type IN_INV_SEL_R = crate::BitReader;
11#[doc = "Field `IN_INV_SEL` writer - set this bit to invert input signal. 1:invert. 0:not invert."]
12pub type IN_INV_SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SEL` reader - set this bit to bypass GPIO. 1:do not bypass GPIO. 0:bypass GPIO."]
14pub type SEL_R = crate::BitReader;
15#[doc = "Field `SEL` writer - set this bit to bypass GPIO. 1:do not bypass GPIO. 0:bypass GPIO."]
16pub type SEL_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bits 0:5 - set this value: s=0-56: connect GPIO\\[s\\] to this port. s=0x3F: set this port always high level. s=0x3E: set this port always low level."]
19    #[inline(always)]
20    pub fn in_sel(&self) -> IN_SEL_R {
21        IN_SEL_R::new((self.bits & 0x3f) as u8)
22    }
23    #[doc = "Bit 6 - set this bit to invert input signal. 1:invert. 0:not invert."]
24    #[inline(always)]
25    pub fn in_inv_sel(&self) -> IN_INV_SEL_R {
26        IN_INV_SEL_R::new(((self.bits >> 6) & 1) != 0)
27    }
28    #[doc = "Bit 7 - set this bit to bypass GPIO. 1:do not bypass GPIO. 0:bypass GPIO."]
29    #[inline(always)]
30    pub fn sel(&self) -> SEL_R {
31        SEL_R::new(((self.bits >> 7) & 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("FUNC_IN_SEL_CFG")
38            .field("in_sel", &format_args!("{}", self.in_sel().bits()))
39            .field("in_inv_sel", &format_args!("{}", self.in_inv_sel().bit()))
40            .field("sel", &format_args!("{}", self.sel().bit()))
41            .finish()
42    }
43}
44#[cfg(feature = "impl-register-debug")]
45impl core::fmt::Debug for crate::generic::Reg<FUNC_IN_SEL_CFG_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:5 - set this value: s=0-56: connect GPIO\\[s\\] to this port. s=0x3F: set this port always high level. s=0x3E: set this port always low level."]
52    #[inline(always)]
53    #[must_use]
54    pub fn in_sel(&mut self) -> IN_SEL_W<FUNC_IN_SEL_CFG_SPEC> {
55        IN_SEL_W::new(self, 0)
56    }
57    #[doc = "Bit 6 - set this bit to invert input signal. 1:invert. 0:not invert."]
58    #[inline(always)]
59    #[must_use]
60    pub fn in_inv_sel(&mut self) -> IN_INV_SEL_W<FUNC_IN_SEL_CFG_SPEC> {
61        IN_INV_SEL_W::new(self, 6)
62    }
63    #[doc = "Bit 7 - set this bit to bypass GPIO. 1:do not bypass GPIO. 0:bypass GPIO."]
64    #[inline(always)]
65    #[must_use]
66    pub fn sel(&mut self) -> SEL_W<FUNC_IN_SEL_CFG_SPEC> {
67        SEL_W::new(self, 7)
68    }
69}
70#[doc = "GPIO input function configuration register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`func_in_sel_cfg::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 [`func_in_sel_cfg::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
71pub struct FUNC_IN_SEL_CFG_SPEC;
72impl crate::RegisterSpec for FUNC_IN_SEL_CFG_SPEC {
73    type Ux = u32;
74}
75#[doc = "`read()` method returns [`func_in_sel_cfg::R`](R) reader structure"]
76impl crate::Readable for FUNC_IN_SEL_CFG_SPEC {}
77#[doc = "`write(|w| ..)` method takes [`func_in_sel_cfg::W`](W) writer structure"]
78impl crate::Writable for FUNC_IN_SEL_CFG_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 FUNC%s_IN_SEL_CFG to value 0"]
84impl crate::Resettable for FUNC_IN_SEL_CFG_SPEC {
85    const RESET_VALUE: u32 = 0;
86}