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
#[doc = "Register `DDRMON_DDR_IF_CTRL` reader"]
pub type R = crate::R<DdrmonDdrIfCtrlSpec>;
#[doc = "Register `DDRMON_DDR_IF_CTRL` writer"]
pub type W = crate::W<DdrmonDdrIfCtrlSpec>;
#[doc = "Write or read monitor in channel 0 for command statistics\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ch0Direction {
    #[doc = "1: write"]
    B1 = 1,
    #[doc = "0: write"]
    B0 = 0,
}
impl From<Ch0Direction> for bool {
    #[inline(always)]
    fn from(variant: Ch0Direction) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CH0_DIRECTION` reader - Write or read monitor in channel 0 for command statistics"]
pub type Ch0DirectionR = crate::BitReader<Ch0Direction>;
impl Ch0DirectionR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ch0Direction {
        match self.bits {
            true => Ch0Direction::B1,
            false => Ch0Direction::B0,
        }
    }
    #[doc = "write"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == Ch0Direction::B1
    }
    #[doc = "write"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == Ch0Direction::B0
    }
}
#[doc = "Field `CH0_DIRECTION` writer - Write or read monitor in channel 0 for command statistics"]
pub type Ch0DirectionW<'a, REG> = crate::BitWriter<'a, REG, Ch0Direction>;
impl<'a, REG> Ch0DirectionW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "write"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(Ch0Direction::B1)
    }
    #[doc = "write"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(Ch0Direction::B0)
    }
}
#[doc = "Write or read monitor in channel 1 for command statistics\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ch1Direction {
    #[doc = "1: write"]
    B1 = 1,
    #[doc = "0: write"]
    B0 = 0,
}
impl From<Ch1Direction> for bool {
    #[inline(always)]
    fn from(variant: Ch1Direction) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CH1_DIRECTION` reader - Write or read monitor in channel 1 for command statistics"]
pub type Ch1DirectionR = crate::BitReader<Ch1Direction>;
impl Ch1DirectionR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ch1Direction {
        match self.bits {
            true => Ch1Direction::B1,
            false => Ch1Direction::B0,
        }
    }
    #[doc = "write"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == Ch1Direction::B1
    }
    #[doc = "write"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == Ch1Direction::B0
    }
}
#[doc = "Field `CH1_DIRECTION` writer - Write or read monitor in channel 1 for command statistics"]
pub type Ch1DirectionW<'a, REG> = crate::BitWriter<'a, REG, Ch1Direction>;
impl<'a, REG> Ch1DirectionW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "write"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(Ch1Direction::B1)
    }
    #[doc = "write"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(Ch1Direction::B0)
    }
}
#[doc = "DDR interface and DFI monitor enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum IfMonEn {
    #[doc = "1: disable"]
    B1 = 1,
    #[doc = "0: disable"]
    B0 = 0,
}
impl From<IfMonEn> for bool {
    #[inline(always)]
    fn from(variant: IfMonEn) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `IF_MON_EN` reader - DDR interface and DFI monitor enable"]
pub type IfMonEnR = crate::BitReader<IfMonEn>;
impl IfMonEnR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> IfMonEn {
        match self.bits {
            true => IfMonEn::B1,
            false => IfMonEn::B0,
        }
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b1(&self) -> bool {
        *self == IfMonEn::B1
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn is_b0(&self) -> bool {
        *self == IfMonEn::B0
    }
}
#[doc = "Field `IF_MON_EN` writer - DDR interface and DFI monitor enable"]
pub type IfMonEnW<'a, REG> = crate::BitWriter<'a, REG, IfMonEn>;
impl<'a, REG> IfMonEnW<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    #[doc = "disable"]
    #[inline(always)]
    pub fn b1(self) -> &'a mut crate::W<REG> {
        self.variant(IfMonEn::B1)
    }
    #[doc = "disable"]
    #[inline(always)]
    pub fn b0(self) -> &'a mut crate::W<REG> {
        self.variant(IfMonEn::B0)
    }
}
#[doc = "Field `WRITE_ENABLE` reader - bit0~15 write enable When bit 16=1, bit 0 can be written by software. 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 software. 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 - Write or read monitor in channel 0 for command statistics"]
    #[inline(always)]
    pub fn ch0_direction(&self) -> Ch0DirectionR {
        Ch0DirectionR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Write or read monitor in channel 1 for command statistics"]
    #[inline(always)]
    pub fn ch1_direction(&self) -> Ch1DirectionR {
        Ch1DirectionR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - DDR interface and DFI monitor enable"]
    #[inline(always)]
    pub fn if_mon_en(&self) -> IfMonEnR {
        IfMonEnR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bits 16:31 - bit0~15 write enable When bit 16=1, bit 0 can be written by software. 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 - Write or read monitor in channel 0 for command statistics"]
    #[inline(always)]
    #[must_use]
    pub fn ch0_direction(&mut self) -> Ch0DirectionW<DdrmonDdrIfCtrlSpec> {
        Ch0DirectionW::new(self, 0)
    }
    #[doc = "Bit 1 - Write or read monitor in channel 1 for command statistics"]
    #[inline(always)]
    #[must_use]
    pub fn ch1_direction(&mut self) -> Ch1DirectionW<DdrmonDdrIfCtrlSpec> {
        Ch1DirectionW::new(self, 1)
    }
    #[doc = "Bit 2 - DDR interface and DFI monitor enable"]
    #[inline(always)]
    #[must_use]
    pub fn if_mon_en(&mut self) -> IfMonEnW<DdrmonDdrIfCtrlSpec> {
        IfMonEnW::new(self, 2)
    }
    #[doc = "Bits 16:31 - bit0~15 write enable When bit 16=1, bit 0 can be written by software. 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<DdrmonDdrIfCtrlSpec> {
        WriteEnableW::new(self, 16)
    }
}
#[doc = "DDR interface Control Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ddrmon_ddr_if_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_ddr_if_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 DdrmonDdrIfCtrlSpec;
impl crate::RegisterSpec for DdrmonDdrIfCtrlSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`ddrmon_ddr_if_ctrl::R`](R) reader structure"]
impl crate::Readable for DdrmonDdrIfCtrlSpec {}
#[doc = "`write(|w| ..)` method takes [`ddrmon_ddr_if_ctrl::W`](W) writer structure"]
impl crate::Writable for DdrmonDdrIfCtrlSpec {
    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_DDR_IF_CTRL to value 0"]
impl crate::Resettable for DdrmonDdrIfCtrlSpec {
    const RESET_VALUE: u32 = 0;
}