Skip to main content

mcxa_pac/syscon/
dieid.rs

1#[doc = "Register `DIEID` reader"]
2pub type R = crate::R<DieidSpec>;
3#[doc = "Field `MINOR_REVISION` reader - Chip minor revision"]
4pub type MinorRevisionR = crate::FieldReader;
5#[doc = "Field `MAJOR_REVISION` reader - Chip major revision"]
6pub type MajorRevisionR = crate::FieldReader;
7#[doc = "Field `MCO_NUM_IN_DIE_ID` reader - Chip number"]
8pub type McoNumInDieIdR = crate::FieldReader<u32>;
9impl R {
10    #[doc = "Bits 0:3 - Chip minor revision"]
11    #[inline(always)]
12    pub fn minor_revision(&self) -> MinorRevisionR {
13        MinorRevisionR::new((self.bits & 0x0f) as u8)
14    }
15    #[doc = "Bits 4:7 - Chip major revision"]
16    #[inline(always)]
17    pub fn major_revision(&self) -> MajorRevisionR {
18        MajorRevisionR::new(((self.bits >> 4) & 0x0f) as u8)
19    }
20    #[doc = "Bits 8:27 - Chip number"]
21    #[inline(always)]
22    pub fn mco_num_in_die_id(&self) -> McoNumInDieIdR {
23        McoNumInDieIdR::new((self.bits >> 8) & 0x000f_ffff)
24    }
25}
26#[cfg(feature = "debug")]
27impl core::fmt::Debug for R {
28    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
29        f.debug_struct("DIEID")
30            .field("minor_revision", &self.minor_revision())
31            .field("major_revision", &self.major_revision())
32            .field("mco_num_in_die_id", &self.mco_num_in_die_id())
33            .finish()
34    }
35}
36#[doc = "Chip Revision ID and Number\n\nYou can [`read`](crate::Reg::read) this register and get [`dieid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
37pub struct DieidSpec;
38impl crate::RegisterSpec for DieidSpec {
39    type Ux = u32;
40}
41#[doc = "`read()` method returns [`dieid::R`](R) reader structure"]
42impl crate::Readable for DieidSpec {}
43#[doc = "`reset()` method sets DIEID to value 0x005d_c1a0"]
44impl crate::Resettable for DieidSpec {
45    const RESET_VALUE: u32 = 0x005d_c1a0;
46}