nrf52832_pac/ficr/info/
ram.rs

1#[doc = "Register `RAM` reader"]
2pub struct R(crate::R<RAM_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<RAM_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<RAM_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<RAM_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `RAM` reader - RAM variant"]
17pub type RAM_R = crate::FieldReader<u32, RAM_A>;
18#[doc = "RAM variant\n\nValue on reset: 64"]
19#[derive(Clone, Copy, Debug, PartialEq)]
20#[repr(u32)]
21pub enum RAM_A {
22    #[doc = "16: 16 kByte RAM"]
23    K16 = 16,
24    #[doc = "32: 32 kByte RAM"]
25    K32 = 32,
26    #[doc = "64: 64 kByte RAM"]
27    K64 = 64,
28    #[doc = "4294967295: Unspecified"]
29    UNSPECIFIED = 4294967295,
30}
31impl From<RAM_A> for u32 {
32    #[inline(always)]
33    fn from(variant: RAM_A) -> Self {
34        variant as _
35    }
36}
37impl RAM_R {
38    #[doc = "Get enumerated values variant"]
39    #[inline(always)]
40    pub fn variant(&self) -> Option<RAM_A> {
41        match self.bits {
42            16 => Some(RAM_A::K16),
43            32 => Some(RAM_A::K32),
44            64 => Some(RAM_A::K64),
45            4294967295 => Some(RAM_A::UNSPECIFIED),
46            _ => None,
47        }
48    }
49    #[doc = "Checks if the value of the field is `K16`"]
50    #[inline(always)]
51    pub fn is_k16(&self) -> bool {
52        *self == RAM_A::K16
53    }
54    #[doc = "Checks if the value of the field is `K32`"]
55    #[inline(always)]
56    pub fn is_k32(&self) -> bool {
57        *self == RAM_A::K32
58    }
59    #[doc = "Checks if the value of the field is `K64`"]
60    #[inline(always)]
61    pub fn is_k64(&self) -> bool {
62        *self == RAM_A::K64
63    }
64    #[doc = "Checks if the value of the field is `UNSPECIFIED`"]
65    #[inline(always)]
66    pub fn is_unspecified(&self) -> bool {
67        *self == RAM_A::UNSPECIFIED
68    }
69}
70impl R {
71    #[doc = "Bits 0:31 - RAM variant"]
72    #[inline(always)]
73    pub fn ram(&self) -> RAM_R {
74        RAM_R::new(self.bits)
75    }
76}
77#[doc = "RAM variant\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 [ram](index.html) module"]
78pub struct RAM_SPEC;
79impl crate::RegisterSpec for RAM_SPEC {
80    type Ux = u32;
81}
82#[doc = "`read()` method returns [ram::R](R) reader structure"]
83impl crate::Readable for RAM_SPEC {
84    type Reader = R;
85}
86#[doc = "`reset()` method sets RAM to value 0x40"]
87impl crate::Resettable for RAM_SPEC {
88    #[inline(always)]
89    fn reset_value() -> Self::Ux {
90        0x40
91    }
92}