1#[doc = "Register `IO_OUTPUT` reader"]
2pub struct R(crate::R<IO_OUTPUT_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<IO_OUTPUT_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<IO_OUTPUT_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<IO_OUTPUT_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `IO_OUTPUT` writer"]
17pub struct W(crate::W<IO_OUTPUT_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<IO_OUTPUT_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<IO_OUTPUT_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<IO_OUTPUT_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `IO_0` reader - Write digital value of pin mapped to IO bit 0"]
38pub struct IO_0_R(crate::FieldReader<bool, bool>);
39impl IO_0_R {
40 #[inline(always)]
41 pub(crate) fn new(bits: bool) -> Self {
42 IO_0_R(crate::FieldReader::new(bits))
43 }
44}
45impl core::ops::Deref for IO_0_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 `IO_0` writer - Write digital value of pin mapped to IO bit 0"]
53pub struct IO_0_W<'a> {
54 w: &'a mut W,
55}
56impl<'a> IO_0_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 = (self.w.bits & !0x01) | (value as u32 & 0x01);
71 self.w
72 }
73}
74#[doc = "Field `IO_1` reader - Write digital value of pin mapped to IO bit 1"]
75pub struct IO_1_R(crate::FieldReader<bool, bool>);
76impl IO_1_R {
77 #[inline(always)]
78 pub(crate) fn new(bits: bool) -> Self {
79 IO_1_R(crate::FieldReader::new(bits))
80 }
81}
82impl core::ops::Deref for IO_1_R {
83 type Target = crate::FieldReader<bool, bool>;
84 #[inline(always)]
85 fn deref(&self) -> &Self::Target {
86 &self.0
87 }
88}
89#[doc = "Field `IO_1` writer - Write digital value of pin mapped to IO bit 1"]
90pub struct IO_1_W<'a> {
91 w: &'a mut W,
92}
93impl<'a> IO_1_W<'a> {
94 #[doc = r"Sets the field bit"]
95 #[inline(always)]
96 pub fn set_bit(self) -> &'a mut W {
97 self.bit(true)
98 }
99 #[doc = r"Clears the field bit"]
100 #[inline(always)]
101 pub fn clear_bit(self) -> &'a mut W {
102 self.bit(false)
103 }
104 #[doc = r"Writes raw bits to the field"]
105 #[inline(always)]
106 pub fn bit(self, value: bool) -> &'a mut W {
107 self.w.bits =
108 (self.w.bits & !(0x01 << 1)) | ((value as u32 & 0x01) << 1);
109 self.w
110 }
111}
112#[doc = "Field `IO_2` reader - Write digital value of pin mapped to IO bit 2"]
113pub struct IO_2_R(crate::FieldReader<bool, bool>);
114impl IO_2_R {
115 #[inline(always)]
116 pub(crate) fn new(bits: bool) -> Self {
117 IO_2_R(crate::FieldReader::new(bits))
118 }
119}
120impl core::ops::Deref for IO_2_R {
121 type Target = crate::FieldReader<bool, bool>;
122 #[inline(always)]
123 fn deref(&self) -> &Self::Target {
124 &self.0
125 }
126}
127#[doc = "Field `IO_2` writer - Write digital value of pin mapped to IO bit 2"]
128pub struct IO_2_W<'a> {
129 w: &'a mut W,
130}
131impl<'a> IO_2_W<'a> {
132 #[doc = r"Sets the field bit"]
133 #[inline(always)]
134 pub fn set_bit(self) -> &'a mut W {
135 self.bit(true)
136 }
137 #[doc = r"Clears the field bit"]
138 #[inline(always)]
139 pub fn clear_bit(self) -> &'a mut W {
140 self.bit(false)
141 }
142 #[doc = r"Writes raw bits to the field"]
143 #[inline(always)]
144 pub fn bit(self, value: bool) -> &'a mut W {
145 self.w.bits =
146 (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
147 self.w
148 }
149}
150#[doc = "Field `IO_3` reader - Write digital value of pin mapped to IO bit 3"]
151pub struct IO_3_R(crate::FieldReader<bool, bool>);
152impl IO_3_R {
153 #[inline(always)]
154 pub(crate) fn new(bits: bool) -> Self {
155 IO_3_R(crate::FieldReader::new(bits))
156 }
157}
158impl core::ops::Deref for IO_3_R {
159 type Target = crate::FieldReader<bool, bool>;
160 #[inline(always)]
161 fn deref(&self) -> &Self::Target {
162 &self.0
163 }
164}
165#[doc = "Field `IO_3` writer - Write digital value of pin mapped to IO bit 3"]
166pub struct IO_3_W<'a> {
167 w: &'a mut W,
168}
169impl<'a> IO_3_W<'a> {
170 #[doc = r"Sets the field bit"]
171 #[inline(always)]
172 pub fn set_bit(self) -> &'a mut W {
173 self.bit(true)
174 }
175 #[doc = r"Clears the field bit"]
176 #[inline(always)]
177 pub fn clear_bit(self) -> &'a mut W {
178 self.bit(false)
179 }
180 #[doc = r"Writes raw bits to the field"]
181 #[inline(always)]
182 pub fn bit(self, value: bool) -> &'a mut W {
183 self.w.bits =
184 (self.w.bits & !(0x01 << 3)) | ((value as u32 & 0x01) << 3);
185 self.w
186 }
187}
188#[doc = "Field `IO_4` reader - Write digital value of pin mapped to IO bit 4"]
189pub struct IO_4_R(crate::FieldReader<bool, bool>);
190impl IO_4_R {
191 #[inline(always)]
192 pub(crate) fn new(bits: bool) -> Self {
193 IO_4_R(crate::FieldReader::new(bits))
194 }
195}
196impl core::ops::Deref for IO_4_R {
197 type Target = crate::FieldReader<bool, bool>;
198 #[inline(always)]
199 fn deref(&self) -> &Self::Target {
200 &self.0
201 }
202}
203#[doc = "Field `IO_4` writer - Write digital value of pin mapped to IO bit 4"]
204pub struct IO_4_W<'a> {
205 w: &'a mut W,
206}
207impl<'a> IO_4_W<'a> {
208 #[doc = r"Sets the field bit"]
209 #[inline(always)]
210 pub fn set_bit(self) -> &'a mut W {
211 self.bit(true)
212 }
213 #[doc = r"Clears the field bit"]
214 #[inline(always)]
215 pub fn clear_bit(self) -> &'a mut W {
216 self.bit(false)
217 }
218 #[doc = r"Writes raw bits to the field"]
219 #[inline(always)]
220 pub fn bit(self, value: bool) -> &'a mut W {
221 self.w.bits =
222 (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
223 self.w
224 }
225}
226#[doc = "Field `IO_5` reader - Write digital value of pin mapped to IO bit 5"]
227pub struct IO_5_R(crate::FieldReader<bool, bool>);
228impl IO_5_R {
229 #[inline(always)]
230 pub(crate) fn new(bits: bool) -> Self {
231 IO_5_R(crate::FieldReader::new(bits))
232 }
233}
234impl core::ops::Deref for IO_5_R {
235 type Target = crate::FieldReader<bool, bool>;
236 #[inline(always)]
237 fn deref(&self) -> &Self::Target {
238 &self.0
239 }
240}
241#[doc = "Field `IO_5` writer - Write digital value of pin mapped to IO bit 5"]
242pub struct IO_5_W<'a> {
243 w: &'a mut W,
244}
245impl<'a> IO_5_W<'a> {
246 #[doc = r"Sets the field bit"]
247 #[inline(always)]
248 pub fn set_bit(self) -> &'a mut W {
249 self.bit(true)
250 }
251 #[doc = r"Clears the field bit"]
252 #[inline(always)]
253 pub fn clear_bit(self) -> &'a mut W {
254 self.bit(false)
255 }
256 #[doc = r"Writes raw bits to the field"]
257 #[inline(always)]
258 pub fn bit(self, value: bool) -> &'a mut W {
259 self.w.bits =
260 (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
261 self.w
262 }
263}
264#[doc = "Field `IO_6` reader - Write digital value of pin mapped to IO bit 6"]
265pub struct IO_6_R(crate::FieldReader<bool, bool>);
266impl IO_6_R {
267 #[inline(always)]
268 pub(crate) fn new(bits: bool) -> Self {
269 IO_6_R(crate::FieldReader::new(bits))
270 }
271}
272impl core::ops::Deref for IO_6_R {
273 type Target = crate::FieldReader<bool, bool>;
274 #[inline(always)]
275 fn deref(&self) -> &Self::Target {
276 &self.0
277 }
278}
279#[doc = "Field `IO_6` writer - Write digital value of pin mapped to IO bit 6"]
280pub struct IO_6_W<'a> {
281 w: &'a mut W,
282}
283impl<'a> IO_6_W<'a> {
284 #[doc = r"Sets the field bit"]
285 #[inline(always)]
286 pub fn set_bit(self) -> &'a mut W {
287 self.bit(true)
288 }
289 #[doc = r"Clears the field bit"]
290 #[inline(always)]
291 pub fn clear_bit(self) -> &'a mut W {
292 self.bit(false)
293 }
294 #[doc = r"Writes raw bits to the field"]
295 #[inline(always)]
296 pub fn bit(self, value: bool) -> &'a mut W {
297 self.w.bits =
298 (self.w.bits & !(0x01 << 6)) | ((value as u32 & 0x01) << 6);
299 self.w
300 }
301}
302#[doc = "Field `IO_7` reader - Write digital value of pin mapped to IO bit 7"]
303pub struct IO_7_R(crate::FieldReader<bool, bool>);
304impl IO_7_R {
305 #[inline(always)]
306 pub(crate) fn new(bits: bool) -> Self {
307 IO_7_R(crate::FieldReader::new(bits))
308 }
309}
310impl core::ops::Deref for IO_7_R {
311 type Target = crate::FieldReader<bool, bool>;
312 #[inline(always)]
313 fn deref(&self) -> &Self::Target {
314 &self.0
315 }
316}
317#[doc = "Field `IO_7` writer - Write digital value of pin mapped to IO bit 7"]
318pub struct IO_7_W<'a> {
319 w: &'a mut W,
320}
321impl<'a> IO_7_W<'a> {
322 #[doc = r"Sets the field bit"]
323 #[inline(always)]
324 pub fn set_bit(self) -> &'a mut W {
325 self.bit(true)
326 }
327 #[doc = r"Clears the field bit"]
328 #[inline(always)]
329 pub fn clear_bit(self) -> &'a mut W {
330 self.bit(false)
331 }
332 #[doc = r"Writes raw bits to the field"]
333 #[inline(always)]
334 pub fn bit(self, value: bool) -> &'a mut W {
335 self.w.bits =
336 (self.w.bits & !(0x01 << 7)) | ((value as u32 & 0x01) << 7);
337 self.w
338 }
339}
340impl R {
341 #[doc = "Bit 0 - Write digital value of pin mapped to IO bit 0"]
342 #[inline(always)]
343 pub fn io_0(&self) -> IO_0_R {
344 IO_0_R::new((self.bits & 0x01) != 0)
345 }
346 #[doc = "Bit 1 - Write digital value of pin mapped to IO bit 1"]
347 #[inline(always)]
348 pub fn io_1(&self) -> IO_1_R {
349 IO_1_R::new(((self.bits >> 1) & 0x01) != 0)
350 }
351 #[doc = "Bit 2 - Write digital value of pin mapped to IO bit 2"]
352 #[inline(always)]
353 pub fn io_2(&self) -> IO_2_R {
354 IO_2_R::new(((self.bits >> 2) & 0x01) != 0)
355 }
356 #[doc = "Bit 3 - Write digital value of pin mapped to IO bit 3"]
357 #[inline(always)]
358 pub fn io_3(&self) -> IO_3_R {
359 IO_3_R::new(((self.bits >> 3) & 0x01) != 0)
360 }
361 #[doc = "Bit 4 - Write digital value of pin mapped to IO bit 4"]
362 #[inline(always)]
363 pub fn io_4(&self) -> IO_4_R {
364 IO_4_R::new(((self.bits >> 4) & 0x01) != 0)
365 }
366 #[doc = "Bit 5 - Write digital value of pin mapped to IO bit 5"]
367 #[inline(always)]
368 pub fn io_5(&self) -> IO_5_R {
369 IO_5_R::new(((self.bits >> 5) & 0x01) != 0)
370 }
371 #[doc = "Bit 6 - Write digital value of pin mapped to IO bit 6"]
372 #[inline(always)]
373 pub fn io_6(&self) -> IO_6_R {
374 IO_6_R::new(((self.bits >> 6) & 0x01) != 0)
375 }
376 #[doc = "Bit 7 - Write digital value of pin mapped to IO bit 7"]
377 #[inline(always)]
378 pub fn io_7(&self) -> IO_7_R {
379 IO_7_R::new(((self.bits >> 7) & 0x01) != 0)
380 }
381}
382impl W {
383 #[doc = "Bit 0 - Write digital value of pin mapped to IO bit 0"]
384 #[inline(always)]
385 pub fn io_0(&mut self) -> IO_0_W {
386 IO_0_W { w: self }
387 }
388 #[doc = "Bit 1 - Write digital value of pin mapped to IO bit 1"]
389 #[inline(always)]
390 pub fn io_1(&mut self) -> IO_1_W {
391 IO_1_W { w: self }
392 }
393 #[doc = "Bit 2 - Write digital value of pin mapped to IO bit 2"]
394 #[inline(always)]
395 pub fn io_2(&mut self) -> IO_2_W {
396 IO_2_W { w: self }
397 }
398 #[doc = "Bit 3 - Write digital value of pin mapped to IO bit 3"]
399 #[inline(always)]
400 pub fn io_3(&mut self) -> IO_3_W {
401 IO_3_W { w: self }
402 }
403 #[doc = "Bit 4 - Write digital value of pin mapped to IO bit 4"]
404 #[inline(always)]
405 pub fn io_4(&mut self) -> IO_4_W {
406 IO_4_W { w: self }
407 }
408 #[doc = "Bit 5 - Write digital value of pin mapped to IO bit 5"]
409 #[inline(always)]
410 pub fn io_5(&mut self) -> IO_5_W {
411 IO_5_W { w: self }
412 }
413 #[doc = "Bit 6 - Write digital value of pin mapped to IO bit 6"]
414 #[inline(always)]
415 pub fn io_6(&mut self) -> IO_6_W {
416 IO_6_W { w: self }
417 }
418 #[doc = "Bit 7 - Write digital value of pin mapped to IO bit 7"]
419 #[inline(always)]
420 pub fn io_7(&mut self) -> IO_7_W {
421 IO_7_W { w: self }
422 }
423 #[doc = "Writes raw bits to the register."]
424 #[inline(always)]
425 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
426 self.0.bits(bits);
427 self
428 }
429}
430#[doc = "Allows FW to drive the IO with the values specified in this register\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 [io_output](index.html) module"]
431pub struct IO_OUTPUT_SPEC;
432impl crate::RegisterSpec for IO_OUTPUT_SPEC {
433 type Ux = u32;
434}
435#[doc = "`read()` method returns [io_output::R](R) reader structure"]
436impl crate::Readable for IO_OUTPUT_SPEC {
437 type Reader = R;
438}
439#[doc = "`write(|w| ..)` method takes [io_output::W](W) writer structure"]
440impl crate::Writable for IO_OUTPUT_SPEC {
441 type Writer = W;
442}
443#[doc = "`reset()` method sets IO_OUTPUT to value 0"]
444impl crate::Resettable for IO_OUTPUT_SPEC {
445 #[inline(always)]
446 fn reset_value() -> Self::Ux {
447 0
448 }
449}