stm32g0/stm32g030/pwr/
cr4.rs1pub type R = crate::R<CR4rs>;
3pub type W = crate::W<CR4rs>;
5pub type WP1_R = crate::BitReader;
7pub type WP1_W<'a, REG> = crate::BitWriter<'a, REG>;
9pub type WP2_R = crate::BitReader;
11pub type WP2_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type WP3_R = crate::BitReader;
15pub type WP3_W<'a, REG> = crate::BitWriter<'a, REG>;
17pub type WP4_R = crate::BitReader;
19pub type WP4_W<'a, REG> = crate::BitWriter<'a, REG>;
21pub type WP5_R = crate::BitReader;
23pub type WP5_W<'a, REG> = crate::BitWriter<'a, REG>;
25pub type WP6_R = crate::BitReader;
27pub type WP6_W<'a, REG> = crate::BitWriter<'a, REG>;
29pub type VBE_R = crate::BitReader;
31pub type VBE_W<'a, REG> = crate::BitWriter<'a, REG>;
33pub type VBRS_R = crate::BitReader;
35pub type VBRS_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38 #[inline(always)]
40 pub fn wp1(&self) -> WP1_R {
41 WP1_R::new((self.bits & 1) != 0)
42 }
43 #[inline(always)]
45 pub fn wp2(&self) -> WP2_R {
46 WP2_R::new(((self.bits >> 1) & 1) != 0)
47 }
48 #[inline(always)]
50 pub fn wp3(&self) -> WP3_R {
51 WP3_R::new(((self.bits >> 2) & 1) != 0)
52 }
53 #[inline(always)]
55 pub fn wp4(&self) -> WP4_R {
56 WP4_R::new(((self.bits >> 3) & 1) != 0)
57 }
58 #[inline(always)]
60 pub fn wp5(&self) -> WP5_R {
61 WP5_R::new(((self.bits >> 4) & 1) != 0)
62 }
63 #[inline(always)]
65 pub fn wp6(&self) -> WP6_R {
66 WP6_R::new(((self.bits >> 5) & 1) != 0)
67 }
68 #[inline(always)]
70 pub fn vbe(&self) -> VBE_R {
71 VBE_R::new(((self.bits >> 8) & 1) != 0)
72 }
73 #[inline(always)]
75 pub fn vbrs(&self) -> VBRS_R {
76 VBRS_R::new(((self.bits >> 9) & 1) != 0)
77 }
78}
79impl core::fmt::Debug for R {
80 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
81 f.debug_struct("CR4")
82 .field("wp1", &self.wp1())
83 .field("wp2", &self.wp2())
84 .field("wp3", &self.wp3())
85 .field("wp4", &self.wp4())
86 .field("wp5", &self.wp5())
87 .field("wp6", &self.wp6())
88 .field("vbe", &self.vbe())
89 .field("vbrs", &self.vbrs())
90 .finish()
91 }
92}
93impl W {
94 #[inline(always)]
96 pub fn wp1(&mut self) -> WP1_W<CR4rs> {
97 WP1_W::new(self, 0)
98 }
99 #[inline(always)]
101 pub fn wp2(&mut self) -> WP2_W<CR4rs> {
102 WP2_W::new(self, 1)
103 }
104 #[inline(always)]
106 pub fn wp3(&mut self) -> WP3_W<CR4rs> {
107 WP3_W::new(self, 2)
108 }
109 #[inline(always)]
111 pub fn wp4(&mut self) -> WP4_W<CR4rs> {
112 WP4_W::new(self, 3)
113 }
114 #[inline(always)]
116 pub fn wp5(&mut self) -> WP5_W<CR4rs> {
117 WP5_W::new(self, 4)
118 }
119 #[inline(always)]
121 pub fn wp6(&mut self) -> WP6_W<CR4rs> {
122 WP6_W::new(self, 5)
123 }
124 #[inline(always)]
126 pub fn vbe(&mut self) -> VBE_W<CR4rs> {
127 VBE_W::new(self, 8)
128 }
129 #[inline(always)]
131 pub fn vbrs(&mut self) -> VBRS_W<CR4rs> {
132 VBRS_W::new(self, 9)
133 }
134}
135pub struct CR4rs;
141impl crate::RegisterSpec for CR4rs {
142 type Ux = u32;
143}
144impl crate::Readable for CR4rs {}
146impl crate::Writable for CR4rs {
148 type Safety = crate::Unsafe;
149}
150impl crate::Resettable for CR4rs {}