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
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
#[doc = "Register `PFLG` reader"]
pub type R = crate::R<PflgSpec>;
#[doc = "Correct Hall Event Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Ches {
    #[doc = "0: Correct Hall Event not detected"]
    Value1 = 0,
    #[doc = "1: Correct Hall Event detected"]
    Value2 = 1,
}
impl From<Ches> for bool {
    #[inline(always)]
    fn from(variant: Ches) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CHES` reader - Correct Hall Event Status"]
pub type ChesR = crate::BitReader<Ches>;
impl ChesR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Ches {
        match self.bits {
            false => Ches::Value1,
            true => Ches::Value2,
        }
    }
    #[doc = "Correct Hall Event not detected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Ches::Value1
    }
    #[doc = "Correct Hall Event detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Ches::Value2
    }
}
#[doc = "Wrong Hall Event Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Whes {
    #[doc = "0: Wrong Hall Event not detected"]
    Value1 = 0,
    #[doc = "1: Wrong Hall Event detected"]
    Value2 = 1,
}
impl From<Whes> for bool {
    #[inline(always)]
    fn from(variant: Whes) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `WHES` reader - Wrong Hall Event Status"]
pub type WhesR = crate::BitReader<Whes>;
impl WhesR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Whes {
        match self.bits {
            false => Whes::Value1,
            true => Whes::Value2,
        }
    }
    #[doc = "Wrong Hall Event not detected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Whes::Value1
    }
    #[doc = "Wrong Hall Event detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Whes::Value2
    }
}
#[doc = "Hall Inputs Update Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Hies {
    #[doc = "0: Transition on the Hall Inputs not detected"]
    Value1 = 0,
    #[doc = "1: Transition on the Hall Inputs detected"]
    Value2 = 1,
}
impl From<Hies> for bool {
    #[inline(always)]
    fn from(variant: Hies) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `HIES` reader - Hall Inputs Update Status"]
pub type HiesR = crate::BitReader<Hies>;
impl HiesR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Hies {
        match self.bits {
            false => Hies::Value1,
            true => Hies::Value2,
        }
    }
    #[doc = "Transition on the Hall Inputs not detected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Hies::Value1
    }
    #[doc = "Transition on the Hall Inputs detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Hies::Value2
    }
}
#[doc = "Multi-Channel pattern shadow transfer status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Msts {
    #[doc = "0: Shadow transfer not done"]
    Value1 = 0,
    #[doc = "1: Shadow transfer done"]
    Value2 = 1,
}
impl From<Msts> for bool {
    #[inline(always)]
    fn from(variant: Msts) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MSTS` reader - Multi-Channel pattern shadow transfer status"]
pub type MstsR = crate::BitReader<Msts>;
impl MstsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Msts {
        match self.bits {
            false => Msts::Value1,
            true => Msts::Value2,
        }
    }
    #[doc = "Shadow transfer not done"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Msts::Value1
    }
    #[doc = "Shadow transfer done"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Msts::Value2
    }
}
#[doc = "Quadrature Index Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Indxs {
    #[doc = "0: Index event not detected"]
    Value1 = 0,
    #[doc = "1: Index event detected"]
    Value2 = 1,
}
impl From<Indxs> for bool {
    #[inline(always)]
    fn from(variant: Indxs) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `INDXS` reader - Quadrature Index Status"]
pub type IndxsR = crate::BitReader<Indxs>;
impl IndxsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Indxs {
        match self.bits {
            false => Indxs::Value1,
            true => Indxs::Value2,
        }
    }
    #[doc = "Index event not detected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Indxs::Value1
    }
    #[doc = "Index event detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Indxs::Value2
    }
}
#[doc = "Quadrature Phase Error Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Errs {
    #[doc = "0: Phase Error event not detected"]
    Value1 = 0,
    #[doc = "1: Phase Error event detected"]
    Value2 = 1,
}
impl From<Errs> for bool {
    #[inline(always)]
    fn from(variant: Errs) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `ERRS` reader - Quadrature Phase Error Status"]
pub type ErrsR = crate::BitReader<Errs>;
impl ErrsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Errs {
        match self.bits {
            false => Errs::Value1,
            true => Errs::Value2,
        }
    }
    #[doc = "Phase Error event not detected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Errs::Value1
    }
    #[doc = "Phase Error event detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Errs::Value2
    }
}
#[doc = "Quadrature CLK Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Cnts {
    #[doc = "0: Quadrature clock not generated"]
    Value1 = 0,
    #[doc = "1: Quadrature clock generated"]
    Value2 = 1,
}
impl From<Cnts> for bool {
    #[inline(always)]
    fn from(variant: Cnts) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `CNTS` reader - Quadrature CLK Status"]
pub type CntsR = crate::BitReader<Cnts>;
impl CntsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Cnts {
        match self.bits {
            false => Cnts::Value1,
            true => Cnts::Value2,
        }
    }
    #[doc = "Quadrature clock not generated"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Cnts::Value1
    }
    #[doc = "Quadrature clock generated"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Cnts::Value2
    }
}
#[doc = "Quadrature Direction Change\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dirs {
    #[doc = "0: Change on direction not detected"]
    Value1 = 0,
    #[doc = "1: Change on direction detected"]
    Value2 = 1,
}
impl From<Dirs> for bool {
    #[inline(always)]
    fn from(variant: Dirs) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DIRS` reader - Quadrature Direction Change"]
pub type DirsR = crate::BitReader<Dirs>;
impl DirsR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dirs {
        match self.bits {
            false => Dirs::Value1,
            true => Dirs::Value2,
        }
    }
    #[doc = "Change on direction not detected"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dirs::Value1
    }
    #[doc = "Change on direction detected"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dirs::Value2
    }
}
#[doc = "Quadrature Period Clk Status\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Pclks {
    #[doc = "0: Period clock not generated"]
    Value1 = 0,
    #[doc = "1: Period clock generated"]
    Value2 = 1,
}
impl From<Pclks> for bool {
    #[inline(always)]
    fn from(variant: Pclks) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `PCLKS` reader - Quadrature Period Clk Status"]
pub type PclksR = crate::BitReader<Pclks>;
impl PclksR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Pclks {
        match self.bits {
            false => Pclks::Value1,
            true => Pclks::Value2,
        }
    }
    #[doc = "Period clock not generated"]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Pclks::Value1
    }
    #[doc = "Period clock generated"]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Pclks::Value2
    }
}
impl R {
    #[doc = "Bit 0 - Correct Hall Event Status"]
    #[inline(always)]
    pub fn ches(&self) -> ChesR {
        ChesR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Wrong Hall Event Status"]
    #[inline(always)]
    pub fn whes(&self) -> WhesR {
        WhesR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Hall Inputs Update Status"]
    #[inline(always)]
    pub fn hies(&self) -> HiesR {
        HiesR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 4 - Multi-Channel pattern shadow transfer status"]
    #[inline(always)]
    pub fn msts(&self) -> MstsR {
        MstsR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 8 - Quadrature Index Status"]
    #[inline(always)]
    pub fn indxs(&self) -> IndxsR {
        IndxsR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Quadrature Phase Error Status"]
    #[inline(always)]
    pub fn errs(&self) -> ErrsR {
        ErrsR::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Quadrature CLK Status"]
    #[inline(always)]
    pub fn cnts(&self) -> CntsR {
        CntsR::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Quadrature Direction Change"]
    #[inline(always)]
    pub fn dirs(&self) -> DirsR {
        DirsR::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bit 12 - Quadrature Period Clk Status"]
    #[inline(always)]
    pub fn pclks(&self) -> PclksR {
        PclksR::new(((self.bits >> 12) & 1) != 0)
    }
}
#[doc = "POSIF Interrupt Flags\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`pflg::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct PflgSpec;
impl crate::RegisterSpec for PflgSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`pflg::R`](R) reader structure"]
impl crate::Readable for PflgSpec {}
#[doc = "`reset()` method sets PFLG to value 0"]
impl crate::Resettable for PflgSpec {
    const RESET_VALUE: u32 = 0;
}