efm32gg12b830_pac/sdio/
prstval6.rs

1#[doc = "Register `PRSTVAL6` reader"]
2pub struct R(crate::R<PRSTVAL6_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PRSTVAL6_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PRSTVAL6_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PRSTVAL6_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `SDR104SDCLKFREQVAL` reader - SD_CLK Frequency Select Value for SDR104"]
17pub type SDR104SDCLKFREQVAL_R = crate::FieldReader<u16, u16>;
18#[doc = "Field `SDR104CLKGENVAL` reader - Clock Generator Select Value for SDR104"]
19pub type SDR104CLKGENVAL_R = crate::BitReader<bool>;
20#[doc = "Driver Strength Select Value for SDR104\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq)]
22#[repr(u8)]
23pub enum SDR104DRVSTVAL_A {
24    #[doc = "0: Driver Type B is selected (Default)"]
25    TYPEB = 0,
26    #[doc = "1: Driver Type A is selected"]
27    TYPEA = 1,
28    #[doc = "2: Driver Type C is selected"]
29    TYPEC = 2,
30    #[doc = "3: Driver Type D is selected"]
31    TYPED = 3,
32}
33impl From<SDR104DRVSTVAL_A> for u8 {
34    #[inline(always)]
35    fn from(variant: SDR104DRVSTVAL_A) -> Self {
36        variant as _
37    }
38}
39#[doc = "Field `SDR104DRVSTVAL` reader - Driver Strength Select Value for SDR104"]
40pub type SDR104DRVSTVAL_R = crate::FieldReader<u8, SDR104DRVSTVAL_A>;
41impl SDR104DRVSTVAL_R {
42    #[doc = "Get enumerated values variant"]
43    #[inline(always)]
44    pub fn variant(&self) -> SDR104DRVSTVAL_A {
45        match self.bits {
46            0 => SDR104DRVSTVAL_A::TYPEB,
47            1 => SDR104DRVSTVAL_A::TYPEA,
48            2 => SDR104DRVSTVAL_A::TYPEC,
49            3 => SDR104DRVSTVAL_A::TYPED,
50            _ => unreachable!(),
51        }
52    }
53    #[doc = "Checks if the value of the field is `TYPEB`"]
54    #[inline(always)]
55    pub fn is_typeb(&self) -> bool {
56        *self == SDR104DRVSTVAL_A::TYPEB
57    }
58    #[doc = "Checks if the value of the field is `TYPEA`"]
59    #[inline(always)]
60    pub fn is_typea(&self) -> bool {
61        *self == SDR104DRVSTVAL_A::TYPEA
62    }
63    #[doc = "Checks if the value of the field is `TYPEC`"]
64    #[inline(always)]
65    pub fn is_typec(&self) -> bool {
66        *self == SDR104DRVSTVAL_A::TYPEC
67    }
68    #[doc = "Checks if the value of the field is `TYPED`"]
69    #[inline(always)]
70    pub fn is_typed(&self) -> bool {
71        *self == SDR104DRVSTVAL_A::TYPED
72    }
73}
74#[doc = "Field `DDR50SDCLKFREQVAL` reader - SD_CLK Frequency Select Value for DDR50"]
75pub type DDR50SDCLKFREQVAL_R = crate::FieldReader<u16, u16>;
76#[doc = "Field `DDR50CLKGENVAL` reader - Clock Generator Select Value for DDR50"]
77pub type DDR50CLKGENVAL_R = crate::BitReader<bool>;
78#[doc = "Driver Strength Select Value for DDR50\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq)]
80#[repr(u8)]
81pub enum DDR50DRVSTVAL_A {
82    #[doc = "0: Driver Type B is selected (Default)"]
83    TYPEB = 0,
84    #[doc = "1: Driver Type A is selected"]
85    TYPEA = 1,
86    #[doc = "2: Driver Type C is selected"]
87    TYPEC = 2,
88    #[doc = "3: Driver Type D is selected"]
89    TYPED = 3,
90}
91impl From<DDR50DRVSTVAL_A> for u8 {
92    #[inline(always)]
93    fn from(variant: DDR50DRVSTVAL_A) -> Self {
94        variant as _
95    }
96}
97#[doc = "Field `DDR50DRVSTVAL` reader - Driver Strength Select Value for DDR50"]
98pub type DDR50DRVSTVAL_R = crate::FieldReader<u8, DDR50DRVSTVAL_A>;
99impl DDR50DRVSTVAL_R {
100    #[doc = "Get enumerated values variant"]
101    #[inline(always)]
102    pub fn variant(&self) -> DDR50DRVSTVAL_A {
103        match self.bits {
104            0 => DDR50DRVSTVAL_A::TYPEB,
105            1 => DDR50DRVSTVAL_A::TYPEA,
106            2 => DDR50DRVSTVAL_A::TYPEC,
107            3 => DDR50DRVSTVAL_A::TYPED,
108            _ => unreachable!(),
109        }
110    }
111    #[doc = "Checks if the value of the field is `TYPEB`"]
112    #[inline(always)]
113    pub fn is_typeb(&self) -> bool {
114        *self == DDR50DRVSTVAL_A::TYPEB
115    }
116    #[doc = "Checks if the value of the field is `TYPEA`"]
117    #[inline(always)]
118    pub fn is_typea(&self) -> bool {
119        *self == DDR50DRVSTVAL_A::TYPEA
120    }
121    #[doc = "Checks if the value of the field is `TYPEC`"]
122    #[inline(always)]
123    pub fn is_typec(&self) -> bool {
124        *self == DDR50DRVSTVAL_A::TYPEC
125    }
126    #[doc = "Checks if the value of the field is `TYPED`"]
127    #[inline(always)]
128    pub fn is_typed(&self) -> bool {
129        *self == DDR50DRVSTVAL_A::TYPED
130    }
131}
132impl R {
133    #[doc = "Bits 0:9 - SD_CLK Frequency Select Value for SDR104"]
134    #[inline(always)]
135    pub fn sdr104sdclkfreqval(&self) -> SDR104SDCLKFREQVAL_R {
136        SDR104SDCLKFREQVAL_R::new((self.bits & 0x03ff) as u16)
137    }
138    #[doc = "Bit 10 - Clock Generator Select Value for SDR104"]
139    #[inline(always)]
140    pub fn sdr104clkgenval(&self) -> SDR104CLKGENVAL_R {
141        SDR104CLKGENVAL_R::new(((self.bits >> 10) & 1) != 0)
142    }
143    #[doc = "Bits 14:15 - Driver Strength Select Value for SDR104"]
144    #[inline(always)]
145    pub fn sdr104drvstval(&self) -> SDR104DRVSTVAL_R {
146        SDR104DRVSTVAL_R::new(((self.bits >> 14) & 3) as u8)
147    }
148    #[doc = "Bits 16:25 - SD_CLK Frequency Select Value for DDR50"]
149    #[inline(always)]
150    pub fn ddr50sdclkfreqval(&self) -> DDR50SDCLKFREQVAL_R {
151        DDR50SDCLKFREQVAL_R::new(((self.bits >> 16) & 0x03ff) as u16)
152    }
153    #[doc = "Bit 26 - Clock Generator Select Value for DDR50"]
154    #[inline(always)]
155    pub fn ddr50clkgenval(&self) -> DDR50CLKGENVAL_R {
156        DDR50CLKGENVAL_R::new(((self.bits >> 26) & 1) != 0)
157    }
158    #[doc = "Bits 30:31 - Driver Strength Select Value for DDR50"]
159    #[inline(always)]
160    pub fn ddr50drvstval(&self) -> DDR50DRVSTVAL_R {
161        DDR50DRVSTVAL_R::new(((self.bits >> 30) & 3) as u8)
162    }
163}
164#[doc = "Preset Value for SDR104 and DDR50 Modes\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prstval6](index.html) module"]
165pub struct PRSTVAL6_SPEC;
166impl crate::RegisterSpec for PRSTVAL6_SPEC {
167    type Ux = u32;
168}
169#[doc = "`read()` method returns [prstval6::R](R) reader structure"]
170impl crate::Readable for PRSTVAL6_SPEC {
171    type Reader = R;
172}
173#[doc = "`reset()` method sets PRSTVAL6 to value 0"]
174impl crate::Resettable for PRSTVAL6_SPEC {
175    #[inline(always)]
176    fn reset_value() -> Self::Ux {
177        0
178    }
179}