atsamd51g/system_control/
cpuid.rs

1#[doc = "Register `CPUID` reader"]
2pub type R = crate::R<CpuidSpec>;
3#[doc = "Field `REVISION` reader - Processor revision number"]
4pub type RevisionR = crate::FieldReader;
5#[doc = "Field `PARTNO` reader - Process Part Number, 0xC24=Cortex-M4"]
6pub type PartnoR = crate::FieldReader<u16>;
7#[doc = "Field `CONSTANT` reader - Constant"]
8pub type ConstantR = crate::FieldReader;
9#[doc = "Field `VARIANT` reader - Variant number"]
10pub type VariantR = crate::FieldReader;
11#[doc = "Field `IMPLEMENTER` reader - Implementer code, 0x41=ARM"]
12pub type ImplementerR = crate::FieldReader;
13impl R {
14    #[doc = "Bits 0:3 - Processor revision number"]
15    #[inline(always)]
16    pub fn revision(&self) -> RevisionR {
17        RevisionR::new((self.bits & 0x0f) as u8)
18    }
19    #[doc = "Bits 4:15 - Process Part Number, 0xC24=Cortex-M4"]
20    #[inline(always)]
21    pub fn partno(&self) -> PartnoR {
22        PartnoR::new(((self.bits >> 4) & 0x0fff) as u16)
23    }
24    #[doc = "Bits 16:19 - Constant"]
25    #[inline(always)]
26    pub fn constant(&self) -> ConstantR {
27        ConstantR::new(((self.bits >> 16) & 0x0f) as u8)
28    }
29    #[doc = "Bits 20:23 - Variant number"]
30    #[inline(always)]
31    pub fn variant(&self) -> VariantR {
32        VariantR::new(((self.bits >> 20) & 0x0f) as u8)
33    }
34    #[doc = "Bits 24:31 - Implementer code, 0x41=ARM"]
35    #[inline(always)]
36    pub fn implementer(&self) -> ImplementerR {
37        ImplementerR::new(((self.bits >> 24) & 0xff) as u8)
38    }
39}
40#[doc = "CPUID Base Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cpuid::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
41pub struct CpuidSpec;
42impl crate::RegisterSpec for CpuidSpec {
43    type Ux = u32;
44}
45#[doc = "`read()` method returns [`cpuid::R`](R) reader structure"]
46impl crate::Readable for CpuidSpec {}
47#[doc = "`reset()` method sets CPUID to value 0x410f_c240"]
48impl crate::Resettable for CpuidSpec {
49    const RESET_VALUE: u32 = 0x410f_c240;
50}