eos_s3/extm4regs/
config_fp2.rs1#[doc = "Register `CONFIG_FP2` reader"]
2pub struct R(crate::R<CONFIG_FP2_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<CONFIG_FP2_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<CONFIG_FP2_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<CONFIG_FP2_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `CONFIG_FP2` writer"]
17pub struct W(crate::W<CONFIG_FP2_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<CONFIG_FP2_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<CONFIG_FP2_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<CONFIG_FP2_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `FPIDZC_EN` reader - Mask exception to cpu; Floating-point divide-by-zero exception"]
38pub struct FPIDZC_EN_R(crate::FieldReader<bool, bool>);
39impl FPIDZC_EN_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: bool) -> Self {
42 FPIDZC_EN_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for FPIDZC_EN_R {
46 type Target = crate::FieldReader<bool, bool>;
47 #[inline(always)]
48 fn deref(&self) -> &Self::Target {
49 &self.0
50 }
51}
52#[doc = "Field `FPIDZC_EN` writer - Mask exception to cpu; Floating-point divide-by-zero exception"]
53pub struct FPIDZC_EN_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> FPIDZC_EN_W<'a> {
57 #[doc = r"Sets the field bit"]
58 #[inline(always)]
59 pub fn set_bit(self) -> &'a mut W {
60 self.bit(true)
61 }
62 #[doc = r"Clears the field bit"]
63 #[inline(always)]
64 pub fn clear_bit(self) -> &'a mut W {
65 self.bit(false)
66 }
67 #[doc = r"Writes raw bits to the field"]
68 #[inline(always)]
69 pub fn bit(self, value: bool) -> &'a mut W {
70 self.w.bits =
71 (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
72 self.w
73 }
74}
75#[doc = "Field `FPIOC_EN` reader - Mask exception to cpu; Floating-point invalid operation exception"]
76pub struct FPIOC_EN_R(crate::FieldReader<bool, bool>);
77impl FPIOC_EN_R {
78 #[inline(always)]
79 pub(crate) fn new(bits: bool) -> Self {
80 FPIOC_EN_R(crate::FieldReader::new(bits))
81 }
82}
83impl core::ops::Deref for FPIOC_EN_R {
84 type Target = crate::FieldReader<bool, bool>;
85 #[inline(always)]
86 fn deref(&self) -> &Self::Target {
87 &self.0
88 }
89}
90#[doc = "Field `FPIOC_EN` writer - Mask exception to cpu; Floating-point invalid operation exception"]
91pub struct FPIOC_EN_W<'a> {
92 w: &'a mut W,
93}
94impl<'a> FPIOC_EN_W<'a> {
95 #[doc = r"Sets the field bit"]
96 #[inline(always)]
97 pub fn set_bit(self) -> &'a mut W {
98 self.bit(true)
99 }
100 #[doc = r"Clears the field bit"]
101 #[inline(always)]
102 pub fn clear_bit(self) -> &'a mut W {
103 self.bit(false)
104 }
105 #[doc = r"Writes raw bits to the field"]
106 #[inline(always)]
107 pub fn bit(self, value: bool) -> &'a mut W {
108 self.w.bits =
109 (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
110 self.w
111 }
112}
113#[doc = "Field `FPIFC_EN` reader - Mask exception to cpu; Floating-point underflow exception"]
114pub struct FPIFC_EN_R(crate::FieldReader<bool, bool>);
115impl FPIFC_EN_R {
116 #[inline(always)]
117 pub(crate) fn new(bits: bool) -> Self {
118 FPIFC_EN_R(crate::FieldReader::new(bits))
119 }
120}
121impl core::ops::Deref for FPIFC_EN_R {
122 type Target = crate::FieldReader<bool, bool>;
123 #[inline(always)]
124 fn deref(&self) -> &Self::Target {
125 &self.0
126 }
127}
128#[doc = "Field `FPIFC_EN` writer - Mask exception to cpu; Floating-point underflow exception"]
129pub struct FPIFC_EN_W<'a> {
130 w: &'a mut W,
131}
132impl<'a> FPIFC_EN_W<'a> {
133 #[doc = r"Sets the field bit"]
134 #[inline(always)]
135 pub fn set_bit(self) -> &'a mut W {
136 self.bit(true)
137 }
138 #[doc = r"Clears the field bit"]
139 #[inline(always)]
140 pub fn clear_bit(self) -> &'a mut W {
141 self.bit(false)
142 }
143 #[doc = r"Writes raw bits to the field"]
144 #[inline(always)]
145 pub fn bit(self, value: bool) -> &'a mut W {
146 self.w.bits =
147 (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
148 self.w
149 }
150}
151#[doc = "Field `FPIDC_EN` reader - Mask exception to cpu; Floating-point overflow exception"]
152pub struct FPIDC_EN_R(crate::FieldReader<bool, bool>);
153impl FPIDC_EN_R {
154 #[inline(always)]
155 pub(crate) fn new(bits: bool) -> Self {
156 FPIDC_EN_R(crate::FieldReader::new(bits))
157 }
158}
159impl core::ops::Deref for FPIDC_EN_R {
160 type Target = crate::FieldReader<bool, bool>;
161 #[inline(always)]
162 fn deref(&self) -> &Self::Target {
163 &self.0
164 }
165}
166#[doc = "Field `FPIDC_EN` writer - Mask exception to cpu; Floating-point overflow exception"]
167pub struct FPIDC_EN_W<'a> {
168 w: &'a mut W,
169}
170impl<'a> FPIDC_EN_W<'a> {
171 #[doc = r"Sets the field bit"]
172 #[inline(always)]
173 pub fn set_bit(self) -> &'a mut W {
174 self.bit(true)
175 }
176 #[doc = r"Clears the field bit"]
177 #[inline(always)]
178 pub fn clear_bit(self) -> &'a mut W {
179 self.bit(false)
180 }
181 #[doc = r"Writes raw bits to the field"]
182 #[inline(always)]
183 pub fn bit(self, value: bool) -> &'a mut W {
184 self.w.bits =
185 (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
186 self.w
187 }
188}
189#[doc = "Field `FPIXC_EN` reader - Mask exception to cpu; Floating-point inexact exception"]
190pub struct FPIXC_EN_R(crate::FieldReader<bool, bool>);
191impl FPIXC_EN_R {
192 #[inline(always)]
193 pub(crate) fn new(bits: bool) -> Self {
194 FPIXC_EN_R(crate::FieldReader::new(bits))
195 }
196}
197impl core::ops::Deref for FPIXC_EN_R {
198 type Target = crate::FieldReader<bool, bool>;
199 #[inline(always)]
200 fn deref(&self) -> &Self::Target {
201 &self.0
202 }
203}
204#[doc = "Field `FPIXC_EN` writer - Mask exception to cpu; Floating-point inexact exception"]
205pub struct FPIXC_EN_W<'a> {
206 w: &'a mut W,
207}
208impl<'a> FPIXC_EN_W<'a> {
209 #[doc = r"Sets the field bit"]
210 #[inline(always)]
211 pub fn set_bit(self) -> &'a mut W {
212 self.bit(true)
213 }
214 #[doc = r"Clears the field bit"]
215 #[inline(always)]
216 pub fn clear_bit(self) -> &'a mut W {
217 self.bit(false)
218 }
219 #[doc = r"Writes raw bits to the field"]
220 #[inline(always)]
221 pub fn bit(self, value: bool) -> &'a mut W {
222 self.w.bits =
223 (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
224 self.w
225 }
226}
227impl R {
228 #[doc = "Bit 1 - Mask exception to cpu; Floating-point divide-by-zero exception"]
229 #[inline(always)]
230 pub fn fpidzc_en(&self) -> FPIDZC_EN_R {
231 FPIDZC_EN_R::new(((self.bits >> 1) & 0x01) != 0)
232 }
233 #[doc = "Bit 2 - Mask exception to cpu; Floating-point invalid operation exception"]
234 #[inline(always)]
235 pub fn fpioc_en(&self) -> FPIOC_EN_R {
236 FPIOC_EN_R::new(((self.bits >> 2) & 0x01) != 0)
237 }
238 #[doc = "Bit 3 - Mask exception to cpu; Floating-point underflow exception"]
239 #[inline(always)]
240 pub fn fpifc_en(&self) -> FPIFC_EN_R {
241 FPIFC_EN_R::new(((self.bits >> 3) & 0x01) != 0)
242 }
243 #[doc = "Bit 4 - Mask exception to cpu; Floating-point overflow exception"]
244 #[inline(always)]
245 pub fn fpidc_en(&self) -> FPIDC_EN_R {
246 FPIDC_EN_R::new(((self.bits >> 4) & 0x01) != 0)
247 }
248 #[doc = "Bit 5 - Mask exception to cpu; Floating-point inexact exception"]
249 #[inline(always)]
250 pub fn fpixc_en(&self) -> FPIXC_EN_R {
251 FPIXC_EN_R::new(((self.bits >> 5) & 0x01) != 0)
252 }
253}
254impl W {
255 #[doc = "Bit 1 - Mask exception to cpu; Floating-point divide-by-zero exception"]
256 #[inline(always)]
257 pub fn fpidzc_en(&mut self) -> FPIDZC_EN_W {
258 FPIDZC_EN_W { w: self }
259 }
260 #[doc = "Bit 2 - Mask exception to cpu; Floating-point invalid operation exception"]
261 #[inline(always)]
262 pub fn fpioc_en(&mut self) -> FPIOC_EN_W {
263 FPIOC_EN_W { w: self }
264 }
265 #[doc = "Bit 3 - Mask exception to cpu; Floating-point underflow exception"]
266 #[inline(always)]
267 pub fn fpifc_en(&mut self) -> FPIFC_EN_W {
268 FPIFC_EN_W { w: self }
269 }
270 #[doc = "Bit 4 - Mask exception to cpu; Floating-point overflow exception"]
271 #[inline(always)]
272 pub fn fpidc_en(&mut self) -> FPIDC_EN_W {
273 FPIDC_EN_W { w: self }
274 }
275 #[doc = "Bit 5 - Mask exception to cpu; Floating-point inexact exception"]
276 #[inline(always)]
277 pub fn fpixc_en(&mut self) -> FPIXC_EN_W {
278 FPIXC_EN_W { w: self }
279 }
280 #[doc = "Writes raw bits to the register."]
281 #[inline(always)]
282 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
283 self.0.bits(bits);
284 self
285 }
286}
287#[doc = "FPU configuration register 2\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [config_fp2](index.html) module"]
288pub struct CONFIG_FP2_SPEC;
289impl crate::RegisterSpec for CONFIG_FP2_SPEC {
290 type Ux = u32;
291}
292#[doc = "`read()` method returns [config_fp2::R](R) reader structure"]
293impl crate::Readable for CONFIG_FP2_SPEC {
294 type Reader = R;
295}
296#[doc = "`write(|w| ..)` method takes [config_fp2::W](W) writer structure"]
297impl crate::Writable for CONFIG_FP2_SPEC {
298 type Writer = W;
299}
300#[doc = "`reset()` method sets CONFIG_FP2 to value 0"]
301impl crate::Resettable for CONFIG_FP2_SPEC {
302 #[inline(always)]
303 fn reset_value() -> Self::Ux {
304 0
305 }
306}