stm32f1_staging/stm32f107/rcc/
ahbrstr.rs1pub type R = crate::R<AHBRSTRrs>;
3pub type W = crate::W<AHBRSTRrs>;
5#[cfg_attr(feature = "defmt", derive(defmt::Format))]
9#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10pub enum OTGFSRST {
11 Reset = 1,
13}
14impl From<OTGFSRST> for bool {
15 #[inline(always)]
16 fn from(variant: OTGFSRST) -> Self {
17 variant as u8 != 0
18 }
19}
20pub type OTGFSRST_R = crate::BitReader<OTGFSRST>;
22impl OTGFSRST_R {
23 #[inline(always)]
25 pub const fn variant(&self) -> Option<OTGFSRST> {
26 match self.bits {
27 true => Some(OTGFSRST::Reset),
28 _ => None,
29 }
30 }
31 #[inline(always)]
33 pub fn is_reset(&self) -> bool {
34 *self == OTGFSRST::Reset
35 }
36}
37pub type OTGFSRST_W<'a, REG> = crate::BitWriter<'a, REG, OTGFSRST>;
39impl<'a, REG> OTGFSRST_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(OTGFSRST::Reset)
47 }
48}
49pub use OTGFSRST_R as ETHMACRST_R;
51pub use OTGFSRST_W as ETHMACRST_W;
53impl R {
54 #[inline(always)]
56 pub fn otgfsrst(&self) -> OTGFSRST_R {
57 OTGFSRST_R::new(((self.bits >> 12) & 1) != 0)
58 }
59 #[inline(always)]
61 pub fn ethmacrst(&self) -> ETHMACRST_R {
62 ETHMACRST_R::new(((self.bits >> 14) & 1) != 0)
63 }
64}
65impl core::fmt::Debug for R {
66 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
67 f.debug_struct("AHBRSTR")
68 .field("otgfsrst", &self.otgfsrst())
69 .field("ethmacrst", &self.ethmacrst())
70 .finish()
71 }
72}
73impl W {
74 #[inline(always)]
76 pub fn otgfsrst(&mut self) -> OTGFSRST_W<AHBRSTRrs> {
77 OTGFSRST_W::new(self, 12)
78 }
79 #[inline(always)]
81 pub fn ethmacrst(&mut self) -> ETHMACRST_W<AHBRSTRrs> {
82 ETHMACRST_W::new(self, 14)
83 }
84}
85pub struct AHBRSTRrs;
91impl crate::RegisterSpec for AHBRSTRrs {
92 type Ux = u32;
93}
94impl crate::Readable for AHBRSTRrs {}
96impl crate::Writable for AHBRSTRrs {
98 type Safety = crate::Unsafe;
99}
100impl crate::Resettable for AHBRSTRrs {}