s32k144_pac/flexio/
verid.rs

1#[doc = "Register `VERID` reader"]
2pub struct R(crate::R<VERID_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<VERID_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<VERID_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<VERID_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Feature Specification Number\n\nValue on reset: 0"]
17#[derive(Clone, Copy, Debug, PartialEq)]
18#[repr(u16)]
19pub enum FEATURE_A {
20    #[doc = "0: Standard features implemented."]
21    _0000000000000000 = 0,
22    #[doc = "1: Supports state, logic and parallel modes."]
23    _0000000000000001 = 1,
24}
25impl From<FEATURE_A> for u16 {
26    #[inline(always)]
27    fn from(variant: FEATURE_A) -> Self {
28        variant as _
29    }
30}
31#[doc = "Field `FEATURE` reader - Feature Specification Number"]
32pub struct FEATURE_R(crate::FieldReader<u16, FEATURE_A>);
33impl FEATURE_R {
34    #[inline(always)]
35    pub(crate) fn new(bits: u16) -> Self {
36        FEATURE_R(crate::FieldReader::new(bits))
37    }
38    #[doc = r"Get enumerated values variant"]
39    #[inline(always)]
40    pub fn variant(&self) -> Option<FEATURE_A> {
41        match self.bits {
42            0 => Some(FEATURE_A::_0000000000000000),
43            1 => Some(FEATURE_A::_0000000000000001),
44            _ => None,
45        }
46    }
47    #[doc = "Checks if the value of the field is `_0000000000000000`"]
48    #[inline(always)]
49    pub fn is_0000000000000000(&self) -> bool {
50        **self == FEATURE_A::_0000000000000000
51    }
52    #[doc = "Checks if the value of the field is `_0000000000000001`"]
53    #[inline(always)]
54    pub fn is_0000000000000001(&self) -> bool {
55        **self == FEATURE_A::_0000000000000001
56    }
57}
58impl core::ops::Deref for FEATURE_R {
59    type Target = crate::FieldReader<u16, FEATURE_A>;
60    #[inline(always)]
61    fn deref(&self) -> &Self::Target {
62        &self.0
63    }
64}
65#[doc = "Field `MINOR` reader - Minor Version Number"]
66pub struct MINOR_R(crate::FieldReader<u8, u8>);
67impl MINOR_R {
68    #[inline(always)]
69    pub(crate) fn new(bits: u8) -> Self {
70        MINOR_R(crate::FieldReader::new(bits))
71    }
72}
73impl core::ops::Deref for MINOR_R {
74    type Target = crate::FieldReader<u8, u8>;
75    #[inline(always)]
76    fn deref(&self) -> &Self::Target {
77        &self.0
78    }
79}
80#[doc = "Field `MAJOR` reader - Major Version Number"]
81pub struct MAJOR_R(crate::FieldReader<u8, u8>);
82impl MAJOR_R {
83    #[inline(always)]
84    pub(crate) fn new(bits: u8) -> Self {
85        MAJOR_R(crate::FieldReader::new(bits))
86    }
87}
88impl core::ops::Deref for MAJOR_R {
89    type Target = crate::FieldReader<u8, u8>;
90    #[inline(always)]
91    fn deref(&self) -> &Self::Target {
92        &self.0
93    }
94}
95impl R {
96    #[doc = "Bits 0:15 - Feature Specification Number"]
97    #[inline(always)]
98    pub fn feature(&self) -> FEATURE_R {
99        FEATURE_R::new((self.bits & 0xffff) as u16)
100    }
101    #[doc = "Bits 16:23 - Minor Version Number"]
102    #[inline(always)]
103    pub fn minor(&self) -> MINOR_R {
104        MINOR_R::new(((self.bits >> 16) & 0xff) as u8)
105    }
106    #[doc = "Bits 24:31 - Major Version Number"]
107    #[inline(always)]
108    pub fn major(&self) -> MAJOR_R {
109        MAJOR_R::new(((self.bits >> 24) & 0xff) as u8)
110    }
111}
112#[doc = "Version ID Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [verid](index.html) module"]
113pub struct VERID_SPEC;
114impl crate::RegisterSpec for VERID_SPEC {
115    type Ux = u32;
116}
117#[doc = "`read()` method returns [verid::R](R) reader structure"]
118impl crate::Readable for VERID_SPEC {
119    type Reader = R;
120}
121#[doc = "`reset()` method sets VERID to value 0x0101_0000"]
122impl crate::Resettable for VERID_SPEC {
123    #[inline(always)]
124    fn reset_value() -> Self::Ux {
125        0x0101_0000
126    }
127}