efm32g230_pac/timer2/
status.rs

1#[doc = "Register `STATUS` reader"]
2pub struct R(crate::R<STATUS_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<STATUS_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<STATUS_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<STATUS_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `RUNNING` reader - Running"]
17pub type RUNNING_R = crate::BitReader<bool>;
18#[doc = "Field `DIR` reader - Direction"]
19pub type DIR_R = crate::BitReader<bool>;
20#[doc = "Field `TOPBV` reader - TOPB Valid"]
21pub type TOPBV_R = crate::BitReader<bool>;
22#[doc = "Field `CCVBV0` reader - CC0 CCVB Valid"]
23pub type CCVBV0_R = crate::BitReader<bool>;
24#[doc = "Field `CCVBV1` reader - CC1 CCVB Valid"]
25pub type CCVBV1_R = crate::BitReader<bool>;
26#[doc = "Field `CCVBV2` reader - CC2 CCVB Valid"]
27pub type CCVBV2_R = crate::BitReader<bool>;
28#[doc = "Field `ICV0` reader - CC0 Input Capture Valid"]
29pub type ICV0_R = crate::BitReader<bool>;
30#[doc = "Field `ICV1` reader - CC1 Input Capture Valid"]
31pub type ICV1_R = crate::BitReader<bool>;
32#[doc = "Field `ICV2` reader - CC2 Input Capture Valid"]
33pub type ICV2_R = crate::BitReader<bool>;
34#[doc = "Field `CCPOL0` reader - CC0 Polarity"]
35pub type CCPOL0_R = crate::BitReader<bool>;
36#[doc = "Field `CCPOL1` reader - CC1 Polarity"]
37pub type CCPOL1_R = crate::BitReader<bool>;
38#[doc = "Field `CCPOL2` reader - CC2 Polarity"]
39pub type CCPOL2_R = crate::BitReader<bool>;
40impl R {
41    #[doc = "Bit 0 - Running"]
42    #[inline(always)]
43    pub fn running(&self) -> RUNNING_R {
44        RUNNING_R::new((self.bits & 1) != 0)
45    }
46    #[doc = "Bit 1 - Direction"]
47    #[inline(always)]
48    pub fn dir(&self) -> DIR_R {
49        DIR_R::new(((self.bits >> 1) & 1) != 0)
50    }
51    #[doc = "Bit 2 - TOPB Valid"]
52    #[inline(always)]
53    pub fn topbv(&self) -> TOPBV_R {
54        TOPBV_R::new(((self.bits >> 2) & 1) != 0)
55    }
56    #[doc = "Bit 8 - CC0 CCVB Valid"]
57    #[inline(always)]
58    pub fn ccvbv0(&self) -> CCVBV0_R {
59        CCVBV0_R::new(((self.bits >> 8) & 1) != 0)
60    }
61    #[doc = "Bit 9 - CC1 CCVB Valid"]
62    #[inline(always)]
63    pub fn ccvbv1(&self) -> CCVBV1_R {
64        CCVBV1_R::new(((self.bits >> 9) & 1) != 0)
65    }
66    #[doc = "Bit 10 - CC2 CCVB Valid"]
67    #[inline(always)]
68    pub fn ccvbv2(&self) -> CCVBV2_R {
69        CCVBV2_R::new(((self.bits >> 10) & 1) != 0)
70    }
71    #[doc = "Bit 16 - CC0 Input Capture Valid"]
72    #[inline(always)]
73    pub fn icv0(&self) -> ICV0_R {
74        ICV0_R::new(((self.bits >> 16) & 1) != 0)
75    }
76    #[doc = "Bit 17 - CC1 Input Capture Valid"]
77    #[inline(always)]
78    pub fn icv1(&self) -> ICV1_R {
79        ICV1_R::new(((self.bits >> 17) & 1) != 0)
80    }
81    #[doc = "Bit 18 - CC2 Input Capture Valid"]
82    #[inline(always)]
83    pub fn icv2(&self) -> ICV2_R {
84        ICV2_R::new(((self.bits >> 18) & 1) != 0)
85    }
86    #[doc = "Bit 24 - CC0 Polarity"]
87    #[inline(always)]
88    pub fn ccpol0(&self) -> CCPOL0_R {
89        CCPOL0_R::new(((self.bits >> 24) & 1) != 0)
90    }
91    #[doc = "Bit 25 - CC1 Polarity"]
92    #[inline(always)]
93    pub fn ccpol1(&self) -> CCPOL1_R {
94        CCPOL1_R::new(((self.bits >> 25) & 1) != 0)
95    }
96    #[doc = "Bit 26 - CC2 Polarity"]
97    #[inline(always)]
98    pub fn ccpol2(&self) -> CCPOL2_R {
99        CCPOL2_R::new(((self.bits >> 26) & 1) != 0)
100    }
101}
102#[doc = "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 [status](index.html) module"]
103pub struct STATUS_SPEC;
104impl crate::RegisterSpec for STATUS_SPEC {
105    type Ux = u32;
106}
107#[doc = "`read()` method returns [status::R](R) reader structure"]
108impl crate::Readable for STATUS_SPEC {
109    type Reader = R;
110}
111#[doc = "`reset()` method sets STATUS to value 0"]
112impl crate::Resettable for STATUS_SPEC {
113    #[inline(always)]
114    fn reset_value() -> Self::Ux {
115        0
116    }
117}