1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#[doc = "Reader of register ID"]
pub type R = crate::R<u32, super::ID>;
#[doc = "Reader of field `MOD_REV`"]
pub type MOD_REV_R = crate::R<u8, u8>;
#[doc = "Module Type\n\nValue on reset: 192"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum MOD_TYPE_A {
    #[doc = "192: Define the module as a 32-bit module."]
    VALUE1 = 192,
}
impl From<MOD_TYPE_A> for u8 {
    #[inline(always)]
    fn from(variant: MOD_TYPE_A) -> Self {
        variant as _
    }
}
#[doc = "Reader of field `MOD_TYPE`"]
pub type MOD_TYPE_R = crate::R<u8, MOD_TYPE_A>;
impl MOD_TYPE_R {
    #[doc = r"Get enumerated values variant"]
    #[inline(always)]
    pub fn variant(&self) -> crate::Variant<u8, MOD_TYPE_A> {
        use crate::Variant::*;
        match self.bits {
            192 => Val(MOD_TYPE_A::VALUE1),
            i => Res(i),
        }
    }
    #[doc = "Checks if the value of the field is `VALUE1`"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == MOD_TYPE_A::VALUE1
    }
}
#[doc = "Reader of field `MOD_NUMBER`"]
pub type MOD_NUMBER_R = crate::R<u16, u16>;
impl R {
    #[doc = "Bits 0:7 - Module Revision Number"]
    #[inline(always)]
    pub fn mod_rev(&self) -> MOD_REV_R {
        MOD_REV_R::new((self.bits & 0xff) as u8)
    }
    #[doc = "Bits 8:15 - Module Type"]
    #[inline(always)]
    pub fn mod_type(&self) -> MOD_TYPE_R {
        MOD_TYPE_R::new(((self.bits >> 8) & 0xff) as u8)
    }
    #[doc = "Bits 16:31 - Module Number Value"]
    #[inline(always)]
    pub fn mod_number(&self) -> MOD_NUMBER_R {
        MOD_NUMBER_R::new(((self.bits >> 16) & 0xffff) as u16)
    }
}