esp32p4/uhci0/
quick_sent.rs

1#[doc = "Register `QUICK_SENT` reader"]
2pub type R = crate::R<QUICK_SENT_SPEC>;
3#[doc = "Register `QUICK_SENT` writer"]
4pub type W = crate::W<QUICK_SENT_SPEC>;
5#[doc = "Field `SINGLE_SEND_NUM` reader - Configures single_send mode."]
6pub type SINGLE_SEND_NUM_R = crate::FieldReader;
7#[doc = "Field `SINGLE_SEND_NUM` writer - Configures single_send mode."]
8pub type SINGLE_SEND_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `SINGLE_SEND_EN` writer - Set this bit to enable sending short packet with single_send mode."]
10pub type SINGLE_SEND_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `ALWAYS_SEND_NUM` reader - Configures always_send mode."]
12pub type ALWAYS_SEND_NUM_R = crate::FieldReader;
13#[doc = "Field `ALWAYS_SEND_NUM` writer - Configures always_send mode."]
14pub type ALWAYS_SEND_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
15#[doc = "Field `ALWAYS_SEND_EN` reader - Set this bit to enable sending short packet with always_send mode."]
16pub type ALWAYS_SEND_EN_R = crate::BitReader;
17#[doc = "Field `ALWAYS_SEND_EN` writer - Set this bit to enable sending short packet with always_send mode."]
18pub type ALWAYS_SEND_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
19impl R {
20    #[doc = "Bits 0:2 - Configures single_send mode."]
21    #[inline(always)]
22    pub fn single_send_num(&self) -> SINGLE_SEND_NUM_R {
23        SINGLE_SEND_NUM_R::new((self.bits & 7) as u8)
24    }
25    #[doc = "Bits 4:6 - Configures always_send mode."]
26    #[inline(always)]
27    pub fn always_send_num(&self) -> ALWAYS_SEND_NUM_R {
28        ALWAYS_SEND_NUM_R::new(((self.bits >> 4) & 7) as u8)
29    }
30    #[doc = "Bit 7 - Set this bit to enable sending short packet with always_send mode."]
31    #[inline(always)]
32    pub fn always_send_en(&self) -> ALWAYS_SEND_EN_R {
33        ALWAYS_SEND_EN_R::new(((self.bits >> 7) & 1) != 0)
34    }
35}
36#[cfg(feature = "impl-register-debug")]
37impl core::fmt::Debug for R {
38    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
39        f.debug_struct("QUICK_SENT")
40            .field(
41                "single_send_num",
42                &format_args!("{}", self.single_send_num().bits()),
43            )
44            .field(
45                "always_send_num",
46                &format_args!("{}", self.always_send_num().bits()),
47            )
48            .field(
49                "always_send_en",
50                &format_args!("{}", self.always_send_en().bit()),
51            )
52            .finish()
53    }
54}
55#[cfg(feature = "impl-register-debug")]
56impl core::fmt::Debug for crate::generic::Reg<QUICK_SENT_SPEC> {
57    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
58        core::fmt::Debug::fmt(&self.read(), f)
59    }
60}
61impl W {
62    #[doc = "Bits 0:2 - Configures single_send mode."]
63    #[inline(always)]
64    #[must_use]
65    pub fn single_send_num(&mut self) -> SINGLE_SEND_NUM_W<QUICK_SENT_SPEC> {
66        SINGLE_SEND_NUM_W::new(self, 0)
67    }
68    #[doc = "Bit 3 - Set this bit to enable sending short packet with single_send mode."]
69    #[inline(always)]
70    #[must_use]
71    pub fn single_send_en(&mut self) -> SINGLE_SEND_EN_W<QUICK_SENT_SPEC> {
72        SINGLE_SEND_EN_W::new(self, 3)
73    }
74    #[doc = "Bits 4:6 - Configures always_send mode."]
75    #[inline(always)]
76    #[must_use]
77    pub fn always_send_num(&mut self) -> ALWAYS_SEND_NUM_W<QUICK_SENT_SPEC> {
78        ALWAYS_SEND_NUM_W::new(self, 4)
79    }
80    #[doc = "Bit 7 - Set this bit to enable sending short packet with always_send mode."]
81    #[inline(always)]
82    #[must_use]
83    pub fn always_send_en(&mut self) -> ALWAYS_SEND_EN_W<QUICK_SENT_SPEC> {
84        ALWAYS_SEND_EN_W::new(self, 7)
85    }
86}
87#[doc = "UCHI Quick send Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`quick_sent::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 [`quick_sent::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
88pub struct QUICK_SENT_SPEC;
89impl crate::RegisterSpec for QUICK_SENT_SPEC {
90    type Ux = u32;
91}
92#[doc = "`read()` method returns [`quick_sent::R`](R) reader structure"]
93impl crate::Readable for QUICK_SENT_SPEC {}
94#[doc = "`write(|w| ..)` method takes [`quick_sent::W`](W) writer structure"]
95impl crate::Writable for QUICK_SENT_SPEC {
96    type Safety = crate::Unsafe;
97    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
98    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
99}
100#[doc = "`reset()` method sets QUICK_SENT to value 0"]
101impl crate::Resettable for QUICK_SENT_SPEC {
102    const RESET_VALUE: u32 = 0;
103}