stm32f7_staging/stm32f779/rng/
sr.rs1pub type R = crate::R<SRrs>;
3pub type W = crate::W<SRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum DRDY {
11 Invalid = 0,
13 Valid = 1,
15}
16impl From<DRDY> for bool {
17 #[inline(always)]
18 fn from(variant: DRDY) -> Self {
19 variant as u8 != 0
20 }
21}
22pub type DRDY_R = crate::BitReader<DRDY>;
24impl DRDY_R {
25 #[inline(always)]
27 pub const fn variant(&self) -> DRDY {
28 match self.bits {
29 false => DRDY::Invalid,
30 true => DRDY::Valid,
31 }
32 }
33 #[inline(always)]
35 pub fn is_invalid(&self) -> bool {
36 *self == DRDY::Invalid
37 }
38 #[inline(always)]
40 pub fn is_valid(&self) -> bool {
41 *self == DRDY::Valid
42 }
43}
44#[cfg_attr(feature = "defmt", derive(defmt::Format))]
48#[derive(Clone, Copy, Debug, PartialEq, Eq)]
49pub enum CECS {
50 Correct = 0,
52 Slow = 1,
54}
55impl From<CECS> for bool {
56 #[inline(always)]
57 fn from(variant: CECS) -> Self {
58 variant as u8 != 0
59 }
60}
61pub type CECS_R = crate::BitReader<CECS>;
63impl CECS_R {
64 #[inline(always)]
66 pub const fn variant(&self) -> CECS {
67 match self.bits {
68 false => CECS::Correct,
69 true => CECS::Slow,
70 }
71 }
72 #[inline(always)]
74 pub fn is_correct(&self) -> bool {
75 *self == CECS::Correct
76 }
77 #[inline(always)]
79 pub fn is_slow(&self) -> bool {
80 *self == CECS::Slow
81 }
82}
83#[cfg_attr(feature = "defmt", derive(defmt::Format))]
87#[derive(Clone, Copy, Debug, PartialEq, Eq)]
88pub enum SECS {
89 NoFault = 0,
91 Fault = 1,
93}
94impl From<SECS> for bool {
95 #[inline(always)]
96 fn from(variant: SECS) -> Self {
97 variant as u8 != 0
98 }
99}
100pub type SECS_R = crate::BitReader<SECS>;
102impl SECS_R {
103 #[inline(always)]
105 pub const fn variant(&self) -> SECS {
106 match self.bits {
107 false => SECS::NoFault,
108 true => SECS::Fault,
109 }
110 }
111 #[inline(always)]
113 pub fn is_no_fault(&self) -> bool {
114 *self == SECS::NoFault
115 }
116 #[inline(always)]
118 pub fn is_fault(&self) -> bool {
119 *self == SECS::Fault
120 }
121}
122#[cfg_attr(feature = "defmt", derive(defmt::Format))]
126#[derive(Clone, Copy, Debug, PartialEq, Eq)]
127pub enum CEISR {
128 Correct = 0,
130 Slow = 1,
132}
133impl From<CEISR> for bool {
134 #[inline(always)]
135 fn from(variant: CEISR) -> Self {
136 variant as u8 != 0
137 }
138}
139pub type CEIS_R = crate::BitReader<CEISR>;
141impl CEIS_R {
142 #[inline(always)]
144 pub const fn variant(&self) -> CEISR {
145 match self.bits {
146 false => CEISR::Correct,
147 true => CEISR::Slow,
148 }
149 }
150 #[inline(always)]
152 pub fn is_correct(&self) -> bool {
153 *self == CEISR::Correct
154 }
155 #[inline(always)]
157 pub fn is_slow(&self) -> bool {
158 *self == CEISR::Slow
159 }
160}
161#[cfg_attr(feature = "defmt", derive(defmt::Format))]
165#[derive(Clone, Copy, Debug, PartialEq, Eq)]
166pub enum CEISW {
167 Clear = 0,
169}
170impl From<CEISW> for bool {
171 #[inline(always)]
172 fn from(variant: CEISW) -> Self {
173 variant as u8 != 0
174 }
175}
176pub type CEIS_W<'a, REG> = crate::BitWriter0C<'a, REG, CEISW>;
178impl<'a, REG> CEIS_W<'a, REG>
179where
180 REG: crate::Writable + crate::RegisterSpec,
181{
182 #[inline(always)]
184 pub fn clear(self) -> &'a mut crate::W<REG> {
185 self.variant(CEISW::Clear)
186 }
187}
188#[cfg_attr(feature = "defmt", derive(defmt::Format))]
192#[derive(Clone, Copy, Debug, PartialEq, Eq)]
193pub enum SEISR {
194 NoFault = 0,
196 Fault = 1,
198}
199impl From<SEISR> for bool {
200 #[inline(always)]
201 fn from(variant: SEISR) -> Self {
202 variant as u8 != 0
203 }
204}
205pub type SEIS_R = crate::BitReader<SEISR>;
207impl SEIS_R {
208 #[inline(always)]
210 pub const fn variant(&self) -> SEISR {
211 match self.bits {
212 false => SEISR::NoFault,
213 true => SEISR::Fault,
214 }
215 }
216 #[inline(always)]
218 pub fn is_no_fault(&self) -> bool {
219 *self == SEISR::NoFault
220 }
221 #[inline(always)]
223 pub fn is_fault(&self) -> bool {
224 *self == SEISR::Fault
225 }
226}
227pub use CEIS_W as SEIS_W;
229impl R {
230 #[inline(always)]
232 pub fn drdy(&self) -> DRDY_R {
233 DRDY_R::new((self.bits & 1) != 0)
234 }
235 #[inline(always)]
237 pub fn cecs(&self) -> CECS_R {
238 CECS_R::new(((self.bits >> 1) & 1) != 0)
239 }
240 #[inline(always)]
242 pub fn secs(&self) -> SECS_R {
243 SECS_R::new(((self.bits >> 2) & 1) != 0)
244 }
245 #[inline(always)]
247 pub fn ceis(&self) -> CEIS_R {
248 CEIS_R::new(((self.bits >> 5) & 1) != 0)
249 }
250 #[inline(always)]
252 pub fn seis(&self) -> SEIS_R {
253 SEIS_R::new(((self.bits >> 6) & 1) != 0)
254 }
255}
256impl core::fmt::Debug for R {
257 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
258 f.debug_struct("SR")
259 .field("ceis", &self.ceis())
260 .field("seis", &self.seis())
261 .field("secs", &self.secs())
262 .field("cecs", &self.cecs())
263 .field("drdy", &self.drdy())
264 .finish()
265 }
266}
267impl W {
268 #[inline(always)]
270 pub fn ceis(&mut self) -> CEIS_W<SRrs> {
271 CEIS_W::new(self, 5)
272 }
273 #[inline(always)]
275 pub fn seis(&mut self) -> SEIS_W<SRrs> {
276 SEIS_W::new(self, 6)
277 }
278}
279pub struct SRrs;
285impl crate::RegisterSpec for SRrs {
286 type Ux = u32;
287}
288impl crate::Readable for SRrs {}
290impl crate::Writable for SRrs {
292 type Safety = crate::Unsafe;
293 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0x60;
294}
295impl crate::Resettable for SRrs {}