nrf52840_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: 4294967295"]
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 = "128: 128 kByte RAM"]
29 K128 = 128,
30 #[doc = "256: 256 kByte RAM"]
31 K256 = 256,
32 #[doc = "4294967295: Unspecified"]
33 UNSPECIFIED = 4294967295,
34}
35impl From<RAM_A> for u32 {
36 #[inline(always)]
37 fn from(variant: RAM_A) -> Self {
38 variant as _
39 }
40}
41impl RAM_R {
42 #[doc = "Get enumerated values variant"]
43 #[inline(always)]
44 pub fn variant(&self) -> Option<RAM_A> {
45 match self.bits {
46 16 => Some(RAM_A::K16),
47 32 => Some(RAM_A::K32),
48 64 => Some(RAM_A::K64),
49 128 => Some(RAM_A::K128),
50 256 => Some(RAM_A::K256),
51 4294967295 => Some(RAM_A::UNSPECIFIED),
52 _ => None,
53 }
54 }
55 #[doc = "Checks if the value of the field is `K16`"]
56 #[inline(always)]
57 pub fn is_k16(&self) -> bool {
58 *self == RAM_A::K16
59 }
60 #[doc = "Checks if the value of the field is `K32`"]
61 #[inline(always)]
62 pub fn is_k32(&self) -> bool {
63 *self == RAM_A::K32
64 }
65 #[doc = "Checks if the value of the field is `K64`"]
66 #[inline(always)]
67 pub fn is_k64(&self) -> bool {
68 *self == RAM_A::K64
69 }
70 #[doc = "Checks if the value of the field is `K128`"]
71 #[inline(always)]
72 pub fn is_k128(&self) -> bool {
73 *self == RAM_A::K128
74 }
75 #[doc = "Checks if the value of the field is `K256`"]
76 #[inline(always)]
77 pub fn is_k256(&self) -> bool {
78 *self == RAM_A::K256
79 }
80 #[doc = "Checks if the value of the field is `UNSPECIFIED`"]
81 #[inline(always)]
82 pub fn is_unspecified(&self) -> bool {
83 *self == RAM_A::UNSPECIFIED
84 }
85}
86impl R {
87 #[doc = "Bits 0:31 - RAM variant"]
88 #[inline(always)]
89 pub fn ram(&self) -> RAM_R {
90 RAM_R::new(self.bits)
91 }
92}
93#[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"]
94pub struct RAM_SPEC;
95impl crate::RegisterSpec for RAM_SPEC {
96 type Ux = u32;
97}
98#[doc = "`read()` method returns [ram::R](R) reader structure"]
99impl crate::Readable for RAM_SPEC {
100 type Reader = R;
101}
102#[doc = "`reset()` method sets RAM to value 0xffff_ffff"]
103impl crate::Resettable for RAM_SPEC {
104 #[inline(always)]
105 fn reset_value() -> Self::Ux {
106 0xffff_ffff
107 }
108}