efm32gg_pac/efm32gg995/etm/
etmpidr2.rs

1#[doc = "Register `ETMPIDR2` reader"]
2pub struct R(crate::R<ETMPIDR2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<ETMPIDR2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<ETMPIDR2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<ETMPIDR2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `IDCODE` reader - JEP106 Identity Code"]
17pub type IDCODE_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `ALWAYS1` reader - Always 1"]
19pub type ALWAYS1_R = crate::BitReader<bool>;
20#[doc = "Field `REV` reader - Revision"]
21pub type REV_R = crate::FieldReader<u8, u8>;
22impl R {
23    #[doc = "Bits 0:2 - JEP106 Identity Code"]
24    #[inline(always)]
25    pub fn idcode(&self) -> IDCODE_R {
26        IDCODE_R::new((self.bits & 7) as u8)
27    }
28    #[doc = "Bit 3 - Always 1"]
29    #[inline(always)]
30    pub fn always1(&self) -> ALWAYS1_R {
31        ALWAYS1_R::new(((self.bits >> 3) & 1) != 0)
32    }
33    #[doc = "Bits 4:7 - Revision"]
34    #[inline(always)]
35    pub fn rev(&self) -> REV_R {
36        REV_R::new(((self.bits >> 4) & 0x0f) as u8)
37    }
38}
39#[doc = "Peripheral ID2 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 [etmpidr2](index.html) module"]
40pub struct ETMPIDR2_SPEC;
41impl crate::RegisterSpec for ETMPIDR2_SPEC {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [etmpidr2::R](R) reader structure"]
45impl crate::Readable for ETMPIDR2_SPEC {
46    type Reader = R;
47}
48#[doc = "`reset()` method sets ETMPIDR2 to value 0x3b"]
49impl crate::Resettable for ETMPIDR2_SPEC {
50    const RESET_VALUE: Self::Ux = 0x3b;
51}