d1_pac/csic/csic_dma/
csic_feature.rs

1#[doc = "Register `csic_feature` reader"]
2pub type R = crate::R<CSIC_FEATURE_SPEC>;
3#[doc = "Register `csic_feature` writer"]
4pub type W = crate::W<CSIC_FEATURE_SPEC>;
5#[doc = "Field `dma0_embedded_fbc` reader - "]
6pub type DMA0_EMBEDDED_FBC_R = crate::BitReader<DMA0_EMBEDDED_FBC_A>;
7#[doc = "\n\nValue on reset: 0"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum DMA0_EMBEDDED_FBC_A {
10    #[doc = "0: No Embedded DMA"]
11    NO_E_MBEDDED = 0,
12    #[doc = "1: Embedded FBC"]
13    E_MBEDDED = 1,
14}
15impl From<DMA0_EMBEDDED_FBC_A> for bool {
16    #[inline(always)]
17    fn from(variant: DMA0_EMBEDDED_FBC_A) -> Self {
18        variant as u8 != 0
19    }
20}
21impl DMA0_EMBEDDED_FBC_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> DMA0_EMBEDDED_FBC_A {
25        match self.bits {
26            false => DMA0_EMBEDDED_FBC_A::NO_E_MBEDDED,
27            true => DMA0_EMBEDDED_FBC_A::E_MBEDDED,
28        }
29    }
30    #[doc = "No Embedded DMA"]
31    #[inline(always)]
32    pub fn is_no_e_mbedded(&self) -> bool {
33        *self == DMA0_EMBEDDED_FBC_A::NO_E_MBEDDED
34    }
35    #[doc = "Embedded FBC"]
36    #[inline(always)]
37    pub fn is_e_mbedded(&self) -> bool {
38        *self == DMA0_EMBEDDED_FBC_A::E_MBEDDED
39    }
40}
41#[doc = "Field `dma0_embedded_lbc` reader - "]
42pub type DMA0_EMBEDDED_LBC_R = crate::BitReader<DMA0_EMBEDDED_LBC_A>;
43#[doc = "\n\nValue on reset: 0"]
44#[derive(Clone, Copy, Debug, PartialEq, Eq)]
45pub enum DMA0_EMBEDDED_LBC_A {
46    #[doc = "0: No Embedded LBC"]
47    NO_E_MBEDDED = 0,
48    #[doc = "1: Embedded LBC"]
49    E_MBEDDED = 1,
50}
51impl From<DMA0_EMBEDDED_LBC_A> for bool {
52    #[inline(always)]
53    fn from(variant: DMA0_EMBEDDED_LBC_A) -> Self {
54        variant as u8 != 0
55    }
56}
57impl DMA0_EMBEDDED_LBC_R {
58    #[doc = "Get enumerated values variant"]
59    #[inline(always)]
60    pub const fn variant(&self) -> DMA0_EMBEDDED_LBC_A {
61        match self.bits {
62            false => DMA0_EMBEDDED_LBC_A::NO_E_MBEDDED,
63            true => DMA0_EMBEDDED_LBC_A::E_MBEDDED,
64        }
65    }
66    #[doc = "No Embedded LBC"]
67    #[inline(always)]
68    pub fn is_no_e_mbedded(&self) -> bool {
69        *self == DMA0_EMBEDDED_LBC_A::NO_E_MBEDDED
70    }
71    #[doc = "Embedded LBC"]
72    #[inline(always)]
73    pub fn is_e_mbedded(&self) -> bool {
74        *self == DMA0_EMBEDDED_LBC_A::E_MBEDDED
75    }
76}
77impl R {
78    #[doc = "Bit 0"]
79    #[inline(always)]
80    pub fn dma0_embedded_fbc(&self) -> DMA0_EMBEDDED_FBC_R {
81        DMA0_EMBEDDED_FBC_R::new((self.bits & 1) != 0)
82    }
83    #[doc = "Bit 1"]
84    #[inline(always)]
85    pub fn dma0_embedded_lbc(&self) -> DMA0_EMBEDDED_LBC_R {
86        DMA0_EMBEDDED_LBC_R::new(((self.bits >> 1) & 1) != 0)
87    }
88}
89impl W {
90    #[doc = r" Writes raw bits to the register."]
91    #[doc = r""]
92    #[doc = r" # Safety"]
93    #[doc = r""]
94    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
95    #[inline(always)]
96    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
97        self.bits = bits;
98        self
99    }
100}
101#[doc = "CSIC DMA Feature List Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`csic_feature::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 [`csic_feature::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
102pub struct CSIC_FEATURE_SPEC;
103impl crate::RegisterSpec for CSIC_FEATURE_SPEC {
104    type Ux = u32;
105}
106#[doc = "`read()` method returns [`csic_feature::R`](R) reader structure"]
107impl crate::Readable for CSIC_FEATURE_SPEC {}
108#[doc = "`write(|w| ..)` method takes [`csic_feature::W`](W) writer structure"]
109impl crate::Writable for CSIC_FEATURE_SPEC {
110    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
111    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
112}
113#[doc = "`reset()` method sets csic_feature to value 0"]
114impl crate::Resettable for CSIC_FEATURE_SPEC {
115    const RESET_VALUE: Self::Ux = 0;
116}