s32k118_pac/sim/
fcfg1.rs

1#[doc = "Register `FCFG1` reader"]
2pub struct R(crate::R<FCFG1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FCFG1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FCFG1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FCFG1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FCFG1` writer"]
17pub struct W(crate::W<FCFG1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FCFG1_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<FCFG1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FCFG1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `DEPART` reader - FlexNVM partition"]
38pub struct DEPART_R(crate::FieldReader<u8, u8>);
39impl DEPART_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: u8) -> Self {
42        DEPART_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for DEPART_R {
46    type Target = crate::FieldReader<u8, u8>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "EEE SRAM SIZE\n\nValue on reset: 0"]
53#[derive(Clone, Copy, Debug, PartialEq)]
54#[repr(u8)]
55pub enum EEERAMSIZE_A {
56    #[doc = "2: 4 KB"]
57    _0010 = 2,
58    #[doc = "3: 2 KB"]
59    _0011 = 3,
60    #[doc = "4: 1 KB"]
61    _0100 = 4,
62    #[doc = "5: 512 Bytes"]
63    _0101 = 5,
64    #[doc = "6: 256 Bytes"]
65    _0110 = 6,
66    #[doc = "7: 128 Bytes"]
67    _0111 = 7,
68    #[doc = "8: 64 Bytes"]
69    _1000 = 8,
70    #[doc = "9: 32 Bytes"]
71    _1001 = 9,
72    #[doc = "15: 0 Bytes"]
73    _1111 = 15,
74}
75impl From<EEERAMSIZE_A> for u8 {
76    #[inline(always)]
77    fn from(variant: EEERAMSIZE_A) -> Self {
78        variant as _
79    }
80}
81#[doc = "Field `EEERAMSIZE` reader - EEE SRAM SIZE"]
82pub struct EEERAMSIZE_R(crate::FieldReader<u8, EEERAMSIZE_A>);
83impl EEERAMSIZE_R {
84    #[inline(always)]
85    pub(crate) fn new(bits: u8) -> Self {
86        EEERAMSIZE_R(crate::FieldReader::new(bits))
87    }
88    #[doc = r"Get enumerated values variant"]
89    #[inline(always)]
90    pub fn variant(&self) -> Option<EEERAMSIZE_A> {
91        match self.bits {
92            2 => Some(EEERAMSIZE_A::_0010),
93            3 => Some(EEERAMSIZE_A::_0011),
94            4 => Some(EEERAMSIZE_A::_0100),
95            5 => Some(EEERAMSIZE_A::_0101),
96            6 => Some(EEERAMSIZE_A::_0110),
97            7 => Some(EEERAMSIZE_A::_0111),
98            8 => Some(EEERAMSIZE_A::_1000),
99            9 => Some(EEERAMSIZE_A::_1001),
100            15 => Some(EEERAMSIZE_A::_1111),
101            _ => None,
102        }
103    }
104    #[doc = "Checks if the value of the field is `_0010`"]
105    #[inline(always)]
106    pub fn is_0010(&self) -> bool {
107        **self == EEERAMSIZE_A::_0010
108    }
109    #[doc = "Checks if the value of the field is `_0011`"]
110    #[inline(always)]
111    pub fn is_0011(&self) -> bool {
112        **self == EEERAMSIZE_A::_0011
113    }
114    #[doc = "Checks if the value of the field is `_0100`"]
115    #[inline(always)]
116    pub fn is_0100(&self) -> bool {
117        **self == EEERAMSIZE_A::_0100
118    }
119    #[doc = "Checks if the value of the field is `_0101`"]
120    #[inline(always)]
121    pub fn is_0101(&self) -> bool {
122        **self == EEERAMSIZE_A::_0101
123    }
124    #[doc = "Checks if the value of the field is `_0110`"]
125    #[inline(always)]
126    pub fn is_0110(&self) -> bool {
127        **self == EEERAMSIZE_A::_0110
128    }
129    #[doc = "Checks if the value of the field is `_0111`"]
130    #[inline(always)]
131    pub fn is_0111(&self) -> bool {
132        **self == EEERAMSIZE_A::_0111
133    }
134    #[doc = "Checks if the value of the field is `_1000`"]
135    #[inline(always)]
136    pub fn is_1000(&self) -> bool {
137        **self == EEERAMSIZE_A::_1000
138    }
139    #[doc = "Checks if the value of the field is `_1001`"]
140    #[inline(always)]
141    pub fn is_1001(&self) -> bool {
142        **self == EEERAMSIZE_A::_1001
143    }
144    #[doc = "Checks if the value of the field is `_1111`"]
145    #[inline(always)]
146    pub fn is_1111(&self) -> bool {
147        **self == EEERAMSIZE_A::_1111
148    }
149}
150impl core::ops::Deref for EEERAMSIZE_R {
151    type Target = crate::FieldReader<u8, EEERAMSIZE_A>;
152    #[inline(always)]
153    fn deref(&self) -> &Self::Target {
154        &self.0
155    }
156}
157impl R {
158    #[doc = "Bits 12:15 - FlexNVM partition"]
159    #[inline(always)]
160    pub fn depart(&self) -> DEPART_R {
161        DEPART_R::new(((self.bits >> 12) & 0x0f) as u8)
162    }
163    #[doc = "Bits 16:19 - EEE SRAM SIZE"]
164    #[inline(always)]
165    pub fn eeeramsize(&self) -> EEERAMSIZE_R {
166        EEERAMSIZE_R::new(((self.bits >> 16) & 0x0f) as u8)
167    }
168}
169impl W {
170    #[doc = "Writes raw bits to the register."]
171    #[inline(always)]
172    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
173        self.0.bits(bits);
174        self
175    }
176}
177#[doc = "Flash Configuration Register 1\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcfg1](index.html) module"]
178pub struct FCFG1_SPEC;
179impl crate::RegisterSpec for FCFG1_SPEC {
180    type Ux = u32;
181}
182#[doc = "`read()` method returns [fcfg1::R](R) reader structure"]
183impl crate::Readable for FCFG1_SPEC {
184    type Reader = R;
185}
186#[doc = "`write(|w| ..)` method takes [fcfg1::W](W) writer structure"]
187impl crate::Writable for FCFG1_SPEC {
188    type Writer = W;
189}
190#[doc = "`reset()` method sets FCFG1 to value 0"]
191impl crate::Resettable for FCFG1_SPEC {
192    #[inline(always)]
193    fn reset_value() -> Self::Ux {
194        0
195    }
196}