nrf5340_net_pac/cti_ns/
pidr4.rs

1#[doc = "Register `PIDR4` reader"]
2pub struct R(crate::R<PIDR4_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<PIDR4_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<PIDR4_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<PIDR4_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `DES_2` reader - Together, PIDR1.DES_0, PIDR2.DES_1, and PIDR4.DES_2 identify the designer of the component."]
17pub type DES_2_R = crate::FieldReader<u8, DES_2_A>;
18#[doc = "Together, PIDR1.DES_0, PIDR2.DES_1, and PIDR4.DES_2 identify the designer of the component.\n\nValue on reset: 4"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u8)]
21pub enum DES_2_A {
22    #[doc = "4: JEDEC continuation code."]
23    CODE = 4,
24}
25impl From<DES_2_A> for u8 {
26    #[inline(always)]
27    fn from(variant: DES_2_A) -> Self {
28        variant as _
29    }
30}
31impl DES_2_R {
32    #[doc = "Get enumerated values variant"]
33    #[inline(always)]
34    pub fn variant(&self) -> Option<DES_2_A> {
35        match self.bits {
36            4 => Some(DES_2_A::CODE),
37            _ => None,
38        }
39    }
40    #[doc = "Checks if the value of the field is `CODE`"]
41    #[inline(always)]
42    pub fn is_code(&self) -> bool {
43        *self == DES_2_A::CODE
44    }
45}
46#[doc = "Field `SIZE` reader - Always 0b0000. Indicates that the device only occupies 4KB of memory."]
47pub type SIZE_R = crate::FieldReader<u8, u8>;
48impl R {
49    #[doc = "Bits 0:3 - Together, PIDR1.DES_0, PIDR2.DES_1, and PIDR4.DES_2 identify the designer of the component."]
50    #[inline(always)]
51    pub fn des_2(&self) -> DES_2_R {
52        DES_2_R::new((self.bits & 0x0f) as u8)
53    }
54    #[doc = "Bits 4:7 - Always 0b0000. Indicates that the device only occupies 4KB of memory."]
55    #[inline(always)]
56    pub fn size(&self) -> SIZE_R {
57        SIZE_R::new(((self.bits >> 4) & 0x0f) as u8)
58    }
59}
60#[doc = "Peripheral ID4 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 [pidr4](index.html) module"]
61pub struct PIDR4_SPEC;
62impl crate::RegisterSpec for PIDR4_SPEC {
63    type Ux = u32;
64}
65#[doc = "`read()` method returns [pidr4::R](R) reader structure"]
66impl crate::Readable for PIDR4_SPEC {
67    type Reader = R;
68}
69#[doc = "`reset()` method sets PIDR4 to value 0x04"]
70impl crate::Resettable for PIDR4_SPEC {
71    #[inline(always)]
72    fn reset_value() -> Self::Ux {
73        0x04
74    }
75}