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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
#[doc = r" Value read from the register"]
pub struct R {
    bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
    bits: u32,
}
impl super::HPM_CAL1 {
    #[doc = r" Modifies the contents of the register"]
    #[inline]
    pub fn modify<F>(&self, f: F)
    where
        for<'w> F: FnOnce(&R, &'w mut W) -> &'w mut W,
    {
        let bits = self.register.get();
        let r = R { bits: bits };
        let mut w = W { bits: bits };
        f(&r, &mut w);
        self.register.set(w.bits);
    }
    #[doc = r" Reads the contents of the register"]
    #[inline]
    pub fn read(&self) -> R {
        R {
            bits: self.register.get(),
        }
    }
    #[doc = r" Writes to the register"]
    #[inline]
    pub fn write<F>(&self, f: F)
    where
        F: FnOnce(&mut W) -> &mut W,
    {
        let mut w = W::reset_value();
        f(&mut w);
        self.register.set(w.bits);
    }
    #[doc = r" Writes the reset value to the register"]
    #[inline]
    pub fn reset(&self) {
        self.write(|w| w)
    }
}
#[doc = r" Value of the field"]
pub struct HPM_COUNT_1R {
    bits: u32,
}
impl HPM_COUNT_1R {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u32 {
        self.bits
    }
}
#[doc = "Possible values of the field `CS_WT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CS_WTR {
    #[doc = "128 us"]
    _000,
    #[doc = "256 us"]
    _001,
    #[doc = "384 us"]
    _010,
    #[doc = "512 us"]
    _011,
    #[doc = "640 us"]
    _100,
    #[doc = "768 us"]
    _101,
    #[doc = "896 us"]
    _110,
    #[doc = "1024 us"]
    _111,
}
impl CS_WTR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        match *self {
            CS_WTR::_000 => 0,
            CS_WTR::_001 => 1,
            CS_WTR::_010 => 2,
            CS_WTR::_011 => 3,
            CS_WTR::_100 => 4,
            CS_WTR::_101 => 5,
            CS_WTR::_110 => 6,
            CS_WTR::_111 => 7,
        }
    }
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _from(value: u8) -> CS_WTR {
        match value {
            0 => CS_WTR::_000,
            1 => CS_WTR::_001,
            2 => CS_WTR::_010,
            3 => CS_WTR::_011,
            4 => CS_WTR::_100,
            5 => CS_WTR::_101,
            6 => CS_WTR::_110,
            7 => CS_WTR::_111,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_000`"]
    #[inline]
    pub fn is_000(&self) -> bool {
        *self == CS_WTR::_000
    }
    #[doc = "Checks if the value of the field is `_001`"]
    #[inline]
    pub fn is_001(&self) -> bool {
        *self == CS_WTR::_001
    }
    #[doc = "Checks if the value of the field is `_010`"]
    #[inline]
    pub fn is_010(&self) -> bool {
        *self == CS_WTR::_010
    }
    #[doc = "Checks if the value of the field is `_011`"]
    #[inline]
    pub fn is_011(&self) -> bool {
        *self == CS_WTR::_011
    }
    #[doc = "Checks if the value of the field is `_100`"]
    #[inline]
    pub fn is_100(&self) -> bool {
        *self == CS_WTR::_100
    }
    #[doc = "Checks if the value of the field is `_101`"]
    #[inline]
    pub fn is_101(&self) -> bool {
        *self == CS_WTR::_101
    }
    #[doc = "Checks if the value of the field is `_110`"]
    #[inline]
    pub fn is_110(&self) -> bool {
        *self == CS_WTR::_110
    }
    #[doc = "Checks if the value of the field is `_111`"]
    #[inline]
    pub fn is_111(&self) -> bool {
        *self == CS_WTR::_111
    }
}
#[doc = "Possible values of the field `CS_FW`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum CS_FWR {
    #[doc = "8 us"]
    _000,
    #[doc = "16 us"]
    _001,
    #[doc = "24 us"]
    _010,
    #[doc = "32 us"]
    _011,
    #[doc = "64 us"]
    _100,
    #[doc = "96 us"]
    _101,
    #[doc = "128 us"]
    _110,
    #[doc = "256 us"]
    _111,
}
impl CS_FWR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        match *self {
            CS_FWR::_000 => 0,
            CS_FWR::_001 => 1,
            CS_FWR::_010 => 2,
            CS_FWR::_011 => 3,
            CS_FWR::_100 => 4,
            CS_FWR::_101 => 5,
            CS_FWR::_110 => 6,
            CS_FWR::_111 => 7,
        }
    }
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _from(value: u8) -> CS_FWR {
        match value {
            0 => CS_FWR::_000,
            1 => CS_FWR::_001,
            2 => CS_FWR::_010,
            3 => CS_FWR::_011,
            4 => CS_FWR::_100,
            5 => CS_FWR::_101,
            6 => CS_FWR::_110,
            7 => CS_FWR::_111,
            _ => unreachable!(),
        }
    }
    #[doc = "Checks if the value of the field is `_000`"]
    #[inline]
    pub fn is_000(&self) -> bool {
        *self == CS_FWR::_000
    }
    #[doc = "Checks if the value of the field is `_001`"]
    #[inline]
    pub fn is_001(&self) -> bool {
        *self == CS_FWR::_001
    }
    #[doc = "Checks if the value of the field is `_010`"]
    #[inline]
    pub fn is_010(&self) -> bool {
        *self == CS_FWR::_010
    }
    #[doc = "Checks if the value of the field is `_011`"]
    #[inline]
    pub fn is_011(&self) -> bool {
        *self == CS_FWR::_011
    }
    #[doc = "Checks if the value of the field is `_100`"]
    #[inline]
    pub fn is_100(&self) -> bool {
        *self == CS_FWR::_100
    }
    #[doc = "Checks if the value of the field is `_101`"]
    #[inline]
    pub fn is_101(&self) -> bool {
        *self == CS_FWR::_101
    }
    #[doc = "Checks if the value of the field is `_110`"]
    #[inline]
    pub fn is_110(&self) -> bool {
        *self == CS_FWR::_110
    }
    #[doc = "Checks if the value of the field is `_111`"]
    #[inline]
    pub fn is_111(&self) -> bool {
        *self == CS_FWR::_111
    }
}
#[doc = r" Value of the field"]
pub struct CS_FCNTR {
    bits: u8,
}
impl CS_FCNTR {
    #[doc = r" Value of the field as raw bits"]
    #[inline]
    pub fn bits(&self) -> u8 {
        self.bits
    }
}
#[doc = "Values that can be written to the field `CS_WT`"]
pub enum CS_WTW {
    #[doc = "128 us"]
    _000,
    #[doc = "256 us"]
    _001,
    #[doc = "384 us"]
    _010,
    #[doc = "512 us"]
    _011,
    #[doc = "640 us"]
    _100,
    #[doc = "768 us"]
    _101,
    #[doc = "896 us"]
    _110,
    #[doc = "1024 us"]
    _111,
}
impl CS_WTW {
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _bits(&self) -> u8 {
        match *self {
            CS_WTW::_000 => 0,
            CS_WTW::_001 => 1,
            CS_WTW::_010 => 2,
            CS_WTW::_011 => 3,
            CS_WTW::_100 => 4,
            CS_WTW::_101 => 5,
            CS_WTW::_110 => 6,
            CS_WTW::_111 => 7,
        }
    }
}
#[doc = r" Proxy"]
pub struct _CS_WTW<'a> {
    w: &'a mut W,
}
impl<'a> _CS_WTW<'a> {
    #[doc = r" Writes `variant` to the field"]
    #[inline]
    pub fn variant(self, variant: CS_WTW) -> &'a mut W {
        {
            self.bits(variant._bits())
        }
    }
    #[doc = "128 us"]
    #[inline]
    pub fn _000(self) -> &'a mut W {
        self.variant(CS_WTW::_000)
    }
    #[doc = "256 us"]
    #[inline]
    pub fn _001(self) -> &'a mut W {
        self.variant(CS_WTW::_001)
    }
    #[doc = "384 us"]
    #[inline]
    pub fn _010(self) -> &'a mut W {
        self.variant(CS_WTW::_010)
    }
    #[doc = "512 us"]
    #[inline]
    pub fn _011(self) -> &'a mut W {
        self.variant(CS_WTW::_011)
    }
    #[doc = "640 us"]
    #[inline]
    pub fn _100(self) -> &'a mut W {
        self.variant(CS_WTW::_100)
    }
    #[doc = "768 us"]
    #[inline]
    pub fn _101(self) -> &'a mut W {
        self.variant(CS_WTW::_101)
    }
    #[doc = "896 us"]
    #[inline]
    pub fn _110(self) -> &'a mut W {
        self.variant(CS_WTW::_110)
    }
    #[doc = "1024 us"]
    #[inline]
    pub fn _111(self) -> &'a mut W {
        self.variant(CS_WTW::_111)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 7;
        const OFFSET: u8 = 20;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = "Values that can be written to the field `CS_FW`"]
pub enum CS_FWW {
    #[doc = "8 us"]
    _000,
    #[doc = "16 us"]
    _001,
    #[doc = "24 us"]
    _010,
    #[doc = "32 us"]
    _011,
    #[doc = "64 us"]
    _100,
    #[doc = "96 us"]
    _101,
    #[doc = "128 us"]
    _110,
    #[doc = "256 us"]
    _111,
}
impl CS_FWW {
    #[allow(missing_docs)]
    #[doc(hidden)]
    #[inline]
    pub fn _bits(&self) -> u8 {
        match *self {
            CS_FWW::_000 => 0,
            CS_FWW::_001 => 1,
            CS_FWW::_010 => 2,
            CS_FWW::_011 => 3,
            CS_FWW::_100 => 4,
            CS_FWW::_101 => 5,
            CS_FWW::_110 => 6,
            CS_FWW::_111 => 7,
        }
    }
}
#[doc = r" Proxy"]
pub struct _CS_FWW<'a> {
    w: &'a mut W,
}
impl<'a> _CS_FWW<'a> {
    #[doc = r" Writes `variant` to the field"]
    #[inline]
    pub fn variant(self, variant: CS_FWW) -> &'a mut W {
        {
            self.bits(variant._bits())
        }
    }
    #[doc = "8 us"]
    #[inline]
    pub fn _000(self) -> &'a mut W {
        self.variant(CS_FWW::_000)
    }
    #[doc = "16 us"]
    #[inline]
    pub fn _001(self) -> &'a mut W {
        self.variant(CS_FWW::_001)
    }
    #[doc = "24 us"]
    #[inline]
    pub fn _010(self) -> &'a mut W {
        self.variant(CS_FWW::_010)
    }
    #[doc = "32 us"]
    #[inline]
    pub fn _011(self) -> &'a mut W {
        self.variant(CS_FWW::_011)
    }
    #[doc = "64 us"]
    #[inline]
    pub fn _100(self) -> &'a mut W {
        self.variant(CS_FWW::_100)
    }
    #[doc = "96 us"]
    #[inline]
    pub fn _101(self) -> &'a mut W {
        self.variant(CS_FWW::_101)
    }
    #[doc = "128 us"]
    #[inline]
    pub fn _110(self) -> &'a mut W {
        self.variant(CS_FWW::_110)
    }
    #[doc = "256 us"]
    #[inline]
    pub fn _111(self) -> &'a mut W {
        self.variant(CS_FWW::_111)
    }
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 7;
        const OFFSET: u8 = 24;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
#[doc = r" Proxy"]
pub struct _CS_FCNTW<'a> {
    w: &'a mut W,
}
impl<'a> _CS_FCNTW<'a> {
    #[doc = r" Writes raw bits to the field"]
    #[inline]
    pub unsafe fn bits(self, value: u8) -> &'a mut W {
        const MASK: u8 = 15;
        const OFFSET: u8 = 28;
        self.w.bits &= !((MASK as u32) << OFFSET);
        self.w.bits |= ((value & MASK) as u32) << OFFSET;
        self.w
    }
}
impl R {
    #[doc = r" Value of the register as raw bits"]
    #[inline]
    pub fn bits(&self) -> u32 {
        self.bits
    }
    #[doc = "Bits 0:18 - High Port Modulation Counter Value 1"]
    #[inline]
    pub fn hpm_count_1(&self) -> HPM_COUNT_1R {
        let bits = {
            const MASK: u32 = 524287;
            const OFFSET: u8 = 0;
            ((self.bits >> OFFSET) & MASK as u32) as u32
        };
        HPM_COUNT_1R { bits }
    }
    #[doc = "Bits 20:22 - Cycle Slip Wait Time"]
    #[inline]
    pub fn cs_wt(&self) -> CS_WTR {
        CS_WTR::_from({
            const MASK: u8 = 7;
            const OFFSET: u8 = 20;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        })
    }
    #[doc = "Bits 24:26 - Cycle Slip Flag Window"]
    #[inline]
    pub fn cs_fw(&self) -> CS_FWR {
        CS_FWR::_from({
            const MASK: u8 = 7;
            const OFFSET: u8 = 24;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        })
    }
    #[doc = "Bits 28:31 - Cycle Slip Flag Count"]
    #[inline]
    pub fn cs_fcnt(&self) -> CS_FCNTR {
        let bits = {
            const MASK: u8 = 15;
            const OFFSET: u8 = 28;
            ((self.bits >> OFFSET) & MASK as u32) as u8
        };
        CS_FCNTR { bits }
    }
}
impl W {
    #[doc = r" Reset value of the register"]
    #[inline]
    pub fn reset_value() -> W {
        W { bits: 1143996416 }
    }
    #[doc = r" Writes raw bits to the register"]
    #[inline]
    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
        self.bits = bits;
        self
    }
    #[doc = "Bits 20:22 - Cycle Slip Wait Time"]
    #[inline]
    pub fn cs_wt(&mut self) -> _CS_WTW {
        _CS_WTW { w: self }
    }
    #[doc = "Bits 24:26 - Cycle Slip Flag Window"]
    #[inline]
    pub fn cs_fw(&mut self) -> _CS_FWW {
        _CS_FWW { w: self }
    }
    #[doc = "Bits 28:31 - Cycle Slip Flag Count"]
    #[inline]
    pub fn cs_fcnt(&mut self) -> _CS_FCNTW {
        _CS_FCNTW { w: self }
    }
}