atsam4sd32c_pac/tc0/
sr2.rs

1#[doc = "Register `SR2` reader"]
2pub struct R(crate::R<SR2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SR2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SR2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SR2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Field `COVFS` reader - Counter Overflow Status"]
17pub type COVFS_R = crate::BitReader<bool>;
18#[doc = "Field `LOVRS` reader - Load Overrun Status"]
19pub type LOVRS_R = crate::BitReader<bool>;
20#[doc = "Field `CPAS` reader - RA Compare Status"]
21pub type CPAS_R = crate::BitReader<bool>;
22#[doc = "Field `CPBS` reader - RB Compare Status"]
23pub type CPBS_R = crate::BitReader<bool>;
24#[doc = "Field `CPCS` reader - RC Compare Status"]
25pub type CPCS_R = crate::BitReader<bool>;
26#[doc = "Field `LDRAS` reader - RA Loading Status"]
27pub type LDRAS_R = crate::BitReader<bool>;
28#[doc = "Field `LDRBS` reader - RB Loading Status"]
29pub type LDRBS_R = crate::BitReader<bool>;
30#[doc = "Field `ETRGS` reader - External Trigger Status"]
31pub type ETRGS_R = crate::BitReader<bool>;
32#[doc = "Field `CLKSTA` reader - Clock Enabling Status"]
33pub type CLKSTA_R = crate::BitReader<bool>;
34#[doc = "Field `MTIOA` reader - TIOA Mirror"]
35pub type MTIOA_R = crate::BitReader<bool>;
36#[doc = "Field `MTIOB` reader - TIOB Mirror"]
37pub type MTIOB_R = crate::BitReader<bool>;
38impl R {
39    #[doc = "Bit 0 - Counter Overflow Status"]
40    #[inline(always)]
41    pub fn covfs(&self) -> COVFS_R {
42        COVFS_R::new((self.bits & 1) != 0)
43    }
44    #[doc = "Bit 1 - Load Overrun Status"]
45    #[inline(always)]
46    pub fn lovrs(&self) -> LOVRS_R {
47        LOVRS_R::new(((self.bits >> 1) & 1) != 0)
48    }
49    #[doc = "Bit 2 - RA Compare Status"]
50    #[inline(always)]
51    pub fn cpas(&self) -> CPAS_R {
52        CPAS_R::new(((self.bits >> 2) & 1) != 0)
53    }
54    #[doc = "Bit 3 - RB Compare Status"]
55    #[inline(always)]
56    pub fn cpbs(&self) -> CPBS_R {
57        CPBS_R::new(((self.bits >> 3) & 1) != 0)
58    }
59    #[doc = "Bit 4 - RC Compare Status"]
60    #[inline(always)]
61    pub fn cpcs(&self) -> CPCS_R {
62        CPCS_R::new(((self.bits >> 4) & 1) != 0)
63    }
64    #[doc = "Bit 5 - RA Loading Status"]
65    #[inline(always)]
66    pub fn ldras(&self) -> LDRAS_R {
67        LDRAS_R::new(((self.bits >> 5) & 1) != 0)
68    }
69    #[doc = "Bit 6 - RB Loading Status"]
70    #[inline(always)]
71    pub fn ldrbs(&self) -> LDRBS_R {
72        LDRBS_R::new(((self.bits >> 6) & 1) != 0)
73    }
74    #[doc = "Bit 7 - External Trigger Status"]
75    #[inline(always)]
76    pub fn etrgs(&self) -> ETRGS_R {
77        ETRGS_R::new(((self.bits >> 7) & 1) != 0)
78    }
79    #[doc = "Bit 16 - Clock Enabling Status"]
80    #[inline(always)]
81    pub fn clksta(&self) -> CLKSTA_R {
82        CLKSTA_R::new(((self.bits >> 16) & 1) != 0)
83    }
84    #[doc = "Bit 17 - TIOA Mirror"]
85    #[inline(always)]
86    pub fn mtioa(&self) -> MTIOA_R {
87        MTIOA_R::new(((self.bits >> 17) & 1) != 0)
88    }
89    #[doc = "Bit 18 - TIOB Mirror"]
90    #[inline(always)]
91    pub fn mtiob(&self) -> MTIOB_R {
92        MTIOB_R::new(((self.bits >> 18) & 1) != 0)
93    }
94}
95#[doc = "Status Register (channel = 2)\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 [sr2](index.html) module"]
96pub struct SR2_SPEC;
97impl crate::RegisterSpec for SR2_SPEC {
98    type Ux = u32;
99}
100#[doc = "`read()` method returns [sr2::R](R) reader structure"]
101impl crate::Readable for SR2_SPEC {
102    type Reader = R;
103}
104#[doc = "`reset()` method sets SR2 to value 0"]
105impl crate::Resettable for SR2_SPEC {
106    const RESET_VALUE: Self::Ux = 0;
107}