efm32gg12b830_pac/sdio/
prstval4.rs1#[doc = "Register `PRSTVAL4` reader"]
2pub struct R(crate::R<PRSTVAL4_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PRSTVAL4_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PRSTVAL4_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PRSTVAL4_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Field `SDR25SDCLKFREQVAL` reader - SD_CLK Frequency Select Value for SDR25"]
17pub type SDR25SDCLKFREQVAL_R = crate::FieldReader<u16, u16>;
18#[doc = "Field `SDR25CLKGENVAL` reader - Clock Generator Select Value for SDR25"]
19pub type SDR25CLKGENVAL_R = crate::BitReader<bool>;
20#[doc = "Driver Strength Select Value for SDR25\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq)]
22#[repr(u8)]
23pub enum SDR25DRVSTVAL_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<SDR25DRVSTVAL_A> for u8 {
34 #[inline(always)]
35 fn from(variant: SDR25DRVSTVAL_A) -> Self {
36 variant as _
37 }
38}
39#[doc = "Field `SDR25DRVSTVAL` reader - Driver Strength Select Value for SDR25"]
40pub type SDR25DRVSTVAL_R = crate::FieldReader<u8, SDR25DRVSTVAL_A>;
41impl SDR25DRVSTVAL_R {
42 #[doc = "Get enumerated values variant"]
43 #[inline(always)]
44 pub fn variant(&self) -> SDR25DRVSTVAL_A {
45 match self.bits {
46 0 => SDR25DRVSTVAL_A::TYPEB,
47 1 => SDR25DRVSTVAL_A::TYPEA,
48 2 => SDR25DRVSTVAL_A::TYPEC,
49 3 => SDR25DRVSTVAL_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 == SDR25DRVSTVAL_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 == SDR25DRVSTVAL_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 == SDR25DRVSTVAL_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 == SDR25DRVSTVAL_A::TYPED
72 }
73}
74#[doc = "Field `SDR50SDCLKFREQVAL` reader - SD_CLK Frequency Select Value for SDR50"]
75pub type SDR50SDCLKFREQVAL_R = crate::FieldReader<u16, u16>;
76#[doc = "Field `SDR50CLCKGENVAL` reader - Clock Generator Select Value for SDR50"]
77pub type SDR50CLCKGENVAL_R = crate::BitReader<bool>;
78#[doc = "Driver Strength Select Value for SDR50\n\nValue on reset: 0"]
79#[derive(Clone, Copy, Debug, PartialEq)]
80#[repr(u8)]
81pub enum SDR50DRVSTVAL_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<SDR50DRVSTVAL_A> for u8 {
92 #[inline(always)]
93 fn from(variant: SDR50DRVSTVAL_A) -> Self {
94 variant as _
95 }
96}
97#[doc = "Field `SDR50DRVSTVAL` reader - Driver Strength Select Value for SDR50"]
98pub type SDR50DRVSTVAL_R = crate::FieldReader<u8, SDR50DRVSTVAL_A>;
99impl SDR50DRVSTVAL_R {
100 #[doc = "Get enumerated values variant"]
101 #[inline(always)]
102 pub fn variant(&self) -> SDR50DRVSTVAL_A {
103 match self.bits {
104 0 => SDR50DRVSTVAL_A::TYPEB,
105 1 => SDR50DRVSTVAL_A::TYPEA,
106 2 => SDR50DRVSTVAL_A::TYPEC,
107 3 => SDR50DRVSTVAL_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 == SDR50DRVSTVAL_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 == SDR50DRVSTVAL_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 == SDR50DRVSTVAL_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 == SDR50DRVSTVAL_A::TYPED
130 }
131}
132impl R {
133 #[doc = "Bits 0:9 - SD_CLK Frequency Select Value for SDR25"]
134 #[inline(always)]
135 pub fn sdr25sdclkfreqval(&self) -> SDR25SDCLKFREQVAL_R {
136 SDR25SDCLKFREQVAL_R::new((self.bits & 0x03ff) as u16)
137 }
138 #[doc = "Bit 10 - Clock Generator Select Value for SDR25"]
139 #[inline(always)]
140 pub fn sdr25clkgenval(&self) -> SDR25CLKGENVAL_R {
141 SDR25CLKGENVAL_R::new(((self.bits >> 10) & 1) != 0)
142 }
143 #[doc = "Bits 14:15 - Driver Strength Select Value for SDR25"]
144 #[inline(always)]
145 pub fn sdr25drvstval(&self) -> SDR25DRVSTVAL_R {
146 SDR25DRVSTVAL_R::new(((self.bits >> 14) & 3) as u8)
147 }
148 #[doc = "Bits 16:25 - SD_CLK Frequency Select Value for SDR50"]
149 #[inline(always)]
150 pub fn sdr50sdclkfreqval(&self) -> SDR50SDCLKFREQVAL_R {
151 SDR50SDCLKFREQVAL_R::new(((self.bits >> 16) & 0x03ff) as u16)
152 }
153 #[doc = "Bit 26 - Clock Generator Select Value for SDR50"]
154 #[inline(always)]
155 pub fn sdr50clckgenval(&self) -> SDR50CLCKGENVAL_R {
156 SDR50CLCKGENVAL_R::new(((self.bits >> 26) & 1) != 0)
157 }
158 #[doc = "Bits 30:31 - Driver Strength Select Value for SDR50"]
159 #[inline(always)]
160 pub fn sdr50drvstval(&self) -> SDR50DRVSTVAL_R {
161 SDR50DRVSTVAL_R::new(((self.bits >> 30) & 3) as u8)
162 }
163}
164#[doc = "Preset Value for SDR25 and SDR50 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 [prstval4](index.html) module"]
165pub struct PRSTVAL4_SPEC;
166impl crate::RegisterSpec for PRSTVAL4_SPEC {
167 type Ux = u32;
168}
169#[doc = "`read()` method returns [prstval4::R](R) reader structure"]
170impl crate::Readable for PRSTVAL4_SPEC {
171 type Reader = R;
172}
173#[doc = "`reset()` method sets PRSTVAL4 to value 0"]
174impl crate::Resettable for PRSTVAL4_SPEC {
175 #[inline(always)]
176 fn reset_value() -> Self::Ux {
177 0
178 }
179}