esp32p4/dma/ch/
cfg0.rs

1#[doc = "Register `CFG0` reader"]
2pub type R = crate::R<CFG0_SPEC>;
3#[doc = "Register `CFG0` writer"]
4pub type W = crate::W<CFG0_SPEC>;
5#[doc = "Field `CH1_SRC_MULTBLK_TYPE` reader - NA"]
6pub type CH1_SRC_MULTBLK_TYPE_R = crate::FieldReader;
7#[doc = "Field `CH1_SRC_MULTBLK_TYPE` writer - NA"]
8pub type CH1_SRC_MULTBLK_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
9#[doc = "Field `CH1_DST_MULTBLK_TYPE` reader - NA"]
10pub type CH1_DST_MULTBLK_TYPE_R = crate::FieldReader;
11#[doc = "Field `CH1_DST_MULTBLK_TYPE` writer - NA"]
12pub type CH1_DST_MULTBLK_TYPE_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
13#[doc = "Field `CH1_RD_UID` reader - NA"]
14pub type CH1_RD_UID_R = crate::FieldReader;
15#[doc = "Field `CH1_WR_UID` reader - NA"]
16pub type CH1_WR_UID_R = crate::FieldReader;
17impl R {
18    #[doc = "Bits 0:1 - NA"]
19    #[inline(always)]
20    pub fn ch1_src_multblk_type(&self) -> CH1_SRC_MULTBLK_TYPE_R {
21        CH1_SRC_MULTBLK_TYPE_R::new((self.bits & 3) as u8)
22    }
23    #[doc = "Bits 2:3 - NA"]
24    #[inline(always)]
25    pub fn ch1_dst_multblk_type(&self) -> CH1_DST_MULTBLK_TYPE_R {
26        CH1_DST_MULTBLK_TYPE_R::new(((self.bits >> 2) & 3) as u8)
27    }
28    #[doc = "Bits 18:21 - NA"]
29    #[inline(always)]
30    pub fn ch1_rd_uid(&self) -> CH1_RD_UID_R {
31        CH1_RD_UID_R::new(((self.bits >> 18) & 0x0f) as u8)
32    }
33    #[doc = "Bits 25:28 - NA"]
34    #[inline(always)]
35    pub fn ch1_wr_uid(&self) -> CH1_WR_UID_R {
36        CH1_WR_UID_R::new(((self.bits >> 25) & 0x0f) as u8)
37    }
38}
39#[cfg(feature = "impl-register-debug")]
40impl core::fmt::Debug for R {
41    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
42        f.debug_struct("CFG0")
43            .field(
44                "ch1_src_multblk_type",
45                &format_args!("{}", self.ch1_src_multblk_type().bits()),
46            )
47            .field(
48                "ch1_dst_multblk_type",
49                &format_args!("{}", self.ch1_dst_multblk_type().bits()),
50            )
51            .field("ch1_rd_uid", &format_args!("{}", self.ch1_rd_uid().bits()))
52            .field("ch1_wr_uid", &format_args!("{}", self.ch1_wr_uid().bits()))
53            .finish()
54    }
55}
56#[cfg(feature = "impl-register-debug")]
57impl core::fmt::Debug for crate::generic::Reg<CFG0_SPEC> {
58    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
59        core::fmt::Debug::fmt(&self.read(), f)
60    }
61}
62impl W {
63    #[doc = "Bits 0:1 - NA"]
64    #[inline(always)]
65    #[must_use]
66    pub fn ch1_src_multblk_type(&mut self) -> CH1_SRC_MULTBLK_TYPE_W<CFG0_SPEC> {
67        CH1_SRC_MULTBLK_TYPE_W::new(self, 0)
68    }
69    #[doc = "Bits 2:3 - NA"]
70    #[inline(always)]
71    #[must_use]
72    pub fn ch1_dst_multblk_type(&mut self) -> CH1_DST_MULTBLK_TYPE_W<CFG0_SPEC> {
73        CH1_DST_MULTBLK_TYPE_W::new(self, 2)
74    }
75}
76#[doc = "NA\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfg0::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 [`cfg0::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct CFG0_SPEC;
78impl crate::RegisterSpec for CFG0_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`cfg0::R`](R) reader structure"]
82impl crate::Readable for CFG0_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`cfg0::W`](W) writer structure"]
84impl crate::Writable for CFG0_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 CFG0 to value 0"]
90impl crate::Resettable for CFG0_SPEC {
91    const RESET_VALUE: u32 = 0;
92}