stm32h7 0.16.0

Device support crates for STM32H7 devices
Documentation
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
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
///Register `CR` reader
pub type R = crate::R<CRrs>;
///Register `CR` writer
pub type W = crate::W<CRrs>;
/**Parallel data clock polarity This bit configures the capture edge of the parallel clock or the edge used for driving outputs, depending on OUTEN.

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum CKPOL {
    ///0: Falling edge active for inputs or rising edge active for outputs
    FallingEdge = 0,
    ///1: Rising edge active for inputs or falling edge active for outputs
    RisingEdge = 1,
}
impl From<CKPOL> for bool {
    #[inline(always)]
    fn from(variant: CKPOL) -> Self {
        variant as u8 != 0
    }
}
///Field `CKPOL` reader - Parallel data clock polarity This bit configures the capture edge of the parallel clock or the edge used for driving outputs, depending on OUTEN.
pub type CKPOL_R = crate::BitReader<CKPOL>;
impl CKPOL_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> CKPOL {
        match self.bits {
            false => CKPOL::FallingEdge,
            true => CKPOL::RisingEdge,
        }
    }
    ///Falling edge active for inputs or rising edge active for outputs
    #[inline(always)]
    pub fn is_falling_edge(&self) -> bool {
        *self == CKPOL::FallingEdge
    }
    ///Rising edge active for inputs or falling edge active for outputs
    #[inline(always)]
    pub fn is_rising_edge(&self) -> bool {
        *self == CKPOL::RisingEdge
    }
}
///Field `CKPOL` writer - Parallel data clock polarity This bit configures the capture edge of the parallel clock or the edge used for driving outputs, depending on OUTEN.
pub type CKPOL_W<'a, REG> = crate::BitWriter<'a, REG, CKPOL>;
impl<'a, REG> CKPOL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    ///Falling edge active for inputs or rising edge active for outputs
    #[inline(always)]
    pub fn falling_edge(self) -> &'a mut crate::W<REG> {
        self.variant(CKPOL::FallingEdge)
    }
    ///Rising edge active for inputs or falling edge active for outputs
    #[inline(always)]
    pub fn rising_edge(self) -> &'a mut crate::W<REG> {
        self.variant(CKPOL::RisingEdge)
    }
}
/**Data enable (PSSI_DE) polarity This bit indicates the level on the PSSI_DE pin when the data are not valid on the parallel interface.

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DEPOL {
    ///0: PSSI_DE active low (0 indicates that data is valid)
    ActiveLow = 0,
    ///1: PSSI_DE active high (1 indicates that data is valid)
    ActiveHigh = 1,
}
impl From<DEPOL> for bool {
    #[inline(always)]
    fn from(variant: DEPOL) -> Self {
        variant as u8 != 0
    }
}
///Field `DEPOL` reader - Data enable (PSSI_DE) polarity This bit indicates the level on the PSSI_DE pin when the data are not valid on the parallel interface.
pub type DEPOL_R = crate::BitReader<DEPOL>;
impl DEPOL_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> DEPOL {
        match self.bits {
            false => DEPOL::ActiveLow,
            true => DEPOL::ActiveHigh,
        }
    }
    ///PSSI_DE active low (0 indicates that data is valid)
    #[inline(always)]
    pub fn is_active_low(&self) -> bool {
        *self == DEPOL::ActiveLow
    }
    ///PSSI_DE active high (1 indicates that data is valid)
    #[inline(always)]
    pub fn is_active_high(&self) -> bool {
        *self == DEPOL::ActiveHigh
    }
}
///Field `DEPOL` writer - Data enable (PSSI_DE) polarity This bit indicates the level on the PSSI_DE pin when the data are not valid on the parallel interface.
pub type DEPOL_W<'a, REG> = crate::BitWriter<'a, REG, DEPOL>;
impl<'a, REG> DEPOL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    ///PSSI_DE active low (0 indicates that data is valid)
    #[inline(always)]
    pub fn active_low(self) -> &'a mut crate::W<REG> {
        self.variant(DEPOL::ActiveLow)
    }
    ///PSSI_DE active high (1 indicates that data is valid)
    #[inline(always)]
    pub fn active_high(self) -> &'a mut crate::W<REG> {
        self.variant(DEPOL::ActiveHigh)
    }
}
/**Ready (PSSI_RDY) polarity This bit indicates the level on the PSSI_RDY pin when the data are not valid on the parallel interface.

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RDYPOL {
    ///0: PSSI_RDY active low (0 indicates that the receiver is ready to receive)
    ActiveLow = 0,
    ///1: PSSI_RDY active high (1 indicates that the receiver is ready to receive)
    ActiveHigh = 1,
}
impl From<RDYPOL> for bool {
    #[inline(always)]
    fn from(variant: RDYPOL) -> Self {
        variant as u8 != 0
    }
}
///Field `RDYPOL` reader - Ready (PSSI_RDY) polarity This bit indicates the level on the PSSI_RDY pin when the data are not valid on the parallel interface.
pub type RDYPOL_R = crate::BitReader<RDYPOL>;
impl RDYPOL_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> RDYPOL {
        match self.bits {
            false => RDYPOL::ActiveLow,
            true => RDYPOL::ActiveHigh,
        }
    }
    ///PSSI_RDY active low (0 indicates that the receiver is ready to receive)
    #[inline(always)]
    pub fn is_active_low(&self) -> bool {
        *self == RDYPOL::ActiveLow
    }
    ///PSSI_RDY active high (1 indicates that the receiver is ready to receive)
    #[inline(always)]
    pub fn is_active_high(&self) -> bool {
        *self == RDYPOL::ActiveHigh
    }
}
///Field `RDYPOL` writer - Ready (PSSI_RDY) polarity This bit indicates the level on the PSSI_RDY pin when the data are not valid on the parallel interface.
pub type RDYPOL_W<'a, REG> = crate::BitWriter<'a, REG, RDYPOL>;
impl<'a, REG> RDYPOL_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    ///PSSI_RDY active low (0 indicates that the receiver is ready to receive)
    #[inline(always)]
    pub fn active_low(self) -> &'a mut crate::W<REG> {
        self.variant(RDYPOL::ActiveLow)
    }
    ///PSSI_RDY active high (1 indicates that the receiver is ready to receive)
    #[inline(always)]
    pub fn active_high(self) -> &'a mut crate::W<REG> {
        self.variant(RDYPOL::ActiveHigh)
    }
}
/**Extended data mode

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum EDM {
    ///0: Interface captures 8-bit data on every parallel data clock
    BitWidth8 = 0,
    ///3: The interface captures 16-bit data on every parallel data clock
    BitWidth16 = 3,
}
impl From<EDM> for u8 {
    #[inline(always)]
    fn from(variant: EDM) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for EDM {
    type Ux = u8;
}
impl crate::IsEnum for EDM {}
///Field `EDM` reader - Extended data mode
pub type EDM_R = crate::FieldReader<EDM>;
impl EDM_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> Option<EDM> {
        match self.bits {
            0 => Some(EDM::BitWidth8),
            3 => Some(EDM::BitWidth16),
            _ => None,
        }
    }
    ///Interface captures 8-bit data on every parallel data clock
    #[inline(always)]
    pub fn is_bit_width8(&self) -> bool {
        *self == EDM::BitWidth8
    }
    ///The interface captures 16-bit data on every parallel data clock
    #[inline(always)]
    pub fn is_bit_width16(&self) -> bool {
        *self == EDM::BitWidth16
    }
}
///Field `EDM` writer - Extended data mode
pub type EDM_W<'a, REG> = crate::FieldWriter<'a, REG, 2, EDM>;
impl<'a, REG> EDM_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///Interface captures 8-bit data on every parallel data clock
    #[inline(always)]
    pub fn bit_width8(self) -> &'a mut crate::W<REG> {
        self.variant(EDM::BitWidth8)
    }
    ///The interface captures 16-bit data on every parallel data clock
    #[inline(always)]
    pub fn bit_width16(self) -> &'a mut crate::W<REG> {
        self.variant(EDM::BitWidth16)
    }
}
/**PSSI enable The contents of the FIFO are flushed when ENABLE is cleared to 0. Note: When ENABLE=1, the content of PSSI_CR must not be changed, except for the ENABLE bit itself. All configuration bits can change as soon as ENABLE changes from 0 to 1. Note: The DMA controller and all PSSI configuration registers must be programmed correctly before setting the ENABLE bit to 1.

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ENABLE {
    ///0: PSSI disabled
    Disabled = 0,
    ///1: PSSI enabled
    Enabled = 1,
}
impl From<ENABLE> for bool {
    #[inline(always)]
    fn from(variant: ENABLE) -> Self {
        variant as u8 != 0
    }
}
///Field `ENABLE` reader - PSSI enable The contents of the FIFO are flushed when ENABLE is cleared to 0. Note: When ENABLE=1, the content of PSSI_CR must not be changed, except for the ENABLE bit itself. All configuration bits can change as soon as ENABLE changes from 0 to 1. Note: The DMA controller and all PSSI configuration registers must be programmed correctly before setting the ENABLE bit to 1.
pub type ENABLE_R = crate::BitReader<ENABLE>;
impl ENABLE_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> ENABLE {
        match self.bits {
            false => ENABLE::Disabled,
            true => ENABLE::Enabled,
        }
    }
    ///PSSI disabled
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == ENABLE::Disabled
    }
    ///PSSI enabled
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == ENABLE::Enabled
    }
}
///Field `ENABLE` writer - PSSI enable The contents of the FIFO are flushed when ENABLE is cleared to 0. Note: When ENABLE=1, the content of PSSI_CR must not be changed, except for the ENABLE bit itself. All configuration bits can change as soon as ENABLE changes from 0 to 1. Note: The DMA controller and all PSSI configuration registers must be programmed correctly before setting the ENABLE bit to 1.
pub type ENABLE_W<'a, REG> = crate::BitWriter<'a, REG, ENABLE>;
impl<'a, REG> ENABLE_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    ///PSSI disabled
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(ENABLE::Disabled)
    }
    ///PSSI enabled
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(ENABLE::Enabled)
    }
}
/**Data enable and ready configuration When the PSSI_RDY function is mapped to the PSSI_DE pin (settings 101 or 111), it is still the RDYPOL bit which determines its polarity. Similarly, when the PSSI_DE function is mapped to the PSSI_RDY pin (settings 110 or 111), it is still the DEPOL bit which determines its polarity.

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum DERDYCFG {
    ///0: PSSI_DE and PSSI_RDY both disabled
    Disabled = 0,
    ///1: Only PSSI_RDY enabled
    Rdy = 1,
    ///2: Only PSSI_DE enabled
    De = 2,
    ///3: Both PSSI_RDY and PSSI_DE alternate functions enabled
    RdyDeAlt = 3,
    ///4: Both PSSI_RDY and PSSI_DE features enabled - bidirectional on PSSI_RDY pin
    RdyDe = 4,
    ///5: Only PSSI_RDY function enabled, but mapped to PSSI_DE pin
    RdyRemapped = 5,
    ///6: Only PSSI_DE function enabled, but mapped to PSSI_RDY pin
    DeRemapped = 6,
    ///7: Both PSSI_RDY and PSSI_DE features enabled - bidirectional on PSSI_DE pin
    RdyDeBidi = 7,
}
impl From<DERDYCFG> for u8 {
    #[inline(always)]
    fn from(variant: DERDYCFG) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for DERDYCFG {
    type Ux = u8;
}
impl crate::IsEnum for DERDYCFG {}
///Field `DERDYCFG` reader - Data enable and ready configuration When the PSSI_RDY function is mapped to the PSSI_DE pin (settings 101 or 111), it is still the RDYPOL bit which determines its polarity. Similarly, when the PSSI_DE function is mapped to the PSSI_RDY pin (settings 110 or 111), it is still the DEPOL bit which determines its polarity.
pub type DERDYCFG_R = crate::FieldReader<DERDYCFG>;
impl DERDYCFG_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> DERDYCFG {
        match self.bits {
            0 => DERDYCFG::Disabled,
            1 => DERDYCFG::Rdy,
            2 => DERDYCFG::De,
            3 => DERDYCFG::RdyDeAlt,
            4 => DERDYCFG::RdyDe,
            5 => DERDYCFG::RdyRemapped,
            6 => DERDYCFG::DeRemapped,
            7 => DERDYCFG::RdyDeBidi,
            _ => unreachable!(),
        }
    }
    ///PSSI_DE and PSSI_RDY both disabled
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == DERDYCFG::Disabled
    }
    ///Only PSSI_RDY enabled
    #[inline(always)]
    pub fn is_rdy(&self) -> bool {
        *self == DERDYCFG::Rdy
    }
    ///Only PSSI_DE enabled
    #[inline(always)]
    pub fn is_de(&self) -> bool {
        *self == DERDYCFG::De
    }
    ///Both PSSI_RDY and PSSI_DE alternate functions enabled
    #[inline(always)]
    pub fn is_rdy_de_alt(&self) -> bool {
        *self == DERDYCFG::RdyDeAlt
    }
    ///Both PSSI_RDY and PSSI_DE features enabled - bidirectional on PSSI_RDY pin
    #[inline(always)]
    pub fn is_rdy_de(&self) -> bool {
        *self == DERDYCFG::RdyDe
    }
    ///Only PSSI_RDY function enabled, but mapped to PSSI_DE pin
    #[inline(always)]
    pub fn is_rdy_remapped(&self) -> bool {
        *self == DERDYCFG::RdyRemapped
    }
    ///Only PSSI_DE function enabled, but mapped to PSSI_RDY pin
    #[inline(always)]
    pub fn is_de_remapped(&self) -> bool {
        *self == DERDYCFG::DeRemapped
    }
    ///Both PSSI_RDY and PSSI_DE features enabled - bidirectional on PSSI_DE pin
    #[inline(always)]
    pub fn is_rdy_de_bidi(&self) -> bool {
        *self == DERDYCFG::RdyDeBidi
    }
}
///Field `DERDYCFG` writer - Data enable and ready configuration When the PSSI_RDY function is mapped to the PSSI_DE pin (settings 101 or 111), it is still the RDYPOL bit which determines its polarity. Similarly, when the PSSI_DE function is mapped to the PSSI_RDY pin (settings 110 or 111), it is still the DEPOL bit which determines its polarity.
pub type DERDYCFG_W<'a, REG> = crate::FieldWriter<'a, REG, 3, DERDYCFG, crate::Safe>;
impl<'a, REG> DERDYCFG_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
    REG::Ux: From<u8>,
{
    ///PSSI_DE and PSSI_RDY both disabled
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::Disabled)
    }
    ///Only PSSI_RDY enabled
    #[inline(always)]
    pub fn rdy(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::Rdy)
    }
    ///Only PSSI_DE enabled
    #[inline(always)]
    pub fn de(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::De)
    }
    ///Both PSSI_RDY and PSSI_DE alternate functions enabled
    #[inline(always)]
    pub fn rdy_de_alt(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::RdyDeAlt)
    }
    ///Both PSSI_RDY and PSSI_DE features enabled - bidirectional on PSSI_RDY pin
    #[inline(always)]
    pub fn rdy_de(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::RdyDe)
    }
    ///Only PSSI_RDY function enabled, but mapped to PSSI_DE pin
    #[inline(always)]
    pub fn rdy_remapped(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::RdyRemapped)
    }
    ///Only PSSI_DE function enabled, but mapped to PSSI_RDY pin
    #[inline(always)]
    pub fn de_remapped(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::DeRemapped)
    }
    ///Both PSSI_RDY and PSSI_DE features enabled - bidirectional on PSSI_DE pin
    #[inline(always)]
    pub fn rdy_de_bidi(self) -> &'a mut crate::W<REG> {
        self.variant(DERDYCFG::RdyDeBidi)
    }
}
///Field `CKSRC` reader - Clock source This bit configures the clock source of the PSSI_PDCK.
pub type CKSRC_R = crate::BitReader;
///Field `CKSRC` writer - Clock source This bit configures the clock source of the PSSI_PDCK.
pub type CKSRC_W<'a, REG> = crate::BitWriter<'a, REG>;
/**DMA enable bit

Value on reset: 1*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum DMAEN {
    ///0: DMA transfers are disabled. The user application can directly access the PSSI_DR register when DMA transfers are disabled.
    Disabled = 0,
    ///1: DMA transfers are enabled (default configuration). A DMA channel in the general-purpose DMA controller must be configured to perform transfers from/to PSSI_DR
    Enabled = 1,
}
impl From<DMAEN> for bool {
    #[inline(always)]
    fn from(variant: DMAEN) -> Self {
        variant as u8 != 0
    }
}
///Field `DMAEN` reader - DMA enable bit
pub type DMAEN_R = crate::BitReader<DMAEN>;
impl DMAEN_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> DMAEN {
        match self.bits {
            false => DMAEN::Disabled,
            true => DMAEN::Enabled,
        }
    }
    ///DMA transfers are disabled. The user application can directly access the PSSI_DR register when DMA transfers are disabled.
    #[inline(always)]
    pub fn is_disabled(&self) -> bool {
        *self == DMAEN::Disabled
    }
    ///DMA transfers are enabled (default configuration). A DMA channel in the general-purpose DMA controller must be configured to perform transfers from/to PSSI_DR
    #[inline(always)]
    pub fn is_enabled(&self) -> bool {
        *self == DMAEN::Enabled
    }
}
///Field `DMAEN` writer - DMA enable bit
pub type DMAEN_W<'a, REG> = crate::BitWriter<'a, REG, DMAEN>;
impl<'a, REG> DMAEN_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    ///DMA transfers are disabled. The user application can directly access the PSSI_DR register when DMA transfers are disabled.
    #[inline(always)]
    pub fn disabled(self) -> &'a mut crate::W<REG> {
        self.variant(DMAEN::Disabled)
    }
    ///DMA transfers are enabled (default configuration). A DMA channel in the general-purpose DMA controller must be configured to perform transfers from/to PSSI_DR
    #[inline(always)]
    pub fn enabled(self) -> &'a mut crate::W<REG> {
        self.variant(DMAEN::Enabled)
    }
}
/**Data direction selection bit

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OUTEN {
    ///0: Data is input synchronously with PSSI_PDCK
    ReceiveMode = 0,
    ///1: Data is output synchronously with PSSI_PDCK
    TransmitMode = 1,
}
impl From<OUTEN> for bool {
    #[inline(always)]
    fn from(variant: OUTEN) -> Self {
        variant as u8 != 0
    }
}
///Field `OUTEN` reader - Data direction selection bit
pub type OUTEN_R = crate::BitReader<OUTEN>;
impl OUTEN_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> OUTEN {
        match self.bits {
            false => OUTEN::ReceiveMode,
            true => OUTEN::TransmitMode,
        }
    }
    ///Data is input synchronously with PSSI_PDCK
    #[inline(always)]
    pub fn is_receive_mode(&self) -> bool {
        *self == OUTEN::ReceiveMode
    }
    ///Data is output synchronously with PSSI_PDCK
    #[inline(always)]
    pub fn is_transmit_mode(&self) -> bool {
        *self == OUTEN::TransmitMode
    }
}
///Field `OUTEN` writer - Data direction selection bit
pub type OUTEN_W<'a, REG> = crate::BitWriter<'a, REG, OUTEN>;
impl<'a, REG> OUTEN_W<'a, REG>
where
    REG: crate::Writable + crate::RegisterSpec,
{
    ///Data is input synchronously with PSSI_PDCK
    #[inline(always)]
    pub fn receive_mode(self) -> &'a mut crate::W<REG> {
        self.variant(OUTEN::ReceiveMode)
    }
    ///Data is output synchronously with PSSI_PDCK
    #[inline(always)]
    pub fn transmit_mode(self) -> &'a mut crate::W<REG> {
        self.variant(OUTEN::TransmitMode)
    }
}
impl R {
    ///Bit 5 - Parallel data clock polarity This bit configures the capture edge of the parallel clock or the edge used for driving outputs, depending on OUTEN.
    #[inline(always)]
    pub fn ckpol(&self) -> CKPOL_R {
        CKPOL_R::new(((self.bits >> 5) & 1) != 0)
    }
    ///Bit 6 - Data enable (PSSI_DE) polarity This bit indicates the level on the PSSI_DE pin when the data are not valid on the parallel interface.
    #[inline(always)]
    pub fn depol(&self) -> DEPOL_R {
        DEPOL_R::new(((self.bits >> 6) & 1) != 0)
    }
    ///Bit 8 - Ready (PSSI_RDY) polarity This bit indicates the level on the PSSI_RDY pin when the data are not valid on the parallel interface.
    #[inline(always)]
    pub fn rdypol(&self) -> RDYPOL_R {
        RDYPOL_R::new(((self.bits >> 8) & 1) != 0)
    }
    ///Bits 10:11 - Extended data mode
    #[inline(always)]
    pub fn edm(&self) -> EDM_R {
        EDM_R::new(((self.bits >> 10) & 3) as u8)
    }
    ///Bit 14 - PSSI enable The contents of the FIFO are flushed when ENABLE is cleared to 0. Note: When ENABLE=1, the content of PSSI_CR must not be changed, except for the ENABLE bit itself. All configuration bits can change as soon as ENABLE changes from 0 to 1. Note: The DMA controller and all PSSI configuration registers must be programmed correctly before setting the ENABLE bit to 1.
    #[inline(always)]
    pub fn enable(&self) -> ENABLE_R {
        ENABLE_R::new(((self.bits >> 14) & 1) != 0)
    }
    ///Bits 18:20 - Data enable and ready configuration When the PSSI_RDY function is mapped to the PSSI_DE pin (settings 101 or 111), it is still the RDYPOL bit which determines its polarity. Similarly, when the PSSI_DE function is mapped to the PSSI_RDY pin (settings 110 or 111), it is still the DEPOL bit which determines its polarity.
    #[inline(always)]
    pub fn derdycfg(&self) -> DERDYCFG_R {
        DERDYCFG_R::new(((self.bits >> 18) & 7) as u8)
    }
    ///Bit 29 - Clock source This bit configures the clock source of the PSSI_PDCK.
    #[inline(always)]
    pub fn cksrc(&self) -> CKSRC_R {
        CKSRC_R::new(((self.bits >> 29) & 1) != 0)
    }
    ///Bit 30 - DMA enable bit
    #[inline(always)]
    pub fn dmaen(&self) -> DMAEN_R {
        DMAEN_R::new(((self.bits >> 30) & 1) != 0)
    }
    ///Bit 31 - Data direction selection bit
    #[inline(always)]
    pub fn outen(&self) -> OUTEN_R {
        OUTEN_R::new(((self.bits >> 31) & 1) != 0)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("CR")
            .field("ckpol", &self.ckpol())
            .field("depol", &self.depol())
            .field("rdypol", &self.rdypol())
            .field("edm", &self.edm())
            .field("enable", &self.enable())
            .field("derdycfg", &self.derdycfg())
            .field("cksrc", &self.cksrc())
            .field("dmaen", &self.dmaen())
            .field("outen", &self.outen())
            .finish()
    }
}
impl W {
    ///Bit 5 - Parallel data clock polarity This bit configures the capture edge of the parallel clock or the edge used for driving outputs, depending on OUTEN.
    #[inline(always)]
    pub fn ckpol(&mut self) -> CKPOL_W<CRrs> {
        CKPOL_W::new(self, 5)
    }
    ///Bit 6 - Data enable (PSSI_DE) polarity This bit indicates the level on the PSSI_DE pin when the data are not valid on the parallel interface.
    #[inline(always)]
    pub fn depol(&mut self) -> DEPOL_W<CRrs> {
        DEPOL_W::new(self, 6)
    }
    ///Bit 8 - Ready (PSSI_RDY) polarity This bit indicates the level on the PSSI_RDY pin when the data are not valid on the parallel interface.
    #[inline(always)]
    pub fn rdypol(&mut self) -> RDYPOL_W<CRrs> {
        RDYPOL_W::new(self, 8)
    }
    ///Bits 10:11 - Extended data mode
    #[inline(always)]
    pub fn edm(&mut self) -> EDM_W<CRrs> {
        EDM_W::new(self, 10)
    }
    ///Bit 14 - PSSI enable The contents of the FIFO are flushed when ENABLE is cleared to 0. Note: When ENABLE=1, the content of PSSI_CR must not be changed, except for the ENABLE bit itself. All configuration bits can change as soon as ENABLE changes from 0 to 1. Note: The DMA controller and all PSSI configuration registers must be programmed correctly before setting the ENABLE bit to 1.
    #[inline(always)]
    pub fn enable(&mut self) -> ENABLE_W<CRrs> {
        ENABLE_W::new(self, 14)
    }
    ///Bits 18:20 - Data enable and ready configuration When the PSSI_RDY function is mapped to the PSSI_DE pin (settings 101 or 111), it is still the RDYPOL bit which determines its polarity. Similarly, when the PSSI_DE function is mapped to the PSSI_RDY pin (settings 110 or 111), it is still the DEPOL bit which determines its polarity.
    #[inline(always)]
    pub fn derdycfg(&mut self) -> DERDYCFG_W<CRrs> {
        DERDYCFG_W::new(self, 18)
    }
    ///Bit 29 - Clock source This bit configures the clock source of the PSSI_PDCK.
    #[inline(always)]
    pub fn cksrc(&mut self) -> CKSRC_W<CRrs> {
        CKSRC_W::new(self, 29)
    }
    ///Bit 30 - DMA enable bit
    #[inline(always)]
    pub fn dmaen(&mut self) -> DMAEN_W<CRrs> {
        DMAEN_W::new(self, 30)
    }
    ///Bit 31 - Data direction selection bit
    #[inline(always)]
    pub fn outen(&mut self) -> OUTEN_W<CRrs> {
        OUTEN_W::new(self, 31)
    }
}
/**PSSI control register

You can [`read`](crate::Reg::read) this register and get [`cr::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
pub struct CRrs;
impl crate::RegisterSpec for CRrs {
    type Ux = u32;
}
///`read()` method returns [`cr::R`](R) reader structure
impl crate::Readable for CRrs {}
///`write(|w| ..)` method takes [`cr::W`](W) writer structure
impl crate::Writable for CRrs {
    type Safety = crate::Unsafe;
}
///`reset()` method sets CR to value 0x4000_0000
impl crate::Resettable for CRrs {
    const RESET_VALUE: u32 = 0x4000_0000;
}