1#[doc = "Register `PAD_%s_CTRL` reader"]
2pub struct R(crate::R<PAD__CTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<PAD__CTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<PAD__CTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<PAD__CTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `PAD_%s_CTRL` writer"]
17pub struct W(crate::W<PAD__CTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<PAD__CTRL_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<PAD__CTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<PAD__CTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Functional selection for IO output. Refer to IO Mux\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum FUNC_SEL_A {
41 #[doc = "0: Select alternative function 0"]
42 ALTERNATIVE_0 = 0,
43 #[doc = "1: Select alternative function 1"]
44 ALTERNATIVE_1 = 1,
45 #[doc = "2: Select alternative function 2"]
46 ALTERNATIVE_2 = 2,
47 #[doc = "3: Select alternative function 3"]
48 ALTERNATIVE_3 = 3,
49}
50impl From<FUNC_SEL_A> for u8 {
51 #[inline(always)]
52 fn from(variant: FUNC_SEL_A) -> Self {
53 variant as _
54 }
55}
56#[doc = "Field `FUNC_SEL` reader - Functional selection for IO output. Refer to IO Mux"]
57pub struct FUNC_SEL_R(crate::FieldReader<u8, FUNC_SEL_A>);
58impl FUNC_SEL_R {
59 #[inline(always)]
60 pub(crate) fn new(bits: u8) -> Self {
61 FUNC_SEL_R(crate::FieldReader::new(bits))
62 }
63 #[doc = r"Get enumerated values variant"]
64 #[inline(always)]
65 pub fn variant(&self) -> FUNC_SEL_A {
66 match self.bits {
67 0 => FUNC_SEL_A::ALTERNATIVE_0,
68 1 => FUNC_SEL_A::ALTERNATIVE_1,
69 2 => FUNC_SEL_A::ALTERNATIVE_2,
70 3 => FUNC_SEL_A::ALTERNATIVE_3,
71 _ => unreachable!(),
72 }
73 }
74 #[doc = "Checks if the value of the field is `ALTERNATIVE_0`"]
75 #[inline(always)]
76 pub fn is_alternative_0(&self) -> bool {
77 **self == FUNC_SEL_A::ALTERNATIVE_0
78 }
79 #[doc = "Checks if the value of the field is `ALTERNATIVE_1`"]
80 #[inline(always)]
81 pub fn is_alternative_1(&self) -> bool {
82 **self == FUNC_SEL_A::ALTERNATIVE_1
83 }
84 #[doc = "Checks if the value of the field is `ALTERNATIVE_2`"]
85 #[inline(always)]
86 pub fn is_alternative_2(&self) -> bool {
87 **self == FUNC_SEL_A::ALTERNATIVE_2
88 }
89 #[doc = "Checks if the value of the field is `ALTERNATIVE_3`"]
90 #[inline(always)]
91 pub fn is_alternative_3(&self) -> bool {
92 **self == FUNC_SEL_A::ALTERNATIVE_3
93 }
94}
95impl core::ops::Deref for FUNC_SEL_R {
96 type Target = crate::FieldReader<u8, FUNC_SEL_A>;
97 #[inline(always)]
98 fn deref(&self) -> &Self::Target {
99 &self.0
100 }
101}
102#[doc = "Field `FUNC_SEL` writer - Functional selection for IO output. Refer to IO Mux"]
103pub struct FUNC_SEL_W<'a> {
104 w: &'a mut W,
105}
106impl<'a> FUNC_SEL_W<'a> {
107 #[doc = r"Writes `variant` to the field"]
108 #[inline(always)]
109 pub fn variant(self, variant: FUNC_SEL_A) -> &'a mut W {
110 self.bits(variant.into())
111 }
112 #[doc = "Select alternative function 0"]
113 #[inline(always)]
114 pub fn alternative_0(self) -> &'a mut W {
115 self.variant(FUNC_SEL_A::ALTERNATIVE_0)
116 }
117 #[doc = "Select alternative function 1"]
118 #[inline(always)]
119 pub fn alternative_1(self) -> &'a mut W {
120 self.variant(FUNC_SEL_A::ALTERNATIVE_1)
121 }
122 #[doc = "Select alternative function 2"]
123 #[inline(always)]
124 pub fn alternative_2(self) -> &'a mut W {
125 self.variant(FUNC_SEL_A::ALTERNATIVE_2)
126 }
127 #[doc = "Select alternative function 3"]
128 #[inline(always)]
129 pub fn alternative_3(self) -> &'a mut W {
130 self.variant(FUNC_SEL_A::ALTERNATIVE_3)
131 }
132 #[doc = r"Writes raw bits to the field"]
133 #[inline(always)]
134 pub fn bits(self, value: u8) -> &'a mut W {
135 self.w.bits = (self.w.bits & !0x03) | (value as u32 & 0x03);
136 self.w
137 }
138}
139#[doc = "Control selection for IO Output. 0x0 = A0 registers, 0x1 = Others, 0x2 = Fabric\n\nValue on reset: 0"]
140#[derive(Clone, Copy, Debug, PartialEq)]
141#[repr(u8)]
142pub enum CTRL_SEL_A {
143 #[doc = "0: A0 registers"]
144 A0_REGISTERS = 0,
145 #[doc = "1: Others"]
146 OTHERS = 1,
147 #[doc = "2: Fabric"]
148 FABRIC = 2,
149}
150impl From<CTRL_SEL_A> for u8 {
151 #[inline(always)]
152 fn from(variant: CTRL_SEL_A) -> Self {
153 variant as _
154 }
155}
156#[doc = "Field `CTRL_SEL` reader - Control selection for IO Output. 0x0 = A0 registers, 0x1 = Others, 0x2 = Fabric"]
157pub struct CTRL_SEL_R(crate::FieldReader<u8, CTRL_SEL_A>);
158impl CTRL_SEL_R {
159 #[inline(always)]
160 pub(crate) fn new(bits: u8) -> Self {
161 CTRL_SEL_R(crate::FieldReader::new(bits))
162 }
163 #[doc = r"Get enumerated values variant"]
164 #[inline(always)]
165 pub fn variant(&self) -> Option<CTRL_SEL_A> {
166 match self.bits {
167 0 => Some(CTRL_SEL_A::A0_REGISTERS),
168 1 => Some(CTRL_SEL_A::OTHERS),
169 2 => Some(CTRL_SEL_A::FABRIC),
170 _ => None,
171 }
172 }
173 #[doc = "Checks if the value of the field is `A0_REGISTERS`"]
174 #[inline(always)]
175 pub fn is_a0_registers(&self) -> bool {
176 **self == CTRL_SEL_A::A0_REGISTERS
177 }
178 #[doc = "Checks if the value of the field is `OTHERS`"]
179 #[inline(always)]
180 pub fn is_others(&self) -> bool {
181 **self == CTRL_SEL_A::OTHERS
182 }
183 #[doc = "Checks if the value of the field is `FABRIC`"]
184 #[inline(always)]
185 pub fn is_fabric(&self) -> bool {
186 **self == CTRL_SEL_A::FABRIC
187 }
188}
189impl core::ops::Deref for CTRL_SEL_R {
190 type Target = crate::FieldReader<u8, CTRL_SEL_A>;
191 #[inline(always)]
192 fn deref(&self) -> &Self::Target {
193 &self.0
194 }
195}
196#[doc = "Field `CTRL_SEL` writer - Control selection for IO Output. 0x0 = A0 registers, 0x1 = Others, 0x2 = Fabric"]
197pub struct CTRL_SEL_W<'a> {
198 w: &'a mut W,
199}
200impl<'a> CTRL_SEL_W<'a> {
201 #[doc = r"Writes `variant` to the field"]
202 #[inline(always)]
203 pub fn variant(self, variant: CTRL_SEL_A) -> &'a mut W {
204 unsafe { self.bits(variant.into()) }
205 }
206 #[doc = "A0 registers"]
207 #[inline(always)]
208 pub fn a0_registers(self) -> &'a mut W {
209 self.variant(CTRL_SEL_A::A0_REGISTERS)
210 }
211 #[doc = "Others"]
212 #[inline(always)]
213 pub fn others(self) -> &'a mut W {
214 self.variant(CTRL_SEL_A::OTHERS)
215 }
216 #[doc = "Fabric"]
217 #[inline(always)]
218 pub fn fabric(self) -> &'a mut W {
219 self.variant(CTRL_SEL_A::FABRIC)
220 }
221 #[doc = r"Writes raw bits to the field"]
222 #[inline(always)]
223 pub unsafe fn bits(self, value: u8) -> &'a mut W {
224 self.w.bits =
225 (self.w.bits & !(0x03 << 3)) | ((value as u32 & 0x03) << 3);
226 self.w
227 }
228}
229#[doc = "Active low output enable\n\nValue on reset: 0"]
230#[derive(Clone, Copy, Debug, PartialEq)]
231pub enum OEN_A {
232 #[doc = "0: normal operation"]
233 NORMAL_OPERATION = 0,
234 #[doc = "1: driver disabled"]
235 DRIVER_DISABLED = 1,
236}
237impl From<OEN_A> for bool {
238 #[inline(always)]
239 fn from(variant: OEN_A) -> Self {
240 variant as u8 != 0
241 }
242}
243#[doc = "Field `OEN` reader - Active low output enable"]
244pub struct OEN_R(crate::FieldReader<bool, OEN_A>);
245impl OEN_R {
246 #[inline(always)]
247 pub(crate) fn new(bits: bool) -> Self {
248 OEN_R(crate::FieldReader::new(bits))
249 }
250 #[doc = r"Get enumerated values variant"]
251 #[inline(always)]
252 pub fn variant(&self) -> OEN_A {
253 match self.bits {
254 false => OEN_A::NORMAL_OPERATION,
255 true => OEN_A::DRIVER_DISABLED,
256 }
257 }
258 #[doc = "Checks if the value of the field is `NORMAL_OPERATION`"]
259 #[inline(always)]
260 pub fn is_normal_operation(&self) -> bool {
261 **self == OEN_A::NORMAL_OPERATION
262 }
263 #[doc = "Checks if the value of the field is `DRIVER_DISABLED`"]
264 #[inline(always)]
265 pub fn is_driver_disabled(&self) -> bool {
266 **self == OEN_A::DRIVER_DISABLED
267 }
268}
269impl core::ops::Deref for OEN_R {
270 type Target = crate::FieldReader<bool, OEN_A>;
271 #[inline(always)]
272 fn deref(&self) -> &Self::Target {
273 &self.0
274 }
275}
276#[doc = "Field `OEN` writer - Active low output enable"]
277pub struct OEN_W<'a> {
278 w: &'a mut W,
279}
280impl<'a> OEN_W<'a> {
281 #[doc = r"Writes `variant` to the field"]
282 #[inline(always)]
283 pub fn variant(self, variant: OEN_A) -> &'a mut W {
284 self.bit(variant.into())
285 }
286 #[doc = "normal operation"]
287 #[inline(always)]
288 pub fn normal_operation(self) -> &'a mut W {
289 self.variant(OEN_A::NORMAL_OPERATION)
290 }
291 #[doc = "driver disabled"]
292 #[inline(always)]
293 pub fn driver_disabled(self) -> &'a mut W {
294 self.variant(OEN_A::DRIVER_DISABLED)
295 }
296 #[doc = r"Sets the field bit"]
297 #[inline(always)]
298 pub fn set_bit(self) -> &'a mut W {
299 self.bit(true)
300 }
301 #[doc = r"Clears the field bit"]
302 #[inline(always)]
303 pub fn clear_bit(self) -> &'a mut W {
304 self.bit(false)
305 }
306 #[doc = r"Writes raw bits to the field"]
307 #[inline(always)]
308 pub fn bit(self, value: bool) -> &'a mut W {
309 self.w.bits =
310 (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
311 self.w
312 }
313}
314#[doc = "Driver state control\n\nValue on reset: 0"]
315#[derive(Clone, Copy, Debug, PartialEq)]
316#[repr(u8)]
317pub enum P_A {
318 #[doc = "0: floating, high impedance"]
319 Z = 0,
320 #[doc = "1: pull-up mode"]
321 PULL_UP = 1,
322 #[doc = "2: pull-down mode"]
323 PULL_DOWN = 2,
324 #[doc = "3: bus keeper mode"]
325 KEEPER = 3,
326}
327impl From<P_A> for u8 {
328 #[inline(always)]
329 fn from(variant: P_A) -> Self {
330 variant as _
331 }
332}
333#[doc = "Field `P` reader - Driver state control"]
334pub struct P_R(crate::FieldReader<u8, P_A>);
335impl P_R {
336 #[inline(always)]
337 pub(crate) fn new(bits: u8) -> Self {
338 P_R(crate::FieldReader::new(bits))
339 }
340 #[doc = r"Get enumerated values variant"]
341 #[inline(always)]
342 pub fn variant(&self) -> P_A {
343 match self.bits {
344 0 => P_A::Z,
345 1 => P_A::PULL_UP,
346 2 => P_A::PULL_DOWN,
347 3 => P_A::KEEPER,
348 _ => unreachable!(),
349 }
350 }
351 #[doc = "Checks if the value of the field is `Z`"]
352 #[inline(always)]
353 pub fn is_z(&self) -> bool {
354 **self == P_A::Z
355 }
356 #[doc = "Checks if the value of the field is `PULL_UP`"]
357 #[inline(always)]
358 pub fn is_pull_up(&self) -> bool {
359 **self == P_A::PULL_UP
360 }
361 #[doc = "Checks if the value of the field is `PULL_DOWN`"]
362 #[inline(always)]
363 pub fn is_pull_down(&self) -> bool {
364 **self == P_A::PULL_DOWN
365 }
366 #[doc = "Checks if the value of the field is `KEEPER`"]
367 #[inline(always)]
368 pub fn is_keeper(&self) -> bool {
369 **self == P_A::KEEPER
370 }
371}
372impl core::ops::Deref for P_R {
373 type Target = crate::FieldReader<u8, P_A>;
374 #[inline(always)]
375 fn deref(&self) -> &Self::Target {
376 &self.0
377 }
378}
379#[doc = "Field `P` writer - Driver state control"]
380pub struct P_W<'a> {
381 w: &'a mut W,
382}
383impl<'a> P_W<'a> {
384 #[doc = r"Writes `variant` to the field"]
385 #[inline(always)]
386 pub fn variant(self, variant: P_A) -> &'a mut W {
387 self.bits(variant.into())
388 }
389 #[doc = "floating, high impedance"]
390 #[inline(always)]
391 pub fn z(self) -> &'a mut W {
392 self.variant(P_A::Z)
393 }
394 #[doc = "pull-up mode"]
395 #[inline(always)]
396 pub fn pull_up(self) -> &'a mut W {
397 self.variant(P_A::PULL_UP)
398 }
399 #[doc = "pull-down mode"]
400 #[inline(always)]
401 pub fn pull_down(self) -> &'a mut W {
402 self.variant(P_A::PULL_DOWN)
403 }
404 #[doc = "bus keeper mode"]
405 #[inline(always)]
406 pub fn keeper(self) -> &'a mut W {
407 self.variant(P_A::KEEPER)
408 }
409 #[doc = r"Writes raw bits to the field"]
410 #[inline(always)]
411 pub fn bits(self, value: u8) -> &'a mut W {
412 self.w.bits =
413 (self.w.bits & !(0x03 << 6)) | ((value as u32 & 0x03) << 6);
414 self.w
415 }
416}
417#[doc = "Driver Strenght\n\nValue on reset: 0"]
418#[derive(Clone, Copy, Debug, PartialEq)]
419#[repr(u8)]
420pub enum E_A {
421 #[doc = "0: Configures the drive current at 2mA"]
422 CURRENT_2MA = 0,
423 #[doc = "1: Configures the drive current at 4mA"]
424 CURRENT_4MA = 1,
425 #[doc = "2: Configures the drive current at 8mA"]
426 CURRENT_8MA = 2,
427 #[doc = "3: Configures the drive current at 12mA"]
428 CURRENT_12MA = 3,
429}
430impl From<E_A> for u8 {
431 #[inline(always)]
432 fn from(variant: E_A) -> Self {
433 variant as _
434 }
435}
436#[doc = "Field `E` reader - Driver Strenght"]
437pub struct E_R(crate::FieldReader<u8, E_A>);
438impl E_R {
439 #[inline(always)]
440 pub(crate) fn new(bits: u8) -> Self {
441 E_R(crate::FieldReader::new(bits))
442 }
443 #[doc = r"Get enumerated values variant"]
444 #[inline(always)]
445 pub fn variant(&self) -> E_A {
446 match self.bits {
447 0 => E_A::CURRENT_2MA,
448 1 => E_A::CURRENT_4MA,
449 2 => E_A::CURRENT_8MA,
450 3 => E_A::CURRENT_12MA,
451 _ => unreachable!(),
452 }
453 }
454 #[doc = "Checks if the value of the field is `CURRENT_2MA`"]
455 #[inline(always)]
456 pub fn is_current_2ma(&self) -> bool {
457 **self == E_A::CURRENT_2MA
458 }
459 #[doc = "Checks if the value of the field is `CURRENT_4MA`"]
460 #[inline(always)]
461 pub fn is_current_4ma(&self) -> bool {
462 **self == E_A::CURRENT_4MA
463 }
464 #[doc = "Checks if the value of the field is `CURRENT_8MA`"]
465 #[inline(always)]
466 pub fn is_current_8ma(&self) -> bool {
467 **self == E_A::CURRENT_8MA
468 }
469 #[doc = "Checks if the value of the field is `CURRENT_12MA`"]
470 #[inline(always)]
471 pub fn is_current_12ma(&self) -> bool {
472 **self == E_A::CURRENT_12MA
473 }
474}
475impl core::ops::Deref for E_R {
476 type Target = crate::FieldReader<u8, E_A>;
477 #[inline(always)]
478 fn deref(&self) -> &Self::Target {
479 &self.0
480 }
481}
482#[doc = "Field `E` writer - Driver Strenght"]
483pub struct E_W<'a> {
484 w: &'a mut W,
485}
486impl<'a> E_W<'a> {
487 #[doc = r"Writes `variant` to the field"]
488 #[inline(always)]
489 pub fn variant(self, variant: E_A) -> &'a mut W {
490 self.bits(variant.into())
491 }
492 #[doc = "Configures the drive current at 2mA"]
493 #[inline(always)]
494 pub fn current_2ma(self) -> &'a mut W {
495 self.variant(E_A::CURRENT_2MA)
496 }
497 #[doc = "Configures the drive current at 4mA"]
498 #[inline(always)]
499 pub fn current_4ma(self) -> &'a mut W {
500 self.variant(E_A::CURRENT_4MA)
501 }
502 #[doc = "Configures the drive current at 8mA"]
503 #[inline(always)]
504 pub fn current_8ma(self) -> &'a mut W {
505 self.variant(E_A::CURRENT_8MA)
506 }
507 #[doc = "Configures the drive current at 12mA"]
508 #[inline(always)]
509 pub fn current_12ma(self) -> &'a mut W {
510 self.variant(E_A::CURRENT_12MA)
511 }
512 #[doc = r"Writes raw bits to the field"]
513 #[inline(always)]
514 pub fn bits(self, value: u8) -> &'a mut W {
515 self.w.bits =
516 (self.w.bits & !(0x03 << 8)) | ((value as u32 & 0x03) << 8);
517 self.w
518 }
519}
520#[doc = "Slew Rate\n\nValue on reset: 0"]
521#[derive(Clone, Copy, Debug, PartialEq)]
522pub enum SR_A {
523 #[doc = "0: slow (half frequency) slew rate"]
524 SLOW = 0,
525 #[doc = "1: fast slew rate"]
526 FAST = 1,
527}
528impl From<SR_A> for bool {
529 #[inline(always)]
530 fn from(variant: SR_A) -> Self {
531 variant as u8 != 0
532 }
533}
534#[doc = "Field `SR` reader - Slew Rate"]
535pub struct SR_R(crate::FieldReader<bool, SR_A>);
536impl SR_R {
537 #[inline(always)]
538 pub(crate) fn new(bits: bool) -> Self {
539 SR_R(crate::FieldReader::new(bits))
540 }
541 #[doc = r"Get enumerated values variant"]
542 #[inline(always)]
543 pub fn variant(&self) -> SR_A {
544 match self.bits {
545 false => SR_A::SLOW,
546 true => SR_A::FAST,
547 }
548 }
549 #[doc = "Checks if the value of the field is `SLOW`"]
550 #[inline(always)]
551 pub fn is_slow(&self) -> bool {
552 **self == SR_A::SLOW
553 }
554 #[doc = "Checks if the value of the field is `FAST`"]
555 #[inline(always)]
556 pub fn is_fast(&self) -> bool {
557 **self == SR_A::FAST
558 }
559}
560impl core::ops::Deref for SR_R {
561 type Target = crate::FieldReader<bool, SR_A>;
562 #[inline(always)]
563 fn deref(&self) -> &Self::Target {
564 &self.0
565 }
566}
567#[doc = "Field `SR` writer - Slew Rate"]
568pub struct SR_W<'a> {
569 w: &'a mut W,
570}
571impl<'a> SR_W<'a> {
572 #[doc = r"Writes `variant` to the field"]
573 #[inline(always)]
574 pub fn variant(self, variant: SR_A) -> &'a mut W {
575 self.bit(variant.into())
576 }
577 #[doc = "slow (half frequency) slew rate"]
578 #[inline(always)]
579 pub fn slow(self) -> &'a mut W {
580 self.variant(SR_A::SLOW)
581 }
582 #[doc = "fast slew rate"]
583 #[inline(always)]
584 pub fn fast(self) -> &'a mut W {
585 self.variant(SR_A::FAST)
586 }
587 #[doc = r"Sets the field bit"]
588 #[inline(always)]
589 pub fn set_bit(self) -> &'a mut W {
590 self.bit(true)
591 }
592 #[doc = r"Clears the field bit"]
593 #[inline(always)]
594 pub fn clear_bit(self) -> &'a mut W {
595 self.bit(false)
596 }
597 #[doc = r"Writes raw bits to the field"]
598 #[inline(always)]
599 pub fn bit(self, value: bool) -> &'a mut W {
600 self.w.bits =
601 (self.w.bits & !(0x01 << 10)) | ((value as u32 & 0x01) << 10);
602 self.w
603 }
604}
605#[doc = "Receive Enable\n\nValue on reset: 0"]
606#[derive(Clone, Copy, Debug, PartialEq)]
607pub enum REN_A {
608 #[doc = "0: disable receive"]
609 DISABLE_RECEIVE = 0,
610 #[doc = "1: enable receive"]
611 ENABLE_RECEIVE = 1,
612}
613impl From<REN_A> for bool {
614 #[inline(always)]
615 fn from(variant: REN_A) -> Self {
616 variant as u8 != 0
617 }
618}
619#[doc = "Field `REN` reader - Receive Enable"]
620pub struct REN_R(crate::FieldReader<bool, REN_A>);
621impl REN_R {
622 #[inline(always)]
623 pub(crate) fn new(bits: bool) -> Self {
624 REN_R(crate::FieldReader::new(bits))
625 }
626 #[doc = r"Get enumerated values variant"]
627 #[inline(always)]
628 pub fn variant(&self) -> REN_A {
629 match self.bits {
630 false => REN_A::DISABLE_RECEIVE,
631 true => REN_A::ENABLE_RECEIVE,
632 }
633 }
634 #[doc = "Checks if the value of the field is `DISABLE_RECEIVE`"]
635 #[inline(always)]
636 pub fn is_disable_receive(&self) -> bool {
637 **self == REN_A::DISABLE_RECEIVE
638 }
639 #[doc = "Checks if the value of the field is `ENABLE_RECEIVE`"]
640 #[inline(always)]
641 pub fn is_enable_receive(&self) -> bool {
642 **self == REN_A::ENABLE_RECEIVE
643 }
644}
645impl core::ops::Deref for REN_R {
646 type Target = crate::FieldReader<bool, REN_A>;
647 #[inline(always)]
648 fn deref(&self) -> &Self::Target {
649 &self.0
650 }
651}
652#[doc = "Field `REN` writer - Receive Enable"]
653pub struct REN_W<'a> {
654 w: &'a mut W,
655}
656impl<'a> REN_W<'a> {
657 #[doc = r"Writes `variant` to the field"]
658 #[inline(always)]
659 pub fn variant(self, variant: REN_A) -> &'a mut W {
660 self.bit(variant.into())
661 }
662 #[doc = "disable receive"]
663 #[inline(always)]
664 pub fn disable_receive(self) -> &'a mut W {
665 self.variant(REN_A::DISABLE_RECEIVE)
666 }
667 #[doc = "enable receive"]
668 #[inline(always)]
669 pub fn enable_receive(self) -> &'a mut W {
670 self.variant(REN_A::ENABLE_RECEIVE)
671 }
672 #[doc = r"Sets the field bit"]
673 #[inline(always)]
674 pub fn set_bit(self) -> &'a mut W {
675 self.bit(true)
676 }
677 #[doc = r"Clears the field bit"]
678 #[inline(always)]
679 pub fn clear_bit(self) -> &'a mut W {
680 self.bit(false)
681 }
682 #[doc = r"Writes raw bits to the field"]
683 #[inline(always)]
684 pub fn bit(self, value: bool) -> &'a mut W {
685 self.w.bits =
686 (self.w.bits & !(0x01 << 11)) | ((value as u32 & 0x01) << 11);
687 self.w
688 }
689}
690#[doc = "Schmitt Trigger\n\nValue on reset: 0"]
691#[derive(Clone, Copy, Debug, PartialEq)]
692pub enum SMT_A {
693 #[doc = "0: Disable the Schmitt trigger"]
694 DISABLE_TRIGGER = 0,
695 #[doc = "1: Enable the Schmitt trigger"]
696 ENABLE_TRIGGER = 1,
697}
698impl From<SMT_A> for bool {
699 #[inline(always)]
700 fn from(variant: SMT_A) -> Self {
701 variant as u8 != 0
702 }
703}
704#[doc = "Field `SMT` reader - Schmitt Trigger"]
705pub struct SMT_R(crate::FieldReader<bool, SMT_A>);
706impl SMT_R {
707 #[inline(always)]
708 pub(crate) fn new(bits: bool) -> Self {
709 SMT_R(crate::FieldReader::new(bits))
710 }
711 #[doc = r"Get enumerated values variant"]
712 #[inline(always)]
713 pub fn variant(&self) -> SMT_A {
714 match self.bits {
715 false => SMT_A::DISABLE_TRIGGER,
716 true => SMT_A::ENABLE_TRIGGER,
717 }
718 }
719 #[doc = "Checks if the value of the field is `DISABLE_TRIGGER`"]
720 #[inline(always)]
721 pub fn is_disable_trigger(&self) -> bool {
722 **self == SMT_A::DISABLE_TRIGGER
723 }
724 #[doc = "Checks if the value of the field is `ENABLE_TRIGGER`"]
725 #[inline(always)]
726 pub fn is_enable_trigger(&self) -> bool {
727 **self == SMT_A::ENABLE_TRIGGER
728 }
729}
730impl core::ops::Deref for SMT_R {
731 type Target = crate::FieldReader<bool, SMT_A>;
732 #[inline(always)]
733 fn deref(&self) -> &Self::Target {
734 &self.0
735 }
736}
737#[doc = "Field `SMT` writer - Schmitt Trigger"]
738pub struct SMT_W<'a> {
739 w: &'a mut W,
740}
741impl<'a> SMT_W<'a> {
742 #[doc = r"Writes `variant` to the field"]
743 #[inline(always)]
744 pub fn variant(self, variant: SMT_A) -> &'a mut W {
745 self.bit(variant.into())
746 }
747 #[doc = "Disable the Schmitt trigger"]
748 #[inline(always)]
749 pub fn disable_trigger(self) -> &'a mut W {
750 self.variant(SMT_A::DISABLE_TRIGGER)
751 }
752 #[doc = "Enable the Schmitt trigger"]
753 #[inline(always)]
754 pub fn enable_trigger(self) -> &'a mut W {
755 self.variant(SMT_A::ENABLE_TRIGGER)
756 }
757 #[doc = r"Sets the field bit"]
758 #[inline(always)]
759 pub fn set_bit(self) -> &'a mut W {
760 self.bit(true)
761 }
762 #[doc = r"Clears the field bit"]
763 #[inline(always)]
764 pub fn clear_bit(self) -> &'a mut W {
765 self.bit(false)
766 }
767 #[doc = r"Writes raw bits to the field"]
768 #[inline(always)]
769 pub fn bit(self, value: bool) -> &'a mut W {
770 self.w.bits =
771 (self.w.bits & !(0x01 << 12)) | ((value as u32 & 0x01) << 12);
772 self.w
773 }
774}
775impl R {
776 #[doc = "Bits 0:1 - Functional selection for IO output. Refer to IO Mux"]
777 #[inline(always)]
778 pub fn func_sel(&self) -> FUNC_SEL_R {
779 FUNC_SEL_R::new((self.bits & 0x03) as u8)
780 }
781 #[doc = "Bits 3:4 - Control selection for IO Output. 0x0 = A0 registers, 0x1 = Others, 0x2 = Fabric"]
782 #[inline(always)]
783 pub fn ctrl_sel(&self) -> CTRL_SEL_R {
784 CTRL_SEL_R::new(((self.bits >> 3) & 0x03) as u8)
785 }
786 #[doc = "Bit 5 - Active low output enable"]
787 #[inline(always)]
788 pub fn oen(&self) -> OEN_R {
789 OEN_R::new(((self.bits >> 5) & 0x01) != 0)
790 }
791 #[doc = "Bits 6:7 - Driver state control"]
792 #[inline(always)]
793 pub fn p(&self) -> P_R {
794 P_R::new(((self.bits >> 6) & 0x03) as u8)
795 }
796 #[doc = "Bits 8:9 - Driver Strenght"]
797 #[inline(always)]
798 pub fn e(&self) -> E_R {
799 E_R::new(((self.bits >> 8) & 0x03) as u8)
800 }
801 #[doc = "Bit 10 - Slew Rate"]
802 #[inline(always)]
803 pub fn sr(&self) -> SR_R {
804 SR_R::new(((self.bits >> 10) & 0x01) != 0)
805 }
806 #[doc = "Bit 11 - Receive Enable"]
807 #[inline(always)]
808 pub fn ren(&self) -> REN_R {
809 REN_R::new(((self.bits >> 11) & 0x01) != 0)
810 }
811 #[doc = "Bit 12 - Schmitt Trigger"]
812 #[inline(always)]
813 pub fn smt(&self) -> SMT_R {
814 SMT_R::new(((self.bits >> 12) & 0x01) != 0)
815 }
816}
817impl W {
818 #[doc = "Bits 0:1 - Functional selection for IO output. Refer to IO Mux"]
819 #[inline(always)]
820 pub fn func_sel(&mut self) -> FUNC_SEL_W {
821 FUNC_SEL_W { w: self }
822 }
823 #[doc = "Bits 3:4 - Control selection for IO Output. 0x0 = A0 registers, 0x1 = Others, 0x2 = Fabric"]
824 #[inline(always)]
825 pub fn ctrl_sel(&mut self) -> CTRL_SEL_W {
826 CTRL_SEL_W { w: self }
827 }
828 #[doc = "Bit 5 - Active low output enable"]
829 #[inline(always)]
830 pub fn oen(&mut self) -> OEN_W {
831 OEN_W { w: self }
832 }
833 #[doc = "Bits 6:7 - Driver state control"]
834 #[inline(always)]
835 pub fn p(&mut self) -> P_W {
836 P_W { w: self }
837 }
838 #[doc = "Bits 8:9 - Driver Strenght"]
839 #[inline(always)]
840 pub fn e(&mut self) -> E_W {
841 E_W { w: self }
842 }
843 #[doc = "Bit 10 - Slew Rate"]
844 #[inline(always)]
845 pub fn sr(&mut self) -> SR_W {
846 SR_W { w: self }
847 }
848 #[doc = "Bit 11 - Receive Enable"]
849 #[inline(always)]
850 pub fn ren(&mut self) -> REN_W {
851 REN_W { w: self }
852 }
853 #[doc = "Bit 12 - Schmitt Trigger"]
854 #[inline(always)]
855 pub fn smt(&mut self) -> SMT_W {
856 SMT_W { w: self }
857 }
858 #[doc = "Writes raw bits to the register."]
859 #[inline(always)]
860 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
861 self.0.bits(bits);
862 self
863 }
864}
865#[doc = "PAD_%s control 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 [pad__ctrl](index.html) module"]
866pub struct PAD__CTRL_SPEC;
867impl crate::RegisterSpec for PAD__CTRL_SPEC {
868 type Ux = u32;
869}
870#[doc = "`read()` method returns [pad__ctrl::R](R) reader structure"]
871impl crate::Readable for PAD__CTRL_SPEC {
872 type Reader = R;
873}
874#[doc = "`write(|w| ..)` method takes [pad__ctrl::W](W) writer structure"]
875impl crate::Writable for PAD__CTRL_SPEC {
876 type Writer = W;
877}
878#[doc = "`reset()` method sets PAD_%s_CTRL to value 0"]
879impl crate::Resettable for PAD__CTRL_SPEC {
880 #[inline(always)]
881 fn reset_value() -> Self::Ux {
882 0
883 }
884}