esp32p4/uhci0/
esc_conf2.rs

1#[doc = "Register `ESC_CONF2` reader"]
2pub type R = crate::R<ESC_CONF2_SPEC>;
3#[doc = "Register `ESC_CONF2` writer"]
4pub type W = crate::W<ESC_CONF2_SPEC>;
5#[doc = "Field `ESC_SEQ1` reader - Configures the char needing encoding, which is 0x11 as flow control char by default."]
6pub type ESC_SEQ1_R = crate::FieldReader;
7#[doc = "Field `ESC_SEQ1` writer - Configures the char needing encoding, which is 0x11 as flow control char by default."]
8pub type ESC_SEQ1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `ESC_SEQ1_CHAR0` reader - Configures the first char of SLIP escape character, default value is 0xDB."]
10pub type ESC_SEQ1_CHAR0_R = crate::FieldReader;
11#[doc = "Field `ESC_SEQ1_CHAR0` writer - Configures the first char of SLIP escape character, default value is 0xDB."]
12pub type ESC_SEQ1_CHAR0_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `ESC_SEQ1_CHAR1` reader - Configures the second char of SLIP escape character, default value is 0xDE."]
14pub type ESC_SEQ1_CHAR1_R = crate::FieldReader;
15#[doc = "Field `ESC_SEQ1_CHAR1` writer - Configures the second char of SLIP escape character, default value is 0xDE."]
16pub type ESC_SEQ1_CHAR1_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
17impl R {
18    #[doc = "Bits 0:7 - Configures the char needing encoding, which is 0x11 as flow control char by default."]
19    #[inline(always)]
20    pub fn esc_seq1(&self) -> ESC_SEQ1_R {
21        ESC_SEQ1_R::new((self.bits & 0xff) as u8)
22    }
23    #[doc = "Bits 8:15 - Configures the first char of SLIP escape character, default value is 0xDB."]
24    #[inline(always)]
25    pub fn esc_seq1_char0(&self) -> ESC_SEQ1_CHAR0_R {
26        ESC_SEQ1_CHAR0_R::new(((self.bits >> 8) & 0xff) as u8)
27    }
28    #[doc = "Bits 16:23 - Configures the second char of SLIP escape character, default value is 0xDE."]
29    #[inline(always)]
30    pub fn esc_seq1_char1(&self) -> ESC_SEQ1_CHAR1_R {
31        ESC_SEQ1_CHAR1_R::new(((self.bits >> 16) & 0xff) as u8)
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("ESC_CONF2")
38            .field("esc_seq1", &format_args!("{}", self.esc_seq1().bits()))
39            .field(
40                "esc_seq1_char0",
41                &format_args!("{}", self.esc_seq1_char0().bits()),
42            )
43            .field(
44                "esc_seq1_char1",
45                &format_args!("{}", self.esc_seq1_char1().bits()),
46            )
47            .finish()
48    }
49}
50#[cfg(feature = "impl-register-debug")]
51impl core::fmt::Debug for crate::generic::Reg<ESC_CONF2_SPEC> {
52    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
53        core::fmt::Debug::fmt(&self.read(), f)
54    }
55}
56impl W {
57    #[doc = "Bits 0:7 - Configures the char needing encoding, which is 0x11 as flow control char by default."]
58    #[inline(always)]
59    #[must_use]
60    pub fn esc_seq1(&mut self) -> ESC_SEQ1_W<ESC_CONF2_SPEC> {
61        ESC_SEQ1_W::new(self, 0)
62    }
63    #[doc = "Bits 8:15 - Configures the first char of SLIP escape character, default value is 0xDB."]
64    #[inline(always)]
65    #[must_use]
66    pub fn esc_seq1_char0(&mut self) -> ESC_SEQ1_CHAR0_W<ESC_CONF2_SPEC> {
67        ESC_SEQ1_CHAR0_W::new(self, 8)
68    }
69    #[doc = "Bits 16:23 - Configures the second char of SLIP escape character, default value is 0xDE."]
70    #[inline(always)]
71    #[must_use]
72    pub fn esc_seq1_char1(&mut self) -> ESC_SEQ1_CHAR1_W<ESC_CONF2_SPEC> {
73        ESC_SEQ1_CHAR1_W::new(self, 16)
74    }
75}
76#[doc = "UHCI Escapes Sequence Configuration Register2\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`esc_conf2::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 [`esc_conf2::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct ESC_CONF2_SPEC;
78impl crate::RegisterSpec for ESC_CONF2_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`esc_conf2::R`](R) reader structure"]
82impl crate::Readable for ESC_CONF2_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`esc_conf2::W`](W) writer structure"]
84impl crate::Writable for ESC_CONF2_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets ESC_CONF2 to value 0x00de_db11"]
90impl crate::Resettable for ESC_CONF2_SPEC {
91    const RESET_VALUE: u32 = 0x00de_db11;
92}