at32f4xx_pac/at32f413/can1/
tsts.rs

1#[doc = "Register `TSTS` reader"]
2pub type R = crate::R<TSTS_SPEC>;
3#[doc = "Register `TSTS` writer"]
4pub type W = crate::W<TSTS_SPEC>;
5#[doc = "Transmit mailbox %s transmission complete flag\n\nValue on reset: 0"]
6#[derive(Clone, Copy, Debug, PartialEq, Eq)]
7pub enum Tm0tcfr {
8    #[doc = "0: Transmission in progress"]
9    InProgress = 0,
10    #[doc = "1: Transmission completed"]
11    Completed = 1,
12}
13impl From<Tm0tcfr> for bool {
14    #[inline(always)]
15    fn from(variant: Tm0tcfr) -> Self {
16        variant as u8 != 0
17    }
18}
19#[doc = "Field `TMTCF(0-2)` reader - Transmit mailbox %s transmission complete flag"]
20pub type TMTCF_R = crate::BitReader<Tm0tcfr>;
21impl TMTCF_R {
22    #[doc = "Get enumerated values variant"]
23    #[inline(always)]
24    pub const fn variant(&self) -> Tm0tcfr {
25        match self.bits {
26            false => Tm0tcfr::InProgress,
27            true => Tm0tcfr::Completed,
28        }
29    }
30    #[doc = "Transmission in progress"]
31    #[inline(always)]
32    pub fn is_in_progress(&self) -> bool {
33        *self == Tm0tcfr::InProgress
34    }
35    #[doc = "Transmission completed"]
36    #[inline(always)]
37    pub fn is_completed(&self) -> bool {
38        *self == Tm0tcfr::Completed
39    }
40}
41#[doc = "Transmit mailbox %s transmission complete flag\n\nValue on reset: 0"]
42#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum Tm0tcfwWO {
44    #[doc = "1: Clear transmission completed flag"]
45    Clear = 1,
46}
47impl From<Tm0tcfwWO> for bool {
48    #[inline(always)]
49    fn from(variant: Tm0tcfwWO) -> Self {
50        variant as u8 != 0
51    }
52}
53#[doc = "Field `TMTCF(0-2)` writer - Transmit mailbox %s transmission complete flag"]
54pub type TMTCF_W<'a, REG> = crate::BitWriter1C<'a, REG, Tm0tcfwWO>;
55impl<'a, REG> TMTCF_W<'a, REG>
56where
57    REG: crate::Writable + crate::RegisterSpec,
58{
59    #[doc = "Clear transmission completed flag"]
60    #[inline(always)]
61    pub fn clear(self) -> &'a mut crate::W<REG> {
62        self.variant(Tm0tcfwWO::Clear)
63    }
64}
65#[doc = "Transmit mailbox %s transmission success flag\n\nValue on reset: 0"]
66#[derive(Clone, Copy, Debug, PartialEq, Eq)]
67pub enum Tm0tsfr {
68    #[doc = "0: Transmission in progress"]
69    Failed = 0,
70    #[doc = "1: Transmission was successful"]
71    Successful = 1,
72}
73impl From<Tm0tsfr> for bool {
74    #[inline(always)]
75    fn from(variant: Tm0tsfr) -> Self {
76        variant as u8 != 0
77    }
78}
79#[doc = "Field `TMTSF(0-2)` reader - Transmit mailbox %s transmission success flag"]
80pub type TMTSF_R = crate::BitReader<Tm0tsfr>;
81impl TMTSF_R {
82    #[doc = "Get enumerated values variant"]
83    #[inline(always)]
84    pub const fn variant(&self) -> Tm0tsfr {
85        match self.bits {
86            false => Tm0tsfr::Failed,
87            true => Tm0tsfr::Successful,
88        }
89    }
90    #[doc = "Transmission in progress"]
91    #[inline(always)]
92    pub fn is_failed(&self) -> bool {
93        *self == Tm0tsfr::Failed
94    }
95    #[doc = "Transmission was successful"]
96    #[inline(always)]
97    pub fn is_successful(&self) -> bool {
98        *self == Tm0tsfr::Successful
99    }
100}
101#[doc = "Transmit mailbox %s transmission success flag\n\nValue on reset: 0"]
102#[derive(Clone, Copy, Debug, PartialEq, Eq)]
103pub enum Tm0tsfwWO {
104    #[doc = "1: Clear transmission success flag"]
105    Clear = 1,
106}
107impl From<Tm0tsfwWO> for bool {
108    #[inline(always)]
109    fn from(variant: Tm0tsfwWO) -> Self {
110        variant as u8 != 0
111    }
112}
113#[doc = "Field `TMTSF(0-2)` writer - Transmit mailbox %s transmission success flag"]
114pub type TMTSF_W<'a, REG> = crate::BitWriter1C<'a, REG, Tm0tsfwWO>;
115impl<'a, REG> TMTSF_W<'a, REG>
116where
117    REG: crate::Writable + crate::RegisterSpec,
118{
119    #[doc = "Clear transmission success flag"]
120    #[inline(always)]
121    pub fn clear(self) -> &'a mut crate::W<REG> {
122        self.variant(Tm0tsfwWO::Clear)
123    }
124}
125#[doc = "Transmit mailbox %s arbitration lost flag\n\nValue on reset: 0"]
126#[derive(Clone, Copy, Debug, PartialEq, Eq)]
127pub enum Tm0alfr {
128    #[doc = "0: No arbitration lost"]
129    NoLost = 0,
130    #[doc = "1: Transmit mailbox arbitration lost"]
131    Lost = 1,
132}
133impl From<Tm0alfr> for bool {
134    #[inline(always)]
135    fn from(variant: Tm0alfr) -> Self {
136        variant as u8 != 0
137    }
138}
139#[doc = "Field `TMALF(0-2)` reader - Transmit mailbox %s arbitration lost flag"]
140pub type TMALF_R = crate::BitReader<Tm0alfr>;
141impl TMALF_R {
142    #[doc = "Get enumerated values variant"]
143    #[inline(always)]
144    pub const fn variant(&self) -> Tm0alfr {
145        match self.bits {
146            false => Tm0alfr::NoLost,
147            true => Tm0alfr::Lost,
148        }
149    }
150    #[doc = "No arbitration lost"]
151    #[inline(always)]
152    pub fn is_no_lost(&self) -> bool {
153        *self == Tm0alfr::NoLost
154    }
155    #[doc = "Transmit mailbox arbitration lost"]
156    #[inline(always)]
157    pub fn is_lost(&self) -> bool {
158        *self == Tm0alfr::Lost
159    }
160}
161#[doc = "Transmit mailbox %s arbitration lost flag\n\nValue on reset: 0"]
162#[derive(Clone, Copy, Debug, PartialEq, Eq)]
163pub enum Tm0alfwWO {
164    #[doc = "1: Clear arbitration lost flag"]
165    Clear = 1,
166}
167impl From<Tm0alfwWO> for bool {
168    #[inline(always)]
169    fn from(variant: Tm0alfwWO) -> Self {
170        variant as u8 != 0
171    }
172}
173#[doc = "Field `TMALF(0-2)` writer - Transmit mailbox %s arbitration lost flag"]
174pub type TMALF_W<'a, REG> = crate::BitWriter1C<'a, REG, Tm0alfwWO>;
175impl<'a, REG> TMALF_W<'a, REG>
176where
177    REG: crate::Writable + crate::RegisterSpec,
178{
179    #[doc = "Clear arbitration lost flag"]
180    #[inline(always)]
181    pub fn clear(self) -> &'a mut crate::W<REG> {
182        self.variant(Tm0alfwWO::Clear)
183    }
184}
185#[doc = "Transmit mailbox %s transmission error flag\n\nValue on reset: 0"]
186#[derive(Clone, Copy, Debug, PartialEq, Eq)]
187pub enum Tm0tefr {
188    #[doc = "0: No error"]
189    NoError = 0,
190    #[doc = "1: Mailbox transmission error"]
191    Error = 1,
192}
193impl From<Tm0tefr> for bool {
194    #[inline(always)]
195    fn from(variant: Tm0tefr) -> Self {
196        variant as u8 != 0
197    }
198}
199#[doc = "Field `TMTEF(0-2)` reader - Transmit mailbox %s transmission error flag"]
200pub type TMTEF_R = crate::BitReader<Tm0tefr>;
201impl TMTEF_R {
202    #[doc = "Get enumerated values variant"]
203    #[inline(always)]
204    pub const fn variant(&self) -> Tm0tefr {
205        match self.bits {
206            false => Tm0tefr::NoError,
207            true => Tm0tefr::Error,
208        }
209    }
210    #[doc = "No error"]
211    #[inline(always)]
212    pub fn is_no_error(&self) -> bool {
213        *self == Tm0tefr::NoError
214    }
215    #[doc = "Mailbox transmission error"]
216    #[inline(always)]
217    pub fn is_error(&self) -> bool {
218        *self == Tm0tefr::Error
219    }
220}
221#[doc = "Transmit mailbox %s transmission error flag\n\nValue on reset: 0"]
222#[derive(Clone, Copy, Debug, PartialEq, Eq)]
223pub enum Tm0tefwWO {
224    #[doc = "1: Clear transmission error flag"]
225    Clear = 1,
226}
227impl From<Tm0tefwWO> for bool {
228    #[inline(always)]
229    fn from(variant: Tm0tefwWO) -> Self {
230        variant as u8 != 0
231    }
232}
233#[doc = "Field `TMTEF(0-2)` writer - Transmit mailbox %s transmission error flag"]
234pub type TMTEF_W<'a, REG> = crate::BitWriter1C<'a, REG, Tm0tefwWO>;
235impl<'a, REG> TMTEF_W<'a, REG>
236where
237    REG: crate::Writable + crate::RegisterSpec,
238{
239    #[doc = "Clear transmission error flag"]
240    #[inline(always)]
241    pub fn clear(self) -> &'a mut crate::W<REG> {
242        self.variant(Tm0tefwWO::Clear)
243    }
244}
245#[doc = "Transmit mailbox %s cancel transmission\n\nValue on reset: 0"]
246#[derive(Clone, Copy, Debug, PartialEq, Eq)]
247pub enum Tm0ctr {
248    #[doc = "0: No effect"]
249    NoCancelling = 0,
250    #[doc = "1: Mailbox cancel transmit"]
251    Cancelling = 1,
252}
253impl From<Tm0ctr> for bool {
254    #[inline(always)]
255    fn from(variant: Tm0ctr) -> Self {
256        variant as u8 != 0
257    }
258}
259#[doc = "Field `TMCT(0-2)` reader - Transmit mailbox %s cancel transmission"]
260pub type TMCT_R = crate::BitReader<Tm0ctr>;
261impl TMCT_R {
262    #[doc = "Get enumerated values variant"]
263    #[inline(always)]
264    pub const fn variant(&self) -> Tm0ctr {
265        match self.bits {
266            false => Tm0ctr::NoCancelling,
267            true => Tm0ctr::Cancelling,
268        }
269    }
270    #[doc = "No effect"]
271    #[inline(always)]
272    pub fn is_no_cancelling(&self) -> bool {
273        *self == Tm0ctr::NoCancelling
274    }
275    #[doc = "Mailbox cancel transmit"]
276    #[inline(always)]
277    pub fn is_cancelling(&self) -> bool {
278        *self == Tm0ctr::Cancelling
279    }
280}
281#[doc = "Transmit mailbox %s cancel transmission\n\nValue on reset: 0"]
282#[derive(Clone, Copy, Debug, PartialEq, Eq)]
283pub enum Tm0ctwWO {
284    #[doc = "1: Mailbox cancel transmit"]
285    Abort = 1,
286}
287impl From<Tm0ctwWO> for bool {
288    #[inline(always)]
289    fn from(variant: Tm0ctwWO) -> Self {
290        variant as u8 != 0
291    }
292}
293#[doc = "Field `TMCT(0-2)` writer - Transmit mailbox %s cancel transmission"]
294pub type TMCT_W<'a, REG> = crate::BitWriter1S<'a, REG, Tm0ctwWO>;
295impl<'a, REG> TMCT_W<'a, REG>
296where
297    REG: crate::Writable + crate::RegisterSpec,
298{
299    #[doc = "Mailbox cancel transmit"]
300    #[inline(always)]
301    pub fn abort(self) -> &'a mut crate::W<REG> {
302        self.variant(Tm0ctwWO::Abort)
303    }
304}
305#[doc = "Field `TMNR` reader - Transmit Mailbox number record"]
306pub type TMNR_R = crate::FieldReader;
307#[doc = "Transmit mailbox %s empty flag\n\nValue on reset: 1"]
308#[derive(Clone, Copy, Debug, PartialEq, Eq)]
309pub enum TM0EF_A {
310    #[doc = "0: Transmission is pending in the mailbox"]
311    NotEmpty = 0,
312    #[doc = "1: No transmission is pending in the mailbox"]
313    Empty = 1,
314}
315impl From<TM0EF_A> for bool {
316    #[inline(always)]
317    fn from(variant: TM0EF_A) -> Self {
318        variant as u8 != 0
319    }
320}
321#[doc = "Field `TMEF(0-2)` reader - Transmit mailbox %s empty flag"]
322pub type TMEF_R = crate::BitReader<TM0EF_A>;
323impl TMEF_R {
324    #[doc = "Get enumerated values variant"]
325    #[inline(always)]
326    pub const fn variant(&self) -> TM0EF_A {
327        match self.bits {
328            false => TM0EF_A::NotEmpty,
329            true => TM0EF_A::Empty,
330        }
331    }
332    #[doc = "Transmission is pending in the mailbox"]
333    #[inline(always)]
334    pub fn is_not_empty(&self) -> bool {
335        *self == TM0EF_A::NotEmpty
336    }
337    #[doc = "No transmission is pending in the mailbox"]
338    #[inline(always)]
339    pub fn is_empty(&self) -> bool {
340        *self == TM0EF_A::Empty
341    }
342}
343#[doc = "Transmit mailbox %s lowest priority flag\n\nValue on reset: 0"]
344#[derive(Clone, Copy, Debug, PartialEq, Eq)]
345pub enum TM0LPF_A {
346    #[doc = "0: Mailbox is not given the lowest priority"]
347    NotLowest = 0,
348    #[doc = "1: Mailbox is given the lowest priority"]
349    Lowest = 1,
350}
351impl From<TM0LPF_A> for bool {
352    #[inline(always)]
353    fn from(variant: TM0LPF_A) -> Self {
354        variant as u8 != 0
355    }
356}
357#[doc = "Field `TMLPF(0-2)` reader - Transmit mailbox %s lowest priority flag"]
358pub type TMLPF_R = crate::BitReader<TM0LPF_A>;
359impl TMLPF_R {
360    #[doc = "Get enumerated values variant"]
361    #[inline(always)]
362    pub const fn variant(&self) -> TM0LPF_A {
363        match self.bits {
364            false => TM0LPF_A::NotLowest,
365            true => TM0LPF_A::Lowest,
366        }
367    }
368    #[doc = "Mailbox is not given the lowest priority"]
369    #[inline(always)]
370    pub fn is_not_lowest(&self) -> bool {
371        *self == TM0LPF_A::NotLowest
372    }
373    #[doc = "Mailbox is given the lowest priority"]
374    #[inline(always)]
375    pub fn is_lowest(&self) -> bool {
376        *self == TM0LPF_A::Lowest
377    }
378}
379impl R {
380    #[doc = "Transmit mailbox (0-2) transmission complete flag"]
381    #[doc = ""]
382    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0TCF` field.</div>"]
383    #[inline(always)]
384    pub fn tmtcf(&self, n: u8) -> TMTCF_R {
385        #[allow(clippy::no_effect)]
386        [(); 3][n as usize];
387        TMTCF_R::new(((self.bits >> (n * 8)) & 1) != 0)
388    }
389    #[doc = "Iterator for array of:"]
390    #[doc = "Transmit mailbox (0-2) transmission complete flag"]
391    #[inline(always)]
392    pub fn tmtcf_iter(&self) -> impl Iterator<Item = TMTCF_R> + '_ {
393        (0..3).map(move |n| TMTCF_R::new(((self.bits >> (n * 8)) & 1) != 0))
394    }
395    #[doc = "Bit 0 - Transmit mailbox 0 transmission complete flag"]
396    #[inline(always)]
397    pub fn tm0tcf(&self) -> TMTCF_R {
398        TMTCF_R::new((self.bits & 1) != 0)
399    }
400    #[doc = "Bit 8 - Transmit mailbox 1 transmission complete flag"]
401    #[inline(always)]
402    pub fn tm1tcf(&self) -> TMTCF_R {
403        TMTCF_R::new(((self.bits >> 8) & 1) != 0)
404    }
405    #[doc = "Bit 16 - Transmit mailbox 2 transmission complete flag"]
406    #[inline(always)]
407    pub fn tm2tcf(&self) -> TMTCF_R {
408        TMTCF_R::new(((self.bits >> 16) & 1) != 0)
409    }
410    #[doc = "Transmit mailbox (0-2) transmission success flag"]
411    #[doc = ""]
412    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0TSF` field.</div>"]
413    #[inline(always)]
414    pub fn tmtsf(&self, n: u8) -> TMTSF_R {
415        #[allow(clippy::no_effect)]
416        [(); 3][n as usize];
417        TMTSF_R::new(((self.bits >> (n * 8 + 1)) & 1) != 0)
418    }
419    #[doc = "Iterator for array of:"]
420    #[doc = "Transmit mailbox (0-2) transmission success flag"]
421    #[inline(always)]
422    pub fn tmtsf_iter(&self) -> impl Iterator<Item = TMTSF_R> + '_ {
423        (0..3).map(move |n| TMTSF_R::new(((self.bits >> (n * 8 + 1)) & 1) != 0))
424    }
425    #[doc = "Bit 1 - Transmit mailbox 0 transmission success flag"]
426    #[inline(always)]
427    pub fn tm0tsf(&self) -> TMTSF_R {
428        TMTSF_R::new(((self.bits >> 1) & 1) != 0)
429    }
430    #[doc = "Bit 9 - Transmit mailbox 1 transmission success flag"]
431    #[inline(always)]
432    pub fn tm1tsf(&self) -> TMTSF_R {
433        TMTSF_R::new(((self.bits >> 9) & 1) != 0)
434    }
435    #[doc = "Bit 17 - Transmit mailbox 2 transmission success flag"]
436    #[inline(always)]
437    pub fn tm2tsf(&self) -> TMTSF_R {
438        TMTSF_R::new(((self.bits >> 17) & 1) != 0)
439    }
440    #[doc = "Transmit mailbox (0-2) arbitration lost flag"]
441    #[doc = ""]
442    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0ALF` field.</div>"]
443    #[inline(always)]
444    pub fn tmalf(&self, n: u8) -> TMALF_R {
445        #[allow(clippy::no_effect)]
446        [(); 3][n as usize];
447        TMALF_R::new(((self.bits >> (n * 8 + 2)) & 1) != 0)
448    }
449    #[doc = "Iterator for array of:"]
450    #[doc = "Transmit mailbox (0-2) arbitration lost flag"]
451    #[inline(always)]
452    pub fn tmalf_iter(&self) -> impl Iterator<Item = TMALF_R> + '_ {
453        (0..3).map(move |n| TMALF_R::new(((self.bits >> (n * 8 + 2)) & 1) != 0))
454    }
455    #[doc = "Bit 2 - Transmit mailbox 0 arbitration lost flag"]
456    #[inline(always)]
457    pub fn tm0alf(&self) -> TMALF_R {
458        TMALF_R::new(((self.bits >> 2) & 1) != 0)
459    }
460    #[doc = "Bit 10 - Transmit mailbox 1 arbitration lost flag"]
461    #[inline(always)]
462    pub fn tm1alf(&self) -> TMALF_R {
463        TMALF_R::new(((self.bits >> 10) & 1) != 0)
464    }
465    #[doc = "Bit 18 - Transmit mailbox 2 arbitration lost flag"]
466    #[inline(always)]
467    pub fn tm2alf(&self) -> TMALF_R {
468        TMALF_R::new(((self.bits >> 18) & 1) != 0)
469    }
470    #[doc = "Transmit mailbox (0-2) transmission error flag"]
471    #[doc = ""]
472    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0TEF` field.</div>"]
473    #[inline(always)]
474    pub fn tmtef(&self, n: u8) -> TMTEF_R {
475        #[allow(clippy::no_effect)]
476        [(); 3][n as usize];
477        TMTEF_R::new(((self.bits >> (n * 8 + 3)) & 1) != 0)
478    }
479    #[doc = "Iterator for array of:"]
480    #[doc = "Transmit mailbox (0-2) transmission error flag"]
481    #[inline(always)]
482    pub fn tmtef_iter(&self) -> impl Iterator<Item = TMTEF_R> + '_ {
483        (0..3).map(move |n| TMTEF_R::new(((self.bits >> (n * 8 + 3)) & 1) != 0))
484    }
485    #[doc = "Bit 3 - Transmit mailbox 0 transmission error flag"]
486    #[inline(always)]
487    pub fn tm0tef(&self) -> TMTEF_R {
488        TMTEF_R::new(((self.bits >> 3) & 1) != 0)
489    }
490    #[doc = "Bit 11 - Transmit mailbox 1 transmission error flag"]
491    #[inline(always)]
492    pub fn tm1tef(&self) -> TMTEF_R {
493        TMTEF_R::new(((self.bits >> 11) & 1) != 0)
494    }
495    #[doc = "Bit 19 - Transmit mailbox 2 transmission error flag"]
496    #[inline(always)]
497    pub fn tm2tef(&self) -> TMTEF_R {
498        TMTEF_R::new(((self.bits >> 19) & 1) != 0)
499    }
500    #[doc = "Transmit mailbox (0-2) cancel transmission"]
501    #[doc = ""]
502    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0CT` field.</div>"]
503    #[inline(always)]
504    pub fn tmct(&self, n: u8) -> TMCT_R {
505        #[allow(clippy::no_effect)]
506        [(); 3][n as usize];
507        TMCT_R::new(((self.bits >> (n * 8 + 7)) & 1) != 0)
508    }
509    #[doc = "Iterator for array of:"]
510    #[doc = "Transmit mailbox (0-2) cancel transmission"]
511    #[inline(always)]
512    pub fn tmct_iter(&self) -> impl Iterator<Item = TMCT_R> + '_ {
513        (0..3).map(move |n| TMCT_R::new(((self.bits >> (n * 8 + 7)) & 1) != 0))
514    }
515    #[doc = "Bit 7 - Transmit mailbox 0 cancel transmission"]
516    #[inline(always)]
517    pub fn tm0ct(&self) -> TMCT_R {
518        TMCT_R::new(((self.bits >> 7) & 1) != 0)
519    }
520    #[doc = "Bit 15 - Transmit mailbox 1 cancel transmission"]
521    #[inline(always)]
522    pub fn tm1ct(&self) -> TMCT_R {
523        TMCT_R::new(((self.bits >> 15) & 1) != 0)
524    }
525    #[doc = "Bit 23 - Transmit mailbox 2 cancel transmission"]
526    #[inline(always)]
527    pub fn tm2ct(&self) -> TMCT_R {
528        TMCT_R::new(((self.bits >> 23) & 1) != 0)
529    }
530    #[doc = "Bits 24:25 - Transmit Mailbox number record"]
531    #[inline(always)]
532    pub fn tmnr(&self) -> TMNR_R {
533        TMNR_R::new(((self.bits >> 24) & 3) as u8)
534    }
535    #[doc = "Transmit mailbox (0-2) empty flag"]
536    #[doc = ""]
537    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0EF` field.</div>"]
538    #[inline(always)]
539    pub fn tmef(&self, n: u8) -> TMEF_R {
540        #[allow(clippy::no_effect)]
541        [(); 3][n as usize];
542        TMEF_R::new(((self.bits >> (n + 26)) & 1) != 0)
543    }
544    #[doc = "Iterator for array of:"]
545    #[doc = "Transmit mailbox (0-2) empty flag"]
546    #[inline(always)]
547    pub fn tmef_iter(&self) -> impl Iterator<Item = TMEF_R> + '_ {
548        (0..3).map(move |n| TMEF_R::new(((self.bits >> (n + 26)) & 1) != 0))
549    }
550    #[doc = "Bit 26 - Transmit mailbox 0 empty flag"]
551    #[inline(always)]
552    pub fn tm0ef(&self) -> TMEF_R {
553        TMEF_R::new(((self.bits >> 26) & 1) != 0)
554    }
555    #[doc = "Bit 27 - Transmit mailbox 1 empty flag"]
556    #[inline(always)]
557    pub fn tm1ef(&self) -> TMEF_R {
558        TMEF_R::new(((self.bits >> 27) & 1) != 0)
559    }
560    #[doc = "Bit 28 - Transmit mailbox 2 empty flag"]
561    #[inline(always)]
562    pub fn tm2ef(&self) -> TMEF_R {
563        TMEF_R::new(((self.bits >> 28) & 1) != 0)
564    }
565    #[doc = "Transmit mailbox (0-2) lowest priority flag"]
566    #[doc = ""]
567    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0LPF` field.</div>"]
568    #[inline(always)]
569    pub fn tmlpf(&self, n: u8) -> TMLPF_R {
570        #[allow(clippy::no_effect)]
571        [(); 3][n as usize];
572        TMLPF_R::new(((self.bits >> (n + 29)) & 1) != 0)
573    }
574    #[doc = "Iterator for array of:"]
575    #[doc = "Transmit mailbox (0-2) lowest priority flag"]
576    #[inline(always)]
577    pub fn tmlpf_iter(&self) -> impl Iterator<Item = TMLPF_R> + '_ {
578        (0..3).map(move |n| TMLPF_R::new(((self.bits >> (n + 29)) & 1) != 0))
579    }
580    #[doc = "Bit 29 - Transmit mailbox 0 lowest priority flag"]
581    #[inline(always)]
582    pub fn tm0lpf(&self) -> TMLPF_R {
583        TMLPF_R::new(((self.bits >> 29) & 1) != 0)
584    }
585    #[doc = "Bit 30 - Transmit mailbox 1 lowest priority flag"]
586    #[inline(always)]
587    pub fn tm1lpf(&self) -> TMLPF_R {
588        TMLPF_R::new(((self.bits >> 30) & 1) != 0)
589    }
590    #[doc = "Bit 31 - Transmit mailbox 2 lowest priority flag"]
591    #[inline(always)]
592    pub fn tm2lpf(&self) -> TMLPF_R {
593        TMLPF_R::new(((self.bits >> 31) & 1) != 0)
594    }
595}
596impl core::fmt::Debug for R {
597    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
598        f.debug_struct("TSTS")
599            .field("tm0lpf", &self.tm0lpf())
600            .field("tm1lpf", &self.tm1lpf())
601            .field("tm2lpf", &self.tm2lpf())
602            .field("tm0ef", &self.tm0ef())
603            .field("tm1ef", &self.tm1ef())
604            .field("tm2ef", &self.tm2ef())
605            .field("tmnr", &self.tmnr())
606            .field("tm0ct", &self.tm0ct())
607            .field("tm1ct", &self.tm1ct())
608            .field("tm2ct", &self.tm2ct())
609            .field("tm0tef", &self.tm0tef())
610            .field("tm1tef", &self.tm1tef())
611            .field("tm2tef", &self.tm2tef())
612            .field("tm0alf", &self.tm0alf())
613            .field("tm1alf", &self.tm1alf())
614            .field("tm2alf", &self.tm2alf())
615            .field("tm0tsf", &self.tm0tsf())
616            .field("tm1tsf", &self.tm1tsf())
617            .field("tm2tsf", &self.tm2tsf())
618            .field("tm0tcf", &self.tm0tcf())
619            .field("tm1tcf", &self.tm1tcf())
620            .field("tm2tcf", &self.tm2tcf())
621            .finish()
622    }
623}
624impl W {
625    #[doc = "Transmit mailbox (0-2) transmission complete flag"]
626    #[doc = ""]
627    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0TCF` field.</div>"]
628    #[inline(always)]
629    pub fn tmtcf(&mut self, n: u8) -> TMTCF_W<'_, TSTS_SPEC> {
630        #[allow(clippy::no_effect)]
631        [(); 3][n as usize];
632        TMTCF_W::new(self, n * 8)
633    }
634    #[doc = "Bit 0 - Transmit mailbox 0 transmission complete flag"]
635    #[inline(always)]
636    pub fn tm0tcf(&mut self) -> TMTCF_W<'_, TSTS_SPEC> {
637        TMTCF_W::new(self, 0)
638    }
639    #[doc = "Bit 8 - Transmit mailbox 1 transmission complete flag"]
640    #[inline(always)]
641    pub fn tm1tcf(&mut self) -> TMTCF_W<'_, TSTS_SPEC> {
642        TMTCF_W::new(self, 8)
643    }
644    #[doc = "Bit 16 - Transmit mailbox 2 transmission complete flag"]
645    #[inline(always)]
646    pub fn tm2tcf(&mut self) -> TMTCF_W<'_, TSTS_SPEC> {
647        TMTCF_W::new(self, 16)
648    }
649    #[doc = "Transmit mailbox (0-2) transmission success flag"]
650    #[doc = ""]
651    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0TSF` field.</div>"]
652    #[inline(always)]
653    pub fn tmtsf(&mut self, n: u8) -> TMTSF_W<'_, TSTS_SPEC> {
654        #[allow(clippy::no_effect)]
655        [(); 3][n as usize];
656        TMTSF_W::new(self, n * 8 + 1)
657    }
658    #[doc = "Bit 1 - Transmit mailbox 0 transmission success flag"]
659    #[inline(always)]
660    pub fn tm0tsf(&mut self) -> TMTSF_W<'_, TSTS_SPEC> {
661        TMTSF_W::new(self, 1)
662    }
663    #[doc = "Bit 9 - Transmit mailbox 1 transmission success flag"]
664    #[inline(always)]
665    pub fn tm1tsf(&mut self) -> TMTSF_W<'_, TSTS_SPEC> {
666        TMTSF_W::new(self, 9)
667    }
668    #[doc = "Bit 17 - Transmit mailbox 2 transmission success flag"]
669    #[inline(always)]
670    pub fn tm2tsf(&mut self) -> TMTSF_W<'_, TSTS_SPEC> {
671        TMTSF_W::new(self, 17)
672    }
673    #[doc = "Transmit mailbox (0-2) arbitration lost flag"]
674    #[doc = ""]
675    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0ALF` field.</div>"]
676    #[inline(always)]
677    pub fn tmalf(&mut self, n: u8) -> TMALF_W<'_, TSTS_SPEC> {
678        #[allow(clippy::no_effect)]
679        [(); 3][n as usize];
680        TMALF_W::new(self, n * 8 + 2)
681    }
682    #[doc = "Bit 2 - Transmit mailbox 0 arbitration lost flag"]
683    #[inline(always)]
684    pub fn tm0alf(&mut self) -> TMALF_W<'_, TSTS_SPEC> {
685        TMALF_W::new(self, 2)
686    }
687    #[doc = "Bit 10 - Transmit mailbox 1 arbitration lost flag"]
688    #[inline(always)]
689    pub fn tm1alf(&mut self) -> TMALF_W<'_, TSTS_SPEC> {
690        TMALF_W::new(self, 10)
691    }
692    #[doc = "Bit 18 - Transmit mailbox 2 arbitration lost flag"]
693    #[inline(always)]
694    pub fn tm2alf(&mut self) -> TMALF_W<'_, TSTS_SPEC> {
695        TMALF_W::new(self, 18)
696    }
697    #[doc = "Transmit mailbox (0-2) transmission error flag"]
698    #[doc = ""]
699    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0TEF` field.</div>"]
700    #[inline(always)]
701    pub fn tmtef(&mut self, n: u8) -> TMTEF_W<'_, TSTS_SPEC> {
702        #[allow(clippy::no_effect)]
703        [(); 3][n as usize];
704        TMTEF_W::new(self, n * 8 + 3)
705    }
706    #[doc = "Bit 3 - Transmit mailbox 0 transmission error flag"]
707    #[inline(always)]
708    pub fn tm0tef(&mut self) -> TMTEF_W<'_, TSTS_SPEC> {
709        TMTEF_W::new(self, 3)
710    }
711    #[doc = "Bit 11 - Transmit mailbox 1 transmission error flag"]
712    #[inline(always)]
713    pub fn tm1tef(&mut self) -> TMTEF_W<'_, TSTS_SPEC> {
714        TMTEF_W::new(self, 11)
715    }
716    #[doc = "Bit 19 - Transmit mailbox 2 transmission error flag"]
717    #[inline(always)]
718    pub fn tm2tef(&mut self) -> TMTEF_W<'_, TSTS_SPEC> {
719        TMTEF_W::new(self, 19)
720    }
721    #[doc = "Transmit mailbox (0-2) cancel transmission"]
722    #[doc = ""]
723    #[doc = "<div class=\"warning\">`n` is number of field in register. `n == 0` corresponds to `TM0CT` field.</div>"]
724    #[inline(always)]
725    pub fn tmct(&mut self, n: u8) -> TMCT_W<'_, TSTS_SPEC> {
726        #[allow(clippy::no_effect)]
727        [(); 3][n as usize];
728        TMCT_W::new(self, n * 8 + 7)
729    }
730    #[doc = "Bit 7 - Transmit mailbox 0 cancel transmission"]
731    #[inline(always)]
732    pub fn tm0ct(&mut self) -> TMCT_W<'_, TSTS_SPEC> {
733        TMCT_W::new(self, 7)
734    }
735    #[doc = "Bit 15 - Transmit mailbox 1 cancel transmission"]
736    #[inline(always)]
737    pub fn tm1ct(&mut self) -> TMCT_W<'_, TSTS_SPEC> {
738        TMCT_W::new(self, 15)
739    }
740    #[doc = "Bit 23 - Transmit mailbox 2 cancel transmission"]
741    #[inline(always)]
742    pub fn tm2ct(&mut self) -> TMCT_W<'_, TSTS_SPEC> {
743        TMCT_W::new(self, 23)
744    }
745}
746#[doc = "Transmit status register\n\nYou can [`read`](crate::Reg::read) this register and get [`tsts::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tsts::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
747pub struct TSTS_SPEC;
748impl crate::RegisterSpec for TSTS_SPEC {
749    type Ux = u32;
750}
751#[doc = "`read()` method returns [`tsts::R`](R) reader structure"]
752impl crate::Readable for TSTS_SPEC {}
753#[doc = "`write(|w| ..)` method takes [`tsts::W`](W) writer structure"]
754impl crate::Writable for TSTS_SPEC {
755    type Safety = crate::Unsafe;
756    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0x008f_8f8f;
757}
758#[doc = "`reset()` method sets TSTS to value 0x1c00_0000"]
759impl crate::Resettable for TSTS_SPEC {
760    const RESET_VALUE: u32 = 0x1c00_0000;
761}