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
#[doc = "Register `MOSTAT` reader"]
pub type R = crate::R<MostatSpec>;
#[doc = "Receive Pending\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rxpnd {
    #[doc = "0: No CAN message has been received."]
    Value1 = 0,
    #[doc = "1: A CAN message has been received by the message object n, either directly or via gateway copy action."]
    Value2 = 1,
}
impl From<Rxpnd> for bool {
    #[inline(always)]
    fn from(variant: Rxpnd) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RXPND` reader - Receive Pending"]
pub type RxpndR = crate::BitReader<Rxpnd>;
impl RxpndR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxpnd {
        match self.bits {
            false => Rxpnd::Value1,
            true => Rxpnd::Value2,
        }
    }
    #[doc = "No CAN message has been received."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxpnd::Value1
    }
    #[doc = "A CAN message has been received by the message object n, either directly or via gateway copy action."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxpnd::Value2
    }
}
#[doc = "Transmit Pending\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Txpnd {
    #[doc = "0: No CAN message has been transmitted."]
    Value1 = 0,
    #[doc = "1: A CAN message from message object n has been transmitted successfully over the CAN bus."]
    Value2 = 1,
}
impl From<Txpnd> for bool {
    #[inline(always)]
    fn from(variant: Txpnd) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TXPND` reader - Transmit Pending"]
pub type TxpndR = crate::BitReader<Txpnd>;
impl TxpndR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Txpnd {
        match self.bits {
            false => Txpnd::Value1,
            true => Txpnd::Value2,
        }
    }
    #[doc = "No CAN message has been transmitted."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Txpnd::Value1
    }
    #[doc = "A CAN message from message object n has been transmitted successfully over the CAN bus."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Txpnd::Value2
    }
}
#[doc = "Receive Updating\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rxupd {
    #[doc = "0: No receive update ongoing."]
    Value1 = 0,
    #[doc = "1: Message identifier, DLC, and data of the message object are currently updated."]
    Value2 = 1,
}
impl From<Rxupd> for bool {
    #[inline(always)]
    fn from(variant: Rxupd) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RXUPD` reader - Receive Updating"]
pub type RxupdR = crate::BitReader<Rxupd>;
impl RxupdR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxupd {
        match self.bits {
            false => Rxupd::Value1,
            true => Rxupd::Value2,
        }
    }
    #[doc = "No receive update ongoing."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxupd::Value1
    }
    #[doc = "Message identifier, DLC, and data of the message object are currently updated."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxupd::Value2
    }
}
#[doc = "New Data\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Newdat {
    #[doc = "0: No update of the message object n since last flag reset."]
    Value1 = 0,
    #[doc = "1: Message object n has been updated."]
    Value2 = 1,
}
impl From<Newdat> for bool {
    #[inline(always)]
    fn from(variant: Newdat) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `NEWDAT` reader - New Data"]
pub type NewdatR = crate::BitReader<Newdat>;
impl NewdatR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Newdat {
        match self.bits {
            false => Newdat::Value1,
            true => Newdat::Value2,
        }
    }
    #[doc = "No update of the message object n since last flag reset."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Newdat::Value1
    }
    #[doc = "Message object n has been updated."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Newdat::Value2
    }
}
#[doc = "Message Lost\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Msglst {
    #[doc = "0: No CAN message is lost."]
    Value1 = 0,
    #[doc = "1: A CAN message is lost because NEWDAT has become set again when it has already been set."]
    Value2 = 1,
}
impl From<Msglst> for bool {
    #[inline(always)]
    fn from(variant: Msglst) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MSGLST` reader - Message Lost"]
pub type MsglstR = crate::BitReader<Msglst>;
impl MsglstR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Msglst {
        match self.bits {
            false => Msglst::Value1,
            true => Msglst::Value2,
        }
    }
    #[doc = "No CAN message is lost."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Msglst::Value1
    }
    #[doc = "A CAN message is lost because NEWDAT has become set again when it has already been set."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Msglst::Value2
    }
}
#[doc = "Message Valid\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Msgval {
    #[doc = "0: Message object n is not valid."]
    Value1 = 0,
    #[doc = "1: Message object n is valid."]
    Value2 = 1,
}
impl From<Msgval> for bool {
    #[inline(always)]
    fn from(variant: Msgval) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `MSGVAL` reader - Message Valid"]
pub type MsgvalR = crate::BitReader<Msgval>;
impl MsgvalR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Msgval {
        match self.bits {
            false => Msgval::Value1,
            true => Msgval::Value2,
        }
    }
    #[doc = "Message object n is not valid."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Msgval::Value1
    }
    #[doc = "Message object n is valid."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Msgval::Value2
    }
}
#[doc = "Receive/Transmit Selected\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rtsel {
    #[doc = "0: Message object n is not selected for receive or transmit operation."]
    Value1 = 0,
    #[doc = "1: Message object n is selected for receive or transmit operation."]
    Value2 = 1,
}
impl From<Rtsel> for bool {
    #[inline(always)]
    fn from(variant: Rtsel) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RTSEL` reader - Receive/Transmit Selected"]
pub type RtselR = crate::BitReader<Rtsel>;
impl RtselR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rtsel {
        match self.bits {
            false => Rtsel::Value1,
            true => Rtsel::Value2,
        }
    }
    #[doc = "Message object n is not selected for receive or transmit operation."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rtsel::Value1
    }
    #[doc = "Message object n is selected for receive or transmit operation."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rtsel::Value2
    }
}
#[doc = "Receive Enable\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Rxen {
    #[doc = "0: Message object n is not enabled for frame reception."]
    Value1 = 0,
    #[doc = "1: Message object n is enabled for frame reception."]
    Value2 = 1,
}
impl From<Rxen> for bool {
    #[inline(always)]
    fn from(variant: Rxen) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `RXEN` reader - Receive Enable"]
pub type RxenR = crate::BitReader<Rxen>;
impl RxenR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Rxen {
        match self.bits {
            false => Rxen::Value1,
            true => Rxen::Value2,
        }
    }
    #[doc = "Message object n is not enabled for frame reception."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Rxen::Value1
    }
    #[doc = "Message object n is enabled for frame reception."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Rxen::Value2
    }
}
#[doc = "Transmit Request\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Txrq {
    #[doc = "0: No transmission of message object n is requested."]
    Value1 = 0,
    #[doc = "1: Transmission of message object n on the CAN bus is requested."]
    Value2 = 1,
}
impl From<Txrq> for bool {
    #[inline(always)]
    fn from(variant: Txrq) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TXRQ` reader - Transmit Request"]
pub type TxrqR = crate::BitReader<Txrq>;
impl TxrqR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Txrq {
        match self.bits {
            false => Txrq::Value1,
            true => Txrq::Value2,
        }
    }
    #[doc = "No transmission of message object n is requested."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Txrq::Value1
    }
    #[doc = "Transmission of message object n on the CAN bus is requested."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Txrq::Value2
    }
}
#[doc = "Transmit Enable 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Txen0 {
    #[doc = "0: Message object n is not enabled for frame transmission."]
    Value1 = 0,
    #[doc = "1: Message object n is enabled for frame transmission."]
    Value2 = 1,
}
impl From<Txen0> for bool {
    #[inline(always)]
    fn from(variant: Txen0) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TXEN0` reader - Transmit Enable 0"]
pub type Txen0R = crate::BitReader<Txen0>;
impl Txen0R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Txen0 {
        match self.bits {
            false => Txen0::Value1,
            true => Txen0::Value2,
        }
    }
    #[doc = "Message object n is not enabled for frame transmission."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Txen0::Value1
    }
    #[doc = "Message object n is enabled for frame transmission."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Txen0::Value2
    }
}
#[doc = "Transmit Enable 1\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Txen1 {
    #[doc = "0: Message object n is not enabled for frame transmission."]
    Value1 = 0,
    #[doc = "1: Message object n is enabled for frame transmission."]
    Value2 = 1,
}
impl From<Txen1> for bool {
    #[inline(always)]
    fn from(variant: Txen1) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `TXEN1` reader - Transmit Enable 1"]
pub type Txen1R = crate::BitReader<Txen1>;
impl Txen1R {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Txen1 {
        match self.bits {
            false => Txen1::Value1,
            true => Txen1::Value2,
        }
    }
    #[doc = "Message object n is not enabled for frame transmission."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Txen1::Value1
    }
    #[doc = "Message object n is enabled for frame transmission."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Txen1::Value2
    }
}
#[doc = "Message Direction\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum Dir {
    #[doc = "0: Receive Object selected: With TXRQ = 1, a Remote Frame with the identifier of message object n is scheduled for transmission. On reception of a Data Frame with matching identifier, the message is stored in message object n."]
    Value1 = 0,
    #[doc = "1: Transmit Object selected: If TXRQ = 1, message object n is scheduled for transmission of a Data Frame. On reception of a Remote Frame with matching identifier, bit TXRQ is set."]
    Value2 = 1,
}
impl From<Dir> for bool {
    #[inline(always)]
    fn from(variant: Dir) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Field `DIR` reader - Message Direction"]
pub type DirR = crate::BitReader<Dir>;
impl DirR {
    #[doc = "Get enumerated values variant"]
    #[inline(always)]
    pub const fn variant(&self) -> Dir {
        match self.bits {
            false => Dir::Value1,
            true => Dir::Value2,
        }
    }
    #[doc = "Receive Object selected: With TXRQ = 1, a Remote Frame with the identifier of message object n is scheduled for transmission. On reception of a Data Frame with matching identifier, the message is stored in message object n."]
    #[inline(always)]
    pub fn is_value1(&self) -> bool {
        *self == Dir::Value1
    }
    #[doc = "Transmit Object selected: If TXRQ = 1, message object n is scheduled for transmission of a Data Frame. On reception of a Remote Frame with matching identifier, bit TXRQ is set."]
    #[inline(always)]
    pub fn is_value2(&self) -> bool {
        *self == Dir::Value2
    }
}
#[doc = "Field `LIST` reader - List Allocation"]
pub type ListR = crate::FieldReader;
#[doc = "Field `PPREV` reader - Pointer to Previous Message Object"]
pub type PprevR = crate::FieldReader;
#[doc = "Field `PNEXT` reader - Pointer to Next Message Object"]
pub type PnextR = crate::FieldReader;
impl R {
    #[doc = "Bit 0 - Receive Pending"]
    #[inline(always)]
    pub fn rxpnd(&self) -> RxpndR {
        RxpndR::new((self.bits & 1) != 0)
    }
    #[doc = "Bit 1 - Transmit Pending"]
    #[inline(always)]
    pub fn txpnd(&self) -> TxpndR {
        TxpndR::new(((self.bits >> 1) & 1) != 0)
    }
    #[doc = "Bit 2 - Receive Updating"]
    #[inline(always)]
    pub fn rxupd(&self) -> RxupdR {
        RxupdR::new(((self.bits >> 2) & 1) != 0)
    }
    #[doc = "Bit 3 - New Data"]
    #[inline(always)]
    pub fn newdat(&self) -> NewdatR {
        NewdatR::new(((self.bits >> 3) & 1) != 0)
    }
    #[doc = "Bit 4 - Message Lost"]
    #[inline(always)]
    pub fn msglst(&self) -> MsglstR {
        MsglstR::new(((self.bits >> 4) & 1) != 0)
    }
    #[doc = "Bit 5 - Message Valid"]
    #[inline(always)]
    pub fn msgval(&self) -> MsgvalR {
        MsgvalR::new(((self.bits >> 5) & 1) != 0)
    }
    #[doc = "Bit 6 - Receive/Transmit Selected"]
    #[inline(always)]
    pub fn rtsel(&self) -> RtselR {
        RtselR::new(((self.bits >> 6) & 1) != 0)
    }
    #[doc = "Bit 7 - Receive Enable"]
    #[inline(always)]
    pub fn rxen(&self) -> RxenR {
        RxenR::new(((self.bits >> 7) & 1) != 0)
    }
    #[doc = "Bit 8 - Transmit Request"]
    #[inline(always)]
    pub fn txrq(&self) -> TxrqR {
        TxrqR::new(((self.bits >> 8) & 1) != 0)
    }
    #[doc = "Bit 9 - Transmit Enable 0"]
    #[inline(always)]
    pub fn txen0(&self) -> Txen0R {
        Txen0R::new(((self.bits >> 9) & 1) != 0)
    }
    #[doc = "Bit 10 - Transmit Enable 1"]
    #[inline(always)]
    pub fn txen1(&self) -> Txen1R {
        Txen1R::new(((self.bits >> 10) & 1) != 0)
    }
    #[doc = "Bit 11 - Message Direction"]
    #[inline(always)]
    pub fn dir(&self) -> DirR {
        DirR::new(((self.bits >> 11) & 1) != 0)
    }
    #[doc = "Bits 12:15 - List Allocation"]
    #[inline(always)]
    pub fn list(&self) -> ListR {
        ListR::new(((self.bits >> 12) & 0x0f) as u8)
    }
    #[doc = "Bits 16:23 - Pointer to Previous Message Object"]
    #[inline(always)]
    pub fn pprev(&self) -> PprevR {
        PprevR::new(((self.bits >> 16) & 0xff) as u8)
    }
    #[doc = "Bits 24:31 - Pointer to Next Message Object"]
    #[inline(always)]
    pub fn pnext(&self) -> PnextR {
        PnextR::new(((self.bits >> 24) & 0xff) as u8)
    }
}
#[doc = "Message Object Status Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`mostat::R`](R).  See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct MostatSpec;
impl crate::RegisterSpec for MostatSpec {
    type Ux = u32;
}
#[doc = "`read()` method returns [`mostat::R`](R) reader structure"]
impl crate::Readable for MostatSpec {}
#[doc = "`reset()` method sets MOSTAT to value 0"]
impl crate::Resettable for MostatSpec {
    const RESET_VALUE: u32 = 0;
}