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
///Register `ISR` reader
pub type R = crate::R<ISRrs>;
/**End of injected conversion flag

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JEOCF {
    ///0: No injected conversion has completed
    Clear = 0,
    ///1: An injected conversion has completed and its data may be read
    Set = 1,
}
impl From<JEOCF> for bool {
    #[inline(always)]
    fn from(variant: JEOCF) -> Self {
        variant as u8 != 0
    }
}
///Field `JEOCF` reader - End of injected conversion flag
pub type JEOCF_R = crate::BitReader<JEOCF>;
impl JEOCF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> JEOCF {
        match self.bits {
            false => JEOCF::Clear,
            true => JEOCF::Set,
        }
    }
    ///No injected conversion has completed
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == JEOCF::Clear
    }
    ///An injected conversion has completed and its data may be read
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == JEOCF::Set
    }
}
/**End of regular conversion flag

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum REOCF {
    ///0: No regular conversion has completed
    Clear = 0,
    ///1: A regular conversion has completed and its data may be read
    Set = 1,
}
impl From<REOCF> for bool {
    #[inline(always)]
    fn from(variant: REOCF) -> Self {
        variant as u8 != 0
    }
}
///Field `REOCF` reader - End of regular conversion flag
pub type REOCF_R = crate::BitReader<REOCF>;
impl REOCF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> REOCF {
        match self.bits {
            false => REOCF::Clear,
            true => REOCF::Set,
        }
    }
    ///No regular conversion has completed
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == REOCF::Clear
    }
    ///A regular conversion has completed and its data may be read
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == REOCF::Set
    }
}
/**Injected conversion overrun flag

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JOVRF {
    ///0: No injected conversion overrun has occurred
    Clear = 0,
    ///1: An injected conversion overrun has occurred, which means that an injected conversion finished while JEOCF was already ‘1’. JDATAR is not affected by overruns
    Set = 1,
}
impl From<JOVRF> for bool {
    #[inline(always)]
    fn from(variant: JOVRF) -> Self {
        variant as u8 != 0
    }
}
///Field `JOVRF` reader - Injected conversion overrun flag
pub type JOVRF_R = crate::BitReader<JOVRF>;
impl JOVRF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> JOVRF {
        match self.bits {
            false => JOVRF::Clear,
            true => JOVRF::Set,
        }
    }
    ///No injected conversion overrun has occurred
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == JOVRF::Clear
    }
    ///An injected conversion overrun has occurred, which means that an injected conversion finished while JEOCF was already ‘1’. JDATAR is not affected by overruns
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == JOVRF::Set
    }
}
/**Regular conversion overrun flag

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum ROVRF {
    ///0: No regular conversion overrun has occurred
    Clear = 0,
    ///1: A regular conversion overrun has occurred, which means that a regular conversion finished while REOCF was already ‘1’. RDATAR is not affected by overruns
    Set = 1,
}
impl From<ROVRF> for bool {
    #[inline(always)]
    fn from(variant: ROVRF) -> Self {
        variant as u8 != 0
    }
}
///Field `ROVRF` reader - Regular conversion overrun flag
pub type ROVRF_R = crate::BitReader<ROVRF>;
impl ROVRF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> ROVRF {
        match self.bits {
            false => ROVRF::Clear,
            true => ROVRF::Set,
        }
    }
    ///No regular conversion overrun has occurred
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == ROVRF::Clear
    }
    ///A regular conversion overrun has occurred, which means that a regular conversion finished while REOCF was already ‘1’. RDATAR is not affected by overruns
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == ROVRF::Set
    }
}
/**Analog watchdog

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum AWDF {
    ///0: No Analog watchdog event occurred
    Clear = 0,
    ///1: The analog watchdog block detected voltage which crosses the value programmed in the DFSDM_FLTxAWLTR or DFSDM_FLTxAWHTR registers
    Set = 1,
}
impl From<AWDF> for bool {
    #[inline(always)]
    fn from(variant: AWDF) -> Self {
        variant as u8 != 0
    }
}
///Field `AWDF` reader - Analog watchdog
pub type AWDF_R = crate::BitReader<AWDF>;
impl AWDF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> AWDF {
        match self.bits {
            false => AWDF::Clear,
            true => AWDF::Set,
        }
    }
    ///No Analog watchdog event occurred
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == AWDF::Clear
    }
    ///The analog watchdog block detected voltage which crosses the value programmed in the DFSDM_FLTxAWLTR or DFSDM_FLTxAWHTR registers
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == AWDF::Set
    }
}
/**Injected conversion in progress status

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum JCIP {
    ///0: No request to convert the injected channel group (neither by software nor by trigger) has been issued
    NotInProgress = 0,
    ///1: The conversion of the injected channel group is in progress or a request for a injected conversion is pending, due either to ‘1’ being written to JSWSTART or to a trigger detection
    InProgress = 1,
}
impl From<JCIP> for bool {
    #[inline(always)]
    fn from(variant: JCIP) -> Self {
        variant as u8 != 0
    }
}
///Field `JCIP` reader - Injected conversion in progress status
pub type JCIP_R = crate::BitReader<JCIP>;
impl JCIP_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> JCIP {
        match self.bits {
            false => JCIP::NotInProgress,
            true => JCIP::InProgress,
        }
    }
    ///No request to convert the injected channel group (neither by software nor by trigger) has been issued
    #[inline(always)]
    pub fn is_not_in_progress(&self) -> bool {
        *self == JCIP::NotInProgress
    }
    ///The conversion of the injected channel group is in progress or a request for a injected conversion is pending, due either to ‘1’ being written to JSWSTART or to a trigger detection
    #[inline(always)]
    pub fn is_in_progress(&self) -> bool {
        *self == JCIP::InProgress
    }
}
/**Regular conversion in progress status

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum RCIP {
    ///0: No request to convert the regular channel has been issued
    NotInProgress = 0,
    ///1: The conversion of the regular channel is in progress or a request for a regular conversion is pending
    InProgress = 1,
}
impl From<RCIP> for bool {
    #[inline(always)]
    fn from(variant: RCIP) -> Self {
        variant as u8 != 0
    }
}
///Field `RCIP` reader - Regular conversion in progress status
pub type RCIP_R = crate::BitReader<RCIP>;
impl RCIP_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> RCIP {
        match self.bits {
            false => RCIP::NotInProgress,
            true => RCIP::InProgress,
        }
    }
    ///No request to convert the regular channel has been issued
    #[inline(always)]
    pub fn is_not_in_progress(&self) -> bool {
        *self == RCIP::NotInProgress
    }
    ///The conversion of the regular channel is in progress or a request for a regular conversion is pending
    #[inline(always)]
    pub fn is_in_progress(&self) -> bool {
        *self == RCIP::InProgress
    }
}
/**Clock absence flag

Value on reset: 255*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum CKABF {
    ///0: Clock signal on channel y is present.
    Clear = 0,
    ///1: Clock signal on channel y is not present
    Set = 1,
}
impl From<CKABF> for u8 {
    #[inline(always)]
    fn from(variant: CKABF) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for CKABF {
    type Ux = u8;
}
impl crate::IsEnum for CKABF {}
///Field `CKABF` reader - Clock absence flag
pub type CKABF_R = crate::FieldReader<CKABF>;
impl CKABF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> Option<CKABF> {
        match self.bits {
            0 => Some(CKABF::Clear),
            1 => Some(CKABF::Set),
            _ => None,
        }
    }
    ///Clock signal on channel y is present.
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == CKABF::Clear
    }
    ///Clock signal on channel y is not present
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == CKABF::Set
    }
}
/**short-circuit detector flag

Value on reset: 0*/
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[repr(u8)]
pub enum SCDF {
    ///0: No short-circuit detector event occurred on channel y
    Clear = 0,
    ///1: The short-circuit detector counter reaches, on channel y, the value programmed in the DFSDM_CHyAWSCDR registers
    Set = 1,
}
impl From<SCDF> for u8 {
    #[inline(always)]
    fn from(variant: SCDF) -> Self {
        variant as _
    }
}
impl crate::FieldSpec for SCDF {
    type Ux = u8;
}
impl crate::IsEnum for SCDF {}
///Field `SCDF` reader - short-circuit detector flag
pub type SCDF_R = crate::FieldReader<SCDF>;
impl SCDF_R {
    ///Get enumerated values variant
    #[inline(always)]
    pub const fn variant(&self) -> Option<SCDF> {
        match self.bits {
            0 => Some(SCDF::Clear),
            1 => Some(SCDF::Set),
            _ => None,
        }
    }
    ///No short-circuit detector event occurred on channel y
    #[inline(always)]
    pub fn is_clear(&self) -> bool {
        *self == SCDF::Clear
    }
    ///The short-circuit detector counter reaches, on channel y, the value programmed in the DFSDM_CHyAWSCDR registers
    #[inline(always)]
    pub fn is_set(&self) -> bool {
        *self == SCDF::Set
    }
}
impl R {
    ///Bit 0 - End of injected conversion flag
    #[inline(always)]
    pub fn jeocf(&self) -> JEOCF_R {
        JEOCF_R::new((self.bits & 1) != 0)
    }
    ///Bit 1 - End of regular conversion flag
    #[inline(always)]
    pub fn reocf(&self) -> REOCF_R {
        REOCF_R::new(((self.bits >> 1) & 1) != 0)
    }
    ///Bit 2 - Injected conversion overrun flag
    #[inline(always)]
    pub fn jovrf(&self) -> JOVRF_R {
        JOVRF_R::new(((self.bits >> 2) & 1) != 0)
    }
    ///Bit 3 - Regular conversion overrun flag
    #[inline(always)]
    pub fn rovrf(&self) -> ROVRF_R {
        ROVRF_R::new(((self.bits >> 3) & 1) != 0)
    }
    ///Bit 4 - Analog watchdog
    #[inline(always)]
    pub fn awdf(&self) -> AWDF_R {
        AWDF_R::new(((self.bits >> 4) & 1) != 0)
    }
    ///Bit 13 - Injected conversion in progress status
    #[inline(always)]
    pub fn jcip(&self) -> JCIP_R {
        JCIP_R::new(((self.bits >> 13) & 1) != 0)
    }
    ///Bit 14 - Regular conversion in progress status
    #[inline(always)]
    pub fn rcip(&self) -> RCIP_R {
        RCIP_R::new(((self.bits >> 14) & 1) != 0)
    }
    ///Bits 16:23 - Clock absence flag
    #[inline(always)]
    pub fn ckabf(&self) -> CKABF_R {
        CKABF_R::new(((self.bits >> 16) & 0xff) as u8)
    }
    ///Bits 24:31 - short-circuit detector flag
    #[inline(always)]
    pub fn scdf(&self) -> SCDF_R {
        SCDF_R::new(((self.bits >> 24) & 0xff) as u8)
    }
}
impl core::fmt::Debug for R {
    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
        f.debug_struct("ISR")
            .field("scdf", &self.scdf())
            .field("ckabf", &self.ckabf())
            .field("rcip", &self.rcip())
            .field("jcip", &self.jcip())
            .field("awdf", &self.awdf())
            .field("rovrf", &self.rovrf())
            .field("jovrf", &self.jovrf())
            .field("reocf", &self.reocf())
            .field("jeocf", &self.jeocf())
            .finish()
    }
}
/**interrupt and status register

You can [`read`](crate::Reg::read) this register and get [`isr::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
pub struct ISRrs;
impl crate::RegisterSpec for ISRrs {
    type Ux = u32;
}
///`read()` method returns [`isr::R`](R) reader structure
impl crate::Readable for ISRrs {}
///`reset()` method sets ISR to value 0x00ff_0000
impl crate::Resettable for ISRrs {
    const RESET_VALUE: u32 = 0x00ff_0000;
}