Skip to main content

mcxa_pac/port0/
verid.rs

1#[doc = "Register `VERID` reader"]
2pub type R = crate::R<VeridSpec>;
3#[doc = "Feature Specification Number\n\nValue on reset: 0"]
4#[cfg_attr(feature = "defmt", derive(defmt::Format))]
5#[derive(Clone, Copy, Debug, PartialEq, Eq)]
6#[repr(u16)]
7pub enum Feature {
8    #[doc = "0: Basic implementation"]
9    Feature0 = 0,
10}
11impl From<Feature> for u16 {
12    #[inline(always)]
13    fn from(variant: Feature) -> Self {
14        variant as _
15    }
16}
17impl crate::FieldSpec for Feature {
18    type Ux = u16;
19}
20impl crate::IsEnum for Feature {}
21#[doc = "Field `FEATURE` reader - Feature Specification Number"]
22pub type FeatureR = crate::FieldReader<Feature>;
23impl FeatureR {
24    #[doc = "Get enumerated values variant"]
25    #[inline(always)]
26    pub const fn variant(&self) -> Option<Feature> {
27        match self.bits {
28            0 => Some(Feature::Feature0),
29            _ => None,
30        }
31    }
32    #[doc = "Basic implementation"]
33    #[inline(always)]
34    pub fn is_feature0(&self) -> bool {
35        *self == Feature::Feature0
36    }
37}
38#[doc = "Field `MINOR` reader - Minor Version Number"]
39pub type MinorR = crate::FieldReader;
40#[doc = "Field `MAJOR` reader - Major Version Number"]
41pub type MajorR = crate::FieldReader;
42impl R {
43    #[doc = "Bits 0:15 - Feature Specification Number"]
44    #[inline(always)]
45    pub fn feature(&self) -> FeatureR {
46        FeatureR::new((self.bits & 0xffff) as u16)
47    }
48    #[doc = "Bits 16:23 - Minor Version Number"]
49    #[inline(always)]
50    pub fn minor(&self) -> MinorR {
51        MinorR::new(((self.bits >> 16) & 0xff) as u8)
52    }
53    #[doc = "Bits 24:31 - Major Version Number"]
54    #[inline(always)]
55    pub fn major(&self) -> MajorR {
56        MajorR::new(((self.bits >> 24) & 0xff) as u8)
57    }
58}
59#[cfg(feature = "debug")]
60impl core::fmt::Debug for R {
61    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
62        f.debug_struct("VERID")
63            .field("feature", &self.feature())
64            .field("minor", &self.minor())
65            .field("major", &self.major())
66            .finish()
67    }
68}
69#[doc = "Version ID\n\nYou can [`read`](crate::Reg::read) this register and get [`verid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct VeridSpec;
71impl crate::RegisterSpec for VeridSpec {
72    type Ux = u32;
73}
74#[doc = "`read()` method returns [`verid::R`](R) reader structure"]
75impl crate::Readable for VeridSpec {}
76#[doc = "`reset()` method sets VERID to value 0x0200_0000"]
77impl crate::Resettable for VeridSpec {
78    const RESET_VALUE: u32 = 0x0200_0000;
79}