esp32c6/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("single_send_num", &self.single_send_num())
41            .field("always_send_num", &self.always_send_num())
42            .field("always_send_en", &self.always_send_en())
43            .finish()
44    }
45}
46impl W {
47    #[doc = "Bits 0:2 - Configures single_send mode."]
48    #[inline(always)]
49    pub fn single_send_num(&mut self) -> SINGLE_SEND_NUM_W<QUICK_SENT_SPEC> {
50        SINGLE_SEND_NUM_W::new(self, 0)
51    }
52    #[doc = "Bit 3 - Set this bit to enable sending short packet with single_send mode."]
53    #[inline(always)]
54    pub fn single_send_en(&mut self) -> SINGLE_SEND_EN_W<QUICK_SENT_SPEC> {
55        SINGLE_SEND_EN_W::new(self, 3)
56    }
57    #[doc = "Bits 4:6 - Configures always_send mode."]
58    #[inline(always)]
59    pub fn always_send_num(&mut self) -> ALWAYS_SEND_NUM_W<QUICK_SENT_SPEC> {
60        ALWAYS_SEND_NUM_W::new(self, 4)
61    }
62    #[doc = "Bit 7 - Set this bit to enable sending short packet with always_send mode."]
63    #[inline(always)]
64    pub fn always_send_en(&mut self) -> ALWAYS_SEND_EN_W<QUICK_SENT_SPEC> {
65        ALWAYS_SEND_EN_W::new(self, 7)
66    }
67}
68#[doc = "UCHI Quick send Register\n\nYou can [`read`](crate::Reg::read) this register and get [`quick_sent::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`quick_sent::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
69pub struct QUICK_SENT_SPEC;
70impl crate::RegisterSpec for QUICK_SENT_SPEC {
71    type Ux = u32;
72}
73#[doc = "`read()` method returns [`quick_sent::R`](R) reader structure"]
74impl crate::Readable for QUICK_SENT_SPEC {}
75#[doc = "`write(|w| ..)` method takes [`quick_sent::W`](W) writer structure"]
76impl crate::Writable for QUICK_SENT_SPEC {
77    type Safety = crate::Unsafe;
78    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
79    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80}
81#[doc = "`reset()` method sets QUICK_SENT to value 0"]
82impl crate::Resettable for QUICK_SENT_SPEC {
83    const RESET_VALUE: u32 = 0;
84}