stm32g4_staging/stm32g474/comp/
ccsr.rs1pub type R = crate::R<CCSRrs>;
3pub type W = crate::W<CCSRrs>;
5pub type EN_R = crate::BitReader;
7pub type EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type INMSEL_R = crate::FieldReader;
11pub type INMSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13pub type INPSEL_R = crate::BitReader;
15pub type INPSEL_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type POL_R = crate::BitReader;
19pub type POL_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type HYST_R = crate::FieldReader;
23pub type HYST_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
25pub type BLANKSEL_R = crate::FieldReader;
27pub type BLANKSEL_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
29pub type BRGEN_R = crate::BitReader;
31pub type BRGEN_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type SCALEN_R = crate::BitReader;
35pub type SCALEN_W<'a, REG> = crate::BitWriter<'a, REG>;
37pub type VALUE_R = crate::BitReader;
39pub type LOCK_R = crate::BitReader;
41pub type LOCK_W<'a, REG> = crate::BitWriter<'a, REG>;
43impl R {
44 #[inline(always)]
46 pub fn en(&self) -> EN_R {
47 EN_R::new((self.bits & 1) != 0)
48 }
49 #[inline(always)]
51 pub fn inmsel(&self) -> INMSEL_R {
52 INMSEL_R::new(((self.bits >> 4) & 7) as u8)
53 }
54 #[inline(always)]
56 pub fn inpsel(&self) -> INPSEL_R {
57 INPSEL_R::new(((self.bits >> 8) & 1) != 0)
58 }
59 #[inline(always)]
61 pub fn pol(&self) -> POL_R {
62 POL_R::new(((self.bits >> 15) & 1) != 0)
63 }
64 #[inline(always)]
66 pub fn hyst(&self) -> HYST_R {
67 HYST_R::new(((self.bits >> 16) & 7) as u8)
68 }
69 #[inline(always)]
71 pub fn blanksel(&self) -> BLANKSEL_R {
72 BLANKSEL_R::new(((self.bits >> 19) & 7) as u8)
73 }
74 #[inline(always)]
76 pub fn brgen(&self) -> BRGEN_R {
77 BRGEN_R::new(((self.bits >> 22) & 1) != 0)
78 }
79 #[inline(always)]
81 pub fn scalen(&self) -> SCALEN_R {
82 SCALEN_R::new(((self.bits >> 23) & 1) != 0)
83 }
84 #[inline(always)]
86 pub fn value(&self) -> VALUE_R {
87 VALUE_R::new(((self.bits >> 30) & 1) != 0)
88 }
89 #[inline(always)]
91 pub fn lock(&self) -> LOCK_R {
92 LOCK_R::new(((self.bits >> 31) & 1) != 0)
93 }
94}
95impl core::fmt::Debug for R {
96 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
97 f.debug_struct("CCSR")
98 .field("en", &self.en())
99 .field("inmsel", &self.inmsel())
100 .field("inpsel", &self.inpsel())
101 .field("pol", &self.pol())
102 .field("hyst", &self.hyst())
103 .field("blanksel", &self.blanksel())
104 .field("brgen", &self.brgen())
105 .field("scalen", &self.scalen())
106 .field("value", &self.value())
107 .field("lock", &self.lock())
108 .finish()
109 }
110}
111impl W {
112 #[inline(always)]
114 pub fn en(&mut self) -> EN_W<CCSRrs> {
115 EN_W::new(self, 0)
116 }
117 #[inline(always)]
119 pub fn inmsel(&mut self) -> INMSEL_W<CCSRrs> {
120 INMSEL_W::new(self, 4)
121 }
122 #[inline(always)]
124 pub fn inpsel(&mut self) -> INPSEL_W<CCSRrs> {
125 INPSEL_W::new(self, 8)
126 }
127 #[inline(always)]
129 pub fn pol(&mut self) -> POL_W<CCSRrs> {
130 POL_W::new(self, 15)
131 }
132 #[inline(always)]
134 pub fn hyst(&mut self) -> HYST_W<CCSRrs> {
135 HYST_W::new(self, 16)
136 }
137 #[inline(always)]
139 pub fn blanksel(&mut self) -> BLANKSEL_W<CCSRrs> {
140 BLANKSEL_W::new(self, 19)
141 }
142 #[inline(always)]
144 pub fn brgen(&mut self) -> BRGEN_W<CCSRrs> {
145 BRGEN_W::new(self, 22)
146 }
147 #[inline(always)]
149 pub fn scalen(&mut self) -> SCALEN_W<CCSRrs> {
150 SCALEN_W::new(self, 23)
151 }
152 #[inline(always)]
154 pub fn lock(&mut self) -> LOCK_W<CCSRrs> {
155 LOCK_W::new(self, 31)
156 }
157}
158pub struct CCSRrs;
164impl crate::RegisterSpec for CCSRrs {
165 type Ux = u32;
166}
167impl crate::Readable for CCSRrs {}
169impl crate::Writable for CCSRrs {
171 type Safety = crate::Unsafe;
172}
173impl crate::Resettable for CCSRrs {}