eos_s3/iomux/
pad__ctrl_ffe.rs

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