ra2e1/dtc/
dtcsts.rs

1#[doc = "Register `DTCSTS` reader"]
2pub struct R(crate::R<DTCSTS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<DTCSTS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<DTCSTS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<DTCSTS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `VECN` reader - DTC-Activating Vector Number Monitoring"]
17pub type VECN_R = crate::FieldReader<u8, u8>;
18#[doc = "Field `ACT` reader - DTC Active Flag"]
19pub type ACT_R = crate::BitReader<ACT_A>;
20#[doc = "DTC Active Flag\n\nValue on reset: 0"]
21#[derive(Clone, Copy, Debug, PartialEq, Eq)]
22pub enum ACT_A {
23    #[doc = "0: DTC transfer operation is not in progress"]
24    _0 = 0,
25    #[doc = "1: DTC transfer operation is in progress"]
26    _1 = 1,
27}
28impl From<ACT_A> for bool {
29    #[inline(always)]
30    fn from(variant: ACT_A) -> Self {
31        variant as u8 != 0
32    }
33}
34impl ACT_R {
35    #[doc = "Get enumerated values variant"]
36    #[inline(always)]
37    pub fn variant(&self) -> ACT_A {
38        match self.bits {
39            false => ACT_A::_0,
40            true => ACT_A::_1,
41        }
42    }
43    #[doc = "Checks if the value of the field is `_0`"]
44    #[inline(always)]
45    pub fn is_0(&self) -> bool {
46        *self == ACT_A::_0
47    }
48    #[doc = "Checks if the value of the field is `_1`"]
49    #[inline(always)]
50    pub fn is_1(&self) -> bool {
51        *self == ACT_A::_1
52    }
53}
54impl R {
55    #[doc = "Bits 0:7 - DTC-Activating Vector Number Monitoring"]
56    #[inline(always)]
57    pub fn vecn(&self) -> VECN_R {
58        VECN_R::new((self.bits & 0xff) as u8)
59    }
60    #[doc = "Bit 15 - DTC Active Flag"]
61    #[inline(always)]
62    pub fn act(&self) -> ACT_R {
63        ACT_R::new(((self.bits >> 15) & 1) != 0)
64    }
65}
66#[doc = "DTC Status Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dtcsts](index.html) module"]
67pub struct DTCSTS_SPEC;
68impl crate::RegisterSpec for DTCSTS_SPEC {
69    type Ux = u16;
70}
71#[doc = "`read()` method returns [dtcsts::R](R) reader structure"]
72impl crate::Readable for DTCSTS_SPEC {
73    type Reader = R;
74}
75#[doc = "`reset()` method sets DTCSTS to value 0"]
76impl crate::Resettable for DTCSTS_SPEC {
77    const RESET_VALUE: Self::Ux = 0;
78}