py32f0/py32f040/ctc/
sr.rs

1///Register `SR` reader
2pub struct R(crate::R<SR_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SR_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SR_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SR_SPEC>) -> Self {
13        R(reader)
14    }
15}
16///Field `CKOKIF` reader - desc CKOKIF
17pub type CKOKIF_R = crate::BitReader<bool>;
18///Field `CKWARNIF` reader - desc CKWARNIF
19pub type CKWARNIF_R = crate::BitReader<bool>;
20///Field `ERRIF` reader - desc ERRIF
21pub type ERRIF_R = crate::BitReader<bool>;
22///Field `EREFIF` reader - desc EREFIF
23pub type EREFIF_R = crate::BitReader<bool>;
24///Field `CKERR` reader - desc CKERR
25pub type CKERR_R = crate::BitReader<bool>;
26///Field `REFMISS` reader - desc REFMISS
27pub type REFMISS_R = crate::BitReader<bool>;
28///Field `TRIMERR` reader - desc TRIMERR
29pub type TRIMERR_R = crate::BitReader<bool>;
30///Field `REFDIR` reader - desc REFDIR
31pub type REFDIR_R = crate::BitReader<bool>;
32///Field `REFCAP` reader - desc REFCAP
33pub type REFCAP_R = crate::FieldReader<u16, u16>;
34impl R {
35    ///Bit 0 - desc CKOKIF
36    #[inline(always)]
37    pub fn ckokif(&self) -> CKOKIF_R {
38        CKOKIF_R::new((self.bits & 1) != 0)
39    }
40    ///Bit 1 - desc CKWARNIF
41    #[inline(always)]
42    pub fn ckwarnif(&self) -> CKWARNIF_R {
43        CKWARNIF_R::new(((self.bits >> 1) & 1) != 0)
44    }
45    ///Bit 2 - desc ERRIF
46    #[inline(always)]
47    pub fn errif(&self) -> ERRIF_R {
48        ERRIF_R::new(((self.bits >> 2) & 1) != 0)
49    }
50    ///Bit 3 - desc EREFIF
51    #[inline(always)]
52    pub fn erefif(&self) -> EREFIF_R {
53        EREFIF_R::new(((self.bits >> 3) & 1) != 0)
54    }
55    ///Bit 8 - desc CKERR
56    #[inline(always)]
57    pub fn ckerr(&self) -> CKERR_R {
58        CKERR_R::new(((self.bits >> 8) & 1) != 0)
59    }
60    ///Bit 9 - desc REFMISS
61    #[inline(always)]
62    pub fn refmiss(&self) -> REFMISS_R {
63        REFMISS_R::new(((self.bits >> 9) & 1) != 0)
64    }
65    ///Bit 10 - desc TRIMERR
66    #[inline(always)]
67    pub fn trimerr(&self) -> TRIMERR_R {
68        TRIMERR_R::new(((self.bits >> 10) & 1) != 0)
69    }
70    ///Bit 15 - desc REFDIR
71    #[inline(always)]
72    pub fn refdir(&self) -> REFDIR_R {
73        REFDIR_R::new(((self.bits >> 15) & 1) != 0)
74    }
75    ///Bits 16:31 - desc REFCAP
76    #[inline(always)]
77    pub fn refcap(&self) -> REFCAP_R {
78        REFCAP_R::new(((self.bits >> 16) & 0xffff) as u16)
79    }
80}
81/**desc SR
82
83This register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
84
85For information about available fields see [sr](index.html) module*/
86pub struct SR_SPEC;
87impl crate::RegisterSpec for SR_SPEC {
88    type Ux = u32;
89}
90///`read()` method returns [sr::R](R) reader structure
91impl crate::Readable for SR_SPEC {
92    type Reader = R;
93}
94///`reset()` method sets SR to value 0
95impl crate::Resettable for SR_SPEC {
96    const RESET_VALUE: Self::Ux = 0;
97}