1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
#[doc = "Register `DDRMON_CTRL` reader"]
pub type R = crate::R<DdrmonCtrlSpec>;
#[doc = "Register `DDRMON_CTRL` writer"]
pub type W = crate::W<DdrmonCtrlSpec>;
#[doc = "DFI Timer Count Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum TimerCntEn {
    #[doc = "1: disable"]
    B1 = 1,
    #[doc = "0: disable"]
    B0 = 0,
}
impl From<TimerCntEn> for bool {
    #[inline(always)]
    fn from(variant: TimerCntEn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TIMER_CNT_EN` reader - DFI Timer Count Enable"]
pub type TimerCntEnR = crate::BitReader<TimerCntEn>;
impl TimerCntEnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> TimerCntEn {
        match self.bits {
            true => TimerCntEn::B1,
            false => TimerCntEn::B0,
        }
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == TimerCntEn::B1
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == TimerCntEn::B0
    }
}
#[doc = "Field `TIMER_CNT_EN` writer - DFI Timer Count Enable"]
pub type TimerCntEnW<'a, REG> = crate::BitWriter<'a, REG, TimerCntEn>;
impl<'a, REG> TimerCntEnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "disable"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(TimerCntEn::B1)
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(TimerCntEn::B0)
    }
}
#[doc = "Software Mode Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SoftwareEn {
    #[doc = "1: disable"]
    B1 = 1,
    #[doc = "0: disable"]
    B0 = 0,
}
impl From<SoftwareEn> for bool {
    #[inline(always)]
    fn from(variant: SoftwareEn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `SOFTWARE_EN` reader - Software Mode Enable"]
pub type SoftwareEnR = crate::BitReader<SoftwareEn>;
impl SoftwareEnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> SoftwareEn {
        match self.bits {
            true => SoftwareEn::B1,
            false => SoftwareEn::B0,
        }
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == SoftwareEn::B1
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == SoftwareEn::B0
    }
}
#[doc = "Field `SOFTWARE_EN` writer - Software Mode Enable"]
pub type SoftwareEnW<'a, REG> = crate::BitWriter<'a, REG, SoftwareEn>;
impl<'a, REG> SoftwareEnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "disable"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(SoftwareEn::B1)
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(SoftwareEn::B0)
    }
}
#[doc = "LPDDR3 Mode Monitor Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lpddr3En {
    #[doc = "1: disable"]
    B1 = 1,
    #[doc = "0: disable"]
    B0 = 0,
}
impl From<Lpddr3En> for bool {
    #[inline(always)]
    fn from(variant: Lpddr3En) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LPDDR3_EN` reader - LPDDR3 Mode Monitor Enable"]
pub type Lpddr3EnR = crate::BitReader<Lpddr3En>;
impl Lpddr3EnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lpddr3En {
        match self.bits {
            true => Lpddr3En::B1,
            false => Lpddr3En::B0,
        }
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == Lpddr3En::B1
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == Lpddr3En::B0
    }
}
#[doc = "Field `LPDDR3_EN` writer - LPDDR3 Mode Monitor Enable"]
pub type Lpddr3EnW<'a, REG> = crate::BitWriter<'a, REG, Lpddr3En>;
impl<'a, REG> Lpddr3EnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "disable"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(Lpddr3En::B1)
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(Lpddr3En::B0)
    }
}
#[doc = "Hardware Mode Enable\n\nValue on reset: 1"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum HardwareEn {
    #[doc = "1: disable"]
    B1 = 1,
    #[doc = "0: disable"]
    B0 = 0,
}
impl From<HardwareEn> for bool {
    #[inline(always)]
    fn from(variant: HardwareEn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `HARDWARE_EN` reader - Hardware Mode Enable"]
pub type HardwareEnR = crate::BitReader<HardwareEn>;
impl HardwareEnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> HardwareEn {
        match self.bits {
            true => HardwareEn::B1,
            false => HardwareEn::B0,
        }
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == HardwareEn::B1
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == HardwareEn::B0
    }
}
#[doc = "Field `HARDWARE_EN` writer - Hardware Mode Enable"]
pub type HardwareEnW<'a, REG> = crate::BitWriter<'a, REG, HardwareEn>;
impl<'a, REG> HardwareEnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "disable"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(HardwareEn::B1)
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(HardwareEn::B0)
    }
}
#[doc = "LPDDR4 Mode Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Lpddr4En {
    #[doc = "1: disable"]
    B1 = 1,
    #[doc = "0: disable"]
    B0 = 0,
}
impl From<Lpddr4En> for bool {
    #[inline(always)]
    fn from(variant: Lpddr4En) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `LPDDR4_EN` reader - LPDDR4 Mode Enable"]
pub type Lpddr4EnR = crate::BitReader<Lpddr4En>;
impl Lpddr4EnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Lpddr4En {
        match self.bits {
            true => Lpddr4En::B1,
            false => Lpddr4En::B0,
        }
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == Lpddr4En::B1
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == Lpddr4En::B0
    }
}
#[doc = "Field `LPDDR4_EN` writer - LPDDR4 Mode Enable"]
pub type Lpddr4EnW<'a, REG> = crate::BitWriter<'a, REG, Lpddr4En>;
impl<'a, REG> Lpddr4EnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "disable"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(Lpddr4En::B1)
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(Lpddr4En::B0)
    }
}
#[doc = "Field `WRITE_ENABLE` reader - bit0~15 write enable When bit 16=1, bit 0 can be written by softwar . When bit 16=0, bit 0 cannot be written by software; When bit 17=1, bit 1 can be written by software. When bit 17=0, bit 1 cannot be written by software; ...... When bit 31=1, bit 15 can be written by software. When bit 31=0, bit 15 cannot be written by software;"]
pub type WriteEnableR = crate::FieldReader<u16>;
#[doc = "Field `WRITE_ENABLE` writer - bit0~15 write enable When bit 16=1, bit 0 can be written by softwar . When bit 16=0, bit 0 cannot be written by software; When bit 17=1, bit 1 can be written by software. When bit 17=0, bit 1 cannot be written by software; ...... When bit 31=1, bit 15 can be written by software. When bit 31=0, bit 15 cannot be written by software;"]
pub type WriteEnableW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
impl R {
    #[doc = "Bit 0 - DFI Timer Count Enable"]
    #[inline(always)]
    pub fn timer_cnt_en(&self) -> TimerCntEnR {
        TimerCntEnR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Software Mode Enable"]
    #[inline(always)]
    pub fn software_en(&self) -> SoftwareEnR {
        SoftwareEnR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - LPDDR3 Mode Monitor Enable"]
    #[inline(always)]
    pub fn lpddr3_en(&self) -> Lpddr3EnR {
        Lpddr3EnR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - Hardware Mode Enable"]
    #[inline(always)]
    pub fn hardware_en(&self) -> HardwareEnR {
        HardwareEnR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - LPDDR4 Mode Enable"]
    #[inline(always)]
    pub fn lpddr4_en(&self) -> Lpddr4EnR {
        Lpddr4EnR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bits 16:31 - bit0~15 write enable When bit 16=1, bit 0 can be written by softwar . When bit 16=0, bit 0 cannot be written by software; When bit 17=1, bit 1 can be written by software. When bit 17=0, bit 1 cannot be written by software; ...... When bit 31=1, bit 15 can be written by software. When bit 31=0, bit 15 cannot be written by software;"]
    #[inline(always)]
    pub fn write_enable(&self) -> WriteEnableR {
        WriteEnableR::new(((self.bits >> 16) & 0xffff) as u16)
    }
}
impl W {
    #[doc = "Bit 0 - DFI Timer Count Enable"]
    #[inline(always)]
    #[must_use]
    pub fn timer_cnt_en(&mut self) -> TimerCntEnW<DdrmonCtrlSpec> {
        TimerCntEnW::new(self, 0)
    }
    #[doc = "Bit 1 - Software Mode Enable"]
    #[inline(always)]
    #[must_use]
    pub fn software_en(&mut self) -> SoftwareEnW<DdrmonCtrlSpec> {
        SoftwareEnW::new(self, 1)
    }
    #[doc = "Bit 2 - LPDDR3 Mode Monitor Enable"]
    #[inline(always)]
    #[must_use]
    pub fn lpddr3_en(&mut self) -> Lpddr3EnW<DdrmonCtrlSpec> {
        Lpddr3EnW::new(self, 2)
    }
    #[doc = "Bit 3 - Hardware Mode Enable"]
    #[inline(always)]
    #[must_use]
    pub fn hardware_en(&mut self) -> HardwareEnW<DdrmonCtrlSpec> {
        HardwareEnW::new(self, 3)
    }
    #[doc = "Bit 4 - LPDDR4 Mode Enable"]
    #[inline(always)]
    #[must_use]
    pub fn lpddr4_en(&mut self) -> Lpddr4EnW<DdrmonCtrlSpec> {
        Lpddr4EnW::new(self, 4)
    }
    #[doc = "Bits 16:31 - bit0~15 write enable When bit 16=1, bit 0 can be written by softwar . When bit 16=0, bit 0 cannot be written by software; When bit 17=1, bit 1 can be written by software. When bit 17=0, bit 1 cannot be written by software; ...... When bit 31=1, bit 15 can be written by software. When bit 31=0, bit 15 cannot be written by software;"]
    #[inline(always)]
    #[must_use]
    pub fn write_enable(&mut self) -> WriteEnableW<DdrmonCtrlSpec> {
        WriteEnableW::new(self, 16)
    }
}
#[doc = "DDR Monitor Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ddrmon_ctrl::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ddrmon_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct DdrmonCtrlSpec;
impl crate::RegisterSpec for DdrmonCtrlSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ddrmon_ctrl::R`](R) reader structure"]
impl crate::Readable for DdrmonCtrlSpec {}
#[doc = "`write(|w| ..)` method takes [`ddrmon_ctrl::W`](W) writer structure"]
impl crate::Writable for DdrmonCtrlSpec {
    type Safety = crate::Unsafe;
    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets DDRMON_CTRL to value 0x08"]
impl crate::Resettable for DdrmonCtrlSpec {
    const RESET_VALUE: u32 = 0x08;
}