mkl26z4/gpioc/
pdir.rs

1#[doc = "Reader of register PDIR"]
2pub type R = crate::R<u32, super::PDIR>;
3#[doc = "Possible values of the field `PDI`"]
4#[derive(Clone, Copy, Debug, PartialEq)]
5pub enum PDI_A {
6    #[doc = "Pin logic level is logic 0, or is not configured for use by digital function."]
7    _0,
8    #[doc = "Pin logic level is logic 1."]
9    _1,
10}
11impl crate::ToBits<u32> for PDI_A {
12    #[inline(always)]
13    fn _bits(&self) -> u32 {
14        match *self {
15            PDI_A::_0 => 0,
16            PDI_A::_1 => 1,
17        }
18    }
19}
20#[doc = "Reader of field `PDI`"]
21pub type PDI_R = crate::R<u32, PDI_A>;
22impl PDI_R {
23    #[doc = r"Get enumerated values variant"]
24    #[inline(always)]
25    pub fn variant(&self) -> crate::Variant<u32, PDI_A> {
26        use crate::Variant::*;
27        match self.bits {
28            0 => Val(PDI_A::_0),
29            1 => Val(PDI_A::_1),
30            i => Res(i),
31        }
32    }
33    #[doc = "Checks if the value of the field is `_0`"]
34    #[inline(always)]
35    pub fn is_0(&self) -> bool {
36        *self == PDI_A::_0
37    }
38    #[doc = "Checks if the value of the field is `_1`"]
39    #[inline(always)]
40    pub fn is_1(&self) -> bool {
41        *self == PDI_A::_1
42    }
43}
44impl R {
45    #[doc = "Bits 0:31 - Port Data Input"]
46    #[inline(always)]
47    pub fn pdi(&self) -> PDI_R {
48        PDI_R::new((self.bits & 0xffff_ffff) as u32)
49    }
50}