py32f0/py32f003/rcc/
ahbrstr.rs1pub struct R(crate::R<AHBRSTR_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<AHBRSTR_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<AHBRSTR_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<AHBRSTR_SPEC>) -> Self {
13 R(reader)
14 }
15}
16pub struct W(crate::W<AHBRSTR_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<AHBRSTR_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<AHBRSTR_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<AHBRSTR_SPEC>) -> Self {
34 W(writer)
35 }
36}
37pub type DMARST_R = crate::BitReader<DMARSTW_A>;
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
43pub enum DMARSTW_A {
44 Reset = 1,
46}
47impl From<DMARSTW_A> for bool {
48 #[inline(always)]
49 fn from(variant: DMARSTW_A) -> Self {
50 variant as u8 != 0
51 }
52}
53impl DMARST_R {
54 #[inline(always)]
56 pub fn variant(&self) -> Option<DMARSTW_A> {
57 match self.bits {
58 true => Some(DMARSTW_A::Reset),
59 _ => None,
60 }
61 }
62 #[inline(always)]
64 pub fn is_reset(&self) -> bool {
65 *self == DMARSTW_A::Reset
66 }
67}
68pub type DMARST_W<'a, const O: u8> = crate::BitWriter<'a, u32, AHBRSTR_SPEC, DMARSTW_A, O>;
70impl<'a, const O: u8> DMARST_W<'a, O> {
71 #[inline(always)]
73 pub fn reset(self) -> &'a mut W {
74 self.variant(DMARSTW_A::Reset)
75 }
76}
77pub use DMARST_R as CRCRST_R;
79pub use DMARST_W as CRCRST_W;
81impl R {
82 #[inline(always)]
84 pub fn dmarst(&self) -> DMARST_R {
85 DMARST_R::new((self.bits & 1) != 0)
86 }
87 #[inline(always)]
89 pub fn crcrst(&self) -> CRCRST_R {
90 CRCRST_R::new(((self.bits >> 12) & 1) != 0)
91 }
92}
93impl W {
94 #[inline(always)]
96 #[must_use]
97 pub fn dmarst(&mut self) -> DMARST_W<0> {
98 DMARST_W::new(self)
99 }
100 #[inline(always)]
102 #[must_use]
103 pub fn crcrst(&mut self) -> CRCRST_W<12> {
104 CRCRST_W::new(self)
105 }
106 #[inline(always)]
108 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
109 self.0.bits(bits);
110 self
111 }
112}
113pub struct AHBRSTR_SPEC;
119impl crate::RegisterSpec for AHBRSTR_SPEC {
120 type Ux = u32;
121}
122impl crate::Readable for AHBRSTR_SPEC {
124 type Reader = R;
125}
126impl crate::Writable for AHBRSTR_SPEC {
128 type Writer = W;
129 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
130 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
131}
132impl crate::Resettable for AHBRSTR_SPEC {
134 const RESET_VALUE: Self::Ux = 0;
135}