stm32f4/stm32f413/rcc/
ahb2rstr.rs1pub type R = crate::R<AHB2RSTRrs>;
3pub type W = crate::W<AHB2RSTRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum CRYPRST {
11 Reset = 1,
13}
14impl From<CRYPRST> for bool {
15 #[inline(always)]
16 fn from(variant: CRYPRST) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type CRYPRST_R = crate::BitReader<CRYPRST>;
22impl CRYPRST_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> Option<CRYPRST> {
26 match self.bits {
27 true => Some(CRYPRST::Reset),
28 _ => None,
29 }
30 }
31 #[inline(always)]
33 pub fn is_reset(&self) -> bool {
34 *self == CRYPRST::Reset
35 }
36}
37pub type CRYPRST_W<'a, REG> = crate::BitWriter<'a, REG, CRYPRST>;
39impl<'a, REG> CRYPRST_W<'a, REG>
40where
41 REG: crate::Writable + crate::RegisterSpec,
42{
43 #[inline(always)]
45 pub fn reset(self) -> &'a mut crate::W<REG> {
46 self.variant(CRYPRST::Reset)
47 }
48}
49pub use CRYPRST_R as RNGRST_R;
51pub use CRYPRST_R as OTGFSRST_R;
53pub use CRYPRST_W as RNGRST_W;
55pub use CRYPRST_W as OTGFSRST_W;
57impl R {
58 #[inline(always)]
60 pub fn cryprst(&self) -> CRYPRST_R {
61 CRYPRST_R::new(((self.bits >> 4) & 1) != 0)
62 }
63 #[inline(always)]
65 pub fn rngrst(&self) -> RNGRST_R {
66 RNGRST_R::new(((self.bits >> 6) & 1) != 0)
67 }
68 #[inline(always)]
70 pub fn otgfsrst(&self) -> OTGFSRST_R {
71 OTGFSRST_R::new(((self.bits >> 7) & 1) != 0)
72 }
73}
74impl core::fmt::Debug for R {
75 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
76 f.debug_struct("AHB2RSTR")
77 .field("cryprst", &self.cryprst())
78 .field("otgfsrst", &self.otgfsrst())
79 .field("rngrst", &self.rngrst())
80 .finish()
81 }
82}
83impl W {
84 #[inline(always)]
86 pub fn cryprst(&mut self) -> CRYPRST_W<AHB2RSTRrs> {
87 CRYPRST_W::new(self, 4)
88 }
89 #[inline(always)]
91 pub fn rngrst(&mut self) -> RNGRST_W<AHB2RSTRrs> {
92 RNGRST_W::new(self, 6)
93 }
94 #[inline(always)]
96 pub fn otgfsrst(&mut self) -> OTGFSRST_W<AHB2RSTRrs> {
97 OTGFSRST_W::new(self, 7)
98 }
99}
100pub struct AHB2RSTRrs;
106impl crate::RegisterSpec for AHB2RSTRrs {
107 type Ux = u32;
108}
109impl crate::Readable for AHB2RSTRrs {}
111impl crate::Writable for AHB2RSTRrs {
113 type Safety = crate::Unsafe;
114}
115impl crate::Resettable for AHB2RSTRrs {}