stm32g0_staging/stm32g0b0/gpiob/
bsrr.rs1pub type W = crate::W<BSRRrs>;
3#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[derive(Clone, Copy, Debug, PartialEq, Eq)]
8pub enum BS0W {
9 Set = 1,
11}
12impl From<BS0W> for bool {
13 #[inline(always)]
14 fn from(variant: BS0W) -> Self {
15 variant as u8 != 0
16 }
17}
18pub type BS_W<'a, REG> = crate::BitWriter<'a, REG, BS0W>;
20impl<'a, REG> BS_W<'a, REG>
21where
22 REG: crate::Writable + crate::RegisterSpec,
23{
24 #[inline(always)]
26 pub fn set_(self) -> &'a mut crate::W<REG> {
27 self.variant(BS0W::Set)
28 }
29}
30#[cfg_attr(feature = "defmt", derive(defmt::Format))]
34#[derive(Clone, Copy, Debug, PartialEq, Eq)]
35pub enum BR0W {
36 Reset = 1,
38}
39impl From<BR0W> for bool {
40 #[inline(always)]
41 fn from(variant: BR0W) -> Self {
42 variant as u8 != 0
43 }
44}
45pub type BR_W<'a, REG> = crate::BitWriter<'a, REG, BR0W>;
47impl<'a, REG> BR_W<'a, REG>
48where
49 REG: crate::Writable + crate::RegisterSpec,
50{
51 #[inline(always)]
53 pub fn reset(self) -> &'a mut crate::W<REG> {
54 self.variant(BR0W::Reset)
55 }
56}
57impl core::fmt::Debug for crate::generic::Reg<BSRRrs> {
58 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
59 write!(f, "(not readable)")
60 }
61}
62impl W {
63 #[inline(always)]
67 pub fn bs(&mut self, n: u8) -> BS_W<BSRRrs> {
68 #[allow(clippy::no_effect)] [(); 16][n as usize];
69 BS_W::new(self, n)
70 }
71 #[inline(always)]
73 pub fn bs0(&mut self) -> BS_W<BSRRrs> {
74 BS_W::new(self, 0)
75 }
76 #[inline(always)]
78 pub fn bs1(&mut self) -> BS_W<BSRRrs> {
79 BS_W::new(self, 1)
80 }
81 #[inline(always)]
83 pub fn bs2(&mut self) -> BS_W<BSRRrs> {
84 BS_W::new(self, 2)
85 }
86 #[inline(always)]
88 pub fn bs3(&mut self) -> BS_W<BSRRrs> {
89 BS_W::new(self, 3)
90 }
91 #[inline(always)]
93 pub fn bs4(&mut self) -> BS_W<BSRRrs> {
94 BS_W::new(self, 4)
95 }
96 #[inline(always)]
98 pub fn bs5(&mut self) -> BS_W<BSRRrs> {
99 BS_W::new(self, 5)
100 }
101 #[inline(always)]
103 pub fn bs6(&mut self) -> BS_W<BSRRrs> {
104 BS_W::new(self, 6)
105 }
106 #[inline(always)]
108 pub fn bs7(&mut self) -> BS_W<BSRRrs> {
109 BS_W::new(self, 7)
110 }
111 #[inline(always)]
113 pub fn bs8(&mut self) -> BS_W<BSRRrs> {
114 BS_W::new(self, 8)
115 }
116 #[inline(always)]
118 pub fn bs9(&mut self) -> BS_W<BSRRrs> {
119 BS_W::new(self, 9)
120 }
121 #[inline(always)]
123 pub fn bs10(&mut self) -> BS_W<BSRRrs> {
124 BS_W::new(self, 10)
125 }
126 #[inline(always)]
128 pub fn bs11(&mut self) -> BS_W<BSRRrs> {
129 BS_W::new(self, 11)
130 }
131 #[inline(always)]
133 pub fn bs12(&mut self) -> BS_W<BSRRrs> {
134 BS_W::new(self, 12)
135 }
136 #[inline(always)]
138 pub fn bs13(&mut self) -> BS_W<BSRRrs> {
139 BS_W::new(self, 13)
140 }
141 #[inline(always)]
143 pub fn bs14(&mut self) -> BS_W<BSRRrs> {
144 BS_W::new(self, 14)
145 }
146 #[inline(always)]
148 pub fn bs15(&mut self) -> BS_W<BSRRrs> {
149 BS_W::new(self, 15)
150 }
151 #[inline(always)]
155 pub fn br(&mut self, n: u8) -> BR_W<BSRRrs> {
156 #[allow(clippy::no_effect)] [(); 16][n as usize];
157 BR_W::new(self, n + 16)
158 }
159 #[inline(always)]
161 pub fn br0(&mut self) -> BR_W<BSRRrs> {
162 BR_W::new(self, 16)
163 }
164 #[inline(always)]
166 pub fn br1(&mut self) -> BR_W<BSRRrs> {
167 BR_W::new(self, 17)
168 }
169 #[inline(always)]
171 pub fn br2(&mut self) -> BR_W<BSRRrs> {
172 BR_W::new(self, 18)
173 }
174 #[inline(always)]
176 pub fn br3(&mut self) -> BR_W<BSRRrs> {
177 BR_W::new(self, 19)
178 }
179 #[inline(always)]
181 pub fn br4(&mut self) -> BR_W<BSRRrs> {
182 BR_W::new(self, 20)
183 }
184 #[inline(always)]
186 pub fn br5(&mut self) -> BR_W<BSRRrs> {
187 BR_W::new(self, 21)
188 }
189 #[inline(always)]
191 pub fn br6(&mut self) -> BR_W<BSRRrs> {
192 BR_W::new(self, 22)
193 }
194 #[inline(always)]
196 pub fn br7(&mut self) -> BR_W<BSRRrs> {
197 BR_W::new(self, 23)
198 }
199 #[inline(always)]
201 pub fn br8(&mut self) -> BR_W<BSRRrs> {
202 BR_W::new(self, 24)
203 }
204 #[inline(always)]
206 pub fn br9(&mut self) -> BR_W<BSRRrs> {
207 BR_W::new(self, 25)
208 }
209 #[inline(always)]
211 pub fn br10(&mut self) -> BR_W<BSRRrs> {
212 BR_W::new(self, 26)
213 }
214 #[inline(always)]
216 pub fn br11(&mut self) -> BR_W<BSRRrs> {
217 BR_W::new(self, 27)
218 }
219 #[inline(always)]
221 pub fn br12(&mut self) -> BR_W<BSRRrs> {
222 BR_W::new(self, 28)
223 }
224 #[inline(always)]
226 pub fn br13(&mut self) -> BR_W<BSRRrs> {
227 BR_W::new(self, 29)
228 }
229 #[inline(always)]
231 pub fn br14(&mut self) -> BR_W<BSRRrs> {
232 BR_W::new(self, 30)
233 }
234 #[inline(always)]
236 pub fn br15(&mut self) -> BR_W<BSRRrs> {
237 BR_W::new(self, 31)
238 }
239}
240pub struct BSRRrs;
246impl crate::RegisterSpec for BSRRrs {
247 type Ux = u32;
248}
249impl crate::Writable for BSRRrs {
251 type Safety = crate::Unsafe;
252 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
253 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
254}
255impl crate::Resettable for BSRRrs {
257 const RESET_VALUE: u32 = 0;
258}