aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embassy-stm32/gen.py9
-rw-r--r--embassy-stm32/src/i2c/mod.rs58
-rw-r--r--embassy-stm32/src/i2c/v2.rs494
-rw-r--r--embassy-stm32/src/lib.rs2
-rw-r--r--embassy-stm32/src/pac/regs.rs35234
-rw-r--r--embassy-stm32/src/pac/stm32h723ve.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h723vg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h723ze.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h723zg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725ae.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725ag.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725ie.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725ig.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725re.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h725rg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h725ve.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725vg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725ze.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h725zg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h730ab.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h730ib.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h730vb.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h730zb.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h733vg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h733zg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h735ag.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h735ig.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h735rg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h735vg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h735zg.rs35
-rw-r--r--embassy-stm32/src/pac/stm32h742ag.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742bg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742ig.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742vg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742vi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742xg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742zg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h742zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743ag.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743bg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743ig.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743vg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743vi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743xg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743zg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h743zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745bg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745ig.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745xg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745zg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h745zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747ag.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747bg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747ig.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747xg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h747zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h750ib.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h750vb.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h750xb.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h750zb.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h753ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h753bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h753ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h753vi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h753xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h753zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h755bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h755ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h755xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h755zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h757ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h757bi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h757ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h757xi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h757zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ag.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ig.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3lg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3li.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ng.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ni.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3qi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3rg.rs21
-rw-r--r--embassy-stm32/src/pac/stm32h7a3ri.rs21
-rw-r--r--embassy-stm32/src/pac/stm32h7a3vg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3vi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3zg.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7a3zi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b0ab.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b0ib.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b0rb.rs21
-rw-r--r--embassy-stm32/src/pac/stm32h7b0vb.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b0zb.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3ai.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3ii.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3li.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3ni.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3qi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3ri.rs21
-rw-r--r--embassy-stm32/src/pac/stm32h7b3vi.rs28
-rw-r--r--embassy-stm32/src/pac/stm32h7b3zi.rs28
118 files changed, 21470 insertions, 17617 deletions
diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py
index ee1b2677f..97beadab2 100644
--- a/embassy-stm32/gen.py
+++ b/embassy-stm32/gen.py
@@ -137,6 +137,15 @@ for chip in chips.values():
137 if func := funcs.get(f'{name}_MISO'): 137 if func := funcs.get(f'{name}_MISO'):
138 f.write(f'impl_spi_pin!({name}, MisoPin, {pin}, {func});') 138 f.write(f'impl_spi_pin!({name}, MisoPin, {pin}, {func});')
139 139
140 if block_mod == 'i2c':
141 f.write(f'impl_i2c!({name});')
142 for pin, funcs in af.items():
143 if pin in pins:
144 if func := funcs.get(f'{name}_SCL'):
145 f.write(f'impl_i2c_pin!({name}, SclPin, {pin}, {func});')
146 if func := funcs.get(f'{name}_SDA'):
147 f.write(f'impl_i2c_pin!({name}, SdaPin, {pin}, {func});')
148
140 if block_mod == 'gpio': 149 if block_mod == 'gpio':
141 custom_singletons = True 150 custom_singletons = True
142 port = name[4:] 151 port = name[4:]
diff --git a/embassy-stm32/src/i2c/mod.rs b/embassy-stm32/src/i2c/mod.rs
new file mode 100644
index 000000000..ed0eaf387
--- /dev/null
+++ b/embassy-stm32/src/i2c/mod.rs
@@ -0,0 +1,58 @@
1#![macro_use]
2
3#[cfg_attr(feature = "_i2c_v2", path = "v2.rs")]
4mod _version;
5pub use _version::*;
6
7pub enum Error {
8 Bus,
9 Arbitration,
10 Nack,
11}
12
13pub(crate) mod sealed {
14 use super::*;
15 use crate::gpio::Pin;
16
17 pub trait Instance {
18 fn regs() -> &'static crate::pac::i2c::I2c;
19 }
20
21 pub trait SclPin<T: Instance>: Pin {
22 fn af_num(&self) -> u8;
23 }
24
25 pub trait SdaPin<T: Instance>: Pin {
26 fn af_num(&self) -> u8;
27 }
28}
29
30pub trait Instance: sealed::Instance + 'static {}
31
32pub trait SclPin<T: Instance>: sealed::SclPin<T> + 'static {}
33
34pub trait SdaPin<T: Instance>: sealed::SdaPin<T> + 'static {}
35
36macro_rules! impl_i2c {
37 ($inst:ident) => {
38 impl crate::i2c::sealed::Instance for peripherals::$inst {
39 fn regs() -> &'static crate::pac::i2c::I2c {
40 &crate::pac::$inst
41 }
42 }
43
44 impl crate::i2c::Instance for peripherals::$inst {}
45 };
46}
47
48macro_rules! impl_i2c_pin {
49 ($inst:ident, $pin_func:ident, $pin:ident, $af:expr) => {
50 impl crate::i2c::$pin_func<peripherals::$inst> for peripherals::$pin {}
51
52 impl crate::i2c::sealed::$pin_func<peripherals::$inst> for peripherals::$pin {
53 fn af_num(&self) -> u8 {
54 $af
55 }
56 }
57 };
58}
diff --git a/embassy-stm32/src/i2c/v2.rs b/embassy-stm32/src/i2c/v2.rs
new file mode 100644
index 000000000..c93d23291
--- /dev/null
+++ b/embassy-stm32/src/i2c/v2.rs
@@ -0,0 +1,494 @@
1use crate::gpio::AnyPin;
2use crate::gpio::Pin;
3use crate::i2c::{Error, Instance, SclPin, SdaPin};
4use crate::time::Hertz;
5use core::marker::PhantomData;
6use embassy::util::Unborrow;
7use embassy_extras::unborrow;
8use embedded_hal::blocking::i2c::Read;
9use embedded_hal::blocking::i2c::Write;
10use embedded_hal::blocking::i2c::WriteRead;
11
12use crate::pac::i2c;
13use crate::pac::i2c::I2c as I2cTrait;
14use core::cmp;
15
16use crate::pac::gpio::vals::{Afr, Moder, Ot};
17use crate::pac::gpio::Gpio;
18use crate::pac::regs::gpio_v1::vals::Cnf;
19
20pub struct I2c<'d, T: Instance> {
21 //peri: T,
22 scl: AnyPin,
23 sda: AnyPin,
24 phantom: PhantomData<&'d mut T>,
25}
26
27impl<'d, T: Instance> I2c<'d, T> {
28 pub fn new<F>(
29 pclk: Hertz,
30 peri: impl Unborrow<Target = T> + 'd,
31 scl: impl Unborrow<Target = impl SclPin<T>>,
32 sda: impl Unborrow<Target = impl SdaPin<T>>,
33 freq: F,
34 ) -> Self
35 where
36 F: Into<Hertz>,
37 {
38 unborrow!(peri);
39 unborrow!(scl, sda);
40
41 unsafe {
42 Self::configure_pin(scl.block(), scl.pin() as _, scl.af_num());
43 Self::configure_pin(sda.block(), sda.pin() as _, sda.af_num());
44 }
45
46 unsafe {
47 T::regs().cr1().modify(|reg| {
48 reg.set_pe(false);
49 reg.set_anfoff(false);
50 });
51 }
52
53 let timings = Timings::new(pclk, freq.into());
54
55 unsafe {
56 T::regs().timingr().write(|reg| {
57 reg.set_presc(timings.prescale);
58 reg.set_scll(timings.scll);
59 reg.set_sclh(timings.sclh);
60 reg.set_sdadel(timings.sdadel);
61 reg.set_scldel(timings.scldel);
62 });
63 }
64
65 let scl = scl.degrade();
66 let sda = sda.degrade();
67
68 unsafe {
69 T::regs().cr1().modify(|reg| {
70 reg.set_pe(true);
71 });
72 }
73
74 Self {
75 scl,
76 sda,
77 phantom: PhantomData,
78 }
79 }
80
81 unsafe fn configure_pin(block: Gpio, pin: usize, af_num: u8) {
82 let (afr, n_af) = if pin < 8 { (0, pin) } else { (1, pin - 8) };
83 block.moder().modify(|w| w.set_moder(pin, Moder::ALTERNATE));
84 block.afr(afr).modify(|w| w.set_afr(n_af, Afr(af_num)));
85 block.otyper().modify(|w| w.set_ot(pin, Ot::OPENDRAIN));
86 //block
87 //.ospeedr()
88 //.modify(|w| w.set_ospeedr(pin, crate::pac::gpio::vals::Ospeedr::VERYHIGHSPEED));
89 }
90
91 fn master_stop(&mut self) {
92 unsafe {
93 T::regs().cr2().write(|w| w.set_stop(i2c::vals::Stop::STOP));
94 }
95 }
96
97 fn master_read(&mut self, address: u8, length: usize, stop: Stop) {
98 assert!(length < 256 && length > 0);
99
100 // Wait for any previous address sequence to end
101 // automatically. This could be up to 50% of a bus
102 // cycle (ie. up to 0.5/freq)
103 while unsafe { T::regs().cr2().read().start() == i2c::vals::Start::START } {}
104
105 // Set START and prepare to receive bytes into
106 // `buffer`. The START bit can be set even if the bus
107 // is BUSY or I2C is in slave mode.
108
109 unsafe {
110 T::regs().cr2().modify(|w| {
111 w.set_sadd((address << 1 | 0) as u16);
112 w.set_rd_wrn(i2c::vals::RdWrn::READ);
113 w.set_nbytes(length as u8);
114 w.set_start(i2c::vals::Start::START);
115 w.set_autoend(i2c::vals::Autoend::AUTOMATIC);
116 });
117 }
118 }
119
120 fn master_write(&mut self, address: u8, length: usize, stop: Stop) {
121 assert!(length < 256 && length > 0);
122
123 // Wait for any previous address sequence to end
124 // automatically. This could be up to 50% of a bus
125 // cycle (ie. up to 0.5/freq)
126 while unsafe { T::regs().cr2().read().start() == i2c::vals::Start::START } {}
127
128 // Set START and prepare to send `bytes`. The
129 // START bit can be set even if the bus is BUSY or
130 // I2C is in slave mode.
131 unsafe {
132 T::regs().cr2().modify(|w| {
133 w.set_sadd((address << 1 | 0) as u16);
134 w.set_add10(i2c::vals::Add::BIT7);
135 w.set_rd_wrn(i2c::vals::RdWrn::WRITE);
136 w.set_nbytes(length as u8);
137 w.set_start(i2c::vals::Start::START);
138 w.set_autoend(stop.autoend());
139 });
140 }
141 }
142
143 fn master_re_start(&mut self, address: u8, length: usize, stop: Stop) {
144 assert!(length < 256 && length > 0);
145
146 unsafe {
147 T::regs().cr2().modify(|w| {
148 w.set_sadd((address << 1 | 1) as u16);
149 w.set_add10(i2c::vals::Add::BIT7);
150 w.set_rd_wrn(i2c::vals::RdWrn::READ);
151 w.set_nbytes(length as u8);
152 w.set_start(i2c::vals::Start::START);
153 w.set_autoend(stop.autoend());
154 });
155 }
156 }
157
158 fn flush_txdr(&self) {
159 //if $i2c.isr.read().txis().bit_is_set() {
160 //$i2c.txdr.write(|w| w.txdata().bits(0));
161 //}
162
163 unsafe {
164 if T::regs().isr().read().txis() {
165 T::regs().txdr().write(|w| w.set_txdata(0));
166 }
167 if T::regs().isr().read().txe() {
168 T::regs().isr().modify(|w| w.set_txe(true))
169 }
170 }
171
172 // If TXDR is not flagged as empty, write 1 to flush it
173 //if $i2c.isr.read().txe().is_not_empty() {
174 //$i2c.isr.write(|w| w.txe().set_bit());
175 //}
176 }
177
178 fn wait_txe(&self) -> Result<(), Error> {
179 loop {
180 unsafe {
181 let isr = T::regs().isr().read();
182 if isr.txe() {
183 return Ok(());
184 } else if isr.berr() {
185 T::regs().icr().write(|reg| reg.set_berrcf(true));
186 return Err(Error::Bus);
187 } else if isr.arlo() {
188 T::regs().icr().write(|reg| reg.set_arlocf(true));
189 return Err(Error::Arbitration);
190 } else if isr.nackf() {
191 T::regs().icr().write(|reg| reg.set_nackcf(true));
192 self.flush_txdr();
193 return Err(Error::Nack);
194 }
195 }
196 }
197 }
198
199 fn wait_rxne(&self) -> Result<(), Error> {
200 loop {
201 unsafe {
202 let isr = T::regs().isr().read();
203 if isr.rxne() {
204 return Ok(());
205 } else if isr.berr() {
206 T::regs().icr().write(|reg| reg.set_berrcf(true));
207 return Err(Error::Bus);
208 } else if isr.arlo() {
209 T::regs().icr().write(|reg| reg.set_arlocf(true));
210 return Err(Error::Arbitration);
211 } else if isr.nackf() {
212 T::regs().icr().write(|reg| reg.set_nackcf(true));
213 self.flush_txdr();
214 return Err(Error::Nack);
215 }
216 }
217 }
218 }
219
220 fn wait_tc(&self) -> Result<(), Error> {
221 loop {
222 unsafe {
223 let isr = T::regs().isr().read();
224 if isr.tc() {
225 return Ok(());
226 } else if isr.berr() {
227 T::regs().icr().write(|reg| reg.set_berrcf(true));
228 return Err(Error::Bus);
229 } else if isr.arlo() {
230 T::regs().icr().write(|reg| reg.set_arlocf(true));
231 return Err(Error::Arbitration);
232 } else if isr.nackf() {
233 T::regs().icr().write(|reg| reg.set_nackcf(true));
234 self.flush_txdr();
235 return Err(Error::Nack);
236 }
237 }
238 }
239 }
240}
241
242impl<'d, T: Instance> Read for I2c<'d, T> {
243 type Error = Error;
244
245 fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error> {
246 assert!(buffer.len() < 256 && buffer.len() > 0);
247
248 self.master_read(address, buffer.len(), Stop::Automatic);
249
250 for byte in buffer {
251 // Wait until we have received something
252 self.wait_rxne()?;
253
254 //*byte = self.i2c.rxdr.read().rxdata().bits();
255 unsafe {
256 *byte = T::regs().rxdr().read().rxdata();
257 }
258 }
259
260 // automatic STOP
261 Ok(())
262 }
263}
264
265impl<'d, T: Instance> Write for I2c<'d, T> {
266 type Error = Error;
267
268 fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error> {
269 // TODO support transfers of more than 255 bytes
270 assert!(bytes.len() < 256 && bytes.len() > 0);
271
272 // I2C start
273 //
274 // ST SAD+W
275 self.master_write(address, bytes.len(), Stop::Software);
276
277 for byte in bytes {
278 // Wait until we are allowed to send data
279 // (START has been ACKed or last byte when
280 // through)
281 self.wait_txe()?;
282
283 // Put byte on the wire
284 //self.i2c.txdr.write(|w| w.txdata().bits(*byte));
285 unsafe {
286 T::regs().txdr().write(|w| w.set_txdata(*byte));
287 }
288 }
289
290 // Wait until the write finishes
291 self.wait_tc()?;
292
293 // Stop
294 self.master_stop();
295
296 Ok(())
297 }
298}
299
300impl<'d, T: Instance> WriteRead for I2c<'d, T> {
301 type Error = Error;
302
303 fn write_read(
304 &mut self,
305 address: u8,
306 bytes: &[u8],
307 buffer: &mut [u8],
308 ) -> Result<(), Self::Error> {
309 // TODO support transfers of more than 255 bytes
310 assert!(bytes.len() < 256 && bytes.len() > 0);
311 assert!(buffer.len() < 256 && buffer.len() > 0);
312
313 // I2C start
314 //
315 // ST SAD+W
316 self.master_write(address, bytes.len(), Stop::Software);
317
318 for byte in bytes {
319 // Wait until we are allowed to send data
320 // (START has been ACKed or last byte went through)
321 self.wait_txe()?;
322
323 // Put byte on the wire
324 //self.i2c.txdr.write(|w| w.txdata().bits(*byte));
325 unsafe {
326 T::regs().txdr().write(|w| w.set_txdata(*byte));
327 }
328 }
329
330 // Wait until the write finishes before beginning to read.
331 self.wait_tc()?;
332
333 // I2C re-start
334 //
335 // SR SAD+R
336 self.master_re_start(address, buffer.len(), Stop::Automatic);
337
338 for byte in buffer {
339 // Wait until we have received something
340 self.wait_rxne()?;
341
342 //*byte = self.i2c.rxdr.read().rxdata().bits();
343 unsafe {
344 *byte = T::regs().rxdr().read().rxdata();
345 }
346 }
347
348 // automatic STOP
349
350 Ok(())
351 }
352}
353
354/// I2C Stop Configuration
355///
356/// Peripheral options for generating the STOP condition
357#[derive(Copy, Clone, PartialEq)]
358pub enum Stop {
359 /// Software end mode: Must write register to generate STOP condition
360 Software,
361 /// Automatic end mode: A STOP condition is automatically generated once the
362 /// configured number of bytes have been transferred
363 Automatic,
364}
365
366impl Stop {
367 fn autoend(&self) -> i2c::vals::Autoend {
368 match self {
369 Stop::Software => i2c::vals::Autoend::SOFTWARE,
370 Stop::Automatic => i2c::vals::Autoend::AUTOMATIC,
371 }
372 }
373}
374
375struct Timings {
376 prescale: u8,
377 scll: u8,
378 sclh: u8,
379 sdadel: u8,
380 scldel: u8,
381}
382
383impl Timings {
384 fn new(i2cclk: Hertz, freq: Hertz) -> Self {
385 let i2cclk = i2cclk.0;
386 let freq = freq.0;
387 // Refer to RM0433 Rev 7 Figure 539 for setup and hold timing:
388 //
389 // t_I2CCLK = 1 / PCLK1
390 // t_PRESC = (PRESC + 1) * t_I2CCLK
391 // t_SCLL = (SCLL + 1) * t_PRESC
392 // t_SCLH = (SCLH + 1) * t_PRESC
393 //
394 // t_SYNC1 + t_SYNC2 > 4 * t_I2CCLK
395 // t_SCL ~= t_SYNC1 + t_SYNC2 + t_SCLL + t_SCLH
396 let ratio = i2cclk / freq;
397
398 // For the standard-mode configuration method, we must have a ratio of 4
399 // or higher
400 assert!(
401 ratio >= 4,
402 "The I2C PCLK must be at least 4 times the bus frequency!"
403 );
404
405 let (presc_reg, scll, sclh, sdadel, scldel) = if freq > 100_000 {
406 // Fast-mode (Fm) or Fast-mode Plus (Fm+)
407 // here we pick SCLL + 1 = 2 * (SCLH + 1)
408
409 // Prescaler, 384 ticks for sclh/scll. Round up then subtract 1
410 let presc_reg = ((ratio - 1) / 384) as u8;
411 // ratio < 1200 by pclk 120MHz max., therefore presc < 16
412
413 // Actual precale value selected
414 let presc = (presc_reg + 1) as u32;
415
416 let sclh = ((ratio / presc) - 3) / 3;
417 let scll = (2 * (sclh + 1)) - 1;
418
419 let (sdadel, scldel) = if freq > 400_000 {
420 // Fast-mode Plus (Fm+)
421 assert!(i2cclk >= 17_000_000); // See table in datsheet
422
423 let sdadel = i2cclk / 8_000_000 / presc;
424 let scldel = i2cclk / 4_000_000 / presc - 1;
425
426 (sdadel, scldel)
427 } else {
428 // Fast-mode (Fm)
429 assert!(i2cclk >= 8_000_000); // See table in datsheet
430
431 let sdadel = i2cclk / 4_000_000 / presc;
432 let scldel = i2cclk / 2_000_000 / presc - 1;
433
434 (sdadel, scldel)
435 };
436
437 (
438 presc_reg,
439 scll as u8,
440 sclh as u8,
441 sdadel as u8,
442 scldel as u8,
443 )
444 } else {
445 // Standard-mode (Sm)
446 // here we pick SCLL = SCLH
447 assert!(i2cclk >= 2_000_000); // See table in datsheet
448
449 // Prescaler, 512 ticks for sclh/scll. Round up then
450 // subtract 1
451 let presc = (ratio - 1) / 512;
452 let presc_reg = cmp::min(presc, 15) as u8;
453
454 // Actual prescale value selected
455 let presc = (presc_reg + 1) as u32;
456
457 let sclh = ((ratio / presc) - 2) / 2;
458 let scll = sclh;
459
460 // Speed check
461 assert!(
462 sclh < 256,
463 "The I2C PCLK is too fast for this bus frequency!"
464 );
465
466 let sdadel = i2cclk / 2_000_000 / presc;
467 let scldel = i2cclk / 500_000 / presc - 1;
468
469 (
470 presc_reg,
471 scll as u8,
472 sclh as u8,
473 sdadel as u8,
474 scldel as u8,
475 )
476 };
477
478 // Sanity check
479 assert!(presc_reg < 16);
480
481 // Keep values within reasonable limits for fast per_ck
482 let sdadel = cmp::max(sdadel, 2);
483 let scldel = cmp::max(scldel, 4);
484
485 //(presc_reg, scll, sclh, sdadel, scldel)
486 Self {
487 prescale: presc_reg,
488 scll,
489 sclh,
490 sdadel,
491 scldel,
492 }
493 }
494}
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs
index 250281f88..365b58f3c 100644
--- a/embassy-stm32/src/lib.rs
+++ b/embassy-stm32/src/lib.rs
@@ -15,6 +15,8 @@ pub mod clock;
15pub mod dma; 15pub mod dma;
16pub mod exti; 16pub mod exti;
17pub mod gpio; 17pub mod gpio;
18#[cfg(feature = "_i2c")]
19pub mod i2c;
18pub mod pwr; 20pub mod pwr;
19pub mod rcc; 21pub mod rcc;
20#[cfg(feature = "_rng")] 22#[cfg(feature = "_rng")]
diff --git a/embassy-stm32/src/pac/regs.rs b/embassy-stm32/src/pac/regs.rs
index d0f2f83ba..032728973 100644
--- a/embassy-stm32/src/pac/regs.rs
+++ b/embassy-stm32/src/pac/regs.rs
@@ -108,24 +108,73 @@ pub mod syscfg_h7 {
108 } 108 }
109 pub mod regs { 109 pub mod regs {
110 use crate::generic::*; 110 use crate::generic::*;
111 #[doc = "SYSCFG user register 12"] 111 #[doc = "SYSCFG user register 14"]
112 #[repr(transparent)] 112 #[repr(transparent)]
113 #[derive(Copy, Clone, Eq, PartialEq)] 113 #[derive(Copy, Clone, Eq, PartialEq)]
114 pub struct Ur12(pub u32); 114 pub struct Ur14(pub u32);
115 impl Ur12 { 115 impl Ur14 {
116 #[doc = "Secure mode"] 116 #[doc = "D1 Stop Reset"]
117 pub const fn secure(&self) -> bool { 117 pub const fn d1stprst(&self) -> bool {
118 let val = (self.0 >> 16usize) & 0x01; 118 let val = (self.0 >> 0usize) & 0x01;
119 val != 0 119 val != 0
120 } 120 }
121 #[doc = "Secure mode"] 121 #[doc = "D1 Stop Reset"]
122 pub fn set_secure(&mut self, val: bool) { 122 pub fn set_d1stprst(&mut self, val: bool) {
123 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 123 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
124 } 124 }
125 } 125 }
126 impl Default for Ur12 { 126 impl Default for Ur14 {
127 fn default() -> Ur12 { 127 fn default() -> Ur14 {
128 Ur12(0) 128 Ur14(0)
129 }
130 }
131 #[doc = "SYSCFG user register 9"]
132 #[repr(transparent)]
133 #[derive(Copy, Clone, Eq, PartialEq)]
134 pub struct Ur9(pub u32);
135 impl Ur9 {
136 #[doc = "Write protection for flash bank 2"]
137 pub const fn wrpn_2(&self) -> u8 {
138 let val = (self.0 >> 0usize) & 0xff;
139 val as u8
140 }
141 #[doc = "Write protection for flash bank 2"]
142 pub fn set_wrpn_2(&mut self, val: u8) {
143 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
144 }
145 #[doc = "Protected area start address for bank 2"]
146 pub const fn pa_beg_2(&self) -> u16 {
147 let val = (self.0 >> 16usize) & 0x0fff;
148 val as u16
149 }
150 #[doc = "Protected area start address for bank 2"]
151 pub fn set_pa_beg_2(&mut self, val: u16) {
152 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
153 }
154 }
155 impl Default for Ur9 {
156 fn default() -> Ur9 {
157 Ur9(0)
158 }
159 }
160 #[doc = "SYSCFG package register"]
161 #[repr(transparent)]
162 #[derive(Copy, Clone, Eq, PartialEq)]
163 pub struct Pkgr(pub u32);
164 impl Pkgr {
165 #[doc = "Package"]
166 pub const fn pkg(&self) -> u8 {
167 let val = (self.0 >> 0usize) & 0x0f;
168 val as u8
169 }
170 #[doc = "Package"]
171 pub fn set_pkg(&mut self, val: u8) {
172 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
173 }
174 }
175 impl Default for Pkgr {
176 fn default() -> Pkgr {
177 Pkgr(0)
129 } 178 }
130 } 179 }
131 #[doc = "SYSCFG user register 13"] 180 #[doc = "SYSCFG user register 13"]
@@ -157,228 +206,120 @@ pub mod syscfg_h7 {
157 Ur13(0) 206 Ur13(0)
158 } 207 }
159 } 208 }
160 #[doc = "SYSCFG user register 16"] 209 #[doc = "SYSCFG user register 7"]
161 #[repr(transparent)] 210 #[repr(transparent)]
162 #[derive(Copy, Clone, Eq, PartialEq)] 211 #[derive(Copy, Clone, Eq, PartialEq)]
163 pub struct Ur16(pub u32); 212 pub struct Ur7(pub u32);
164 impl Ur16 { 213 impl Ur7 {
165 #[doc = "Freeze independent watchdog in Stop mode"] 214 #[doc = "Secured area start address for bank 1"]
166 pub const fn fziwdgstp(&self) -> bool { 215 pub const fn sa_beg_1(&self) -> u16 {
167 let val = (self.0 >> 0usize) & 0x01; 216 let val = (self.0 >> 0usize) & 0x0fff;
168 val != 0 217 val as u16
169 } 218 }
170 #[doc = "Freeze independent watchdog in Stop mode"] 219 #[doc = "Secured area start address for bank 1"]
171 pub fn set_fziwdgstp(&mut self, val: bool) { 220 pub fn set_sa_beg_1(&mut self, val: u16) {
172 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 221 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
173 } 222 }
174 #[doc = "Private key programmed"] 223 #[doc = "Secured area end address for bank 1"]
175 pub const fn pkp(&self) -> bool { 224 pub const fn sa_end_1(&self) -> u16 {
176 let val = (self.0 >> 16usize) & 0x01; 225 let val = (self.0 >> 16usize) & 0x0fff;
177 val != 0 226 val as u16
178 } 227 }
179 #[doc = "Private key programmed"] 228 #[doc = "Secured area end address for bank 1"]
180 pub fn set_pkp(&mut self, val: bool) { 229 pub fn set_sa_end_1(&mut self, val: u16) {
181 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 230 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
182 } 231 }
183 } 232 }
184 impl Default for Ur16 { 233 impl Default for Ur7 {
185 fn default() -> Ur16 { 234 fn default() -> Ur7 {
186 Ur16(0) 235 Ur7(0)
187 } 236 }
188 } 237 }
189 #[doc = "SYSCFG power control register"] 238 #[doc = "SYSCFG user register 11"]
190 #[repr(transparent)] 239 #[repr(transparent)]
191 #[derive(Copy, Clone, Eq, PartialEq)] 240 #[derive(Copy, Clone, Eq, PartialEq)]
192 pub struct Pwrcr(pub u32); 241 pub struct Ur11(pub u32);
193 impl Pwrcr { 242 impl Ur11 {
194 #[doc = "Overdrive enable"] 243 #[doc = "Secured area end address for bank 2"]
195 pub const fn oden(&self) -> u8 { 244 pub const fn sa_end_2(&self) -> u16 {
196 let val = (self.0 >> 0usize) & 0x0f; 245 let val = (self.0 >> 0usize) & 0x0fff;
197 val as u8 246 val as u16
198 } 247 }
199 #[doc = "Overdrive enable"] 248 #[doc = "Secured area end address for bank 2"]
200 pub fn set_oden(&mut self, val: u8) { 249 pub fn set_sa_end_2(&mut self, val: u16) {
201 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 250 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
251 }
252 #[doc = "Independent Watchdog 1 mode"]
253 pub const fn iwdg1m(&self) -> bool {
254 let val = (self.0 >> 16usize) & 0x01;
255 val != 0
256 }
257 #[doc = "Independent Watchdog 1 mode"]
258 pub fn set_iwdg1m(&mut self, val: bool) {
259 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
202 } 260 }
203 } 261 }
204 impl Default for Pwrcr { 262 impl Default for Ur11 {
205 fn default() -> Pwrcr { 263 fn default() -> Ur11 {
206 Pwrcr(0) 264 Ur11(0)
207 } 265 }
208 } 266 }
209 #[doc = "peripheral mode configuration register"] 267 #[doc = "SYSCFG compensation cell value register"]
210 #[repr(transparent)] 268 #[repr(transparent)]
211 #[derive(Copy, Clone, Eq, PartialEq)] 269 #[derive(Copy, Clone, Eq, PartialEq)]
212 pub struct Pmcr(pub u32); 270 pub struct Ccvr(pub u32);
213 impl Pmcr { 271 impl Ccvr {
214 #[doc = "I2C1 Fm+"] 272 #[doc = "NMOS compensation value"]
215 pub const fn i2c1fmp(&self) -> bool { 273 pub const fn ncv(&self) -> u8 {
216 let val = (self.0 >> 0usize) & 0x01; 274 let val = (self.0 >> 0usize) & 0x0f;
217 val != 0
218 }
219 #[doc = "I2C1 Fm+"]
220 pub fn set_i2c1fmp(&mut self, val: bool) {
221 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
222 }
223 #[doc = "I2C2 Fm+"]
224 pub const fn i2c2fmp(&self) -> bool {
225 let val = (self.0 >> 1usize) & 0x01;
226 val != 0
227 }
228 #[doc = "I2C2 Fm+"]
229 pub fn set_i2c2fmp(&mut self, val: bool) {
230 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
231 }
232 #[doc = "I2C3 Fm+"]
233 pub const fn i2c3fmp(&self) -> bool {
234 let val = (self.0 >> 2usize) & 0x01;
235 val != 0
236 }
237 #[doc = "I2C3 Fm+"]
238 pub fn set_i2c3fmp(&mut self, val: bool) {
239 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
240 }
241 #[doc = "I2C4 Fm+"]
242 pub const fn i2c4fmp(&self) -> bool {
243 let val = (self.0 >> 3usize) & 0x01;
244 val != 0
245 }
246 #[doc = "I2C4 Fm+"]
247 pub fn set_i2c4fmp(&mut self, val: bool) {
248 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
249 }
250 #[doc = "PB(6) Fm+"]
251 pub const fn pb6fmp(&self) -> bool {
252 let val = (self.0 >> 4usize) & 0x01;
253 val != 0
254 }
255 #[doc = "PB(6) Fm+"]
256 pub fn set_pb6fmp(&mut self, val: bool) {
257 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
258 }
259 #[doc = "PB(7) Fast Mode Plus"]
260 pub const fn pb7fmp(&self) -> bool {
261 let val = (self.0 >> 5usize) & 0x01;
262 val != 0
263 }
264 #[doc = "PB(7) Fast Mode Plus"]
265 pub fn set_pb7fmp(&mut self, val: bool) {
266 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
267 }
268 #[doc = "PB(8) Fast Mode Plus"]
269 pub const fn pb8fmp(&self) -> bool {
270 let val = (self.0 >> 6usize) & 0x01;
271 val != 0
272 }
273 #[doc = "PB(8) Fast Mode Plus"]
274 pub fn set_pb8fmp(&mut self, val: bool) {
275 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
276 }
277 #[doc = "PB(9) Fm+"]
278 pub const fn pb9fmp(&self) -> bool {
279 let val = (self.0 >> 7usize) & 0x01;
280 val != 0
281 }
282 #[doc = "PB(9) Fm+"]
283 pub fn set_pb9fmp(&mut self, val: bool) {
284 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
285 }
286 #[doc = "Booster Enable"]
287 pub const fn booste(&self) -> bool {
288 let val = (self.0 >> 8usize) & 0x01;
289 val != 0
290 }
291 #[doc = "Booster Enable"]
292 pub fn set_booste(&mut self, val: bool) {
293 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
294 }
295 #[doc = "Analog switch supply voltage selection"]
296 pub const fn boostvddsel(&self) -> bool {
297 let val = (self.0 >> 9usize) & 0x01;
298 val != 0
299 }
300 #[doc = "Analog switch supply voltage selection"]
301 pub fn set_boostvddsel(&mut self, val: bool) {
302 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
303 }
304 #[doc = "Ethernet PHY Interface Selection"]
305 pub const fn epis(&self) -> u8 {
306 let val = (self.0 >> 21usize) & 0x07;
307 val as u8 275 val as u8
308 } 276 }
309 #[doc = "Ethernet PHY Interface Selection"] 277 #[doc = "NMOS compensation value"]
310 pub fn set_epis(&mut self, val: u8) { 278 pub fn set_ncv(&mut self, val: u8) {
311 self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize); 279 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
312 }
313 #[doc = "PA0 Switch Open"]
314 pub const fn pa0so(&self) -> bool {
315 let val = (self.0 >> 24usize) & 0x01;
316 val != 0
317 }
318 #[doc = "PA0 Switch Open"]
319 pub fn set_pa0so(&mut self, val: bool) {
320 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
321 }
322 #[doc = "PA1 Switch Open"]
323 pub const fn pa1so(&self) -> bool {
324 let val = (self.0 >> 25usize) & 0x01;
325 val != 0
326 }
327 #[doc = "PA1 Switch Open"]
328 pub fn set_pa1so(&mut self, val: bool) {
329 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
330 }
331 #[doc = "PC2 Switch Open"]
332 pub const fn pc2so(&self) -> bool {
333 let val = (self.0 >> 26usize) & 0x01;
334 val != 0
335 }
336 #[doc = "PC2 Switch Open"]
337 pub fn set_pc2so(&mut self, val: bool) {
338 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
339 } 280 }
340 #[doc = "PC3 Switch Open"] 281 #[doc = "PMOS compensation value"]
341 pub const fn pc3so(&self) -> bool { 282 pub const fn pcv(&self) -> u8 {
342 let val = (self.0 >> 27usize) & 0x01; 283 let val = (self.0 >> 4usize) & 0x0f;
343 val != 0 284 val as u8
344 } 285 }
345 #[doc = "PC3 Switch Open"] 286 #[doc = "PMOS compensation value"]
346 pub fn set_pc3so(&mut self, val: bool) { 287 pub fn set_pcv(&mut self, val: u8) {
347 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); 288 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
348 } 289 }
349 } 290 }
350 impl Default for Pmcr { 291 impl Default for Ccvr {
351 fn default() -> Pmcr { 292 fn default() -> Ccvr {
352 Pmcr(0) 293 Ccvr(0)
353 } 294 }
354 } 295 }
355 #[doc = "SYSCFG user register 2"] 296 #[doc = "SYSCFG user register 0"]
356 #[repr(transparent)] 297 #[repr(transparent)]
357 #[derive(Copy, Clone, Eq, PartialEq)] 298 #[derive(Copy, Clone, Eq, PartialEq)]
358 pub struct Ur2(pub u32); 299 pub struct Ur0(pub u32);
359 impl Ur2 { 300 impl Ur0 {
360 #[doc = "BOR_LVL Brownout Reset Threshold Level"] 301 #[doc = "Bank Swap"]
361 pub const fn borh(&self) -> u8 { 302 pub const fn bks(&self) -> bool {
362 let val = (self.0 >> 0usize) & 0x03; 303 let val = (self.0 >> 0usize) & 0x01;
363 val as u8 304 val != 0
364 } 305 }
365 #[doc = "BOR_LVL Brownout Reset Threshold Level"] 306 #[doc = "Bank Swap"]
366 pub fn set_borh(&mut self, val: u8) { 307 pub fn set_bks(&mut self, val: bool) {
367 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize); 308 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
368 } 309 }
369 #[doc = "Boot Address 0"] 310 #[doc = "Readout protection"]
370 pub const fn boot_add0(&self) -> u16 { 311 pub const fn rdp(&self) -> u8 {
371 let val = (self.0 >> 16usize) & 0xffff; 312 let val = (self.0 >> 16usize) & 0xff;
372 val as u16 313 val as u8
373 } 314 }
374 #[doc = "Boot Address 0"] 315 #[doc = "Readout protection"]
375 pub fn set_boot_add0(&mut self, val: u16) { 316 pub fn set_rdp(&mut self, val: u8) {
376 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); 317 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
377 } 318 }
378 } 319 }
379 impl Default for Ur2 { 320 impl Default for Ur0 {
380 fn default() -> Ur2 { 321 fn default() -> Ur0 {
381 Ur2(0) 322 Ur0(0)
382 } 323 }
383 } 324 }
384 #[doc = "SYSCFG user register 5"] 325 #[doc = "SYSCFG user register 5"]
@@ -410,95 +351,6 @@ pub mod syscfg_h7 {
410 Ur5(0) 351 Ur5(0)
411 } 352 }
412 } 353 }
413 #[doc = "SYSCFG user register 3"]
414 #[repr(transparent)]
415 #[derive(Copy, Clone, Eq, PartialEq)]
416 pub struct Ur3(pub u32);
417 impl Ur3 {
418 #[doc = "Boot Address 1"]
419 pub const fn boot_add1(&self) -> u16 {
420 let val = (self.0 >> 16usize) & 0xffff;
421 val as u16
422 }
423 #[doc = "Boot Address 1"]
424 pub fn set_boot_add1(&mut self, val: u16) {
425 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
426 }
427 }
428 impl Default for Ur3 {
429 fn default() -> Ur3 {
430 Ur3(0)
431 }
432 }
433 #[doc = "SYSCFG user register 14"]
434 #[repr(transparent)]
435 #[derive(Copy, Clone, Eq, PartialEq)]
436 pub struct Ur14(pub u32);
437 impl Ur14 {
438 #[doc = "D1 Stop Reset"]
439 pub const fn d1stprst(&self) -> bool {
440 let val = (self.0 >> 0usize) & 0x01;
441 val != 0
442 }
443 #[doc = "D1 Stop Reset"]
444 pub fn set_d1stprst(&mut self, val: bool) {
445 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
446 }
447 }
448 impl Default for Ur14 {
449 fn default() -> Ur14 {
450 Ur14(0)
451 }
452 }
453 #[doc = "SYSCFG user register 6"]
454 #[repr(transparent)]
455 #[derive(Copy, Clone, Eq, PartialEq)]
456 pub struct Ur6(pub u32);
457 impl Ur6 {
458 #[doc = "Protected area start address for bank 1"]
459 pub const fn pa_beg_1(&self) -> u16 {
460 let val = (self.0 >> 0usize) & 0x0fff;
461 val as u16
462 }
463 #[doc = "Protected area start address for bank 1"]
464 pub fn set_pa_beg_1(&mut self, val: u16) {
465 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
466 }
467 #[doc = "Protected area end address for bank 1"]
468 pub const fn pa_end_1(&self) -> u16 {
469 let val = (self.0 >> 16usize) & 0x0fff;
470 val as u16
471 }
472 #[doc = "Protected area end address for bank 1"]
473 pub fn set_pa_end_1(&mut self, val: u16) {
474 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
475 }
476 }
477 impl Default for Ur6 {
478 fn default() -> Ur6 {
479 Ur6(0)
480 }
481 }
482 #[doc = "SYSCFG package register"]
483 #[repr(transparent)]
484 #[derive(Copy, Clone, Eq, PartialEq)]
485 pub struct Pkgr(pub u32);
486 impl Pkgr {
487 #[doc = "Package"]
488 pub const fn pkg(&self) -> u8 {
489 let val = (self.0 >> 0usize) & 0x0f;
490 val as u8
491 }
492 #[doc = "Package"]
493 pub fn set_pkg(&mut self, val: u8) {
494 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
495 }
496 }
497 impl Default for Pkgr {
498 fn default() -> Pkgr {
499 Pkgr(0)
500 }
501 }
502 #[doc = "SYSCFG user register 8"] 354 #[doc = "SYSCFG user register 8"]
503 #[repr(transparent)] 355 #[repr(transparent)]
504 #[derive(Copy, Clone, Eq, PartialEq)] 356 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -557,126 +409,82 @@ pub mod syscfg_h7 {
557 Cccr(0) 409 Cccr(0)
558 } 410 }
559 } 411 }
560 #[doc = "SYSCFG user register 11"] 412 #[doc = "SYSCFG user register 6"]
561 #[repr(transparent)] 413 #[repr(transparent)]
562 #[derive(Copy, Clone, Eq, PartialEq)] 414 #[derive(Copy, Clone, Eq, PartialEq)]
563 pub struct Ur11(pub u32); 415 pub struct Ur6(pub u32);
564 impl Ur11 { 416 impl Ur6 {
565 #[doc = "Secured area end address for bank 2"] 417 #[doc = "Protected area start address for bank 1"]
566 pub const fn sa_end_2(&self) -> u16 { 418 pub const fn pa_beg_1(&self) -> u16 {
567 let val = (self.0 >> 0usize) & 0x0fff; 419 let val = (self.0 >> 0usize) & 0x0fff;
568 val as u16 420 val as u16
569 } 421 }
570 #[doc = "Secured area end address for bank 2"] 422 #[doc = "Protected area start address for bank 1"]
571 pub fn set_sa_end_2(&mut self, val: u16) { 423 pub fn set_pa_beg_1(&mut self, val: u16) {
572 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 424 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
573 } 425 }
574 #[doc = "Independent Watchdog 1 mode"] 426 #[doc = "Protected area end address for bank 1"]
575 pub const fn iwdg1m(&self) -> bool { 427 pub const fn pa_end_1(&self) -> u16 {
576 let val = (self.0 >> 16usize) & 0x01; 428 let val = (self.0 >> 16usize) & 0x0fff;
577 val != 0 429 val as u16
578 }
579 #[doc = "Independent Watchdog 1 mode"]
580 pub fn set_iwdg1m(&mut self, val: bool) {
581 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
582 }
583 }
584 impl Default for Ur11 {
585 fn default() -> Ur11 {
586 Ur11(0)
587 }
588 }
589 #[doc = "SYSCFG user register 0"]
590 #[repr(transparent)]
591 #[derive(Copy, Clone, Eq, PartialEq)]
592 pub struct Ur0(pub u32);
593 impl Ur0 {
594 #[doc = "Bank Swap"]
595 pub const fn bks(&self) -> bool {
596 let val = (self.0 >> 0usize) & 0x01;
597 val != 0
598 }
599 #[doc = "Bank Swap"]
600 pub fn set_bks(&mut self, val: bool) {
601 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
602 }
603 #[doc = "Readout protection"]
604 pub const fn rdp(&self) -> u8 {
605 let val = (self.0 >> 16usize) & 0xff;
606 val as u8
607 } 430 }
608 #[doc = "Readout protection"] 431 #[doc = "Protected area end address for bank 1"]
609 pub fn set_rdp(&mut self, val: u8) { 432 pub fn set_pa_end_1(&mut self, val: u16) {
610 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); 433 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
611 } 434 }
612 } 435 }
613 impl Default for Ur0 { 436 impl Default for Ur6 {
614 fn default() -> Ur0 { 437 fn default() -> Ur6 {
615 Ur0(0) 438 Ur6(0)
616 } 439 }
617 } 440 }
618 #[doc = "SYSCFG user register 4"] 441 #[doc = "SYSCFG user register 10"]
619 #[repr(transparent)] 442 #[repr(transparent)]
620 #[derive(Copy, Clone, Eq, PartialEq)] 443 #[derive(Copy, Clone, Eq, PartialEq)]
621 pub struct Ur4(pub u32); 444 pub struct Ur10(pub u32);
622 impl Ur4 { 445 impl Ur10 {
623 #[doc = "Mass Erase Protected Area Disabled for bank 1"] 446 #[doc = "Protected area end address for bank 2"]
624 pub const fn mepad_1(&self) -> bool { 447 pub const fn pa_end_2(&self) -> u16 {
625 let val = (self.0 >> 16usize) & 0x01; 448 let val = (self.0 >> 0usize) & 0x0fff;
626 val != 0 449 val as u16
627 }
628 #[doc = "Mass Erase Protected Area Disabled for bank 1"]
629 pub fn set_mepad_1(&mut self, val: bool) {
630 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
631 } 450 }
632 } 451 #[doc = "Protected area end address for bank 2"]
633 impl Default for Ur4 { 452 pub fn set_pa_end_2(&mut self, val: u16) {
634 fn default() -> Ur4 { 453 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
635 Ur4(0)
636 } 454 }
637 } 455 #[doc = "Secured area start address for bank 2"]
638 #[doc = "SYSCFG user register 17"] 456 pub const fn sa_beg_2(&self) -> u16 {
639 #[repr(transparent)] 457 let val = (self.0 >> 16usize) & 0x0fff;
640 #[derive(Copy, Clone, Eq, PartialEq)] 458 val as u16
641 pub struct Ur17(pub u32);
642 impl Ur17 {
643 #[doc = "I/O high speed / low voltage"]
644 pub const fn io_hslv(&self) -> bool {
645 let val = (self.0 >> 0usize) & 0x01;
646 val != 0
647 } 459 }
648 #[doc = "I/O high speed / low voltage"] 460 #[doc = "Secured area start address for bank 2"]
649 pub fn set_io_hslv(&mut self, val: bool) { 461 pub fn set_sa_beg_2(&mut self, val: u16) {
650 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 462 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
651 } 463 }
652 } 464 }
653 impl Default for Ur17 { 465 impl Default for Ur10 {
654 fn default() -> Ur17 { 466 fn default() -> Ur10 {
655 Ur17(0) 467 Ur10(0)
656 } 468 }
657 } 469 }
658 #[doc = "external interrupt configuration register 2"] 470 #[doc = "SYSCFG user register 3"]
659 #[repr(transparent)] 471 #[repr(transparent)]
660 #[derive(Copy, Clone, Eq, PartialEq)] 472 #[derive(Copy, Clone, Eq, PartialEq)]
661 pub struct Exticr(pub u32); 473 pub struct Ur3(pub u32);
662 impl Exticr { 474 impl Ur3 {
663 #[doc = "EXTI x configuration (x = 4 to 7)"] 475 #[doc = "Boot Address 1"]
664 pub fn exti(&self, n: usize) -> u8 { 476 pub const fn boot_add1(&self) -> u16 {
665 assert!(n < 4usize); 477 let val = (self.0 >> 16usize) & 0xffff;
666 let offs = 0usize + n * 4usize; 478 val as u16
667 let val = (self.0 >> offs) & 0x0f;
668 val as u8
669 } 479 }
670 #[doc = "EXTI x configuration (x = 4 to 7)"] 480 #[doc = "Boot Address 1"]
671 pub fn set_exti(&mut self, n: usize, val: u8) { 481 pub fn set_boot_add1(&mut self, val: u16) {
672 assert!(n < 4usize); 482 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
673 let offs = 0usize + n * 4usize;
674 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
675 } 483 }
676 } 484 }
677 impl Default for Exticr { 485 impl Default for Ur3 {
678 fn default() -> Exticr { 486 fn default() -> Ur3 {
679 Exticr(0) 487 Ur3(0)
680 } 488 }
681 } 489 }
682 #[doc = "compensation cell control/status register"] 490 #[doc = "compensation cell control/status register"]
@@ -726,62 +534,117 @@ pub mod syscfg_h7 {
726 Cccsr(0) 534 Cccsr(0)
727 } 535 }
728 } 536 }
729 #[doc = "SYSCFG user register 10"] 537 #[doc = "SYSCFG user register 12"]
730 #[repr(transparent)] 538 #[repr(transparent)]
731 #[derive(Copy, Clone, Eq, PartialEq)] 539 #[derive(Copy, Clone, Eq, PartialEq)]
732 pub struct Ur10(pub u32); 540 pub struct Ur12(pub u32);
733 impl Ur10 { 541 impl Ur12 {
734 #[doc = "Protected area end address for bank 2"] 542 #[doc = "Secure mode"]
735 pub const fn pa_end_2(&self) -> u16 { 543 pub const fn secure(&self) -> bool {
736 let val = (self.0 >> 0usize) & 0x0fff; 544 let val = (self.0 >> 16usize) & 0x01;
737 val as u16 545 val != 0
738 } 546 }
739 #[doc = "Protected area end address for bank 2"] 547 #[doc = "Secure mode"]
740 pub fn set_pa_end_2(&mut self, val: u16) { 548 pub fn set_secure(&mut self, val: bool) {
741 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 549 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
742 } 550 }
743 #[doc = "Secured area start address for bank 2"] 551 }
744 pub const fn sa_beg_2(&self) -> u16 { 552 impl Default for Ur12 {
745 let val = (self.0 >> 16usize) & 0x0fff; 553 fn default() -> Ur12 {
746 val as u16 554 Ur12(0)
747 } 555 }
748 #[doc = "Secured area start address for bank 2"] 556 }
749 pub fn set_sa_beg_2(&mut self, val: u16) { 557 #[doc = "SYSCFG user register 4"]
750 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); 558 #[repr(transparent)]
559 #[derive(Copy, Clone, Eq, PartialEq)]
560 pub struct Ur4(pub u32);
561 impl Ur4 {
562 #[doc = "Mass Erase Protected Area Disabled for bank 1"]
563 pub const fn mepad_1(&self) -> bool {
564 let val = (self.0 >> 16usize) & 0x01;
565 val != 0
566 }
567 #[doc = "Mass Erase Protected Area Disabled for bank 1"]
568 pub fn set_mepad_1(&mut self, val: bool) {
569 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
751 } 570 }
752 } 571 }
753 impl Default for Ur10 { 572 impl Default for Ur4 {
754 fn default() -> Ur10 { 573 fn default() -> Ur4 {
755 Ur10(0) 574 Ur4(0)
756 } 575 }
757 } 576 }
758 #[doc = "SYSCFG user register 7"] 577 #[doc = "SYSCFG user register 2"]
759 #[repr(transparent)] 578 #[repr(transparent)]
760 #[derive(Copy, Clone, Eq, PartialEq)] 579 #[derive(Copy, Clone, Eq, PartialEq)]
761 pub struct Ur7(pub u32); 580 pub struct Ur2(pub u32);
762 impl Ur7 { 581 impl Ur2 {
763 #[doc = "Secured area start address for bank 1"] 582 #[doc = "BOR_LVL Brownout Reset Threshold Level"]
764 pub const fn sa_beg_1(&self) -> u16 { 583 pub const fn borh(&self) -> u8 {
765 let val = (self.0 >> 0usize) & 0x0fff; 584 let val = (self.0 >> 0usize) & 0x03;
766 val as u16 585 val as u8
767 } 586 }
768 #[doc = "Secured area start address for bank 1"] 587 #[doc = "BOR_LVL Brownout Reset Threshold Level"]
769 pub fn set_sa_beg_1(&mut self, val: u16) { 588 pub fn set_borh(&mut self, val: u8) {
770 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 589 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
771 } 590 }
772 #[doc = "Secured area end address for bank 1"] 591 #[doc = "Boot Address 0"]
773 pub const fn sa_end_1(&self) -> u16 { 592 pub const fn boot_add0(&self) -> u16 {
774 let val = (self.0 >> 16usize) & 0x0fff; 593 let val = (self.0 >> 16usize) & 0xffff;
775 val as u16 594 val as u16
776 } 595 }
777 #[doc = "Secured area end address for bank 1"] 596 #[doc = "Boot Address 0"]
778 pub fn set_sa_end_1(&mut self, val: u16) { 597 pub fn set_boot_add0(&mut self, val: u16) {
779 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); 598 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
780 } 599 }
781 } 600 }
782 impl Default for Ur7 { 601 impl Default for Ur2 {
783 fn default() -> Ur7 { 602 fn default() -> Ur2 {
784 Ur7(0) 603 Ur2(0)
604 }
605 }
606 #[doc = "SYSCFG power control register"]
607 #[repr(transparent)]
608 #[derive(Copy, Clone, Eq, PartialEq)]
609 pub struct Pwrcr(pub u32);
610 impl Pwrcr {
611 #[doc = "Overdrive enable"]
612 pub const fn oden(&self) -> u8 {
613 let val = (self.0 >> 0usize) & 0x0f;
614 val as u8
615 }
616 #[doc = "Overdrive enable"]
617 pub fn set_oden(&mut self, val: u8) {
618 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
619 }
620 }
621 impl Default for Pwrcr {
622 fn default() -> Pwrcr {
623 Pwrcr(0)
624 }
625 }
626 #[doc = "external interrupt configuration register 2"]
627 #[repr(transparent)]
628 #[derive(Copy, Clone, Eq, PartialEq)]
629 pub struct Exticr(pub u32);
630 impl Exticr {
631 #[doc = "EXTI x configuration (x = 4 to 7)"]
632 pub fn exti(&self, n: usize) -> u8 {
633 assert!(n < 4usize);
634 let offs = 0usize + n * 4usize;
635 let val = (self.0 >> offs) & 0x0f;
636 val as u8
637 }
638 #[doc = "EXTI x configuration (x = 4 to 7)"]
639 pub fn set_exti(&mut self, n: usize, val: u8) {
640 assert!(n < 4usize);
641 let offs = 0usize + n * 4usize;
642 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
643 }
644 }
645 impl Default for Exticr {
646 fn default() -> Exticr {
647 Exticr(0)
785 } 648 }
786 } 649 }
787 #[doc = "SYSCFG user register 15"] 650 #[doc = "SYSCFG user register 15"]
@@ -804,3903 +667,3310 @@ pub mod syscfg_h7 {
804 Ur15(0) 667 Ur15(0)
805 } 668 }
806 } 669 }
807 #[doc = "SYSCFG compensation cell value register"] 670 #[doc = "peripheral mode configuration register"]
808 #[repr(transparent)] 671 #[repr(transparent)]
809 #[derive(Copy, Clone, Eq, PartialEq)] 672 #[derive(Copy, Clone, Eq, PartialEq)]
810 pub struct Ccvr(pub u32); 673 pub struct Pmcr(pub u32);
811 impl Ccvr { 674 impl Pmcr {
812 #[doc = "NMOS compensation value"] 675 #[doc = "I2C1 Fm+"]
813 pub const fn ncv(&self) -> u8 { 676 pub const fn i2c1fmp(&self) -> bool {
814 let val = (self.0 >> 0usize) & 0x0f; 677 let val = (self.0 >> 0usize) & 0x01;
815 val as u8 678 val != 0
816 } 679 }
817 #[doc = "NMOS compensation value"] 680 #[doc = "I2C1 Fm+"]
818 pub fn set_ncv(&mut self, val: u8) { 681 pub fn set_i2c1fmp(&mut self, val: bool) {
819 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 682 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
820 } 683 }
821 #[doc = "PMOS compensation value"] 684 #[doc = "I2C2 Fm+"]
822 pub const fn pcv(&self) -> u8 { 685 pub const fn i2c2fmp(&self) -> bool {
823 let val = (self.0 >> 4usize) & 0x0f; 686 let val = (self.0 >> 1usize) & 0x01;
687 val != 0
688 }
689 #[doc = "I2C2 Fm+"]
690 pub fn set_i2c2fmp(&mut self, val: bool) {
691 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
692 }
693 #[doc = "I2C3 Fm+"]
694 pub const fn i2c3fmp(&self) -> bool {
695 let val = (self.0 >> 2usize) & 0x01;
696 val != 0
697 }
698 #[doc = "I2C3 Fm+"]
699 pub fn set_i2c3fmp(&mut self, val: bool) {
700 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
701 }
702 #[doc = "I2C4 Fm+"]
703 pub const fn i2c4fmp(&self) -> bool {
704 let val = (self.0 >> 3usize) & 0x01;
705 val != 0
706 }
707 #[doc = "I2C4 Fm+"]
708 pub fn set_i2c4fmp(&mut self, val: bool) {
709 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
710 }
711 #[doc = "PB(6) Fm+"]
712 pub const fn pb6fmp(&self) -> bool {
713 let val = (self.0 >> 4usize) & 0x01;
714 val != 0
715 }
716 #[doc = "PB(6) Fm+"]
717 pub fn set_pb6fmp(&mut self, val: bool) {
718 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
719 }
720 #[doc = "PB(7) Fast Mode Plus"]
721 pub const fn pb7fmp(&self) -> bool {
722 let val = (self.0 >> 5usize) & 0x01;
723 val != 0
724 }
725 #[doc = "PB(7) Fast Mode Plus"]
726 pub fn set_pb7fmp(&mut self, val: bool) {
727 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
728 }
729 #[doc = "PB(8) Fast Mode Plus"]
730 pub const fn pb8fmp(&self) -> bool {
731 let val = (self.0 >> 6usize) & 0x01;
732 val != 0
733 }
734 #[doc = "PB(8) Fast Mode Plus"]
735 pub fn set_pb8fmp(&mut self, val: bool) {
736 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
737 }
738 #[doc = "PB(9) Fm+"]
739 pub const fn pb9fmp(&self) -> bool {
740 let val = (self.0 >> 7usize) & 0x01;
741 val != 0
742 }
743 #[doc = "PB(9) Fm+"]
744 pub fn set_pb9fmp(&mut self, val: bool) {
745 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
746 }
747 #[doc = "Booster Enable"]
748 pub const fn booste(&self) -> bool {
749 let val = (self.0 >> 8usize) & 0x01;
750 val != 0
751 }
752 #[doc = "Booster Enable"]
753 pub fn set_booste(&mut self, val: bool) {
754 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
755 }
756 #[doc = "Analog switch supply voltage selection"]
757 pub const fn boostvddsel(&self) -> bool {
758 let val = (self.0 >> 9usize) & 0x01;
759 val != 0
760 }
761 #[doc = "Analog switch supply voltage selection"]
762 pub fn set_boostvddsel(&mut self, val: bool) {
763 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
764 }
765 #[doc = "Ethernet PHY Interface Selection"]
766 pub const fn epis(&self) -> u8 {
767 let val = (self.0 >> 21usize) & 0x07;
824 val as u8 768 val as u8
825 } 769 }
826 #[doc = "PMOS compensation value"] 770 #[doc = "Ethernet PHY Interface Selection"]
827 pub fn set_pcv(&mut self, val: u8) { 771 pub fn set_epis(&mut self, val: u8) {
828 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); 772 self.0 = (self.0 & !(0x07 << 21usize)) | (((val as u32) & 0x07) << 21usize);
773 }
774 #[doc = "PA0 Switch Open"]
775 pub const fn pa0so(&self) -> bool {
776 let val = (self.0 >> 24usize) & 0x01;
777 val != 0
778 }
779 #[doc = "PA0 Switch Open"]
780 pub fn set_pa0so(&mut self, val: bool) {
781 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
782 }
783 #[doc = "PA1 Switch Open"]
784 pub const fn pa1so(&self) -> bool {
785 let val = (self.0 >> 25usize) & 0x01;
786 val != 0
787 }
788 #[doc = "PA1 Switch Open"]
789 pub fn set_pa1so(&mut self, val: bool) {
790 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
791 }
792 #[doc = "PC2 Switch Open"]
793 pub const fn pc2so(&self) -> bool {
794 let val = (self.0 >> 26usize) & 0x01;
795 val != 0
796 }
797 #[doc = "PC2 Switch Open"]
798 pub fn set_pc2so(&mut self, val: bool) {
799 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
800 }
801 #[doc = "PC3 Switch Open"]
802 pub const fn pc3so(&self) -> bool {
803 let val = (self.0 >> 27usize) & 0x01;
804 val != 0
805 }
806 #[doc = "PC3 Switch Open"]
807 pub fn set_pc3so(&mut self, val: bool) {
808 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
829 } 809 }
830 } 810 }
831 impl Default for Ccvr { 811 impl Default for Pmcr {
832 fn default() -> Ccvr { 812 fn default() -> Pmcr {
833 Ccvr(0) 813 Pmcr(0)
834 } 814 }
835 } 815 }
836 #[doc = "SYSCFG user register 9"] 816 #[doc = "SYSCFG user register 16"]
837 #[repr(transparent)] 817 #[repr(transparent)]
838 #[derive(Copy, Clone, Eq, PartialEq)] 818 #[derive(Copy, Clone, Eq, PartialEq)]
839 pub struct Ur9(pub u32); 819 pub struct Ur16(pub u32);
840 impl Ur9 { 820 impl Ur16 {
841 #[doc = "Write protection for flash bank 2"] 821 #[doc = "Freeze independent watchdog in Stop mode"]
842 pub const fn wrpn_2(&self) -> u8 { 822 pub const fn fziwdgstp(&self) -> bool {
843 let val = (self.0 >> 0usize) & 0xff; 823 let val = (self.0 >> 0usize) & 0x01;
844 val as u8 824 val != 0
845 } 825 }
846 #[doc = "Write protection for flash bank 2"] 826 #[doc = "Freeze independent watchdog in Stop mode"]
847 pub fn set_wrpn_2(&mut self, val: u8) { 827 pub fn set_fziwdgstp(&mut self, val: bool) {
848 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 828 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
849 } 829 }
850 #[doc = "Protected area start address for bank 2"] 830 #[doc = "Private key programmed"]
851 pub const fn pa_beg_2(&self) -> u16 { 831 pub const fn pkp(&self) -> bool {
852 let val = (self.0 >> 16usize) & 0x0fff; 832 let val = (self.0 >> 16usize) & 0x01;
853 val as u16 833 val != 0
854 } 834 }
855 #[doc = "Protected area start address for bank 2"] 835 #[doc = "Private key programmed"]
856 pub fn set_pa_beg_2(&mut self, val: u16) { 836 pub fn set_pkp(&mut self, val: bool) {
857 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); 837 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
858 } 838 }
859 } 839 }
860 impl Default for Ur9 { 840 impl Default for Ur16 {
861 fn default() -> Ur9 { 841 fn default() -> Ur16 {
862 Ur9(0) 842 Ur16(0)
863 } 843 }
864 } 844 }
865 } 845 #[doc = "SYSCFG user register 17"]
866} 846 #[repr(transparent)]
867pub mod dma_v2 { 847 #[derive(Copy, Clone, Eq, PartialEq)]
868 use crate::generic::*; 848 pub struct Ur17(pub u32);
869 #[doc = "DMA controller"] 849 impl Ur17 {
870 #[derive(Copy, Clone)] 850 #[doc = "I/O high speed / low voltage"]
871 pub struct Dma(pub *mut u8); 851 pub const fn io_hslv(&self) -> bool {
872 unsafe impl Send for Dma {} 852 let val = (self.0 >> 0usize) & 0x01;
873 unsafe impl Sync for Dma {} 853 val != 0
874 impl Dma { 854 }
875 #[doc = "low interrupt status register"] 855 #[doc = "I/O high speed / low voltage"]
876 pub fn isr(self, n: usize) -> Reg<regs::Ixr, R> { 856 pub fn set_io_hslv(&mut self, val: bool) {
877 assert!(n < 2usize); 857 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
878 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) } 858 }
879 }
880 #[doc = "low interrupt flag clear register"]
881 pub fn ifcr(self, n: usize) -> Reg<regs::Ixr, W> {
882 assert!(n < 2usize);
883 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
884 } 859 }
885 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] 860 impl Default for Ur17 {
886 pub fn st(self, n: usize) -> St { 861 fn default() -> Ur17 {
887 assert!(n < 8usize); 862 Ur17(0)
888 unsafe { St(self.0.add(16usize + n * 24usize)) } 863 }
889 } 864 }
890 } 865 }
891 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"] 866}
867pub mod dbgmcu_h7 {
868 use crate::generic::*;
869 #[doc = "Debug support"]
892 #[derive(Copy, Clone)] 870 #[derive(Copy, Clone)]
893 pub struct St(pub *mut u8); 871 pub struct Dbgmcu(pub *mut u8);
894 unsafe impl Send for St {} 872 unsafe impl Send for Dbgmcu {}
895 unsafe impl Sync for St {} 873 unsafe impl Sync for Dbgmcu {}
896 impl St { 874 impl Dbgmcu {
897 #[doc = "stream x configuration register"] 875 #[doc = "Identity code"]
898 pub fn cr(self) -> Reg<regs::Cr, RW> { 876 pub fn idc(self) -> Reg<regs::Idc, R> {
899 unsafe { Reg::from_ptr(self.0.add(0usize)) } 877 unsafe { Reg::from_ptr(self.0.add(0usize)) }
900 } 878 }
901 #[doc = "stream x number of data register"] 879 #[doc = "Configuration register"]
902 pub fn ndtr(self) -> Reg<regs::Ndtr, RW> { 880 pub fn cr(self) -> Reg<regs::Cr, RW> {
903 unsafe { Reg::from_ptr(self.0.add(4usize)) } 881 unsafe { Reg::from_ptr(self.0.add(4usize)) }
904 } 882 }
905 #[doc = "stream x peripheral address register"] 883 #[doc = "APB3 peripheral freeze register"]
906 pub fn par(self) -> Reg<u32, RW> { 884 pub fn apb3fz1(self) -> Reg<regs::Apb3fz1, RW> {
907 unsafe { Reg::from_ptr(self.0.add(8usize)) } 885 unsafe { Reg::from_ptr(self.0.add(52usize)) }
908 } 886 }
909 #[doc = "stream x memory 0 address register"] 887 #[doc = "APB1L peripheral freeze register"]
910 pub fn m0ar(self) -> Reg<u32, RW> { 888 pub fn apb1lfz1(self) -> Reg<regs::Apb1lfz1, RW> {
911 unsafe { Reg::from_ptr(self.0.add(12usize)) } 889 unsafe { Reg::from_ptr(self.0.add(60usize)) }
912 } 890 }
913 #[doc = "stream x memory 1 address register"] 891 #[doc = "APB2 peripheral freeze register"]
914 pub fn m1ar(self) -> Reg<u32, RW> { 892 pub fn apb2fz1(self) -> Reg<regs::Apb2fz1, RW> {
915 unsafe { Reg::from_ptr(self.0.add(16usize)) } 893 unsafe { Reg::from_ptr(self.0.add(76usize)) }
916 } 894 }
917 #[doc = "stream x FIFO control register"] 895 #[doc = "APB4 peripheral freeze register"]
918 pub fn fcr(self) -> Reg<regs::Fcr, RW> { 896 pub fn apb4fz1(self) -> Reg<regs::Apb4fz1, RW> {
919 unsafe { Reg::from_ptr(self.0.add(20usize)) } 897 unsafe { Reg::from_ptr(self.0.add(84usize)) }
920 } 898 }
921 } 899 }
922 pub mod regs { 900 pub mod regs {
923 use crate::generic::*; 901 use crate::generic::*;
924 #[doc = "stream x number of data register"] 902 #[doc = "Configuration register"]
925 #[repr(transparent)]
926 #[derive(Copy, Clone, Eq, PartialEq)]
927 pub struct Ndtr(pub u32);
928 impl Ndtr {
929 #[doc = "Number of data items to transfer"]
930 pub const fn ndt(&self) -> u16 {
931 let val = (self.0 >> 0usize) & 0xffff;
932 val as u16
933 }
934 #[doc = "Number of data items to transfer"]
935 pub fn set_ndt(&mut self, val: u16) {
936 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
937 }
938 }
939 impl Default for Ndtr {
940 fn default() -> Ndtr {
941 Ndtr(0)
942 }
943 }
944 #[doc = "stream x configuration register"]
945 #[repr(transparent)] 903 #[repr(transparent)]
946 #[derive(Copy, Clone, Eq, PartialEq)] 904 #[derive(Copy, Clone, Eq, PartialEq)]
947 pub struct Cr(pub u32); 905 pub struct Cr(pub u32);
948 impl Cr { 906 impl Cr {
949 #[doc = "Stream enable / flag stream ready when read low"] 907 #[doc = "Allow debug in D1 Sleep mode"]
950 pub const fn en(&self) -> bool { 908 pub const fn dbgsleep_d1(&self) -> bool {
951 let val = (self.0 >> 0usize) & 0x01; 909 let val = (self.0 >> 0usize) & 0x01;
952 val != 0 910 val != 0
953 } 911 }
954 #[doc = "Stream enable / flag stream ready when read low"] 912 #[doc = "Allow debug in D1 Sleep mode"]
955 pub fn set_en(&mut self, val: bool) { 913 pub fn set_dbgsleep_d1(&mut self, val: bool) {
956 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 914 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
957 } 915 }
958 #[doc = "Direct mode error interrupt enable"] 916 #[doc = "Allow debug in D1 Stop mode"]
959 pub const fn dmeie(&self) -> bool { 917 pub const fn dbgstop_d1(&self) -> bool {
960 let val = (self.0 >> 1usize) & 0x01; 918 let val = (self.0 >> 1usize) & 0x01;
961 val != 0 919 val != 0
962 } 920 }
963 #[doc = "Direct mode error interrupt enable"] 921 #[doc = "Allow debug in D1 Stop mode"]
964 pub fn set_dmeie(&mut self, val: bool) { 922 pub fn set_dbgstop_d1(&mut self, val: bool) {
965 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 923 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
966 } 924 }
967 #[doc = "Transfer error interrupt enable"] 925 #[doc = "Allow debug in D1 Standby mode"]
968 pub const fn teie(&self) -> bool { 926 pub const fn dbgstby_d1(&self) -> bool {
969 let val = (self.0 >> 2usize) & 0x01; 927 let val = (self.0 >> 2usize) & 0x01;
970 val != 0 928 val != 0
971 } 929 }
972 #[doc = "Transfer error interrupt enable"] 930 #[doc = "Allow debug in D1 Standby mode"]
973 pub fn set_teie(&mut self, val: bool) { 931 pub fn set_dbgstby_d1(&mut self, val: bool) {
974 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 932 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
975 } 933 }
976 #[doc = "Half transfer interrupt enable"] 934 #[doc = "Trace clock enable enable"]
977 pub const fn htie(&self) -> bool { 935 pub const fn traceclken(&self) -> bool {
978 let val = (self.0 >> 3usize) & 0x01; 936 let val = (self.0 >> 20usize) & 0x01;
979 val != 0 937 val != 0
980 } 938 }
981 #[doc = "Half transfer interrupt enable"] 939 #[doc = "Trace clock enable enable"]
982 pub fn set_htie(&mut self, val: bool) { 940 pub fn set_traceclken(&mut self, val: bool) {
983 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 941 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
984 } 942 }
985 #[doc = "Transfer complete interrupt enable"] 943 #[doc = "D1 debug clock enable enable"]
986 pub const fn tcie(&self) -> bool { 944 pub const fn d1dbgcken(&self) -> bool {
987 let val = (self.0 >> 4usize) & 0x01; 945 let val = (self.0 >> 21usize) & 0x01;
988 val != 0 946 val != 0
989 } 947 }
990 #[doc = "Transfer complete interrupt enable"] 948 #[doc = "D1 debug clock enable enable"]
991 pub fn set_tcie(&mut self, val: bool) { 949 pub fn set_d1dbgcken(&mut self, val: bool) {
992 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 950 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
993 } 951 }
994 #[doc = "Peripheral flow controller"] 952 #[doc = "D3 debug clock enable enable"]
995 pub const fn pfctrl(&self) -> super::vals::Pfctrl { 953 pub const fn d3dbgcken(&self) -> bool {
996 let val = (self.0 >> 5usize) & 0x01; 954 let val = (self.0 >> 22usize) & 0x01;
997 super::vals::Pfctrl(val as u8) 955 val != 0
998 } 956 }
999 #[doc = "Peripheral flow controller"] 957 #[doc = "D3 debug clock enable enable"]
1000 pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) { 958 pub fn set_d3dbgcken(&mut self, val: bool) {
1001 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 959 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
1002 } 960 }
1003 #[doc = "Data transfer direction"] 961 #[doc = "External trigger output enable"]
1004 pub const fn dir(&self) -> super::vals::Dir { 962 pub const fn trgoen(&self) -> bool {
1005 let val = (self.0 >> 6usize) & 0x03; 963 let val = (self.0 >> 28usize) & 0x01;
1006 super::vals::Dir(val as u8) 964 val != 0
1007 } 965 }
1008 #[doc = "Data transfer direction"] 966 #[doc = "External trigger output enable"]
1009 pub fn set_dir(&mut self, val: super::vals::Dir) { 967 pub fn set_trgoen(&mut self, val: bool) {
1010 self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize); 968 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
1011 } 969 }
1012 #[doc = "Circular mode"] 970 }
1013 pub const fn circ(&self) -> super::vals::Circ { 971 impl Default for Cr {
1014 let val = (self.0 >> 8usize) & 0x01; 972 fn default() -> Cr {
1015 super::vals::Circ(val as u8) 973 Cr(0)
1016 } 974 }
1017 #[doc = "Circular mode"] 975 }
1018 pub fn set_circ(&mut self, val: super::vals::Circ) { 976 #[doc = "Identity code"]
1019 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 977 #[repr(transparent)]
978 #[derive(Copy, Clone, Eq, PartialEq)]
979 pub struct Idc(pub u32);
980 impl Idc {
981 #[doc = "Device ID"]
982 pub const fn dev_id(&self) -> u16 {
983 let val = (self.0 >> 0usize) & 0x0fff;
984 val as u16
1020 } 985 }
1021 #[doc = "Peripheral increment mode"] 986 #[doc = "Device ID"]
1022 pub const fn pinc(&self) -> super::vals::Inc { 987 pub fn set_dev_id(&mut self, val: u16) {
1023 let val = (self.0 >> 9usize) & 0x01; 988 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
1024 super::vals::Inc(val as u8)
1025 } 989 }
1026 #[doc = "Peripheral increment mode"] 990 #[doc = "Revision ID"]
1027 pub fn set_pinc(&mut self, val: super::vals::Inc) { 991 pub const fn rev_id(&self) -> u16 {
1028 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 992 let val = (self.0 >> 16usize) & 0xffff;
993 val as u16
1029 } 994 }
1030 #[doc = "Memory increment mode"] 995 #[doc = "Revision ID"]
1031 pub const fn minc(&self) -> super::vals::Inc { 996 pub fn set_rev_id(&mut self, val: u16) {
1032 let val = (self.0 >> 10usize) & 0x01; 997 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
1033 super::vals::Inc(val as u8)
1034 } 998 }
1035 #[doc = "Memory increment mode"] 999 }
1036 pub fn set_minc(&mut self, val: super::vals::Inc) { 1000 impl Default for Idc {
1037 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 1001 fn default() -> Idc {
1002 Idc(0)
1038 } 1003 }
1039 #[doc = "Peripheral data size"] 1004 }
1040 pub const fn psize(&self) -> super::vals::Size { 1005 #[doc = "APB2 peripheral freeze register"]
1041 let val = (self.0 >> 11usize) & 0x03; 1006 #[repr(transparent)]
1042 super::vals::Size(val as u8) 1007 #[derive(Copy, Clone, Eq, PartialEq)]
1008 pub struct Apb2fz1(pub u32);
1009 impl Apb2fz1 {
1010 #[doc = "TIM1 stop in debug mode"]
1011 pub const fn tim1(&self) -> bool {
1012 let val = (self.0 >> 0usize) & 0x01;
1013 val != 0
1043 } 1014 }
1044 #[doc = "Peripheral data size"] 1015 #[doc = "TIM1 stop in debug mode"]
1045 pub fn set_psize(&mut self, val: super::vals::Size) { 1016 pub fn set_tim1(&mut self, val: bool) {
1046 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); 1017 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1047 } 1018 }
1048 #[doc = "Memory data size"] 1019 #[doc = "TIM8 stop in debug mode"]
1049 pub const fn msize(&self) -> super::vals::Size { 1020 pub const fn tim8(&self) -> bool {
1050 let val = (self.0 >> 13usize) & 0x03; 1021 let val = (self.0 >> 1usize) & 0x01;
1051 super::vals::Size(val as u8) 1022 val != 0
1052 } 1023 }
1053 #[doc = "Memory data size"] 1024 #[doc = "TIM8 stop in debug mode"]
1054 pub fn set_msize(&mut self, val: super::vals::Size) { 1025 pub fn set_tim8(&mut self, val: bool) {
1055 self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); 1026 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
1056 } 1027 }
1057 #[doc = "Peripheral increment offset size"] 1028 #[doc = "TIM15 stop in debug mode"]
1058 pub const fn pincos(&self) -> super::vals::Pincos { 1029 pub const fn tim15(&self) -> bool {
1059 let val = (self.0 >> 15usize) & 0x01; 1030 let val = (self.0 >> 16usize) & 0x01;
1060 super::vals::Pincos(val as u8) 1031 val != 0
1061 } 1032 }
1062 #[doc = "Peripheral increment offset size"] 1033 #[doc = "TIM15 stop in debug mode"]
1063 pub fn set_pincos(&mut self, val: super::vals::Pincos) { 1034 pub fn set_tim15(&mut self, val: bool) {
1064 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 1035 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
1065 } 1036 }
1066 #[doc = "Priority level"] 1037 #[doc = "TIM16 stop in debug mode"]
1067 pub const fn pl(&self) -> super::vals::Pl { 1038 pub const fn tim16(&self) -> bool {
1068 let val = (self.0 >> 16usize) & 0x03; 1039 let val = (self.0 >> 17usize) & 0x01;
1069 super::vals::Pl(val as u8) 1040 val != 0
1070 } 1041 }
1071 #[doc = "Priority level"] 1042 #[doc = "TIM16 stop in debug mode"]
1072 pub fn set_pl(&mut self, val: super::vals::Pl) { 1043 pub fn set_tim16(&mut self, val: bool) {
1073 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); 1044 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
1074 } 1045 }
1075 #[doc = "Double buffer mode"] 1046 #[doc = "TIM17 stop in debug mode"]
1076 pub const fn dbm(&self) -> super::vals::Dbm { 1047 pub const fn tim17(&self) -> bool {
1077 let val = (self.0 >> 18usize) & 0x01; 1048 let val = (self.0 >> 18usize) & 0x01;
1078 super::vals::Dbm(val as u8) 1049 val != 0
1079 } 1050 }
1080 #[doc = "Double buffer mode"] 1051 #[doc = "TIM17 stop in debug mode"]
1081 pub fn set_dbm(&mut self, val: super::vals::Dbm) { 1052 pub fn set_tim17(&mut self, val: bool) {
1082 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); 1053 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
1083 } 1054 }
1084 #[doc = "Current target (only in double buffer mode)"] 1055 #[doc = "HRTIM stop in debug mode"]
1085 pub const fn ct(&self) -> super::vals::Ct { 1056 pub const fn hrtim(&self) -> bool {
1086 let val = (self.0 >> 19usize) & 0x01; 1057 let val = (self.0 >> 29usize) & 0x01;
1087 super::vals::Ct(val as u8) 1058 val != 0
1088 } 1059 }
1089 #[doc = "Current target (only in double buffer mode)"] 1060 #[doc = "HRTIM stop in debug mode"]
1090 pub fn set_ct(&mut self, val: super::vals::Ct) { 1061 pub fn set_hrtim(&mut self, val: bool) {
1091 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 1062 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
1092 } 1063 }
1093 #[doc = "Peripheral burst transfer configuration"] 1064 }
1094 pub const fn pburst(&self) -> super::vals::Burst { 1065 impl Default for Apb2fz1 {
1095 let val = (self.0 >> 21usize) & 0x03; 1066 fn default() -> Apb2fz1 {
1096 super::vals::Burst(val as u8) 1067 Apb2fz1(0)
1097 } 1068 }
1098 #[doc = "Peripheral burst transfer configuration"] 1069 }
1099 pub fn set_pburst(&mut self, val: super::vals::Burst) { 1070 #[doc = "APB4 peripheral freeze register"]
1100 self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize); 1071 #[repr(transparent)]
1072 #[derive(Copy, Clone, Eq, PartialEq)]
1073 pub struct Apb4fz1(pub u32);
1074 impl Apb4fz1 {
1075 #[doc = "I2C4 SMBUS timeout stop in debug mode"]
1076 pub const fn i2c4(&self) -> bool {
1077 let val = (self.0 >> 7usize) & 0x01;
1078 val != 0
1101 } 1079 }
1102 #[doc = "Memory burst transfer configuration"] 1080 #[doc = "I2C4 SMBUS timeout stop in debug mode"]
1103 pub const fn mburst(&self) -> super::vals::Burst { 1081 pub fn set_i2c4(&mut self, val: bool) {
1104 let val = (self.0 >> 23usize) & 0x03; 1082 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
1105 super::vals::Burst(val as u8)
1106 } 1083 }
1107 #[doc = "Memory burst transfer configuration"] 1084 #[doc = "LPTIM2 stop in debug mode"]
1108 pub fn set_mburst(&mut self, val: super::vals::Burst) { 1085 pub const fn lptim2(&self) -> bool {
1109 self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize); 1086 let val = (self.0 >> 9usize) & 0x01;
1087 val != 0
1110 } 1088 }
1111 #[doc = "Channel selection"] 1089 #[doc = "LPTIM2 stop in debug mode"]
1112 pub const fn chsel(&self) -> u8 { 1090 pub fn set_lptim2(&mut self, val: bool) {
1113 let val = (self.0 >> 25usize) & 0x0f; 1091 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
1114 val as u8
1115 } 1092 }
1116 #[doc = "Channel selection"] 1093 #[doc = "LPTIM3 stop in debug mode"]
1117 pub fn set_chsel(&mut self, val: u8) { 1094 pub const fn lptim3(&self) -> bool {
1118 self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); 1095 let val = (self.0 >> 10usize) & 0x01;
1096 val != 0
1097 }
1098 #[doc = "LPTIM3 stop in debug mode"]
1099 pub fn set_lptim3(&mut self, val: bool) {
1100 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
1101 }
1102 #[doc = "LPTIM4 stop in debug mode"]
1103 pub const fn lptim4(&self) -> bool {
1104 let val = (self.0 >> 11usize) & 0x01;
1105 val != 0
1106 }
1107 #[doc = "LPTIM4 stop in debug mode"]
1108 pub fn set_lptim4(&mut self, val: bool) {
1109 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
1110 }
1111 #[doc = "LPTIM5 stop in debug mode"]
1112 pub const fn lptim5(&self) -> bool {
1113 let val = (self.0 >> 12usize) & 0x01;
1114 val != 0
1115 }
1116 #[doc = "LPTIM5 stop in debug mode"]
1117 pub fn set_lptim5(&mut self, val: bool) {
1118 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
1119 }
1120 #[doc = "RTC stop in debug mode"]
1121 pub const fn rtc(&self) -> bool {
1122 let val = (self.0 >> 16usize) & 0x01;
1123 val != 0
1124 }
1125 #[doc = "RTC stop in debug mode"]
1126 pub fn set_rtc(&mut self, val: bool) {
1127 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
1128 }
1129 #[doc = "Independent watchdog for D1 stop in debug mode"]
1130 pub const fn iwdg1(&self) -> bool {
1131 let val = (self.0 >> 18usize) & 0x01;
1132 val != 0
1133 }
1134 #[doc = "Independent watchdog for D1 stop in debug mode"]
1135 pub fn set_iwdg1(&mut self, val: bool) {
1136 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
1119 } 1137 }
1120 } 1138 }
1121 impl Default for Cr { 1139 impl Default for Apb4fz1 {
1122 fn default() -> Cr { 1140 fn default() -> Apb4fz1 {
1123 Cr(0) 1141 Apb4fz1(0)
1124 } 1142 }
1125 } 1143 }
1126 #[doc = "stream x FIFO control register"] 1144 #[doc = "APB3 peripheral freeze register"]
1127 #[repr(transparent)] 1145 #[repr(transparent)]
1128 #[derive(Copy, Clone, Eq, PartialEq)] 1146 #[derive(Copy, Clone, Eq, PartialEq)]
1129 pub struct Fcr(pub u32); 1147 pub struct Apb3fz1(pub u32);
1130 impl Fcr { 1148 impl Apb3fz1 {
1131 #[doc = "FIFO threshold selection"] 1149 #[doc = "WWDG1 stop in debug mode"]
1132 pub const fn fth(&self) -> super::vals::Fth { 1150 pub const fn wwdg1(&self) -> bool {
1133 let val = (self.0 >> 0usize) & 0x03; 1151 let val = (self.0 >> 6usize) & 0x01;
1134 super::vals::Fth(val as u8) 1152 val != 0
1135 } 1153 }
1136 #[doc = "FIFO threshold selection"] 1154 #[doc = "WWDG1 stop in debug mode"]
1137 pub fn set_fth(&mut self, val: super::vals::Fth) { 1155 pub fn set_wwdg1(&mut self, val: bool) {
1138 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize); 1156 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1139 } 1157 }
1140 #[doc = "Direct mode disable"] 1158 }
1141 pub const fn dmdis(&self) -> super::vals::Dmdis { 1159 impl Default for Apb3fz1 {
1160 fn default() -> Apb3fz1 {
1161 Apb3fz1(0)
1162 }
1163 }
1164 #[doc = "APB1L peripheral freeze register"]
1165 #[repr(transparent)]
1166 #[derive(Copy, Clone, Eq, PartialEq)]
1167 pub struct Apb1lfz1(pub u32);
1168 impl Apb1lfz1 {
1169 #[doc = "TIM2 stop in debug mode"]
1170 pub const fn tim2(&self) -> bool {
1171 let val = (self.0 >> 0usize) & 0x01;
1172 val != 0
1173 }
1174 #[doc = "TIM2 stop in debug mode"]
1175 pub fn set_tim2(&mut self, val: bool) {
1176 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1177 }
1178 #[doc = "TIM3 stop in debug mode"]
1179 pub const fn tim3(&self) -> bool {
1180 let val = (self.0 >> 1usize) & 0x01;
1181 val != 0
1182 }
1183 #[doc = "TIM3 stop in debug mode"]
1184 pub fn set_tim3(&mut self, val: bool) {
1185 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
1186 }
1187 #[doc = "TIM4 stop in debug mode"]
1188 pub const fn tim4(&self) -> bool {
1142 let val = (self.0 >> 2usize) & 0x01; 1189 let val = (self.0 >> 2usize) & 0x01;
1143 super::vals::Dmdis(val as u8) 1190 val != 0
1144 } 1191 }
1145 #[doc = "Direct mode disable"] 1192 #[doc = "TIM4 stop in debug mode"]
1146 pub fn set_dmdis(&mut self, val: super::vals::Dmdis) { 1193 pub fn set_tim4(&mut self, val: bool) {
1147 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 1194 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
1148 } 1195 }
1149 #[doc = "FIFO status"] 1196 #[doc = "TIM5 stop in debug mode"]
1150 pub const fn fs(&self) -> super::vals::Fs { 1197 pub const fn tim5(&self) -> bool {
1151 let val = (self.0 >> 3usize) & 0x07; 1198 let val = (self.0 >> 3usize) & 0x01;
1152 super::vals::Fs(val as u8) 1199 val != 0
1153 } 1200 }
1154 #[doc = "FIFO status"] 1201 #[doc = "TIM5 stop in debug mode"]
1155 pub fn set_fs(&mut self, val: super::vals::Fs) { 1202 pub fn set_tim5(&mut self, val: bool) {
1156 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); 1203 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
1157 } 1204 }
1158 #[doc = "FIFO error interrupt enable"] 1205 #[doc = "TIM6 stop in debug mode"]
1159 pub const fn feie(&self) -> bool { 1206 pub const fn tim6(&self) -> bool {
1207 let val = (self.0 >> 4usize) & 0x01;
1208 val != 0
1209 }
1210 #[doc = "TIM6 stop in debug mode"]
1211 pub fn set_tim6(&mut self, val: bool) {
1212 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
1213 }
1214 #[doc = "TIM7 stop in debug mode"]
1215 pub const fn tim7(&self) -> bool {
1216 let val = (self.0 >> 5usize) & 0x01;
1217 val != 0
1218 }
1219 #[doc = "TIM7 stop in debug mode"]
1220 pub fn set_tim7(&mut self, val: bool) {
1221 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
1222 }
1223 #[doc = "TIM12 stop in debug mode"]
1224 pub const fn tim12(&self) -> bool {
1225 let val = (self.0 >> 6usize) & 0x01;
1226 val != 0
1227 }
1228 #[doc = "TIM12 stop in debug mode"]
1229 pub fn set_tim12(&mut self, val: bool) {
1230 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1231 }
1232 #[doc = "TIM13 stop in debug mode"]
1233 pub const fn tim13(&self) -> bool {
1160 let val = (self.0 >> 7usize) & 0x01; 1234 let val = (self.0 >> 7usize) & 0x01;
1161 val != 0 1235 val != 0
1162 } 1236 }
1163 #[doc = "FIFO error interrupt enable"] 1237 #[doc = "TIM13 stop in debug mode"]
1164 pub fn set_feie(&mut self, val: bool) { 1238 pub fn set_tim13(&mut self, val: bool) {
1165 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 1239 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
1166 } 1240 }
1167 } 1241 #[doc = "TIM14 stop in debug mode"]
1168 impl Default for Fcr { 1242 pub const fn tim14(&self) -> bool {
1169 fn default() -> Fcr { 1243 let val = (self.0 >> 8usize) & 0x01;
1170 Fcr(0)
1171 }
1172 }
1173 #[doc = "interrupt register"]
1174 #[repr(transparent)]
1175 #[derive(Copy, Clone, Eq, PartialEq)]
1176 pub struct Ixr(pub u32);
1177 impl Ixr {
1178 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"]
1179 pub fn feif(&self, n: usize) -> bool {
1180 assert!(n < 4usize);
1181 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1182 let val = (self.0 >> offs) & 0x01;
1183 val != 0 1244 val != 0
1184 } 1245 }
1185 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] 1246 #[doc = "TIM14 stop in debug mode"]
1186 pub fn set_feif(&mut self, n: usize, val: bool) { 1247 pub fn set_tim14(&mut self, val: bool) {
1187 assert!(n < 4usize); 1248 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
1188 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1189 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1190 } 1249 }
1191 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] 1250 #[doc = "LPTIM1 stop in debug mode"]
1192 pub fn dmeif(&self, n: usize) -> bool { 1251 pub const fn lptim1(&self) -> bool {
1193 assert!(n < 4usize); 1252 let val = (self.0 >> 9usize) & 0x01;
1194 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1195 let val = (self.0 >> offs) & 0x01;
1196 val != 0 1253 val != 0
1197 } 1254 }
1198 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"] 1255 #[doc = "LPTIM1 stop in debug mode"]
1199 pub fn set_dmeif(&mut self, n: usize, val: bool) { 1256 pub fn set_lptim1(&mut self, val: bool) {
1200 assert!(n < 4usize); 1257 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
1201 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1202 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1203 } 1258 }
1204 #[doc = "Stream x transfer error interrupt flag (x=3..0)"] 1259 #[doc = "I2C1 SMBUS timeout stop in debug mode"]
1205 pub fn teif(&self, n: usize) -> bool { 1260 pub const fn i2c1(&self) -> bool {
1206 assert!(n < 4usize); 1261 let val = (self.0 >> 21usize) & 0x01;
1207 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1208 let val = (self.0 >> offs) & 0x01;
1209 val != 0 1262 val != 0
1210 } 1263 }
1211 #[doc = "Stream x transfer error interrupt flag (x=3..0)"] 1264 #[doc = "I2C1 SMBUS timeout stop in debug mode"]
1212 pub fn set_teif(&mut self, n: usize, val: bool) { 1265 pub fn set_i2c1(&mut self, val: bool) {
1213 assert!(n < 4usize); 1266 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
1214 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1215 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1216 } 1267 }
1217 #[doc = "Stream x half transfer interrupt flag (x=3..0)"] 1268 #[doc = "I2C2 SMBUS timeout stop in debug mode"]
1218 pub fn htif(&self, n: usize) -> bool { 1269 pub const fn i2c2(&self) -> bool {
1219 assert!(n < 4usize); 1270 let val = (self.0 >> 22usize) & 0x01;
1220 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1221 let val = (self.0 >> offs) & 0x01;
1222 val != 0 1271 val != 0
1223 } 1272 }
1224 #[doc = "Stream x half transfer interrupt flag (x=3..0)"] 1273 #[doc = "I2C2 SMBUS timeout stop in debug mode"]
1225 pub fn set_htif(&mut self, n: usize, val: bool) { 1274 pub fn set_i2c2(&mut self, val: bool) {
1226 assert!(n < 4usize); 1275 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
1227 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1228 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1229 } 1276 }
1230 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] 1277 #[doc = "I2C3 SMBUS timeout stop in debug mode"]
1231 pub fn tcif(&self, n: usize) -> bool { 1278 pub const fn i2c3(&self) -> bool {
1232 assert!(n < 4usize); 1279 let val = (self.0 >> 23usize) & 0x01;
1233 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1234 let val = (self.0 >> offs) & 0x01;
1235 val != 0 1280 val != 0
1236 } 1281 }
1237 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] 1282 #[doc = "I2C3 SMBUS timeout stop in debug mode"]
1238 pub fn set_tcif(&mut self, n: usize, val: bool) { 1283 pub fn set_i2c3(&mut self, val: bool) {
1239 assert!(n < 4usize); 1284 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
1240 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
1241 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1242 } 1285 }
1243 } 1286 }
1244 impl Default for Ixr { 1287 impl Default for Apb1lfz1 {
1245 fn default() -> Ixr { 1288 fn default() -> Apb1lfz1 {
1246 Ixr(0) 1289 Apb1lfz1(0)
1247 } 1290 }
1248 } 1291 }
1249 } 1292 }
1293}
1294pub mod spi_v1 {
1295 use crate::generic::*;
1296 #[doc = "Serial peripheral interface"]
1297 #[derive(Copy, Clone)]
1298 pub struct Spi(pub *mut u8);
1299 unsafe impl Send for Spi {}
1300 unsafe impl Sync for Spi {}
1301 impl Spi {
1302 #[doc = "control register 1"]
1303 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
1304 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1305 }
1306 #[doc = "control register 2"]
1307 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
1308 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1309 }
1310 #[doc = "status register"]
1311 pub fn sr(self) -> Reg<regs::Sr, RW> {
1312 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1313 }
1314 #[doc = "data register"]
1315 pub fn dr(self) -> Reg<regs::Dr, RW> {
1316 unsafe { Reg::from_ptr(self.0.add(12usize)) }
1317 }
1318 #[doc = "CRC polynomial register"]
1319 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
1320 unsafe { Reg::from_ptr(self.0.add(16usize)) }
1321 }
1322 #[doc = "RX CRC register"]
1323 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
1324 unsafe { Reg::from_ptr(self.0.add(20usize)) }
1325 }
1326 #[doc = "TX CRC register"]
1327 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
1328 unsafe { Reg::from_ptr(self.0.add(24usize)) }
1329 }
1330 }
1250 pub mod vals { 1331 pub mod vals {
1251 use crate::generic::*; 1332 use crate::generic::*;
1252 #[repr(transparent)] 1333 #[repr(transparent)]
1253 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1334 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1254 pub struct Fs(pub u8); 1335 pub struct Br(pub u8);
1255 impl Fs { 1336 impl Br {
1256 #[doc = "0 < fifo_level < 1/4"] 1337 #[doc = "f_PCLK / 2"]
1257 pub const QUARTER1: Self = Self(0); 1338 pub const DIV2: Self = Self(0);
1258 #[doc = "1/4 <= fifo_level < 1/2"] 1339 #[doc = "f_PCLK / 4"]
1259 pub const QUARTER2: Self = Self(0x01); 1340 pub const DIV4: Self = Self(0x01);
1260 #[doc = "1/2 <= fifo_level < 3/4"] 1341 #[doc = "f_PCLK / 8"]
1261 pub const QUARTER3: Self = Self(0x02); 1342 pub const DIV8: Self = Self(0x02);
1262 #[doc = "3/4 <= fifo_level < full"] 1343 #[doc = "f_PCLK / 16"]
1263 pub const QUARTER4: Self = Self(0x03); 1344 pub const DIV16: Self = Self(0x03);
1264 #[doc = "FIFO is empty"] 1345 #[doc = "f_PCLK / 32"]
1265 pub const EMPTY: Self = Self(0x04); 1346 pub const DIV32: Self = Self(0x04);
1266 #[doc = "FIFO is full"] 1347 #[doc = "f_PCLK / 64"]
1267 pub const FULL: Self = Self(0x05); 1348 pub const DIV64: Self = Self(0x05);
1349 #[doc = "f_PCLK / 128"]
1350 pub const DIV128: Self = Self(0x06);
1351 #[doc = "f_PCLK / 256"]
1352 pub const DIV256: Self = Self(0x07);
1268 } 1353 }
1269 #[repr(transparent)] 1354 #[repr(transparent)]
1270 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1355 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1271 pub struct Dmdis(pub u8); 1356 pub struct Dff(pub u8);
1272 impl Dmdis { 1357 impl Dff {
1273 #[doc = "Direct mode is enabled"] 1358 #[doc = "8-bit data frame format is selected for transmission/reception"]
1274 pub const ENABLED: Self = Self(0); 1359 pub const EIGHTBIT: Self = Self(0);
1275 #[doc = "Direct mode is disabled"] 1360 #[doc = "16-bit data frame format is selected for transmission/reception"]
1276 pub const DISABLED: Self = Self(0x01); 1361 pub const SIXTEENBIT: Self = Self(0x01);
1277 } 1362 }
1278 #[repr(transparent)] 1363 #[repr(transparent)]
1279 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1364 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1280 pub struct Pl(pub u8); 1365 pub struct Iscfg(pub u8);
1281 impl Pl { 1366 impl Iscfg {
1282 #[doc = "Low"] 1367 #[doc = "Slave - transmit"]
1283 pub const LOW: Self = Self(0); 1368 pub const SLAVETX: Self = Self(0);
1284 #[doc = "Medium"] 1369 #[doc = "Slave - receive"]
1285 pub const MEDIUM: Self = Self(0x01); 1370 pub const SLAVERX: Self = Self(0x01);
1286 #[doc = "High"] 1371 #[doc = "Master - transmit"]
1287 pub const HIGH: Self = Self(0x02); 1372 pub const MASTERTX: Self = Self(0x02);
1288 #[doc = "Very high"] 1373 #[doc = "Master - receive"]
1289 pub const VERYHIGH: Self = Self(0x03); 1374 pub const MASTERRX: Self = Self(0x03);
1290 } 1375 }
1291 #[repr(transparent)] 1376 #[repr(transparent)]
1292 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1377 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1293 pub struct Size(pub u8); 1378 pub struct Rxonly(pub u8);
1294 impl Size { 1379 impl Rxonly {
1295 #[doc = "Byte (8-bit)"] 1380 #[doc = "Full duplex (Transmit and receive)"]
1296 pub const BITS8: Self = Self(0); 1381 pub const FULLDUPLEX: Self = Self(0);
1297 #[doc = "Half-word (16-bit)"] 1382 #[doc = "Output disabled (Receive-only mode)"]
1298 pub const BITS16: Self = Self(0x01); 1383 pub const OUTPUTDISABLED: Self = Self(0x01);
1299 #[doc = "Word (32-bit)"]
1300 pub const BITS32: Self = Self(0x02);
1301 } 1384 }
1302 #[repr(transparent)] 1385 #[repr(transparent)]
1303 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1386 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1304 pub struct Dbm(pub u8); 1387 pub struct Cpol(pub u8);
1305 impl Dbm { 1388 impl Cpol {
1306 #[doc = "No buffer switching at the end of transfer"] 1389 #[doc = "CK to 0 when idle"]
1307 pub const DISABLED: Self = Self(0); 1390 pub const IDLELOW: Self = Self(0);
1308 #[doc = "Memory target switched at the end of the DMA transfer"] 1391 #[doc = "CK to 1 when idle"]
1309 pub const ENABLED: Self = Self(0x01); 1392 pub const IDLEHIGH: Self = Self(0x01);
1310 } 1393 }
1311 #[repr(transparent)] 1394 #[repr(transparent)]
1312 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1395 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1313 pub struct Circ(pub u8); 1396 pub struct Crcnext(pub u8);
1314 impl Circ { 1397 impl Crcnext {
1315 #[doc = "Circular mode disabled"] 1398 #[doc = "Next transmit value is from Tx buffer"]
1316 pub const DISABLED: Self = Self(0); 1399 pub const TXBUFFER: Self = Self(0);
1317 #[doc = "Circular mode enabled"] 1400 #[doc = "Next transmit value is from Tx CRC register"]
1318 pub const ENABLED: Self = Self(0x01); 1401 pub const CRC: Self = Self(0x01);
1319 } 1402 }
1320 #[repr(transparent)] 1403 #[repr(transparent)]
1321 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1404 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1322 pub struct Pfctrl(pub u8); 1405 pub struct Mstr(pub u8);
1323 impl Pfctrl { 1406 impl Mstr {
1324 #[doc = "The DMA is the flow controller"] 1407 #[doc = "Slave configuration"]
1325 pub const DMA: Self = Self(0); 1408 pub const SLAVE: Self = Self(0);
1326 #[doc = "The peripheral is the flow controller"] 1409 #[doc = "Master configuration"]
1327 pub const PERIPHERAL: Self = Self(0x01); 1410 pub const MASTER: Self = Self(0x01);
1328 } 1411 }
1329 #[repr(transparent)] 1412 #[repr(transparent)]
1330 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1413 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1331 pub struct Dir(pub u8); 1414 pub struct Lsbfirst(pub u8);
1332 impl Dir { 1415 impl Lsbfirst {
1333 #[doc = "Peripheral-to-memory"] 1416 #[doc = "Data is transmitted/received with the MSB first"]
1334 pub const PERIPHERALTOMEMORY: Self = Self(0); 1417 pub const MSBFIRST: Self = Self(0);
1335 #[doc = "Memory-to-peripheral"] 1418 #[doc = "Data is transmitted/received with the LSB first"]
1336 pub const MEMORYTOPERIPHERAL: Self = Self(0x01); 1419 pub const LSBFIRST: Self = Self(0x01);
1337 #[doc = "Memory-to-memory"]
1338 pub const MEMORYTOMEMORY: Self = Self(0x02);
1339 } 1420 }
1340 #[repr(transparent)] 1421 #[repr(transparent)]
1341 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1422 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1342 pub struct Fth(pub u8); 1423 pub struct Frer(pub u8);
1343 impl Fth { 1424 impl Frer {
1344 #[doc = "1/4 full FIFO"] 1425 #[doc = "No frame format error"]
1345 pub const QUARTER: Self = Self(0); 1426 pub const NOERROR: Self = Self(0);
1346 #[doc = "1/2 full FIFO"] 1427 #[doc = "A frame format error occurred"]
1347 pub const HALF: Self = Self(0x01); 1428 pub const ERROR: Self = Self(0x01);
1348 #[doc = "3/4 full FIFO"]
1349 pub const THREEQUARTERS: Self = Self(0x02);
1350 #[doc = "Full FIFO"]
1351 pub const FULL: Self = Self(0x03);
1352 } 1429 }
1353 #[repr(transparent)] 1430 #[repr(transparent)]
1354 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1431 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1355 pub struct Ct(pub u8); 1432 pub struct Bidimode(pub u8);
1356 impl Ct { 1433 impl Bidimode {
1357 #[doc = "The current target memory is Memory 0"] 1434 #[doc = "2-line unidirectional data mode selected"]
1358 pub const MEMORY0: Self = Self(0); 1435 pub const UNIDIRECTIONAL: Self = Self(0);
1359 #[doc = "The current target memory is Memory 1"] 1436 #[doc = "1-line bidirectional data mode selected"]
1360 pub const MEMORY1: Self = Self(0x01); 1437 pub const BIDIRECTIONAL: Self = Self(0x01);
1361 } 1438 }
1362 #[repr(transparent)] 1439 #[repr(transparent)]
1363 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1440 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1364 pub struct Burst(pub u8); 1441 pub struct Bidioe(pub u8);
1365 impl Burst { 1442 impl Bidioe {
1366 #[doc = "Single transfer"] 1443 #[doc = "Output disabled (receive-only mode)"]
1367 pub const SINGLE: Self = Self(0); 1444 pub const OUTPUTDISABLED: Self = Self(0);
1368 #[doc = "Incremental burst of 4 beats"] 1445 #[doc = "Output enabled (transmit-only mode)"]
1369 pub const INCR4: Self = Self(0x01); 1446 pub const OUTPUTENABLED: Self = Self(0x01);
1370 #[doc = "Incremental burst of 8 beats"]
1371 pub const INCR8: Self = Self(0x02);
1372 #[doc = "Incremental burst of 16 beats"]
1373 pub const INCR16: Self = Self(0x03);
1374 } 1447 }
1375 #[repr(transparent)] 1448 #[repr(transparent)]
1376 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1449 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1377 pub struct Inc(pub u8); 1450 pub struct Frf(pub u8);
1378 impl Inc { 1451 impl Frf {
1379 #[doc = "Address pointer is fixed"] 1452 #[doc = "SPI Motorola mode"]
1380 pub const FIXED: Self = Self(0); 1453 pub const MOTOROLA: Self = Self(0);
1381 #[doc = "Address pointer is incremented after each data transfer"] 1454 #[doc = "SPI TI mode"]
1382 pub const INCREMENTED: Self = Self(0x01); 1455 pub const TI: Self = Self(0x01);
1383 } 1456 }
1384 #[repr(transparent)] 1457 #[repr(transparent)]
1385 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1458 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1386 pub struct Pincos(pub u8); 1459 pub struct Cpha(pub u8);
1387 impl Pincos { 1460 impl Cpha {
1388 #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"] 1461 #[doc = "The first clock transition is the first data capture edge"]
1389 pub const PSIZE: Self = Self(0); 1462 pub const FIRSTEDGE: Self = Self(0);
1390 #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"] 1463 #[doc = "The second clock transition is the first data capture edge"]
1391 pub const FIXED4: Self = Self(0x01); 1464 pub const SECONDEDGE: Self = Self(0x01);
1392 }
1393 }
1394}
1395pub mod dma_v1 {
1396 use crate::generic::*;
1397 #[doc = "Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers"]
1398 #[derive(Copy, Clone)]
1399 pub struct Ch(pub *mut u8);
1400 unsafe impl Send for Ch {}
1401 unsafe impl Sync for Ch {}
1402 impl Ch {
1403 #[doc = "DMA channel configuration register (DMA_CCR)"]
1404 pub fn cr(self) -> Reg<regs::Cr, RW> {
1405 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1406 }
1407 #[doc = "DMA channel 1 number of data register"]
1408 pub fn ndtr(self) -> Reg<regs::Ndtr, RW> {
1409 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1410 }
1411 #[doc = "DMA channel 1 peripheral address register"]
1412 pub fn par(self) -> Reg<u32, RW> {
1413 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1414 }
1415 #[doc = "DMA channel 1 memory address register"]
1416 pub fn mar(self) -> Reg<u32, RW> {
1417 unsafe { Reg::from_ptr(self.0.add(12usize)) }
1418 }
1419 }
1420 #[doc = "DMA controller"]
1421 #[derive(Copy, Clone)]
1422 pub struct Dma(pub *mut u8);
1423 unsafe impl Send for Dma {}
1424 unsafe impl Sync for Dma {}
1425 impl Dma {
1426 #[doc = "DMA interrupt status register (DMA_ISR)"]
1427 pub fn isr(self) -> Reg<regs::Isr, R> {
1428 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1429 }
1430 #[doc = "DMA interrupt flag clear register (DMA_IFCR)"]
1431 pub fn ifcr(self) -> Reg<regs::Ifcr, W> {
1432 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1433 }
1434 #[doc = "Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers"]
1435 pub fn ch(self, n: usize) -> Ch {
1436 assert!(n < 7usize);
1437 unsafe { Ch(self.0.add(8usize + n * 20usize)) }
1438 } 1465 }
1439 } 1466 }
1440 pub mod regs { 1467 pub mod regs {
1441 use crate::generic::*; 1468 use crate::generic::*;
1442 #[doc = "DMA interrupt flag clear register (DMA_IFCR)"] 1469 #[doc = "RX CRC register"]
1443 #[repr(transparent)] 1470 #[repr(transparent)]
1444 #[derive(Copy, Clone, Eq, PartialEq)] 1471 #[derive(Copy, Clone, Eq, PartialEq)]
1445 pub struct Ifcr(pub u32); 1472 pub struct Rxcrcr(pub u32);
1446 impl Ifcr { 1473 impl Rxcrcr {
1447 #[doc = "Channel 1 Global interrupt clear"] 1474 #[doc = "Rx CRC register"]
1448 pub fn cgif(&self, n: usize) -> bool { 1475 pub const fn rx_crc(&self) -> u16 {
1449 assert!(n < 7usize); 1476 let val = (self.0 >> 0usize) & 0xffff;
1450 let offs = 0usize + n * 4usize; 1477 val as u16
1451 let val = (self.0 >> offs) & 0x01; 1478 }
1479 #[doc = "Rx CRC register"]
1480 pub fn set_rx_crc(&mut self, val: u16) {
1481 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1482 }
1483 }
1484 impl Default for Rxcrcr {
1485 fn default() -> Rxcrcr {
1486 Rxcrcr(0)
1487 }
1488 }
1489 #[doc = "status register"]
1490 #[repr(transparent)]
1491 #[derive(Copy, Clone, Eq, PartialEq)]
1492 pub struct Sr(pub u32);
1493 impl Sr {
1494 #[doc = "Receive buffer not empty"]
1495 pub const fn rxne(&self) -> bool {
1496 let val = (self.0 >> 0usize) & 0x01;
1452 val != 0 1497 val != 0
1453 } 1498 }
1454 #[doc = "Channel 1 Global interrupt clear"] 1499 #[doc = "Receive buffer not empty"]
1455 pub fn set_cgif(&mut self, n: usize, val: bool) { 1500 pub fn set_rxne(&mut self, val: bool) {
1456 assert!(n < 7usize); 1501 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1457 let offs = 0usize + n * 4usize;
1458 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1459 } 1502 }
1460 #[doc = "Channel 1 Transfer Complete clear"] 1503 #[doc = "Transmit buffer empty"]
1461 pub fn ctcif(&self, n: usize) -> bool { 1504 pub const fn txe(&self) -> bool {
1462 assert!(n < 7usize); 1505 let val = (self.0 >> 1usize) & 0x01;
1463 let offs = 1usize + n * 4usize;
1464 let val = (self.0 >> offs) & 0x01;
1465 val != 0 1506 val != 0
1466 } 1507 }
1467 #[doc = "Channel 1 Transfer Complete clear"] 1508 #[doc = "Transmit buffer empty"]
1468 pub fn set_ctcif(&mut self, n: usize, val: bool) { 1509 pub fn set_txe(&mut self, val: bool) {
1469 assert!(n < 7usize); 1510 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
1470 let offs = 1usize + n * 4usize;
1471 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1472 } 1511 }
1473 #[doc = "Channel 1 Half Transfer clear"] 1512 #[doc = "CRC error flag"]
1474 pub fn chtif(&self, n: usize) -> bool { 1513 pub const fn crcerr(&self) -> bool {
1475 assert!(n < 7usize); 1514 let val = (self.0 >> 4usize) & 0x01;
1476 let offs = 2usize + n * 4usize;
1477 let val = (self.0 >> offs) & 0x01;
1478 val != 0 1515 val != 0
1479 } 1516 }
1480 #[doc = "Channel 1 Half Transfer clear"] 1517 #[doc = "CRC error flag"]
1481 pub fn set_chtif(&mut self, n: usize, val: bool) { 1518 pub fn set_crcerr(&mut self, val: bool) {
1482 assert!(n < 7usize); 1519 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
1483 let offs = 2usize + n * 4usize;
1484 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1485 } 1520 }
1486 #[doc = "Channel 1 Transfer Error clear"] 1521 #[doc = "Mode fault"]
1487 pub fn cteif(&self, n: usize) -> bool { 1522 pub const fn modf(&self) -> bool {
1488 assert!(n < 7usize); 1523 let val = (self.0 >> 5usize) & 0x01;
1489 let offs = 3usize + n * 4usize;
1490 let val = (self.0 >> offs) & 0x01;
1491 val != 0 1524 val != 0
1492 } 1525 }
1493 #[doc = "Channel 1 Transfer Error clear"] 1526 #[doc = "Mode fault"]
1494 pub fn set_cteif(&mut self, n: usize, val: bool) { 1527 pub fn set_modf(&mut self, val: bool) {
1495 assert!(n < 7usize); 1528 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
1496 let offs = 3usize + n * 4usize; 1529 }
1497 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); 1530 #[doc = "Overrun flag"]
1531 pub const fn ovr(&self) -> bool {
1532 let val = (self.0 >> 6usize) & 0x01;
1533 val != 0
1534 }
1535 #[doc = "Overrun flag"]
1536 pub fn set_ovr(&mut self, val: bool) {
1537 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1538 }
1539 #[doc = "Busy flag"]
1540 pub const fn bsy(&self) -> bool {
1541 let val = (self.0 >> 7usize) & 0x01;
1542 val != 0
1543 }
1544 #[doc = "Busy flag"]
1545 pub fn set_bsy(&mut self, val: bool) {
1546 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
1547 }
1548 #[doc = "TI frame format error"]
1549 pub const fn fre(&self) -> bool {
1550 let val = (self.0 >> 8usize) & 0x01;
1551 val != 0
1552 }
1553 #[doc = "TI frame format error"]
1554 pub fn set_fre(&mut self, val: bool) {
1555 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
1498 } 1556 }
1499 } 1557 }
1500 impl Default for Ifcr { 1558 impl Default for Sr {
1501 fn default() -> Ifcr { 1559 fn default() -> Sr {
1502 Ifcr(0) 1560 Sr(0)
1503 } 1561 }
1504 } 1562 }
1505 #[doc = "DMA channel configuration register (DMA_CCR)"] 1563 #[doc = "control register 1"]
1506 #[repr(transparent)] 1564 #[repr(transparent)]
1507 #[derive(Copy, Clone, Eq, PartialEq)] 1565 #[derive(Copy, Clone, Eq, PartialEq)]
1508 pub struct Cr(pub u32); 1566 pub struct Cr1(pub u32);
1509 impl Cr { 1567 impl Cr1 {
1510 #[doc = "Channel enable"] 1568 #[doc = "Clock phase"]
1511 pub const fn en(&self) -> bool { 1569 pub const fn cpha(&self) -> super::vals::Cpha {
1512 let val = (self.0 >> 0usize) & 0x01; 1570 let val = (self.0 >> 0usize) & 0x01;
1513 val != 0 1571 super::vals::Cpha(val as u8)
1514 } 1572 }
1515 #[doc = "Channel enable"] 1573 #[doc = "Clock phase"]
1516 pub fn set_en(&mut self, val: bool) { 1574 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
1517 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 1575 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
1518 } 1576 }
1519 #[doc = "Transfer complete interrupt enable"] 1577 #[doc = "Clock polarity"]
1520 pub const fn tcie(&self) -> bool { 1578 pub const fn cpol(&self) -> super::vals::Cpol {
1521 let val = (self.0 >> 1usize) & 0x01; 1579 let val = (self.0 >> 1usize) & 0x01;
1522 val != 0 1580 super::vals::Cpol(val as u8)
1523 } 1581 }
1524 #[doc = "Transfer complete interrupt enable"] 1582 #[doc = "Clock polarity"]
1525 pub fn set_tcie(&mut self, val: bool) { 1583 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
1526 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 1584 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
1527 } 1585 }
1528 #[doc = "Half Transfer interrupt enable"] 1586 #[doc = "Master selection"]
1529 pub const fn htie(&self) -> bool { 1587 pub const fn mstr(&self) -> super::vals::Mstr {
1530 let val = (self.0 >> 2usize) & 0x01; 1588 let val = (self.0 >> 2usize) & 0x01;
1531 val != 0 1589 super::vals::Mstr(val as u8)
1532 } 1590 }
1533 #[doc = "Half Transfer interrupt enable"] 1591 #[doc = "Master selection"]
1534 pub fn set_htie(&mut self, val: bool) { 1592 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
1535 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 1593 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
1536 } 1594 }
1537 #[doc = "Transfer error interrupt enable"] 1595 #[doc = "Baud rate control"]
1538 pub const fn teie(&self) -> bool { 1596 pub const fn br(&self) -> super::vals::Br {
1539 let val = (self.0 >> 3usize) & 0x01; 1597 let val = (self.0 >> 3usize) & 0x07;
1598 super::vals::Br(val as u8)
1599 }
1600 #[doc = "Baud rate control"]
1601 pub fn set_br(&mut self, val: super::vals::Br) {
1602 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
1603 }
1604 #[doc = "SPI enable"]
1605 pub const fn spe(&self) -> bool {
1606 let val = (self.0 >> 6usize) & 0x01;
1540 val != 0 1607 val != 0
1541 } 1608 }
1542 #[doc = "Transfer error interrupt enable"] 1609 #[doc = "SPI enable"]
1543 pub fn set_teie(&mut self, val: bool) { 1610 pub fn set_spe(&mut self, val: bool) {
1544 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 1611 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1545 } 1612 }
1546 #[doc = "Data transfer direction"] 1613 #[doc = "Frame format"]
1547 pub const fn dir(&self) -> super::vals::Dir { 1614 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst {
1548 let val = (self.0 >> 4usize) & 0x01; 1615 let val = (self.0 >> 7usize) & 0x01;
1549 super::vals::Dir(val as u8) 1616 super::vals::Lsbfirst(val as u8)
1550 } 1617 }
1551 #[doc = "Data transfer direction"] 1618 #[doc = "Frame format"]
1552 pub fn set_dir(&mut self, val: super::vals::Dir) { 1619 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) {
1553 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 1620 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
1554 } 1621 }
1555 #[doc = "Circular mode"] 1622 #[doc = "Internal slave select"]
1556 pub const fn circ(&self) -> super::vals::Circ { 1623 pub const fn ssi(&self) -> bool {
1557 let val = (self.0 >> 5usize) & 0x01; 1624 let val = (self.0 >> 8usize) & 0x01;
1558 super::vals::Circ(val as u8) 1625 val != 0
1559 } 1626 }
1560 #[doc = "Circular mode"] 1627 #[doc = "Internal slave select"]
1561 pub fn set_circ(&mut self, val: super::vals::Circ) { 1628 pub fn set_ssi(&mut self, val: bool) {
1562 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 1629 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
1563 } 1630 }
1564 #[doc = "Peripheral increment mode"] 1631 #[doc = "Software slave management"]
1565 pub const fn pinc(&self) -> super::vals::Inc { 1632 pub const fn ssm(&self) -> bool {
1566 let val = (self.0 >> 6usize) & 0x01; 1633 let val = (self.0 >> 9usize) & 0x01;
1567 super::vals::Inc(val as u8) 1634 val != 0
1568 } 1635 }
1569 #[doc = "Peripheral increment mode"] 1636 #[doc = "Software slave management"]
1570 pub fn set_pinc(&mut self, val: super::vals::Inc) { 1637 pub fn set_ssm(&mut self, val: bool) {
1571 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 1638 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
1572 } 1639 }
1573 #[doc = "Memory increment mode"] 1640 #[doc = "Receive only"]
1574 pub const fn minc(&self) -> super::vals::Inc { 1641 pub const fn rxonly(&self) -> super::vals::Rxonly {
1575 let val = (self.0 >> 7usize) & 0x01; 1642 let val = (self.0 >> 10usize) & 0x01;
1576 super::vals::Inc(val as u8) 1643 super::vals::Rxonly(val as u8)
1577 } 1644 }
1578 #[doc = "Memory increment mode"] 1645 #[doc = "Receive only"]
1579 pub fn set_minc(&mut self, val: super::vals::Inc) { 1646 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
1580 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 1647 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
1581 } 1648 }
1582 #[doc = "Peripheral size"] 1649 #[doc = "Data frame format"]
1583 pub const fn psize(&self) -> super::vals::Size { 1650 pub const fn dff(&self) -> super::vals::Dff {
1584 let val = (self.0 >> 8usize) & 0x03; 1651 let val = (self.0 >> 11usize) & 0x01;
1585 super::vals::Size(val as u8) 1652 super::vals::Dff(val as u8)
1586 } 1653 }
1587 #[doc = "Peripheral size"] 1654 #[doc = "Data frame format"]
1588 pub fn set_psize(&mut self, val: super::vals::Size) { 1655 pub fn set_dff(&mut self, val: super::vals::Dff) {
1589 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); 1656 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
1590 } 1657 }
1591 #[doc = "Memory size"] 1658 #[doc = "CRC transfer next"]
1592 pub const fn msize(&self) -> super::vals::Size { 1659 pub const fn crcnext(&self) -> super::vals::Crcnext {
1593 let val = (self.0 >> 10usize) & 0x03; 1660 let val = (self.0 >> 12usize) & 0x01;
1594 super::vals::Size(val as u8) 1661 super::vals::Crcnext(val as u8)
1595 } 1662 }
1596 #[doc = "Memory size"] 1663 #[doc = "CRC transfer next"]
1597 pub fn set_msize(&mut self, val: super::vals::Size) { 1664 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
1598 self.0 = (self.0 & !(0x03 << 10usize)) | (((val.0 as u32) & 0x03) << 10usize); 1665 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
1599 } 1666 }
1600 #[doc = "Channel Priority level"] 1667 #[doc = "Hardware CRC calculation enable"]
1601 pub const fn pl(&self) -> super::vals::Pl { 1668 pub const fn crcen(&self) -> bool {
1602 let val = (self.0 >> 12usize) & 0x03; 1669 let val = (self.0 >> 13usize) & 0x01;
1603 super::vals::Pl(val as u8) 1670 val != 0
1604 } 1671 }
1605 #[doc = "Channel Priority level"] 1672 #[doc = "Hardware CRC calculation enable"]
1606 pub fn set_pl(&mut self, val: super::vals::Pl) { 1673 pub fn set_crcen(&mut self, val: bool) {
1607 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); 1674 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
1608 } 1675 }
1609 #[doc = "Memory to memory mode"] 1676 #[doc = "Output enable in bidirectional mode"]
1610 pub const fn mem2mem(&self) -> super::vals::Memmem { 1677 pub const fn bidioe(&self) -> super::vals::Bidioe {
1611 let val = (self.0 >> 14usize) & 0x01; 1678 let val = (self.0 >> 14usize) & 0x01;
1612 super::vals::Memmem(val as u8) 1679 super::vals::Bidioe(val as u8)
1613 } 1680 }
1614 #[doc = "Memory to memory mode"] 1681 #[doc = "Output enable in bidirectional mode"]
1615 pub fn set_mem2mem(&mut self, val: super::vals::Memmem) { 1682 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) {
1616 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 1683 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
1617 } 1684 }
1685 #[doc = "Bidirectional data mode enable"]
1686 pub const fn bidimode(&self) -> super::vals::Bidimode {
1687 let val = (self.0 >> 15usize) & 0x01;
1688 super::vals::Bidimode(val as u8)
1689 }
1690 #[doc = "Bidirectional data mode enable"]
1691 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) {
1692 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
1693 }
1618 } 1694 }
1619 impl Default for Cr { 1695 impl Default for Cr1 {
1620 fn default() -> Cr { 1696 fn default() -> Cr1 {
1621 Cr(0) 1697 Cr1(0)
1622 } 1698 }
1623 } 1699 }
1624 #[doc = "DMA channel 1 number of data register"] 1700 #[doc = "data register"]
1625 #[repr(transparent)] 1701 #[repr(transparent)]
1626 #[derive(Copy, Clone, Eq, PartialEq)] 1702 #[derive(Copy, Clone, Eq, PartialEq)]
1627 pub struct Ndtr(pub u32); 1703 pub struct Dr(pub u32);
1628 impl Ndtr { 1704 impl Dr {
1629 #[doc = "Number of data to transfer"] 1705 #[doc = "Data register"]
1630 pub const fn ndt(&self) -> u16 { 1706 pub const fn dr(&self) -> u16 {
1631 let val = (self.0 >> 0usize) & 0xffff; 1707 let val = (self.0 >> 0usize) & 0xffff;
1632 val as u16 1708 val as u16
1633 } 1709 }
1634 #[doc = "Number of data to transfer"] 1710 #[doc = "Data register"]
1635 pub fn set_ndt(&mut self, val: u16) { 1711 pub fn set_dr(&mut self, val: u16) {
1636 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 1712 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1637 } 1713 }
1638 } 1714 }
1639 impl Default for Ndtr { 1715 impl Default for Dr {
1640 fn default() -> Ndtr { 1716 fn default() -> Dr {
1641 Ndtr(0) 1717 Dr(0)
1642 } 1718 }
1643 } 1719 }
1644 #[doc = "DMA interrupt status register (DMA_ISR)"] 1720 #[doc = "TX CRC register"]
1645 #[repr(transparent)] 1721 #[repr(transparent)]
1646 #[derive(Copy, Clone, Eq, PartialEq)] 1722 #[derive(Copy, Clone, Eq, PartialEq)]
1647 pub struct Isr(pub u32); 1723 pub struct Txcrcr(pub u32);
1648 impl Isr { 1724 impl Txcrcr {
1649 #[doc = "Channel 1 Global interrupt flag"] 1725 #[doc = "Tx CRC register"]
1650 pub fn gif(&self, n: usize) -> bool { 1726 pub const fn tx_crc(&self) -> u16 {
1651 assert!(n < 7usize); 1727 let val = (self.0 >> 0usize) & 0xffff;
1652 let offs = 0usize + n * 4usize; 1728 val as u16
1653 let val = (self.0 >> offs) & 0x01;
1654 val != 0
1655 }
1656 #[doc = "Channel 1 Global interrupt flag"]
1657 pub fn set_gif(&mut self, n: usize, val: bool) {
1658 assert!(n < 7usize);
1659 let offs = 0usize + n * 4usize;
1660 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1661 }
1662 #[doc = "Channel 1 Transfer Complete flag"]
1663 pub fn tcif(&self, n: usize) -> bool {
1664 assert!(n < 7usize);
1665 let offs = 1usize + n * 4usize;
1666 let val = (self.0 >> offs) & 0x01;
1667 val != 0
1668 }
1669 #[doc = "Channel 1 Transfer Complete flag"]
1670 pub fn set_tcif(&mut self, n: usize, val: bool) {
1671 assert!(n < 7usize);
1672 let offs = 1usize + n * 4usize;
1673 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1674 }
1675 #[doc = "Channel 1 Half Transfer Complete flag"]
1676 pub fn htif(&self, n: usize) -> bool {
1677 assert!(n < 7usize);
1678 let offs = 2usize + n * 4usize;
1679 let val = (self.0 >> offs) & 0x01;
1680 val != 0
1681 }
1682 #[doc = "Channel 1 Half Transfer Complete flag"]
1683 pub fn set_htif(&mut self, n: usize, val: bool) {
1684 assert!(n < 7usize);
1685 let offs = 2usize + n * 4usize;
1686 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1687 }
1688 #[doc = "Channel 1 Transfer Error flag"]
1689 pub fn teif(&self, n: usize) -> bool {
1690 assert!(n < 7usize);
1691 let offs = 3usize + n * 4usize;
1692 let val = (self.0 >> offs) & 0x01;
1693 val != 0
1694 } 1729 }
1695 #[doc = "Channel 1 Transfer Error flag"] 1730 #[doc = "Tx CRC register"]
1696 pub fn set_teif(&mut self, n: usize, val: bool) { 1731 pub fn set_tx_crc(&mut self, val: u16) {
1697 assert!(n < 7usize); 1732 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1698 let offs = 3usize + n * 4usize;
1699 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1700 } 1733 }
1701 } 1734 }
1702 impl Default for Isr { 1735 impl Default for Txcrcr {
1703 fn default() -> Isr { 1736 fn default() -> Txcrcr {
1704 Isr(0) 1737 Txcrcr(0)
1705 } 1738 }
1706 } 1739 }
1707 } 1740 #[doc = "control register 2"]
1708 pub mod vals {
1709 use crate::generic::*;
1710 #[repr(transparent)]
1711 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1712 pub struct Inc(pub u8);
1713 impl Inc {
1714 #[doc = "Increment mode disabled"]
1715 pub const DISABLED: Self = Self(0);
1716 #[doc = "Increment mode enabled"]
1717 pub const ENABLED: Self = Self(0x01);
1718 }
1719 #[repr(transparent)]
1720 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1721 pub struct Dir(pub u8);
1722 impl Dir {
1723 #[doc = "Read from peripheral"]
1724 pub const FROMPERIPHERAL: Self = Self(0);
1725 #[doc = "Read from memory"]
1726 pub const FROMMEMORY: Self = Self(0x01);
1727 }
1728 #[repr(transparent)]
1729 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1730 pub struct Size(pub u8);
1731 impl Size {
1732 #[doc = "8-bit size"]
1733 pub const BITS8: Self = Self(0);
1734 #[doc = "16-bit size"]
1735 pub const BITS16: Self = Self(0x01);
1736 #[doc = "32-bit size"]
1737 pub const BITS32: Self = Self(0x02);
1738 }
1739 #[repr(transparent)]
1740 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1741 pub struct Circ(pub u8);
1742 impl Circ {
1743 #[doc = "Circular buffer disabled"]
1744 pub const DISABLED: Self = Self(0);
1745 #[doc = "Circular buffer enabled"]
1746 pub const ENABLED: Self = Self(0x01);
1747 }
1748 #[repr(transparent)]
1749 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1750 pub struct Pl(pub u8);
1751 impl Pl {
1752 #[doc = "Low priority"]
1753 pub const LOW: Self = Self(0);
1754 #[doc = "Medium priority"]
1755 pub const MEDIUM: Self = Self(0x01);
1756 #[doc = "High priority"]
1757 pub const HIGH: Self = Self(0x02);
1758 #[doc = "Very high priority"]
1759 pub const VERYHIGH: Self = Self(0x03);
1760 }
1761 #[repr(transparent)]
1762 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1763 pub struct Memmem(pub u8);
1764 impl Memmem {
1765 #[doc = "Memory to memory mode disabled"]
1766 pub const DISABLED: Self = Self(0);
1767 #[doc = "Memory to memory mode enabled"]
1768 pub const ENABLED: Self = Self(0x01);
1769 }
1770 }
1771}
1772pub mod syscfg_f4 {
1773 use crate::generic::*;
1774 #[doc = "System configuration controller"]
1775 #[derive(Copy, Clone)]
1776 pub struct Syscfg(pub *mut u8);
1777 unsafe impl Send for Syscfg {}
1778 unsafe impl Sync for Syscfg {}
1779 impl Syscfg {
1780 #[doc = "memory remap register"]
1781 pub fn memrm(self) -> Reg<regs::Memrm, RW> {
1782 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1783 }
1784 #[doc = "peripheral mode configuration register"]
1785 pub fn pmc(self) -> Reg<regs::Pmc, RW> {
1786 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1787 }
1788 #[doc = "external interrupt configuration register"]
1789 pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> {
1790 assert!(n < 4usize);
1791 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
1792 }
1793 #[doc = "Compensation cell control register"]
1794 pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> {
1795 unsafe { Reg::from_ptr(self.0.add(32usize)) }
1796 }
1797 }
1798 pub mod regs {
1799 use crate::generic::*;
1800 #[doc = "Compensation cell control register"]
1801 #[repr(transparent)] 1741 #[repr(transparent)]
1802 #[derive(Copy, Clone, Eq, PartialEq)] 1742 #[derive(Copy, Clone, Eq, PartialEq)]
1803 pub struct Cmpcr(pub u32); 1743 pub struct Cr2(pub u32);
1804 impl Cmpcr { 1744 impl Cr2 {
1805 #[doc = "Compensation cell power-down"] 1745 #[doc = "Rx buffer DMA enable"]
1806 pub const fn cmp_pd(&self) -> bool { 1746 pub const fn rxdmaen(&self) -> bool {
1807 let val = (self.0 >> 0usize) & 0x01; 1747 let val = (self.0 >> 0usize) & 0x01;
1808 val != 0 1748 val != 0
1809 } 1749 }
1810 #[doc = "Compensation cell power-down"] 1750 #[doc = "Rx buffer DMA enable"]
1811 pub fn set_cmp_pd(&mut self, val: bool) { 1751 pub fn set_rxdmaen(&mut self, val: bool) {
1812 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 1752 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1813 } 1753 }
1814 #[doc = "READY"] 1754 #[doc = "Tx buffer DMA enable"]
1815 pub const fn ready(&self) -> bool { 1755 pub const fn txdmaen(&self) -> bool {
1816 let val = (self.0 >> 8usize) & 0x01; 1756 let val = (self.0 >> 1usize) & 0x01;
1817 val != 0 1757 val != 0
1818 } 1758 }
1819 #[doc = "READY"] 1759 #[doc = "Tx buffer DMA enable"]
1820 pub fn set_ready(&mut self, val: bool) { 1760 pub fn set_txdmaen(&mut self, val: bool) {
1821 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 1761 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
1822 }
1823 }
1824 impl Default for Cmpcr {
1825 fn default() -> Cmpcr {
1826 Cmpcr(0)
1827 }
1828 }
1829 #[doc = "memory remap register"]
1830 #[repr(transparent)]
1831 #[derive(Copy, Clone, Eq, PartialEq)]
1832 pub struct Memrm(pub u32);
1833 impl Memrm {
1834 #[doc = "Memory mapping selection"]
1835 pub const fn mem_mode(&self) -> u8 {
1836 let val = (self.0 >> 0usize) & 0x07;
1837 val as u8
1838 }
1839 #[doc = "Memory mapping selection"]
1840 pub fn set_mem_mode(&mut self, val: u8) {
1841 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
1842 } 1762 }
1843 #[doc = "Flash bank mode selection"] 1763 #[doc = "SS output enable"]
1844 pub const fn fb_mode(&self) -> bool { 1764 pub const fn ssoe(&self) -> bool {
1845 let val = (self.0 >> 8usize) & 0x01; 1765 let val = (self.0 >> 2usize) & 0x01;
1846 val != 0 1766 val != 0
1847 } 1767 }
1848 #[doc = "Flash bank mode selection"] 1768 #[doc = "SS output enable"]
1849 pub fn set_fb_mode(&mut self, val: bool) { 1769 pub fn set_ssoe(&mut self, val: bool) {
1850 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 1770 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
1851 }
1852 #[doc = "FMC memory mapping swap"]
1853 pub const fn swp_fmc(&self) -> u8 {
1854 let val = (self.0 >> 10usize) & 0x03;
1855 val as u8
1856 }
1857 #[doc = "FMC memory mapping swap"]
1858 pub fn set_swp_fmc(&mut self, val: u8) {
1859 self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize);
1860 }
1861 }
1862 impl Default for Memrm {
1863 fn default() -> Memrm {
1864 Memrm(0)
1865 } 1771 }
1866 } 1772 #[doc = "Frame format"]
1867 #[doc = "peripheral mode configuration register"] 1773 pub const fn frf(&self) -> super::vals::Frf {
1868 #[repr(transparent)] 1774 let val = (self.0 >> 4usize) & 0x01;
1869 #[derive(Copy, Clone, Eq, PartialEq)] 1775 super::vals::Frf(val as u8)
1870 pub struct Pmc(pub u32);
1871 impl Pmc {
1872 #[doc = "ADC1DC2"]
1873 pub const fn adc1dc2(&self) -> bool {
1874 let val = (self.0 >> 16usize) & 0x01;
1875 val != 0
1876 } 1776 }
1877 #[doc = "ADC1DC2"] 1777 #[doc = "Frame format"]
1878 pub fn set_adc1dc2(&mut self, val: bool) { 1778 pub fn set_frf(&mut self, val: super::vals::Frf) {
1879 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 1779 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
1880 } 1780 }
1881 #[doc = "ADC2DC2"] 1781 #[doc = "Error interrupt enable"]
1882 pub const fn adc2dc2(&self) -> bool { 1782 pub const fn errie(&self) -> bool {
1883 let val = (self.0 >> 17usize) & 0x01; 1783 let val = (self.0 >> 5usize) & 0x01;
1884 val != 0 1784 val != 0
1885 } 1785 }
1886 #[doc = "ADC2DC2"] 1786 #[doc = "Error interrupt enable"]
1887 pub fn set_adc2dc2(&mut self, val: bool) { 1787 pub fn set_errie(&mut self, val: bool) {
1888 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 1788 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
1889 } 1789 }
1890 #[doc = "ADC3DC2"] 1790 #[doc = "RX buffer not empty interrupt enable"]
1891 pub const fn adc3dc2(&self) -> bool { 1791 pub const fn rxneie(&self) -> bool {
1892 let val = (self.0 >> 18usize) & 0x01; 1792 let val = (self.0 >> 6usize) & 0x01;
1893 val != 0 1793 val != 0
1894 } 1794 }
1895 #[doc = "ADC3DC2"] 1795 #[doc = "RX buffer not empty interrupt enable"]
1896 pub fn set_adc3dc2(&mut self, val: bool) { 1796 pub fn set_rxneie(&mut self, val: bool) {
1897 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 1797 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1898 } 1798 }
1899 #[doc = "Ethernet PHY interface selection"] 1799 #[doc = "Tx buffer empty interrupt enable"]
1900 pub const fn mii_rmii_sel(&self) -> bool { 1800 pub const fn txeie(&self) -> bool {
1901 let val = (self.0 >> 23usize) & 0x01; 1801 let val = (self.0 >> 7usize) & 0x01;
1902 val != 0 1802 val != 0
1903 } 1803 }
1904 #[doc = "Ethernet PHY interface selection"] 1804 #[doc = "Tx buffer empty interrupt enable"]
1905 pub fn set_mii_rmii_sel(&mut self, val: bool) { 1805 pub fn set_txeie(&mut self, val: bool) {
1906 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); 1806 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
1907 } 1807 }
1908 } 1808 }
1909 impl Default for Pmc { 1809 impl Default for Cr2 {
1910 fn default() -> Pmc { 1810 fn default() -> Cr2 {
1911 Pmc(0) 1811 Cr2(0)
1912 } 1812 }
1913 } 1813 }
1914 #[doc = "external interrupt configuration register"] 1814 #[doc = "CRC polynomial register"]
1915 #[repr(transparent)] 1815 #[repr(transparent)]
1916 #[derive(Copy, Clone, Eq, PartialEq)] 1816 #[derive(Copy, Clone, Eq, PartialEq)]
1917 pub struct Exticr(pub u32); 1817 pub struct Crcpr(pub u32);
1918 impl Exticr { 1818 impl Crcpr {
1919 #[doc = "EXTI x configuration"] 1819 #[doc = "CRC polynomial register"]
1920 pub fn exti(&self, n: usize) -> u8 { 1820 pub const fn crcpoly(&self) -> u16 {
1921 assert!(n < 4usize); 1821 let val = (self.0 >> 0usize) & 0xffff;
1922 let offs = 0usize + n * 4usize; 1822 val as u16
1923 let val = (self.0 >> offs) & 0x0f;
1924 val as u8
1925 } 1823 }
1926 #[doc = "EXTI x configuration"] 1824 #[doc = "CRC polynomial register"]
1927 pub fn set_exti(&mut self, n: usize, val: u8) { 1825 pub fn set_crcpoly(&mut self, val: u16) {
1928 assert!(n < 4usize); 1826 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1929 let offs = 0usize + n * 4usize;
1930 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
1931 } 1827 }
1932 } 1828 }
1933 impl Default for Exticr { 1829 impl Default for Crcpr {
1934 fn default() -> Exticr { 1830 fn default() -> Crcpr {
1935 Exticr(0) 1831 Crcpr(0)
1936 } 1832 }
1937 } 1833 }
1938 } 1834 }
1939} 1835}
1940pub mod rcc_l0 { 1836pub mod timer_v1 {
1941 use crate::generic::*; 1837 use crate::generic::*;
1942 #[doc = "Reset and clock control"] 1838 #[doc = "General purpose 16-bit timer"]
1943 #[derive(Copy, Clone)] 1839 #[derive(Copy, Clone)]
1944 pub struct Rcc(pub *mut u8); 1840 pub struct TimGp16(pub *mut u8);
1945 unsafe impl Send for Rcc {} 1841 unsafe impl Send for TimGp16 {}
1946 unsafe impl Sync for Rcc {} 1842 unsafe impl Sync for TimGp16 {}
1947 impl Rcc { 1843 impl TimGp16 {
1948 #[doc = "Clock control register"] 1844 #[doc = "control register 1"]
1949 pub fn cr(self) -> Reg<regs::Cr, RW> { 1845 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
1950 unsafe { Reg::from_ptr(self.0.add(0usize)) } 1846 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1951 } 1847 }
1952 #[doc = "Internal clock sources calibration register"] 1848 #[doc = "control register 2"]
1953 pub fn icscr(self) -> Reg<regs::Icscr, RW> { 1849 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
1954 unsafe { Reg::from_ptr(self.0.add(4usize)) } 1850 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1955 } 1851 }
1956 #[doc = "Clock recovery RC register"] 1852 #[doc = "slave mode control register"]
1957 pub fn crrcr(self) -> Reg<regs::Crrcr, RW> { 1853 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
1958 unsafe { Reg::from_ptr(self.0.add(8usize)) } 1854 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1959 } 1855 }
1960 #[doc = "Clock configuration register"] 1856 #[doc = "DMA/Interrupt enable register"]
1961 pub fn cfgr(self) -> Reg<regs::Cfgr, RW> { 1857 pub fn dier(self) -> Reg<regs::DierGp, RW> {
1962 unsafe { Reg::from_ptr(self.0.add(12usize)) } 1858 unsafe { Reg::from_ptr(self.0.add(12usize)) }
1963 } 1859 }
1964 #[doc = "Clock interrupt enable register"] 1860 #[doc = "status register"]
1965 pub fn cier(self) -> Reg<regs::Cier, R> { 1861 pub fn sr(self) -> Reg<regs::SrGp, RW> {
1966 unsafe { Reg::from_ptr(self.0.add(16usize)) } 1862 unsafe { Reg::from_ptr(self.0.add(16usize)) }
1967 } 1863 }
1968 #[doc = "Clock interrupt flag register"] 1864 #[doc = "event generation register"]
1969 pub fn cifr(self) -> Reg<regs::Cifr, R> { 1865 pub fn egr(self) -> Reg<regs::EgrGp, W> {
1970 unsafe { Reg::from_ptr(self.0.add(20usize)) } 1866 unsafe { Reg::from_ptr(self.0.add(20usize)) }
1971 } 1867 }
1972 #[doc = "Clock interrupt clear register"] 1868 #[doc = "capture/compare mode register 1 (input mode)"]
1973 pub fn cicr(self) -> Reg<regs::Cicr, R> { 1869 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
1974 unsafe { Reg::from_ptr(self.0.add(24usize)) } 1870 assert!(n < 2usize);
1871 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
1975 } 1872 }
1976 #[doc = "GPIO reset register"] 1873 #[doc = "capture/compare mode register 1 (output mode)"]
1977 pub fn ioprstr(self) -> Reg<regs::Ioprstr, RW> { 1874 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
1978 unsafe { Reg::from_ptr(self.0.add(28usize)) } 1875 assert!(n < 2usize);
1876 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
1979 } 1877 }
1980 #[doc = "AHB peripheral reset register"] 1878 #[doc = "capture/compare enable register"]
1981 pub fn ahbrstr(self) -> Reg<regs::Ahbrstr, RW> { 1879 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
1982 unsafe { Reg::from_ptr(self.0.add(32usize)) } 1880 unsafe { Reg::from_ptr(self.0.add(32usize)) }
1983 } 1881 }
1984 #[doc = "APB2 peripheral reset register"] 1882 #[doc = "counter"]
1985 pub fn apb2rstr(self) -> Reg<regs::Apb2rstr, RW> { 1883 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
1986 unsafe { Reg::from_ptr(self.0.add(36usize)) } 1884 unsafe { Reg::from_ptr(self.0.add(36usize)) }
1987 } 1885 }
1988 #[doc = "APB1 peripheral reset register"] 1886 #[doc = "prescaler"]
1989 pub fn apb1rstr(self) -> Reg<regs::Apb1rstr, RW> { 1887 pub fn psc(self) -> Reg<regs::Psc, RW> {
1990 unsafe { Reg::from_ptr(self.0.add(40usize)) } 1888 unsafe { Reg::from_ptr(self.0.add(40usize)) }
1991 } 1889 }
1992 #[doc = "GPIO clock enable register"] 1890 #[doc = "auto-reload register"]
1993 pub fn iopenr(self) -> Reg<regs::Iopenr, RW> { 1891 pub fn arr(self) -> Reg<regs::Arr16, RW> {
1994 unsafe { Reg::from_ptr(self.0.add(44usize)) } 1892 unsafe { Reg::from_ptr(self.0.add(44usize)) }
1995 } 1893 }
1996 #[doc = "AHB peripheral clock enable register"] 1894 #[doc = "capture/compare register"]
1997 pub fn ahbenr(self) -> Reg<regs::Ahbenr, RW> { 1895 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
1998 unsafe { Reg::from_ptr(self.0.add(48usize)) } 1896 assert!(n < 4usize);
1897 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
1999 } 1898 }
2000 #[doc = "APB2 peripheral clock enable register"] 1899 #[doc = "DMA control register"]
2001 pub fn apb2enr(self) -> Reg<regs::Apb2enr, RW> { 1900 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
2002 unsafe { Reg::from_ptr(self.0.add(52usize)) } 1901 unsafe { Reg::from_ptr(self.0.add(72usize)) }
2003 } 1902 }
2004 #[doc = "APB1 peripheral clock enable register"] 1903 #[doc = "DMA address for full transfer"]
2005 pub fn apb1enr(self) -> Reg<regs::Apb1enr, RW> { 1904 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
2006 unsafe { Reg::from_ptr(self.0.add(56usize)) } 1905 unsafe { Reg::from_ptr(self.0.add(76usize)) }
2007 } 1906 }
2008 #[doc = "GPIO clock enable in sleep mode register"] 1907 }
2009 pub fn iopsmen(self) -> Reg<regs::Iopsmen, RW> { 1908 #[doc = "Advanced-timers"]
2010 unsafe { Reg::from_ptr(self.0.add(60usize)) } 1909 #[derive(Copy, Clone)]
1910 pub struct TimAdv(pub *mut u8);
1911 unsafe impl Send for TimAdv {}
1912 unsafe impl Sync for TimAdv {}
1913 impl TimAdv {
1914 #[doc = "control register 1"]
1915 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
1916 unsafe { Reg::from_ptr(self.0.add(0usize)) }
2011 } 1917 }
2012 #[doc = "AHB peripheral clock enable in sleep mode register"] 1918 #[doc = "control register 2"]
2013 pub fn ahbsmenr(self) -> Reg<regs::Ahbsmenr, RW> { 1919 pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> {
2014 unsafe { Reg::from_ptr(self.0.add(64usize)) } 1920 unsafe { Reg::from_ptr(self.0.add(4usize)) }
2015 } 1921 }
2016 #[doc = "APB2 peripheral clock enable in sleep mode register"] 1922 #[doc = "slave mode control register"]
2017 pub fn apb2smenr(self) -> Reg<regs::Apb2smenr, RW> { 1923 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
1924 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1925 }
1926 #[doc = "DMA/Interrupt enable register"]
1927 pub fn dier(self) -> Reg<regs::DierAdv, RW> {
1928 unsafe { Reg::from_ptr(self.0.add(12usize)) }
1929 }
1930 #[doc = "status register"]
1931 pub fn sr(self) -> Reg<regs::SrAdv, RW> {
1932 unsafe { Reg::from_ptr(self.0.add(16usize)) }
1933 }
1934 #[doc = "event generation register"]
1935 pub fn egr(self) -> Reg<regs::EgrAdv, W> {
1936 unsafe { Reg::from_ptr(self.0.add(20usize)) }
1937 }
1938 #[doc = "capture/compare mode register 1 (input mode)"]
1939 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
1940 assert!(n < 2usize);
1941 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
1942 }
1943 #[doc = "capture/compare mode register 1 (output mode)"]
1944 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
1945 assert!(n < 2usize);
1946 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
1947 }
1948 #[doc = "capture/compare enable register"]
1949 pub fn ccer(self) -> Reg<regs::CcerAdv, RW> {
1950 unsafe { Reg::from_ptr(self.0.add(32usize)) }
1951 }
1952 #[doc = "counter"]
1953 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
1954 unsafe { Reg::from_ptr(self.0.add(36usize)) }
1955 }
1956 #[doc = "prescaler"]
1957 pub fn psc(self) -> Reg<regs::Psc, RW> {
1958 unsafe { Reg::from_ptr(self.0.add(40usize)) }
1959 }
1960 #[doc = "auto-reload register"]
1961 pub fn arr(self) -> Reg<regs::Arr16, RW> {
1962 unsafe { Reg::from_ptr(self.0.add(44usize)) }
1963 }
1964 #[doc = "repetition counter register"]
1965 pub fn rcr(self) -> Reg<regs::Rcr, RW> {
1966 unsafe { Reg::from_ptr(self.0.add(48usize)) }
1967 }
1968 #[doc = "capture/compare register"]
1969 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
1970 assert!(n < 4usize);
1971 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
1972 }
1973 #[doc = "break and dead-time register"]
1974 pub fn bdtr(self) -> Reg<regs::Bdtr, RW> {
2018 unsafe { Reg::from_ptr(self.0.add(68usize)) } 1975 unsafe { Reg::from_ptr(self.0.add(68usize)) }
2019 } 1976 }
2020 #[doc = "APB1 peripheral clock enable in sleep mode register"] 1977 #[doc = "DMA control register"]
2021 pub fn apb1smenr(self) -> Reg<regs::Apb1smenr, RW> { 1978 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
2022 unsafe { Reg::from_ptr(self.0.add(72usize)) } 1979 unsafe { Reg::from_ptr(self.0.add(72usize)) }
2023 } 1980 }
2024 #[doc = "Clock configuration register"] 1981 #[doc = "DMA address for full transfer"]
2025 pub fn ccipr(self) -> Reg<regs::Ccipr, RW> { 1982 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
2026 unsafe { Reg::from_ptr(self.0.add(76usize)) } 1983 unsafe { Reg::from_ptr(self.0.add(76usize)) }
2027 } 1984 }
2028 #[doc = "Control and status register"]
2029 pub fn csr(self) -> Reg<regs::Csr, RW> {
2030 unsafe { Reg::from_ptr(self.0.add(80usize)) }
2031 }
2032 } 1985 }
2033 pub mod vals { 1986 #[doc = "Basic timer"]
2034 use crate::generic::*; 1987 #[derive(Copy, Clone)]
2035 #[repr(transparent)] 1988 pub struct TimBasic(pub *mut u8);
2036 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1989 unsafe impl Send for TimBasic {}
2037 pub struct Csslsef(pub u8); 1990 unsafe impl Sync for TimBasic {}
2038 impl Csslsef { 1991 impl TimBasic {
2039 #[doc = "No failure detected on LSE clock failure"] 1992 #[doc = "control register 1"]
2040 pub const NOFAILURE: Self = Self(0); 1993 pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> {
2041 #[doc = "Failure detected on LSE clock failure"] 1994 unsafe { Reg::from_ptr(self.0.add(0usize)) }
2042 pub const FAILURE: Self = Self(0x01);
2043 } 1995 }
2044 #[repr(transparent)] 1996 #[doc = "control register 2"]
2045 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1997 pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> {
2046 pub struct Iophrst(pub u8); 1998 unsafe { Reg::from_ptr(self.0.add(4usize)) }
2047 impl Iophrst {
2048 #[doc = "Reset I/O port"]
2049 pub const RESET: Self = Self(0x01);
2050 } 1999 }
2051 #[repr(transparent)] 2000 #[doc = "DMA/Interrupt enable register"]
2052 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2001 pub fn dier(self) -> Reg<regs::DierBasic, RW> {
2053 pub struct Rtcpre(pub u8); 2002 unsafe { Reg::from_ptr(self.0.add(12usize)) }
2054 impl Rtcpre {
2055 #[doc = "HSE divided by 2"]
2056 pub const DIV2: Self = Self(0);
2057 #[doc = "HSE divided by 4"]
2058 pub const DIV4: Self = Self(0x01);
2059 #[doc = "HSE divided by 8"]
2060 pub const DIV8: Self = Self(0x02);
2061 #[doc = "HSE divided by 16"]
2062 pub const DIV16: Self = Self(0x03);
2063 } 2003 }
2064 #[repr(transparent)] 2004 #[doc = "status register"]
2065 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2005 pub fn sr(self) -> Reg<regs::SrBasic, RW> {
2066 pub struct Csslsed(pub u8); 2006 unsafe { Reg::from_ptr(self.0.add(16usize)) }
2067 impl Csslsed {
2068 #[doc = "No failure detected on LSE (32 kHz oscillator)"]
2069 pub const NOFAILURE: Self = Self(0);
2070 #[doc = "Failure detected on LSE (32 kHz oscillator)"]
2071 pub const FAILURE: Self = Self(0x01);
2072 } 2007 }
2073 #[repr(transparent)] 2008 #[doc = "event generation register"]
2074 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2009 pub fn egr(self) -> Reg<regs::EgrBasic, W> {
2075 pub struct Ppre(pub u8); 2010 unsafe { Reg::from_ptr(self.0.add(20usize)) }
2076 impl Ppre {
2077 #[doc = "HCLK not divided"]
2078 pub const DIV1: Self = Self(0);
2079 #[doc = "HCLK divided by 2"]
2080 pub const DIV2: Self = Self(0x04);
2081 #[doc = "HCLK divided by 4"]
2082 pub const DIV4: Self = Self(0x05);
2083 #[doc = "HCLK divided by 8"]
2084 pub const DIV8: Self = Self(0x06);
2085 #[doc = "HCLK divided by 16"]
2086 pub const DIV16: Self = Self(0x07);
2087 } 2011 }
2088 #[repr(transparent)] 2012 #[doc = "counter"]
2089 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2013 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
2090 pub struct Hserdyr(pub u8); 2014 unsafe { Reg::from_ptr(self.0.add(36usize)) }
2091 impl Hserdyr {
2092 #[doc = "Oscillator is not stable"]
2093 pub const NOTREADY: Self = Self(0);
2094 #[doc = "Oscillator is stable"]
2095 pub const READY: Self = Self(0x01);
2096 } 2015 }
2097 #[repr(transparent)] 2016 #[doc = "prescaler"]
2098 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2017 pub fn psc(self) -> Reg<regs::Psc, RW> {
2099 pub struct Lptimsel(pub u8); 2018 unsafe { Reg::from_ptr(self.0.add(40usize)) }
2100 impl Lptimsel {
2101 #[doc = "APB clock selected as Timer clock"]
2102 pub const APB: Self = Self(0);
2103 #[doc = "LSI clock selected as Timer clock"]
2104 pub const LSI: Self = Self(0x01);
2105 #[doc = "HSI16 clock selected as Timer clock"]
2106 pub const HSI16: Self = Self(0x02);
2107 #[doc = "LSE clock selected as Timer clock"]
2108 pub const LSE: Self = Self(0x03);
2109 } 2019 }
2110 #[repr(transparent)] 2020 #[doc = "auto-reload register"]
2111 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2021 pub fn arr(self) -> Reg<regs::Arr16, RW> {
2112 pub struct Lsedrv(pub u8); 2022 unsafe { Reg::from_ptr(self.0.add(44usize)) }
2113 impl Lsedrv {
2114 #[doc = "Lowest drive"]
2115 pub const LOW: Self = Self(0);
2116 #[doc = "Medium low drive"]
2117 pub const MEDIUMLOW: Self = Self(0x01);
2118 #[doc = "Medium high drive"]
2119 pub const MEDIUMHIGH: Self = Self(0x02);
2120 #[doc = "Highest drive"]
2121 pub const HIGH: Self = Self(0x03);
2122 } 2023 }
2123 #[repr(transparent)] 2024 }
2124 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2025 #[doc = "General purpose 32-bit timer"]
2125 pub struct Csshsecw(pub u8); 2026 #[derive(Copy, Clone)]
2126 impl Csshsecw { 2027 pub struct TimGp32(pub *mut u8);
2127 #[doc = "Clear interrupt flag"] 2028 unsafe impl Send for TimGp32 {}
2128 pub const CLEAR: Self = Self(0x01); 2029 unsafe impl Sync for TimGp32 {}
2030 impl TimGp32 {
2031 #[doc = "control register 1"]
2032 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
2033 unsafe { Reg::from_ptr(self.0.add(0usize)) }
2129 } 2034 }
2130 #[repr(transparent)] 2035 #[doc = "control register 2"]
2131 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2036 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
2132 pub struct Hsebyp(pub u8); 2037 unsafe { Reg::from_ptr(self.0.add(4usize)) }
2133 impl Hsebyp {
2134 #[doc = "HSE oscillator not bypassed"]
2135 pub const NOTBYPASSED: Self = Self(0);
2136 #[doc = "HSE oscillator bypassed"]
2137 pub const BYPASSED: Self = Self(0x01);
2138 } 2038 }
2139 #[repr(transparent)] 2039 #[doc = "slave mode control register"]
2140 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2040 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
2141 pub struct Mcosel(pub u8); 2041 unsafe { Reg::from_ptr(self.0.add(8usize)) }
2142 impl Mcosel {
2143 #[doc = "No clock"]
2144 pub const NOCLOCK: Self = Self(0);
2145 #[doc = "SYSCLK clock selected"]
2146 pub const SYSCLK: Self = Self(0x01);
2147 #[doc = "HSI oscillator clock selected"]
2148 pub const HSI16: Self = Self(0x02);
2149 #[doc = "MSI oscillator clock selected"]
2150 pub const MSI: Self = Self(0x03);
2151 #[doc = "HSE oscillator clock selected"]
2152 pub const HSE: Self = Self(0x04);
2153 #[doc = "PLL clock selected"]
2154 pub const PLL: Self = Self(0x05);
2155 #[doc = "LSI oscillator clock selected"]
2156 pub const LSI: Self = Self(0x06);
2157 #[doc = "LSE oscillator clock selected"]
2158 pub const LSE: Self = Self(0x07);
2159 } 2042 }
2160 #[repr(transparent)] 2043 #[doc = "DMA/Interrupt enable register"]
2161 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2044 pub fn dier(self) -> Reg<regs::DierGp, RW> {
2162 pub struct Pllon(pub u8); 2045 unsafe { Reg::from_ptr(self.0.add(12usize)) }
2163 impl Pllon {
2164 #[doc = "Clock disabled"]
2165 pub const DISABLED: Self = Self(0);
2166 #[doc = "Clock enabled"]
2167 pub const ENABLED: Self = Self(0x01);
2168 } 2046 }
2169 #[repr(transparent)] 2047 #[doc = "status register"]
2170 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2048 pub fn sr(self) -> Reg<regs::SrGp, RW> {
2171 pub struct Crypsmen(pub u8); 2049 unsafe { Reg::from_ptr(self.0.add(16usize)) }
2172 impl Crypsmen {
2173 #[doc = "Crypto clock disabled in Sleep mode"]
2174 pub const DISABLED: Self = Self(0);
2175 #[doc = "Crypto clock enabled in Sleep mode"]
2176 pub const ENABLED: Self = Self(0x01);
2177 } 2050 }
2178 #[repr(transparent)] 2051 #[doc = "event generation register"]
2179 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2052 pub fn egr(self) -> Reg<regs::EgrGp, W> {
2180 pub struct Stopwuck(pub u8); 2053 unsafe { Reg::from_ptr(self.0.add(20usize)) }
2181 impl Stopwuck {
2182 #[doc = "Internal 64 KHz to 4 MHz (MSI) oscillator selected as wake-up from Stop clock"]
2183 pub const MSI: Self = Self(0);
2184 #[doc = "Internal 16 MHz (HSI) oscillator selected as wake-up from Stop clock (or HSI16/4 if HSI16DIVEN=1)"]
2185 pub const HSI16: Self = Self(0x01);
2186 } 2054 }
2187 #[repr(transparent)] 2055 #[doc = "capture/compare mode register 1 (input mode)"]
2188 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2056 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
2189 pub struct Dbgsmen(pub u8); 2057 assert!(n < 2usize);
2190 impl Dbgsmen { 2058 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
2191 #[doc = "Clock disabled"]
2192 pub const DISABLED: Self = Self(0);
2193 #[doc = "Clock enabled"]
2194 pub const ENABLED: Self = Self(0x01);
2195 } 2059 }
2196 #[repr(transparent)] 2060 #[doc = "capture/compare mode register 1 (output mode)"]
2197 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2061 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
2198 pub struct Sws(pub u8); 2062 assert!(n < 2usize);
2199 impl Sws { 2063 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
2200 #[doc = "MSI oscillator used as system clock"]
2201 pub const MSI: Self = Self(0);
2202 #[doc = "HSI oscillator used as system clock"]
2203 pub const HSI16: Self = Self(0x01);
2204 #[doc = "HSE oscillator used as system clock"]
2205 pub const HSE: Self = Self(0x02);
2206 #[doc = "PLL used as system clock"]
2207 pub const PLL: Self = Self(0x03);
2208 } 2064 }
2209 #[repr(transparent)] 2065 #[doc = "capture/compare enable register"]
2210 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2066 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
2211 pub struct Crypen(pub u8); 2067 unsafe { Reg::from_ptr(self.0.add(32usize)) }
2212 impl Crypen {
2213 #[doc = "Clock disabled"]
2214 pub const DISABLED: Self = Self(0);
2215 #[doc = "Clock enabled"]
2216 pub const ENABLED: Self = Self(0x01);
2217 } 2068 }
2218 #[repr(transparent)] 2069 #[doc = "counter"]
2219 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2070 pub fn cnt(self) -> Reg<regs::Cnt32, RW> {
2220 pub struct Csslse(pub u8); 2071 unsafe { Reg::from_ptr(self.0.add(36usize)) }
2221 impl Csslse {
2222 #[doc = "LSE CSS interrupt disabled"]
2223 pub const DISABLED: Self = Self(0);
2224 #[doc = "LSE CSS interrupt enabled"]
2225 pub const ENABLED: Self = Self(0x01);
2226 } 2072 }
2227 #[repr(transparent)] 2073 #[doc = "prescaler"]
2228 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2074 pub fn psc(self) -> Reg<regs::Psc, RW> {
2229 pub struct Lptimsmen(pub u8); 2075 unsafe { Reg::from_ptr(self.0.add(40usize)) }
2230 impl Lptimsmen {
2231 #[doc = "Clock disabled"]
2232 pub const DISABLED: Self = Self(0);
2233 #[doc = "Clock enabled"]
2234 pub const ENABLED: Self = Self(0x01);
2235 } 2076 }
2236 #[repr(transparent)] 2077 #[doc = "auto-reload register"]
2237 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2078 pub fn arr(self) -> Reg<regs::Arr32, RW> {
2238 pub struct Msirange(pub u8); 2079 unsafe { Reg::from_ptr(self.0.add(44usize)) }
2239 impl Msirange {
2240 #[doc = "range 0 around 65.536 kHz"]
2241 pub const RANGE0: Self = Self(0);
2242 #[doc = "range 1 around 131.072 kHz"]
2243 pub const RANGE1: Self = Self(0x01);
2244 #[doc = "range 2 around 262.144 kHz"]
2245 pub const RANGE2: Self = Self(0x02);
2246 #[doc = "range 3 around 524.288 kHz"]
2247 pub const RANGE3: Self = Self(0x03);
2248 #[doc = "range 4 around 1.048 MHz"]
2249 pub const RANGE4: Self = Self(0x04);
2250 #[doc = "range 5 around 2.097 MHz (reset value)"]
2251 pub const RANGE5: Self = Self(0x05);
2252 #[doc = "range 6 around 4.194 MHz"]
2253 pub const RANGE6: Self = Self(0x06);
2254 #[doc = "not allowed"]
2255 pub const RANGE7: Self = Self(0x07);
2256 } 2080 }
2257 #[repr(transparent)] 2081 #[doc = "capture/compare register"]
2258 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2082 pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> {
2259 pub struct Sramsmen(pub u8); 2083 assert!(n < 4usize);
2260 impl Sramsmen { 2084 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
2261 #[doc = "NVM interface clock disabled in Sleep mode"]
2262 pub const DISABLED: Self = Self(0);
2263 #[doc = "NVM interface clock enabled in Sleep mode"]
2264 pub const ENABLED: Self = Self(0x01);
2265 } 2085 }
2266 #[repr(transparent)] 2086 #[doc = "DMA control register"]
2267 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2087 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
2268 pub struct Pllsrc(pub u8); 2088 unsafe { Reg::from_ptr(self.0.add(72usize)) }
2269 impl Pllsrc {
2270 #[doc = "HSI selected as PLL input clock"]
2271 pub const HSI16: Self = Self(0);
2272 #[doc = "HSE selected as PLL input clock"]
2273 pub const HSE: Self = Self(0x01);
2274 } 2089 }
2090 #[doc = "DMA address for full transfer"]
2091 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
2092 unsafe { Reg::from_ptr(self.0.add(76usize)) }
2093 }
2094 }
2095 pub mod vals {
2096 use crate::generic::*;
2275 #[repr(transparent)] 2097 #[repr(transparent)]
2276 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2098 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2277 pub struct Hsidiven(pub u8); 2099 pub struct Icf(pub u8);
2278 impl Hsidiven { 2100 impl Icf {
2279 #[doc = "no 16 MHz HSI division requested"] 2101 #[doc = "No filter, sampling is done at fDTS"]
2280 pub const NOTDIVIDED: Self = Self(0); 2102 pub const NOFILTER: Self = Self(0);
2281 #[doc = "16 MHz HSI division by 4 requested"] 2103 #[doc = "fSAMPLING=fCK_INT, N=2"]
2282 pub const DIV4: Self = Self(0x01); 2104 pub const FCK_INT_N2: Self = Self(0x01);
2105 #[doc = "fSAMPLING=fCK_INT, N=4"]
2106 pub const FCK_INT_N4: Self = Self(0x02);
2107 #[doc = "fSAMPLING=fCK_INT, N=8"]
2108 pub const FCK_INT_N8: Self = Self(0x03);
2109 #[doc = "fSAMPLING=fDTS/2, N=6"]
2110 pub const FDTS_DIV2_N6: Self = Self(0x04);
2111 #[doc = "fSAMPLING=fDTS/2, N=8"]
2112 pub const FDTS_DIV2_N8: Self = Self(0x05);
2113 #[doc = "fSAMPLING=fDTS/4, N=6"]
2114 pub const FDTS_DIV4_N6: Self = Self(0x06);
2115 #[doc = "fSAMPLING=fDTS/4, N=8"]
2116 pub const FDTS_DIV4_N8: Self = Self(0x07);
2117 #[doc = "fSAMPLING=fDTS/8, N=6"]
2118 pub const FDTS_DIV8_N6: Self = Self(0x08);
2119 #[doc = "fSAMPLING=fDTS/8, N=8"]
2120 pub const FDTS_DIV8_N8: Self = Self(0x09);
2121 #[doc = "fSAMPLING=fDTS/16, N=5"]
2122 pub const FDTS_DIV16_N5: Self = Self(0x0a);
2123 #[doc = "fSAMPLING=fDTS/16, N=6"]
2124 pub const FDTS_DIV16_N6: Self = Self(0x0b);
2125 #[doc = "fSAMPLING=fDTS/16, N=8"]
2126 pub const FDTS_DIV16_N8: Self = Self(0x0c);
2127 #[doc = "fSAMPLING=fDTS/32, N=5"]
2128 pub const FDTS_DIV32_N5: Self = Self(0x0d);
2129 #[doc = "fSAMPLING=fDTS/32, N=6"]
2130 pub const FDTS_DIV32_N6: Self = Self(0x0e);
2131 #[doc = "fSAMPLING=fDTS/32, N=8"]
2132 pub const FDTS_DIV32_N8: Self = Self(0x0f);
2283 } 2133 }
2284 #[repr(transparent)] 2134 #[repr(transparent)]
2285 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2135 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2286 pub struct Dmasmen(pub u8); 2136 pub struct Ossi(pub u8);
2287 impl Dmasmen { 2137 impl Ossi {
2288 #[doc = "DMA clock disabled in Sleep mode"] 2138 #[doc = "When inactive, OC/OCN outputs are disabled"]
2289 pub const DISABLED: Self = Self(0); 2139 pub const DISABLED: Self = Self(0);
2290 #[doc = "DMA clock enabled in Sleep mode"] 2140 #[doc = "When inactive, OC/OCN outputs are forced to idle level"]
2291 pub const ENABLED: Self = Self(0x01); 2141 pub const IDLELEVEL: Self = Self(0x01);
2292 } 2142 }
2293 #[repr(transparent)] 2143 #[repr(transparent)]
2294 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2144 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2295 pub struct Csslseon(pub u8); 2145 pub struct Mms(pub u8);
2296 impl Csslseon { 2146 impl Mms {
2297 #[doc = "Oscillator OFF"] 2147 #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"]
2298 pub const OFF: Self = Self(0); 2148 pub const RESET: Self = Self(0);
2299 #[doc = "Oscillator ON"] 2149 #[doc = "The counter enable signal, CNT_EN, is used as trigger output"]
2300 pub const ON: Self = Self(0x01); 2150 pub const ENABLE: Self = Self(0x01);
2151 #[doc = "The update event is selected as trigger output"]
2152 pub const UPDATE: Self = Self(0x02);
2153 #[doc = "The trigger output send a positive pulse when the CC1IF flag it to be set, as soon as a capture or a compare match occurred"]
2154 pub const COMPAREPULSE: Self = Self(0x03);
2155 #[doc = "OC1REF signal is used as trigger output"]
2156 pub const COMPAREOC1: Self = Self(0x04);
2157 #[doc = "OC2REF signal is used as trigger output"]
2158 pub const COMPAREOC2: Self = Self(0x05);
2159 #[doc = "OC3REF signal is used as trigger output"]
2160 pub const COMPAREOC3: Self = Self(0x06);
2161 #[doc = "OC4REF signal is used as trigger output"]
2162 pub const COMPAREOC4: Self = Self(0x07);
2301 } 2163 }
2302 #[repr(transparent)] 2164 #[repr(transparent)]
2303 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2165 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2304 pub struct Hpre(pub u8); 2166 pub struct Tis(pub u8);
2305 impl Hpre { 2167 impl Tis {
2306 #[doc = "system clock not divided"] 2168 #[doc = "The TIMx_CH1 pin is connected to TI1 input"]
2307 pub const DIV1: Self = Self(0); 2169 pub const NORMAL: Self = Self(0);
2308 #[doc = "system clock divided by 2"] 2170 #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"]
2309 pub const DIV2: Self = Self(0x08); 2171 pub const XOR: Self = Self(0x01);
2310 #[doc = "system clock divided by 4"]
2311 pub const DIV4: Self = Self(0x09);
2312 #[doc = "system clock divided by 8"]
2313 pub const DIV8: Self = Self(0x0a);
2314 #[doc = "system clock divided by 16"]
2315 pub const DIV16: Self = Self(0x0b);
2316 #[doc = "system clock divided by 64"]
2317 pub const DIV64: Self = Self(0x0c);
2318 #[doc = "system clock divided by 128"]
2319 pub const DIV128: Self = Self(0x0d);
2320 #[doc = "system clock divided by 256"]
2321 pub const DIV256: Self = Self(0x0e);
2322 #[doc = "system clock divided by 512"]
2323 pub const DIV512: Self = Self(0x0f);
2324 } 2172 }
2325 #[repr(transparent)] 2173 #[repr(transparent)]
2326 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2174 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2327 pub struct Rtcen(pub u8); 2175 pub struct Arpe(pub u8);
2328 impl Rtcen { 2176 impl Arpe {
2329 #[doc = "RTC clock disabled"] 2177 #[doc = "TIMx_APRR register is not buffered"]
2330 pub const DISABLED: Self = Self(0); 2178 pub const DISABLED: Self = Self(0);
2331 #[doc = "RTC clock enabled"] 2179 #[doc = "TIMx_APRR register is buffered"]
2332 pub const ENABLED: Self = Self(0x01); 2180 pub const ENABLED: Self = Self(0x01);
2333 } 2181 }
2334 #[repr(transparent)] 2182 #[repr(transparent)]
2335 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2183 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2336 pub struct Sw(pub u8); 2184 pub struct Ocpe(pub u8);
2337 impl Sw { 2185 impl Ocpe {
2338 #[doc = "MSI oscillator used as system clock"] 2186 #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"]
2339 pub const MSI: Self = Self(0);
2340 #[doc = "HSI oscillator used as system clock"]
2341 pub const HSI16: Self = Self(0x01);
2342 #[doc = "HSE oscillator used as system clock"]
2343 pub const HSE: Self = Self(0x02);
2344 #[doc = "PLL used as system clock"]
2345 pub const PLL: Self = Self(0x03);
2346 }
2347 #[repr(transparent)]
2348 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2349 pub struct Dbgrstw(pub u8);
2350 impl Dbgrstw {
2351 #[doc = "Reset the module"]
2352 pub const RESET: Self = Self(0x01);
2353 }
2354 #[repr(transparent)]
2355 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2356 pub struct Hsi48rdyfr(pub u8);
2357 impl Hsi48rdyfr {
2358 #[doc = "No clock ready interrupt"]
2359 pub const NOTINTERRUPTED: Self = Self(0);
2360 #[doc = "Clock ready interrupt"]
2361 pub const INTERRUPTED: Self = Self(0x01);
2362 }
2363 #[repr(transparent)]
2364 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2365 pub struct Rtcsel(pub u8);
2366 impl Rtcsel {
2367 #[doc = "No clock"]
2368 pub const NOCLOCK: Self = Self(0);
2369 #[doc = "LSE oscillator clock used as RTC clock"]
2370 pub const LSE: Self = Self(0x01);
2371 #[doc = "LSI oscillator clock used as RTC clock"]
2372 pub const LSI: Self = Self(0x02);
2373 #[doc = "HSE oscillator clock divided by a programmable prescaler (selection through the RTCPRE[1:0]
2374bits in the RCC clock control register (RCC_CR)) used as the RTC clock"]
2375 pub const HSE: Self = Self(0x03);
2376 }
2377 #[repr(transparent)]
2378 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2379 pub struct Rmvfw(pub u8);
2380 impl Rmvfw {
2381 #[doc = "Clears the reset flag"]
2382 pub const CLEAR: Self = Self(0x01);
2383 }
2384 #[repr(transparent)]
2385 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2386 pub struct Lptimen(pub u8);
2387 impl Lptimen {
2388 #[doc = "Clock disabled"]
2389 pub const DISABLED: Self = Self(0); 2187 pub const DISABLED: Self = Self(0);
2390 #[doc = "Clock enabled"] 2188 #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"]
2391 pub const ENABLED: Self = Self(0x01); 2189 pub const ENABLED: Self = Self(0x01);
2392 } 2190 }
2393 #[repr(transparent)] 2191 #[repr(transparent)]
2394 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2192 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2395 pub struct Pllrdyr(pub u8); 2193 pub struct Cms(pub u8);
2396 impl Pllrdyr { 2194 impl Cms {
2397 #[doc = "PLL unlocked"] 2195 #[doc = "The counter counts up or down depending on the direction bit"]
2398 pub const UNLOCKED: Self = Self(0); 2196 pub const EDGEALIGNED: Self = Self(0);
2399 #[doc = "PLL locked"] 2197 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting down."]
2400 pub const LOCKED: Self = Self(0x01); 2198 pub const CENTERALIGNED1: Self = Self(0x01);
2199 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting up."]
2200 pub const CENTERALIGNED2: Self = Self(0x02);
2201 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set both when the counter is counting up or down."]
2202 pub const CENTERALIGNED3: Self = Self(0x03);
2401 } 2203 }
2402 #[repr(transparent)] 2204 #[repr(transparent)]
2403 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2205 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2404 pub struct Iophsmen(pub u8); 2206 pub struct Ossr(pub u8);
2405 impl Iophsmen { 2207 impl Ossr {
2406 #[doc = "Port x clock is disabled in Sleep mode"] 2208 #[doc = "When inactive, OC/OCN outputs are disabled"]
2407 pub const DISABLED: Self = Self(0); 2209 pub const DISABLED: Self = Self(0);
2408 #[doc = "Port x clock is enabled in Sleep mode (if enabled by IOPHEN)"] 2210 #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"]
2409 pub const ENABLED: Self = Self(0x01); 2211 pub const IDLELEVEL: Self = Self(0x01);
2410 } 2212 }
2411 #[repr(transparent)] 2213 #[repr(transparent)]
2412 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2214 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2413 pub struct Lpwrrstfr(pub u8); 2215 pub struct Dir(pub u8);
2414 impl Lpwrrstfr { 2216 impl Dir {
2415 #[doc = "No reset has occured"] 2217 #[doc = "Counter used as upcounter"]
2416 pub const NORESET: Self = Self(0); 2218 pub const UP: Self = Self(0);
2417 #[doc = "A reset has occured"] 2219 #[doc = "Counter used as downcounter"]
2418 pub const RESET: Self = Self(0x01); 2220 pub const DOWN: Self = Self(0x01);
2419 } 2221 }
2420 #[repr(transparent)] 2222 #[repr(transparent)]
2421 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2223 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2422 pub struct Hsiouten(pub u8); 2224 pub struct Msm(pub u8);
2423 impl Hsiouten { 2225 impl Msm {
2424 #[doc = "HSI output clock disabled"] 2226 #[doc = "No action"]
2425 pub const DISABLED: Self = Self(0); 2227 pub const NOSYNC: Self = Self(0);
2426 #[doc = "HSI output clock enabled"] 2228 #[doc = "The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event."]
2427 pub const ENABLED: Self = Self(0x01); 2229 pub const SYNC: Self = Self(0x01);
2428 } 2230 }
2429 #[repr(transparent)] 2231 #[repr(transparent)]
2430 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2232 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2431 pub struct Hsirdyie(pub u8); 2233 pub struct Urs(pub u8);
2432 impl Hsirdyie { 2234 impl Urs {
2433 #[doc = "Ready interrupt disabled"] 2235 #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"]
2434 pub const DISABLED: Self = Self(0); 2236 pub const ANYEVENT: Self = Self(0);
2435 #[doc = "Ready interrupt enabled"] 2237 #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"]
2436 pub const ENABLED: Self = Self(0x01); 2238 pub const COUNTERONLY: Self = Self(0x01);
2437 } 2239 }
2438 #[repr(transparent)] 2240 #[repr(transparent)]
2439 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2241 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2440 pub struct Mcopre(pub u8); 2242 pub struct Etps(pub u8);
2441 impl Mcopre { 2243 impl Etps {
2442 #[doc = "No division"] 2244 #[doc = "Prescaler OFF"]
2443 pub const DIV1: Self = Self(0); 2245 pub const DIV1: Self = Self(0);
2444 #[doc = "Division by 2"] 2246 #[doc = "ETRP frequency divided by 2"]
2445 pub const DIV2: Self = Self(0x01); 2247 pub const DIV2: Self = Self(0x01);
2446 #[doc = "Division by 4"] 2248 #[doc = "ETRP frequency divided by 4"]
2447 pub const DIV4: Self = Self(0x02); 2249 pub const DIV4: Self = Self(0x02);
2448 #[doc = "Division by 8"] 2250 #[doc = "ETRP frequency divided by 8"]
2449 pub const DIV8: Self = Self(0x03); 2251 pub const DIV8: Self = Self(0x03);
2450 #[doc = "Division by 16"]
2451 pub const DIV16: Self = Self(0x04);
2452 } 2252 }
2453 #[repr(transparent)] 2253 #[repr(transparent)]
2454 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2254 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2455 pub struct Hsi16rdyfr(pub u8); 2255 pub struct Ocm(pub u8);
2456 impl Hsi16rdyfr { 2256 impl Ocm {
2457 #[doc = "HSI 16 MHz oscillator not ready"] 2257 #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"]
2458 pub const NOTREADY: Self = Self(0); 2258 pub const FROZEN: Self = Self(0);
2459 #[doc = "HSI 16 MHz oscillator ready"] 2259 #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"]
2460 pub const READY: Self = Self(0x01); 2260 pub const ACTIVEONMATCH: Self = Self(0x01);
2461 } 2261 #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"]
2462 #[repr(transparent)] 2262 pub const INACTIVEONMATCH: Self = Self(0x02);
2463 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2263 #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"]
2464 pub struct Crcsmen(pub u8); 2264 pub const TOGGLE: Self = Self(0x03);
2465 impl Crcsmen { 2265 #[doc = "OCyREF is forced low"]
2466 #[doc = "Test integration module clock disabled in Sleep mode"] 2266 pub const FORCEINACTIVE: Self = Self(0x04);
2467 pub const DISABLED: Self = Self(0); 2267 #[doc = "OCyREF is forced high"]
2468 #[doc = "Test integration module clock enabled in Sleep mode (if enabled by CRCEN)"] 2268 pub const FORCEACTIVE: Self = Self(0x05);
2469 pub const ENABLED: Self = Self(0x01); 2269 #[doc = "In upcounting, channel is active as long as TIMx_CNT<TIMx_CCRy else inactive. In downcounting, channel is inactive as long as TIMx_CNT>TIMx_CCRy else active"]
2270 pub const PWMMODE1: Self = Self(0x06);
2271 #[doc = "Inversely to PwmMode1"]
2272 pub const PWMMODE2: Self = Self(0x07);
2470 } 2273 }
2471 #[repr(transparent)] 2274 #[repr(transparent)]
2472 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2275 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2473 pub struct Lpuartsel(pub u8); 2276 pub struct CcmrInputCcs(pub u8);
2474 impl Lpuartsel { 2277 impl CcmrInputCcs {
2475 #[doc = "APB clock selected as peripheral clock"] 2278 #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"]
2476 pub const APB: Self = Self(0); 2279 pub const TI4: Self = Self(0x01);
2477 #[doc = "System clock selected as peripheral clock"] 2280 #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"]
2478 pub const SYSTEM: Self = Self(0x01); 2281 pub const TI3: Self = Self(0x02);
2479 #[doc = "HSI16 clock selected as peripheral clock"] 2282 #[doc = "CCx channel is configured as input, ICx is mapped on TRC"]
2480 pub const HSI16: Self = Self(0x02); 2283 pub const TRC: Self = Self(0x03);
2481 #[doc = "LSE clock selected as peripheral clock"]
2482 pub const LSE: Self = Self(0x03);
2483 } 2284 }
2484 #[repr(transparent)] 2285 #[repr(transparent)]
2485 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2286 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2486 pub struct Cryprstw(pub u8); 2287 pub struct Etf(pub u8);
2487 impl Cryprstw { 2288 impl Etf {
2488 #[doc = "Reset the module"] 2289 #[doc = "No filter, sampling is done at fDTS"]
2489 pub const RESET: Self = Self(0x01); 2290 pub const NOFILTER: Self = Self(0);
2291 #[doc = "fSAMPLING=fCK_INT, N=2"]
2292 pub const FCK_INT_N2: Self = Self(0x01);
2293 #[doc = "fSAMPLING=fCK_INT, N=4"]
2294 pub const FCK_INT_N4: Self = Self(0x02);
2295 #[doc = "fSAMPLING=fCK_INT, N=8"]
2296 pub const FCK_INT_N8: Self = Self(0x03);
2297 #[doc = "fSAMPLING=fDTS/2, N=6"]
2298 pub const FDTS_DIV2_N6: Self = Self(0x04);
2299 #[doc = "fSAMPLING=fDTS/2, N=8"]
2300 pub const FDTS_DIV2_N8: Self = Self(0x05);
2301 #[doc = "fSAMPLING=fDTS/4, N=6"]
2302 pub const FDTS_DIV4_N6: Self = Self(0x06);
2303 #[doc = "fSAMPLING=fDTS/4, N=8"]
2304 pub const FDTS_DIV4_N8: Self = Self(0x07);
2305 #[doc = "fSAMPLING=fDTS/8, N=6"]
2306 pub const FDTS_DIV8_N6: Self = Self(0x08);
2307 #[doc = "fSAMPLING=fDTS/8, N=8"]
2308 pub const FDTS_DIV8_N8: Self = Self(0x09);
2309 #[doc = "fSAMPLING=fDTS/16, N=5"]
2310 pub const FDTS_DIV16_N5: Self = Self(0x0a);
2311 #[doc = "fSAMPLING=fDTS/16, N=6"]
2312 pub const FDTS_DIV16_N6: Self = Self(0x0b);
2313 #[doc = "fSAMPLING=fDTS/16, N=8"]
2314 pub const FDTS_DIV16_N8: Self = Self(0x0c);
2315 #[doc = "fSAMPLING=fDTS/32, N=5"]
2316 pub const FDTS_DIV32_N5: Self = Self(0x0d);
2317 #[doc = "fSAMPLING=fDTS/32, N=6"]
2318 pub const FDTS_DIV32_N6: Self = Self(0x0e);
2319 #[doc = "fSAMPLING=fDTS/32, N=8"]
2320 pub const FDTS_DIV32_N8: Self = Self(0x0f);
2490 } 2321 }
2491 #[repr(transparent)] 2322 #[repr(transparent)]
2492 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2323 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2493 pub struct Iophen(pub u8); 2324 pub struct Ece(pub u8);
2494 impl Iophen { 2325 impl Ece {
2495 #[doc = "Port clock disabled"] 2326 #[doc = "External clock mode 2 disabled"]
2496 pub const DISABLED: Self = Self(0); 2327 pub const DISABLED: Self = Self(0);
2497 #[doc = "Port clock enabled"] 2328 #[doc = "External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal."]
2498 pub const ENABLED: Self = Self(0x01); 2329 pub const ENABLED: Self = Self(0x01);
2499 } 2330 }
2500 #[repr(transparent)] 2331 #[repr(transparent)]
2501 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2332 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2502 pub struct Plldiv(pub u8); 2333 pub struct Sms(pub u8);
2503 impl Plldiv { 2334 impl Sms {
2504 #[doc = "PLLVCO / 2"] 2335 #[doc = "Slave mode disabled - if CEN = ‘1 then the prescaler is clocked directly by the internal clock."]
2505 pub const DIV2: Self = Self(0x01); 2336 pub const DISABLED: Self = Self(0);
2506 #[doc = "PLLVCO / 3"] 2337 #[doc = "Encoder mode 1 - Counter counts up/down on TI2FP1 edge depending on TI1FP2 level."]
2507 pub const DIV3: Self = Self(0x02); 2338 pub const ENCODER_MODE_1: Self = Self(0x01);
2508 #[doc = "PLLVCO / 4"] 2339 #[doc = "Encoder mode 2 - Counter counts up/down on TI1FP2 edge depending on TI2FP1 level."]
2509 pub const DIV4: Self = Self(0x03); 2340 pub const ENCODER_MODE_2: Self = Self(0x02);
2510 } 2341 #[doc = "Encoder mode 3 - Counter counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input."]
2511 #[repr(transparent)] 2342 pub const ENCODER_MODE_3: Self = Self(0x03);
2512 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2343 #[doc = "Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers."]
2513 pub struct Rtcrstw(pub u8); 2344 pub const RESET_MODE: Self = Self(0x04);
2514 impl Rtcrstw { 2345 #[doc = "Gated Mode - The counter clock is enabled when the trigger input (TRGI) is high. The counter stops (but is not reset) as soon as the trigger becomes low. Both start and stop of the counter are controlled."]
2515 #[doc = "Resets the RTC peripheral"] 2346 pub const GATED_MODE: Self = Self(0x05);
2516 pub const RESET: Self = Self(0x01); 2347 #[doc = "Trigger Mode - The counter starts at a rising edge of the trigger TRGI (but it is not reset). Only the start of the counter is controlled."]
2348 pub const TRIGGER_MODE: Self = Self(0x06);
2349 #[doc = "External Clock Mode 1 - Rising edges of the selected trigger (TRGI) clock the counter."]
2350 pub const EXT_CLOCK_MODE: Self = Self(0x07);
2517 } 2351 }
2518 #[repr(transparent)] 2352 #[repr(transparent)]
2519 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2353 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2520 pub struct Lsebyp(pub u8); 2354 pub struct Etp(pub u8);
2521 impl Lsebyp { 2355 impl Etp {
2522 #[doc = "LSE oscillator not bypassed"] 2356 #[doc = "ETR is noninverted, active at high level or rising edge"]
2523 pub const NOTBYPASSED: Self = Self(0); 2357 pub const NOTINVERTED: Self = Self(0);
2524 #[doc = "LSE oscillator bypassed"] 2358 #[doc = "ETR is inverted, active at low level or falling edge"]
2525 pub const BYPASSED: Self = Self(0x01); 2359 pub const INVERTED: Self = Self(0x01);
2526 } 2360 }
2527 #[repr(transparent)] 2361 #[repr(transparent)]
2528 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2362 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2529 pub struct Mifsmen(pub u8); 2363 pub struct Opm(pub u8);
2530 impl Mifsmen { 2364 impl Opm {
2531 #[doc = "NVM interface clock disabled in Sleep mode"] 2365 #[doc = "Counter is not stopped at update event"]
2532 pub const DISABLED: Self = Self(0); 2366 pub const DISABLED: Self = Self(0);
2533 #[doc = "NVM interface clock enabled in Sleep mode"] 2367 #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"]
2534 pub const ENABLED: Self = Self(0x01); 2368 pub const ENABLED: Self = Self(0x01);
2535 } 2369 }
2536 #[repr(transparent)] 2370 #[repr(transparent)]
2537 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2371 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2538 pub struct Lptimrstw(pub u8); 2372 pub struct CcmrOutputCcs(pub u8);
2539 impl Lptimrstw { 2373 impl CcmrOutputCcs {
2540 #[doc = "Reset the module"] 2374 #[doc = "CCx channel is configured as output"]
2541 pub const RESET: Self = Self(0x01); 2375 pub const OUTPUT: Self = Self(0);
2542 }
2543 #[repr(transparent)]
2544 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2545 pub struct Lserdy(pub u8);
2546 impl Lserdy {
2547 #[doc = "Oscillator not ready"]
2548 pub const NOTREADY: Self = Self(0);
2549 #[doc = "Oscillator ready"]
2550 pub const READY: Self = Self(0x01);
2551 }
2552 #[repr(transparent)]
2553 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2554 pub struct Hsidivfr(pub u8);
2555 impl Hsidivfr {
2556 #[doc = "16 MHz HSI clock not divided"]
2557 pub const NOTDIVIDED: Self = Self(0);
2558 #[doc = "16 MHz HSI clock divided by 4"]
2559 pub const DIV4: Self = Self(0x01);
2560 }
2561 #[repr(transparent)]
2562 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2563 pub struct Csshsef(pub u8);
2564 impl Csshsef {
2565 #[doc = "No clock security interrupt caused by HSE clock failure"]
2566 pub const NOCLOCK: Self = Self(0);
2567 #[doc = "Clock security interrupt caused by HSE clock failure"]
2568 pub const CLOCK: Self = Self(0x01);
2569 } 2376 }
2570 #[repr(transparent)] 2377 #[repr(transparent)]
2571 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2378 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2572 pub struct Dbgen(pub u8); 2379 pub struct Ccds(pub u8);
2573 impl Dbgen { 2380 impl Ccds {
2574 #[doc = "Clock disabled"] 2381 #[doc = "CCx DMA request sent when CCx event occurs"]
2575 pub const DISABLED: Self = Self(0); 2382 pub const ONCOMPARE: Self = Self(0);
2576 #[doc = "Clock enabled"] 2383 #[doc = "CCx DMA request sent when update event occurs"]
2577 pub const ENABLED: Self = Self(0x01); 2384 pub const ONUPDATE: Self = Self(0x01);
2578 } 2385 }
2579 #[repr(transparent)] 2386 #[repr(transparent)]
2580 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2387 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2581 pub struct Icsel(pub u8); 2388 pub struct Ts(pub u8);
2582 impl Icsel { 2389 impl Ts {
2583 #[doc = "APB clock selected as peripheral clock"] 2390 #[doc = "Internal Trigger 0 (ITR0)"]
2584 pub const APB: Self = Self(0); 2391 pub const ITR0: Self = Self(0);
2585 #[doc = "System clock selected as peripheral clock"] 2392 #[doc = "Internal Trigger 1 (ITR1)"]
2586 pub const SYSTEM: Self = Self(0x01); 2393 pub const ITR1: Self = Self(0x01);
2587 #[doc = "HSI16 clock selected as peripheral clock"] 2394 #[doc = "Internal Trigger 2 (ITR2)"]
2588 pub const HSI16: Self = Self(0x02); 2395 pub const ITR2: Self = Self(0x02);
2396 #[doc = "TI1 Edge Detector (TI1F_ED)"]
2397 pub const TI1F_ED: Self = Self(0x04);
2398 #[doc = "Filtered Timer Input 1 (TI1FP1)"]
2399 pub const TI1FP1: Self = Self(0x05);
2400 #[doc = "Filtered Timer Input 2 (TI2FP2)"]
2401 pub const TI2FP2: Self = Self(0x06);
2402 #[doc = "External Trigger input (ETRF)"]
2403 pub const ETRF: Self = Self(0x07);
2589 } 2404 }
2590 #[repr(transparent)] 2405 #[repr(transparent)]
2591 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2406 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2592 pub struct Pllmul(pub u8); 2407 pub struct Ckd(pub u8);
2593 impl Pllmul { 2408 impl Ckd {
2594 #[doc = "PLL clock entry x 3"] 2409 #[doc = "t_DTS = t_CK_INT"]
2595 pub const MUL3: Self = Self(0); 2410 pub const DIV1: Self = Self(0);
2596 #[doc = "PLL clock entry x 4"] 2411 #[doc = "t_DTS = 2 × t_CK_INT"]
2597 pub const MUL4: Self = Self(0x01); 2412 pub const DIV2: Self = Self(0x01);
2598 #[doc = "PLL clock entry x 6"] 2413 #[doc = "t_DTS = 4 × t_CK_INT"]
2599 pub const MUL6: Self = Self(0x02); 2414 pub const DIV4: Self = Self(0x02);
2600 #[doc = "PLL clock entry x 8"]
2601 pub const MUL8: Self = Self(0x03);
2602 #[doc = "PLL clock entry x 12"]
2603 pub const MUL12: Self = Self(0x04);
2604 #[doc = "PLL clock entry x 16"]
2605 pub const MUL16: Self = Self(0x05);
2606 #[doc = "PLL clock entry x 24"]
2607 pub const MUL24: Self = Self(0x06);
2608 #[doc = "PLL clock entry x 32"]
2609 pub const MUL32: Self = Self(0x07);
2610 #[doc = "PLL clock entry x 48"]
2611 pub const MUL48: Self = Self(0x08);
2612 } 2415 }
2613 } 2416 }
2614 pub mod regs { 2417 pub mod regs {
2615 use crate::generic::*; 2418 use crate::generic::*;
2616 #[doc = "APB2 peripheral clock enable in sleep mode register"] 2419 #[doc = "prescaler"]
2617 #[repr(transparent)] 2420 #[repr(transparent)]
2618 #[derive(Copy, Clone, Eq, PartialEq)] 2421 #[derive(Copy, Clone, Eq, PartialEq)]
2619 pub struct Apb2smenr(pub u32); 2422 pub struct Psc(pub u32);
2620 impl Apb2smenr { 2423 impl Psc {
2621 #[doc = "System configuration controller clock enable during sleep mode bit"] 2424 #[doc = "Prescaler value"]
2622 pub const fn syscfgsmen(&self) -> super::vals::Dbgsmen { 2425 pub const fn psc(&self) -> u16 {
2623 let val = (self.0 >> 0usize) & 0x01; 2426 let val = (self.0 >> 0usize) & 0xffff;
2624 super::vals::Dbgsmen(val as u8) 2427 val as u16
2625 }
2626 #[doc = "System configuration controller clock enable during sleep mode bit"]
2627 pub fn set_syscfgsmen(&mut self, val: super::vals::Dbgsmen) {
2628 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
2629 }
2630 #[doc = "TIM21 timer clock enable during sleep mode bit"]
2631 pub const fn tim21smen(&self) -> super::vals::Dbgsmen {
2632 let val = (self.0 >> 2usize) & 0x01;
2633 super::vals::Dbgsmen(val as u8)
2634 }
2635 #[doc = "TIM21 timer clock enable during sleep mode bit"]
2636 pub fn set_tim21smen(&mut self, val: super::vals::Dbgsmen) {
2637 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
2638 }
2639 #[doc = "TIM22 timer clock enable during sleep mode bit"]
2640 pub const fn tim22smen(&self) -> super::vals::Dbgsmen {
2641 let val = (self.0 >> 5usize) & 0x01;
2642 super::vals::Dbgsmen(val as u8)
2643 }
2644 #[doc = "TIM22 timer clock enable during sleep mode bit"]
2645 pub fn set_tim22smen(&mut self, val: super::vals::Dbgsmen) {
2646 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
2647 }
2648 #[doc = "ADC clock enable during sleep mode bit"]
2649 pub const fn adcsmen(&self) -> super::vals::Dbgsmen {
2650 let val = (self.0 >> 9usize) & 0x01;
2651 super::vals::Dbgsmen(val as u8)
2652 } 2428 }
2653 #[doc = "ADC clock enable during sleep mode bit"] 2429 #[doc = "Prescaler value"]
2654 pub fn set_adcsmen(&mut self, val: super::vals::Dbgsmen) { 2430 pub fn set_psc(&mut self, val: u16) {
2655 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 2431 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
2656 } 2432 }
2657 #[doc = "SPI1 clock enable during sleep mode bit"] 2433 }
2658 pub const fn spi1smen(&self) -> super::vals::Dbgsmen { 2434 impl Default for Psc {
2659 let val = (self.0 >> 12usize) & 0x01; 2435 fn default() -> Psc {
2660 super::vals::Dbgsmen(val as u8) 2436 Psc(0)
2661 } 2437 }
2662 #[doc = "SPI1 clock enable during sleep mode bit"] 2438 }
2663 pub fn set_spi1smen(&mut self, val: super::vals::Dbgsmen) { 2439 #[doc = "counter"]
2664 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 2440 #[repr(transparent)]
2441 #[derive(Copy, Clone, Eq, PartialEq)]
2442 pub struct Cnt16(pub u32);
2443 impl Cnt16 {
2444 #[doc = "counter value"]
2445 pub const fn cnt(&self) -> u16 {
2446 let val = (self.0 >> 0usize) & 0xffff;
2447 val as u16
2665 } 2448 }
2666 #[doc = "USART1 clock enable during sleep mode bit"] 2449 #[doc = "counter value"]
2667 pub const fn usart1smen(&self) -> super::vals::Dbgsmen { 2450 pub fn set_cnt(&mut self, val: u16) {
2668 let val = (self.0 >> 14usize) & 0x01; 2451 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
2669 super::vals::Dbgsmen(val as u8)
2670 } 2452 }
2671 #[doc = "USART1 clock enable during sleep mode bit"] 2453 }
2672 pub fn set_usart1smen(&mut self, val: super::vals::Dbgsmen) { 2454 impl Default for Cnt16 {
2673 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 2455 fn default() -> Cnt16 {
2456 Cnt16(0)
2674 } 2457 }
2675 #[doc = "DBG clock enable during sleep mode bit"] 2458 }
2676 pub const fn dbgsmen(&self) -> super::vals::Dbgsmen { 2459 #[doc = "auto-reload register"]
2677 let val = (self.0 >> 22usize) & 0x01; 2460 #[repr(transparent)]
2678 super::vals::Dbgsmen(val as u8) 2461 #[derive(Copy, Clone, Eq, PartialEq)]
2462 pub struct Arr32(pub u32);
2463 impl Arr32 {
2464 #[doc = "Auto-reload value"]
2465 pub const fn arr(&self) -> u32 {
2466 let val = (self.0 >> 0usize) & 0xffff_ffff;
2467 val as u32
2679 } 2468 }
2680 #[doc = "DBG clock enable during sleep mode bit"] 2469 #[doc = "Auto-reload value"]
2681 pub fn set_dbgsmen(&mut self, val: super::vals::Dbgsmen) { 2470 pub fn set_arr(&mut self, val: u32) {
2682 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); 2471 self.0 =
2472 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
2683 } 2473 }
2684 } 2474 }
2685 impl Default for Apb2smenr { 2475 impl Default for Arr32 {
2686 fn default() -> Apb2smenr { 2476 fn default() -> Arr32 {
2687 Apb2smenr(0) 2477 Arr32(0)
2688 } 2478 }
2689 } 2479 }
2690 #[doc = "APB1 peripheral clock enable register"] 2480 #[doc = "control register 2"]
2691 #[repr(transparent)] 2481 #[repr(transparent)]
2692 #[derive(Copy, Clone, Eq, PartialEq)] 2482 #[derive(Copy, Clone, Eq, PartialEq)]
2693 pub struct Apb1enr(pub u32); 2483 pub struct Cr2Adv(pub u32);
2694 impl Apb1enr { 2484 impl Cr2Adv {
2695 #[doc = "Timer2 clock enable bit"] 2485 #[doc = "Capture/compare preloaded control"]
2696 pub const fn tim2en(&self) -> super::vals::Lptimen { 2486 pub const fn ccpc(&self) -> bool {
2697 let val = (self.0 >> 0usize) & 0x01; 2487 let val = (self.0 >> 0usize) & 0x01;
2698 super::vals::Lptimen(val as u8) 2488 val != 0
2699 }
2700 #[doc = "Timer2 clock enable bit"]
2701 pub fn set_tim2en(&mut self, val: super::vals::Lptimen) {
2702 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
2703 }
2704 #[doc = "Timer3 clock enable bit"]
2705 pub const fn tim3en(&self) -> super::vals::Lptimen {
2706 let val = (self.0 >> 1usize) & 0x01;
2707 super::vals::Lptimen(val as u8)
2708 }
2709 #[doc = "Timer3 clock enable bit"]
2710 pub fn set_tim3en(&mut self, val: super::vals::Lptimen) {
2711 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
2712 }
2713 #[doc = "Timer 6 clock enable bit"]
2714 pub const fn tim6en(&self) -> super::vals::Lptimen {
2715 let val = (self.0 >> 4usize) & 0x01;
2716 super::vals::Lptimen(val as u8)
2717 }
2718 #[doc = "Timer 6 clock enable bit"]
2719 pub fn set_tim6en(&mut self, val: super::vals::Lptimen) {
2720 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
2721 }
2722 #[doc = "Timer 7 clock enable bit"]
2723 pub const fn tim7en(&self) -> super::vals::Lptimen {
2724 let val = (self.0 >> 5usize) & 0x01;
2725 super::vals::Lptimen(val as u8)
2726 }
2727 #[doc = "Timer 7 clock enable bit"]
2728 pub fn set_tim7en(&mut self, val: super::vals::Lptimen) {
2729 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
2730 }
2731 #[doc = "Window watchdog clock enable bit"]
2732 pub const fn wwdgen(&self) -> super::vals::Lptimen {
2733 let val = (self.0 >> 11usize) & 0x01;
2734 super::vals::Lptimen(val as u8)
2735 }
2736 #[doc = "Window watchdog clock enable bit"]
2737 pub fn set_wwdgen(&mut self, val: super::vals::Lptimen) {
2738 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
2739 }
2740 #[doc = "SPI2 clock enable bit"]
2741 pub const fn spi2en(&self) -> super::vals::Lptimen {
2742 let val = (self.0 >> 14usize) & 0x01;
2743 super::vals::Lptimen(val as u8)
2744 }
2745 #[doc = "SPI2 clock enable bit"]
2746 pub fn set_spi2en(&mut self, val: super::vals::Lptimen) {
2747 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
2748 }
2749 #[doc = "UART2 clock enable bit"]
2750 pub const fn usart2en(&self) -> super::vals::Lptimen {
2751 let val = (self.0 >> 17usize) & 0x01;
2752 super::vals::Lptimen(val as u8)
2753 }
2754 #[doc = "UART2 clock enable bit"]
2755 pub fn set_usart2en(&mut self, val: super::vals::Lptimen) {
2756 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
2757 }
2758 #[doc = "LPUART1 clock enable bit"]
2759 pub const fn lpuart1en(&self) -> super::vals::Lptimen {
2760 let val = (self.0 >> 18usize) & 0x01;
2761 super::vals::Lptimen(val as u8)
2762 }
2763 #[doc = "LPUART1 clock enable bit"]
2764 pub fn set_lpuart1en(&mut self, val: super::vals::Lptimen) {
2765 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
2766 }
2767 #[doc = "USART4 clock enable bit"]
2768 pub const fn usart4en(&self) -> super::vals::Lptimen {
2769 let val = (self.0 >> 19usize) & 0x01;
2770 super::vals::Lptimen(val as u8)
2771 }
2772 #[doc = "USART4 clock enable bit"]
2773 pub fn set_usart4en(&mut self, val: super::vals::Lptimen) {
2774 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
2775 }
2776 #[doc = "USART5 clock enable bit"]
2777 pub const fn usart5en(&self) -> super::vals::Lptimen {
2778 let val = (self.0 >> 20usize) & 0x01;
2779 super::vals::Lptimen(val as u8)
2780 } 2489 }
2781 #[doc = "USART5 clock enable bit"] 2490 #[doc = "Capture/compare preloaded control"]
2782 pub fn set_usart5en(&mut self, val: super::vals::Lptimen) { 2491 pub fn set_ccpc(&mut self, val: bool) {
2783 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); 2492 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2784 } 2493 }
2785 #[doc = "I2C1 clock enable bit"] 2494 #[doc = "Capture/compare control update selection"]
2786 pub const fn i2c1en(&self) -> super::vals::Lptimen { 2495 pub const fn ccus(&self) -> bool {
2787 let val = (self.0 >> 21usize) & 0x01; 2496 let val = (self.0 >> 2usize) & 0x01;
2788 super::vals::Lptimen(val as u8) 2497 val != 0
2789 } 2498 }
2790 #[doc = "I2C1 clock enable bit"] 2499 #[doc = "Capture/compare control update selection"]
2791 pub fn set_i2c1en(&mut self, val: super::vals::Lptimen) { 2500 pub fn set_ccus(&mut self, val: bool) {
2792 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 2501 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
2793 } 2502 }
2794 #[doc = "I2C2 clock enable bit"] 2503 #[doc = "Capture/compare DMA selection"]
2795 pub const fn i2c2en(&self) -> super::vals::Lptimen { 2504 pub const fn ccds(&self) -> super::vals::Ccds {
2796 let val = (self.0 >> 22usize) & 0x01; 2505 let val = (self.0 >> 3usize) & 0x01;
2797 super::vals::Lptimen(val as u8) 2506 super::vals::Ccds(val as u8)
2798 } 2507 }
2799 #[doc = "I2C2 clock enable bit"] 2508 #[doc = "Capture/compare DMA selection"]
2800 pub fn set_i2c2en(&mut self, val: super::vals::Lptimen) { 2509 pub fn set_ccds(&mut self, val: super::vals::Ccds) {
2801 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); 2510 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
2802 } 2511 }
2803 #[doc = "USB clock enable bit"] 2512 #[doc = "Master mode selection"]
2804 pub const fn usben(&self) -> super::vals::Lptimen { 2513 pub const fn mms(&self) -> super::vals::Mms {
2805 let val = (self.0 >> 23usize) & 0x01; 2514 let val = (self.0 >> 4usize) & 0x07;
2806 super::vals::Lptimen(val as u8) 2515 super::vals::Mms(val as u8)
2807 } 2516 }
2808 #[doc = "USB clock enable bit"] 2517 #[doc = "Master mode selection"]
2809 pub fn set_usben(&mut self, val: super::vals::Lptimen) { 2518 pub fn set_mms(&mut self, val: super::vals::Mms) {
2810 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); 2519 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
2811 } 2520 }
2812 #[doc = "Clock recovery system clock enable bit"] 2521 #[doc = "TI1 selection"]
2813 pub const fn crsen(&self) -> super::vals::Lptimen { 2522 pub const fn ti1s(&self) -> super::vals::Tis {
2814 let val = (self.0 >> 27usize) & 0x01; 2523 let val = (self.0 >> 7usize) & 0x01;
2815 super::vals::Lptimen(val as u8) 2524 super::vals::Tis(val as u8)
2816 } 2525 }
2817 #[doc = "Clock recovery system clock enable bit"] 2526 #[doc = "TI1 selection"]
2818 pub fn set_crsen(&mut self, val: super::vals::Lptimen) { 2527 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
2819 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 2528 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
2820 } 2529 }
2821 #[doc = "Power interface clock enable bit"] 2530 #[doc = "Output Idle state 1"]
2822 pub const fn pwren(&self) -> super::vals::Lptimen { 2531 pub fn ois(&self, n: usize) -> bool {
2823 let val = (self.0 >> 28usize) & 0x01; 2532 assert!(n < 4usize);
2824 super::vals::Lptimen(val as u8) 2533 let offs = 8usize + n * 2usize;
2534 let val = (self.0 >> offs) & 0x01;
2535 val != 0
2825 } 2536 }
2826 #[doc = "Power interface clock enable bit"] 2537 #[doc = "Output Idle state 1"]
2827 pub fn set_pwren(&mut self, val: super::vals::Lptimen) { 2538 pub fn set_ois(&mut self, n: usize, val: bool) {
2828 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 2539 assert!(n < 4usize);
2540 let offs = 8usize + n * 2usize;
2541 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2829 } 2542 }
2830 #[doc = "DAC interface clock enable bit"] 2543 #[doc = "Output Idle state 1"]
2831 pub const fn dacen(&self) -> super::vals::Lptimen { 2544 pub const fn ois1n(&self) -> bool {
2832 let val = (self.0 >> 29usize) & 0x01; 2545 let val = (self.0 >> 9usize) & 0x01;
2833 super::vals::Lptimen(val as u8) 2546 val != 0
2834 } 2547 }
2835 #[doc = "DAC interface clock enable bit"] 2548 #[doc = "Output Idle state 1"]
2836 pub fn set_dacen(&mut self, val: super::vals::Lptimen) { 2549 pub fn set_ois1n(&mut self, val: bool) {
2837 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 2550 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
2838 } 2551 }
2839 #[doc = "I2C3 clock enable bit"] 2552 #[doc = "Output Idle state 2"]
2840 pub const fn i2c3en(&self) -> super::vals::Lptimen { 2553 pub const fn ois2n(&self) -> bool {
2841 let val = (self.0 >> 30usize) & 0x01; 2554 let val = (self.0 >> 11usize) & 0x01;
2842 super::vals::Lptimen(val as u8) 2555 val != 0
2843 } 2556 }
2844 #[doc = "I2C3 clock enable bit"] 2557 #[doc = "Output Idle state 2"]
2845 pub fn set_i2c3en(&mut self, val: super::vals::Lptimen) { 2558 pub fn set_ois2n(&mut self, val: bool) {
2846 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); 2559 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
2847 } 2560 }
2848 #[doc = "Low power timer clock enable bit"] 2561 #[doc = "Output Idle state 3"]
2849 pub const fn lptim1en(&self) -> super::vals::Lptimen { 2562 pub const fn ois3n(&self) -> bool {
2850 let val = (self.0 >> 31usize) & 0x01; 2563 let val = (self.0 >> 13usize) & 0x01;
2851 super::vals::Lptimen(val as u8) 2564 val != 0
2852 } 2565 }
2853 #[doc = "Low power timer clock enable bit"] 2566 #[doc = "Output Idle state 3"]
2854 pub fn set_lptim1en(&mut self, val: super::vals::Lptimen) { 2567 pub fn set_ois3n(&mut self, val: bool) {
2855 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 2568 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
2856 } 2569 }
2857 } 2570 }
2858 impl Default for Apb1enr { 2571 impl Default for Cr2Adv {
2859 fn default() -> Apb1enr { 2572 fn default() -> Cr2Adv {
2860 Apb1enr(0) 2573 Cr2Adv(0)
2861 } 2574 }
2862 } 2575 }
2863 #[doc = "Clock interrupt clear register"] 2576 #[doc = "DMA/Interrupt enable register"]
2864 #[repr(transparent)] 2577 #[repr(transparent)]
2865 #[derive(Copy, Clone, Eq, PartialEq)] 2578 #[derive(Copy, Clone, Eq, PartialEq)]
2866 pub struct Cicr(pub u32); 2579 pub struct DierBasic(pub u32);
2867 impl Cicr { 2580 impl DierBasic {
2868 #[doc = "LSI ready Interrupt clear"] 2581 #[doc = "Update interrupt enable"]
2869 pub const fn lsirdyc(&self) -> bool { 2582 pub const fn uie(&self) -> bool {
2870 let val = (self.0 >> 0usize) & 0x01; 2583 let val = (self.0 >> 0usize) & 0x01;
2871 val != 0 2584 val != 0
2872 } 2585 }
2873 #[doc = "LSI ready Interrupt clear"] 2586 #[doc = "Update interrupt enable"]
2874 pub fn set_lsirdyc(&mut self, val: bool) { 2587 pub fn set_uie(&mut self, val: bool) {
2875 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 2588 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2876 } 2589 }
2877 #[doc = "LSE ready Interrupt clear"] 2590 #[doc = "Update DMA request enable"]
2878 pub const fn lserdyc(&self) -> bool { 2591 pub const fn ude(&self) -> bool {
2879 let val = (self.0 >> 1usize) & 0x01; 2592 let val = (self.0 >> 8usize) & 0x01;
2880 val != 0 2593 val != 0
2881 } 2594 }
2882 #[doc = "LSE ready Interrupt clear"] 2595 #[doc = "Update DMA request enable"]
2883 pub fn set_lserdyc(&mut self, val: bool) { 2596 pub fn set_ude(&mut self, val: bool) {
2884 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 2597 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
2885 }
2886 #[doc = "HSI16 ready Interrupt clear"]
2887 pub const fn hsi16rdyc(&self) -> bool {
2888 let val = (self.0 >> 2usize) & 0x01;
2889 val != 0
2890 } 2598 }
2891 #[doc = "HSI16 ready Interrupt clear"] 2599 }
2892 pub fn set_hsi16rdyc(&mut self, val: bool) { 2600 impl Default for DierBasic {
2893 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 2601 fn default() -> DierBasic {
2602 DierBasic(0)
2894 } 2603 }
2895 #[doc = "HSE ready Interrupt clear"] 2604 }
2896 pub const fn hserdyc(&self) -> bool { 2605 #[doc = "event generation register"]
2897 let val = (self.0 >> 3usize) & 0x01; 2606 #[repr(transparent)]
2607 #[derive(Copy, Clone, Eq, PartialEq)]
2608 pub struct EgrAdv(pub u32);
2609 impl EgrAdv {
2610 #[doc = "Update generation"]
2611 pub const fn ug(&self) -> bool {
2612 let val = (self.0 >> 0usize) & 0x01;
2898 val != 0 2613 val != 0
2899 } 2614 }
2900 #[doc = "HSE ready Interrupt clear"] 2615 #[doc = "Update generation"]
2901 pub fn set_hserdyc(&mut self, val: bool) { 2616 pub fn set_ug(&mut self, val: bool) {
2902 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 2617 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2903 } 2618 }
2904 #[doc = "PLL ready Interrupt clear"] 2619 #[doc = "Capture/compare 1 generation"]
2905 pub const fn pllrdyc(&self) -> bool { 2620 pub fn ccg(&self, n: usize) -> bool {
2906 let val = (self.0 >> 4usize) & 0x01; 2621 assert!(n < 4usize);
2622 let offs = 1usize + n * 1usize;
2623 let val = (self.0 >> offs) & 0x01;
2907 val != 0 2624 val != 0
2908 } 2625 }
2909 #[doc = "PLL ready Interrupt clear"] 2626 #[doc = "Capture/compare 1 generation"]
2910 pub fn set_pllrdyc(&mut self, val: bool) { 2627 pub fn set_ccg(&mut self, n: usize, val: bool) {
2911 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 2628 assert!(n < 4usize);
2629 let offs = 1usize + n * 1usize;
2630 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2912 } 2631 }
2913 #[doc = "MSI ready Interrupt clear"] 2632 #[doc = "Capture/Compare control update generation"]
2914 pub const fn msirdyc(&self) -> bool { 2633 pub const fn comg(&self) -> bool {
2915 let val = (self.0 >> 5usize) & 0x01; 2634 let val = (self.0 >> 5usize) & 0x01;
2916 val != 0 2635 val != 0
2917 } 2636 }
2918 #[doc = "MSI ready Interrupt clear"] 2637 #[doc = "Capture/Compare control update generation"]
2919 pub fn set_msirdyc(&mut self, val: bool) { 2638 pub fn set_comg(&mut self, val: bool) {
2920 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 2639 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
2921 } 2640 }
2922 #[doc = "HSI48 ready Interrupt clear"] 2641 #[doc = "Trigger generation"]
2923 pub const fn hsi48rdyc(&self) -> bool { 2642 pub const fn tg(&self) -> bool {
2924 let val = (self.0 >> 6usize) & 0x01; 2643 let val = (self.0 >> 6usize) & 0x01;
2925 val != 0 2644 val != 0
2926 } 2645 }
2927 #[doc = "HSI48 ready Interrupt clear"] 2646 #[doc = "Trigger generation"]
2928 pub fn set_hsi48rdyc(&mut self, val: bool) { 2647 pub fn set_tg(&mut self, val: bool) {
2929 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 2648 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
2930 } 2649 }
2931 #[doc = "LSE Clock Security System Interrupt clear"] 2650 #[doc = "Break generation"]
2932 pub const fn csslsec(&self) -> bool { 2651 pub const fn bg(&self) -> bool {
2933 let val = (self.0 >> 7usize) & 0x01; 2652 let val = (self.0 >> 7usize) & 0x01;
2934 val != 0 2653 val != 0
2935 } 2654 }
2936 #[doc = "LSE Clock Security System Interrupt clear"] 2655 #[doc = "Break generation"]
2937 pub fn set_csslsec(&mut self, val: bool) { 2656 pub fn set_bg(&mut self, val: bool) {
2938 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 2657 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
2939 } 2658 }
2940 #[doc = "Clock Security System Interrupt clear"]
2941 pub const fn csshsec(&self) -> bool {
2942 let val = (self.0 >> 8usize) & 0x01;
2943 val != 0
2944 }
2945 #[doc = "Clock Security System Interrupt clear"]
2946 pub fn set_csshsec(&mut self, val: bool) {
2947 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
2948 }
2949 }
2950 impl Default for Cicr {
2951 fn default() -> Cicr {
2952 Cicr(0)
2953 }
2954 }
2955 #[doc = "APB2 peripheral clock enable register"]
2956 #[repr(transparent)]
2957 #[derive(Copy, Clone, Eq, PartialEq)]
2958 pub struct Apb2enr(pub u32);
2959 impl Apb2enr {
2960 #[doc = "System configuration controller clock enable bit"]
2961 pub const fn syscfgen(&self) -> super::vals::Dbgen {
2962 let val = (self.0 >> 0usize) & 0x01;
2963 super::vals::Dbgen(val as u8)
2964 }
2965 #[doc = "System configuration controller clock enable bit"]
2966 pub fn set_syscfgen(&mut self, val: super::vals::Dbgen) {
2967 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
2968 }
2969 #[doc = "TIM21 timer clock enable bit"]
2970 pub const fn tim21en(&self) -> super::vals::Dbgen {
2971 let val = (self.0 >> 2usize) & 0x01;
2972 super::vals::Dbgen(val as u8)
2973 }
2974 #[doc = "TIM21 timer clock enable bit"]
2975 pub fn set_tim21en(&mut self, val: super::vals::Dbgen) {
2976 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
2977 }
2978 #[doc = "TIM22 timer clock enable bit"]
2979 pub const fn tim22en(&self) -> super::vals::Dbgen {
2980 let val = (self.0 >> 5usize) & 0x01;
2981 super::vals::Dbgen(val as u8)
2982 }
2983 #[doc = "TIM22 timer clock enable bit"]
2984 pub fn set_tim22en(&mut self, val: super::vals::Dbgen) {
2985 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
2986 }
2987 #[doc = "MiFaRe Firewall clock enable bit"]
2988 pub const fn mifien(&self) -> super::vals::Dbgen {
2989 let val = (self.0 >> 7usize) & 0x01;
2990 super::vals::Dbgen(val as u8)
2991 }
2992 #[doc = "MiFaRe Firewall clock enable bit"]
2993 pub fn set_mifien(&mut self, val: super::vals::Dbgen) {
2994 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
2995 }
2996 #[doc = "ADC clock enable bit"]
2997 pub const fn adcen(&self) -> super::vals::Dbgen {
2998 let val = (self.0 >> 9usize) & 0x01;
2999 super::vals::Dbgen(val as u8)
3000 }
3001 #[doc = "ADC clock enable bit"]
3002 pub fn set_adcen(&mut self, val: super::vals::Dbgen) {
3003 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
3004 }
3005 #[doc = "SPI1 clock enable bit"]
3006 pub const fn spi1en(&self) -> super::vals::Dbgen {
3007 let val = (self.0 >> 12usize) & 0x01;
3008 super::vals::Dbgen(val as u8)
3009 }
3010 #[doc = "SPI1 clock enable bit"]
3011 pub fn set_spi1en(&mut self, val: super::vals::Dbgen) {
3012 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
3013 }
3014 #[doc = "USART1 clock enable bit"]
3015 pub const fn usart1en(&self) -> super::vals::Dbgen {
3016 let val = (self.0 >> 14usize) & 0x01;
3017 super::vals::Dbgen(val as u8)
3018 }
3019 #[doc = "USART1 clock enable bit"]
3020 pub fn set_usart1en(&mut self, val: super::vals::Dbgen) {
3021 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
3022 }
3023 #[doc = "DBG clock enable bit"]
3024 pub const fn dbgen(&self) -> super::vals::Dbgen {
3025 let val = (self.0 >> 22usize) & 0x01;
3026 super::vals::Dbgen(val as u8)
3027 }
3028 #[doc = "DBG clock enable bit"]
3029 pub fn set_dbgen(&mut self, val: super::vals::Dbgen) {
3030 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
3031 }
3032 } 2659 }
3033 impl Default for Apb2enr { 2660 impl Default for EgrAdv {
3034 fn default() -> Apb2enr { 2661 fn default() -> EgrAdv {
3035 Apb2enr(0) 2662 EgrAdv(0)
3036 } 2663 }
3037 } 2664 }
3038 #[doc = "Clock interrupt enable register"] 2665 #[doc = "event generation register"]
3039 #[repr(transparent)] 2666 #[repr(transparent)]
3040 #[derive(Copy, Clone, Eq, PartialEq)] 2667 #[derive(Copy, Clone, Eq, PartialEq)]
3041 pub struct Cier(pub u32); 2668 pub struct EgrGp(pub u32);
3042 impl Cier { 2669 impl EgrGp {
3043 #[doc = "LSI ready interrupt flag"] 2670 #[doc = "Update generation"]
3044 pub const fn lsirdyie(&self) -> super::vals::Hsirdyie { 2671 pub const fn ug(&self) -> bool {
3045 let val = (self.0 >> 0usize) & 0x01; 2672 let val = (self.0 >> 0usize) & 0x01;
3046 super::vals::Hsirdyie(val as u8) 2673 val != 0
3047 }
3048 #[doc = "LSI ready interrupt flag"]
3049 pub fn set_lsirdyie(&mut self, val: super::vals::Hsirdyie) {
3050 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
3051 }
3052 #[doc = "LSE ready interrupt flag"]
3053 pub const fn lserdyie(&self) -> super::vals::Hsirdyie {
3054 let val = (self.0 >> 1usize) & 0x01;
3055 super::vals::Hsirdyie(val as u8)
3056 }
3057 #[doc = "LSE ready interrupt flag"]
3058 pub fn set_lserdyie(&mut self, val: super::vals::Hsirdyie) {
3059 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
3060 }
3061 #[doc = "HSI16 ready interrupt flag"]
3062 pub const fn hsi16rdyie(&self) -> super::vals::Hsirdyie {
3063 let val = (self.0 >> 2usize) & 0x01;
3064 super::vals::Hsirdyie(val as u8)
3065 }
3066 #[doc = "HSI16 ready interrupt flag"]
3067 pub fn set_hsi16rdyie(&mut self, val: super::vals::Hsirdyie) {
3068 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
3069 }
3070 #[doc = "HSE ready interrupt flag"]
3071 pub const fn hserdyie(&self) -> super::vals::Hsirdyie {
3072 let val = (self.0 >> 3usize) & 0x01;
3073 super::vals::Hsirdyie(val as u8)
3074 } 2674 }
3075 #[doc = "HSE ready interrupt flag"] 2675 #[doc = "Update generation"]
3076 pub fn set_hserdyie(&mut self, val: super::vals::Hsirdyie) { 2676 pub fn set_ug(&mut self, val: bool) {
3077 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 2677 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3078 } 2678 }
3079 #[doc = "PLL ready interrupt flag"] 2679 #[doc = "Capture/compare 1 generation"]
3080 pub const fn pllrdyie(&self) -> super::vals::Hsirdyie { 2680 pub fn ccg(&self, n: usize) -> bool {
3081 let val = (self.0 >> 4usize) & 0x01; 2681 assert!(n < 4usize);
3082 super::vals::Hsirdyie(val as u8) 2682 let offs = 1usize + n * 1usize;
2683 let val = (self.0 >> offs) & 0x01;
2684 val != 0
3083 } 2685 }
3084 #[doc = "PLL ready interrupt flag"] 2686 #[doc = "Capture/compare 1 generation"]
3085 pub fn set_pllrdyie(&mut self, val: super::vals::Hsirdyie) { 2687 pub fn set_ccg(&mut self, n: usize, val: bool) {
3086 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 2688 assert!(n < 4usize);
2689 let offs = 1usize + n * 1usize;
2690 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3087 } 2691 }
3088 #[doc = "MSI ready interrupt flag"] 2692 #[doc = "Capture/Compare control update generation"]
3089 pub const fn msirdyie(&self) -> super::vals::Hsirdyie { 2693 pub const fn comg(&self) -> bool {
3090 let val = (self.0 >> 5usize) & 0x01; 2694 let val = (self.0 >> 5usize) & 0x01;
3091 super::vals::Hsirdyie(val as u8) 2695 val != 0
3092 } 2696 }
3093 #[doc = "MSI ready interrupt flag"] 2697 #[doc = "Capture/Compare control update generation"]
3094 pub fn set_msirdyie(&mut self, val: super::vals::Hsirdyie) { 2698 pub fn set_comg(&mut self, val: bool) {
3095 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 2699 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
3096 } 2700 }
3097 #[doc = "HSI48 ready interrupt flag"] 2701 #[doc = "Trigger generation"]
3098 pub const fn hsi48rdyie(&self) -> super::vals::Hsirdyie { 2702 pub const fn tg(&self) -> bool {
3099 let val = (self.0 >> 6usize) & 0x01; 2703 let val = (self.0 >> 6usize) & 0x01;
3100 super::vals::Hsirdyie(val as u8) 2704 val != 0
3101 } 2705 }
3102 #[doc = "HSI48 ready interrupt flag"] 2706 #[doc = "Trigger generation"]
3103 pub fn set_hsi48rdyie(&mut self, val: super::vals::Hsirdyie) { 2707 pub fn set_tg(&mut self, val: bool) {
3104 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 2708 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
3105 } 2709 }
3106 #[doc = "LSE CSS interrupt flag"] 2710 #[doc = "Break generation"]
3107 pub const fn csslse(&self) -> super::vals::Csslse { 2711 pub const fn bg(&self) -> bool {
3108 let val = (self.0 >> 7usize) & 0x01; 2712 let val = (self.0 >> 7usize) & 0x01;
3109 super::vals::Csslse(val as u8) 2713 val != 0
3110 } 2714 }
3111 #[doc = "LSE CSS interrupt flag"] 2715 #[doc = "Break generation"]
3112 pub fn set_csslse(&mut self, val: super::vals::Csslse) { 2716 pub fn set_bg(&mut self, val: bool) {
3113 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 2717 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
3114 } 2718 }
3115 } 2719 }
3116 impl Default for Cier { 2720 impl Default for EgrGp {
3117 fn default() -> Cier { 2721 fn default() -> EgrGp {
3118 Cier(0) 2722 EgrGp(0)
3119 } 2723 }
3120 } 2724 }
3121 #[doc = "AHB peripheral clock enable register"] 2725 #[doc = "control register 2"]
3122 #[repr(transparent)] 2726 #[repr(transparent)]
3123 #[derive(Copy, Clone, Eq, PartialEq)] 2727 #[derive(Copy, Clone, Eq, PartialEq)]
3124 pub struct Ahbenr(pub u32); 2728 pub struct Cr2Basic(pub u32);
3125 impl Ahbenr { 2729 impl Cr2Basic {
3126 #[doc = "DMA clock enable bit"] 2730 #[doc = "Master mode selection"]
3127 pub const fn dmaen(&self) -> super::vals::Crypen { 2731 pub const fn mms(&self) -> super::vals::Mms {
3128 let val = (self.0 >> 0usize) & 0x01; 2732 let val = (self.0 >> 4usize) & 0x07;
3129 super::vals::Crypen(val as u8) 2733 super::vals::Mms(val as u8)
3130 }
3131 #[doc = "DMA clock enable bit"]
3132 pub fn set_dmaen(&mut self, val: super::vals::Crypen) {
3133 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
3134 }
3135 #[doc = "NVM interface clock enable bit"]
3136 pub const fn mifen(&self) -> super::vals::Crypen {
3137 let val = (self.0 >> 8usize) & 0x01;
3138 super::vals::Crypen(val as u8)
3139 }
3140 #[doc = "NVM interface clock enable bit"]
3141 pub fn set_mifen(&mut self, val: super::vals::Crypen) {
3142 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
3143 }
3144 #[doc = "CRC clock enable bit"]
3145 pub const fn crcen(&self) -> super::vals::Crypen {
3146 let val = (self.0 >> 12usize) & 0x01;
3147 super::vals::Crypen(val as u8)
3148 }
3149 #[doc = "CRC clock enable bit"]
3150 pub fn set_crcen(&mut self, val: super::vals::Crypen) {
3151 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
3152 }
3153 #[doc = "Touch Sensing clock enable bit"]
3154 pub const fn touchen(&self) -> super::vals::Crypen {
3155 let val = (self.0 >> 16usize) & 0x01;
3156 super::vals::Crypen(val as u8)
3157 }
3158 #[doc = "Touch Sensing clock enable bit"]
3159 pub fn set_touchen(&mut self, val: super::vals::Crypen) {
3160 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
3161 }
3162 #[doc = "Random Number Generator clock enable bit"]
3163 pub const fn rngen(&self) -> super::vals::Crypen {
3164 let val = (self.0 >> 20usize) & 0x01;
3165 super::vals::Crypen(val as u8)
3166 }
3167 #[doc = "Random Number Generator clock enable bit"]
3168 pub fn set_rngen(&mut self, val: super::vals::Crypen) {
3169 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
3170 }
3171 #[doc = "Crypto clock enable bit"]
3172 pub const fn crypen(&self) -> super::vals::Crypen {
3173 let val = (self.0 >> 24usize) & 0x01;
3174 super::vals::Crypen(val as u8)
3175 } 2734 }
3176 #[doc = "Crypto clock enable bit"] 2735 #[doc = "Master mode selection"]
3177 pub fn set_crypen(&mut self, val: super::vals::Crypen) { 2736 pub fn set_mms(&mut self, val: super::vals::Mms) {
3178 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 2737 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
3179 } 2738 }
3180 } 2739 }
3181 impl Default for Ahbenr { 2740 impl Default for Cr2Basic {
3182 fn default() -> Ahbenr { 2741 fn default() -> Cr2Basic {
3183 Ahbenr(0) 2742 Cr2Basic(0)
3184 } 2743 }
3185 } 2744 }
3186 #[doc = "Clock control register"] 2745 #[doc = "capture/compare mode register 2 (output mode)"]
3187 #[repr(transparent)] 2746 #[repr(transparent)]
3188 #[derive(Copy, Clone, Eq, PartialEq)] 2747 #[derive(Copy, Clone, Eq, PartialEq)]
3189 pub struct Cr(pub u32); 2748 pub struct CcmrOutput(pub u32);
3190 impl Cr { 2749 impl CcmrOutput {
3191 #[doc = "16 MHz high-speed internal clock enable"] 2750 #[doc = "Capture/Compare 3 selection"]
3192 pub const fn hsi16on(&self) -> super::vals::Pllon { 2751 pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs {
3193 let val = (self.0 >> 0usize) & 0x01; 2752 assert!(n < 2usize);
3194 super::vals::Pllon(val as u8) 2753 let offs = 0usize + n * 8usize;
3195 } 2754 let val = (self.0 >> offs) & 0x03;
3196 #[doc = "16 MHz high-speed internal clock enable"] 2755 super::vals::CcmrOutputCcs(val as u8)
3197 pub fn set_hsi16on(&mut self, val: super::vals::Pllon) {
3198 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
3199 }
3200 #[doc = "High-speed internal clock enable bit for some IP kernels"]
3201 pub const fn hsi16keron(&self) -> super::vals::Pllon {
3202 let val = (self.0 >> 1usize) & 0x01;
3203 super::vals::Pllon(val as u8)
3204 }
3205 #[doc = "High-speed internal clock enable bit for some IP kernels"]
3206 pub fn set_hsi16keron(&mut self, val: super::vals::Pllon) {
3207 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
3208 }
3209 #[doc = "Internal high-speed clock ready flag"]
3210 pub const fn hsi16rdyf(&self) -> bool {
3211 let val = (self.0 >> 2usize) & 0x01;
3212 val != 0
3213 }
3214 #[doc = "Internal high-speed clock ready flag"]
3215 pub fn set_hsi16rdyf(&mut self, val: bool) {
3216 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
3217 }
3218 #[doc = "HSI16DIVEN"]
3219 pub const fn hsi16diven(&self) -> super::vals::Hsidiven {
3220 let val = (self.0 >> 3usize) & 0x01;
3221 super::vals::Hsidiven(val as u8)
3222 } 2756 }
3223 #[doc = "HSI16DIVEN"] 2757 #[doc = "Capture/Compare 3 selection"]
3224 pub fn set_hsi16diven(&mut self, val: super::vals::Hsidiven) { 2758 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) {
3225 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 2759 assert!(n < 2usize);
2760 let offs = 0usize + n * 8usize;
2761 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
3226 } 2762 }
3227 #[doc = "HSI16DIVF"] 2763 #[doc = "Output compare 3 fast enable"]
3228 pub const fn hsi16divf(&self) -> bool { 2764 pub fn ocfe(&self, n: usize) -> bool {
3229 let val = (self.0 >> 4usize) & 0x01; 2765 assert!(n < 2usize);
2766 let offs = 2usize + n * 8usize;
2767 let val = (self.0 >> offs) & 0x01;
3230 val != 0 2768 val != 0
3231 } 2769 }
3232 #[doc = "HSI16DIVF"] 2770 #[doc = "Output compare 3 fast enable"]
3233 pub fn set_hsi16divf(&mut self, val: bool) { 2771 pub fn set_ocfe(&mut self, n: usize, val: bool) {
3234 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 2772 assert!(n < 2usize);
3235 } 2773 let offs = 2usize + n * 8usize;
3236 #[doc = "16 MHz high-speed internal clock output enable"] 2774 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3237 pub const fn hsi16outen(&self) -> super::vals::Hsiouten {
3238 let val = (self.0 >> 5usize) & 0x01;
3239 super::vals::Hsiouten(val as u8)
3240 }
3241 #[doc = "16 MHz high-speed internal clock output enable"]
3242 pub fn set_hsi16outen(&mut self, val: super::vals::Hsiouten) {
3243 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
3244 }
3245 #[doc = "MSI clock enable bit"]
3246 pub const fn msion(&self) -> super::vals::Pllon {
3247 let val = (self.0 >> 8usize) & 0x01;
3248 super::vals::Pllon(val as u8)
3249 }
3250 #[doc = "MSI clock enable bit"]
3251 pub fn set_msion(&mut self, val: super::vals::Pllon) {
3252 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
3253 } 2775 }
3254 #[doc = "MSI clock ready flag"] 2776 #[doc = "Output compare 3 preload enable"]
3255 pub const fn msirdy(&self) -> bool { 2777 pub fn ocpe(&self, n: usize) -> super::vals::Ocpe {
3256 let val = (self.0 >> 9usize) & 0x01; 2778 assert!(n < 2usize);
3257 val != 0 2779 let offs = 3usize + n * 8usize;
2780 let val = (self.0 >> offs) & 0x01;
2781 super::vals::Ocpe(val as u8)
3258 } 2782 }
3259 #[doc = "MSI clock ready flag"] 2783 #[doc = "Output compare 3 preload enable"]
3260 pub fn set_msirdy(&mut self, val: bool) { 2784 pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) {
3261 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 2785 assert!(n < 2usize);
2786 let offs = 3usize + n * 8usize;
2787 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
3262 } 2788 }
3263 #[doc = "HSE clock enable bit"] 2789 #[doc = "Output compare 3 mode"]
3264 pub const fn hseon(&self) -> super::vals::Pllon { 2790 pub fn ocm(&self, n: usize) -> super::vals::Ocm {
3265 let val = (self.0 >> 16usize) & 0x01; 2791 assert!(n < 2usize);
3266 super::vals::Pllon(val as u8) 2792 let offs = 4usize + n * 8usize;
2793 let val = (self.0 >> offs) & 0x07;
2794 super::vals::Ocm(val as u8)
3267 } 2795 }
3268 #[doc = "HSE clock enable bit"] 2796 #[doc = "Output compare 3 mode"]
3269 pub fn set_hseon(&mut self, val: super::vals::Pllon) { 2797 pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) {
3270 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 2798 assert!(n < 2usize);
2799 let offs = 4usize + n * 8usize;
2800 self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs);
3271 } 2801 }
3272 #[doc = "HSE clock ready flag"] 2802 #[doc = "Output compare 3 clear enable"]
3273 pub const fn hserdy(&self) -> bool { 2803 pub fn occe(&self, n: usize) -> bool {
3274 let val = (self.0 >> 17usize) & 0x01; 2804 assert!(n < 2usize);
2805 let offs = 7usize + n * 8usize;
2806 let val = (self.0 >> offs) & 0x01;
3275 val != 0 2807 val != 0
3276 } 2808 }
3277 #[doc = "HSE clock ready flag"] 2809 #[doc = "Output compare 3 clear enable"]
3278 pub fn set_hserdy(&mut self, val: bool) { 2810 pub fn set_occe(&mut self, n: usize, val: bool) {
3279 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 2811 assert!(n < 2usize);
3280 } 2812 let offs = 7usize + n * 8usize;
3281 #[doc = "HSE clock bypass bit"] 2813 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3282 pub const fn hsebyp(&self) -> super::vals::Hsebyp {
3283 let val = (self.0 >> 18usize) & 0x01;
3284 super::vals::Hsebyp(val as u8)
3285 }
3286 #[doc = "HSE clock bypass bit"]
3287 pub fn set_hsebyp(&mut self, val: super::vals::Hsebyp) {
3288 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
3289 }
3290 #[doc = "Clock security system on HSE enable bit"]
3291 pub const fn csshseon(&self) -> super::vals::Pllon {
3292 let val = (self.0 >> 19usize) & 0x01;
3293 super::vals::Pllon(val as u8)
3294 }
3295 #[doc = "Clock security system on HSE enable bit"]
3296 pub fn set_csshseon(&mut self, val: super::vals::Pllon) {
3297 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
3298 }
3299 #[doc = "TC/LCD prescaler"]
3300 pub const fn rtcpre(&self) -> super::vals::Rtcpre {
3301 let val = (self.0 >> 20usize) & 0x03;
3302 super::vals::Rtcpre(val as u8)
3303 }
3304 #[doc = "TC/LCD prescaler"]
3305 pub fn set_rtcpre(&mut self, val: super::vals::Rtcpre) {
3306 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
3307 }
3308 #[doc = "PLL enable bit"]
3309 pub const fn pllon(&self) -> super::vals::Pllon {
3310 let val = (self.0 >> 24usize) & 0x01;
3311 super::vals::Pllon(val as u8)
3312 } 2814 }
3313 #[doc = "PLL enable bit"] 2815 }
3314 pub fn set_pllon(&mut self, val: super::vals::Pllon) { 2816 impl Default for CcmrOutput {
3315 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 2817 fn default() -> CcmrOutput {
2818 CcmrOutput(0)
3316 } 2819 }
3317 #[doc = "PLL clock ready flag"] 2820 }
3318 pub const fn pllrdy(&self) -> bool { 2821 #[doc = "capture/compare register 1"]
3319 let val = (self.0 >> 25usize) & 0x01; 2822 #[repr(transparent)]
3320 val != 0 2823 #[derive(Copy, Clone, Eq, PartialEq)]
2824 pub struct Ccr32(pub u32);
2825 impl Ccr32 {
2826 #[doc = "Capture/Compare 1 value"]
2827 pub const fn ccr(&self) -> u32 {
2828 let val = (self.0 >> 0usize) & 0xffff_ffff;
2829 val as u32
3321 } 2830 }
3322 #[doc = "PLL clock ready flag"] 2831 #[doc = "Capture/Compare 1 value"]
3323 pub fn set_pllrdy(&mut self, val: bool) { 2832 pub fn set_ccr(&mut self, val: u32) {
3324 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); 2833 self.0 =
2834 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
3325 } 2835 }
3326 } 2836 }
3327 impl Default for Cr { 2837 impl Default for Ccr32 {
3328 fn default() -> Cr { 2838 fn default() -> Ccr32 {
3329 Cr(0) 2839 Ccr32(0)
3330 } 2840 }
3331 } 2841 }
3332 #[doc = "AHB peripheral reset register"] 2842 #[doc = "control register 1"]
3333 #[repr(transparent)] 2843 #[repr(transparent)]
3334 #[derive(Copy, Clone, Eq, PartialEq)] 2844 #[derive(Copy, Clone, Eq, PartialEq)]
3335 pub struct Ahbrstr(pub u32); 2845 pub struct Cr1Basic(pub u32);
3336 impl Ahbrstr { 2846 impl Cr1Basic {
3337 #[doc = "DMA reset"] 2847 #[doc = "Counter enable"]
3338 pub const fn dmarst(&self) -> bool { 2848 pub const fn cen(&self) -> bool {
3339 let val = (self.0 >> 0usize) & 0x01; 2849 let val = (self.0 >> 0usize) & 0x01;
3340 val != 0 2850 val != 0
3341 } 2851 }
3342 #[doc = "DMA reset"] 2852 #[doc = "Counter enable"]
3343 pub fn set_dmarst(&mut self, val: bool) { 2853 pub fn set_cen(&mut self, val: bool) {
3344 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 2854 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3345 } 2855 }
3346 #[doc = "Memory interface reset"] 2856 #[doc = "Update disable"]
3347 pub const fn mifrst(&self) -> bool { 2857 pub const fn udis(&self) -> bool {
3348 let val = (self.0 >> 8usize) & 0x01; 2858 let val = (self.0 >> 1usize) & 0x01;
3349 val != 0
3350 }
3351 #[doc = "Memory interface reset"]
3352 pub fn set_mifrst(&mut self, val: bool) {
3353 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
3354 }
3355 #[doc = "Test integration module reset"]
3356 pub const fn crcrst(&self) -> bool {
3357 let val = (self.0 >> 12usize) & 0x01;
3358 val != 0 2859 val != 0
3359 } 2860 }
3360 #[doc = "Test integration module reset"] 2861 #[doc = "Update disable"]
3361 pub fn set_crcrst(&mut self, val: bool) { 2862 pub fn set_udis(&mut self, val: bool) {
3362 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 2863 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
3363 } 2864 }
3364 #[doc = "Touch Sensing reset"] 2865 #[doc = "Update request source"]
3365 pub const fn touchrst(&self) -> bool { 2866 pub const fn urs(&self) -> super::vals::Urs {
3366 let val = (self.0 >> 16usize) & 0x01; 2867 let val = (self.0 >> 2usize) & 0x01;
3367 val != 0 2868 super::vals::Urs(val as u8)
3368 } 2869 }
3369 #[doc = "Touch Sensing reset"] 2870 #[doc = "Update request source"]
3370 pub fn set_touchrst(&mut self, val: bool) { 2871 pub fn set_urs(&mut self, val: super::vals::Urs) {
3371 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 2872 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
3372 } 2873 }
3373 #[doc = "Random Number Generator module reset"] 2874 #[doc = "One-pulse mode"]
3374 pub const fn rngrst(&self) -> bool { 2875 pub const fn opm(&self) -> super::vals::Opm {
3375 let val = (self.0 >> 20usize) & 0x01; 2876 let val = (self.0 >> 3usize) & 0x01;
3376 val != 0 2877 super::vals::Opm(val as u8)
3377 } 2878 }
3378 #[doc = "Random Number Generator module reset"] 2879 #[doc = "One-pulse mode"]
3379 pub fn set_rngrst(&mut self, val: bool) { 2880 pub fn set_opm(&mut self, val: super::vals::Opm) {
3380 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); 2881 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
3381 } 2882 }
3382 #[doc = "Crypto module reset"] 2883 #[doc = "Auto-reload preload enable"]
3383 pub const fn cryprst(&self) -> bool { 2884 pub const fn arpe(&self) -> super::vals::Arpe {
3384 let val = (self.0 >> 24usize) & 0x01; 2885 let val = (self.0 >> 7usize) & 0x01;
3385 val != 0 2886 super::vals::Arpe(val as u8)
3386 } 2887 }
3387 #[doc = "Crypto module reset"] 2888 #[doc = "Auto-reload preload enable"]
3388 pub fn set_cryprst(&mut self, val: bool) { 2889 pub fn set_arpe(&mut self, val: super::vals::Arpe) {
3389 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); 2890 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
3390 } 2891 }
3391 } 2892 }
3392 impl Default for Ahbrstr { 2893 impl Default for Cr1Basic {
3393 fn default() -> Ahbrstr { 2894 fn default() -> Cr1Basic {
3394 Ahbrstr(0) 2895 Cr1Basic(0)
3395 } 2896 }
3396 } 2897 }
3397 #[doc = "Clock interrupt flag register"] 2898 #[doc = "status register"]
3398 #[repr(transparent)] 2899 #[repr(transparent)]
3399 #[derive(Copy, Clone, Eq, PartialEq)] 2900 #[derive(Copy, Clone, Eq, PartialEq)]
3400 pub struct Cifr(pub u32); 2901 pub struct SrAdv(pub u32);
3401 impl Cifr { 2902 impl SrAdv {
3402 #[doc = "LSI ready interrupt flag"] 2903 #[doc = "Update interrupt flag"]
3403 pub const fn lsirdyf(&self) -> bool { 2904 pub const fn uif(&self) -> bool {
3404 let val = (self.0 >> 0usize) & 0x01; 2905 let val = (self.0 >> 0usize) & 0x01;
3405 val != 0 2906 val != 0
3406 } 2907 }
3407 #[doc = "LSI ready interrupt flag"] 2908 #[doc = "Update interrupt flag"]
3408 pub fn set_lsirdyf(&mut self, val: bool) { 2909 pub fn set_uif(&mut self, val: bool) {
3409 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 2910 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3410 } 2911 }
3411 #[doc = "LSE ready interrupt flag"] 2912 #[doc = "Capture/compare 1 interrupt flag"]
3412 pub const fn lserdyf(&self) -> bool { 2913 pub fn ccif(&self, n: usize) -> bool {
3413 let val = (self.0 >> 1usize) & 0x01; 2914 assert!(n < 4usize);
3414 val != 0 2915 let offs = 1usize + n * 1usize;
3415 } 2916 let val = (self.0 >> offs) & 0x01;
3416 #[doc = "LSE ready interrupt flag"]
3417 pub fn set_lserdyf(&mut self, val: bool) {
3418 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
3419 }
3420 #[doc = "HSI16 ready interrupt flag"]
3421 pub const fn hsi16rdyf(&self) -> bool {
3422 let val = (self.0 >> 2usize) & 0x01;
3423 val != 0
3424 }
3425 #[doc = "HSI16 ready interrupt flag"]
3426 pub fn set_hsi16rdyf(&mut self, val: bool) {
3427 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
3428 }
3429 #[doc = "HSE ready interrupt flag"]
3430 pub const fn hserdyf(&self) -> bool {
3431 let val = (self.0 >> 3usize) & 0x01;
3432 val != 0
3433 }
3434 #[doc = "HSE ready interrupt flag"]
3435 pub fn set_hserdyf(&mut self, val: bool) {
3436 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
3437 }
3438 #[doc = "PLL ready interrupt flag"]
3439 pub const fn pllrdyf(&self) -> bool {
3440 let val = (self.0 >> 4usize) & 0x01;
3441 val != 0 2917 val != 0
3442 } 2918 }
3443 #[doc = "PLL ready interrupt flag"] 2919 #[doc = "Capture/compare 1 interrupt flag"]
3444 pub fn set_pllrdyf(&mut self, val: bool) { 2920 pub fn set_ccif(&mut self, n: usize, val: bool) {
3445 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 2921 assert!(n < 4usize);
2922 let offs = 1usize + n * 1usize;
2923 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3446 } 2924 }
3447 #[doc = "MSI ready interrupt flag"] 2925 #[doc = "COM interrupt flag"]
3448 pub const fn msirdyf(&self) -> bool { 2926 pub const fn comif(&self) -> bool {
3449 let val = (self.0 >> 5usize) & 0x01; 2927 let val = (self.0 >> 5usize) & 0x01;
3450 val != 0 2928 val != 0
3451 } 2929 }
3452 #[doc = "MSI ready interrupt flag"] 2930 #[doc = "COM interrupt flag"]
3453 pub fn set_msirdyf(&mut self, val: bool) { 2931 pub fn set_comif(&mut self, val: bool) {
3454 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 2932 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
3455 } 2933 }
3456 #[doc = "HSI48 ready interrupt flag"] 2934 #[doc = "Trigger interrupt flag"]
3457 pub const fn hsi48rdyf(&self) -> bool { 2935 pub const fn tif(&self) -> bool {
3458 let val = (self.0 >> 6usize) & 0x01; 2936 let val = (self.0 >> 6usize) & 0x01;
3459 val != 0 2937 val != 0
3460 } 2938 }
3461 #[doc = "HSI48 ready interrupt flag"] 2939 #[doc = "Trigger interrupt flag"]
3462 pub fn set_hsi48rdyf(&mut self, val: bool) { 2940 pub fn set_tif(&mut self, val: bool) {
3463 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 2941 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
3464 } 2942 }
3465 #[doc = "LSE Clock Security System Interrupt flag"] 2943 #[doc = "Break interrupt flag"]
3466 pub const fn csslsef(&self) -> super::vals::Csslsef { 2944 pub const fn bif(&self) -> bool {
3467 let val = (self.0 >> 7usize) & 0x01; 2945 let val = (self.0 >> 7usize) & 0x01;
3468 super::vals::Csslsef(val as u8) 2946 val != 0
3469 } 2947 }
3470 #[doc = "LSE Clock Security System Interrupt flag"] 2948 #[doc = "Break interrupt flag"]
3471 pub fn set_csslsef(&mut self, val: super::vals::Csslsef) { 2949 pub fn set_bif(&mut self, val: bool) {
3472 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 2950 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
3473 } 2951 }
3474 #[doc = "Clock Security System Interrupt flag"] 2952 #[doc = "Capture/Compare 1 overcapture flag"]
3475 pub const fn csshsef(&self) -> super::vals::Csshsef { 2953 pub fn ccof(&self, n: usize) -> bool {
3476 let val = (self.0 >> 8usize) & 0x01; 2954 assert!(n < 4usize);
3477 super::vals::Csshsef(val as u8) 2955 let offs = 9usize + n * 1usize;
2956 let val = (self.0 >> offs) & 0x01;
2957 val != 0
3478 } 2958 }
3479 #[doc = "Clock Security System Interrupt flag"] 2959 #[doc = "Capture/Compare 1 overcapture flag"]
3480 pub fn set_csshsef(&mut self, val: super::vals::Csshsef) { 2960 pub fn set_ccof(&mut self, n: usize, val: bool) {
3481 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 2961 assert!(n < 4usize);
2962 let offs = 9usize + n * 1usize;
2963 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3482 } 2964 }
3483 } 2965 }
3484 impl Default for Cifr { 2966 impl Default for SrAdv {
3485 fn default() -> Cifr { 2967 fn default() -> SrAdv {
3486 Cifr(0) 2968 SrAdv(0)
3487 } 2969 }
3488 } 2970 }
3489 #[doc = "Clock configuration register"] 2971 #[doc = "capture/compare mode register 1 (input mode)"]
3490 #[repr(transparent)] 2972 #[repr(transparent)]
3491 #[derive(Copy, Clone, Eq, PartialEq)] 2973 #[derive(Copy, Clone, Eq, PartialEq)]
3492 pub struct Cfgr(pub u32); 2974 pub struct CcmrInput(pub u32);
3493 impl Cfgr { 2975 impl CcmrInput {
3494 #[doc = "System clock switch"] 2976 #[doc = "Capture/Compare 1 selection"]
3495 pub const fn sw(&self) -> super::vals::Sw { 2977 pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs {
3496 let val = (self.0 >> 0usize) & 0x03; 2978 assert!(n < 2usize);
3497 super::vals::Sw(val as u8) 2979 let offs = 0usize + n * 8usize;
3498 } 2980 let val = (self.0 >> offs) & 0x03;
3499 #[doc = "System clock switch"] 2981 super::vals::CcmrInputCcs(val as u8)
3500 pub fn set_sw(&mut self, val: super::vals::Sw) {
3501 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
3502 }
3503 #[doc = "System clock switch status"]
3504 pub const fn sws(&self) -> super::vals::Sws {
3505 let val = (self.0 >> 2usize) & 0x03;
3506 super::vals::Sws(val as u8)
3507 } 2982 }
3508 #[doc = "System clock switch status"] 2983 #[doc = "Capture/Compare 1 selection"]
3509 pub fn set_sws(&mut self, val: super::vals::Sws) { 2984 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) {
3510 self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize); 2985 assert!(n < 2usize);
2986 let offs = 0usize + n * 8usize;
2987 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
3511 } 2988 }
3512 #[doc = "AHB prescaler"] 2989 #[doc = "Input capture 1 prescaler"]
3513 pub const fn hpre(&self) -> super::vals::Hpre { 2990 pub fn icpsc(&self, n: usize) -> u8 {
3514 let val = (self.0 >> 4usize) & 0x0f; 2991 assert!(n < 2usize);
3515 super::vals::Hpre(val as u8) 2992 let offs = 2usize + n * 8usize;
2993 let val = (self.0 >> offs) & 0x03;
2994 val as u8
3516 } 2995 }
3517 #[doc = "AHB prescaler"] 2996 #[doc = "Input capture 1 prescaler"]
3518 pub fn set_hpre(&mut self, val: super::vals::Hpre) { 2997 pub fn set_icpsc(&mut self, n: usize, val: u8) {
3519 self.0 = (self.0 & !(0x0f << 4usize)) | (((val.0 as u32) & 0x0f) << 4usize); 2998 assert!(n < 2usize);
2999 let offs = 2usize + n * 8usize;
3000 self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs);
3520 } 3001 }
3521 #[doc = "APB low-speed prescaler (APB1)"] 3002 #[doc = "Input capture 1 filter"]
3522 pub fn ppre(&self, n: usize) -> super::vals::Ppre { 3003 pub fn icf(&self, n: usize) -> super::vals::Icf {
3523 assert!(n < 2usize); 3004 assert!(n < 2usize);
3524 let offs = 8usize + n * 3usize; 3005 let offs = 4usize + n * 8usize;
3525 let val = (self.0 >> offs) & 0x07; 3006 let val = (self.0 >> offs) & 0x0f;
3526 super::vals::Ppre(val as u8) 3007 super::vals::Icf(val as u8)
3527 } 3008 }
3528 #[doc = "APB low-speed prescaler (APB1)"] 3009 #[doc = "Input capture 1 filter"]
3529 pub fn set_ppre(&mut self, n: usize, val: super::vals::Ppre) { 3010 pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) {
3530 assert!(n < 2usize); 3011 assert!(n < 2usize);
3531 let offs = 8usize + n * 3usize; 3012 let offs = 4usize + n * 8usize;
3532 self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs); 3013 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
3533 } 3014 }
3534 #[doc = "Wake-up from stop clock selection"] 3015 }
3535 pub const fn stopwuck(&self) -> super::vals::Stopwuck { 3016 impl Default for CcmrInput {
3536 let val = (self.0 >> 15usize) & 0x01; 3017 fn default() -> CcmrInput {
3537 super::vals::Stopwuck(val as u8) 3018 CcmrInput(0)
3538 } 3019 }
3539 #[doc = "Wake-up from stop clock selection"] 3020 }
3540 pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) { 3021 #[doc = "event generation register"]
3541 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 3022 #[repr(transparent)]
3023 #[derive(Copy, Clone, Eq, PartialEq)]
3024 pub struct EgrBasic(pub u32);
3025 impl EgrBasic {
3026 #[doc = "Update generation"]
3027 pub const fn ug(&self) -> bool {
3028 let val = (self.0 >> 0usize) & 0x01;
3029 val != 0
3542 } 3030 }
3543 #[doc = "PLL entry clock source"] 3031 #[doc = "Update generation"]
3544 pub const fn pllsrc(&self) -> super::vals::Pllsrc { 3032 pub fn set_ug(&mut self, val: bool) {
3545 let val = (self.0 >> 16usize) & 0x01; 3033 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3546 super::vals::Pllsrc(val as u8)
3547 } 3034 }
3548 #[doc = "PLL entry clock source"] 3035 }
3549 pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) { 3036 impl Default for EgrBasic {
3550 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 3037 fn default() -> EgrBasic {
3038 EgrBasic(0)
3551 } 3039 }
3552 #[doc = "PLL multiplication factor"] 3040 }
3553 pub const fn pllmul(&self) -> super::vals::Pllmul { 3041 #[doc = "counter"]
3554 let val = (self.0 >> 18usize) & 0x0f; 3042 #[repr(transparent)]
3555 super::vals::Pllmul(val as u8) 3043 #[derive(Copy, Clone, Eq, PartialEq)]
3044 pub struct Cnt32(pub u32);
3045 impl Cnt32 {
3046 #[doc = "counter value"]
3047 pub const fn cnt(&self) -> u32 {
3048 let val = (self.0 >> 0usize) & 0xffff_ffff;
3049 val as u32
3556 } 3050 }
3557 #[doc = "PLL multiplication factor"] 3051 #[doc = "counter value"]
3558 pub fn set_pllmul(&mut self, val: super::vals::Pllmul) { 3052 pub fn set_cnt(&mut self, val: u32) {
3559 self.0 = (self.0 & !(0x0f << 18usize)) | (((val.0 as u32) & 0x0f) << 18usize); 3053 self.0 =
3054 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
3560 } 3055 }
3561 #[doc = "PLL output division"] 3056 }
3562 pub const fn plldiv(&self) -> super::vals::Plldiv { 3057 impl Default for Cnt32 {
3563 let val = (self.0 >> 22usize) & 0x03; 3058 fn default() -> Cnt32 {
3564 super::vals::Plldiv(val as u8) 3059 Cnt32(0)
3565 } 3060 }
3566 #[doc = "PLL output division"] 3061 }
3567 pub fn set_plldiv(&mut self, val: super::vals::Plldiv) { 3062 #[doc = "capture/compare enable register"]
3568 self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize); 3063 #[repr(transparent)]
3064 #[derive(Copy, Clone, Eq, PartialEq)]
3065 pub struct CcerAdv(pub u32);
3066 impl CcerAdv {
3067 #[doc = "Capture/Compare 1 output enable"]
3068 pub fn cce(&self, n: usize) -> bool {
3069 assert!(n < 4usize);
3070 let offs = 0usize + n * 4usize;
3071 let val = (self.0 >> offs) & 0x01;
3072 val != 0
3569 } 3073 }
3570 #[doc = "Microcontroller clock output selection"] 3074 #[doc = "Capture/Compare 1 output enable"]
3571 pub const fn mcosel(&self) -> super::vals::Mcosel { 3075 pub fn set_cce(&mut self, n: usize, val: bool) {
3572 let val = (self.0 >> 24usize) & 0x0f; 3076 assert!(n < 4usize);
3573 super::vals::Mcosel(val as u8) 3077 let offs = 0usize + n * 4usize;
3078 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3574 } 3079 }
3575 #[doc = "Microcontroller clock output selection"] 3080 #[doc = "Capture/Compare 1 output Polarity"]
3576 pub fn set_mcosel(&mut self, val: super::vals::Mcosel) { 3081 pub fn ccp(&self, n: usize) -> bool {
3577 self.0 = (self.0 & !(0x0f << 24usize)) | (((val.0 as u32) & 0x0f) << 24usize); 3082 assert!(n < 4usize);
3083 let offs = 1usize + n * 4usize;
3084 let val = (self.0 >> offs) & 0x01;
3085 val != 0
3578 } 3086 }
3579 #[doc = "Microcontroller clock output prescaler"] 3087 #[doc = "Capture/Compare 1 output Polarity"]
3580 pub const fn mcopre(&self) -> super::vals::Mcopre { 3088 pub fn set_ccp(&mut self, n: usize, val: bool) {
3581 let val = (self.0 >> 28usize) & 0x07; 3089 assert!(n < 4usize);
3582 super::vals::Mcopre(val as u8) 3090 let offs = 1usize + n * 4usize;
3091 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3583 } 3092 }
3584 #[doc = "Microcontroller clock output prescaler"] 3093 #[doc = "Capture/Compare 1 complementary output enable"]
3585 pub fn set_mcopre(&mut self, val: super::vals::Mcopre) { 3094 pub fn ccne(&self, n: usize) -> bool {
3586 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); 3095 assert!(n < 4usize);
3096 let offs = 2usize + n * 4usize;
3097 let val = (self.0 >> offs) & 0x01;
3098 val != 0
3099 }
3100 #[doc = "Capture/Compare 1 complementary output enable"]
3101 pub fn set_ccne(&mut self, n: usize, val: bool) {
3102 assert!(n < 4usize);
3103 let offs = 2usize + n * 4usize;
3104 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3105 }
3106 #[doc = "Capture/Compare 1 output Polarity"]
3107 pub fn ccnp(&self, n: usize) -> bool {
3108 assert!(n < 4usize);
3109 let offs = 3usize + n * 4usize;
3110 let val = (self.0 >> offs) & 0x01;
3111 val != 0
3112 }
3113 #[doc = "Capture/Compare 1 output Polarity"]
3114 pub fn set_ccnp(&mut self, n: usize, val: bool) {
3115 assert!(n < 4usize);
3116 let offs = 3usize + n * 4usize;
3117 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3587 } 3118 }
3588 } 3119 }
3589 impl Default for Cfgr { 3120 impl Default for CcerAdv {
3590 fn default() -> Cfgr { 3121 fn default() -> CcerAdv {
3591 Cfgr(0) 3122 CcerAdv(0)
3592 } 3123 }
3593 } 3124 }
3594 #[doc = "Internal clock sources calibration register"] 3125 #[doc = "DMA control register"]
3595 #[repr(transparent)] 3126 #[repr(transparent)]
3596 #[derive(Copy, Clone, Eq, PartialEq)] 3127 #[derive(Copy, Clone, Eq, PartialEq)]
3597 pub struct Icscr(pub u32); 3128 pub struct Dcr(pub u32);
3598 impl Icscr { 3129 impl Dcr {
3599 #[doc = "nternal high speed clock calibration"] 3130 #[doc = "DMA base address"]
3600 pub const fn hsi16cal(&self) -> u8 { 3131 pub const fn dba(&self) -> u8 {
3601 let val = (self.0 >> 0usize) & 0xff; 3132 let val = (self.0 >> 0usize) & 0x1f;
3602 val as u8 3133 val as u8
3603 } 3134 }
3604 #[doc = "nternal high speed clock calibration"] 3135 #[doc = "DMA base address"]
3605 pub fn set_hsi16cal(&mut self, val: u8) { 3136 pub fn set_dba(&mut self, val: u8) {
3606 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 3137 self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
3607 } 3138 }
3608 #[doc = "High speed internal clock trimming"] 3139 #[doc = "DMA burst length"]
3609 pub const fn hsi16trim(&self) -> u8 { 3140 pub const fn dbl(&self) -> u8 {
3610 let val = (self.0 >> 8usize) & 0x1f; 3141 let val = (self.0 >> 8usize) & 0x1f;
3611 val as u8 3142 val as u8
3612 } 3143 }
3613 #[doc = "High speed internal clock trimming"] 3144 #[doc = "DMA burst length"]
3614 pub fn set_hsi16trim(&mut self, val: u8) { 3145 pub fn set_dbl(&mut self, val: u8) {
3615 self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize); 3146 self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize);
3616 } 3147 }
3617 #[doc = "MSI clock ranges"]
3618 pub const fn msirange(&self) -> super::vals::Msirange {
3619 let val = (self.0 >> 13usize) & 0x07;
3620 super::vals::Msirange(val as u8)
3621 }
3622 #[doc = "MSI clock ranges"]
3623 pub fn set_msirange(&mut self, val: super::vals::Msirange) {
3624 self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize);
3625 }
3626 #[doc = "MSI clock calibration"]
3627 pub const fn msical(&self) -> u8 {
3628 let val = (self.0 >> 16usize) & 0xff;
3629 val as u8
3630 }
3631 #[doc = "MSI clock calibration"]
3632 pub fn set_msical(&mut self, val: u8) {
3633 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
3634 }
3635 #[doc = "MSI clock trimming"]
3636 pub const fn msitrim(&self) -> u8 {
3637 let val = (self.0 >> 24usize) & 0xff;
3638 val as u8
3639 }
3640 #[doc = "MSI clock trimming"]
3641 pub fn set_msitrim(&mut self, val: u8) {
3642 self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
3643 }
3644 } 3148 }
3645 impl Default for Icscr { 3149 impl Default for Dcr {
3646 fn default() -> Icscr { 3150 fn default() -> Dcr {
3647 Icscr(0) 3151 Dcr(0)
3648 } 3152 }
3649 } 3153 }
3650 #[doc = "APB2 peripheral reset register"] 3154 #[doc = "DMA/Interrupt enable register"]
3651 #[repr(transparent)] 3155 #[repr(transparent)]
3652 #[derive(Copy, Clone, Eq, PartialEq)] 3156 #[derive(Copy, Clone, Eq, PartialEq)]
3653 pub struct Apb2rstr(pub u32); 3157 pub struct DierGp(pub u32);
3654 impl Apb2rstr { 3158 impl DierGp {
3655 #[doc = "System configuration controller reset"] 3159 #[doc = "Update interrupt enable"]
3656 pub const fn syscfgrst(&self) -> bool { 3160 pub const fn uie(&self) -> bool {
3657 let val = (self.0 >> 0usize) & 0x01; 3161 let val = (self.0 >> 0usize) & 0x01;
3658 val != 0 3162 val != 0
3659 } 3163 }
3660 #[doc = "System configuration controller reset"] 3164 #[doc = "Update interrupt enable"]
3661 pub fn set_syscfgrst(&mut self, val: bool) { 3165 pub fn set_uie(&mut self, val: bool) {
3662 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 3166 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3663 } 3167 }
3664 #[doc = "TIM21 timer reset"] 3168 #[doc = "Capture/Compare 1 interrupt enable"]
3665 pub const fn tim21rst(&self) -> bool { 3169 pub fn ccie(&self, n: usize) -> bool {
3666 let val = (self.0 >> 2usize) & 0x01; 3170 assert!(n < 4usize);
3171 let offs = 1usize + n * 1usize;
3172 let val = (self.0 >> offs) & 0x01;
3667 val != 0 3173 val != 0
3668 } 3174 }
3669 #[doc = "TIM21 timer reset"] 3175 #[doc = "Capture/Compare 1 interrupt enable"]
3670 pub fn set_tim21rst(&mut self, val: bool) { 3176 pub fn set_ccie(&mut self, n: usize, val: bool) {
3671 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 3177 assert!(n < 4usize);
3178 let offs = 1usize + n * 1usize;
3179 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3672 } 3180 }
3673 #[doc = "TIM22 timer reset"] 3181 #[doc = "Trigger interrupt enable"]
3674 pub const fn tim22rst(&self) -> bool { 3182 pub const fn tie(&self) -> bool {
3675 let val = (self.0 >> 5usize) & 0x01; 3183 let val = (self.0 >> 6usize) & 0x01;
3676 val != 0 3184 val != 0
3677 } 3185 }
3678 #[doc = "TIM22 timer reset"] 3186 #[doc = "Trigger interrupt enable"]
3679 pub fn set_tim22rst(&mut self, val: bool) { 3187 pub fn set_tie(&mut self, val: bool) {
3680 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 3188 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
3681 } 3189 }
3682 #[doc = "ADC interface reset"] 3190 #[doc = "Update DMA request enable"]
3683 pub const fn adcrst(&self) -> bool { 3191 pub const fn ude(&self) -> bool {
3684 let val = (self.0 >> 9usize) & 0x01; 3192 let val = (self.0 >> 8usize) & 0x01;
3685 val != 0 3193 val != 0
3686 } 3194 }
3687 #[doc = "ADC interface reset"] 3195 #[doc = "Update DMA request enable"]
3688 pub fn set_adcrst(&mut self, val: bool) { 3196 pub fn set_ude(&mut self, val: bool) {
3689 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 3197 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
3690 } 3198 }
3691 #[doc = "SPI 1 reset"] 3199 #[doc = "Capture/Compare 1 DMA request enable"]
3692 pub const fn spi1rst(&self) -> bool { 3200 pub fn ccde(&self, n: usize) -> bool {
3693 let val = (self.0 >> 12usize) & 0x01; 3201 assert!(n < 4usize);
3202 let offs = 9usize + n * 1usize;
3203 let val = (self.0 >> offs) & 0x01;
3694 val != 0 3204 val != 0
3695 } 3205 }
3696 #[doc = "SPI 1 reset"] 3206 #[doc = "Capture/Compare 1 DMA request enable"]
3697 pub fn set_spi1rst(&mut self, val: bool) { 3207 pub fn set_ccde(&mut self, n: usize, val: bool) {
3698 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 3208 assert!(n < 4usize);
3209 let offs = 9usize + n * 1usize;
3210 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3699 } 3211 }
3700 #[doc = "USART1 reset"] 3212 #[doc = "Trigger DMA request enable"]
3701 pub const fn usart1rst(&self) -> bool { 3213 pub const fn tde(&self) -> bool {
3702 let val = (self.0 >> 14usize) & 0x01; 3214 let val = (self.0 >> 14usize) & 0x01;
3703 val != 0 3215 val != 0
3704 } 3216 }
3705 #[doc = "USART1 reset"] 3217 #[doc = "Trigger DMA request enable"]
3706 pub fn set_usart1rst(&mut self, val: bool) { 3218 pub fn set_tde(&mut self, val: bool) {
3707 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 3219 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
3708 } 3220 }
3709 #[doc = "DBG reset"]
3710 pub const fn dbgrst(&self) -> bool {
3711 let val = (self.0 >> 22usize) & 0x01;
3712 val != 0
3713 }
3714 #[doc = "DBG reset"]
3715 pub fn set_dbgrst(&mut self, val: bool) {
3716 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
3717 }
3718 } 3221 }
3719 impl Default for Apb2rstr { 3222 impl Default for DierGp {
3720 fn default() -> Apb2rstr { 3223 fn default() -> DierGp {
3721 Apb2rstr(0) 3224 DierGp(0)
3722 } 3225 }
3723 } 3226 }
3724 #[doc = "Clock recovery RC register"] 3227 #[doc = "DMA/Interrupt enable register"]
3725 #[repr(transparent)] 3228 #[repr(transparent)]
3726 #[derive(Copy, Clone, Eq, PartialEq)] 3229 #[derive(Copy, Clone, Eq, PartialEq)]
3727 pub struct Crrcr(pub u32); 3230 pub struct DierAdv(pub u32);
3728 impl Crrcr { 3231 impl DierAdv {
3729 #[doc = "48MHz HSI clock enable bit"] 3232 #[doc = "Update interrupt enable"]
3730 pub const fn hsi48on(&self) -> bool { 3233 pub const fn uie(&self) -> bool {
3731 let val = (self.0 >> 0usize) & 0x01; 3234 let val = (self.0 >> 0usize) & 0x01;
3732 val != 0 3235 val != 0
3733 } 3236 }
3734 #[doc = "48MHz HSI clock enable bit"] 3237 #[doc = "Update interrupt enable"]
3735 pub fn set_hsi48on(&mut self, val: bool) { 3238 pub fn set_uie(&mut self, val: bool) {
3736 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 3239 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3737 } 3240 }
3738 #[doc = "48MHz HSI clock ready flag"] 3241 #[doc = "Capture/Compare 1 interrupt enable"]
3739 pub const fn hsi48rdy(&self) -> bool { 3242 pub fn ccie(&self, n: usize) -> bool {
3740 let val = (self.0 >> 1usize) & 0x01; 3243 assert!(n < 4usize);
3244 let offs = 1usize + n * 1usize;
3245 let val = (self.0 >> offs) & 0x01;
3741 val != 0 3246 val != 0
3742 } 3247 }
3743 #[doc = "48MHz HSI clock ready flag"] 3248 #[doc = "Capture/Compare 1 interrupt enable"]
3744 pub fn set_hsi48rdy(&mut self, val: bool) { 3249 pub fn set_ccie(&mut self, n: usize, val: bool) {
3745 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 3250 assert!(n < 4usize);
3251 let offs = 1usize + n * 1usize;
3252 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3746 } 3253 }
3747 #[doc = "48 MHz HSI clock divided by 6 output enable"] 3254 #[doc = "COM interrupt enable"]
3748 pub const fn hsi48div6en(&self) -> bool { 3255 pub const fn comie(&self) -> bool {
3749 let val = (self.0 >> 2usize) & 0x01; 3256 let val = (self.0 >> 5usize) & 0x01;
3750 val != 0 3257 val != 0
3751 } 3258 }
3752 #[doc = "48 MHz HSI clock divided by 6 output enable"] 3259 #[doc = "COM interrupt enable"]
3753 pub fn set_hsi48div6en(&mut self, val: bool) { 3260 pub fn set_comie(&mut self, val: bool) {
3754 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 3261 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
3755 }
3756 #[doc = "48 MHz HSI clock calibration"]
3757 pub const fn hsi48cal(&self) -> u8 {
3758 let val = (self.0 >> 8usize) & 0xff;
3759 val as u8
3760 }
3761 #[doc = "48 MHz HSI clock calibration"]
3762 pub fn set_hsi48cal(&mut self, val: u8) {
3763 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
3764 }
3765 }
3766 impl Default for Crrcr {
3767 fn default() -> Crrcr {
3768 Crrcr(0)
3769 } 3262 }
3770 } 3263 #[doc = "Trigger interrupt enable"]
3771 #[doc = "APB1 peripheral clock enable in sleep mode register"] 3264 pub const fn tie(&self) -> bool {
3772 #[repr(transparent)] 3265 let val = (self.0 >> 6usize) & 0x01;
3773 #[derive(Copy, Clone, Eq, PartialEq)] 3266 val != 0
3774 pub struct Apb1smenr(pub u32);
3775 impl Apb1smenr {
3776 #[doc = "Timer2 clock enable during sleep mode bit"]
3777 pub const fn tim2smen(&self) -> super::vals::Lptimsmen {
3778 let val = (self.0 >> 0usize) & 0x01;
3779 super::vals::Lptimsmen(val as u8)
3780 } 3267 }
3781 #[doc = "Timer2 clock enable during sleep mode bit"] 3268 #[doc = "Trigger interrupt enable"]
3782 pub fn set_tim2smen(&mut self, val: super::vals::Lptimsmen) { 3269 pub fn set_tie(&mut self, val: bool) {
3783 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 3270 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
3784 } 3271 }
3785 #[doc = "Timer3 clock enable during Sleep mode bit"] 3272 #[doc = "Break interrupt enable"]
3786 pub const fn tim3smen(&self) -> super::vals::Lptimsmen { 3273 pub const fn bie(&self) -> bool {
3787 let val = (self.0 >> 1usize) & 0x01; 3274 let val = (self.0 >> 7usize) & 0x01;
3788 super::vals::Lptimsmen(val as u8) 3275 val != 0
3789 } 3276 }
3790 #[doc = "Timer3 clock enable during Sleep mode bit"] 3277 #[doc = "Break interrupt enable"]
3791 pub fn set_tim3smen(&mut self, val: super::vals::Lptimsmen) { 3278 pub fn set_bie(&mut self, val: bool) {
3792 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 3279 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
3793 } 3280 }
3794 #[doc = "Timer 6 clock enable during sleep mode bit"] 3281 #[doc = "Update DMA request enable"]
3795 pub const fn tim6smen(&self) -> super::vals::Lptimsmen { 3282 pub const fn ude(&self) -> bool {
3796 let val = (self.0 >> 4usize) & 0x01; 3283 let val = (self.0 >> 8usize) & 0x01;
3797 super::vals::Lptimsmen(val as u8) 3284 val != 0
3798 } 3285 }
3799 #[doc = "Timer 6 clock enable during sleep mode bit"] 3286 #[doc = "Update DMA request enable"]
3800 pub fn set_tim6smen(&mut self, val: super::vals::Lptimsmen) { 3287 pub fn set_ude(&mut self, val: bool) {
3801 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 3288 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
3802 } 3289 }
3803 #[doc = "Timer 7 clock enable during Sleep mode bit"] 3290 #[doc = "Capture/Compare 1 DMA request enable"]
3804 pub const fn tim7smen(&self) -> super::vals::Lptimsmen { 3291 pub fn ccde(&self, n: usize) -> bool {
3805 let val = (self.0 >> 5usize) & 0x01; 3292 assert!(n < 4usize);
3806 super::vals::Lptimsmen(val as u8) 3293 let offs = 9usize + n * 1usize;
3294 let val = (self.0 >> offs) & 0x01;
3295 val != 0
3807 } 3296 }
3808 #[doc = "Timer 7 clock enable during Sleep mode bit"] 3297 #[doc = "Capture/Compare 1 DMA request enable"]
3809 pub fn set_tim7smen(&mut self, val: super::vals::Lptimsmen) { 3298 pub fn set_ccde(&mut self, n: usize, val: bool) {
3810 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 3299 assert!(n < 4usize);
3300 let offs = 9usize + n * 1usize;
3301 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3811 } 3302 }
3812 #[doc = "Window watchdog clock enable during sleep mode bit"] 3303 #[doc = "COM DMA request enable"]
3813 pub const fn wwdgsmen(&self) -> super::vals::Lptimsmen { 3304 pub const fn comde(&self) -> bool {
3814 let val = (self.0 >> 11usize) & 0x01; 3305 let val = (self.0 >> 13usize) & 0x01;
3815 super::vals::Lptimsmen(val as u8) 3306 val != 0
3816 } 3307 }
3817 #[doc = "Window watchdog clock enable during sleep mode bit"] 3308 #[doc = "COM DMA request enable"]
3818 pub fn set_wwdgsmen(&mut self, val: super::vals::Lptimsmen) { 3309 pub fn set_comde(&mut self, val: bool) {
3819 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 3310 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
3820 } 3311 }
3821 #[doc = "SPI2 clock enable during sleep mode bit"] 3312 #[doc = "Trigger DMA request enable"]
3822 pub const fn spi2smen(&self) -> super::vals::Lptimsmen { 3313 pub const fn tde(&self) -> bool {
3823 let val = (self.0 >> 14usize) & 0x01; 3314 let val = (self.0 >> 14usize) & 0x01;
3824 super::vals::Lptimsmen(val as u8) 3315 val != 0
3825 }
3826 #[doc = "SPI2 clock enable during sleep mode bit"]
3827 pub fn set_spi2smen(&mut self, val: super::vals::Lptimsmen) {
3828 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
3829 }
3830 #[doc = "UART2 clock enable during sleep mode bit"]
3831 pub const fn usart2smen(&self) -> super::vals::Lptimsmen {
3832 let val = (self.0 >> 17usize) & 0x01;
3833 super::vals::Lptimsmen(val as u8)
3834 }
3835 #[doc = "UART2 clock enable during sleep mode bit"]
3836 pub fn set_usart2smen(&mut self, val: super::vals::Lptimsmen) {
3837 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
3838 }
3839 #[doc = "LPUART1 clock enable during sleep mode bit"]
3840 pub const fn lpuart1smen(&self) -> super::vals::Lptimsmen {
3841 let val = (self.0 >> 18usize) & 0x01;
3842 super::vals::Lptimsmen(val as u8)
3843 }
3844 #[doc = "LPUART1 clock enable during sleep mode bit"]
3845 pub fn set_lpuart1smen(&mut self, val: super::vals::Lptimsmen) {
3846 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
3847 }
3848 #[doc = "USART4 clock enable during Sleep mode bit"]
3849 pub const fn usart4smen(&self) -> super::vals::Lptimsmen {
3850 let val = (self.0 >> 19usize) & 0x01;
3851 super::vals::Lptimsmen(val as u8)
3852 }
3853 #[doc = "USART4 clock enable during Sleep mode bit"]
3854 pub fn set_usart4smen(&mut self, val: super::vals::Lptimsmen) {
3855 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
3856 }
3857 #[doc = "USART5 clock enable during Sleep mode bit"]
3858 pub const fn usart5smen(&self) -> super::vals::Lptimsmen {
3859 let val = (self.0 >> 20usize) & 0x01;
3860 super::vals::Lptimsmen(val as u8)
3861 }
3862 #[doc = "USART5 clock enable during Sleep mode bit"]
3863 pub fn set_usart5smen(&mut self, val: super::vals::Lptimsmen) {
3864 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
3865 }
3866 #[doc = "I2C1 clock enable during sleep mode bit"]
3867 pub const fn i2c1smen(&self) -> super::vals::Lptimsmen {
3868 let val = (self.0 >> 21usize) & 0x01;
3869 super::vals::Lptimsmen(val as u8)
3870 }
3871 #[doc = "I2C1 clock enable during sleep mode bit"]
3872 pub fn set_i2c1smen(&mut self, val: super::vals::Lptimsmen) {
3873 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
3874 }
3875 #[doc = "I2C2 clock enable during sleep mode bit"]
3876 pub const fn i2c2smen(&self) -> super::vals::Lptimsmen {
3877 let val = (self.0 >> 22usize) & 0x01;
3878 super::vals::Lptimsmen(val as u8)
3879 }
3880 #[doc = "I2C2 clock enable during sleep mode bit"]
3881 pub fn set_i2c2smen(&mut self, val: super::vals::Lptimsmen) {
3882 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
3883 }
3884 #[doc = "USB clock enable during sleep mode bit"]
3885 pub const fn usbsmen(&self) -> super::vals::Lptimsmen {
3886 let val = (self.0 >> 23usize) & 0x01;
3887 super::vals::Lptimsmen(val as u8)
3888 }
3889 #[doc = "USB clock enable during sleep mode bit"]
3890 pub fn set_usbsmen(&mut self, val: super::vals::Lptimsmen) {
3891 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
3892 }
3893 #[doc = "Clock recovery system clock enable during sleep mode bit"]
3894 pub const fn crssmen(&self) -> super::vals::Lptimsmen {
3895 let val = (self.0 >> 27usize) & 0x01;
3896 super::vals::Lptimsmen(val as u8)
3897 }
3898 #[doc = "Clock recovery system clock enable during sleep mode bit"]
3899 pub fn set_crssmen(&mut self, val: super::vals::Lptimsmen) {
3900 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
3901 }
3902 #[doc = "Power interface clock enable during sleep mode bit"]
3903 pub const fn pwrsmen(&self) -> super::vals::Lptimsmen {
3904 let val = (self.0 >> 28usize) & 0x01;
3905 super::vals::Lptimsmen(val as u8)
3906 }
3907 #[doc = "Power interface clock enable during sleep mode bit"]
3908 pub fn set_pwrsmen(&mut self, val: super::vals::Lptimsmen) {
3909 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
3910 }
3911 #[doc = "DAC interface clock enable during sleep mode bit"]
3912 pub const fn dacsmen(&self) -> super::vals::Lptimsmen {
3913 let val = (self.0 >> 29usize) & 0x01;
3914 super::vals::Lptimsmen(val as u8)
3915 }
3916 #[doc = "DAC interface clock enable during sleep mode bit"]
3917 pub fn set_dacsmen(&mut self, val: super::vals::Lptimsmen) {
3918 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
3919 }
3920 #[doc = "2C3 clock enable during Sleep mode bit"]
3921 pub const fn i2c3smen(&self) -> super::vals::Lptimsmen {
3922 let val = (self.0 >> 30usize) & 0x01;
3923 super::vals::Lptimsmen(val as u8)
3924 }
3925 #[doc = "2C3 clock enable during Sleep mode bit"]
3926 pub fn set_i2c3smen(&mut self, val: super::vals::Lptimsmen) {
3927 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
3928 }
3929 #[doc = "Low power timer clock enable during sleep mode bit"]
3930 pub const fn lptim1smen(&self) -> super::vals::Lptimsmen {
3931 let val = (self.0 >> 31usize) & 0x01;
3932 super::vals::Lptimsmen(val as u8)
3933 } 3316 }
3934 #[doc = "Low power timer clock enable during sleep mode bit"] 3317 #[doc = "Trigger DMA request enable"]
3935 pub fn set_lptim1smen(&mut self, val: super::vals::Lptimsmen) { 3318 pub fn set_tde(&mut self, val: bool) {
3936 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 3319 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
3937 } 3320 }
3938 } 3321 }
3939 impl Default for Apb1smenr { 3322 impl Default for DierAdv {
3940 fn default() -> Apb1smenr { 3323 fn default() -> DierAdv {
3941 Apb1smenr(0) 3324 DierAdv(0)
3942 } 3325 }
3943 } 3326 }
3944 #[doc = "GPIO clock enable register"] 3327 #[doc = "control register 1"]
3945 #[repr(transparent)] 3328 #[repr(transparent)]
3946 #[derive(Copy, Clone, Eq, PartialEq)] 3329 #[derive(Copy, Clone, Eq, PartialEq)]
3947 pub struct Iopenr(pub u32); 3330 pub struct Cr1Gp(pub u32);
3948 impl Iopenr { 3331 impl Cr1Gp {
3949 #[doc = "IO port A clock enable bit"] 3332 #[doc = "Counter enable"]
3950 pub const fn iopaen(&self) -> super::vals::Iophen { 3333 pub const fn cen(&self) -> bool {
3951 let val = (self.0 >> 0usize) & 0x01; 3334 let val = (self.0 >> 0usize) & 0x01;
3952 super::vals::Iophen(val as u8) 3335 val != 0
3953 } 3336 }
3954 #[doc = "IO port A clock enable bit"] 3337 #[doc = "Counter enable"]
3955 pub fn set_iopaen(&mut self, val: super::vals::Iophen) { 3338 pub fn set_cen(&mut self, val: bool) {
3956 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 3339 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3957 } 3340 }
3958 #[doc = "IO port B clock enable bit"] 3341 #[doc = "Update disable"]
3959 pub const fn iopben(&self) -> super::vals::Iophen { 3342 pub const fn udis(&self) -> bool {
3960 let val = (self.0 >> 1usize) & 0x01; 3343 let val = (self.0 >> 1usize) & 0x01;
3961 super::vals::Iophen(val as u8) 3344 val != 0
3962 } 3345 }
3963 #[doc = "IO port B clock enable bit"] 3346 #[doc = "Update disable"]
3964 pub fn set_iopben(&mut self, val: super::vals::Iophen) { 3347 pub fn set_udis(&mut self, val: bool) {
3965 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 3348 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
3966 } 3349 }
3967 #[doc = "IO port A clock enable bit"] 3350 #[doc = "Update request source"]
3968 pub const fn iopcen(&self) -> super::vals::Iophen { 3351 pub const fn urs(&self) -> super::vals::Urs {
3969 let val = (self.0 >> 2usize) & 0x01; 3352 let val = (self.0 >> 2usize) & 0x01;
3970 super::vals::Iophen(val as u8) 3353 super::vals::Urs(val as u8)
3971 } 3354 }
3972 #[doc = "IO port A clock enable bit"] 3355 #[doc = "Update request source"]
3973 pub fn set_iopcen(&mut self, val: super::vals::Iophen) { 3356 pub fn set_urs(&mut self, val: super::vals::Urs) {
3974 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 3357 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
3975 } 3358 }
3976 #[doc = "I/O port D clock enable bit"] 3359 #[doc = "One-pulse mode"]
3977 pub const fn iopden(&self) -> super::vals::Iophen { 3360 pub const fn opm(&self) -> super::vals::Opm {
3978 let val = (self.0 >> 3usize) & 0x01; 3361 let val = (self.0 >> 3usize) & 0x01;
3979 super::vals::Iophen(val as u8) 3362 super::vals::Opm(val as u8)
3980 } 3363 }
3981 #[doc = "I/O port D clock enable bit"] 3364 #[doc = "One-pulse mode"]
3982 pub fn set_iopden(&mut self, val: super::vals::Iophen) { 3365 pub fn set_opm(&mut self, val: super::vals::Opm) {
3983 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 3366 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
3984 } 3367 }
3985 #[doc = "I/O port E clock enable bit"] 3368 #[doc = "Direction"]
3986 pub const fn iopeen(&self) -> super::vals::Iophen { 3369 pub const fn dir(&self) -> super::vals::Dir {
3987 let val = (self.0 >> 4usize) & 0x01; 3370 let val = (self.0 >> 4usize) & 0x01;
3988 super::vals::Iophen(val as u8) 3371 super::vals::Dir(val as u8)
3989 } 3372 }
3990 #[doc = "I/O port E clock enable bit"] 3373 #[doc = "Direction"]
3991 pub fn set_iopeen(&mut self, val: super::vals::Iophen) { 3374 pub fn set_dir(&mut self, val: super::vals::Dir) {
3992 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 3375 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
3993 } 3376 }
3994 #[doc = "I/O port H clock enable bit"] 3377 #[doc = "Center-aligned mode selection"]
3995 pub const fn iophen(&self) -> super::vals::Iophen { 3378 pub const fn cms(&self) -> super::vals::Cms {
3379 let val = (self.0 >> 5usize) & 0x03;
3380 super::vals::Cms(val as u8)
3381 }
3382 #[doc = "Center-aligned mode selection"]
3383 pub fn set_cms(&mut self, val: super::vals::Cms) {
3384 self.0 = (self.0 & !(0x03 << 5usize)) | (((val.0 as u32) & 0x03) << 5usize);
3385 }
3386 #[doc = "Auto-reload preload enable"]
3387 pub const fn arpe(&self) -> super::vals::Arpe {
3996 let val = (self.0 >> 7usize) & 0x01; 3388 let val = (self.0 >> 7usize) & 0x01;
3997 super::vals::Iophen(val as u8) 3389 super::vals::Arpe(val as u8)
3998 } 3390 }
3999 #[doc = "I/O port H clock enable bit"] 3391 #[doc = "Auto-reload preload enable"]
4000 pub fn set_iophen(&mut self, val: super::vals::Iophen) { 3392 pub fn set_arpe(&mut self, val: super::vals::Arpe) {
4001 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 3393 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4002 } 3394 }
3395 #[doc = "Clock division"]
3396 pub const fn ckd(&self) -> super::vals::Ckd {
3397 let val = (self.0 >> 8usize) & 0x03;
3398 super::vals::Ckd(val as u8)
3399 }
3400 #[doc = "Clock division"]
3401 pub fn set_ckd(&mut self, val: super::vals::Ckd) {
3402 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
3403 }
4003 } 3404 }
4004 impl Default for Iopenr { 3405 impl Default for Cr1Gp {
4005 fn default() -> Iopenr { 3406 fn default() -> Cr1Gp {
4006 Iopenr(0) 3407 Cr1Gp(0)
4007 } 3408 }
4008 } 3409 }
4009 #[doc = "Clock configuration register"] 3410 #[doc = "DMA address for full transfer"]
4010 #[repr(transparent)] 3411 #[repr(transparent)]
4011 #[derive(Copy, Clone, Eq, PartialEq)] 3412 #[derive(Copy, Clone, Eq, PartialEq)]
4012 pub struct Ccipr(pub u32); 3413 pub struct Dmar(pub u32);
4013 impl Ccipr { 3414 impl Dmar {
4014 #[doc = "USART1 clock source selection bits"] 3415 #[doc = "DMA register for burst accesses"]
4015 pub const fn usart1sel(&self) -> super::vals::Lpuartsel { 3416 pub const fn dmab(&self) -> u16 {
4016 let val = (self.0 >> 0usize) & 0x03; 3417 let val = (self.0 >> 0usize) & 0xffff;
4017 super::vals::Lpuartsel(val as u8) 3418 val as u16
4018 }
4019 #[doc = "USART1 clock source selection bits"]
4020 pub fn set_usart1sel(&mut self, val: super::vals::Lpuartsel) {
4021 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
4022 }
4023 #[doc = "USART2 clock source selection bits"]
4024 pub const fn usart2sel(&self) -> super::vals::Lpuartsel {
4025 let val = (self.0 >> 2usize) & 0x03;
4026 super::vals::Lpuartsel(val as u8)
4027 }
4028 #[doc = "USART2 clock source selection bits"]
4029 pub fn set_usart2sel(&mut self, val: super::vals::Lpuartsel) {
4030 self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize);
4031 }
4032 #[doc = "LPUART1 clock source selection bits"]
4033 pub const fn lpuart1sel(&self) -> super::vals::Lpuartsel {
4034 let val = (self.0 >> 10usize) & 0x03;
4035 super::vals::Lpuartsel(val as u8)
4036 }
4037 #[doc = "LPUART1 clock source selection bits"]
4038 pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuartsel) {
4039 self.0 = (self.0 & !(0x03 << 10usize)) | (((val.0 as u32) & 0x03) << 10usize);
4040 }
4041 #[doc = "I2C1 clock source selection bits"]
4042 pub const fn i2c1sel(&self) -> super::vals::Icsel {
4043 let val = (self.0 >> 12usize) & 0x03;
4044 super::vals::Icsel(val as u8)
4045 }
4046 #[doc = "I2C1 clock source selection bits"]
4047 pub fn set_i2c1sel(&mut self, val: super::vals::Icsel) {
4048 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
4049 }
4050 #[doc = "I2C3 clock source selection bits"]
4051 pub const fn i2c3sel(&self) -> super::vals::Icsel {
4052 let val = (self.0 >> 16usize) & 0x03;
4053 super::vals::Icsel(val as u8)
4054 }
4055 #[doc = "I2C3 clock source selection bits"]
4056 pub fn set_i2c3sel(&mut self, val: super::vals::Icsel) {
4057 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
4058 }
4059 #[doc = "Low Power Timer clock source selection bits"]
4060 pub const fn lptim1sel(&self) -> super::vals::Lptimsel {
4061 let val = (self.0 >> 18usize) & 0x03;
4062 super::vals::Lptimsel(val as u8)
4063 }
4064 #[doc = "Low Power Timer clock source selection bits"]
4065 pub fn set_lptim1sel(&mut self, val: super::vals::Lptimsel) {
4066 self.0 = (self.0 & !(0x03 << 18usize)) | (((val.0 as u32) & 0x03) << 18usize);
4067 }
4068 #[doc = "48 MHz HSI48 clock source selection bit"]
4069 pub const fn hsi48msel(&self) -> bool {
4070 let val = (self.0 >> 26usize) & 0x01;
4071 val != 0
4072 } 3419 }
4073 #[doc = "48 MHz HSI48 clock source selection bit"] 3420 #[doc = "DMA register for burst accesses"]
4074 pub fn set_hsi48msel(&mut self, val: bool) { 3421 pub fn set_dmab(&mut self, val: u16) {
4075 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); 3422 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
4076 } 3423 }
4077 } 3424 }
4078 impl Default for Ccipr { 3425 impl Default for Dmar {
4079 fn default() -> Ccipr { 3426 fn default() -> Dmar {
4080 Ccipr(0) 3427 Dmar(0)
4081 } 3428 }
4082 } 3429 }
4083 #[doc = "AHB peripheral clock enable in sleep mode register"] 3430 #[doc = "status register"]
4084 #[repr(transparent)] 3431 #[repr(transparent)]
4085 #[derive(Copy, Clone, Eq, PartialEq)] 3432 #[derive(Copy, Clone, Eq, PartialEq)]
4086 pub struct Ahbsmenr(pub u32); 3433 pub struct SrBasic(pub u32);
4087 impl Ahbsmenr { 3434 impl SrBasic {
4088 #[doc = "DMA clock enable during sleep mode bit"] 3435 #[doc = "Update interrupt flag"]
4089 pub const fn dmasmen(&self) -> super::vals::Dmasmen { 3436 pub const fn uif(&self) -> bool {
4090 let val = (self.0 >> 0usize) & 0x01; 3437 let val = (self.0 >> 0usize) & 0x01;
4091 super::vals::Dmasmen(val as u8)
4092 }
4093 #[doc = "DMA clock enable during sleep mode bit"]
4094 pub fn set_dmasmen(&mut self, val: super::vals::Dmasmen) {
4095 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
4096 }
4097 #[doc = "NVM interface clock enable during sleep mode bit"]
4098 pub const fn mifsmen(&self) -> super::vals::Mifsmen {
4099 let val = (self.0 >> 8usize) & 0x01;
4100 super::vals::Mifsmen(val as u8)
4101 }
4102 #[doc = "NVM interface clock enable during sleep mode bit"]
4103 pub fn set_mifsmen(&mut self, val: super::vals::Mifsmen) {
4104 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
4105 }
4106 #[doc = "SRAM interface clock enable during sleep mode bit"]
4107 pub const fn sramsmen(&self) -> super::vals::Sramsmen {
4108 let val = (self.0 >> 9usize) & 0x01;
4109 super::vals::Sramsmen(val as u8)
4110 }
4111 #[doc = "SRAM interface clock enable during sleep mode bit"]
4112 pub fn set_sramsmen(&mut self, val: super::vals::Sramsmen) {
4113 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
4114 }
4115 #[doc = "CRC clock enable during sleep mode bit"]
4116 pub const fn crcsmen(&self) -> super::vals::Crcsmen {
4117 let val = (self.0 >> 12usize) & 0x01;
4118 super::vals::Crcsmen(val as u8)
4119 }
4120 #[doc = "CRC clock enable during sleep mode bit"]
4121 pub fn set_crcsmen(&mut self, val: super::vals::Crcsmen) {
4122 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
4123 }
4124 #[doc = "Touch Sensing clock enable during sleep mode bit"]
4125 pub const fn touchsmen(&self) -> bool {
4126 let val = (self.0 >> 16usize) & 0x01;
4127 val != 0
4128 }
4129 #[doc = "Touch Sensing clock enable during sleep mode bit"]
4130 pub fn set_touchsmen(&mut self, val: bool) {
4131 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
4132 }
4133 #[doc = "Random Number Generator clock enable during sleep mode bit"]
4134 pub const fn rngsmen(&self) -> bool {
4135 let val = (self.0 >> 20usize) & 0x01;
4136 val != 0 3438 val != 0
4137 } 3439 }
4138 #[doc = "Random Number Generator clock enable during sleep mode bit"] 3440 #[doc = "Update interrupt flag"]
4139 pub fn set_rngsmen(&mut self, val: bool) { 3441 pub fn set_uif(&mut self, val: bool) {
4140 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); 3442 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4141 }
4142 #[doc = "Crypto clock enable during sleep mode bit"]
4143 pub const fn crypsmen(&self) -> super::vals::Crypsmen {
4144 let val = (self.0 >> 24usize) & 0x01;
4145 super::vals::Crypsmen(val as u8)
4146 }
4147 #[doc = "Crypto clock enable during sleep mode bit"]
4148 pub fn set_crypsmen(&mut self, val: super::vals::Crypsmen) {
4149 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
4150 } 3443 }
4151 } 3444 }
4152 impl Default for Ahbsmenr { 3445 impl Default for SrBasic {
4153 fn default() -> Ahbsmenr { 3446 fn default() -> SrBasic {
4154 Ahbsmenr(0) 3447 SrBasic(0)
4155 } 3448 }
4156 } 3449 }
4157 #[doc = "Control and status register"] 3450 #[doc = "capture/compare register 1"]
4158 #[repr(transparent)] 3451 #[repr(transparent)]
4159 #[derive(Copy, Clone, Eq, PartialEq)] 3452 #[derive(Copy, Clone, Eq, PartialEq)]
4160 pub struct Csr(pub u32); 3453 pub struct Ccr16(pub u32);
4161 impl Csr { 3454 impl Ccr16 {
4162 #[doc = "Internal low-speed oscillator enable"] 3455 #[doc = "Capture/Compare 1 value"]
4163 pub const fn lsion(&self) -> super::vals::Csslseon { 3456 pub const fn ccr(&self) -> u16 {
4164 let val = (self.0 >> 0usize) & 0x01; 3457 let val = (self.0 >> 0usize) & 0xffff;
4165 super::vals::Csslseon(val as u8) 3458 val as u16
4166 }
4167 #[doc = "Internal low-speed oscillator enable"]
4168 pub fn set_lsion(&mut self, val: super::vals::Csslseon) {
4169 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
4170 } 3459 }
4171 #[doc = "Internal low-speed oscillator ready bit"] 3460 #[doc = "Capture/Compare 1 value"]
4172 pub const fn lsirdy(&self) -> super::vals::Lserdy { 3461 pub fn set_ccr(&mut self, val: u16) {
4173 let val = (self.0 >> 1usize) & 0x01; 3462 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
4174 super::vals::Lserdy(val as u8)
4175 } 3463 }
4176 #[doc = "Internal low-speed oscillator ready bit"] 3464 }
4177 pub fn set_lsirdy(&mut self, val: super::vals::Lserdy) { 3465 impl Default for Ccr16 {
4178 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 3466 fn default() -> Ccr16 {
3467 Ccr16(0)
4179 } 3468 }
4180 #[doc = "External low-speed oscillator enable bit"] 3469 }
4181 pub const fn lseon(&self) -> super::vals::Csslseon { 3470 #[doc = "break and dead-time register"]
4182 let val = (self.0 >> 8usize) & 0x01; 3471 #[repr(transparent)]
4183 super::vals::Csslseon(val as u8) 3472 #[derive(Copy, Clone, Eq, PartialEq)]
3473 pub struct Bdtr(pub u32);
3474 impl Bdtr {
3475 #[doc = "Dead-time generator setup"]
3476 pub const fn dtg(&self) -> u8 {
3477 let val = (self.0 >> 0usize) & 0xff;
3478 val as u8
4184 } 3479 }
4185 #[doc = "External low-speed oscillator enable bit"] 3480 #[doc = "Dead-time generator setup"]
4186 pub fn set_lseon(&mut self, val: super::vals::Csslseon) { 3481 pub fn set_dtg(&mut self, val: u8) {
4187 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 3482 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
4188 } 3483 }
4189 #[doc = "External low-speed oscillator ready bit"] 3484 #[doc = "Lock configuration"]
4190 pub const fn lserdy(&self) -> super::vals::Lserdy { 3485 pub const fn lock(&self) -> u8 {
4191 let val = (self.0 >> 9usize) & 0x01; 3486 let val = (self.0 >> 8usize) & 0x03;
4192 super::vals::Lserdy(val as u8) 3487 val as u8
4193 } 3488 }
4194 #[doc = "External low-speed oscillator ready bit"] 3489 #[doc = "Lock configuration"]
4195 pub fn set_lserdy(&mut self, val: super::vals::Lserdy) { 3490 pub fn set_lock(&mut self, val: u8) {
4196 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 3491 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
4197 } 3492 }
4198 #[doc = "External low-speed oscillator bypass bit"] 3493 #[doc = "Off-state selection for Idle mode"]
4199 pub const fn lsebyp(&self) -> super::vals::Lsebyp { 3494 pub const fn ossi(&self) -> super::vals::Ossi {
4200 let val = (self.0 >> 10usize) & 0x01; 3495 let val = (self.0 >> 10usize) & 0x01;
4201 super::vals::Lsebyp(val as u8) 3496 super::vals::Ossi(val as u8)
4202 } 3497 }
4203 #[doc = "External low-speed oscillator bypass bit"] 3498 #[doc = "Off-state selection for Idle mode"]
4204 pub fn set_lsebyp(&mut self, val: super::vals::Lsebyp) { 3499 pub fn set_ossi(&mut self, val: super::vals::Ossi) {
4205 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 3500 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
4206 } 3501 }
4207 #[doc = "LSEDRV"] 3502 #[doc = "Off-state selection for Run mode"]
4208 pub const fn lsedrv(&self) -> super::vals::Lsedrv { 3503 pub const fn ossr(&self) -> super::vals::Ossr {
4209 let val = (self.0 >> 11usize) & 0x03; 3504 let val = (self.0 >> 11usize) & 0x01;
4210 super::vals::Lsedrv(val as u8) 3505 super::vals::Ossr(val as u8)
4211 }
4212 #[doc = "LSEDRV"]
4213 pub fn set_lsedrv(&mut self, val: super::vals::Lsedrv) {
4214 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize);
4215 }
4216 #[doc = "CSSLSEON"]
4217 pub const fn csslseon(&self) -> super::vals::Csslseon {
4218 let val = (self.0 >> 13usize) & 0x01;
4219 super::vals::Csslseon(val as u8)
4220 }
4221 #[doc = "CSSLSEON"]
4222 pub fn set_csslseon(&mut self, val: super::vals::Csslseon) {
4223 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
4224 }
4225 #[doc = "CSS on LSE failure detection flag"]
4226 pub const fn csslsed(&self) -> super::vals::Csslsed {
4227 let val = (self.0 >> 14usize) & 0x01;
4228 super::vals::Csslsed(val as u8)
4229 }
4230 #[doc = "CSS on LSE failure detection flag"]
4231 pub fn set_csslsed(&mut self, val: super::vals::Csslsed) {
4232 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
4233 }
4234 #[doc = "RTC and LCD clock source selection bits"]
4235 pub const fn rtcsel(&self) -> super::vals::Rtcsel {
4236 let val = (self.0 >> 16usize) & 0x03;
4237 super::vals::Rtcsel(val as u8)
4238 }
4239 #[doc = "RTC and LCD clock source selection bits"]
4240 pub fn set_rtcsel(&mut self, val: super::vals::Rtcsel) {
4241 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
4242 }
4243 #[doc = "RTC clock enable bit"]
4244 pub const fn rtcen(&self) -> super::vals::Rtcen {
4245 let val = (self.0 >> 18usize) & 0x01;
4246 super::vals::Rtcen(val as u8)
4247 }
4248 #[doc = "RTC clock enable bit"]
4249 pub fn set_rtcen(&mut self, val: super::vals::Rtcen) {
4250 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
4251 }
4252 #[doc = "RTC software reset bit"]
4253 pub const fn rtcrst(&self) -> bool {
4254 let val = (self.0 >> 19usize) & 0x01;
4255 val != 0
4256 }
4257 #[doc = "RTC software reset bit"]
4258 pub fn set_rtcrst(&mut self, val: bool) {
4259 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
4260 }
4261 #[doc = "Remove reset flag"]
4262 pub const fn rmvf(&self) -> bool {
4263 let val = (self.0 >> 24usize) & 0x01;
4264 val != 0
4265 }
4266 #[doc = "Remove reset flag"]
4267 pub fn set_rmvf(&mut self, val: bool) {
4268 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
4269 }
4270 #[doc = "OBLRSTF"]
4271 pub const fn oblrstf(&self) -> bool {
4272 let val = (self.0 >> 25usize) & 0x01;
4273 val != 0
4274 }
4275 #[doc = "OBLRSTF"]
4276 pub fn set_oblrstf(&mut self, val: bool) {
4277 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
4278 }
4279 #[doc = "PIN reset flag"]
4280 pub const fn pinrstf(&self) -> bool {
4281 let val = (self.0 >> 26usize) & 0x01;
4282 val != 0
4283 }
4284 #[doc = "PIN reset flag"]
4285 pub fn set_pinrstf(&mut self, val: bool) {
4286 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
4287 }
4288 #[doc = "POR/PDR reset flag"]
4289 pub const fn porrstf(&self) -> bool {
4290 let val = (self.0 >> 27usize) & 0x01;
4291 val != 0
4292 } 3506 }
4293 #[doc = "POR/PDR reset flag"] 3507 #[doc = "Off-state selection for Run mode"]
4294 pub fn set_porrstf(&mut self, val: bool) { 3508 pub fn set_ossr(&mut self, val: super::vals::Ossr) {
4295 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); 3509 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
4296 } 3510 }
4297 #[doc = "Software reset flag"] 3511 #[doc = "Break enable"]
4298 pub const fn sftrstf(&self) -> bool { 3512 pub const fn bke(&self) -> bool {
4299 let val = (self.0 >> 28usize) & 0x01; 3513 let val = (self.0 >> 12usize) & 0x01;
4300 val != 0 3514 val != 0
4301 } 3515 }
4302 #[doc = "Software reset flag"] 3516 #[doc = "Break enable"]
4303 pub fn set_sftrstf(&mut self, val: bool) { 3517 pub fn set_bke(&mut self, val: bool) {
4304 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); 3518 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
4305 } 3519 }
4306 #[doc = "Independent watchdog reset flag"] 3520 #[doc = "Break polarity"]
4307 pub const fn iwdgrstf(&self) -> bool { 3521 pub const fn bkp(&self) -> bool {
4308 let val = (self.0 >> 29usize) & 0x01; 3522 let val = (self.0 >> 13usize) & 0x01;
4309 val != 0 3523 val != 0
4310 } 3524 }
4311 #[doc = "Independent watchdog reset flag"] 3525 #[doc = "Break polarity"]
4312 pub fn set_iwdgrstf(&mut self, val: bool) { 3526 pub fn set_bkp(&mut self, val: bool) {
4313 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); 3527 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
4314 } 3528 }
4315 #[doc = "Window watchdog reset flag"] 3529 #[doc = "Automatic output enable"]
4316 pub const fn wwdgrstf(&self) -> bool { 3530 pub const fn aoe(&self) -> bool {
4317 let val = (self.0 >> 30usize) & 0x01; 3531 let val = (self.0 >> 14usize) & 0x01;
4318 val != 0 3532 val != 0
4319 } 3533 }
4320 #[doc = "Window watchdog reset flag"] 3534 #[doc = "Automatic output enable"]
4321 pub fn set_wwdgrstf(&mut self, val: bool) { 3535 pub fn set_aoe(&mut self, val: bool) {
4322 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); 3536 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
4323 } 3537 }
4324 #[doc = "Low-power reset flag"] 3538 #[doc = "Main output enable"]
4325 pub const fn lpwrrstf(&self) -> bool { 3539 pub const fn moe(&self) -> bool {
4326 let val = (self.0 >> 31usize) & 0x01; 3540 let val = (self.0 >> 15usize) & 0x01;
4327 val != 0 3541 val != 0
4328 } 3542 }
4329 #[doc = "Low-power reset flag"] 3543 #[doc = "Main output enable"]
4330 pub fn set_lpwrrstf(&mut self, val: bool) { 3544 pub fn set_moe(&mut self, val: bool) {
4331 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); 3545 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
4332 } 3546 }
4333 } 3547 }
4334 impl Default for Csr { 3548 impl Default for Bdtr {
4335 fn default() -> Csr { 3549 fn default() -> Bdtr {
4336 Csr(0) 3550 Bdtr(0)
4337 } 3551 }
4338 } 3552 }
4339 #[doc = "APB1 peripheral reset register"] 3553 #[doc = "auto-reload register"]
4340 #[repr(transparent)] 3554 #[repr(transparent)]
4341 #[derive(Copy, Clone, Eq, PartialEq)] 3555 #[derive(Copy, Clone, Eq, PartialEq)]
4342 pub struct Apb1rstr(pub u32); 3556 pub struct Arr16(pub u32);
4343 impl Apb1rstr { 3557 impl Arr16 {
4344 #[doc = "Timer2 reset"] 3558 #[doc = "Auto-reload value"]
4345 pub const fn tim2rst(&self) -> bool { 3559 pub const fn arr(&self) -> u16 {
4346 let val = (self.0 >> 0usize) & 0x01; 3560 let val = (self.0 >> 0usize) & 0xffff;
4347 val != 0 3561 val as u16
4348 }
4349 #[doc = "Timer2 reset"]
4350 pub fn set_tim2rst(&mut self, val: bool) {
4351 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4352 }
4353 #[doc = "Timer3 reset"]
4354 pub const fn tim3rst(&self) -> bool {
4355 let val = (self.0 >> 1usize) & 0x01;
4356 val != 0
4357 }
4358 #[doc = "Timer3 reset"]
4359 pub fn set_tim3rst(&mut self, val: bool) {
4360 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
4361 }
4362 #[doc = "Timer 6 reset"]
4363 pub const fn tim6rst(&self) -> bool {
4364 let val = (self.0 >> 4usize) & 0x01;
4365 val != 0
4366 }
4367 #[doc = "Timer 6 reset"]
4368 pub fn set_tim6rst(&mut self, val: bool) {
4369 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
4370 }
4371 #[doc = "Timer 7 reset"]
4372 pub const fn tim7rst(&self) -> bool {
4373 let val = (self.0 >> 5usize) & 0x01;
4374 val != 0
4375 }
4376 #[doc = "Timer 7 reset"]
4377 pub fn set_tim7rst(&mut self, val: bool) {
4378 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
4379 }
4380 #[doc = "Window watchdog reset"]
4381 pub const fn wwdrst(&self) -> bool {
4382 let val = (self.0 >> 11usize) & 0x01;
4383 val != 0
4384 }
4385 #[doc = "Window watchdog reset"]
4386 pub fn set_wwdrst(&mut self, val: bool) {
4387 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
4388 } 3562 }
4389 #[doc = "SPI2 reset"] 3563 #[doc = "Auto-reload value"]
4390 pub const fn spi2rst(&self) -> bool { 3564 pub fn set_arr(&mut self, val: u16) {
4391 let val = (self.0 >> 14usize) & 0x01; 3565 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
4392 val != 0
4393 } 3566 }
4394 #[doc = "SPI2 reset"] 3567 }
4395 pub fn set_spi2rst(&mut self, val: bool) { 3568 impl Default for Arr16 {
4396 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 3569 fn default() -> Arr16 {
3570 Arr16(0)
4397 } 3571 }
4398 #[doc = "UART2 reset"] 3572 }
4399 pub const fn lpuart12rst(&self) -> bool { 3573 #[doc = "control register 2"]
4400 let val = (self.0 >> 17usize) & 0x01; 3574 #[repr(transparent)]
4401 val != 0 3575 #[derive(Copy, Clone, Eq, PartialEq)]
3576 pub struct Cr2Gp(pub u32);
3577 impl Cr2Gp {
3578 #[doc = "Capture/compare DMA selection"]
3579 pub const fn ccds(&self) -> super::vals::Ccds {
3580 let val = (self.0 >> 3usize) & 0x01;
3581 super::vals::Ccds(val as u8)
4402 } 3582 }
4403 #[doc = "UART2 reset"] 3583 #[doc = "Capture/compare DMA selection"]
4404 pub fn set_lpuart12rst(&mut self, val: bool) { 3584 pub fn set_ccds(&mut self, val: super::vals::Ccds) {
4405 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 3585 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
4406 } 3586 }
4407 #[doc = "LPUART1 reset"] 3587 #[doc = "Master mode selection"]
4408 pub const fn lpuart1rst(&self) -> bool { 3588 pub const fn mms(&self) -> super::vals::Mms {
4409 let val = (self.0 >> 18usize) & 0x01; 3589 let val = (self.0 >> 4usize) & 0x07;
4410 val != 0 3590 super::vals::Mms(val as u8)
4411 } 3591 }
4412 #[doc = "LPUART1 reset"] 3592 #[doc = "Master mode selection"]
4413 pub fn set_lpuart1rst(&mut self, val: bool) { 3593 pub fn set_mms(&mut self, val: super::vals::Mms) {
4414 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 3594 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
4415 } 3595 }
4416 #[doc = "USART4 reset"] 3596 #[doc = "TI1 selection"]
4417 pub const fn usart4rst(&self) -> bool { 3597 pub const fn ti1s(&self) -> super::vals::Tis {
4418 let val = (self.0 >> 19usize) & 0x01; 3598 let val = (self.0 >> 7usize) & 0x01;
4419 val != 0 3599 super::vals::Tis(val as u8)
4420 } 3600 }
4421 #[doc = "USART4 reset"] 3601 #[doc = "TI1 selection"]
4422 pub fn set_usart4rst(&mut self, val: bool) { 3602 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
4423 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); 3603 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4424 } 3604 }
4425 #[doc = "USART5 reset"] 3605 }
4426 pub const fn usart5rst(&self) -> bool { 3606 impl Default for Cr2Gp {
4427 let val = (self.0 >> 20usize) & 0x01; 3607 fn default() -> Cr2Gp {
4428 val != 0 3608 Cr2Gp(0)
4429 } 3609 }
4430 #[doc = "USART5 reset"] 3610 }
4431 pub fn set_usart5rst(&mut self, val: bool) { 3611 #[doc = "repetition counter register"]
4432 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); 3612 #[repr(transparent)]
3613 #[derive(Copy, Clone, Eq, PartialEq)]
3614 pub struct Rcr(pub u32);
3615 impl Rcr {
3616 #[doc = "Repetition counter value"]
3617 pub const fn rep(&self) -> u8 {
3618 let val = (self.0 >> 0usize) & 0xff;
3619 val as u8
4433 } 3620 }
4434 #[doc = "I2C1 reset"] 3621 #[doc = "Repetition counter value"]
4435 pub const fn i2c1rst(&self) -> bool { 3622 pub fn set_rep(&mut self, val: u8) {
4436 let val = (self.0 >> 21usize) & 0x01; 3623 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
4437 val != 0
4438 } 3624 }
4439 #[doc = "I2C1 reset"] 3625 }
4440 pub fn set_i2c1rst(&mut self, val: bool) { 3626 impl Default for Rcr {
4441 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); 3627 fn default() -> Rcr {
3628 Rcr(0)
4442 } 3629 }
4443 #[doc = "I2C2 reset"] 3630 }
4444 pub const fn i2c2rst(&self) -> bool { 3631 #[doc = "slave mode control register"]
4445 let val = (self.0 >> 22usize) & 0x01; 3632 #[repr(transparent)]
4446 val != 0 3633 #[derive(Copy, Clone, Eq, PartialEq)]
3634 pub struct Smcr(pub u32);
3635 impl Smcr {
3636 #[doc = "Slave mode selection"]
3637 pub const fn sms(&self) -> super::vals::Sms {
3638 let val = (self.0 >> 0usize) & 0x07;
3639 super::vals::Sms(val as u8)
4447 } 3640 }
4448 #[doc = "I2C2 reset"] 3641 #[doc = "Slave mode selection"]
4449 pub fn set_i2c2rst(&mut self, val: bool) { 3642 pub fn set_sms(&mut self, val: super::vals::Sms) {
4450 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 3643 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
4451 } 3644 }
4452 #[doc = "USB reset"] 3645 #[doc = "Trigger selection"]
4453 pub const fn usbrst(&self) -> bool { 3646 pub const fn ts(&self) -> super::vals::Ts {
4454 let val = (self.0 >> 23usize) & 0x01; 3647 let val = (self.0 >> 4usize) & 0x07;
4455 val != 0 3648 super::vals::Ts(val as u8)
4456 } 3649 }
4457 #[doc = "USB reset"] 3650 #[doc = "Trigger selection"]
4458 pub fn set_usbrst(&mut self, val: bool) { 3651 pub fn set_ts(&mut self, val: super::vals::Ts) {
4459 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); 3652 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
4460 } 3653 }
4461 #[doc = "Clock recovery system reset"] 3654 #[doc = "Master/Slave mode"]
4462 pub const fn crsrst(&self) -> bool { 3655 pub const fn msm(&self) -> super::vals::Msm {
4463 let val = (self.0 >> 27usize) & 0x01; 3656 let val = (self.0 >> 7usize) & 0x01;
4464 val != 0 3657 super::vals::Msm(val as u8)
4465 } 3658 }
4466 #[doc = "Clock recovery system reset"] 3659 #[doc = "Master/Slave mode"]
4467 pub fn set_crsrst(&mut self, val: bool) { 3660 pub fn set_msm(&mut self, val: super::vals::Msm) {
4468 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); 3661 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4469 } 3662 }
4470 #[doc = "Power interface reset"] 3663 #[doc = "External trigger filter"]
4471 pub const fn pwrrst(&self) -> bool { 3664 pub const fn etf(&self) -> super::vals::Etf {
4472 let val = (self.0 >> 28usize) & 0x01; 3665 let val = (self.0 >> 8usize) & 0x0f;
4473 val != 0 3666 super::vals::Etf(val as u8)
4474 } 3667 }
4475 #[doc = "Power interface reset"] 3668 #[doc = "External trigger filter"]
4476 pub fn set_pwrrst(&mut self, val: bool) { 3669 pub fn set_etf(&mut self, val: super::vals::Etf) {
4477 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); 3670 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
4478 } 3671 }
4479 #[doc = "DAC interface reset"] 3672 #[doc = "External trigger prescaler"]
4480 pub const fn dacrst(&self) -> bool { 3673 pub const fn etps(&self) -> super::vals::Etps {
4481 let val = (self.0 >> 29usize) & 0x01; 3674 let val = (self.0 >> 12usize) & 0x03;
4482 val != 0 3675 super::vals::Etps(val as u8)
4483 } 3676 }
4484 #[doc = "DAC interface reset"] 3677 #[doc = "External trigger prescaler"]
4485 pub fn set_dacrst(&mut self, val: bool) { 3678 pub fn set_etps(&mut self, val: super::vals::Etps) {
4486 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); 3679 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
4487 } 3680 }
4488 #[doc = "I2C3 reset"] 3681 #[doc = "External clock enable"]
4489 pub const fn i2c3rst(&self) -> bool { 3682 pub const fn ece(&self) -> super::vals::Ece {
4490 let val = (self.0 >> 30usize) & 0x01; 3683 let val = (self.0 >> 14usize) & 0x01;
4491 val != 0 3684 super::vals::Ece(val as u8)
4492 } 3685 }
4493 #[doc = "I2C3 reset"] 3686 #[doc = "External clock enable"]
4494 pub fn set_i2c3rst(&mut self, val: bool) { 3687 pub fn set_ece(&mut self, val: super::vals::Ece) {
4495 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); 3688 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
4496 } 3689 }
4497 #[doc = "Low power timer reset"] 3690 #[doc = "External trigger polarity"]
4498 pub const fn lptim1rst(&self) -> bool { 3691 pub const fn etp(&self) -> super::vals::Etp {
4499 let val = (self.0 >> 31usize) & 0x01; 3692 let val = (self.0 >> 15usize) & 0x01;
4500 val != 0 3693 super::vals::Etp(val as u8)
4501 } 3694 }
4502 #[doc = "Low power timer reset"] 3695 #[doc = "External trigger polarity"]
4503 pub fn set_lptim1rst(&mut self, val: bool) { 3696 pub fn set_etp(&mut self, val: super::vals::Etp) {
4504 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); 3697 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
4505 } 3698 }
4506 } 3699 }
4507 impl Default for Apb1rstr { 3700 impl Default for Smcr {
4508 fn default() -> Apb1rstr { 3701 fn default() -> Smcr {
4509 Apb1rstr(0) 3702 Smcr(0)
4510 } 3703 }
4511 } 3704 }
4512 #[doc = "GPIO clock enable in sleep mode register"] 3705 #[doc = "capture/compare enable register"]
4513 #[repr(transparent)] 3706 #[repr(transparent)]
4514 #[derive(Copy, Clone, Eq, PartialEq)] 3707 #[derive(Copy, Clone, Eq, PartialEq)]
4515 pub struct Iopsmen(pub u32); 3708 pub struct CcerGp(pub u32);
4516 impl Iopsmen { 3709 impl CcerGp {
4517 #[doc = "IOPASMEN"] 3710 #[doc = "Capture/Compare 1 output enable"]
4518 pub const fn iopasmen(&self) -> super::vals::Iophsmen { 3711 pub fn cce(&self, n: usize) -> bool {
4519 let val = (self.0 >> 0usize) & 0x01; 3712 assert!(n < 4usize);
4520 super::vals::Iophsmen(val as u8) 3713 let offs = 0usize + n * 4usize;
4521 } 3714 let val = (self.0 >> offs) & 0x01;
4522 #[doc = "IOPASMEN"] 3715 val != 0
4523 pub fn set_iopasmen(&mut self, val: super::vals::Iophsmen) {
4524 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
4525 }
4526 #[doc = "IOPBSMEN"]
4527 pub const fn iopbsmen(&self) -> super::vals::Iophsmen {
4528 let val = (self.0 >> 1usize) & 0x01;
4529 super::vals::Iophsmen(val as u8)
4530 }
4531 #[doc = "IOPBSMEN"]
4532 pub fn set_iopbsmen(&mut self, val: super::vals::Iophsmen) {
4533 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
4534 }
4535 #[doc = "IOPCSMEN"]
4536 pub const fn iopcsmen(&self) -> super::vals::Iophsmen {
4537 let val = (self.0 >> 2usize) & 0x01;
4538 super::vals::Iophsmen(val as u8)
4539 }
4540 #[doc = "IOPCSMEN"]
4541 pub fn set_iopcsmen(&mut self, val: super::vals::Iophsmen) {
4542 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
4543 }
4544 #[doc = "IOPDSMEN"]
4545 pub const fn iopdsmen(&self) -> super::vals::Iophsmen {
4546 let val = (self.0 >> 3usize) & 0x01;
4547 super::vals::Iophsmen(val as u8)
4548 } 3716 }
4549 #[doc = "IOPDSMEN"] 3717 #[doc = "Capture/Compare 1 output enable"]
4550 pub fn set_iopdsmen(&mut self, val: super::vals::Iophsmen) { 3718 pub fn set_cce(&mut self, n: usize, val: bool) {
4551 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 3719 assert!(n < 4usize);
3720 let offs = 0usize + n * 4usize;
3721 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4552 } 3722 }
4553 #[doc = "Port E clock enable during Sleep mode bit"] 3723 #[doc = "Capture/Compare 1 output Polarity"]
4554 pub const fn iopesmen(&self) -> super::vals::Iophsmen { 3724 pub fn ccp(&self, n: usize) -> bool {
4555 let val = (self.0 >> 4usize) & 0x01; 3725 assert!(n < 4usize);
4556 super::vals::Iophsmen(val as u8) 3726 let offs = 1usize + n * 4usize;
3727 let val = (self.0 >> offs) & 0x01;
3728 val != 0
4557 } 3729 }
4558 #[doc = "Port E clock enable during Sleep mode bit"] 3730 #[doc = "Capture/Compare 1 output Polarity"]
4559 pub fn set_iopesmen(&mut self, val: super::vals::Iophsmen) { 3731 pub fn set_ccp(&mut self, n: usize, val: bool) {
4560 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 3732 assert!(n < 4usize);
3733 let offs = 1usize + n * 4usize;
3734 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4561 } 3735 }
4562 #[doc = "IOPHSMEN"] 3736 #[doc = "Capture/Compare 1 output Polarity"]
4563 pub const fn iophsmen(&self) -> super::vals::Iophsmen { 3737 pub fn ccnp(&self, n: usize) -> bool {
4564 let val = (self.0 >> 7usize) & 0x01; 3738 assert!(n < 4usize);
4565 super::vals::Iophsmen(val as u8) 3739 let offs = 3usize + n * 4usize;
3740 let val = (self.0 >> offs) & 0x01;
3741 val != 0
4566 } 3742 }
4567 #[doc = "IOPHSMEN"] 3743 #[doc = "Capture/Compare 1 output Polarity"]
4568 pub fn set_iophsmen(&mut self, val: super::vals::Iophsmen) { 3744 pub fn set_ccnp(&mut self, n: usize, val: bool) {
4569 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 3745 assert!(n < 4usize);
3746 let offs = 3usize + n * 4usize;
3747 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4570 } 3748 }
4571 } 3749 }
4572 impl Default for Iopsmen { 3750 impl Default for CcerGp {
4573 fn default() -> Iopsmen { 3751 fn default() -> CcerGp {
4574 Iopsmen(0) 3752 CcerGp(0)
4575 } 3753 }
4576 } 3754 }
4577 #[doc = "GPIO reset register"] 3755 #[doc = "status register"]
4578 #[repr(transparent)] 3756 #[repr(transparent)]
4579 #[derive(Copy, Clone, Eq, PartialEq)] 3757 #[derive(Copy, Clone, Eq, PartialEq)]
4580 pub struct Ioprstr(pub u32); 3758 pub struct SrGp(pub u32);
4581 impl Ioprstr { 3759 impl SrGp {
4582 #[doc = "I/O port A reset"] 3760 #[doc = "Update interrupt flag"]
4583 pub const fn ioparst(&self) -> super::vals::Iophrst { 3761 pub const fn uif(&self) -> bool {
4584 let val = (self.0 >> 0usize) & 0x01; 3762 let val = (self.0 >> 0usize) & 0x01;
4585 super::vals::Iophrst(val as u8) 3763 val != 0
4586 } 3764 }
4587 #[doc = "I/O port A reset"] 3765 #[doc = "Update interrupt flag"]
4588 pub fn set_ioparst(&mut self, val: super::vals::Iophrst) { 3766 pub fn set_uif(&mut self, val: bool) {
4589 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 3767 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4590 } 3768 }
4591 #[doc = "I/O port B reset"] 3769 #[doc = "Capture/compare 1 interrupt flag"]
4592 pub const fn iopbrst(&self) -> super::vals::Iophrst { 3770 pub fn ccif(&self, n: usize) -> bool {
4593 let val = (self.0 >> 1usize) & 0x01; 3771 assert!(n < 4usize);
4594 super::vals::Iophrst(val as u8) 3772 let offs = 1usize + n * 1usize;
3773 let val = (self.0 >> offs) & 0x01;
3774 val != 0
4595 } 3775 }
4596 #[doc = "I/O port B reset"] 3776 #[doc = "Capture/compare 1 interrupt flag"]
4597 pub fn set_iopbrst(&mut self, val: super::vals::Iophrst) { 3777 pub fn set_ccif(&mut self, n: usize, val: bool) {
4598 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 3778 assert!(n < 4usize);
3779 let offs = 1usize + n * 1usize;
3780 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4599 } 3781 }
4600 #[doc = "I/O port A reset"] 3782 #[doc = "COM interrupt flag"]
4601 pub const fn iopcrst(&self) -> super::vals::Iophrst { 3783 pub const fn comif(&self) -> bool {
4602 let val = (self.0 >> 2usize) & 0x01; 3784 let val = (self.0 >> 5usize) & 0x01;
4603 super::vals::Iophrst(val as u8) 3785 val != 0
4604 } 3786 }
4605 #[doc = "I/O port A reset"] 3787 #[doc = "COM interrupt flag"]
4606 pub fn set_iopcrst(&mut self, val: super::vals::Iophrst) { 3788 pub fn set_comif(&mut self, val: bool) {
4607 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 3789 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
4608 } 3790 }
4609 #[doc = "I/O port D reset"] 3791 #[doc = "Trigger interrupt flag"]
4610 pub const fn iopdrst(&self) -> super::vals::Iophrst { 3792 pub const fn tif(&self) -> bool {
4611 let val = (self.0 >> 3usize) & 0x01; 3793 let val = (self.0 >> 6usize) & 0x01;
4612 super::vals::Iophrst(val as u8) 3794 val != 0
4613 } 3795 }
4614 #[doc = "I/O port D reset"] 3796 #[doc = "Trigger interrupt flag"]
4615 pub fn set_iopdrst(&mut self, val: super::vals::Iophrst) { 3797 pub fn set_tif(&mut self, val: bool) {
4616 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 3798 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4617 } 3799 }
4618 #[doc = "I/O port E reset"] 3800 #[doc = "Break interrupt flag"]
4619 pub const fn ioperst(&self) -> super::vals::Iophrst { 3801 pub const fn bif(&self) -> bool {
4620 let val = (self.0 >> 4usize) & 0x01; 3802 let val = (self.0 >> 7usize) & 0x01;
4621 super::vals::Iophrst(val as u8) 3803 val != 0
4622 } 3804 }
4623 #[doc = "I/O port E reset"] 3805 #[doc = "Break interrupt flag"]
4624 pub fn set_ioperst(&mut self, val: super::vals::Iophrst) { 3806 pub fn set_bif(&mut self, val: bool) {
4625 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 3807 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
4626 } 3808 }
4627 #[doc = "I/O port H reset"] 3809 #[doc = "Capture/Compare 1 overcapture flag"]
4628 pub const fn iophrst(&self) -> super::vals::Iophrst { 3810 pub fn ccof(&self, n: usize) -> bool {
4629 let val = (self.0 >> 7usize) & 0x01; 3811 assert!(n < 4usize);
4630 super::vals::Iophrst(val as u8) 3812 let offs = 9usize + n * 1usize;
3813 let val = (self.0 >> offs) & 0x01;
3814 val != 0
4631 } 3815 }
4632 #[doc = "I/O port H reset"] 3816 #[doc = "Capture/Compare 1 overcapture flag"]
4633 pub fn set_iophrst(&mut self, val: super::vals::Iophrst) { 3817 pub fn set_ccof(&mut self, n: usize, val: bool) {
4634 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 3818 assert!(n < 4usize);
3819 let offs = 9usize + n * 1usize;
3820 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4635 } 3821 }
4636 } 3822 }
4637 impl Default for Ioprstr { 3823 impl Default for SrGp {
4638 fn default() -> Ioprstr { 3824 fn default() -> SrGp {
4639 Ioprstr(0) 3825 SrGp(0)
4640 } 3826 }
4641 } 3827 }
4642 } 3828 }
4643} 3829}
4644pub mod gpio_v1 { 3830pub mod gpio_v2 {
4645 use crate::generic::*; 3831 use crate::generic::*;
4646 #[doc = "General purpose I/O"] 3832 #[doc = "General-purpose I/Os"]
4647 #[derive(Copy, Clone)] 3833 #[derive(Copy, Clone)]
4648 pub struct Gpio(pub *mut u8); 3834 pub struct Gpio(pub *mut u8);
4649 unsafe impl Send for Gpio {} 3835 unsafe impl Send for Gpio {}
4650 unsafe impl Sync for Gpio {} 3836 unsafe impl Sync for Gpio {}
4651 impl Gpio { 3837 impl Gpio {
4652 #[doc = "Port configuration register low (GPIOn_CRL)"] 3838 #[doc = "GPIO port mode register"]
4653 pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> { 3839 pub fn moder(self) -> Reg<regs::Moder, RW> {
4654 assert!(n < 2usize); 3840 unsafe { Reg::from_ptr(self.0.add(0usize)) }
4655 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
4656 } 3841 }
4657 #[doc = "Port input data register (GPIOn_IDR)"] 3842 #[doc = "GPIO port output type register"]
4658 pub fn idr(self) -> Reg<regs::Idr, R> { 3843 pub fn otyper(self) -> Reg<regs::Otyper, RW> {
3844 unsafe { Reg::from_ptr(self.0.add(4usize)) }
3845 }
3846 #[doc = "GPIO port output speed register"]
3847 pub fn ospeedr(self) -> Reg<regs::Ospeedr, RW> {
4659 unsafe { Reg::from_ptr(self.0.add(8usize)) } 3848 unsafe { Reg::from_ptr(self.0.add(8usize)) }
4660 } 3849 }
4661 #[doc = "Port output data register (GPIOn_ODR)"] 3850 #[doc = "GPIO port pull-up/pull-down register"]
4662 pub fn odr(self) -> Reg<regs::Odr, RW> { 3851 pub fn pupdr(self) -> Reg<regs::Pupdr, RW> {
4663 unsafe { Reg::from_ptr(self.0.add(12usize)) } 3852 unsafe { Reg::from_ptr(self.0.add(12usize)) }
4664 } 3853 }
4665 #[doc = "Port bit set/reset register (GPIOn_BSRR)"] 3854 #[doc = "GPIO port input data register"]
4666 pub fn bsrr(self) -> Reg<regs::Bsrr, W> { 3855 pub fn idr(self) -> Reg<regs::Idr, R> {
4667 unsafe { Reg::from_ptr(self.0.add(16usize)) } 3856 unsafe { Reg::from_ptr(self.0.add(16usize)) }
4668 } 3857 }
4669 #[doc = "Port bit reset register (GPIOn_BRR)"] 3858 #[doc = "GPIO port output data register"]
4670 pub fn brr(self) -> Reg<regs::Brr, W> { 3859 pub fn odr(self) -> Reg<regs::Odr, RW> {
4671 unsafe { Reg::from_ptr(self.0.add(20usize)) } 3860 unsafe { Reg::from_ptr(self.0.add(20usize)) }
4672 } 3861 }
4673 #[doc = "Port configuration lock register"] 3862 #[doc = "GPIO port bit set/reset register"]
4674 pub fn lckr(self) -> Reg<regs::Lckr, RW> { 3863 pub fn bsrr(self) -> Reg<regs::Bsrr, W> {
4675 unsafe { Reg::from_ptr(self.0.add(24usize)) } 3864 unsafe { Reg::from_ptr(self.0.add(24usize)) }
4676 } 3865 }
3866 #[doc = "GPIO port configuration lock register"]
3867 pub fn lckr(self) -> Reg<regs::Lckr, RW> {
3868 unsafe { Reg::from_ptr(self.0.add(28usize)) }
3869 }
3870 #[doc = "GPIO alternate function register (low, high)"]
3871 pub fn afr(self, n: usize) -> Reg<regs::Afr, RW> {
3872 assert!(n < 2usize);
3873 unsafe { Reg::from_ptr(self.0.add(32usize + n * 4usize)) }
3874 }
4677 } 3875 }
4678 pub mod regs { 3876 pub mod regs {
4679 use crate::generic::*; 3877 use crate::generic::*;
4680 #[doc = "Port configuration lock register"] 3878 #[doc = "GPIO port output type register"]
3879 #[repr(transparent)]
3880 #[derive(Copy, Clone, Eq, PartialEq)]
3881 pub struct Otyper(pub u32);
3882 impl Otyper {
3883 #[doc = "Port x configuration bits (y = 0..15)"]
3884 pub fn ot(&self, n: usize) -> super::vals::Ot {
3885 assert!(n < 16usize);
3886 let offs = 0usize + n * 1usize;
3887 let val = (self.0 >> offs) & 0x01;
3888 super::vals::Ot(val as u8)
3889 }
3890 #[doc = "Port x configuration bits (y = 0..15)"]
3891 pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) {
3892 assert!(n < 16usize);
3893 let offs = 0usize + n * 1usize;
3894 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
3895 }
3896 }
3897 impl Default for Otyper {
3898 fn default() -> Otyper {
3899 Otyper(0)
3900 }
3901 }
3902 #[doc = "GPIO port pull-up/pull-down register"]
3903 #[repr(transparent)]
3904 #[derive(Copy, Clone, Eq, PartialEq)]
3905 pub struct Pupdr(pub u32);
3906 impl Pupdr {
3907 #[doc = "Port x configuration bits (y = 0..15)"]
3908 pub fn pupdr(&self, n: usize) -> super::vals::Pupdr {
3909 assert!(n < 16usize);
3910 let offs = 0usize + n * 2usize;
3911 let val = (self.0 >> offs) & 0x03;
3912 super::vals::Pupdr(val as u8)
3913 }
3914 #[doc = "Port x configuration bits (y = 0..15)"]
3915 pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) {
3916 assert!(n < 16usize);
3917 let offs = 0usize + n * 2usize;
3918 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
3919 }
3920 }
3921 impl Default for Pupdr {
3922 fn default() -> Pupdr {
3923 Pupdr(0)
3924 }
3925 }
3926 #[doc = "GPIO port output speed register"]
3927 #[repr(transparent)]
3928 #[derive(Copy, Clone, Eq, PartialEq)]
3929 pub struct Ospeedr(pub u32);
3930 impl Ospeedr {
3931 #[doc = "Port x configuration bits (y = 0..15)"]
3932 pub fn ospeedr(&self, n: usize) -> super::vals::Ospeedr {
3933 assert!(n < 16usize);
3934 let offs = 0usize + n * 2usize;
3935 let val = (self.0 >> offs) & 0x03;
3936 super::vals::Ospeedr(val as u8)
3937 }
3938 #[doc = "Port x configuration bits (y = 0..15)"]
3939 pub fn set_ospeedr(&mut self, n: usize, val: super::vals::Ospeedr) {
3940 assert!(n < 16usize);
3941 let offs = 0usize + n * 2usize;
3942 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
3943 }
3944 }
3945 impl Default for Ospeedr {
3946 fn default() -> Ospeedr {
3947 Ospeedr(0)
3948 }
3949 }
3950 #[doc = "GPIO port configuration lock register"]
4681 #[repr(transparent)] 3951 #[repr(transparent)]
4682 #[derive(Copy, Clone, Eq, PartialEq)] 3952 #[derive(Copy, Clone, Eq, PartialEq)]
4683 pub struct Lckr(pub u32); 3953 pub struct Lckr(pub u32);
4684 impl Lckr { 3954 impl Lckr {
4685 #[doc = "Port A Lock bit"] 3955 #[doc = "Port x lock bit y (y= 0..15)"]
4686 pub fn lck(&self, n: usize) -> super::vals::Lck { 3956 pub fn lck(&self, n: usize) -> super::vals::Lck {
4687 assert!(n < 16usize); 3957 assert!(n < 16usize);
4688 let offs = 0usize + n * 1usize; 3958 let offs = 0usize + n * 1usize;
4689 let val = (self.0 >> offs) & 0x01; 3959 let val = (self.0 >> offs) & 0x01;
4690 super::vals::Lck(val as u8) 3960 super::vals::Lck(val as u8)
4691 } 3961 }
4692 #[doc = "Port A Lock bit"] 3962 #[doc = "Port x lock bit y (y= 0..15)"]
4693 pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) { 3963 pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) {
4694 assert!(n < 16usize); 3964 assert!(n < 16usize);
4695 let offs = 0usize + n * 1usize; 3965 let offs = 0usize + n * 1usize;
4696 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); 3966 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
4697 } 3967 }
4698 #[doc = "Lock key"] 3968 #[doc = "Port x lock bit y (y= 0..15)"]
4699 pub const fn lckk(&self) -> super::vals::Lckk { 3969 pub const fn lckk(&self) -> super::vals::Lckk {
4700 let val = (self.0 >> 16usize) & 0x01; 3970 let val = (self.0 >> 16usize) & 0x01;
4701 super::vals::Lckk(val as u8) 3971 super::vals::Lckk(val as u8)
4702 } 3972 }
4703 #[doc = "Lock key"] 3973 #[doc = "Port x lock bit y (y= 0..15)"]
4704 pub fn set_lckk(&mut self, val: super::vals::Lckk) { 3974 pub fn set_lckk(&mut self, val: super::vals::Lckk) {
4705 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 3975 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
4706 } 3976 }
@@ -4710,19 +3980,19 @@ pub mod gpio_v1 {
4710 Lckr(0) 3980 Lckr(0)
4711 } 3981 }
4712 } 3982 }
4713 #[doc = "Port input data register (GPIOn_IDR)"] 3983 #[doc = "GPIO port input data register"]
4714 #[repr(transparent)] 3984 #[repr(transparent)]
4715 #[derive(Copy, Clone, Eq, PartialEq)] 3985 #[derive(Copy, Clone, Eq, PartialEq)]
4716 pub struct Idr(pub u32); 3986 pub struct Idr(pub u32);
4717 impl Idr { 3987 impl Idr {
4718 #[doc = "Port input data"] 3988 #[doc = "Port input data (y = 0..15)"]
4719 pub fn idr(&self, n: usize) -> super::vals::Idr { 3989 pub fn idr(&self, n: usize) -> super::vals::Idr {
4720 assert!(n < 16usize); 3990 assert!(n < 16usize);
4721 let offs = 0usize + n * 1usize; 3991 let offs = 0usize + n * 1usize;
4722 let val = (self.0 >> offs) & 0x01; 3992 let val = (self.0 >> offs) & 0x01;
4723 super::vals::Idr(val as u8) 3993 super::vals::Idr(val as u8)
4724 } 3994 }
4725 #[doc = "Port input data"] 3995 #[doc = "Port input data (y = 0..15)"]
4726 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { 3996 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) {
4727 assert!(n < 16usize); 3997 assert!(n < 16usize);
4728 let offs = 0usize + n * 1usize; 3998 let offs = 0usize + n * 1usize;
@@ -4734,56 +4004,104 @@ pub mod gpio_v1 {
4734 Idr(0) 4004 Idr(0)
4735 } 4005 }
4736 } 4006 }
4737 #[doc = "Port bit reset register (GPIOn_BRR)"] 4007 #[doc = "GPIO alternate function register"]
4738 #[repr(transparent)] 4008 #[repr(transparent)]
4739 #[derive(Copy, Clone, Eq, PartialEq)] 4009 #[derive(Copy, Clone, Eq, PartialEq)]
4740 pub struct Brr(pub u32); 4010 pub struct Afr(pub u32);
4741 impl Brr { 4011 impl Afr {
4742 #[doc = "Reset bit"] 4012 #[doc = "Alternate function selection for port x bit y (y = 0..15)"]
4743 pub fn br(&self, n: usize) -> bool { 4013 pub fn afr(&self, n: usize) -> super::vals::Afr {
4014 assert!(n < 8usize);
4015 let offs = 0usize + n * 4usize;
4016 let val = (self.0 >> offs) & 0x0f;
4017 super::vals::Afr(val as u8)
4018 }
4019 #[doc = "Alternate function selection for port x bit y (y = 0..15)"]
4020 pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) {
4021 assert!(n < 8usize);
4022 let offs = 0usize + n * 4usize;
4023 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
4024 }
4025 }
4026 impl Default for Afr {
4027 fn default() -> Afr {
4028 Afr(0)
4029 }
4030 }
4031 #[doc = "GPIO port output data register"]
4032 #[repr(transparent)]
4033 #[derive(Copy, Clone, Eq, PartialEq)]
4034 pub struct Odr(pub u32);
4035 impl Odr {
4036 #[doc = "Port output data (y = 0..15)"]
4037 pub fn odr(&self, n: usize) -> super::vals::Odr {
4744 assert!(n < 16usize); 4038 assert!(n < 16usize);
4745 let offs = 0usize + n * 1usize; 4039 let offs = 0usize + n * 1usize;
4746 let val = (self.0 >> offs) & 0x01; 4040 let val = (self.0 >> offs) & 0x01;
4747 val != 0 4041 super::vals::Odr(val as u8)
4748 } 4042 }
4749 #[doc = "Reset bit"] 4043 #[doc = "Port output data (y = 0..15)"]
4750 pub fn set_br(&mut self, n: usize, val: bool) { 4044 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) {
4751 assert!(n < 16usize); 4045 assert!(n < 16usize);
4752 let offs = 0usize + n * 1usize; 4046 let offs = 0usize + n * 1usize;
4753 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); 4047 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
4754 } 4048 }
4755 } 4049 }
4756 impl Default for Brr { 4050 impl Default for Odr {
4757 fn default() -> Brr { 4051 fn default() -> Odr {
4758 Brr(0) 4052 Odr(0)
4759 } 4053 }
4760 } 4054 }
4761 #[doc = "Port bit set/reset register (GPIOn_BSRR)"] 4055 #[doc = "GPIO port mode register"]
4056 #[repr(transparent)]
4057 #[derive(Copy, Clone, Eq, PartialEq)]
4058 pub struct Moder(pub u32);
4059 impl Moder {
4060 #[doc = "Port x configuration bits (y = 0..15)"]
4061 pub fn moder(&self, n: usize) -> super::vals::Moder {
4062 assert!(n < 16usize);
4063 let offs = 0usize + n * 2usize;
4064 let val = (self.0 >> offs) & 0x03;
4065 super::vals::Moder(val as u8)
4066 }
4067 #[doc = "Port x configuration bits (y = 0..15)"]
4068 pub fn set_moder(&mut self, n: usize, val: super::vals::Moder) {
4069 assert!(n < 16usize);
4070 let offs = 0usize + n * 2usize;
4071 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
4072 }
4073 }
4074 impl Default for Moder {
4075 fn default() -> Moder {
4076 Moder(0)
4077 }
4078 }
4079 #[doc = "GPIO port bit set/reset register"]
4762 #[repr(transparent)] 4080 #[repr(transparent)]
4763 #[derive(Copy, Clone, Eq, PartialEq)] 4081 #[derive(Copy, Clone, Eq, PartialEq)]
4764 pub struct Bsrr(pub u32); 4082 pub struct Bsrr(pub u32);
4765 impl Bsrr { 4083 impl Bsrr {
4766 #[doc = "Set bit"] 4084 #[doc = "Port x set bit y (y= 0..15)"]
4767 pub fn bs(&self, n: usize) -> bool { 4085 pub fn bs(&self, n: usize) -> bool {
4768 assert!(n < 16usize); 4086 assert!(n < 16usize);
4769 let offs = 0usize + n * 1usize; 4087 let offs = 0usize + n * 1usize;
4770 let val = (self.0 >> offs) & 0x01; 4088 let val = (self.0 >> offs) & 0x01;
4771 val != 0 4089 val != 0
4772 } 4090 }
4773 #[doc = "Set bit"] 4091 #[doc = "Port x set bit y (y= 0..15)"]
4774 pub fn set_bs(&mut self, n: usize, val: bool) { 4092 pub fn set_bs(&mut self, n: usize, val: bool) {
4775 assert!(n < 16usize); 4093 assert!(n < 16usize);
4776 let offs = 0usize + n * 1usize; 4094 let offs = 0usize + n * 1usize;
4777 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); 4095 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4778 } 4096 }
4779 #[doc = "Reset bit"] 4097 #[doc = "Port x set bit y (y= 0..15)"]
4780 pub fn br(&self, n: usize) -> bool { 4098 pub fn br(&self, n: usize) -> bool {
4781 assert!(n < 16usize); 4099 assert!(n < 16usize);
4782 let offs = 16usize + n * 1usize; 4100 let offs = 16usize + n * 1usize;
4783 let val = (self.0 >> offs) & 0x01; 4101 let val = (self.0 >> offs) & 0x01;
4784 val != 0 4102 val != 0
4785 } 4103 }
4786 #[doc = "Reset bit"] 4104 #[doc = "Port x set bit y (y= 0..15)"]
4787 pub fn set_br(&mut self, n: usize, val: bool) { 4105 pub fn set_br(&mut self, n: usize, val: bool) {
4788 assert!(n < 16usize); 4106 assert!(n < 16usize);
4789 let offs = 16usize + n * 1usize; 4107 let offs = 16usize + n * 1usize;
@@ -4795,70 +4113,31 @@ pub mod gpio_v1 {
4795 Bsrr(0) 4113 Bsrr(0)
4796 } 4114 }
4797 } 4115 }
4798 #[doc = "Port configuration register (GPIOn_CRx)"] 4116 }
4117 pub mod vals {
4118 use crate::generic::*;
4799 #[repr(transparent)] 4119 #[repr(transparent)]
4800 #[derive(Copy, Clone, Eq, PartialEq)] 4120 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4801 pub struct Cr(pub u32); 4121 pub struct Idr(pub u8);
4802 impl Cr { 4122 impl Idr {
4803 #[doc = "Port n mode bits"] 4123 #[doc = "Input is logic low"]
4804 pub fn mode(&self, n: usize) -> super::vals::Mode { 4124 pub const LOW: Self = Self(0);
4805 assert!(n < 8usize); 4125 #[doc = "Input is logic high"]
4806 let offs = 0usize + n * 4usize; 4126 pub const HIGH: Self = Self(0x01);
4807 let val = (self.0 >> offs) & 0x03;
4808 super::vals::Mode(val as u8)
4809 }
4810 #[doc = "Port n mode bits"]
4811 pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) {
4812 assert!(n < 8usize);
4813 let offs = 0usize + n * 4usize;
4814 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
4815 }
4816 #[doc = "Port n configuration bits"]
4817 pub fn cnf(&self, n: usize) -> super::vals::Cnf {
4818 assert!(n < 8usize);
4819 let offs = 2usize + n * 4usize;
4820 let val = (self.0 >> offs) & 0x03;
4821 super::vals::Cnf(val as u8)
4822 }
4823 #[doc = "Port n configuration bits"]
4824 pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) {
4825 assert!(n < 8usize);
4826 let offs = 2usize + n * 4usize;
4827 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
4828 }
4829 }
4830 impl Default for Cr {
4831 fn default() -> Cr {
4832 Cr(0)
4833 }
4834 } 4127 }
4835 #[doc = "Port output data register (GPIOn_ODR)"]
4836 #[repr(transparent)] 4128 #[repr(transparent)]
4837 #[derive(Copy, Clone, Eq, PartialEq)] 4129 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4838 pub struct Odr(pub u32); 4130 pub struct Ospeedr(pub u8);
4839 impl Odr { 4131 impl Ospeedr {
4840 #[doc = "Port output data"] 4132 #[doc = "Low speed"]
4841 pub fn odr(&self, n: usize) -> super::vals::Odr { 4133 pub const LOWSPEED: Self = Self(0);
4842 assert!(n < 16usize); 4134 #[doc = "Medium speed"]
4843 let offs = 0usize + n * 1usize; 4135 pub const MEDIUMSPEED: Self = Self(0x01);
4844 let val = (self.0 >> offs) & 0x01; 4136 #[doc = "High speed"]
4845 super::vals::Odr(val as u8) 4137 pub const HIGHSPEED: Self = Self(0x02);
4846 } 4138 #[doc = "Very high speed"]
4847 #[doc = "Port output data"] 4139 pub const VERYHIGHSPEED: Self = Self(0x03);
4848 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) {
4849 assert!(n < 16usize);
4850 let offs = 0usize + n * 1usize;
4851 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
4852 }
4853 }
4854 impl Default for Odr {
4855 fn default() -> Odr {
4856 Odr(0)
4857 }
4858 } 4140 }
4859 }
4860 pub mod vals {
4861 use crate::generic::*;
4862 #[repr(transparent)] 4141 #[repr(transparent)]
4863 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4142 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4864 pub struct Lckk(pub u8); 4143 pub struct Lckk(pub u8);
@@ -4870,34 +4149,78 @@ pub mod gpio_v1 {
4870 } 4149 }
4871 #[repr(transparent)] 4150 #[repr(transparent)]
4872 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4151 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4873 pub struct Brw(pub u8); 4152 pub struct Ot(pub u8);
4874 impl Brw { 4153 impl Ot {
4875 #[doc = "No action on the corresponding ODx bit"] 4154 #[doc = "Output push-pull (reset state)"]
4876 pub const NOACTION: Self = Self(0); 4155 pub const PUSHPULL: Self = Self(0);
4877 #[doc = "Reset the ODx bit"] 4156 #[doc = "Output open-drain"]
4878 pub const RESET: Self = Self(0x01); 4157 pub const OPENDRAIN: Self = Self(0x01);
4879 } 4158 }
4880 #[repr(transparent)] 4159 #[repr(transparent)]
4881 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4160 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4882 pub struct Idr(pub u8); 4161 pub struct Lck(pub u8);
4883 impl Idr { 4162 impl Lck {
4884 #[doc = "Input is logic low"] 4163 #[doc = "Port configuration not locked"]
4885 pub const LOW: Self = Self(0); 4164 pub const UNLOCKED: Self = Self(0);
4886 #[doc = "Input is logic high"] 4165 #[doc = "Port configuration locked"]
4887 pub const HIGH: Self = Self(0x01); 4166 pub const LOCKED: Self = Self(0x01);
4888 } 4167 }
4889 #[repr(transparent)] 4168 #[repr(transparent)]
4890 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4169 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4891 pub struct Mode(pub u8); 4170 pub struct Afr(pub u8);
4892 impl Mode { 4171 impl Afr {
4172 #[doc = "AF0"]
4173 pub const AF0: Self = Self(0);
4174 #[doc = "AF1"]
4175 pub const AF1: Self = Self(0x01);
4176 #[doc = "AF2"]
4177 pub const AF2: Self = Self(0x02);
4178 #[doc = "AF3"]
4179 pub const AF3: Self = Self(0x03);
4180 #[doc = "AF4"]
4181 pub const AF4: Self = Self(0x04);
4182 #[doc = "AF5"]
4183 pub const AF5: Self = Self(0x05);
4184 #[doc = "AF6"]
4185 pub const AF6: Self = Self(0x06);
4186 #[doc = "AF7"]
4187 pub const AF7: Self = Self(0x07);
4188 #[doc = "AF8"]
4189 pub const AF8: Self = Self(0x08);
4190 #[doc = "AF9"]
4191 pub const AF9: Self = Self(0x09);
4192 #[doc = "AF10"]
4193 pub const AF10: Self = Self(0x0a);
4194 #[doc = "AF11"]
4195 pub const AF11: Self = Self(0x0b);
4196 #[doc = "AF12"]
4197 pub const AF12: Self = Self(0x0c);
4198 #[doc = "AF13"]
4199 pub const AF13: Self = Self(0x0d);
4200 #[doc = "AF14"]
4201 pub const AF14: Self = Self(0x0e);
4202 #[doc = "AF15"]
4203 pub const AF15: Self = Self(0x0f);
4204 }
4205 #[repr(transparent)]
4206 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4207 pub struct Bsw(pub u8);
4208 impl Bsw {
4209 #[doc = "Sets the corresponding ODRx bit"]
4210 pub const SET: Self = Self(0x01);
4211 }
4212 #[repr(transparent)]
4213 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4214 pub struct Moder(pub u8);
4215 impl Moder {
4893 #[doc = "Input mode (reset state)"] 4216 #[doc = "Input mode (reset state)"]
4894 pub const INPUT: Self = Self(0); 4217 pub const INPUT: Self = Self(0);
4895 #[doc = "Output mode 10 MHz"] 4218 #[doc = "General purpose output mode"]
4896 pub const OUTPUT: Self = Self(0x01); 4219 pub const OUTPUT: Self = Self(0x01);
4897 #[doc = "Output mode 2 MHz"] 4220 #[doc = "Alternate function mode"]
4898 pub const OUTPUT2: Self = Self(0x02); 4221 pub const ALTERNATE: Self = Self(0x02);
4899 #[doc = "Output mode 50 MHz"] 4222 #[doc = "Analog mode"]
4900 pub const OUTPUT50: Self = Self(0x03); 4223 pub const ANALOG: Self = Self(0x03);
4901 } 4224 }
4902 #[repr(transparent)] 4225 #[repr(transparent)]
4903 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4226 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -4910,2139 +4233,1229 @@ pub mod gpio_v1 {
4910 } 4233 }
4911 #[repr(transparent)] 4234 #[repr(transparent)]
4912 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4235 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4913 pub struct Cnf(pub u8); 4236 pub struct Brw(pub u8);
4914 impl Cnf { 4237 impl Brw {
4915 #[doc = "Analog mode / Push-Pull mode"] 4238 #[doc = "Resets the corresponding ODRx bit"]
4916 pub const PUSHPULL: Self = Self(0); 4239 pub const RESET: Self = Self(0x01);
4917 #[doc = "Floating input (reset state) / Open Drain-Mode"]
4918 pub const OPENDRAIN: Self = Self(0x01);
4919 #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"]
4920 pub const ALTPUSHPULL: Self = Self(0x02);
4921 #[doc = "Alternate Function Open-Drain Mode"]
4922 pub const ALTOPENDRAIN: Self = Self(0x03);
4923 }
4924 #[repr(transparent)]
4925 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4926 pub struct Bsw(pub u8);
4927 impl Bsw {
4928 #[doc = "No action on the corresponding ODx bit"]
4929 pub const NOACTION: Self = Self(0);
4930 #[doc = "Sets the corresponding ODRx bit"]
4931 pub const SET: Self = Self(0x01);
4932 } 4240 }
4933 #[repr(transparent)] 4241 #[repr(transparent)]
4934 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 4242 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
4935 pub struct Lck(pub u8); 4243 pub struct Pupdr(pub u8);
4936 impl Lck { 4244 impl Pupdr {
4937 #[doc = "Port configuration not locked"] 4245 #[doc = "No pull-up, pull-down"]
4938 pub const UNLOCKED: Self = Self(0); 4246 pub const FLOATING: Self = Self(0);
4939 #[doc = "Port configuration locked"] 4247 #[doc = "Pull-up"]
4940 pub const LOCKED: Self = Self(0x01); 4248 pub const PULLUP: Self = Self(0x01);
4249 #[doc = "Pull-down"]
4250 pub const PULLDOWN: Self = Self(0x02);
4941 } 4251 }
4942 } 4252 }
4943} 4253}
4944pub mod sdmmc_v2 { 4254pub mod syscfg_l0 {
4945 use crate::generic::*; 4255 use crate::generic::*;
4946 #[doc = "SDMMC"] 4256 #[doc = "System configuration controller"]
4947 #[derive(Copy, Clone)] 4257 #[derive(Copy, Clone)]
4948 pub struct Sdmmc(pub *mut u8); 4258 pub struct Syscfg(pub *mut u8);
4949 unsafe impl Send for Sdmmc {} 4259 unsafe impl Send for Syscfg {}
4950 unsafe impl Sync for Sdmmc {} 4260 unsafe impl Sync for Syscfg {}
4951 impl Sdmmc { 4261 impl Syscfg {
4952 #[doc = "SDMMC power control register"] 4262 #[doc = "configuration register 1"]
4953 pub fn power(self) -> Reg<regs::Power, RW> { 4263 pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> {
4954 unsafe { Reg::from_ptr(self.0.add(0usize)) } 4264 unsafe { Reg::from_ptr(self.0.add(0usize)) }
4955 } 4265 }
4956 #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."] 4266 #[doc = "CFGR2"]
4957 pub fn clkcr(self) -> Reg<regs::Clkcr, RW> { 4267 pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> {
4958 unsafe { Reg::from_ptr(self.0.add(4usize)) } 4268 unsafe { Reg::from_ptr(self.0.add(4usize)) }
4959 } 4269 }
4960 #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] 4270 #[doc = "external interrupt configuration register"]
4961 pub fn argr(self) -> Reg<regs::Argr, RW> { 4271 pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> {
4962 unsafe { Reg::from_ptr(self.0.add(8usize)) }
4963 }
4964 #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."]
4965 pub fn cmdr(self) -> Reg<regs::Cmdr, RW> {
4966 unsafe { Reg::from_ptr(self.0.add(12usize)) }
4967 }
4968 #[doc = "SDMMC command response register"]
4969 pub fn respcmdr(self) -> Reg<regs::Respcmdr, R> {
4970 unsafe { Reg::from_ptr(self.0.add(16usize)) }
4971 }
4972 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
4973 pub fn respr(self, n: usize) -> Reg<regs::Resp1r, R> {
4974 assert!(n < 4usize); 4272 assert!(n < 4usize);
4975 unsafe { Reg::from_ptr(self.0.add(20usize + n * 4usize)) } 4273 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
4976 }
4977 #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."]
4978 pub fn dtimer(self) -> Reg<regs::Dtimer, RW> {
4979 unsafe { Reg::from_ptr(self.0.add(36usize)) }
4980 }
4981 #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."]
4982 pub fn dlenr(self) -> Reg<regs::Dlenr, RW> {
4983 unsafe { Reg::from_ptr(self.0.add(40usize)) }
4984 }
4985 #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."]
4986 pub fn dctrl(self) -> Reg<regs::Dctrl, RW> {
4987 unsafe { Reg::from_ptr(self.0.add(44usize)) }
4988 }
4989 #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."]
4990 pub fn dcntr(self) -> Reg<regs::Dcntr, R> {
4991 unsafe { Reg::from_ptr(self.0.add(48usize)) }
4992 }
4993 #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"]
4994 pub fn star(self) -> Reg<regs::Star, R> {
4995 unsafe { Reg::from_ptr(self.0.add(52usize)) }
4996 }
4997 #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."]
4998 pub fn icr(self) -> Reg<regs::Icr, RW> {
4999 unsafe { Reg::from_ptr(self.0.add(56usize)) }
5000 }
5001 #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."]
5002 pub fn maskr(self) -> Reg<regs::Maskr, RW> {
5003 unsafe { Reg::from_ptr(self.0.add(60usize)) }
5004 }
5005 #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."]
5006 pub fn acktimer(self) -> Reg<regs::Acktimer, RW> {
5007 unsafe { Reg::from_ptr(self.0.add(64usize)) }
5008 }
5009 #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."]
5010 pub fn idmactrlr(self) -> Reg<regs::Idmactrlr, RW> {
5011 unsafe { Reg::from_ptr(self.0.add(80usize)) }
5012 }
5013 #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."]
5014 pub fn idmabsizer(self) -> Reg<regs::Idmabsizer, RW> {
5015 unsafe { Reg::from_ptr(self.0.add(84usize)) }
5016 }
5017 #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."]
5018 pub fn idmabase0r(self) -> Reg<regs::Idmabase0r, RW> {
5019 unsafe { Reg::from_ptr(self.0.add(88usize)) }
5020 }
5021 #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."]
5022 pub fn idmabase1r(self) -> Reg<regs::Idmabase1r, RW> {
5023 unsafe { Reg::from_ptr(self.0.add(92usize)) }
5024 }
5025 #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."]
5026 pub fn fifor(self) -> Reg<regs::Fifor, RW> {
5027 unsafe { Reg::from_ptr(self.0.add(128usize)) }
5028 }
5029 #[doc = "SDMMC IP version register"]
5030 pub fn ver(self) -> Reg<regs::Ver, R> {
5031 unsafe { Reg::from_ptr(self.0.add(1012usize)) }
5032 } 4274 }
5033 #[doc = "SDMMC IP identification register"] 4275 #[doc = "CFGR3"]
5034 pub fn id(self) -> Reg<regs::Id, R> { 4276 pub fn cfgr3(self) -> Reg<regs::Cfgr3, RW> {
5035 unsafe { Reg::from_ptr(self.0.add(1016usize)) } 4277 unsafe { Reg::from_ptr(self.0.add(32usize)) }
5036 } 4278 }
5037 } 4279 }
5038 pub mod regs { 4280 pub mod regs {
5039 use crate::generic::*; 4281 use crate::generic::*;
5040 #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."] 4282 #[doc = "CFGR3"]
5041 #[repr(transparent)]
5042 #[derive(Copy, Clone, Eq, PartialEq)]
5043 pub struct Dcntr(pub u32);
5044 impl Dcntr {
5045 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
5046 pub const fn datacount(&self) -> u32 {
5047 let val = (self.0 >> 0usize) & 0x01ff_ffff;
5048 val as u32
5049 }
5050 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
5051 pub fn set_datacount(&mut self, val: u32) {
5052 self.0 =
5053 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
5054 }
5055 }
5056 impl Default for Dcntr {
5057 fn default() -> Dcntr {
5058 Dcntr(0)
5059 }
5060 }
5061 #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."]
5062 #[repr(transparent)]
5063 #[derive(Copy, Clone, Eq, PartialEq)]
5064 pub struct Fifor(pub u32);
5065 impl Fifor {
5066 #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."]
5067 pub const fn fifodata(&self) -> u32 {
5068 let val = (self.0 >> 0usize) & 0xffff_ffff;
5069 val as u32
5070 }
5071 #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."]
5072 pub fn set_fifodata(&mut self, val: u32) {
5073 self.0 =
5074 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5075 }
5076 }
5077 impl Default for Fifor {
5078 fn default() -> Fifor {
5079 Fifor(0)
5080 }
5081 }
5082 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
5083 #[repr(transparent)]
5084 #[derive(Copy, Clone, Eq, PartialEq)]
5085 pub struct Resp2r(pub u32);
5086 impl Resp2r {
5087 #[doc = "see Table404."]
5088 pub const fn cardstatus2(&self) -> u32 {
5089 let val = (self.0 >> 0usize) & 0xffff_ffff;
5090 val as u32
5091 }
5092 #[doc = "see Table404."]
5093 pub fn set_cardstatus2(&mut self, val: u32) {
5094 self.0 =
5095 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5096 }
5097 }
5098 impl Default for Resp2r {
5099 fn default() -> Resp2r {
5100 Resp2r(0)
5101 }
5102 }
5103 #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."]
5104 #[repr(transparent)] 4283 #[repr(transparent)]
5105 #[derive(Copy, Clone, Eq, PartialEq)] 4284 #[derive(Copy, Clone, Eq, PartialEq)]
5106 pub struct Maskr(pub u32); 4285 pub struct Cfgr3(pub u32);
5107 impl Maskr { 4286 impl Cfgr3 {
5108 #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."] 4287 #[doc = "VREFINT enable and scaler control for COMP2 enable bit"]
5109 pub const fn ccrcfailie(&self) -> bool { 4288 pub const fn en_vrefint(&self) -> bool {
5110 let val = (self.0 >> 0usize) & 0x01; 4289 let val = (self.0 >> 0usize) & 0x01;
5111 val != 0 4290 val != 0
5112 } 4291 }
5113 #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."] 4292 #[doc = "VREFINT enable and scaler control for COMP2 enable bit"]
5114 pub fn set_ccrcfailie(&mut self, val: bool) { 4293 pub fn set_en_vrefint(&mut self, val: bool) {
5115 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 4294 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
5116 } 4295 }
5117 #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."] 4296 #[doc = "VREFINT_ADC connection bit"]
5118 pub const fn dcrcfailie(&self) -> bool { 4297 pub const fn sel_vref_out(&self) -> u8 {
5119 let val = (self.0 >> 1usize) & 0x01; 4298 let val = (self.0 >> 4usize) & 0x03;
5120 val != 0 4299 val as u8
5121 }
5122 #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."]
5123 pub fn set_dcrcfailie(&mut self, val: bool) {
5124 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
5125 }
5126 #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."]
5127 pub const fn ctimeoutie(&self) -> bool {
5128 let val = (self.0 >> 2usize) & 0x01;
5129 val != 0
5130 }
5131 #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."]
5132 pub fn set_ctimeoutie(&mut self, val: bool) {
5133 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
5134 }
5135 #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."]
5136 pub const fn dtimeoutie(&self) -> bool {
5137 let val = (self.0 >> 3usize) & 0x01;
5138 val != 0
5139 }
5140 #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."]
5141 pub fn set_dtimeoutie(&mut self, val: bool) {
5142 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
5143 }
5144 #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."]
5145 pub const fn txunderrie(&self) -> bool {
5146 let val = (self.0 >> 4usize) & 0x01;
5147 val != 0
5148 }
5149 #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."]
5150 pub fn set_txunderrie(&mut self, val: bool) {
5151 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
5152 }
5153 #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."]
5154 pub const fn rxoverrie(&self) -> bool {
5155 let val = (self.0 >> 5usize) & 0x01;
5156 val != 0
5157 }
5158 #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."]
5159 pub fn set_rxoverrie(&mut self, val: bool) {
5160 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
5161 }
5162 #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."]
5163 pub const fn cmdrendie(&self) -> bool {
5164 let val = (self.0 >> 6usize) & 0x01;
5165 val != 0
5166 }
5167 #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."]
5168 pub fn set_cmdrendie(&mut self, val: bool) {
5169 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
5170 }
5171 #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."]
5172 pub const fn cmdsentie(&self) -> bool {
5173 let val = (self.0 >> 7usize) & 0x01;
5174 val != 0
5175 } 4300 }
5176 #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."] 4301 #[doc = "VREFINT_ADC connection bit"]
5177 pub fn set_cmdsentie(&mut self, val: bool) { 4302 pub fn set_sel_vref_out(&mut self, val: u8) {
5178 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 4303 self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize);
5179 } 4304 }
5180 #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."] 4305 #[doc = "VREFINT reference for ADC enable bit"]
5181 pub const fn dataendie(&self) -> bool { 4306 pub const fn enbuf_vrefint_adc(&self) -> bool {
5182 let val = (self.0 >> 8usize) & 0x01; 4307 let val = (self.0 >> 8usize) & 0x01;
5183 val != 0 4308 val != 0
5184 } 4309 }
5185 #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."] 4310 #[doc = "VREFINT reference for ADC enable bit"]
5186 pub fn set_dataendie(&mut self, val: bool) { 4311 pub fn set_enbuf_vrefint_adc(&mut self, val: bool) {
5187 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 4312 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
5188 } 4313 }
5189 #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."] 4314 #[doc = "Temperature sensor reference for ADC enable bit"]
5190 pub const fn dholdie(&self) -> bool { 4315 pub const fn enbuf_sensor_adc(&self) -> bool {
5191 let val = (self.0 >> 9usize) & 0x01; 4316 let val = (self.0 >> 9usize) & 0x01;
5192 val != 0 4317 val != 0
5193 } 4318 }
5194 #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."] 4319 #[doc = "Temperature sensor reference for ADC enable bit"]
5195 pub fn set_dholdie(&mut self, val: bool) { 4320 pub fn set_enbuf_sensor_adc(&mut self, val: bool) {
5196 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 4321 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
5197 } 4322 }
5198 #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."] 4323 #[doc = "VREFINT reference for COMP2 scaler enable bit"]
5199 pub const fn dbckendie(&self) -> bool { 4324 pub const fn enbuf_vrefint_comp2(&self) -> bool {
5200 let val = (self.0 >> 10usize) & 0x01;
5201 val != 0
5202 }
5203 #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."]
5204 pub fn set_dbckendie(&mut self, val: bool) {
5205 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
5206 }
5207 #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."]
5208 pub const fn dabortie(&self) -> bool {
5209 let val = (self.0 >> 11usize) & 0x01;
5210 val != 0
5211 }
5212 #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."]
5213 pub fn set_dabortie(&mut self, val: bool) {
5214 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
5215 }
5216 #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."]
5217 pub const fn txfifoheie(&self) -> bool {
5218 let val = (self.0 >> 14usize) & 0x01;
5219 val != 0
5220 }
5221 #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."]
5222 pub fn set_txfifoheie(&mut self, val: bool) {
5223 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
5224 }
5225 #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."]
5226 pub const fn rxfifohfie(&self) -> bool {
5227 let val = (self.0 >> 15usize) & 0x01;
5228 val != 0
5229 }
5230 #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."]
5231 pub fn set_rxfifohfie(&mut self, val: bool) {
5232 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
5233 }
5234 #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."]
5235 pub const fn rxfifofie(&self) -> bool {
5236 let val = (self.0 >> 17usize) & 0x01;
5237 val != 0
5238 }
5239 #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."]
5240 pub fn set_rxfifofie(&mut self, val: bool) {
5241 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
5242 }
5243 #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."]
5244 pub const fn txfifoeie(&self) -> bool {
5245 let val = (self.0 >> 18usize) & 0x01;
5246 val != 0
5247 }
5248 #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."]
5249 pub fn set_txfifoeie(&mut self, val: bool) {
5250 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
5251 }
5252 #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."]
5253 pub const fn busyd0endie(&self) -> bool {
5254 let val = (self.0 >> 21usize) & 0x01;
5255 val != 0
5256 }
5257 #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."]
5258 pub fn set_busyd0endie(&mut self, val: bool) {
5259 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
5260 }
5261 #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."]
5262 pub const fn sdioitie(&self) -> bool {
5263 let val = (self.0 >> 22usize) & 0x01;
5264 val != 0
5265 }
5266 #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."]
5267 pub fn set_sdioitie(&mut self, val: bool) {
5268 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
5269 }
5270 #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."]
5271 pub const fn ackfailie(&self) -> bool {
5272 let val = (self.0 >> 23usize) & 0x01;
5273 val != 0
5274 }
5275 #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."]
5276 pub fn set_ackfailie(&mut self, val: bool) {
5277 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
5278 }
5279 #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."]
5280 pub const fn acktimeoutie(&self) -> bool {
5281 let val = (self.0 >> 24usize) & 0x01;
5282 val != 0
5283 }
5284 #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."]
5285 pub fn set_acktimeoutie(&mut self, val: bool) {
5286 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
5287 }
5288 #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."]
5289 pub const fn vswendie(&self) -> bool {
5290 let val = (self.0 >> 25usize) & 0x01;
5291 val != 0
5292 }
5293 #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."]
5294 pub fn set_vswendie(&mut self, val: bool) {
5295 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
5296 }
5297 #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."]
5298 pub const fn ckstopie(&self) -> bool {
5299 let val = (self.0 >> 26usize) & 0x01;
5300 val != 0
5301 }
5302 #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."]
5303 pub fn set_ckstopie(&mut self, val: bool) {
5304 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
5305 }
5306 #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."]
5307 pub const fn idmabtcie(&self) -> bool {
5308 let val = (self.0 >> 28usize) & 0x01;
5309 val != 0
5310 }
5311 #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."]
5312 pub fn set_idmabtcie(&mut self, val: bool) {
5313 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
5314 }
5315 }
5316 impl Default for Maskr {
5317 fn default() -> Maskr {
5318 Maskr(0)
5319 }
5320 }
5321 #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."]
5322 #[repr(transparent)]
5323 #[derive(Copy, Clone, Eq, PartialEq)]
5324 pub struct Argr(pub u32);
5325 impl Argr {
5326 #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."]
5327 pub const fn cmdarg(&self) -> u32 {
5328 let val = (self.0 >> 0usize) & 0xffff_ffff;
5329 val as u32
5330 }
5331 #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."]
5332 pub fn set_cmdarg(&mut self, val: u32) {
5333 self.0 =
5334 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5335 }
5336 }
5337 impl Default for Argr {
5338 fn default() -> Argr {
5339 Argr(0)
5340 }
5341 }
5342 #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."]
5343 #[repr(transparent)]
5344 #[derive(Copy, Clone, Eq, PartialEq)]
5345 pub struct Clkcr(pub u32);
5346 impl Clkcr {
5347 #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."]
5348 pub const fn clkdiv(&self) -> u16 {
5349 let val = (self.0 >> 0usize) & 0x03ff;
5350 val as u16
5351 }
5352 #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."]
5353 pub fn set_clkdiv(&mut self, val: u16) {
5354 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
5355 }
5356 #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"]
5357 pub const fn pwrsav(&self) -> bool {
5358 let val = (self.0 >> 12usize) & 0x01; 4325 let val = (self.0 >> 12usize) & 0x01;
5359 val != 0 4326 val != 0
5360 } 4327 }
5361 #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"] 4328 #[doc = "VREFINT reference for COMP2 scaler enable bit"]
5362 pub fn set_pwrsav(&mut self, val: bool) { 4329 pub fn set_enbuf_vrefint_comp2(&mut self, val: bool) {
5363 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 4330 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
5364 } 4331 }
5365 #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] 4332 #[doc = "VREFINT reference for HSI48 oscillator enable bit"]
5366 pub const fn widbus(&self) -> u8 { 4333 pub const fn enref_hsi48(&self) -> bool {
5367 let val = (self.0 >> 14usize) & 0x03; 4334 let val = (self.0 >> 13usize) & 0x01;
5368 val as u8
5369 }
5370 #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
5371 pub fn set_widbus(&mut self, val: u8) {
5372 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize);
5373 }
5374 #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division &gt;1 (CLKDIV &gt; 0) &amp; DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."]
5375 pub const fn negedge(&self) -> bool {
5376 let val = (self.0 >> 16usize) & 0x01;
5377 val != 0
5378 }
5379 #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division &gt;1 (CLKDIV &gt; 0) &amp; DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."]
5380 pub fn set_negedge(&mut self, val: bool) {
5381 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
5382 }
5383 #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."]
5384 pub const fn hwfc_en(&self) -> bool {
5385 let val = (self.0 >> 17usize) & 0x01;
5386 val != 0 4335 val != 0
5387 } 4336 }
5388 #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."] 4337 #[doc = "VREFINT reference for HSI48 oscillator enable bit"]
5389 pub fn set_hwfc_en(&mut self, val: bool) { 4338 pub fn set_enref_hsi48(&mut self, val: bool) {
5390 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 4339 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
5391 } 4340 }
5392 #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS &gt; 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division &gt;1. (CLKDIV &gt; 0)"] 4341 #[doc = "VREFINT ready flag"]
5393 pub const fn ddr(&self) -> bool { 4342 pub const fn vrefint_rdyf(&self) -> bool {
5394 let val = (self.0 >> 18usize) & 0x01; 4343 let val = (self.0 >> 30usize) & 0x01;
5395 val != 0 4344 val != 0
5396 } 4345 }
5397 #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS &gt; 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division &gt;1. (CLKDIV &gt; 0)"] 4346 #[doc = "VREFINT ready flag"]
5398 pub fn set_ddr(&mut self, val: bool) { 4347 pub fn set_vrefint_rdyf(&mut self, val: bool) {
5399 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 4348 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
5400 } 4349 }
5401 #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] 4350 #[doc = "SYSCFG_CFGR3 lock bit"]
5402 pub const fn busspeed(&self) -> bool { 4351 pub const fn ref_lock(&self) -> bool {
5403 let val = (self.0 >> 19usize) & 0x01; 4352 let val = (self.0 >> 31usize) & 0x01;
5404 val != 0 4353 val != 0
5405 } 4354 }
5406 #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] 4355 #[doc = "SYSCFG_CFGR3 lock bit"]
5407 pub fn set_busspeed(&mut self, val: bool) { 4356 pub fn set_ref_lock(&mut self, val: bool) {
5408 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); 4357 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
5409 }
5410 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
5411 pub const fn selclkrx(&self) -> u8 {
5412 let val = (self.0 >> 20usize) & 0x03;
5413 val as u8
5414 }
5415 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
5416 pub fn set_selclkrx(&mut self, val: u8) {
5417 self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize);
5418 } 4358 }
5419 } 4359 }
5420 impl Default for Clkcr { 4360 impl Default for Cfgr3 {
5421 fn default() -> Clkcr { 4361 fn default() -> Cfgr3 {
5422 Clkcr(0) 4362 Cfgr3(0)
5423 } 4363 }
5424 } 4364 }
5425 #[doc = "SDMMC IP version register"] 4365 #[doc = "external interrupt configuration register 1-4"]
5426 #[repr(transparent)] 4366 #[repr(transparent)]
5427 #[derive(Copy, Clone, Eq, PartialEq)] 4367 #[derive(Copy, Clone, Eq, PartialEq)]
5428 pub struct Ver(pub u32); 4368 pub struct Exticr(pub u32);
5429 impl Ver { 4369 impl Exticr {
5430 #[doc = "IP minor revision number."] 4370 #[doc = "EXTI configuration bits"]
5431 pub const fn minrev(&self) -> u8 { 4371 pub fn exti(&self, n: usize) -> u8 {
5432 let val = (self.0 >> 0usize) & 0x0f; 4372 assert!(n < 4usize);
5433 val as u8 4373 let offs = 0usize + n * 4usize;
5434 } 4374 let val = (self.0 >> offs) & 0x0f;
5435 #[doc = "IP minor revision number."]
5436 pub fn set_minrev(&mut self, val: u8) {
5437 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
5438 }
5439 #[doc = "IP major revision number."]
5440 pub const fn majrev(&self) -> u8 {
5441 let val = (self.0 >> 4usize) & 0x0f;
5442 val as u8 4375 val as u8
5443 } 4376 }
5444 #[doc = "IP major revision number."] 4377 #[doc = "EXTI configuration bits"]
5445 pub fn set_majrev(&mut self, val: u8) { 4378 pub fn set_exti(&mut self, n: usize, val: u8) {
5446 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); 4379 assert!(n < 4usize);
4380 let offs = 0usize + n * 4usize;
4381 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
5447 } 4382 }
5448 } 4383 }
5449 impl Default for Ver { 4384 impl Default for Exticr {
5450 fn default() -> Ver { 4385 fn default() -> Exticr {
5451 Ver(0) 4386 Exticr(0)
5452 } 4387 }
5453 } 4388 }
5454 #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"] 4389 #[doc = "CFGR2"]
5455 #[repr(transparent)] 4390 #[repr(transparent)]
5456 #[derive(Copy, Clone, Eq, PartialEq)] 4391 #[derive(Copy, Clone, Eq, PartialEq)]
5457 pub struct Star(pub u32); 4392 pub struct Cfgr2(pub u32);
5458 impl Star { 4393 impl Cfgr2 {
5459 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4394 #[doc = "Firewall disable bit"]
5460 pub const fn ccrcfail(&self) -> bool { 4395 pub const fn fwdis(&self) -> bool {
5461 let val = (self.0 >> 0usize) & 0x01; 4396 let val = (self.0 >> 0usize) & 0x01;
5462 val != 0 4397 val != 0
5463 } 4398 }
5464 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4399 #[doc = "Firewall disable bit"]
5465 pub fn set_ccrcfail(&mut self, val: bool) { 4400 pub fn set_fwdis(&mut self, val: bool) {
5466 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 4401 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
5467 } 4402 }
5468 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4403 #[doc = "Fm+ drive capability on PB6 enable bit"]
5469 pub const fn dcrcfail(&self) -> bool { 4404 pub const fn i2c_pb6_fmp(&self) -> bool {
5470 let val = (self.0 >> 1usize) & 0x01;
5471 val != 0
5472 }
5473 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5474 pub fn set_dcrcfail(&mut self, val: bool) {
5475 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
5476 }
5477 #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."]
5478 pub const fn ctimeout(&self) -> bool {
5479 let val = (self.0 >> 2usize) & 0x01;
5480 val != 0
5481 }
5482 #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."]
5483 pub fn set_ctimeout(&mut self, val: bool) {
5484 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
5485 }
5486 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5487 pub const fn dtimeout(&self) -> bool {
5488 let val = (self.0 >> 3usize) & 0x01;
5489 val != 0
5490 }
5491 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5492 pub fn set_dtimeout(&mut self, val: bool) {
5493 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
5494 }
5495 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5496 pub const fn txunderr(&self) -> bool {
5497 let val = (self.0 >> 4usize) & 0x01;
5498 val != 0
5499 }
5500 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5501 pub fn set_txunderr(&mut self, val: bool) {
5502 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
5503 }
5504 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5505 pub const fn rxoverr(&self) -> bool {
5506 let val = (self.0 >> 5usize) & 0x01;
5507 val != 0
5508 }
5509 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5510 pub fn set_rxoverr(&mut self, val: bool) {
5511 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
5512 }
5513 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5514 pub const fn cmdrend(&self) -> bool {
5515 let val = (self.0 >> 6usize) & 0x01;
5516 val != 0
5517 }
5518 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5519 pub fn set_cmdrend(&mut self, val: bool) {
5520 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
5521 }
5522 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5523 pub const fn cmdsent(&self) -> bool {
5524 let val = (self.0 >> 7usize) & 0x01;
5525 val != 0
5526 }
5527 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5528 pub fn set_cmdsent(&mut self, val: bool) {
5529 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
5530 }
5531 #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5532 pub const fn dataend(&self) -> bool {
5533 let val = (self.0 >> 8usize) & 0x01; 4405 let val = (self.0 >> 8usize) & 0x01;
5534 val != 0 4406 val != 0
5535 } 4407 }
5536 #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4408 #[doc = "Fm+ drive capability on PB6 enable bit"]
5537 pub fn set_dataend(&mut self, val: bool) { 4409 pub fn set_i2c_pb6_fmp(&mut self, val: bool) {
5538 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 4410 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
5539 } 4411 }
5540 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4412 #[doc = "Fm+ drive capability on PB7 enable bit"]
5541 pub const fn dhold(&self) -> bool { 4413 pub const fn i2c_pb7_fmp(&self) -> bool {
5542 let val = (self.0 >> 9usize) & 0x01; 4414 let val = (self.0 >> 9usize) & 0x01;
5543 val != 0 4415 val != 0
5544 } 4416 }
5545 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4417 #[doc = "Fm+ drive capability on PB7 enable bit"]
5546 pub fn set_dhold(&mut self, val: bool) { 4418 pub fn set_i2c_pb7_fmp(&mut self, val: bool) {
5547 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 4419 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
5548 } 4420 }
5549 #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4421 #[doc = "Fm+ drive capability on PB8 enable bit"]
5550 pub const fn dbckend(&self) -> bool { 4422 pub const fn i2c_pb8_fmp(&self) -> bool {
5551 let val = (self.0 >> 10usize) & 0x01; 4423 let val = (self.0 >> 10usize) & 0x01;
5552 val != 0 4424 val != 0
5553 } 4425 }
5554 #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4426 #[doc = "Fm+ drive capability on PB8 enable bit"]
5555 pub fn set_dbckend(&mut self, val: bool) { 4427 pub fn set_i2c_pb8_fmp(&mut self, val: bool) {
5556 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 4428 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
5557 } 4429 }
5558 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4430 #[doc = "Fm+ drive capability on PB9 enable bit"]
5559 pub const fn dabort(&self) -> bool { 4431 pub const fn i2c_pb9_fmp(&self) -> bool {
5560 let val = (self.0 >> 11usize) & 0x01; 4432 let val = (self.0 >> 11usize) & 0x01;
5561 val != 0 4433 val != 0
5562 } 4434 }
5563 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4435 #[doc = "Fm+ drive capability on PB9 enable bit"]
5564 pub fn set_dabort(&mut self, val: bool) { 4436 pub fn set_i2c_pb9_fmp(&mut self, val: bool) {
5565 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 4437 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
5566 } 4438 }
5567 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] 4439 #[doc = "I2C1 Fm+ drive capability enable bit"]
5568 pub const fn dpsmact(&self) -> bool { 4440 pub const fn i2c1_fmp(&self) -> bool {
5569 let val = (self.0 >> 12usize) & 0x01; 4441 let val = (self.0 >> 12usize) & 0x01;
5570 val != 0 4442 val != 0
5571 } 4443 }
5572 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] 4444 #[doc = "I2C1 Fm+ drive capability enable bit"]
5573 pub fn set_dpsmact(&mut self, val: bool) { 4445 pub fn set_i2c1_fmp(&mut self, val: bool) {
5574 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 4446 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
5575 } 4447 }
5576 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] 4448 #[doc = "I2C2 Fm+ drive capability enable bit"]
5577 pub const fn cpsmact(&self) -> bool { 4449 pub const fn i2c2_fmp(&self) -> bool {
5578 let val = (self.0 >> 13usize) & 0x01; 4450 let val = (self.0 >> 13usize) & 0x01;
5579 val != 0 4451 val != 0
5580 } 4452 }
5581 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."] 4453 #[doc = "I2C2 Fm+ drive capability enable bit"]
5582 pub fn set_cpsmact(&mut self, val: bool) { 4454 pub fn set_i2c2_fmp(&mut self, val: bool) {
5583 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 4455 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
5584 } 4456 }
5585 #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."] 4457 #[doc = "I2C3 Fm+ drive capability enable bit"]
5586 pub const fn txfifohe(&self) -> bool { 4458 pub const fn i2c3_fmp(&self) -> bool {
5587 let val = (self.0 >> 14usize) & 0x01; 4459 let val = (self.0 >> 14usize) & 0x01;
5588 val != 0 4460 val != 0
5589 } 4461 }
5590 #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."] 4462 #[doc = "I2C3 Fm+ drive capability enable bit"]
5591 pub fn set_txfifohe(&mut self, val: bool) { 4463 pub fn set_i2c3_fmp(&mut self, val: bool) {
5592 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 4464 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
5593 } 4465 }
5594 #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."] 4466 }
5595 pub const fn rxfifohf(&self) -> bool { 4467 impl Default for Cfgr2 {
5596 let val = (self.0 >> 15usize) & 0x01; 4468 fn default() -> Cfgr2 {
5597 val != 0 4469 Cfgr2(0)
5598 }
5599 #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."]
5600 pub fn set_rxfifohf(&mut self, val: bool) {
5601 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
5602 }
5603 #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."]
5604 pub const fn txfifof(&self) -> bool {
5605 let val = (self.0 >> 16usize) & 0x01;
5606 val != 0
5607 }
5608 #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."]
5609 pub fn set_txfifof(&mut self, val: bool) {
5610 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
5611 }
5612 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
5613 pub const fn rxfifof(&self) -> bool {
5614 let val = (self.0 >> 17usize) & 0x01;
5615 val != 0
5616 }
5617 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
5618 pub fn set_rxfifof(&mut self, val: bool) {
5619 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
5620 }
5621 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
5622 pub const fn txfifoe(&self) -> bool {
5623 let val = (self.0 >> 18usize) & 0x01;
5624 val != 0
5625 }
5626 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
5627 pub fn set_txfifoe(&mut self, val: bool) {
5628 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
5629 }
5630 #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."]
5631 pub const fn rxfifoe(&self) -> bool {
5632 let val = (self.0 >> 19usize) & 0x01;
5633 val != 0
5634 }
5635 #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."]
5636 pub fn set_rxfifoe(&mut self, val: bool) {
5637 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
5638 }
5639 #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."]
5640 pub const fn busyd0(&self) -> bool {
5641 let val = (self.0 >> 20usize) & 0x01;
5642 val != 0
5643 }
5644 #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."]
5645 pub fn set_busyd0(&mut self, val: bool) {
5646 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
5647 }
5648 #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5649 pub const fn busyd0end(&self) -> bool {
5650 let val = (self.0 >> 21usize) & 0x01;
5651 val != 0
5652 }
5653 #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5654 pub fn set_busyd0end(&mut self, val: bool) {
5655 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
5656 }
5657 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5658 pub const fn sdioit(&self) -> bool {
5659 let val = (self.0 >> 22usize) & 0x01;
5660 val != 0
5661 }
5662 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5663 pub fn set_sdioit(&mut self, val: bool) {
5664 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
5665 }
5666 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5667 pub const fn ackfail(&self) -> bool {
5668 let val = (self.0 >> 23usize) & 0x01;
5669 val != 0
5670 }
5671 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5672 pub fn set_ackfail(&mut self, val: bool) {
5673 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
5674 }
5675 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5676 pub const fn acktimeout(&self) -> bool {
5677 let val = (self.0 >> 24usize) & 0x01;
5678 val != 0
5679 }
5680 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5681 pub fn set_acktimeout(&mut self, val: bool) {
5682 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
5683 }
5684 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5685 pub const fn vswend(&self) -> bool {
5686 let val = (self.0 >> 25usize) & 0x01;
5687 val != 0
5688 }
5689 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5690 pub fn set_vswend(&mut self, val: bool) {
5691 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
5692 } 4470 }
5693 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4471 }
5694 pub const fn ckstop(&self) -> bool { 4472 #[doc = "configuration register 1"]
5695 let val = (self.0 >> 26usize) & 0x01; 4473 #[repr(transparent)]
5696 val != 0 4474 #[derive(Copy, Clone, Eq, PartialEq)]
4475 pub struct Cfgr1(pub u32);
4476 impl Cfgr1 {
4477 #[doc = "Memory mapping selection bits"]
4478 pub const fn mem_mode(&self) -> u8 {
4479 let val = (self.0 >> 0usize) & 0x03;
4480 val as u8
5697 } 4481 }
5698 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4482 #[doc = "Memory mapping selection bits"]
5699 pub fn set_ckstop(&mut self, val: bool) { 4483 pub fn set_mem_mode(&mut self, val: u8) {
5700 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); 4484 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
5701 } 4485 }
5702 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4486 #[doc = "User bank swapping"]
5703 pub const fn idmate(&self) -> bool { 4487 pub const fn ufb(&self) -> bool {
5704 let val = (self.0 >> 27usize) & 0x01; 4488 let val = (self.0 >> 3usize) & 0x01;
5705 val != 0 4489 val != 0
5706 } 4490 }
5707 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4491 #[doc = "User bank swapping"]
5708 pub fn set_idmate(&mut self, val: bool) { 4492 pub fn set_ufb(&mut self, val: bool) {
5709 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); 4493 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
5710 } 4494 }
5711 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4495 #[doc = "Boot mode selected by the boot pins status bits"]
5712 pub const fn idmabtc(&self) -> bool { 4496 pub const fn boot_mode(&self) -> u8 {
5713 let val = (self.0 >> 28usize) & 0x01; 4497 let val = (self.0 >> 8usize) & 0x03;
5714 val != 0 4498 val as u8
5715 } 4499 }
5716 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 4500 #[doc = "Boot mode selected by the boot pins status bits"]
5717 pub fn set_idmabtc(&mut self, val: bool) { 4501 pub fn set_boot_mode(&mut self, val: u8) {
5718 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); 4502 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
5719 } 4503 }
5720 } 4504 }
5721 impl Default for Star { 4505 impl Default for Cfgr1 {
5722 fn default() -> Star { 4506 fn default() -> Cfgr1 {
5723 Star(0) 4507 Cfgr1(0)
5724 } 4508 }
5725 } 4509 }
5726 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] 4510 }
5727 #[repr(transparent)] 4511}
5728 #[derive(Copy, Clone, Eq, PartialEq)] 4512pub mod exti_v1 {
5729 pub struct Resp3r(pub u32); 4513 use crate::generic::*;
5730 impl Resp3r { 4514 #[doc = "External interrupt/event controller"]
5731 #[doc = "see Table404."] 4515 #[derive(Copy, Clone)]
5732 pub const fn cardstatus3(&self) -> u32 { 4516 pub struct Exti(pub *mut u8);
5733 let val = (self.0 >> 0usize) & 0xffff_ffff; 4517 unsafe impl Send for Exti {}
5734 val as u32 4518 unsafe impl Sync for Exti {}
5735 } 4519 impl Exti {
5736 #[doc = "see Table404."] 4520 #[doc = "Interrupt mask register (EXTI_IMR)"]
5737 pub fn set_cardstatus3(&mut self, val: u32) { 4521 pub fn imr(self) -> Reg<regs::Imr, RW> {
5738 self.0 = 4522 unsafe { Reg::from_ptr(self.0.add(0usize)) }
5739 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5740 }
5741 } 4523 }
5742 impl Default for Resp3r { 4524 #[doc = "Event mask register (EXTI_EMR)"]
5743 fn default() -> Resp3r { 4525 pub fn emr(self) -> Reg<regs::Emr, RW> {
5744 Resp3r(0) 4526 unsafe { Reg::from_ptr(self.0.add(4usize)) }
5745 }
5746 } 4527 }
5747 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] 4528 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
5748 #[repr(transparent)] 4529 pub fn rtsr(self) -> Reg<regs::Rtsr, RW> {
5749 #[derive(Copy, Clone, Eq, PartialEq)] 4530 unsafe { Reg::from_ptr(self.0.add(8usize)) }
5750 pub struct Resp4r(pub u32);
5751 impl Resp4r {
5752 #[doc = "see Table404."]
5753 pub const fn cardstatus4(&self) -> u32 {
5754 let val = (self.0 >> 0usize) & 0xffff_ffff;
5755 val as u32
5756 }
5757 #[doc = "see Table404."]
5758 pub fn set_cardstatus4(&mut self, val: u32) {
5759 self.0 =
5760 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5761 }
5762 } 4531 }
5763 impl Default for Resp4r { 4532 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
5764 fn default() -> Resp4r { 4533 pub fn ftsr(self) -> Reg<regs::Ftsr, RW> {
5765 Resp4r(0) 4534 unsafe { Reg::from_ptr(self.0.add(12usize)) }
5766 }
5767 } 4535 }
5768 #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."] 4536 #[doc = "Software interrupt event register (EXTI_SWIER)"]
4537 pub fn swier(self) -> Reg<regs::Swier, RW> {
4538 unsafe { Reg::from_ptr(self.0.add(16usize)) }
4539 }
4540 #[doc = "Pending register (EXTI_PR)"]
4541 pub fn pr(self) -> Reg<regs::Pr, RW> {
4542 unsafe { Reg::from_ptr(self.0.add(20usize)) }
4543 }
4544 }
4545 pub mod regs {
4546 use crate::generic::*;
4547 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
5769 #[repr(transparent)] 4548 #[repr(transparent)]
5770 #[derive(Copy, Clone, Eq, PartialEq)] 4549 #[derive(Copy, Clone, Eq, PartialEq)]
5771 pub struct Dlenr(pub u32); 4550 pub struct Ftsr(pub u32);
5772 impl Dlenr { 4551 impl Ftsr {
5773 #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."] 4552 #[doc = "Falling trigger event configuration of line 0"]
5774 pub const fn datalength(&self) -> u32 { 4553 pub fn tr(&self, n: usize) -> super::vals::Tr {
5775 let val = (self.0 >> 0usize) & 0x01ff_ffff; 4554 assert!(n < 23usize);
5776 val as u32 4555 let offs = 0usize + n * 1usize;
4556 let val = (self.0 >> offs) & 0x01;
4557 super::vals::Tr(val as u8)
5777 } 4558 }
5778 #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."] 4559 #[doc = "Falling trigger event configuration of line 0"]
5779 pub fn set_datalength(&mut self, val: u32) { 4560 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) {
5780 self.0 = 4561 assert!(n < 23usize);
5781 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); 4562 let offs = 0usize + n * 1usize;
4563 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
5782 } 4564 }
5783 } 4565 }
5784 impl Default for Dlenr { 4566 impl Default for Ftsr {
5785 fn default() -> Dlenr { 4567 fn default() -> Ftsr {
5786 Dlenr(0) 4568 Ftsr(0)
5787 } 4569 }
5788 } 4570 }
5789 #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."] 4571 #[doc = "Software interrupt event register (EXTI_SWIER)"]
5790 #[repr(transparent)] 4572 #[repr(transparent)]
5791 #[derive(Copy, Clone, Eq, PartialEq)] 4573 #[derive(Copy, Clone, Eq, PartialEq)]
5792 pub struct Acktimer(pub u32); 4574 pub struct Swier(pub u32);
5793 impl Acktimer { 4575 impl Swier {
5794 #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."] 4576 #[doc = "Software Interrupt on line 0"]
5795 pub const fn acktime(&self) -> u32 { 4577 pub fn swier(&self, n: usize) -> bool {
5796 let val = (self.0 >> 0usize) & 0x01ff_ffff; 4578 assert!(n < 23usize);
5797 val as u32 4579 let offs = 0usize + n * 1usize;
4580 let val = (self.0 >> offs) & 0x01;
4581 val != 0
5798 } 4582 }
5799 #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."] 4583 #[doc = "Software Interrupt on line 0"]
5800 pub fn set_acktime(&mut self, val: u32) { 4584 pub fn set_swier(&mut self, n: usize, val: bool) {
5801 self.0 = 4585 assert!(n < 23usize);
5802 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); 4586 let offs = 0usize + n * 1usize;
4587 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
5803 } 4588 }
5804 } 4589 }
5805 impl Default for Acktimer { 4590 impl Default for Swier {
5806 fn default() -> Acktimer { 4591 fn default() -> Swier {
5807 Acktimer(0) 4592 Swier(0)
5808 } 4593 }
5809 } 4594 }
5810 #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] 4595 #[doc = "Event mask register (EXTI_EMR)"]
5811 #[repr(transparent)] 4596 #[repr(transparent)]
5812 #[derive(Copy, Clone, Eq, PartialEq)] 4597 #[derive(Copy, Clone, Eq, PartialEq)]
5813 pub struct Idmabase1r(pub u32); 4598 pub struct Emr(pub u32);
5814 impl Idmabase1r { 4599 impl Emr {
5815 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] 4600 #[doc = "Event Mask on line 0"]
5816are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."] 4601 pub fn mr(&self, n: usize) -> super::vals::Mr {
5817 pub const fn idmabase1(&self) -> u32 { 4602 assert!(n < 23usize);
5818 let val = (self.0 >> 0usize) & 0xffff_ffff; 4603 let offs = 0usize + n * 1usize;
5819 val as u32 4604 let val = (self.0 >> offs) & 0x01;
4605 super::vals::Mr(val as u8)
5820 } 4606 }
5821 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] 4607 #[doc = "Event Mask on line 0"]
5822are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."] 4608 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) {
5823 pub fn set_idmabase1(&mut self, val: u32) { 4609 assert!(n < 23usize);
5824 self.0 = 4610 let offs = 0usize + n * 1usize;
5825 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 4611 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
5826 } 4612 }
5827 } 4613 }
5828 impl Default for Idmabase1r { 4614 impl Default for Emr {
5829 fn default() -> Idmabase1r { 4615 fn default() -> Emr {
5830 Idmabase1r(0) 4616 Emr(0)
5831 } 4617 }
5832 } 4618 }
5833 #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] 4619 #[doc = "Pending register (EXTI_PR)"]
5834 #[repr(transparent)] 4620 #[repr(transparent)]
5835 #[derive(Copy, Clone, Eq, PartialEq)] 4621 #[derive(Copy, Clone, Eq, PartialEq)]
5836 pub struct Idmabsizer(pub u32); 4622 pub struct Pr(pub u32);
5837 impl Idmabsizer { 4623 impl Pr {
5838 #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 4624 #[doc = "Pending bit 0"]
5839 pub const fn idmabndt(&self) -> u8 { 4625 pub fn pr(&self, n: usize) -> bool {
5840 let val = (self.0 >> 5usize) & 0xff; 4626 assert!(n < 23usize);
5841 val as u8 4627 let offs = 0usize + n * 1usize;
4628 let val = (self.0 >> offs) & 0x01;
4629 val != 0
5842 } 4630 }
5843 #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 4631 #[doc = "Pending bit 0"]
5844 pub fn set_idmabndt(&mut self, val: u8) { 4632 pub fn set_pr(&mut self, n: usize, val: bool) {
5845 self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize); 4633 assert!(n < 23usize);
4634 let offs = 0usize + n * 1usize;
4635 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
5846 } 4636 }
5847 } 4637 }
5848 impl Default for Idmabsizer { 4638 impl Default for Pr {
5849 fn default() -> Idmabsizer { 4639 fn default() -> Pr {
5850 Idmabsizer(0) 4640 Pr(0)
5851 } 4641 }
5852 } 4642 }
5853 #[doc = "SDMMC IP identification register"] 4643 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
5854 #[repr(transparent)] 4644 #[repr(transparent)]
5855 #[derive(Copy, Clone, Eq, PartialEq)] 4645 #[derive(Copy, Clone, Eq, PartialEq)]
5856 pub struct Id(pub u32); 4646 pub struct Rtsr(pub u32);
5857 impl Id { 4647 impl Rtsr {
5858 #[doc = "SDMMC IP identification."] 4648 #[doc = "Rising trigger event configuration of line 0"]
5859 pub const fn ip_id(&self) -> u32 { 4649 pub fn tr(&self, n: usize) -> super::vals::Tr {
5860 let val = (self.0 >> 0usize) & 0xffff_ffff; 4650 assert!(n < 23usize);
5861 val as u32 4651 let offs = 0usize + n * 1usize;
4652 let val = (self.0 >> offs) & 0x01;
4653 super::vals::Tr(val as u8)
5862 } 4654 }
5863 #[doc = "SDMMC IP identification."] 4655 #[doc = "Rising trigger event configuration of line 0"]
5864 pub fn set_ip_id(&mut self, val: u32) { 4656 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) {
5865 self.0 = 4657 assert!(n < 23usize);
5866 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 4658 let offs = 0usize + n * 1usize;
4659 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
5867 } 4660 }
5868 } 4661 }
5869 impl Default for Id { 4662 impl Default for Rtsr {
5870 fn default() -> Id { 4663 fn default() -> Rtsr {
5871 Id(0) 4664 Rtsr(0)
5872 } 4665 }
5873 } 4666 }
5874 #[doc = "SDMMC command response register"] 4667 #[doc = "Interrupt mask register (EXTI_IMR)"]
5875 #[repr(transparent)] 4668 #[repr(transparent)]
5876 #[derive(Copy, Clone, Eq, PartialEq)] 4669 #[derive(Copy, Clone, Eq, PartialEq)]
5877 pub struct Respcmdr(pub u32); 4670 pub struct Imr(pub u32);
5878 impl Respcmdr { 4671 impl Imr {
5879 #[doc = "Response command index"] 4672 #[doc = "Interrupt Mask on line 0"]
5880 pub const fn respcmd(&self) -> u8 { 4673 pub fn mr(&self, n: usize) -> super::vals::Mr {
5881 let val = (self.0 >> 0usize) & 0x3f; 4674 assert!(n < 23usize);
5882 val as u8 4675 let offs = 0usize + n * 1usize;
4676 let val = (self.0 >> offs) & 0x01;
4677 super::vals::Mr(val as u8)
5883 } 4678 }
5884 #[doc = "Response command index"] 4679 #[doc = "Interrupt Mask on line 0"]
5885 pub fn set_respcmd(&mut self, val: u8) { 4680 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) {
5886 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); 4681 assert!(n < 23usize);
4682 let offs = 0usize + n * 1usize;
4683 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
5887 } 4684 }
5888 } 4685 }
5889 impl Default for Respcmdr { 4686 impl Default for Imr {
5890 fn default() -> Respcmdr { 4687 fn default() -> Imr {
5891 Respcmdr(0) 4688 Imr(0)
5892 } 4689 }
5893 } 4690 }
5894 #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."] 4691 }
4692 pub mod vals {
4693 use crate::generic::*;
5895 #[repr(transparent)] 4694 #[repr(transparent)]
5896 #[derive(Copy, Clone, Eq, PartialEq)] 4695 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5897 pub struct Cmdr(pub u32); 4696 pub struct Mr(pub u8);
5898 impl Cmdr { 4697 impl Mr {
5899 #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."] 4698 #[doc = "Interrupt request line is masked"]
5900 pub const fn cmdindex(&self) -> u8 { 4699 pub const MASKED: Self = Self(0);
5901 let val = (self.0 >> 0usize) & 0x3f; 4700 #[doc = "Interrupt request line is unmasked"]
5902 val as u8 4701 pub const UNMASKED: Self = Self(0x01);
5903 }
5904 #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."]
5905 pub fn set_cmdindex(&mut self, val: u8) {
5906 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
5907 }
5908 #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."]
5909 pub const fn cmdtrans(&self) -> bool {
5910 let val = (self.0 >> 6usize) & 0x01;
5911 val != 0
5912 }
5913 #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."]
5914 pub fn set_cmdtrans(&mut self, val: bool) {
5915 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
5916 }
5917 #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."]
5918 pub const fn cmdstop(&self) -> bool {
5919 let val = (self.0 >> 7usize) & 0x01;
5920 val != 0
5921 }
5922 #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."]
5923 pub fn set_cmdstop(&mut self, val: bool) {
5924 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
5925 }
5926 #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."]
5927 pub const fn waitresp(&self) -> u8 {
5928 let val = (self.0 >> 8usize) & 0x03;
5929 val as u8
5930 }
5931 #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."]
5932 pub fn set_waitresp(&mut self, val: u8) {
5933 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
5934 }
5935 #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."]
5936 pub const fn waitint(&self) -> bool {
5937 let val = (self.0 >> 10usize) & 0x01;
5938 val != 0
5939 }
5940 #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."]
5941 pub fn set_waitint(&mut self, val: bool) {
5942 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
5943 }
5944 #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."]
5945 pub const fn waitpend(&self) -> bool {
5946 let val = (self.0 >> 11usize) & 0x01;
5947 val != 0
5948 }
5949 #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."]
5950 pub fn set_waitpend(&mut self, val: bool) {
5951 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
5952 }
5953 #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."]
5954 pub const fn cpsmen(&self) -> bool {
5955 let val = (self.0 >> 12usize) & 0x01;
5956 val != 0
5957 }
5958 #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."]
5959 pub fn set_cpsmen(&mut self, val: bool) {
5960 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
5961 }
5962 #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."]
5963 pub const fn dthold(&self) -> bool {
5964 let val = (self.0 >> 13usize) & 0x01;
5965 val != 0
5966 }
5967 #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."]
5968 pub fn set_dthold(&mut self, val: bool) {
5969 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
5970 }
5971 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
5972 pub const fn bootmode(&self) -> bool {
5973 let val = (self.0 >> 14usize) & 0x01;
5974 val != 0
5975 }
5976 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
5977 pub fn set_bootmode(&mut self, val: bool) {
5978 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
5979 }
5980 #[doc = "Enable boot mode procedure."]
5981 pub const fn booten(&self) -> bool {
5982 let val = (self.0 >> 15usize) & 0x01;
5983 val != 0
5984 }
5985 #[doc = "Enable boot mode procedure."]
5986 pub fn set_booten(&mut self, val: bool) {
5987 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
5988 }
5989 #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."]
5990 pub const fn cmdsuspend(&self) -> bool {
5991 let val = (self.0 >> 16usize) & 0x01;
5992 val != 0
5993 }
5994 #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."]
5995 pub fn set_cmdsuspend(&mut self, val: bool) {
5996 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
5997 }
5998 } 4702 }
5999 impl Default for Cmdr { 4703 #[repr(transparent)]
6000 fn default() -> Cmdr { 4704 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6001 Cmdr(0) 4705 pub struct Prw(pub u8);
6002 } 4706 impl Prw {
4707 #[doc = "Clears pending bit"]
4708 pub const CLEAR: Self = Self(0x01);
6003 } 4709 }
6004 #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."]
6005 #[repr(transparent)] 4710 #[repr(transparent)]
6006 #[derive(Copy, Clone, Eq, PartialEq)] 4711 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6007 pub struct Dctrl(pub u32); 4712 pub struct Tr(pub u8);
6008 impl Dctrl { 4713 impl Tr {
6009 #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."] 4714 #[doc = "Falling edge trigger is disabled"]
6010 pub const fn dten(&self) -> bool { 4715 pub const DISABLED: Self = Self(0);
6011 let val = (self.0 >> 0usize) & 0x01; 4716 #[doc = "Falling edge trigger is enabled"]
6012 val != 0 4717 pub const ENABLED: Self = Self(0x01);
6013 }
6014 #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."]
6015 pub fn set_dten(&mut self, val: bool) {
6016 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6017 }
6018 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6019 pub const fn dtdir(&self) -> bool {
6020 let val = (self.0 >> 1usize) & 0x01;
6021 val != 0
6022 }
6023 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6024 pub fn set_dtdir(&mut self, val: bool) {
6025 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
6026 }
6027 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6028 pub const fn dtmode(&self) -> u8 {
6029 let val = (self.0 >> 2usize) & 0x03;
6030 val as u8
6031 }
6032 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6033 pub fn set_dtmode(&mut self, val: u8) {
6034 self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize);
6035 }
6036 #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"]
6037 pub const fn dblocksize(&self) -> u8 {
6038 let val = (self.0 >> 4usize) & 0x0f;
6039 val as u8
6040 }
6041 #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"]
6042 pub fn set_dblocksize(&mut self, val: u8) {
6043 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
6044 }
6045 #[doc = "Read wait start. If this bit is set, read wait operation starts."]
6046 pub const fn rwstart(&self) -> bool {
6047 let val = (self.0 >> 8usize) & 0x01;
6048 val != 0
6049 }
6050 #[doc = "Read wait start. If this bit is set, read wait operation starts."]
6051 pub fn set_rwstart(&mut self, val: bool) {
6052 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
6053 }
6054 #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."]
6055 pub const fn rwstop(&self) -> bool {
6056 let val = (self.0 >> 9usize) & 0x01;
6057 val != 0
6058 }
6059 #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."]
6060 pub fn set_rwstop(&mut self, val: bool) {
6061 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
6062 }
6063 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6064 pub const fn rwmod(&self) -> bool {
6065 let val = (self.0 >> 10usize) & 0x01;
6066 val != 0
6067 }
6068 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6069 pub fn set_rwmod(&mut self, val: bool) {
6070 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
6071 }
6072 #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."]
6073 pub const fn sdioen(&self) -> bool {
6074 let val = (self.0 >> 11usize) & 0x01;
6075 val != 0
6076 }
6077 #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."]
6078 pub fn set_sdioen(&mut self, val: bool) {
6079 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
6080 }
6081 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6082 pub const fn bootacken(&self) -> bool {
6083 let val = (self.0 >> 12usize) & 0x01;
6084 val != 0
6085 }
6086 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6087 pub fn set_bootacken(&mut self, val: bool) {
6088 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
6089 }
6090 #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."]
6091 pub const fn fiforst(&self) -> bool {
6092 let val = (self.0 >> 13usize) & 0x01;
6093 val != 0
6094 }
6095 #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."]
6096 pub fn set_fiforst(&mut self, val: bool) {
6097 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
6098 }
6099 } 4718 }
6100 impl Default for Dctrl { 4719 #[repr(transparent)]
6101 fn default() -> Dctrl { 4720 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6102 Dctrl(0) 4721 pub struct Swierw(pub u8);
6103 } 4722 impl Swierw {
4723 #[doc = "Generates an interrupt request"]
4724 pub const PEND: Self = Self(0x01);
6104 } 4725 }
6105 #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."]
6106 #[repr(transparent)] 4726 #[repr(transparent)]
6107 #[derive(Copy, Clone, Eq, PartialEq)] 4727 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6108 pub struct Idmactrlr(pub u32); 4728 pub struct Prr(pub u8);
6109 impl Idmactrlr { 4729 impl Prr {
6110 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 4730 #[doc = "No trigger request occurred"]
6111 pub const fn idmaen(&self) -> bool { 4731 pub const NOTPENDING: Self = Self(0);
6112 let val = (self.0 >> 0usize) & 0x01; 4732 #[doc = "Selected trigger request occurred"]
6113 val != 0 4733 pub const PENDING: Self = Self(0x01);
6114 }
6115 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6116 pub fn set_idmaen(&mut self, val: bool) {
6117 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6118 }
6119 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6120 pub const fn idmabmode(&self) -> bool {
6121 let val = (self.0 >> 1usize) & 0x01;
6122 val != 0
6123 }
6124 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6125 pub fn set_idmabmode(&mut self, val: bool) {
6126 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
6127 }
6128 #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."]
6129 pub const fn idmabact(&self) -> bool {
6130 let val = (self.0 >> 2usize) & 0x01;
6131 val != 0
6132 }
6133 #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."]
6134 pub fn set_idmabact(&mut self, val: bool) {
6135 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
6136 }
6137 } 4734 }
6138 impl Default for Idmactrlr { 4735 }
6139 fn default() -> Idmactrlr { 4736}
6140 Idmactrlr(0) 4737pub mod spi_v3 {
6141 } 4738 use crate::generic::*;
4739 #[doc = "Serial peripheral interface"]
4740 #[derive(Copy, Clone)]
4741 pub struct Spi(pub *mut u8);
4742 unsafe impl Send for Spi {}
4743 unsafe impl Sync for Spi {}
4744 impl Spi {
4745 #[doc = "control register 1"]
4746 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
4747 unsafe { Reg::from_ptr(self.0.add(0usize)) }
6142 } 4748 }
6143 #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."] 4749 #[doc = "control register 2"]
4750 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
4751 unsafe { Reg::from_ptr(self.0.add(4usize)) }
4752 }
4753 #[doc = "configuration register 1"]
4754 pub fn cfg1(self) -> Reg<regs::Cfg1, RW> {
4755 unsafe { Reg::from_ptr(self.0.add(8usize)) }
4756 }
4757 #[doc = "configuration register 2"]
4758 pub fn cfg2(self) -> Reg<regs::Cfg2, RW> {
4759 unsafe { Reg::from_ptr(self.0.add(12usize)) }
4760 }
4761 #[doc = "Interrupt Enable Register"]
4762 pub fn ier(self) -> Reg<regs::Ier, RW> {
4763 unsafe { Reg::from_ptr(self.0.add(16usize)) }
4764 }
4765 #[doc = "Status Register"]
4766 pub fn sr(self) -> Reg<regs::Sr, R> {
4767 unsafe { Reg::from_ptr(self.0.add(20usize)) }
4768 }
4769 #[doc = "Interrupt/Status Flags Clear Register"]
4770 pub fn ifcr(self) -> Reg<regs::Ifcr, W> {
4771 unsafe { Reg::from_ptr(self.0.add(24usize)) }
4772 }
4773 #[doc = "Transmit Data Register"]
4774 pub fn txdr(self) -> Reg<regs::Txdr, W> {
4775 unsafe { Reg::from_ptr(self.0.add(32usize)) }
4776 }
4777 #[doc = "Receive Data Register"]
4778 pub fn rxdr(self) -> Reg<regs::Rxdr, R> {
4779 unsafe { Reg::from_ptr(self.0.add(48usize)) }
4780 }
4781 #[doc = "Polynomial Register"]
4782 pub fn crcpoly(self) -> Reg<regs::Crcpoly, RW> {
4783 unsafe { Reg::from_ptr(self.0.add(64usize)) }
4784 }
4785 #[doc = "Transmitter CRC Register"]
4786 pub fn txcrc(self) -> Reg<regs::Txcrc, RW> {
4787 unsafe { Reg::from_ptr(self.0.add(68usize)) }
4788 }
4789 #[doc = "Receiver CRC Register"]
4790 pub fn rxcrc(self) -> Reg<regs::Rxcrc, RW> {
4791 unsafe { Reg::from_ptr(self.0.add(72usize)) }
4792 }
4793 #[doc = "Underrun Data Register"]
4794 pub fn udrdr(self) -> Reg<regs::Udrdr, RW> {
4795 unsafe { Reg::from_ptr(self.0.add(76usize)) }
4796 }
4797 }
4798 pub mod regs {
4799 use crate::generic::*;
4800 #[doc = "Underrun Data Register"]
6144 #[repr(transparent)] 4801 #[repr(transparent)]
6145 #[derive(Copy, Clone, Eq, PartialEq)] 4802 #[derive(Copy, Clone, Eq, PartialEq)]
6146 pub struct Idmabase0r(pub u32); 4803 pub struct Udrdr(pub u32);
6147 impl Idmabase0r { 4804 impl Udrdr {
6148 #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] 4805 #[doc = "Data at slave underrun condition"]
6149are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."] 4806 pub const fn udrdr(&self) -> u32 {
6150 pub const fn idmabase0(&self) -> u32 {
6151 let val = (self.0 >> 0usize) & 0xffff_ffff; 4807 let val = (self.0 >> 0usize) & 0xffff_ffff;
6152 val as u32 4808 val as u32
6153 } 4809 }
6154 #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0] 4810 #[doc = "Data at slave underrun condition"]
6155are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."] 4811 pub fn set_udrdr(&mut self, val: u32) {
6156 pub fn set_idmabase0(&mut self, val: u32) {
6157 self.0 = 4812 self.0 =
6158 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 4813 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
6159 } 4814 }
6160 } 4815 }
6161 impl Default for Idmabase0r { 4816 impl Default for Udrdr {
6162 fn default() -> Idmabase0r { 4817 fn default() -> Udrdr {
6163 Idmabase0r(0) 4818 Udrdr(0)
6164 } 4819 }
6165 } 4820 }
6166 #[doc = "SDMMC power control register"] 4821 #[doc = "Transmit Data Register"]
6167 #[repr(transparent)] 4822 #[repr(transparent)]
6168 #[derive(Copy, Clone, Eq, PartialEq)] 4823 #[derive(Copy, Clone, Eq, PartialEq)]
6169 pub struct Power(pub u32); 4824 pub struct Txdr(pub u32);
6170 impl Power { 4825 impl Txdr {
6171 #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."] 4826 #[doc = "Transmit data register"]
6172 pub const fn pwrctrl(&self) -> u8 { 4827 pub const fn txdr(&self) -> u32 {
6173 let val = (self.0 >> 0usize) & 0x03; 4828 let val = (self.0 >> 0usize) & 0xffff_ffff;
6174 val as u8 4829 val as u32
6175 }
6176 #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."]
6177 pub fn set_pwrctrl(&mut self, val: u8) {
6178 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
6179 }
6180 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
6181 pub const fn vswitch(&self) -> bool {
6182 let val = (self.0 >> 2usize) & 0x01;
6183 val != 0
6184 }
6185 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
6186 pub fn set_vswitch(&mut self, val: bool) {
6187 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
6188 }
6189 #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"]
6190 pub const fn vswitchen(&self) -> bool {
6191 let val = (self.0 >> 3usize) & 0x01;
6192 val != 0
6193 }
6194 #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"]
6195 pub fn set_vswitchen(&mut self, val: bool) {
6196 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
6197 }
6198 #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."]
6199 pub const fn dirpol(&self) -> bool {
6200 let val = (self.0 >> 4usize) & 0x01;
6201 val != 0
6202 } 4830 }
6203 #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."] 4831 #[doc = "Transmit data register"]
6204 pub fn set_dirpol(&mut self, val: bool) { 4832 pub fn set_txdr(&mut self, val: u32) {
6205 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 4833 self.0 =
4834 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
6206 } 4835 }
6207 } 4836 }
6208 impl Default for Power { 4837 impl Default for Txdr {
6209 fn default() -> Power { 4838 fn default() -> Txdr {
6210 Power(0) 4839 Txdr(0)
6211 } 4840 }
6212 } 4841 }
6213 #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."] 4842 #[doc = "Interrupt Enable Register"]
6214 #[repr(transparent)] 4843 #[repr(transparent)]
6215 #[derive(Copy, Clone, Eq, PartialEq)] 4844 #[derive(Copy, Clone, Eq, PartialEq)]
6216 pub struct Icr(pub u32); 4845 pub struct Ier(pub u32);
6217 impl Icr { 4846 impl Ier {
6218 #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] 4847 #[doc = "RXP Interrupt Enable"]
6219 pub const fn ccrcfailc(&self) -> bool { 4848 pub const fn rxpie(&self) -> bool {
6220 let val = (self.0 >> 0usize) & 0x01; 4849 let val = (self.0 >> 0usize) & 0x01;
6221 val != 0 4850 val != 0
6222 } 4851 }
6223 #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."] 4852 #[doc = "RXP Interrupt Enable"]
6224 pub fn set_ccrcfailc(&mut self, val: bool) { 4853 pub fn set_rxpie(&mut self, val: bool) {
6225 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 4854 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6226 } 4855 }
6227 #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] 4856 #[doc = "TXP interrupt enable"]
6228 pub const fn dcrcfailc(&self) -> bool { 4857 pub const fn txpie(&self) -> bool {
6229 let val = (self.0 >> 1usize) & 0x01; 4858 let val = (self.0 >> 1usize) & 0x01;
6230 val != 0 4859 val != 0
6231 } 4860 }
6232 #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."] 4861 #[doc = "TXP interrupt enable"]
6233 pub fn set_dcrcfailc(&mut self, val: bool) { 4862 pub fn set_txpie(&mut self, val: bool) {
6234 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 4863 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
6235 } 4864 }
6236 #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] 4865 #[doc = "DXP interrupt enabled"]
6237 pub const fn ctimeoutc(&self) -> bool { 4866 pub const fn dxpie(&self) -> bool {
6238 let val = (self.0 >> 2usize) & 0x01; 4867 let val = (self.0 >> 2usize) & 0x01;
6239 val != 0 4868 val != 0
6240 } 4869 }
6241 #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."] 4870 #[doc = "DXP interrupt enabled"]
6242 pub fn set_ctimeoutc(&mut self, val: bool) { 4871 pub fn set_dxpie(&mut self, val: bool) {
6243 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 4872 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
6244 } 4873 }
6245 #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] 4874 #[doc = "EOT, SUSP and TXC interrupt enable"]
6246 pub const fn dtimeoutc(&self) -> bool { 4875 pub const fn eotie(&self) -> bool {
6247 let val = (self.0 >> 3usize) & 0x01; 4876 let val = (self.0 >> 3usize) & 0x01;
6248 val != 0 4877 val != 0
6249 } 4878 }
6250 #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."] 4879 #[doc = "EOT, SUSP and TXC interrupt enable"]
6251 pub fn set_dtimeoutc(&mut self, val: bool) { 4880 pub fn set_eotie(&mut self, val: bool) {
6252 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 4881 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
6253 } 4882 }
6254 #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] 4883 #[doc = "TXTFIE interrupt enable"]
6255 pub const fn txunderrc(&self) -> bool { 4884 pub const fn txtfie(&self) -> bool {
6256 let val = (self.0 >> 4usize) & 0x01; 4885 let val = (self.0 >> 4usize) & 0x01;
6257 val != 0 4886 val != 0
6258 } 4887 }
6259 #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."] 4888 #[doc = "TXTFIE interrupt enable"]
6260 pub fn set_txunderrc(&mut self, val: bool) { 4889 pub fn set_txtfie(&mut self, val: bool) {
6261 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 4890 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
6262 } 4891 }
6263 #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] 4892 #[doc = "UDR interrupt enable"]
6264 pub const fn rxoverrc(&self) -> bool { 4893 pub const fn udrie(&self) -> bool {
6265 let val = (self.0 >> 5usize) & 0x01; 4894 let val = (self.0 >> 5usize) & 0x01;
6266 val != 0 4895 val != 0
6267 } 4896 }
6268 #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."] 4897 #[doc = "UDR interrupt enable"]
6269 pub fn set_rxoverrc(&mut self, val: bool) { 4898 pub fn set_udrie(&mut self, val: bool) {
6270 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 4899 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
6271 } 4900 }
6272 #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] 4901 #[doc = "OVR interrupt enable"]
6273 pub const fn cmdrendc(&self) -> bool { 4902 pub const fn ovrie(&self) -> bool {
6274 let val = (self.0 >> 6usize) & 0x01; 4903 let val = (self.0 >> 6usize) & 0x01;
6275 val != 0 4904 val != 0
6276 } 4905 }
6277 #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."] 4906 #[doc = "OVR interrupt enable"]
6278 pub fn set_cmdrendc(&mut self, val: bool) { 4907 pub fn set_ovrie(&mut self, val: bool) {
6279 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 4908 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
6280 } 4909 }
6281 #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] 4910 #[doc = "CRC Interrupt enable"]
6282 pub const fn cmdsentc(&self) -> bool { 4911 pub const fn crceie(&self) -> bool {
6283 let val = (self.0 >> 7usize) & 0x01; 4912 let val = (self.0 >> 7usize) & 0x01;
6284 val != 0 4913 val != 0
6285 } 4914 }
6286 #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."] 4915 #[doc = "CRC Interrupt enable"]
6287 pub fn set_cmdsentc(&mut self, val: bool) { 4916 pub fn set_crceie(&mut self, val: bool) {
6288 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 4917 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
6289 } 4918 }
6290 #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] 4919 #[doc = "TIFRE interrupt enable"]
6291 pub const fn dataendc(&self) -> bool { 4920 pub const fn tifreie(&self) -> bool {
6292 let val = (self.0 >> 8usize) & 0x01; 4921 let val = (self.0 >> 8usize) & 0x01;
6293 val != 0 4922 val != 0
6294 } 4923 }
6295 #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."] 4924 #[doc = "TIFRE interrupt enable"]
6296 pub fn set_dataendc(&mut self, val: bool) { 4925 pub fn set_tifreie(&mut self, val: bool) {
6297 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 4926 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
6298 } 4927 }
6299 #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] 4928 #[doc = "Mode Fault interrupt enable"]
6300 pub const fn dholdc(&self) -> bool { 4929 pub const fn modfie(&self) -> bool {
6301 let val = (self.0 >> 9usize) & 0x01; 4930 let val = (self.0 >> 9usize) & 0x01;
6302 val != 0 4931 val != 0
6303 } 4932 }
6304 #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."] 4933 #[doc = "Mode Fault interrupt enable"]
6305 pub fn set_dholdc(&mut self, val: bool) { 4934 pub fn set_modfie(&mut self, val: bool) {
6306 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 4935 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
6307 } 4936 }
6308 #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] 4937 #[doc = "Additional number of transactions reload interrupt enable"]
6309 pub const fn dbckendc(&self) -> bool { 4938 pub const fn tserfie(&self) -> bool {
6310 let val = (self.0 >> 10usize) & 0x01; 4939 let val = (self.0 >> 10usize) & 0x01;
6311 val != 0 4940 val != 0
6312 } 4941 }
6313 #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."] 4942 #[doc = "Additional number of transactions reload interrupt enable"]
6314 pub fn set_dbckendc(&mut self, val: bool) { 4943 pub fn set_tserfie(&mut self, val: bool) {
6315 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 4944 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
6316 } 4945 }
6317 #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."]
6318 pub const fn dabortc(&self) -> bool {
6319 let val = (self.0 >> 11usize) & 0x01;
6320 val != 0
6321 }
6322 #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."]
6323 pub fn set_dabortc(&mut self, val: bool) {
6324 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
6325 }
6326 #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."]
6327 pub const fn busyd0endc(&self) -> bool {
6328 let val = (self.0 >> 21usize) & 0x01;
6329 val != 0
6330 }
6331 #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."]
6332 pub fn set_busyd0endc(&mut self, val: bool) {
6333 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
6334 }
6335 #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."]
6336 pub const fn sdioitc(&self) -> bool {
6337 let val = (self.0 >> 22usize) & 0x01;
6338 val != 0
6339 }
6340 #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."]
6341 pub fn set_sdioitc(&mut self, val: bool) {
6342 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
6343 }
6344 #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."]
6345 pub const fn ackfailc(&self) -> bool {
6346 let val = (self.0 >> 23usize) & 0x01;
6347 val != 0
6348 }
6349 #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."]
6350 pub fn set_ackfailc(&mut self, val: bool) {
6351 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
6352 }
6353 #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."]
6354 pub const fn acktimeoutc(&self) -> bool {
6355 let val = (self.0 >> 24usize) & 0x01;
6356 val != 0
6357 }
6358 #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."]
6359 pub fn set_acktimeoutc(&mut self, val: bool) {
6360 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
6361 }
6362 #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."]
6363 pub const fn vswendc(&self) -> bool {
6364 let val = (self.0 >> 25usize) & 0x01;
6365 val != 0
6366 }
6367 #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."]
6368 pub fn set_vswendc(&mut self, val: bool) {
6369 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
6370 }
6371 #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."]
6372 pub const fn ckstopc(&self) -> bool {
6373 let val = (self.0 >> 26usize) & 0x01;
6374 val != 0
6375 }
6376 #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."]
6377 pub fn set_ckstopc(&mut self, val: bool) {
6378 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
6379 }
6380 #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."]
6381 pub const fn idmatec(&self) -> bool {
6382 let val = (self.0 >> 27usize) & 0x01;
6383 val != 0
6384 }
6385 #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."]
6386 pub fn set_idmatec(&mut self, val: bool) {
6387 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
6388 }
6389 #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."]
6390 pub const fn idmabtcc(&self) -> bool {
6391 let val = (self.0 >> 28usize) & 0x01;
6392 val != 0
6393 }
6394 #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."]
6395 pub fn set_idmabtcc(&mut self, val: bool) {
6396 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
6397 }
6398 } 4946 }
6399 impl Default for Icr { 4947 impl Default for Ier {
6400 fn default() -> Icr { 4948 fn default() -> Ier {
6401 Icr(0) 4949 Ier(0)
6402 } 4950 }
6403 } 4951 }
6404 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] 4952 #[doc = "Receive Data Register"]
6405 #[repr(transparent)] 4953 #[repr(transparent)]
6406 #[derive(Copy, Clone, Eq, PartialEq)] 4954 #[derive(Copy, Clone, Eq, PartialEq)]
6407 pub struct Resp1r(pub u32); 4955 pub struct Rxdr(pub u32);
6408 impl Resp1r { 4956 impl Rxdr {
6409 #[doc = "see Table 432"] 4957 #[doc = "Receive data register"]
6410 pub const fn cardstatus1(&self) -> u32 { 4958 pub const fn rxdr(&self) -> u32 {
6411 let val = (self.0 >> 0usize) & 0xffff_ffff; 4959 let val = (self.0 >> 0usize) & 0xffff_ffff;
6412 val as u32 4960 val as u32
6413 } 4961 }
6414 #[doc = "see Table 432"] 4962 #[doc = "Receive data register"]
6415 pub fn set_cardstatus1(&mut self, val: u32) { 4963 pub fn set_rxdr(&mut self, val: u32) {
6416 self.0 = 4964 self.0 =
6417 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 4965 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
6418 } 4966 }
6419 } 4967 }
6420 impl Default for Resp1r { 4968 impl Default for Rxdr {
6421 fn default() -> Resp1r { 4969 fn default() -> Rxdr {
6422 Resp1r(0) 4970 Rxdr(0)
6423 } 4971 }
6424 } 4972 }
6425 #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."] 4973 #[doc = "control register 1"]
6426 #[repr(transparent)] 4974 #[repr(transparent)]
6427 #[derive(Copy, Clone, Eq, PartialEq)] 4975 #[derive(Copy, Clone, Eq, PartialEq)]
6428 pub struct Dtimer(pub u32); 4976 pub struct Cr1(pub u32);
6429 impl Dtimer { 4977 impl Cr1 {
6430 #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."] 4978 #[doc = "Serial Peripheral Enable"]
6431 pub const fn datatime(&self) -> u32 { 4979 pub const fn spe(&self) -> bool {
6432 let val = (self.0 >> 0usize) & 0xffff_ffff; 4980 let val = (self.0 >> 0usize) & 0x01;
6433 val as u32 4981 val != 0
6434 }
6435 #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."]
6436 pub fn set_datatime(&mut self, val: u32) {
6437 self.0 =
6438 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
6439 } 4982 }
6440 } 4983 #[doc = "Serial Peripheral Enable"]
6441 impl Default for Dtimer { 4984 pub fn set_spe(&mut self, val: bool) {
6442 fn default() -> Dtimer { 4985 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6443 Dtimer(0)
6444 } 4986 }
6445 } 4987 #[doc = "Master automatic SUSP in Receive mode"]
6446 } 4988 pub const fn masrx(&self) -> bool {
6447} 4989 let val = (self.0 >> 8usize) & 0x01;
6448pub mod dbgmcu_h7 {
6449 use crate::generic::*;
6450 #[doc = "Debug support"]
6451 #[derive(Copy, Clone)]
6452 pub struct Dbgmcu(pub *mut u8);
6453 unsafe impl Send for Dbgmcu {}
6454 unsafe impl Sync for Dbgmcu {}
6455 impl Dbgmcu {
6456 #[doc = "Identity code"]
6457 pub fn idc(self) -> Reg<regs::Idc, R> {
6458 unsafe { Reg::from_ptr(self.0.add(0usize)) }
6459 }
6460 #[doc = "Configuration register"]
6461 pub fn cr(self) -> Reg<regs::Cr, RW> {
6462 unsafe { Reg::from_ptr(self.0.add(4usize)) }
6463 }
6464 #[doc = "APB3 peripheral freeze register"]
6465 pub fn apb3fz1(self) -> Reg<regs::Apb3fz1, RW> {
6466 unsafe { Reg::from_ptr(self.0.add(52usize)) }
6467 }
6468 #[doc = "APB1L peripheral freeze register"]
6469 pub fn apb1lfz1(self) -> Reg<regs::Apb1lfz1, RW> {
6470 unsafe { Reg::from_ptr(self.0.add(60usize)) }
6471 }
6472 #[doc = "APB2 peripheral freeze register"]
6473 pub fn apb2fz1(self) -> Reg<regs::Apb2fz1, RW> {
6474 unsafe { Reg::from_ptr(self.0.add(76usize)) }
6475 }
6476 #[doc = "APB4 peripheral freeze register"]
6477 pub fn apb4fz1(self) -> Reg<regs::Apb4fz1, RW> {
6478 unsafe { Reg::from_ptr(self.0.add(84usize)) }
6479 }
6480 }
6481 pub mod regs {
6482 use crate::generic::*;
6483 #[doc = "APB4 peripheral freeze register"]
6484 #[repr(transparent)]
6485 #[derive(Copy, Clone, Eq, PartialEq)]
6486 pub struct Apb4fz1(pub u32);
6487 impl Apb4fz1 {
6488 #[doc = "I2C4 SMBUS timeout stop in debug mode"]
6489 pub const fn i2c4(&self) -> bool {
6490 let val = (self.0 >> 7usize) & 0x01;
6491 val != 0 4990 val != 0
6492 } 4991 }
6493 #[doc = "I2C4 SMBUS timeout stop in debug mode"] 4992 #[doc = "Master automatic SUSP in Receive mode"]
6494 pub fn set_i2c4(&mut self, val: bool) { 4993 pub fn set_masrx(&mut self, val: bool) {
6495 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 4994 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
6496 } 4995 }
6497 #[doc = "LPTIM2 stop in debug mode"] 4996 #[doc = "Master transfer start"]
6498 pub const fn lptim2(&self) -> bool { 4997 pub const fn cstart(&self) -> bool {
6499 let val = (self.0 >> 9usize) & 0x01; 4998 let val = (self.0 >> 9usize) & 0x01;
6500 val != 0 4999 val != 0
6501 } 5000 }
6502 #[doc = "LPTIM2 stop in debug mode"] 5001 #[doc = "Master transfer start"]
6503 pub fn set_lptim2(&mut self, val: bool) { 5002 pub fn set_cstart(&mut self, val: bool) {
6504 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 5003 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
6505 } 5004 }
6506 #[doc = "LPTIM3 stop in debug mode"] 5005 #[doc = "Master SUSPend request"]
6507 pub const fn lptim3(&self) -> bool { 5006 pub const fn csusp(&self) -> bool {
6508 let val = (self.0 >> 10usize) & 0x01; 5007 let val = (self.0 >> 10usize) & 0x01;
6509 val != 0 5008 val != 0
6510 } 5009 }
6511 #[doc = "LPTIM3 stop in debug mode"] 5010 #[doc = "Master SUSPend request"]
6512 pub fn set_lptim3(&mut self, val: bool) { 5011 pub fn set_csusp(&mut self, val: bool) {
6513 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 5012 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
6514 } 5013 }
6515 #[doc = "LPTIM4 stop in debug mode"] 5014 #[doc = "Rx/Tx direction at Half-duplex mode"]
6516 pub const fn lptim4(&self) -> bool { 5015 pub const fn hddir(&self) -> super::vals::Hddir {
6517 let val = (self.0 >> 11usize) & 0x01; 5016 let val = (self.0 >> 11usize) & 0x01;
6518 val != 0 5017 super::vals::Hddir(val as u8)
6519 } 5018 }
6520 #[doc = "LPTIM4 stop in debug mode"] 5019 #[doc = "Rx/Tx direction at Half-duplex mode"]
6521 pub fn set_lptim4(&mut self, val: bool) { 5020 pub fn set_hddir(&mut self, val: super::vals::Hddir) {
6522 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 5021 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
6523 } 5022 }
6524 #[doc = "LPTIM5 stop in debug mode"] 5023 #[doc = "Internal SS signal input level"]
6525 pub const fn lptim5(&self) -> bool { 5024 pub const fn ssi(&self) -> bool {
6526 let val = (self.0 >> 12usize) & 0x01; 5025 let val = (self.0 >> 12usize) & 0x01;
6527 val != 0 5026 val != 0
6528 } 5027 }
6529 #[doc = "LPTIM5 stop in debug mode"] 5028 #[doc = "Internal SS signal input level"]
6530 pub fn set_lptim5(&mut self, val: bool) { 5029 pub fn set_ssi(&mut self, val: bool) {
6531 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 5030 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
6532 } 5031 }
6533 #[doc = "RTC stop in debug mode"] 5032 #[doc = "32-bit CRC polynomial configuration"]
6534 pub const fn rtc(&self) -> bool { 5033 pub const fn crc33_17(&self) -> super::vals::Crc {
6535 let val = (self.0 >> 16usize) & 0x01; 5034 let val = (self.0 >> 13usize) & 0x01;
6536 val != 0 5035 super::vals::Crc(val as u8)
6537 }
6538 #[doc = "RTC stop in debug mode"]
6539 pub fn set_rtc(&mut self, val: bool) {
6540 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
6541 }
6542 #[doc = "Independent watchdog for D1 stop in debug mode"]
6543 pub const fn iwdg1(&self) -> bool {
6544 let val = (self.0 >> 18usize) & 0x01;
6545 val != 0
6546 }
6547 #[doc = "Independent watchdog for D1 stop in debug mode"]
6548 pub fn set_iwdg1(&mut self, val: bool) {
6549 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
6550 } 5036 }
6551 } 5037 #[doc = "32-bit CRC polynomial configuration"]
6552 impl Default for Apb4fz1 { 5038 pub fn set_crc33_17(&mut self, val: super::vals::Crc) {
6553 fn default() -> Apb4fz1 { 5039 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
6554 Apb4fz1(0)
6555 } 5040 }
6556 } 5041 #[doc = "CRC calculation initialization pattern control for receiver"]
6557 #[doc = "APB2 peripheral freeze register"] 5042 pub const fn rcrcini(&self) -> super::vals::Rcrcini {
6558 #[repr(transparent)] 5043 let val = (self.0 >> 14usize) & 0x01;
6559 #[derive(Copy, Clone, Eq, PartialEq)] 5044 super::vals::Rcrcini(val as u8)
6560 pub struct Apb2fz1(pub u32);
6561 impl Apb2fz1 {
6562 #[doc = "TIM1 stop in debug mode"]
6563 pub const fn tim1(&self) -> bool {
6564 let val = (self.0 >> 0usize) & 0x01;
6565 val != 0
6566 } 5045 }
6567 #[doc = "TIM1 stop in debug mode"] 5046 #[doc = "CRC calculation initialization pattern control for receiver"]
6568 pub fn set_tim1(&mut self, val: bool) { 5047 pub fn set_rcrcini(&mut self, val: super::vals::Rcrcini) {
6569 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5048 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
6570 } 5049 }
6571 #[doc = "TIM8 stop in debug mode"] 5050 #[doc = "CRC calculation initialization pattern control for transmitter"]
6572 pub const fn tim8(&self) -> bool { 5051 pub const fn tcrcini(&self) -> super::vals::Tcrcini {
6573 let val = (self.0 >> 1usize) & 0x01; 5052 let val = (self.0 >> 15usize) & 0x01;
6574 val != 0 5053 super::vals::Tcrcini(val as u8)
6575 } 5054 }
6576 #[doc = "TIM8 stop in debug mode"] 5055 #[doc = "CRC calculation initialization pattern control for transmitter"]
6577 pub fn set_tim8(&mut self, val: bool) { 5056 pub fn set_tcrcini(&mut self, val: super::vals::Tcrcini) {
6578 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5057 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
6579 } 5058 }
6580 #[doc = "TIM15 stop in debug mode"] 5059 #[doc = "Locking the AF configuration of associated IOs"]
6581 pub const fn tim15(&self) -> bool { 5060 pub const fn iolock(&self) -> bool {
6582 let val = (self.0 >> 16usize) & 0x01; 5061 let val = (self.0 >> 16usize) & 0x01;
6583 val != 0 5062 val != 0
6584 } 5063 }
6585 #[doc = "TIM15 stop in debug mode"] 5064 #[doc = "Locking the AF configuration of associated IOs"]
6586 pub fn set_tim15(&mut self, val: bool) { 5065 pub fn set_iolock(&mut self, val: bool) {
6587 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 5066 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
6588 } 5067 }
6589 #[doc = "TIM16 stop in debug mode"]
6590 pub const fn tim16(&self) -> bool {
6591 let val = (self.0 >> 17usize) & 0x01;
6592 val != 0
6593 }
6594 #[doc = "TIM16 stop in debug mode"]
6595 pub fn set_tim16(&mut self, val: bool) {
6596 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
6597 }
6598 #[doc = "TIM17 stop in debug mode"]
6599 pub const fn tim17(&self) -> bool {
6600 let val = (self.0 >> 18usize) & 0x01;
6601 val != 0
6602 }
6603 #[doc = "TIM17 stop in debug mode"]
6604 pub fn set_tim17(&mut self, val: bool) {
6605 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
6606 }
6607 #[doc = "HRTIM stop in debug mode"]
6608 pub const fn hrtim(&self) -> bool {
6609 let val = (self.0 >> 29usize) & 0x01;
6610 val != 0
6611 }
6612 #[doc = "HRTIM stop in debug mode"]
6613 pub fn set_hrtim(&mut self, val: bool) {
6614 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
6615 }
6616 } 5068 }
6617 impl Default for Apb2fz1 { 5069 impl Default for Cr1 {
6618 fn default() -> Apb2fz1 { 5070 fn default() -> Cr1 {
6619 Apb2fz1(0) 5071 Cr1(0)
6620 } 5072 }
6621 } 5073 }
6622 #[doc = "APB1L peripheral freeze register"] 5074 #[doc = "Interrupt/Status Flags Clear Register"]
6623 #[repr(transparent)] 5075 #[repr(transparent)]
6624 #[derive(Copy, Clone, Eq, PartialEq)] 5076 #[derive(Copy, Clone, Eq, PartialEq)]
6625 pub struct Apb1lfz1(pub u32); 5077 pub struct Ifcr(pub u32);
6626 impl Apb1lfz1 { 5078 impl Ifcr {
6627 #[doc = "TIM2 stop in debug mode"] 5079 #[doc = "End Of Transfer flag clear"]
6628 pub const fn tim2(&self) -> bool { 5080 pub const fn eotc(&self) -> bool {
6629 let val = (self.0 >> 0usize) & 0x01;
6630 val != 0
6631 }
6632 #[doc = "TIM2 stop in debug mode"]
6633 pub fn set_tim2(&mut self, val: bool) {
6634 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6635 }
6636 #[doc = "TIM3 stop in debug mode"]
6637 pub const fn tim3(&self) -> bool {
6638 let val = (self.0 >> 1usize) & 0x01;
6639 val != 0
6640 }
6641 #[doc = "TIM3 stop in debug mode"]
6642 pub fn set_tim3(&mut self, val: bool) {
6643 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
6644 }
6645 #[doc = "TIM4 stop in debug mode"]
6646 pub const fn tim4(&self) -> bool {
6647 let val = (self.0 >> 2usize) & 0x01;
6648 val != 0
6649 }
6650 #[doc = "TIM4 stop in debug mode"]
6651 pub fn set_tim4(&mut self, val: bool) {
6652 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
6653 }
6654 #[doc = "TIM5 stop in debug mode"]
6655 pub const fn tim5(&self) -> bool {
6656 let val = (self.0 >> 3usize) & 0x01; 5081 let val = (self.0 >> 3usize) & 0x01;
6657 val != 0 5082 val != 0
6658 } 5083 }
6659 #[doc = "TIM5 stop in debug mode"] 5084 #[doc = "End Of Transfer flag clear"]
6660 pub fn set_tim5(&mut self, val: bool) { 5085 pub fn set_eotc(&mut self, val: bool) {
6661 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 5086 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
6662 } 5087 }
6663 #[doc = "TIM6 stop in debug mode"] 5088 #[doc = "Transmission Transfer Filled flag clear"]
6664 pub const fn tim6(&self) -> bool { 5089 pub const fn txtfc(&self) -> bool {
6665 let val = (self.0 >> 4usize) & 0x01; 5090 let val = (self.0 >> 4usize) & 0x01;
6666 val != 0 5091 val != 0
6667 } 5092 }
6668 #[doc = "TIM6 stop in debug mode"] 5093 #[doc = "Transmission Transfer Filled flag clear"]
6669 pub fn set_tim6(&mut self, val: bool) { 5094 pub fn set_txtfc(&mut self, val: bool) {
6670 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 5095 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
6671 } 5096 }
6672 #[doc = "TIM7 stop in debug mode"] 5097 #[doc = "Underrun flag clear"]
6673 pub const fn tim7(&self) -> bool { 5098 pub const fn udrc(&self) -> bool {
6674 let val = (self.0 >> 5usize) & 0x01; 5099 let val = (self.0 >> 5usize) & 0x01;
6675 val != 0 5100 val != 0
6676 } 5101 }
6677 #[doc = "TIM7 stop in debug mode"] 5102 #[doc = "Underrun flag clear"]
6678 pub fn set_tim7(&mut self, val: bool) { 5103 pub fn set_udrc(&mut self, val: bool) {
6679 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5104 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
6680 } 5105 }
6681 #[doc = "TIM12 stop in debug mode"] 5106 #[doc = "Overrun flag clear"]
6682 pub const fn tim12(&self) -> bool { 5107 pub const fn ovrc(&self) -> bool {
6683 let val = (self.0 >> 6usize) & 0x01; 5108 let val = (self.0 >> 6usize) & 0x01;
6684 val != 0 5109 val != 0
6685 } 5110 }
6686 #[doc = "TIM12 stop in debug mode"] 5111 #[doc = "Overrun flag clear"]
6687 pub fn set_tim12(&mut self, val: bool) { 5112 pub fn set_ovrc(&mut self, val: bool) {
6688 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5113 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
6689 } 5114 }
6690 #[doc = "TIM13 stop in debug mode"] 5115 #[doc = "CRC Error flag clear"]
6691 pub const fn tim13(&self) -> bool { 5116 pub const fn crcec(&self) -> bool {
6692 let val = (self.0 >> 7usize) & 0x01; 5117 let val = (self.0 >> 7usize) & 0x01;
6693 val != 0 5118 val != 0
6694 } 5119 }
6695 #[doc = "TIM13 stop in debug mode"] 5120 #[doc = "CRC Error flag clear"]
6696 pub fn set_tim13(&mut self, val: bool) { 5121 pub fn set_crcec(&mut self, val: bool) {
6697 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 5122 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
6698 } 5123 }
6699 #[doc = "TIM14 stop in debug mode"] 5124 #[doc = "TI frame format error flag clear"]
6700 pub const fn tim14(&self) -> bool { 5125 pub const fn tifrec(&self) -> bool {
6701 let val = (self.0 >> 8usize) & 0x01; 5126 let val = (self.0 >> 8usize) & 0x01;
6702 val != 0 5127 val != 0
6703 } 5128 }
6704 #[doc = "TIM14 stop in debug mode"] 5129 #[doc = "TI frame format error flag clear"]
6705 pub fn set_tim14(&mut self, val: bool) { 5130 pub fn set_tifrec(&mut self, val: bool) {
6706 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 5131 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
6707 } 5132 }
6708 #[doc = "LPTIM1 stop in debug mode"] 5133 #[doc = "Mode Fault flag clear"]
6709 pub const fn lptim1(&self) -> bool { 5134 pub const fn modfc(&self) -> bool {
6710 let val = (self.0 >> 9usize) & 0x01; 5135 let val = (self.0 >> 9usize) & 0x01;
6711 val != 0 5136 val != 0
6712 } 5137 }
6713 #[doc = "LPTIM1 stop in debug mode"] 5138 #[doc = "Mode Fault flag clear"]
6714 pub fn set_lptim1(&mut self, val: bool) { 5139 pub fn set_modfc(&mut self, val: bool) {
6715 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 5140 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
6716 } 5141 }
6717 #[doc = "I2C1 SMBUS timeout stop in debug mode"] 5142 #[doc = "TSERFC flag clear"]
6718 pub const fn i2c1(&self) -> bool { 5143 pub const fn tserfc(&self) -> bool {
6719 let val = (self.0 >> 21usize) & 0x01; 5144 let val = (self.0 >> 10usize) & 0x01;
6720 val != 0
6721 }
6722 #[doc = "I2C1 SMBUS timeout stop in debug mode"]
6723 pub fn set_i2c1(&mut self, val: bool) {
6724 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
6725 }
6726 #[doc = "I2C2 SMBUS timeout stop in debug mode"]
6727 pub const fn i2c2(&self) -> bool {
6728 let val = (self.0 >> 22usize) & 0x01;
6729 val != 0 5145 val != 0
6730 } 5146 }
6731 #[doc = "I2C2 SMBUS timeout stop in debug mode"] 5147 #[doc = "TSERFC flag clear"]
6732 pub fn set_i2c2(&mut self, val: bool) { 5148 pub fn set_tserfc(&mut self, val: bool) {
6733 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 5149 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
6734 } 5150 }
6735 #[doc = "I2C3 SMBUS timeout stop in debug mode"] 5151 #[doc = "SUSPend flag clear"]
6736 pub const fn i2c3(&self) -> bool { 5152 pub const fn suspc(&self) -> bool {
6737 let val = (self.0 >> 23usize) & 0x01; 5153 let val = (self.0 >> 11usize) & 0x01;
6738 val != 0 5154 val != 0
6739 } 5155 }
6740 #[doc = "I2C3 SMBUS timeout stop in debug mode"] 5156 #[doc = "SUSPend flag clear"]
6741 pub fn set_i2c3(&mut self, val: bool) { 5157 pub fn set_suspc(&mut self, val: bool) {
6742 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); 5158 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
6743 } 5159 }
6744 } 5160 }
6745 impl Default for Apb1lfz1 { 5161 impl Default for Ifcr {
6746 fn default() -> Apb1lfz1 { 5162 fn default() -> Ifcr {
6747 Apb1lfz1(0) 5163 Ifcr(0)
6748 } 5164 }
6749 } 5165 }
6750 #[doc = "Configuration register"] 5166 #[doc = "configuration register 2"]
6751 #[repr(transparent)] 5167 #[repr(transparent)]
6752 #[derive(Copy, Clone, Eq, PartialEq)] 5168 #[derive(Copy, Clone, Eq, PartialEq)]
6753 pub struct Cr(pub u32); 5169 pub struct Cfg2(pub u32);
6754 impl Cr { 5170 impl Cfg2 {
6755 #[doc = "Allow debug in D1 Sleep mode"] 5171 #[doc = "Master SS Idleness"]
6756 pub const fn dbgsleep_d1(&self) -> bool { 5172 pub const fn mssi(&self) -> u8 {
6757 let val = (self.0 >> 0usize) & 0x01; 5173 let val = (self.0 >> 0usize) & 0x0f;
6758 val != 0 5174 val as u8
6759 } 5175 }
6760 #[doc = "Allow debug in D1 Sleep mode"] 5176 #[doc = "Master SS Idleness"]
6761 pub fn set_dbgsleep_d1(&mut self, val: bool) { 5177 pub fn set_mssi(&mut self, val: u8) {
6762 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5178 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
6763 } 5179 }
6764 #[doc = "Allow debug in D1 Stop mode"] 5180 #[doc = "Master Inter-Data Idleness"]
6765 pub const fn dbgstop_d1(&self) -> bool { 5181 pub const fn midi(&self) -> u8 {
6766 let val = (self.0 >> 1usize) & 0x01; 5182 let val = (self.0 >> 4usize) & 0x0f;
6767 val != 0 5183 val as u8
6768 } 5184 }
6769 #[doc = "Allow debug in D1 Stop mode"] 5185 #[doc = "Master Inter-Data Idleness"]
6770 pub fn set_dbgstop_d1(&mut self, val: bool) { 5186 pub fn set_midi(&mut self, val: u8) {
6771 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5187 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
6772 } 5188 }
6773 #[doc = "Allow debug in D1 Standby mode"] 5189 #[doc = "Swap functionality of MISO and MOSI pins"]
6774 pub const fn dbgstby_d1(&self) -> bool { 5190 pub const fn ioswp(&self) -> bool {
6775 let val = (self.0 >> 2usize) & 0x01; 5191 let val = (self.0 >> 15usize) & 0x01;
6776 val != 0 5192 val != 0
6777 } 5193 }
6778 #[doc = "Allow debug in D1 Standby mode"] 5194 #[doc = "Swap functionality of MISO and MOSI pins"]
6779 pub fn set_dbgstby_d1(&mut self, val: bool) { 5195 pub fn set_ioswp(&mut self, val: bool) {
6780 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5196 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
6781 } 5197 }
6782 #[doc = "Trace clock enable enable"] 5198 #[doc = "SPI Communication Mode"]
6783 pub const fn traceclken(&self) -> bool { 5199 pub const fn comm(&self) -> super::vals::Comm {
6784 let val = (self.0 >> 20usize) & 0x01; 5200 let val = (self.0 >> 17usize) & 0x03;
6785 val != 0 5201 super::vals::Comm(val as u8)
6786 } 5202 }
6787 #[doc = "Trace clock enable enable"] 5203 #[doc = "SPI Communication Mode"]
6788 pub fn set_traceclken(&mut self, val: bool) { 5204 pub fn set_comm(&mut self, val: super::vals::Comm) {
6789 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); 5205 self.0 = (self.0 & !(0x03 << 17usize)) | (((val.0 as u32) & 0x03) << 17usize);
6790 } 5206 }
6791 #[doc = "D1 debug clock enable enable"] 5207 #[doc = "Serial Protocol"]
6792 pub const fn d1dbgcken(&self) -> bool { 5208 pub const fn sp(&self) -> super::vals::Sp {
6793 let val = (self.0 >> 21usize) & 0x01; 5209 let val = (self.0 >> 19usize) & 0x07;
6794 val != 0 5210 super::vals::Sp(val as u8)
6795 } 5211 }
6796 #[doc = "D1 debug clock enable enable"] 5212 #[doc = "Serial Protocol"]
6797 pub fn set_d1dbgcken(&mut self, val: bool) { 5213 pub fn set_sp(&mut self, val: super::vals::Sp) {
6798 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); 5214 self.0 = (self.0 & !(0x07 << 19usize)) | (((val.0 as u32) & 0x07) << 19usize);
6799 } 5215 }
6800 #[doc = "D3 debug clock enable enable"] 5216 #[doc = "SPI Master"]
6801 pub const fn d3dbgcken(&self) -> bool { 5217 pub const fn master(&self) -> super::vals::Master {
6802 let val = (self.0 >> 22usize) & 0x01; 5218 let val = (self.0 >> 22usize) & 0x01;
5219 super::vals::Master(val as u8)
5220 }
5221 #[doc = "SPI Master"]
5222 pub fn set_master(&mut self, val: super::vals::Master) {
5223 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
5224 }
5225 #[doc = "Data frame format"]
5226 pub const fn lsbfrst(&self) -> super::vals::Lsbfrst {
5227 let val = (self.0 >> 23usize) & 0x01;
5228 super::vals::Lsbfrst(val as u8)
5229 }
5230 #[doc = "Data frame format"]
5231 pub fn set_lsbfrst(&mut self, val: super::vals::Lsbfrst) {
5232 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
5233 }
5234 #[doc = "Clock phase"]
5235 pub const fn cpha(&self) -> super::vals::Cpha {
5236 let val = (self.0 >> 24usize) & 0x01;
5237 super::vals::Cpha(val as u8)
5238 }
5239 #[doc = "Clock phase"]
5240 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
5241 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
5242 }
5243 #[doc = "Clock polarity"]
5244 pub const fn cpol(&self) -> super::vals::Cpol {
5245 let val = (self.0 >> 25usize) & 0x01;
5246 super::vals::Cpol(val as u8)
5247 }
5248 #[doc = "Clock polarity"]
5249 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
5250 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
5251 }
5252 #[doc = "Software management of SS signal input"]
5253 pub const fn ssm(&self) -> bool {
5254 let val = (self.0 >> 26usize) & 0x01;
6803 val != 0 5255 val != 0
6804 } 5256 }
6805 #[doc = "D3 debug clock enable enable"] 5257 #[doc = "Software management of SS signal input"]
6806 pub fn set_d3dbgcken(&mut self, val: bool) { 5258 pub fn set_ssm(&mut self, val: bool) {
6807 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 5259 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
6808 } 5260 }
6809 #[doc = "External trigger output enable"] 5261 #[doc = "SS input/output polarity"]
6810 pub const fn trgoen(&self) -> bool { 5262 pub const fn ssiop(&self) -> super::vals::Ssiop {
6811 let val = (self.0 >> 28usize) & 0x01; 5263 let val = (self.0 >> 28usize) & 0x01;
5264 super::vals::Ssiop(val as u8)
5265 }
5266 #[doc = "SS input/output polarity"]
5267 pub fn set_ssiop(&mut self, val: super::vals::Ssiop) {
5268 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
5269 }
5270 #[doc = "SS output enable"]
5271 pub const fn ssoe(&self) -> bool {
5272 let val = (self.0 >> 29usize) & 0x01;
6812 val != 0 5273 val != 0
6813 } 5274 }
6814 #[doc = "External trigger output enable"] 5275 #[doc = "SS output enable"]
6815 pub fn set_trgoen(&mut self, val: bool) { 5276 pub fn set_ssoe(&mut self, val: bool) {
6816 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); 5277 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
6817 } 5278 }
6818 } 5279 #[doc = "SS output management in master mode"]
6819 impl Default for Cr { 5280 pub const fn ssom(&self) -> super::vals::Ssom {
6820 fn default() -> Cr { 5281 let val = (self.0 >> 30usize) & 0x01;
6821 Cr(0) 5282 super::vals::Ssom(val as u8)
6822 } 5283 }
6823 } 5284 #[doc = "SS output management in master mode"]
6824 #[doc = "APB3 peripheral freeze register"] 5285 pub fn set_ssom(&mut self, val: super::vals::Ssom) {
6825 #[repr(transparent)] 5286 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
6826 #[derive(Copy, Clone, Eq, PartialEq)]
6827 pub struct Apb3fz1(pub u32);
6828 impl Apb3fz1 {
6829 #[doc = "WWDG1 stop in debug mode"]
6830 pub const fn wwdg1(&self) -> bool {
6831 let val = (self.0 >> 6usize) & 0x01;
6832 val != 0
6833 } 5287 }
6834 #[doc = "WWDG1 stop in debug mode"] 5288 #[doc = "Alternate function GPIOs control"]
6835 pub fn set_wwdg1(&mut self, val: bool) { 5289 pub const fn afcntr(&self) -> super::vals::Afcntr {
6836 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5290 let val = (self.0 >> 31usize) & 0x01;
5291 super::vals::Afcntr(val as u8)
5292 }
5293 #[doc = "Alternate function GPIOs control"]
5294 pub fn set_afcntr(&mut self, val: super::vals::Afcntr) {
5295 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
6837 } 5296 }
6838 } 5297 }
6839 impl Default for Apb3fz1 { 5298 impl Default for Cfg2 {
6840 fn default() -> Apb3fz1 { 5299 fn default() -> Cfg2 {
6841 Apb3fz1(0) 5300 Cfg2(0)
6842 } 5301 }
6843 } 5302 }
6844 #[doc = "Identity code"] 5303 #[doc = "configuration register 1"]
6845 #[repr(transparent)] 5304 #[repr(transparent)]
6846 #[derive(Copy, Clone, Eq, PartialEq)] 5305 #[derive(Copy, Clone, Eq, PartialEq)]
6847 pub struct Idc(pub u32); 5306 pub struct Cfg1(pub u32);
6848 impl Idc { 5307 impl Cfg1 {
6849 #[doc = "Device ID"] 5308 #[doc = "Number of bits in at single SPI data frame"]
6850 pub const fn dev_id(&self) -> u16 { 5309 pub const fn dsize(&self) -> u8 {
6851 let val = (self.0 >> 0usize) & 0x0fff; 5310 let val = (self.0 >> 0usize) & 0x1f;
6852 val as u16 5311 val as u8
6853 } 5312 }
6854 #[doc = "Device ID"] 5313 #[doc = "Number of bits in at single SPI data frame"]
6855 pub fn set_dev_id(&mut self, val: u16) { 5314 pub fn set_dsize(&mut self, val: u8) {
6856 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 5315 self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
6857 } 5316 }
6858 #[doc = "Revision ID"] 5317 #[doc = "threshold level"]
6859 pub const fn rev_id(&self) -> u16 { 5318 pub const fn fthlv(&self) -> super::vals::Fthlv {
6860 let val = (self.0 >> 16usize) & 0xffff; 5319 let val = (self.0 >> 5usize) & 0x0f;
6861 val as u16 5320 super::vals::Fthlv(val as u8)
6862 } 5321 }
6863 #[doc = "Revision ID"] 5322 #[doc = "threshold level"]
6864 pub fn set_rev_id(&mut self, val: u16) { 5323 pub fn set_fthlv(&mut self, val: super::vals::Fthlv) {
6865 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); 5324 self.0 = (self.0 & !(0x0f << 5usize)) | (((val.0 as u32) & 0x0f) << 5usize);
6866 } 5325 }
6867 } 5326 #[doc = "Behavior of slave transmitter at underrun condition"]
6868 impl Default for Idc { 5327 pub const fn udrcfg(&self) -> super::vals::Udrcfg {
6869 fn default() -> Idc { 5328 let val = (self.0 >> 9usize) & 0x03;
6870 Idc(0) 5329 super::vals::Udrcfg(val as u8)
6871 } 5330 }
6872 } 5331 #[doc = "Behavior of slave transmitter at underrun condition"]
6873 } 5332 pub fn set_udrcfg(&mut self, val: super::vals::Udrcfg) {
6874} 5333 self.0 = (self.0 & !(0x03 << 9usize)) | (((val.0 as u32) & 0x03) << 9usize);
6875pub mod spi_v2 {
6876 use crate::generic::*;
6877 #[doc = "Serial peripheral interface"]
6878 #[derive(Copy, Clone)]
6879 pub struct Spi(pub *mut u8);
6880 unsafe impl Send for Spi {}
6881 unsafe impl Sync for Spi {}
6882 impl Spi {
6883 #[doc = "control register 1"]
6884 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
6885 unsafe { Reg::from_ptr(self.0.add(0usize)) }
6886 }
6887 #[doc = "control register 2"]
6888 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
6889 unsafe { Reg::from_ptr(self.0.add(4usize)) }
6890 }
6891 #[doc = "status register"]
6892 pub fn sr(self) -> Reg<regs::Sr, RW> {
6893 unsafe { Reg::from_ptr(self.0.add(8usize)) }
6894 }
6895 #[doc = "data register"]
6896 pub fn dr(self) -> Reg<regs::Dr, RW> {
6897 unsafe { Reg::from_ptr(self.0.add(12usize)) }
6898 }
6899 #[doc = "CRC polynomial register"]
6900 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
6901 unsafe { Reg::from_ptr(self.0.add(16usize)) }
6902 }
6903 #[doc = "RX CRC register"]
6904 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
6905 unsafe { Reg::from_ptr(self.0.add(20usize)) }
6906 }
6907 #[doc = "TX CRC register"]
6908 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
6909 unsafe { Reg::from_ptr(self.0.add(24usize)) }
6910 }
6911 }
6912 pub mod regs {
6913 use crate::generic::*;
6914 #[doc = "CRC polynomial register"]
6915 #[repr(transparent)]
6916 #[derive(Copy, Clone, Eq, PartialEq)]
6917 pub struct Crcpr(pub u32);
6918 impl Crcpr {
6919 #[doc = "CRC polynomial register"]
6920 pub const fn crcpoly(&self) -> u16 {
6921 let val = (self.0 >> 0usize) & 0xffff;
6922 val as u16
6923 } 5334 }
6924 #[doc = "CRC polynomial register"] 5335 #[doc = "Detection of underrun condition at slave transmitter"]
6925 pub fn set_crcpoly(&mut self, val: u16) { 5336 pub const fn udrdet(&self) -> super::vals::Udrdet {
6926 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 5337 let val = (self.0 >> 11usize) & 0x03;
5338 super::vals::Udrdet(val as u8)
6927 } 5339 }
6928 } 5340 #[doc = "Detection of underrun condition at slave transmitter"]
6929 impl Default for Crcpr { 5341 pub fn set_udrdet(&mut self, val: super::vals::Udrdet) {
6930 fn default() -> Crcpr { 5342 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize);
6931 Crcpr(0)
6932 } 5343 }
6933 } 5344 #[doc = "Rx DMA stream enable"]
6934 #[doc = "control register 2"]
6935 #[repr(transparent)]
6936 #[derive(Copy, Clone, Eq, PartialEq)]
6937 pub struct Cr2(pub u32);
6938 impl Cr2 {
6939 #[doc = "Rx buffer DMA enable"]
6940 pub const fn rxdmaen(&self) -> bool { 5345 pub const fn rxdmaen(&self) -> bool {
6941 let val = (self.0 >> 0usize) & 0x01; 5346 let val = (self.0 >> 14usize) & 0x01;
6942 val != 0 5347 val != 0
6943 } 5348 }
6944 #[doc = "Rx buffer DMA enable"] 5349 #[doc = "Rx DMA stream enable"]
6945 pub fn set_rxdmaen(&mut self, val: bool) { 5350 pub fn set_rxdmaen(&mut self, val: bool) {
6946 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5351 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
6947 } 5352 }
6948 #[doc = "Tx buffer DMA enable"] 5353 #[doc = "Tx DMA stream enable"]
6949 pub const fn txdmaen(&self) -> bool { 5354 pub const fn txdmaen(&self) -> bool {
6950 let val = (self.0 >> 1usize) & 0x01; 5355 let val = (self.0 >> 15usize) & 0x01;
6951 val != 0 5356 val != 0
6952 } 5357 }
6953 #[doc = "Tx buffer DMA enable"] 5358 #[doc = "Tx DMA stream enable"]
6954 pub fn set_txdmaen(&mut self, val: bool) { 5359 pub fn set_txdmaen(&mut self, val: bool) {
6955 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5360 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
6956 } 5361 }
6957 #[doc = "SS output enable"] 5362 #[doc = "Length of CRC frame to be transacted and compared"]
6958 pub const fn ssoe(&self) -> bool { 5363 pub const fn crcsize(&self) -> u8 {
6959 let val = (self.0 >> 2usize) & 0x01; 5364 let val = (self.0 >> 16usize) & 0x1f;
6960 val != 0 5365 val as u8
6961 } 5366 }
6962 #[doc = "SS output enable"] 5367 #[doc = "Length of CRC frame to be transacted and compared"]
6963 pub fn set_ssoe(&mut self, val: bool) { 5368 pub fn set_crcsize(&mut self, val: u8) {
6964 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5369 self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize);
6965 } 5370 }
6966 #[doc = "NSS pulse management"] 5371 #[doc = "Hardware CRC computation enable"]
6967 pub const fn nssp(&self) -> bool { 5372 pub const fn crcen(&self) -> bool {
6968 let val = (self.0 >> 3usize) & 0x01; 5373 let val = (self.0 >> 22usize) & 0x01;
6969 val != 0 5374 val != 0
6970 } 5375 }
6971 #[doc = "NSS pulse management"] 5376 #[doc = "Hardware CRC computation enable"]
6972 pub fn set_nssp(&mut self, val: bool) { 5377 pub fn set_crcen(&mut self, val: bool) {
6973 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 5378 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
6974 }
6975 #[doc = "Frame format"]
6976 pub const fn frf(&self) -> super::vals::Frf {
6977 let val = (self.0 >> 4usize) & 0x01;
6978 super::vals::Frf(val as u8)
6979 }
6980 #[doc = "Frame format"]
6981 pub fn set_frf(&mut self, val: super::vals::Frf) {
6982 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
6983 }
6984 #[doc = "Error interrupt enable"]
6985 pub const fn errie(&self) -> bool {
6986 let val = (self.0 >> 5usize) & 0x01;
6987 val != 0
6988 } 5379 }
6989 #[doc = "Error interrupt enable"] 5380 #[doc = "Master baud rate"]
6990 pub fn set_errie(&mut self, val: bool) { 5381 pub const fn mbr(&self) -> super::vals::Mbr {
6991 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5382 let val = (self.0 >> 28usize) & 0x07;
5383 super::vals::Mbr(val as u8)
6992 } 5384 }
6993 #[doc = "RX buffer not empty interrupt enable"] 5385 #[doc = "Master baud rate"]
6994 pub const fn rxneie(&self) -> bool { 5386 pub fn set_mbr(&mut self, val: super::vals::Mbr) {
6995 let val = (self.0 >> 6usize) & 0x01; 5387 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize);
6996 val != 0
6997 } 5388 }
6998 #[doc = "RX buffer not empty interrupt enable"] 5389 }
6999 pub fn set_rxneie(&mut self, val: bool) { 5390 impl Default for Cfg1 {
7000 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5391 fn default() -> Cfg1 {
5392 Cfg1(0)
7001 } 5393 }
7002 #[doc = "Tx buffer empty interrupt enable"] 5394 }
7003 pub const fn txeie(&self) -> bool { 5395 #[doc = "Polynomial Register"]
7004 let val = (self.0 >> 7usize) & 0x01; 5396 #[repr(transparent)]
7005 val != 0 5397 #[derive(Copy, Clone, Eq, PartialEq)]
5398 pub struct Crcpoly(pub u32);
5399 impl Crcpoly {
5400 #[doc = "CRC polynomial register"]
5401 pub const fn crcpoly(&self) -> u32 {
5402 let val = (self.0 >> 0usize) & 0xffff_ffff;
5403 val as u32
7006 } 5404 }
7007 #[doc = "Tx buffer empty interrupt enable"] 5405 #[doc = "CRC polynomial register"]
7008 pub fn set_txeie(&mut self, val: bool) { 5406 pub fn set_crcpoly(&mut self, val: u32) {
7009 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 5407 self.0 =
5408 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
7010 } 5409 }
7011 #[doc = "Data size"] 5410 }
7012 pub const fn ds(&self) -> super::vals::Ds { 5411 impl Default for Crcpoly {
7013 let val = (self.0 >> 8usize) & 0x0f; 5412 fn default() -> Crcpoly {
7014 super::vals::Ds(val as u8) 5413 Crcpoly(0)
7015 } 5414 }
7016 #[doc = "Data size"] 5415 }
7017 pub fn set_ds(&mut self, val: super::vals::Ds) { 5416 #[doc = "Transmitter CRC Register"]
7018 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); 5417 #[repr(transparent)]
5418 #[derive(Copy, Clone, Eq, PartialEq)]
5419 pub struct Txcrc(pub u32);
5420 impl Txcrc {
5421 #[doc = "CRC register for transmitter"]
5422 pub const fn txcrc(&self) -> u32 {
5423 let val = (self.0 >> 0usize) & 0xffff_ffff;
5424 val as u32
7019 } 5425 }
7020 #[doc = "FIFO reception threshold"] 5426 #[doc = "CRC register for transmitter"]
7021 pub const fn frxth(&self) -> super::vals::Frxth { 5427 pub fn set_txcrc(&mut self, val: u32) {
7022 let val = (self.0 >> 12usize) & 0x01; 5428 self.0 =
7023 super::vals::Frxth(val as u8) 5429 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
7024 } 5430 }
7025 #[doc = "FIFO reception threshold"] 5431 }
7026 pub fn set_frxth(&mut self, val: super::vals::Frxth) { 5432 impl Default for Txcrc {
7027 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 5433 fn default() -> Txcrc {
5434 Txcrc(0)
7028 } 5435 }
7029 #[doc = "Last DMA transfer for reception"] 5436 }
7030 pub const fn ldma_rx(&self) -> super::vals::LdmaRx { 5437 #[doc = "control register 2"]
7031 let val = (self.0 >> 13usize) & 0x01; 5438 #[repr(transparent)]
7032 super::vals::LdmaRx(val as u8) 5439 #[derive(Copy, Clone, Eq, PartialEq)]
5440 pub struct Cr2(pub u32);
5441 impl Cr2 {
5442 #[doc = "Number of data at current transfer"]
5443 pub const fn tsize(&self) -> u16 {
5444 let val = (self.0 >> 0usize) & 0xffff;
5445 val as u16
7033 } 5446 }
7034 #[doc = "Last DMA transfer for reception"] 5447 #[doc = "Number of data at current transfer"]
7035 pub fn set_ldma_rx(&mut self, val: super::vals::LdmaRx) { 5448 pub fn set_tsize(&mut self, val: u16) {
7036 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); 5449 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
7037 } 5450 }
7038 #[doc = "Last DMA transfer for transmission"] 5451 #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"]
7039 pub const fn ldma_tx(&self) -> super::vals::LdmaTx { 5452 pub const fn tser(&self) -> u16 {
7040 let val = (self.0 >> 14usize) & 0x01; 5453 let val = (self.0 >> 16usize) & 0xffff;
7041 super::vals::LdmaTx(val as u8) 5454 val as u16
7042 } 5455 }
7043 #[doc = "Last DMA transfer for transmission"] 5456 #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"]
7044 pub fn set_ldma_tx(&mut self, val: super::vals::LdmaTx) { 5457 pub fn set_tser(&mut self, val: u16) {
7045 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 5458 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
7046 } 5459 }
7047 } 5460 }
7048 impl Default for Cr2 { 5461 impl Default for Cr2 {
@@ -7050,293 +5463,180 @@ pub mod spi_v2 {
7050 Cr2(0) 5463 Cr2(0)
7051 } 5464 }
7052 } 5465 }
7053 #[doc = "control register 1"] 5466 #[doc = "Receiver CRC Register"]
7054 #[repr(transparent)] 5467 #[repr(transparent)]
7055 #[derive(Copy, Clone, Eq, PartialEq)] 5468 #[derive(Copy, Clone, Eq, PartialEq)]
7056 pub struct Cr1(pub u32); 5469 pub struct Rxcrc(pub u32);
7057 impl Cr1 { 5470 impl Rxcrc {
7058 #[doc = "Clock phase"] 5471 #[doc = "CRC register for receiver"]
7059 pub const fn cpha(&self) -> super::vals::Cpha { 5472 pub const fn rxcrc(&self) -> u32 {
7060 let val = (self.0 >> 0usize) & 0x01; 5473 let val = (self.0 >> 0usize) & 0xffff_ffff;
7061 super::vals::Cpha(val as u8) 5474 val as u32
7062 }
7063 #[doc = "Clock phase"]
7064 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
7065 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
7066 }
7067 #[doc = "Clock polarity"]
7068 pub const fn cpol(&self) -> super::vals::Cpol {
7069 let val = (self.0 >> 1usize) & 0x01;
7070 super::vals::Cpol(val as u8)
7071 }
7072 #[doc = "Clock polarity"]
7073 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
7074 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
7075 }
7076 #[doc = "Master selection"]
7077 pub const fn mstr(&self) -> super::vals::Mstr {
7078 let val = (self.0 >> 2usize) & 0x01;
7079 super::vals::Mstr(val as u8)
7080 }
7081 #[doc = "Master selection"]
7082 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
7083 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
7084 }
7085 #[doc = "Baud rate control"]
7086 pub const fn br(&self) -> super::vals::Br {
7087 let val = (self.0 >> 3usize) & 0x07;
7088 super::vals::Br(val as u8)
7089 }
7090 #[doc = "Baud rate control"]
7091 pub fn set_br(&mut self, val: super::vals::Br) {
7092 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
7093 }
7094 #[doc = "SPI enable"]
7095 pub const fn spe(&self) -> bool {
7096 let val = (self.0 >> 6usize) & 0x01;
7097 val != 0
7098 }
7099 #[doc = "SPI enable"]
7100 pub fn set_spe(&mut self, val: bool) {
7101 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7102 }
7103 #[doc = "Frame format"]
7104 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst {
7105 let val = (self.0 >> 7usize) & 0x01;
7106 super::vals::Lsbfirst(val as u8)
7107 }
7108 #[doc = "Frame format"]
7109 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) {
7110 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
7111 }
7112 #[doc = "Internal slave select"]
7113 pub const fn ssi(&self) -> bool {
7114 let val = (self.0 >> 8usize) & 0x01;
7115 val != 0
7116 }
7117 #[doc = "Internal slave select"]
7118 pub fn set_ssi(&mut self, val: bool) {
7119 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
7120 }
7121 #[doc = "Software slave management"]
7122 pub const fn ssm(&self) -> bool {
7123 let val = (self.0 >> 9usize) & 0x01;
7124 val != 0
7125 }
7126 #[doc = "Software slave management"]
7127 pub fn set_ssm(&mut self, val: bool) {
7128 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
7129 }
7130 #[doc = "Receive only"]
7131 pub const fn rxonly(&self) -> super::vals::Rxonly {
7132 let val = (self.0 >> 10usize) & 0x01;
7133 super::vals::Rxonly(val as u8)
7134 }
7135 #[doc = "Receive only"]
7136 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
7137 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
7138 }
7139 #[doc = "CRC length"]
7140 pub const fn crcl(&self) -> super::vals::Crcl {
7141 let val = (self.0 >> 11usize) & 0x01;
7142 super::vals::Crcl(val as u8)
7143 }
7144 #[doc = "CRC length"]
7145 pub fn set_crcl(&mut self, val: super::vals::Crcl) {
7146 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
7147 }
7148 #[doc = "CRC transfer next"]
7149 pub const fn crcnext(&self) -> super::vals::Crcnext {
7150 let val = (self.0 >> 12usize) & 0x01;
7151 super::vals::Crcnext(val as u8)
7152 }
7153 #[doc = "CRC transfer next"]
7154 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
7155 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
7156 }
7157 #[doc = "Hardware CRC calculation enable"]
7158 pub const fn crcen(&self) -> bool {
7159 let val = (self.0 >> 13usize) & 0x01;
7160 val != 0
7161 }
7162 #[doc = "Hardware CRC calculation enable"]
7163 pub fn set_crcen(&mut self, val: bool) {
7164 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
7165 }
7166 #[doc = "Output enable in bidirectional mode"]
7167 pub const fn bidioe(&self) -> super::vals::Bidioe {
7168 let val = (self.0 >> 14usize) & 0x01;
7169 super::vals::Bidioe(val as u8)
7170 }
7171 #[doc = "Output enable in bidirectional mode"]
7172 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) {
7173 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
7174 }
7175 #[doc = "Bidirectional data mode enable"]
7176 pub const fn bidimode(&self) -> super::vals::Bidimode {
7177 let val = (self.0 >> 15usize) & 0x01;
7178 super::vals::Bidimode(val as u8)
7179 } 5475 }
7180 #[doc = "Bidirectional data mode enable"] 5476 #[doc = "CRC register for receiver"]
7181 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { 5477 pub fn set_rxcrc(&mut self, val: u32) {
7182 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 5478 self.0 =
5479 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
7183 } 5480 }
7184 } 5481 }
7185 impl Default for Cr1 { 5482 impl Default for Rxcrc {
7186 fn default() -> Cr1 { 5483 fn default() -> Rxcrc {
7187 Cr1(0) 5484 Rxcrc(0)
7188 } 5485 }
7189 } 5486 }
7190 #[doc = "status register"] 5487 #[doc = "Status Register"]
7191 #[repr(transparent)] 5488 #[repr(transparent)]
7192 #[derive(Copy, Clone, Eq, PartialEq)] 5489 #[derive(Copy, Clone, Eq, PartialEq)]
7193 pub struct Sr(pub u32); 5490 pub struct Sr(pub u32);
7194 impl Sr { 5491 impl Sr {
7195 #[doc = "Receive buffer not empty"] 5492 #[doc = "Rx-Packet available"]
7196 pub const fn rxne(&self) -> bool { 5493 pub const fn rxp(&self) -> bool {
7197 let val = (self.0 >> 0usize) & 0x01; 5494 let val = (self.0 >> 0usize) & 0x01;
7198 val != 0 5495 val != 0
7199 } 5496 }
7200 #[doc = "Receive buffer not empty"] 5497 #[doc = "Rx-Packet available"]
7201 pub fn set_rxne(&mut self, val: bool) { 5498 pub fn set_rxp(&mut self, val: bool) {
7202 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5499 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7203 } 5500 }
7204 #[doc = "Transmit buffer empty"] 5501 #[doc = "Tx-Packet space available"]
7205 pub const fn txe(&self) -> bool { 5502 pub const fn txp(&self) -> bool {
7206 let val = (self.0 >> 1usize) & 0x01; 5503 let val = (self.0 >> 1usize) & 0x01;
7207 val != 0 5504 val != 0
7208 } 5505 }
7209 #[doc = "Transmit buffer empty"] 5506 #[doc = "Tx-Packet space available"]
7210 pub fn set_txe(&mut self, val: bool) { 5507 pub fn set_txp(&mut self, val: bool) {
7211 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5508 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
7212 } 5509 }
7213 #[doc = "CRC error flag"] 5510 #[doc = "Duplex Packet"]
7214 pub const fn crcerr(&self) -> bool { 5511 pub const fn dxp(&self) -> bool {
5512 let val = (self.0 >> 2usize) & 0x01;
5513 val != 0
5514 }
5515 #[doc = "Duplex Packet"]
5516 pub fn set_dxp(&mut self, val: bool) {
5517 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
5518 }
5519 #[doc = "End Of Transfer"]
5520 pub const fn eot(&self) -> bool {
5521 let val = (self.0 >> 3usize) & 0x01;
5522 val != 0
5523 }
5524 #[doc = "End Of Transfer"]
5525 pub fn set_eot(&mut self, val: bool) {
5526 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
5527 }
5528 #[doc = "Transmission Transfer Filled"]
5529 pub const fn txtf(&self) -> bool {
7215 let val = (self.0 >> 4usize) & 0x01; 5530 let val = (self.0 >> 4usize) & 0x01;
7216 val != 0 5531 val != 0
7217 } 5532 }
7218 #[doc = "CRC error flag"] 5533 #[doc = "Transmission Transfer Filled"]
7219 pub fn set_crcerr(&mut self, val: bool) { 5534 pub fn set_txtf(&mut self, val: bool) {
7220 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 5535 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
7221 } 5536 }
7222 #[doc = "Mode fault"] 5537 #[doc = "Underrun at slave transmission mode"]
7223 pub const fn modf(&self) -> bool { 5538 pub const fn udr(&self) -> bool {
7224 let val = (self.0 >> 5usize) & 0x01; 5539 let val = (self.0 >> 5usize) & 0x01;
7225 val != 0 5540 val != 0
7226 } 5541 }
7227 #[doc = "Mode fault"] 5542 #[doc = "Underrun at slave transmission mode"]
7228 pub fn set_modf(&mut self, val: bool) { 5543 pub fn set_udr(&mut self, val: bool) {
7229 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5544 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
7230 } 5545 }
7231 #[doc = "Overrun flag"] 5546 #[doc = "Overrun"]
7232 pub const fn ovr(&self) -> bool { 5547 pub const fn ovr(&self) -> bool {
7233 let val = (self.0 >> 6usize) & 0x01; 5548 let val = (self.0 >> 6usize) & 0x01;
7234 val != 0 5549 val != 0
7235 } 5550 }
7236 #[doc = "Overrun flag"] 5551 #[doc = "Overrun"]
7237 pub fn set_ovr(&mut self, val: bool) { 5552 pub fn set_ovr(&mut self, val: bool) {
7238 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5553 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7239 } 5554 }
7240 #[doc = "Busy flag"] 5555 #[doc = "CRC Error"]
7241 pub const fn bsy(&self) -> bool { 5556 pub const fn crce(&self) -> bool {
7242 let val = (self.0 >> 7usize) & 0x01; 5557 let val = (self.0 >> 7usize) & 0x01;
7243 val != 0 5558 val != 0
7244 } 5559 }
7245 #[doc = "Busy flag"] 5560 #[doc = "CRC Error"]
7246 pub fn set_bsy(&mut self, val: bool) { 5561 pub fn set_crce(&mut self, val: bool) {
7247 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 5562 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
7248 } 5563 }
7249 #[doc = "Frame format error"] 5564 #[doc = "TI frame format error"]
7250 pub const fn fre(&self) -> bool { 5565 pub const fn tifre(&self) -> bool {
7251 let val = (self.0 >> 8usize) & 0x01; 5566 let val = (self.0 >> 8usize) & 0x01;
7252 val != 0 5567 val != 0
7253 } 5568 }
7254 #[doc = "Frame format error"] 5569 #[doc = "TI frame format error"]
7255 pub fn set_fre(&mut self, val: bool) { 5570 pub fn set_tifre(&mut self, val: bool) {
7256 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 5571 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
7257 } 5572 }
7258 #[doc = "FIFO reception level"] 5573 #[doc = "Mode Fault"]
7259 pub const fn frlvl(&self) -> u8 { 5574 pub const fn modf(&self) -> bool {
7260 let val = (self.0 >> 9usize) & 0x03; 5575 let val = (self.0 >> 9usize) & 0x01;
7261 val as u8 5576 val != 0
7262 } 5577 }
7263 #[doc = "FIFO reception level"] 5578 #[doc = "Mode Fault"]
7264 pub fn set_frlvl(&mut self, val: u8) { 5579 pub fn set_modf(&mut self, val: bool) {
7265 self.0 = (self.0 & !(0x03 << 9usize)) | (((val as u32) & 0x03) << 9usize); 5580 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
7266 } 5581 }
7267 #[doc = "FIFO Transmission Level"] 5582 #[doc = "Additional number of SPI data to be transacted was reload"]
7268 pub const fn ftlvl(&self) -> u8 { 5583 pub const fn tserf(&self) -> bool {
7269 let val = (self.0 >> 11usize) & 0x03; 5584 let val = (self.0 >> 10usize) & 0x01;
7270 val as u8 5585 val != 0
7271 } 5586 }
7272 #[doc = "FIFO Transmission Level"] 5587 #[doc = "Additional number of SPI data to be transacted was reload"]
7273 pub fn set_ftlvl(&mut self, val: u8) { 5588 pub fn set_tserf(&mut self, val: bool) {
7274 self.0 = (self.0 & !(0x03 << 11usize)) | (((val as u32) & 0x03) << 11usize); 5589 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
7275 } 5590 }
7276 } 5591 #[doc = "SUSPend"]
7277 impl Default for Sr { 5592 pub const fn susp(&self) -> bool {
7278 fn default() -> Sr { 5593 let val = (self.0 >> 11usize) & 0x01;
7279 Sr(0) 5594 val != 0
7280 } 5595 }
7281 } 5596 #[doc = "SUSPend"]
7282 #[doc = "RX CRC register"] 5597 pub fn set_susp(&mut self, val: bool) {
7283 #[repr(transparent)] 5598 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
7284 #[derive(Copy, Clone, Eq, PartialEq)]
7285 pub struct Rxcrcr(pub u32);
7286 impl Rxcrcr {
7287 #[doc = "Rx CRC register"]
7288 pub const fn rx_crc(&self) -> u16 {
7289 let val = (self.0 >> 0usize) & 0xffff;
7290 val as u16
7291 } 5599 }
7292 #[doc = "Rx CRC register"] 5600 #[doc = "TxFIFO transmission complete"]
7293 pub fn set_rx_crc(&mut self, val: u16) { 5601 pub const fn txc(&self) -> bool {
7294 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 5602 let val = (self.0 >> 12usize) & 0x01;
5603 val != 0
7295 } 5604 }
7296 } 5605 #[doc = "TxFIFO transmission complete"]
7297 impl Default for Rxcrcr { 5606 pub fn set_txc(&mut self, val: bool) {
7298 fn default() -> Rxcrcr { 5607 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
7299 Rxcrcr(0)
7300 } 5608 }
7301 } 5609 #[doc = "RxFIFO Packing LeVeL"]
7302 #[doc = "TX CRC register"] 5610 pub const fn rxplvl(&self) -> super::vals::Rxplvl {
7303 #[repr(transparent)] 5611 let val = (self.0 >> 13usize) & 0x03;
7304 #[derive(Copy, Clone, Eq, PartialEq)] 5612 super::vals::Rxplvl(val as u8)
7305 pub struct Txcrcr(pub u32);
7306 impl Txcrcr {
7307 #[doc = "Tx CRC register"]
7308 pub const fn tx_crc(&self) -> u16 {
7309 let val = (self.0 >> 0usize) & 0xffff;
7310 val as u16
7311 } 5613 }
7312 #[doc = "Tx CRC register"] 5614 #[doc = "RxFIFO Packing LeVeL"]
7313 pub fn set_tx_crc(&mut self, val: u16) { 5615 pub fn set_rxplvl(&mut self, val: super::vals::Rxplvl) {
7314 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 5616 self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize);
7315 } 5617 }
7316 } 5618 #[doc = "RxFIFO Word Not Empty"]
7317 impl Default for Txcrcr { 5619 pub const fn rxwne(&self) -> super::vals::Rxwne {
7318 fn default() -> Txcrcr { 5620 let val = (self.0 >> 15usize) & 0x01;
7319 Txcrcr(0) 5621 super::vals::Rxwne(val as u8)
7320 } 5622 }
7321 } 5623 #[doc = "RxFIFO Word Not Empty"]
7322 #[doc = "data register"] 5624 pub fn set_rxwne(&mut self, val: super::vals::Rxwne) {
7323 #[repr(transparent)] 5625 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
7324 #[derive(Copy, Clone, Eq, PartialEq)] 5626 }
7325 pub struct Dr(pub u32); 5627 #[doc = "Number of data frames remaining in current TSIZE session"]
7326 impl Dr { 5628 pub const fn ctsize(&self) -> u16 {
7327 #[doc = "Data register"] 5629 let val = (self.0 >> 16usize) & 0xffff;
7328 pub const fn dr(&self) -> u16 {
7329 let val = (self.0 >> 0usize) & 0xffff;
7330 val as u16 5630 val as u16
7331 } 5631 }
7332 #[doc = "Data register"] 5632 #[doc = "Number of data frames remaining in current TSIZE session"]
7333 pub fn set_dr(&mut self, val: u16) { 5633 pub fn set_ctsize(&mut self, val: u16) {
7334 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 5634 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
7335 } 5635 }
7336 } 5636 }
7337 impl Default for Dr { 5637 impl Default for Sr {
7338 fn default() -> Dr { 5638 fn default() -> Sr {
7339 Dr(0) 5639 Sr(0)
7340 } 5640 }
7341 } 5641 }
7342 } 5642 }
@@ -7344,1846 +5644,1450 @@ pub mod spi_v2 {
7344 use crate::generic::*; 5644 use crate::generic::*;
7345 #[repr(transparent)] 5645 #[repr(transparent)]
7346 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5646 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7347 pub struct Rxonly(pub u8); 5647 pub struct Fthlv(pub u8);
7348 impl Rxonly { 5648 impl Fthlv {
7349 #[doc = "Full duplex (Transmit and receive)"] 5649 #[doc = "1 frame"]
7350 pub const FULLDUPLEX: Self = Self(0); 5650 pub const ONEFRAME: Self = Self(0);
7351 #[doc = "Output disabled (Receive-only mode)"] 5651 #[doc = "2 frames"]
7352 pub const OUTPUTDISABLED: Self = Self(0x01); 5652 pub const TWOFRAMES: Self = Self(0x01);
5653 #[doc = "3 frames"]
5654 pub const THREEFRAMES: Self = Self(0x02);
5655 #[doc = "4 frames"]
5656 pub const FOURFRAMES: Self = Self(0x03);
5657 #[doc = "5 frames"]
5658 pub const FIVEFRAMES: Self = Self(0x04);
5659 #[doc = "6 frames"]
5660 pub const SIXFRAMES: Self = Self(0x05);
5661 #[doc = "7 frames"]
5662 pub const SEVENFRAMES: Self = Self(0x06);
5663 #[doc = "8 frames"]
5664 pub const EIGHTFRAMES: Self = Self(0x07);
5665 #[doc = "9 frames"]
5666 pub const NINEFRAMES: Self = Self(0x08);
5667 #[doc = "10 frames"]
5668 pub const TENFRAMES: Self = Self(0x09);
5669 #[doc = "11 frames"]
5670 pub const ELEVENFRAMES: Self = Self(0x0a);
5671 #[doc = "12 frames"]
5672 pub const TWELVEFRAMES: Self = Self(0x0b);
5673 #[doc = "13 frames"]
5674 pub const THIRTEENFRAMES: Self = Self(0x0c);
5675 #[doc = "14 frames"]
5676 pub const FOURTEENFRAMES: Self = Self(0x0d);
5677 #[doc = "15 frames"]
5678 pub const FIFTEENFRAMES: Self = Self(0x0e);
5679 #[doc = "16 frames"]
5680 pub const SIXTEENFRAMES: Self = Self(0x0f);
7353 } 5681 }
7354 #[repr(transparent)] 5682 #[repr(transparent)]
7355 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5683 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7356 pub struct Bidioe(pub u8); 5684 pub struct Rxplvl(pub u8);
7357 impl Bidioe { 5685 impl Rxplvl {
7358 #[doc = "Output disabled (receive-only mode)"] 5686 #[doc = "Zero frames beyond packing ratio available"]
7359 pub const OUTPUTDISABLED: Self = Self(0); 5687 pub const ZEROFRAMES: Self = Self(0);
7360 #[doc = "Output enabled (transmit-only mode)"] 5688 #[doc = "One frame beyond packing ratio available"]
7361 pub const OUTPUTENABLED: Self = Self(0x01); 5689 pub const ONEFRAME: Self = Self(0x01);
5690 #[doc = "Two frame beyond packing ratio available"]
5691 pub const TWOFRAMES: Self = Self(0x02);
5692 #[doc = "Three frame beyond packing ratio available"]
5693 pub const THREEFRAMES: Self = Self(0x03);
7362 } 5694 }
7363 #[repr(transparent)] 5695 #[repr(transparent)]
7364 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5696 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7365 pub struct Frxth(pub u8); 5697 pub struct Rxwne(pub u8);
7366 impl Frxth { 5698 impl Rxwne {
7367 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"] 5699 #[doc = "Less than 32-bit data frame received"]
7368 pub const HALF: Self = Self(0); 5700 pub const LESSTHAN32: Self = Self(0);
7369 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"] 5701 #[doc = "At least 32-bit data frame received"]
7370 pub const QUARTER: Self = Self(0x01); 5702 pub const ATLEAST32: Self = Self(0x01);
7371 } 5703 }
7372 #[repr(transparent)] 5704 #[repr(transparent)]
7373 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5705 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7374 pub struct Crcl(pub u8); 5706 pub struct Lsbfrst(pub u8);
7375 impl Crcl { 5707 impl Lsbfrst {
7376 #[doc = "8-bit CRC length"] 5708 #[doc = "Data is transmitted/received with the MSB first"]
7377 pub const EIGHTBIT: Self = Self(0); 5709 pub const MSBFIRST: Self = Self(0);
7378 #[doc = "16-bit CRC length"] 5710 #[doc = "Data is transmitted/received with the LSB first"]
7379 pub const SIXTEENBIT: Self = Self(0x01); 5711 pub const LSBFIRST: Self = Self(0x01);
7380 } 5712 }
7381 #[repr(transparent)] 5713 #[repr(transparent)]
7382 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5714 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7383 pub struct Bidimode(pub u8); 5715 pub struct Datlen(pub u8);
7384 impl Bidimode { 5716 impl Datlen {
7385 #[doc = "2-line unidirectional data mode selected"] 5717 #[doc = "16 bit data length"]
7386 pub const UNIDIRECTIONAL: Self = Self(0); 5718 pub const BITS16: Self = Self(0);
7387 #[doc = "1-line bidirectional data mode selected"] 5719 #[doc = "24 bit data length"]
7388 pub const BIDIRECTIONAL: Self = Self(0x01); 5720 pub const BITS24: Self = Self(0x01);
5721 #[doc = "32 bit data length"]
5722 pub const BITS32: Self = Self(0x02);
7389 } 5723 }
7390 #[repr(transparent)] 5724 #[repr(transparent)]
7391 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5725 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7392 pub struct Mstr(pub u8); 5726 pub struct Tcrcini(pub u8);
7393 impl Mstr { 5727 impl Tcrcini {
7394 #[doc = "Slave configuration"] 5728 #[doc = "All zeros TX CRC initialization pattern"]
7395 pub const SLAVE: Self = Self(0); 5729 pub const ALLZEROS: Self = Self(0);
7396 #[doc = "Master configuration"] 5730 #[doc = "All ones TX CRC initialization pattern"]
7397 pub const MASTER: Self = Self(0x01); 5731 pub const ALLONES: Self = Self(0x01);
7398 } 5732 }
7399 #[repr(transparent)] 5733 #[repr(transparent)]
7400 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5734 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7401 pub struct Br(pub u8); 5735 pub struct Cpha(pub u8);
7402 impl Br { 5736 impl Cpha {
7403 #[doc = "f_PCLK / 2"] 5737 #[doc = "The first clock transition is the first data capture edge"]
7404 pub const DIV2: Self = Self(0); 5738 pub const FIRSTEDGE: Self = Self(0);
7405 #[doc = "f_PCLK / 4"] 5739 #[doc = "The second clock transition is the first data capture edge"]
7406 pub const DIV4: Self = Self(0x01); 5740 pub const SECONDEDGE: Self = Self(0x01);
7407 #[doc = "f_PCLK / 8"]
7408 pub const DIV8: Self = Self(0x02);
7409 #[doc = "f_PCLK / 16"]
7410 pub const DIV16: Self = Self(0x03);
7411 #[doc = "f_PCLK / 32"]
7412 pub const DIV32: Self = Self(0x04);
7413 #[doc = "f_PCLK / 64"]
7414 pub const DIV64: Self = Self(0x05);
7415 #[doc = "f_PCLK / 128"]
7416 pub const DIV128: Self = Self(0x06);
7417 #[doc = "f_PCLK / 256"]
7418 pub const DIV256: Self = Self(0x07);
7419 } 5741 }
7420 #[repr(transparent)] 5742 #[repr(transparent)]
7421 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5743 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7422 pub struct Cpol(pub u8); 5744 pub struct Datfmt(pub u8);
7423 impl Cpol { 5745 impl Datfmt {
7424 #[doc = "CK to 0 when idle"] 5746 #[doc = "The data inside RXDR and TXDR are right aligned"]
7425 pub const IDLELOW: Self = Self(0); 5747 pub const RIGHTALIGNED: Self = Self(0);
7426 #[doc = "CK to 1 when idle"] 5748 #[doc = "The data inside RXDR and TXDR are left aligned"]
7427 pub const IDLEHIGH: Self = Self(0x01); 5749 pub const LEFTALIGNED: Self = Self(0x01);
7428 } 5750 }
7429 #[repr(transparent)] 5751 #[repr(transparent)]
7430 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5752 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7431 pub struct Frer(pub u8); 5753 pub struct Hddir(pub u8);
7432 impl Frer { 5754 impl Hddir {
7433 #[doc = "No frame format error"] 5755 #[doc = "Receiver in half duplex mode"]
7434 pub const NOERROR: Self = Self(0); 5756 pub const RECEIVER: Self = Self(0);
7435 #[doc = "A frame format error occurred"] 5757 #[doc = "Transmitter in half duplex mode"]
7436 pub const ERROR: Self = Self(0x01); 5758 pub const TRANSMITTER: Self = Self(0x01);
7437 } 5759 }
7438 #[repr(transparent)] 5760 #[repr(transparent)]
7439 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5761 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7440 pub struct Cpha(pub u8); 5762 pub struct Rcrcini(pub u8);
7441 impl Cpha { 5763 impl Rcrcini {
7442 #[doc = "The first clock transition is the first data capture edge"] 5764 #[doc = "All zeros RX CRC initialization pattern"]
7443 pub const FIRSTEDGE: Self = Self(0); 5765 pub const ALLZEROS: Self = Self(0);
7444 #[doc = "The second clock transition is the first data capture edge"] 5766 #[doc = "All ones RX CRC initialization pattern"]
7445 pub const SECONDEDGE: Self = Self(0x01); 5767 pub const ALLONES: Self = Self(0x01);
7446 } 5768 }
7447 #[repr(transparent)] 5769 #[repr(transparent)]
7448 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5770 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7449 pub struct Crcnext(pub u8); 5771 pub struct Udrdet(pub u8);
7450 impl Crcnext { 5772 impl Udrdet {
7451 #[doc = "Next transmit value is from Tx buffer"] 5773 #[doc = "Underrun is detected at begin of data frame"]
7452 pub const TXBUFFER: Self = Self(0); 5774 pub const STARTOFFRAME: Self = Self(0);
7453 #[doc = "Next transmit value is from Tx CRC register"] 5775 #[doc = "Underrun is detected at end of last data frame"]
7454 pub const CRC: Self = Self(0x01); 5776 pub const ENDOFFRAME: Self = Self(0x01);
5777 #[doc = "Underrun is detected at begin of active SS signal"]
5778 pub const STARTOFSLAVESELECT: Self = Self(0x02);
7455 } 5779 }
7456 #[repr(transparent)] 5780 #[repr(transparent)]
7457 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5781 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7458 pub struct Frf(pub u8); 5782 pub struct Master(pub u8);
7459 impl Frf { 5783 impl Master {
7460 #[doc = "SPI Motorola mode"] 5784 #[doc = "Slave configuration"]
5785 pub const SLAVE: Self = Self(0);
5786 #[doc = "Master configuration"]
5787 pub const MASTER: Self = Self(0x01);
5788 }
5789 #[repr(transparent)]
5790 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5791 pub struct Udrcfg(pub u8);
5792 impl Udrcfg {
5793 #[doc = "Slave sends a constant underrun pattern"]
5794 pub const CONSTANT: Self = Self(0);
5795 #[doc = "Slave repeats last received data frame from master"]
5796 pub const REPEATRECEIVED: Self = Self(0x01);
5797 #[doc = "Slave repeats last transmitted data frame"]
5798 pub const REPEATTRANSMITTED: Self = Self(0x02);
5799 }
5800 #[repr(transparent)]
5801 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5802 pub struct Sp(pub u8);
5803 impl Sp {
5804 #[doc = "Motorola SPI protocol"]
7461 pub const MOTOROLA: Self = Self(0); 5805 pub const MOTOROLA: Self = Self(0);
7462 #[doc = "SPI TI mode"] 5806 #[doc = "TI SPI protocol"]
7463 pub const TI: Self = Self(0x01); 5807 pub const TI: Self = Self(0x01);
7464 } 5808 }
7465 #[repr(transparent)] 5809 #[repr(transparent)]
7466 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5810 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7467 pub struct Ds(pub u8); 5811 pub struct Comm(pub u8);
7468 impl Ds { 5812 impl Comm {
7469 #[doc = "4-bit"] 5813 #[doc = "Full duplex"]
7470 pub const FOURBIT: Self = Self(0x03); 5814 pub const FULLDUPLEX: Self = Self(0);
7471 #[doc = "5-bit"] 5815 #[doc = "Simplex transmitter only"]
7472 pub const FIVEBIT: Self = Self(0x04); 5816 pub const TRANSMITTER: Self = Self(0x01);
7473 #[doc = "6-bit"] 5817 #[doc = "Simplex receiver only"]
7474 pub const SIXBIT: Self = Self(0x05); 5818 pub const RECEIVER: Self = Self(0x02);
7475 #[doc = "7-bit"] 5819 #[doc = "Half duplex"]
7476 pub const SEVENBIT: Self = Self(0x06); 5820 pub const HALFDUPLEX: Self = Self(0x03);
7477 #[doc = "8-bit"]
7478 pub const EIGHTBIT: Self = Self(0x07);
7479 #[doc = "9-bit"]
7480 pub const NINEBIT: Self = Self(0x08);
7481 #[doc = "10-bit"]
7482 pub const TENBIT: Self = Self(0x09);
7483 #[doc = "11-bit"]
7484 pub const ELEVENBIT: Self = Self(0x0a);
7485 #[doc = "12-bit"]
7486 pub const TWELVEBIT: Self = Self(0x0b);
7487 #[doc = "13-bit"]
7488 pub const THIRTEENBIT: Self = Self(0x0c);
7489 #[doc = "14-bit"]
7490 pub const FOURTEENBIT: Self = Self(0x0d);
7491 #[doc = "15-bit"]
7492 pub const FIFTEENBIT: Self = Self(0x0e);
7493 #[doc = "16-bit"]
7494 pub const SIXTEENBIT: Self = Self(0x0f);
7495 } 5821 }
7496 #[repr(transparent)] 5822 #[repr(transparent)]
7497 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5823 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7498 pub struct LdmaRx(pub u8); 5824 pub struct Ssiop(pub u8);
7499 impl LdmaRx { 5825 impl Ssiop {
7500 #[doc = "Number of data to transfer for receive is even"] 5826 #[doc = "Low level is active for SS signal"]
7501 pub const EVEN: Self = Self(0); 5827 pub const ACTIVELOW: Self = Self(0);
7502 #[doc = "Number of data to transfer for receive is odd"] 5828 #[doc = "High level is active for SS signal"]
7503 pub const ODD: Self = Self(0x01); 5829 pub const ACTIVEHIGH: Self = Self(0x01);
7504 } 5830 }
7505 #[repr(transparent)] 5831 #[repr(transparent)]
7506 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5832 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7507 pub struct Ftlvlr(pub u8); 5833 pub struct Cpol(pub u8);
7508 impl Ftlvlr { 5834 impl Cpol {
7509 #[doc = "Tx FIFO Empty"] 5835 #[doc = "CK to 0 when idle"]
7510 pub const EMPTY: Self = Self(0); 5836 pub const IDLELOW: Self = Self(0);
7511 #[doc = "Tx 1/4 FIFO"] 5837 #[doc = "CK to 1 when idle"]
7512 pub const QUARTER: Self = Self(0x01); 5838 pub const IDLEHIGH: Self = Self(0x01);
7513 #[doc = "Tx 1/2 FIFO"]
7514 pub const HALF: Self = Self(0x02);
7515 #[doc = "Tx FIFO full"]
7516 pub const FULL: Self = Self(0x03);
7517 } 5839 }
7518 #[repr(transparent)] 5840 #[repr(transparent)]
7519 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5841 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7520 pub struct Lsbfirst(pub u8); 5842 pub struct Afcntr(pub u8);
7521 impl Lsbfirst { 5843 impl Afcntr {
7522 #[doc = "Data is transmitted/received with the MSB first"] 5844 #[doc = "Peripheral takes no control of GPIOs while disabled"]
7523 pub const MSBFIRST: Self = Self(0); 5845 pub const NOTCONTROLLED: Self = Self(0);
7524 #[doc = "Data is transmitted/received with the LSB first"] 5846 #[doc = "Peripheral controls GPIOs while disabled"]
7525 pub const LSBFIRST: Self = Self(0x01); 5847 pub const CONTROLLED: Self = Self(0x01);
7526 } 5848 }
7527 #[repr(transparent)] 5849 #[repr(transparent)]
7528 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5850 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7529 pub struct Frlvlr(pub u8); 5851 pub struct Crc(pub u8);
7530 impl Frlvlr { 5852 impl Crc {
7531 #[doc = "Rx FIFO Empty"] 5853 #[doc = "Full size (33/17 bit) CRC polynomial is not used"]
7532 pub const EMPTY: Self = Self(0); 5854 pub const DISABLED: Self = Self(0);
7533 #[doc = "Rx 1/4 FIFO"] 5855 #[doc = "Full size (33/17 bit) CRC polynomial is used"]
7534 pub const QUARTER: Self = Self(0x01); 5856 pub const ENABLED: Self = Self(0x01);
7535 #[doc = "Rx 1/2 FIFO"]
7536 pub const HALF: Self = Self(0x02);
7537 #[doc = "Rx FIFO full"]
7538 pub const FULL: Self = Self(0x03);
7539 } 5857 }
7540 #[repr(transparent)] 5858 #[repr(transparent)]
7541 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 5859 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
7542 pub struct LdmaTx(pub u8); 5860 pub struct Mbr(pub u8);
7543 impl LdmaTx { 5861 impl Mbr {
7544 #[doc = "Number of data to transfer for transmit is even"] 5862 #[doc = "f_spi_ker_ck / 2"]
7545 pub const EVEN: Self = Self(0); 5863 pub const DIV2: Self = Self(0);
7546 #[doc = "Number of data to transfer for transmit is odd"] 5864 #[doc = "f_spi_ker_ck / 4"]
7547 pub const ODD: Self = Self(0x01); 5865 pub const DIV4: Self = Self(0x01);
5866 #[doc = "f_spi_ker_ck / 8"]
5867 pub const DIV8: Self = Self(0x02);
5868 #[doc = "f_spi_ker_ck / 16"]
5869 pub const DIV16: Self = Self(0x03);
5870 #[doc = "f_spi_ker_ck / 32"]
5871 pub const DIV32: Self = Self(0x04);
5872 #[doc = "f_spi_ker_ck / 64"]
5873 pub const DIV64: Self = Self(0x05);
5874 #[doc = "f_spi_ker_ck / 128"]
5875 pub const DIV128: Self = Self(0x06);
5876 #[doc = "f_spi_ker_ck / 256"]
5877 pub const DIV256: Self = Self(0x07);
5878 }
5879 #[repr(transparent)]
5880 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5881 pub struct Ssom(pub u8);
5882 impl Ssom {
5883 #[doc = "SS is asserted until data transfer complete"]
5884 pub const ASSERTED: Self = Self(0);
5885 #[doc = "Data frames interleaved with SS not asserted during MIDI"]
5886 pub const NOTASSERTED: Self = Self(0x01);
7548 } 5887 }
7549 } 5888 }
7550} 5889}
7551pub mod usart_v1 { 5890pub mod dma_v1 {
7552 use crate::generic::*; 5891 use crate::generic::*;
7553 #[doc = "Universal synchronous asynchronous receiver transmitter"] 5892 #[doc = "DMA controller"]
7554 #[derive(Copy, Clone)] 5893 #[derive(Copy, Clone)]
7555 pub struct Usart(pub *mut u8); 5894 pub struct Dma(pub *mut u8);
7556 unsafe impl Send for Usart {} 5895 unsafe impl Send for Dma {}
7557 unsafe impl Sync for Usart {} 5896 unsafe impl Sync for Dma {}
7558 impl Usart { 5897 impl Dma {
7559 #[doc = "Status register"] 5898 #[doc = "DMA interrupt status register (DMA_ISR)"]
7560 pub fn sr(self) -> Reg<regs::Sr, RW> { 5899 pub fn isr(self) -> Reg<regs::Isr, R> {
7561 unsafe { Reg::from_ptr(self.0.add(0usize)) } 5900 unsafe { Reg::from_ptr(self.0.add(0usize)) }
7562 } 5901 }
7563 #[doc = "Data register"] 5902 #[doc = "DMA interrupt flag clear register (DMA_IFCR)"]
7564 pub fn dr(self) -> Reg<regs::Dr, RW> { 5903 pub fn ifcr(self) -> Reg<regs::Ifcr, W> {
7565 unsafe { Reg::from_ptr(self.0.add(4usize)) } 5904 unsafe { Reg::from_ptr(self.0.add(4usize)) }
7566 } 5905 }
7567 #[doc = "Baud rate register"] 5906 #[doc = "Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers"]
7568 pub fn brr(self) -> Reg<regs::Brr, RW> { 5907 pub fn ch(self, n: usize) -> Ch {
7569 unsafe { Reg::from_ptr(self.0.add(8usize)) } 5908 assert!(n < 7usize);
7570 } 5909 unsafe { Ch(self.0.add(8usize + n * 20usize)) }
7571 #[doc = "Control register 1"]
7572 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
7573 unsafe { Reg::from_ptr(self.0.add(12usize)) }
7574 }
7575 #[doc = "Control register 2"]
7576 pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> {
7577 unsafe { Reg::from_ptr(self.0.add(16usize)) }
7578 }
7579 #[doc = "Control register 3"]
7580 pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> {
7581 unsafe { Reg::from_ptr(self.0.add(20usize)) }
7582 }
7583 #[doc = "Guard time and prescaler register"]
7584 pub fn gtpr(self) -> Reg<regs::Gtpr, RW> {
7585 unsafe { Reg::from_ptr(self.0.add(24usize)) }
7586 } 5910 }
7587 } 5911 }
7588 #[doc = "Universal asynchronous receiver transmitter"] 5912 #[doc = "Channel cluster: CCR?, CNDTR?, CPAR?, and CMAR? registers"]
7589 #[derive(Copy, Clone)] 5913 #[derive(Copy, Clone)]
7590 pub struct Uart(pub *mut u8); 5914 pub struct Ch(pub *mut u8);
7591 unsafe impl Send for Uart {} 5915 unsafe impl Send for Ch {}
7592 unsafe impl Sync for Uart {} 5916 unsafe impl Sync for Ch {}
7593 impl Uart { 5917 impl Ch {
7594 #[doc = "Status register"] 5918 #[doc = "DMA channel configuration register (DMA_CCR)"]
7595 pub fn sr(self) -> Reg<regs::Sr, RW> { 5919 pub fn cr(self) -> Reg<regs::Cr, RW> {
7596 unsafe { Reg::from_ptr(self.0.add(0usize)) } 5920 unsafe { Reg::from_ptr(self.0.add(0usize)) }
7597 } 5921 }
7598 #[doc = "Data register"] 5922 #[doc = "DMA channel 1 number of data register"]
7599 pub fn dr(self) -> Reg<regs::Dr, RW> { 5923 pub fn ndtr(self) -> Reg<regs::Ndtr, RW> {
7600 unsafe { Reg::from_ptr(self.0.add(4usize)) } 5924 unsafe { Reg::from_ptr(self.0.add(4usize)) }
7601 } 5925 }
7602 #[doc = "Baud rate register"] 5926 #[doc = "DMA channel 1 peripheral address register"]
7603 pub fn brr(self) -> Reg<regs::Brr, RW> { 5927 pub fn par(self) -> Reg<u32, RW> {
7604 unsafe { Reg::from_ptr(self.0.add(8usize)) } 5928 unsafe { Reg::from_ptr(self.0.add(8usize)) }
7605 } 5929 }
7606 #[doc = "Control register 1"] 5930 #[doc = "DMA channel 1 memory address register"]
7607 pub fn cr1(self) -> Reg<regs::Cr1, RW> { 5931 pub fn mar(self) -> Reg<u32, RW> {
7608 unsafe { Reg::from_ptr(self.0.add(12usize)) } 5932 unsafe { Reg::from_ptr(self.0.add(12usize)) }
7609 } 5933 }
7610 #[doc = "Control register 2"]
7611 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
7612 unsafe { Reg::from_ptr(self.0.add(16usize)) }
7613 }
7614 #[doc = "Control register 3"]
7615 pub fn cr3(self) -> Reg<regs::Cr3, RW> {
7616 unsafe { Reg::from_ptr(self.0.add(20usize)) }
7617 }
7618 } 5934 }
7619 pub mod regs { 5935 pub mod regs {
7620 use crate::generic::*; 5936 use crate::generic::*;
7621 #[doc = "Guard time and prescaler register"] 5937 #[doc = "DMA channel configuration register (DMA_CCR)"]
7622 #[repr(transparent)]
7623 #[derive(Copy, Clone, Eq, PartialEq)]
7624 pub struct Gtpr(pub u32);
7625 impl Gtpr {
7626 #[doc = "Prescaler value"]
7627 pub const fn psc(&self) -> u8 {
7628 let val = (self.0 >> 0usize) & 0xff;
7629 val as u8
7630 }
7631 #[doc = "Prescaler value"]
7632 pub fn set_psc(&mut self, val: u8) {
7633 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
7634 }
7635 #[doc = "Guard time value"]
7636 pub const fn gt(&self) -> u8 {
7637 let val = (self.0 >> 8usize) & 0xff;
7638 val as u8
7639 }
7640 #[doc = "Guard time value"]
7641 pub fn set_gt(&mut self, val: u8) {
7642 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
7643 }
7644 }
7645 impl Default for Gtpr {
7646 fn default() -> Gtpr {
7647 Gtpr(0)
7648 }
7649 }
7650 #[doc = "Data register"]
7651 #[repr(transparent)]
7652 #[derive(Copy, Clone, Eq, PartialEq)]
7653 pub struct Dr(pub u32);
7654 impl Dr {
7655 #[doc = "Data value"]
7656 pub const fn dr(&self) -> u16 {
7657 let val = (self.0 >> 0usize) & 0x01ff;
7658 val as u16
7659 }
7660 #[doc = "Data value"]
7661 pub fn set_dr(&mut self, val: u16) {
7662 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
7663 }
7664 }
7665 impl Default for Dr {
7666 fn default() -> Dr {
7667 Dr(0)
7668 }
7669 }
7670 #[doc = "Status register"]
7671 #[repr(transparent)] 5938 #[repr(transparent)]
7672 #[derive(Copy, Clone, Eq, PartialEq)] 5939 #[derive(Copy, Clone, Eq, PartialEq)]
7673 pub struct SrUsart(pub u32); 5940 pub struct Cr(pub u32);
7674 impl SrUsart { 5941 impl Cr {
7675 #[doc = "Parity error"] 5942 #[doc = "Channel enable"]
7676 pub const fn pe(&self) -> bool { 5943 pub const fn en(&self) -> bool {
7677 let val = (self.0 >> 0usize) & 0x01; 5944 let val = (self.0 >> 0usize) & 0x01;
7678 val != 0 5945 val != 0
7679 } 5946 }
7680 #[doc = "Parity error"] 5947 #[doc = "Channel enable"]
7681 pub fn set_pe(&mut self, val: bool) { 5948 pub fn set_en(&mut self, val: bool) {
7682 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5949 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7683 } 5950 }
7684 #[doc = "Framing error"] 5951 #[doc = "Transfer complete interrupt enable"]
7685 pub const fn fe(&self) -> bool { 5952 pub const fn tcie(&self) -> bool {
7686 let val = (self.0 >> 1usize) & 0x01; 5953 let val = (self.0 >> 1usize) & 0x01;
7687 val != 0 5954 val != 0
7688 } 5955 }
7689 #[doc = "Framing error"] 5956 #[doc = "Transfer complete interrupt enable"]
7690 pub fn set_fe(&mut self, val: bool) { 5957 pub fn set_tcie(&mut self, val: bool) {
7691 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5958 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
7692 } 5959 }
7693 #[doc = "Noise error flag"] 5960 #[doc = "Half Transfer interrupt enable"]
7694 pub const fn ne(&self) -> bool { 5961 pub const fn htie(&self) -> bool {
7695 let val = (self.0 >> 2usize) & 0x01; 5962 let val = (self.0 >> 2usize) & 0x01;
7696 val != 0 5963 val != 0
7697 } 5964 }
7698 #[doc = "Noise error flag"] 5965 #[doc = "Half Transfer interrupt enable"]
7699 pub fn set_ne(&mut self, val: bool) { 5966 pub fn set_htie(&mut self, val: bool) {
7700 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5967 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
7701 } 5968 }
7702 #[doc = "Overrun error"] 5969 #[doc = "Transfer error interrupt enable"]
7703 pub const fn ore(&self) -> bool { 5970 pub const fn teie(&self) -> bool {
7704 let val = (self.0 >> 3usize) & 0x01; 5971 let val = (self.0 >> 3usize) & 0x01;
7705 val != 0 5972 val != 0
7706 } 5973 }
7707 #[doc = "Overrun error"] 5974 #[doc = "Transfer error interrupt enable"]
7708 pub fn set_ore(&mut self, val: bool) { 5975 pub fn set_teie(&mut self, val: bool) {
7709 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 5976 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
7710 } 5977 }
7711 #[doc = "IDLE line detected"] 5978 #[doc = "Data transfer direction"]
7712 pub const fn idle(&self) -> bool { 5979 pub const fn dir(&self) -> super::vals::Dir {
7713 let val = (self.0 >> 4usize) & 0x01; 5980 let val = (self.0 >> 4usize) & 0x01;
7714 val != 0 5981 super::vals::Dir(val as u8)
7715 } 5982 }
7716 #[doc = "IDLE line detected"] 5983 #[doc = "Data transfer direction"]
7717 pub fn set_idle(&mut self, val: bool) { 5984 pub fn set_dir(&mut self, val: super::vals::Dir) {
7718 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 5985 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
7719 } 5986 }
7720 #[doc = "Read data register not empty"] 5987 #[doc = "Circular mode"]
7721 pub const fn rxne(&self) -> bool { 5988 pub const fn circ(&self) -> super::vals::Circ {
7722 let val = (self.0 >> 5usize) & 0x01; 5989 let val = (self.0 >> 5usize) & 0x01;
7723 val != 0 5990 super::vals::Circ(val as u8)
7724 } 5991 }
7725 #[doc = "Read data register not empty"] 5992 #[doc = "Circular mode"]
7726 pub fn set_rxne(&mut self, val: bool) { 5993 pub fn set_circ(&mut self, val: super::vals::Circ) {
7727 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5994 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
7728 } 5995 }
7729 #[doc = "Transmission complete"] 5996 #[doc = "Peripheral increment mode"]
7730 pub const fn tc(&self) -> bool { 5997 pub const fn pinc(&self) -> super::vals::Inc {
7731 let val = (self.0 >> 6usize) & 0x01; 5998 let val = (self.0 >> 6usize) & 0x01;
7732 val != 0 5999 super::vals::Inc(val as u8)
7733 } 6000 }
7734 #[doc = "Transmission complete"] 6001 #[doc = "Peripheral increment mode"]
7735 pub fn set_tc(&mut self, val: bool) { 6002 pub fn set_pinc(&mut self, val: super::vals::Inc) {
7736 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 6003 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
7737 } 6004 }
7738 #[doc = "Transmit data register empty"] 6005 #[doc = "Memory increment mode"]
7739 pub const fn txe(&self) -> bool { 6006 pub const fn minc(&self) -> super::vals::Inc {
7740 let val = (self.0 >> 7usize) & 0x01; 6007 let val = (self.0 >> 7usize) & 0x01;
7741 val != 0 6008 super::vals::Inc(val as u8)
7742 }
7743 #[doc = "Transmit data register empty"]
7744 pub fn set_txe(&mut self, val: bool) {
7745 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
7746 }
7747 #[doc = "LIN break detection flag"]
7748 pub const fn lbd(&self) -> bool {
7749 let val = (self.0 >> 8usize) & 0x01;
7750 val != 0
7751 }
7752 #[doc = "LIN break detection flag"]
7753 pub fn set_lbd(&mut self, val: bool) {
7754 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
7755 }
7756 #[doc = "CTS flag"]
7757 pub const fn cts(&self) -> bool {
7758 let val = (self.0 >> 9usize) & 0x01;
7759 val != 0
7760 }
7761 #[doc = "CTS flag"]
7762 pub fn set_cts(&mut self, val: bool) {
7763 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
7764 }
7765 }
7766 impl Default for SrUsart {
7767 fn default() -> SrUsart {
7768 SrUsart(0)
7769 }
7770 }
7771 #[doc = "Control register 3"]
7772 #[repr(transparent)]
7773 #[derive(Copy, Clone, Eq, PartialEq)]
7774 pub struct Cr3(pub u32);
7775 impl Cr3 {
7776 #[doc = "Error interrupt enable"]
7777 pub const fn eie(&self) -> bool {
7778 let val = (self.0 >> 0usize) & 0x01;
7779 val != 0
7780 }
7781 #[doc = "Error interrupt enable"]
7782 pub fn set_eie(&mut self, val: bool) {
7783 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7784 }
7785 #[doc = "IrDA mode enable"]
7786 pub const fn iren(&self) -> bool {
7787 let val = (self.0 >> 1usize) & 0x01;
7788 val != 0
7789 } 6009 }
7790 #[doc = "IrDA mode enable"] 6010 #[doc = "Memory increment mode"]
7791 pub fn set_iren(&mut self, val: bool) { 6011 pub fn set_minc(&mut self, val: super::vals::Inc) {
7792 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 6012 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
7793 } 6013 }
7794 #[doc = "IrDA low-power"] 6014 #[doc = "Peripheral size"]
7795 pub const fn irlp(&self) -> super::vals::Irlp { 6015 pub const fn psize(&self) -> super::vals::Size {
7796 let val = (self.0 >> 2usize) & 0x01; 6016 let val = (self.0 >> 8usize) & 0x03;
7797 super::vals::Irlp(val as u8) 6017 super::vals::Size(val as u8)
7798 } 6018 }
7799 #[doc = "IrDA low-power"] 6019 #[doc = "Peripheral size"]
7800 pub fn set_irlp(&mut self, val: super::vals::Irlp) { 6020 pub fn set_psize(&mut self, val: super::vals::Size) {
7801 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 6021 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
7802 } 6022 }
7803 #[doc = "Half-duplex selection"] 6023 #[doc = "Memory size"]
7804 pub const fn hdsel(&self) -> super::vals::Hdsel { 6024 pub const fn msize(&self) -> super::vals::Size {
7805 let val = (self.0 >> 3usize) & 0x01; 6025 let val = (self.0 >> 10usize) & 0x03;
7806 super::vals::Hdsel(val as u8) 6026 super::vals::Size(val as u8)
7807 } 6027 }
7808 #[doc = "Half-duplex selection"] 6028 #[doc = "Memory size"]
7809 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { 6029 pub fn set_msize(&mut self, val: super::vals::Size) {
7810 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 6030 self.0 = (self.0 & !(0x03 << 10usize)) | (((val.0 as u32) & 0x03) << 10usize);
7811 } 6031 }
7812 #[doc = "DMA enable receiver"] 6032 #[doc = "Channel Priority level"]
7813 pub const fn dmar(&self) -> bool { 6033 pub const fn pl(&self) -> super::vals::Pl {
7814 let val = (self.0 >> 6usize) & 0x01; 6034 let val = (self.0 >> 12usize) & 0x03;
7815 val != 0 6035 super::vals::Pl(val as u8)
7816 } 6036 }
7817 #[doc = "DMA enable receiver"] 6037 #[doc = "Channel Priority level"]
7818 pub fn set_dmar(&mut self, val: bool) { 6038 pub fn set_pl(&mut self, val: super::vals::Pl) {
7819 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 6039 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
7820 } 6040 }
7821 #[doc = "DMA enable transmitter"] 6041 #[doc = "Memory to memory mode"]
7822 pub const fn dmat(&self) -> bool { 6042 pub const fn mem2mem(&self) -> super::vals::Memmem {
7823 let val = (self.0 >> 7usize) & 0x01; 6043 let val = (self.0 >> 14usize) & 0x01;
7824 val != 0 6044 super::vals::Memmem(val as u8)
7825 } 6045 }
7826 #[doc = "DMA enable transmitter"] 6046 #[doc = "Memory to memory mode"]
7827 pub fn set_dmat(&mut self, val: bool) { 6047 pub fn set_mem2mem(&mut self, val: super::vals::Memmem) {
7828 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 6048 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
7829 } 6049 }
7830 } 6050 }
7831 impl Default for Cr3 { 6051 impl Default for Cr {
7832 fn default() -> Cr3 { 6052 fn default() -> Cr {
7833 Cr3(0) 6053 Cr(0)
7834 } 6054 }
7835 } 6055 }
7836 #[doc = "Control register 3"] 6056 #[doc = "DMA interrupt flag clear register (DMA_IFCR)"]
7837 #[repr(transparent)] 6057 #[repr(transparent)]
7838 #[derive(Copy, Clone, Eq, PartialEq)] 6058 #[derive(Copy, Clone, Eq, PartialEq)]
7839 pub struct Cr3Usart(pub u32); 6059 pub struct Ifcr(pub u32);
7840 impl Cr3Usart { 6060 impl Ifcr {
7841 #[doc = "Error interrupt enable"] 6061 #[doc = "Channel 1 Global interrupt clear"]
7842 pub const fn eie(&self) -> bool { 6062 pub fn cgif(&self, n: usize) -> bool {
7843 let val = (self.0 >> 0usize) & 0x01; 6063 assert!(n < 7usize);
7844 val != 0 6064 let offs = 0usize + n * 4usize;
7845 } 6065 let val = (self.0 >> offs) & 0x01;
7846 #[doc = "Error interrupt enable"]
7847 pub fn set_eie(&mut self, val: bool) {
7848 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7849 }
7850 #[doc = "IrDA mode enable"]
7851 pub const fn iren(&self) -> bool {
7852 let val = (self.0 >> 1usize) & 0x01;
7853 val != 0
7854 }
7855 #[doc = "IrDA mode enable"]
7856 pub fn set_iren(&mut self, val: bool) {
7857 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
7858 }
7859 #[doc = "IrDA low-power"]
7860 pub const fn irlp(&self) -> super::vals::Irlp {
7861 let val = (self.0 >> 2usize) & 0x01;
7862 super::vals::Irlp(val as u8)
7863 }
7864 #[doc = "IrDA low-power"]
7865 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
7866 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
7867 }
7868 #[doc = "Half-duplex selection"]
7869 pub const fn hdsel(&self) -> super::vals::Hdsel {
7870 let val = (self.0 >> 3usize) & 0x01;
7871 super::vals::Hdsel(val as u8)
7872 }
7873 #[doc = "Half-duplex selection"]
7874 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
7875 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
7876 }
7877 #[doc = "Smartcard NACK enable"]
7878 pub const fn nack(&self) -> bool {
7879 let val = (self.0 >> 4usize) & 0x01;
7880 val != 0
7881 }
7882 #[doc = "Smartcard NACK enable"]
7883 pub fn set_nack(&mut self, val: bool) {
7884 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
7885 }
7886 #[doc = "Smartcard mode enable"]
7887 pub const fn scen(&self) -> bool {
7888 let val = (self.0 >> 5usize) & 0x01;
7889 val != 0
7890 }
7891 #[doc = "Smartcard mode enable"]
7892 pub fn set_scen(&mut self, val: bool) {
7893 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
7894 }
7895 #[doc = "DMA enable receiver"]
7896 pub const fn dmar(&self) -> bool {
7897 let val = (self.0 >> 6usize) & 0x01;
7898 val != 0
7899 }
7900 #[doc = "DMA enable receiver"]
7901 pub fn set_dmar(&mut self, val: bool) {
7902 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7903 }
7904 #[doc = "DMA enable transmitter"]
7905 pub const fn dmat(&self) -> bool {
7906 let val = (self.0 >> 7usize) & 0x01;
7907 val != 0 6066 val != 0
7908 } 6067 }
7909 #[doc = "DMA enable transmitter"] 6068 #[doc = "Channel 1 Global interrupt clear"]
7910 pub fn set_dmat(&mut self, val: bool) { 6069 pub fn set_cgif(&mut self, n: usize, val: bool) {
7911 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 6070 assert!(n < 7usize);
6071 let offs = 0usize + n * 4usize;
6072 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7912 } 6073 }
7913 #[doc = "RTS enable"] 6074 #[doc = "Channel 1 Transfer Complete clear"]
7914 pub const fn rtse(&self) -> bool { 6075 pub fn ctcif(&self, n: usize) -> bool {
7915 let val = (self.0 >> 8usize) & 0x01; 6076 assert!(n < 7usize);
6077 let offs = 1usize + n * 4usize;
6078 let val = (self.0 >> offs) & 0x01;
7916 val != 0 6079 val != 0
7917 } 6080 }
7918 #[doc = "RTS enable"] 6081 #[doc = "Channel 1 Transfer Complete clear"]
7919 pub fn set_rtse(&mut self, val: bool) { 6082 pub fn set_ctcif(&mut self, n: usize, val: bool) {
7920 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 6083 assert!(n < 7usize);
6084 let offs = 1usize + n * 4usize;
6085 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7921 } 6086 }
7922 #[doc = "CTS enable"] 6087 #[doc = "Channel 1 Half Transfer clear"]
7923 pub const fn ctse(&self) -> bool { 6088 pub fn chtif(&self, n: usize) -> bool {
7924 let val = (self.0 >> 9usize) & 0x01; 6089 assert!(n < 7usize);
6090 let offs = 2usize + n * 4usize;
6091 let val = (self.0 >> offs) & 0x01;
7925 val != 0 6092 val != 0
7926 } 6093 }
7927 #[doc = "CTS enable"] 6094 #[doc = "Channel 1 Half Transfer clear"]
7928 pub fn set_ctse(&mut self, val: bool) { 6095 pub fn set_chtif(&mut self, n: usize, val: bool) {
7929 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 6096 assert!(n < 7usize);
6097 let offs = 2usize + n * 4usize;
6098 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7930 } 6099 }
7931 #[doc = "CTS interrupt enable"] 6100 #[doc = "Channel 1 Transfer Error clear"]
7932 pub const fn ctsie(&self) -> bool { 6101 pub fn cteif(&self, n: usize) -> bool {
7933 let val = (self.0 >> 10usize) & 0x01; 6102 assert!(n < 7usize);
6103 let offs = 3usize + n * 4usize;
6104 let val = (self.0 >> offs) & 0x01;
7934 val != 0 6105 val != 0
7935 } 6106 }
7936 #[doc = "CTS interrupt enable"] 6107 #[doc = "Channel 1 Transfer Error clear"]
7937 pub fn set_ctsie(&mut self, val: bool) { 6108 pub fn set_cteif(&mut self, n: usize, val: bool) {
7938 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 6109 assert!(n < 7usize);
6110 let offs = 3usize + n * 4usize;
6111 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7939 } 6112 }
7940 } 6113 }
7941 impl Default for Cr3Usart { 6114 impl Default for Ifcr {
7942 fn default() -> Cr3Usart { 6115 fn default() -> Ifcr {
7943 Cr3Usart(0) 6116 Ifcr(0)
7944 } 6117 }
7945 } 6118 }
7946 #[doc = "Control register 2"] 6119 #[doc = "DMA interrupt status register (DMA_ISR)"]
7947 #[repr(transparent)] 6120 #[repr(transparent)]
7948 #[derive(Copy, Clone, Eq, PartialEq)] 6121 #[derive(Copy, Clone, Eq, PartialEq)]
7949 pub struct Cr2Usart(pub u32); 6122 pub struct Isr(pub u32);
7950 impl Cr2Usart { 6123 impl Isr {
7951 #[doc = "Address of the USART node"] 6124 #[doc = "Channel 1 Global interrupt flag"]
7952 pub const fn add(&self) -> u8 { 6125 pub fn gif(&self, n: usize) -> bool {
7953 let val = (self.0 >> 0usize) & 0x0f; 6126 assert!(n < 7usize);
7954 val as u8 6127 let offs = 0usize + n * 4usize;
7955 } 6128 let val = (self.0 >> offs) & 0x01;
7956 #[doc = "Address of the USART node"]
7957 pub fn set_add(&mut self, val: u8) {
7958 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
7959 }
7960 #[doc = "lin break detection length"]
7961 pub const fn lbdl(&self) -> super::vals::Lbdl {
7962 let val = (self.0 >> 5usize) & 0x01;
7963 super::vals::Lbdl(val as u8)
7964 }
7965 #[doc = "lin break detection length"]
7966 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
7967 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
7968 }
7969 #[doc = "LIN break detection interrupt enable"]
7970 pub const fn lbdie(&self) -> bool {
7971 let val = (self.0 >> 6usize) & 0x01;
7972 val != 0 6129 val != 0
7973 } 6130 }
7974 #[doc = "LIN break detection interrupt enable"] 6131 #[doc = "Channel 1 Global interrupt flag"]
7975 pub fn set_lbdie(&mut self, val: bool) { 6132 pub fn set_gif(&mut self, n: usize, val: bool) {
7976 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 6133 assert!(n < 7usize);
6134 let offs = 0usize + n * 4usize;
6135 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7977 } 6136 }
7978 #[doc = "Last bit clock pulse"] 6137 #[doc = "Channel 1 Transfer Complete flag"]
7979 pub const fn lbcl(&self) -> bool { 6138 pub fn tcif(&self, n: usize) -> bool {
7980 let val = (self.0 >> 8usize) & 0x01; 6139 assert!(n < 7usize);
6140 let offs = 1usize + n * 4usize;
6141 let val = (self.0 >> offs) & 0x01;
7981 val != 0 6142 val != 0
7982 } 6143 }
7983 #[doc = "Last bit clock pulse"] 6144 #[doc = "Channel 1 Transfer Complete flag"]
7984 pub fn set_lbcl(&mut self, val: bool) { 6145 pub fn set_tcif(&mut self, n: usize, val: bool) {
7985 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 6146 assert!(n < 7usize);
7986 } 6147 let offs = 1usize + n * 4usize;
7987 #[doc = "Clock phase"] 6148 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7988 pub const fn cpha(&self) -> super::vals::Cpha {
7989 let val = (self.0 >> 9usize) & 0x01;
7990 super::vals::Cpha(val as u8)
7991 }
7992 #[doc = "Clock phase"]
7993 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
7994 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
7995 }
7996 #[doc = "Clock polarity"]
7997 pub const fn cpol(&self) -> super::vals::Cpol {
7998 let val = (self.0 >> 10usize) & 0x01;
7999 super::vals::Cpol(val as u8)
8000 }
8001 #[doc = "Clock polarity"]
8002 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
8003 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
8004 } 6149 }
8005 #[doc = "Clock enable"] 6150 #[doc = "Channel 1 Half Transfer Complete flag"]
8006 pub const fn clken(&self) -> bool { 6151 pub fn htif(&self, n: usize) -> bool {
8007 let val = (self.0 >> 11usize) & 0x01; 6152 assert!(n < 7usize);
6153 let offs = 2usize + n * 4usize;
6154 let val = (self.0 >> offs) & 0x01;
8008 val != 0 6155 val != 0
8009 } 6156 }
8010 #[doc = "Clock enable"] 6157 #[doc = "Channel 1 Half Transfer Complete flag"]
8011 pub fn set_clken(&mut self, val: bool) { 6158 pub fn set_htif(&mut self, n: usize, val: bool) {
8012 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 6159 assert!(n < 7usize);
8013 } 6160 let offs = 2usize + n * 4usize;
8014 #[doc = "STOP bits"] 6161 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8015 pub const fn stop(&self) -> super::vals::Stop {
8016 let val = (self.0 >> 12usize) & 0x03;
8017 super::vals::Stop(val as u8)
8018 }
8019 #[doc = "STOP bits"]
8020 pub fn set_stop(&mut self, val: super::vals::Stop) {
8021 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
8022 } 6162 }
8023 #[doc = "LIN mode enable"] 6163 #[doc = "Channel 1 Transfer Error flag"]
8024 pub const fn linen(&self) -> bool { 6164 pub fn teif(&self, n: usize) -> bool {
8025 let val = (self.0 >> 14usize) & 0x01; 6165 assert!(n < 7usize);
6166 let offs = 3usize + n * 4usize;
6167 let val = (self.0 >> offs) & 0x01;
8026 val != 0 6168 val != 0
8027 } 6169 }
8028 #[doc = "LIN mode enable"] 6170 #[doc = "Channel 1 Transfer Error flag"]
8029 pub fn set_linen(&mut self, val: bool) { 6171 pub fn set_teif(&mut self, n: usize, val: bool) {
8030 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 6172 assert!(n < 7usize);
6173 let offs = 3usize + n * 4usize;
6174 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8031 } 6175 }
8032 } 6176 }
8033 impl Default for Cr2Usart { 6177 impl Default for Isr {
8034 fn default() -> Cr2Usart { 6178 fn default() -> Isr {
8035 Cr2Usart(0) 6179 Isr(0)
8036 } 6180 }
8037 } 6181 }
8038 #[doc = "Baud rate register"] 6182 #[doc = "DMA channel 1 number of data register"]
8039 #[repr(transparent)] 6183 #[repr(transparent)]
8040 #[derive(Copy, Clone, Eq, PartialEq)] 6184 #[derive(Copy, Clone, Eq, PartialEq)]
8041 pub struct Brr(pub u32); 6185 pub struct Ndtr(pub u32);
8042 impl Brr { 6186 impl Ndtr {
8043 #[doc = "fraction of USARTDIV"] 6187 #[doc = "Number of data to transfer"]
8044 pub const fn div_fraction(&self) -> u8 { 6188 pub const fn ndt(&self) -> u16 {
8045 let val = (self.0 >> 0usize) & 0x0f; 6189 let val = (self.0 >> 0usize) & 0xffff;
8046 val as u8
8047 }
8048 #[doc = "fraction of USARTDIV"]
8049 pub fn set_div_fraction(&mut self, val: u8) {
8050 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
8051 }
8052 #[doc = "mantissa of USARTDIV"]
8053 pub const fn div_mantissa(&self) -> u16 {
8054 let val = (self.0 >> 4usize) & 0x0fff;
8055 val as u16 6190 val as u16
8056 } 6191 }
8057 #[doc = "mantissa of USARTDIV"] 6192 #[doc = "Number of data to transfer"]
8058 pub fn set_div_mantissa(&mut self, val: u16) { 6193 pub fn set_ndt(&mut self, val: u16) {
8059 self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize); 6194 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
8060 } 6195 }
8061 } 6196 }
8062 impl Default for Brr { 6197 impl Default for Ndtr {
8063 fn default() -> Brr { 6198 fn default() -> Ndtr {
8064 Brr(0) 6199 Ndtr(0)
8065 } 6200 }
8066 } 6201 }
8067 #[doc = "Control register 2"] 6202 }
6203 pub mod vals {
6204 use crate::generic::*;
8068 #[repr(transparent)] 6205 #[repr(transparent)]
8069 #[derive(Copy, Clone, Eq, PartialEq)] 6206 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8070 pub struct Cr2(pub u32); 6207 pub struct Size(pub u8);
8071 impl Cr2 { 6208 impl Size {
8072 #[doc = "Address of the USART node"] 6209 #[doc = "8-bit size"]
8073 pub const fn add(&self) -> u8 { 6210 pub const BITS8: Self = Self(0);
8074 let val = (self.0 >> 0usize) & 0x0f; 6211 #[doc = "16-bit size"]
8075 val as u8 6212 pub const BITS16: Self = Self(0x01);
8076 } 6213 #[doc = "32-bit size"]
8077 #[doc = "Address of the USART node"] 6214 pub const BITS32: Self = Self(0x02);
8078 pub fn set_add(&mut self, val: u8) {
8079 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
8080 }
8081 #[doc = "lin break detection length"]
8082 pub const fn lbdl(&self) -> super::vals::Lbdl {
8083 let val = (self.0 >> 5usize) & 0x01;
8084 super::vals::Lbdl(val as u8)
8085 }
8086 #[doc = "lin break detection length"]
8087 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
8088 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
8089 }
8090 #[doc = "LIN break detection interrupt enable"]
8091 pub const fn lbdie(&self) -> bool {
8092 let val = (self.0 >> 6usize) & 0x01;
8093 val != 0
8094 }
8095 #[doc = "LIN break detection interrupt enable"]
8096 pub fn set_lbdie(&mut self, val: bool) {
8097 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8098 }
8099 #[doc = "STOP bits"]
8100 pub const fn stop(&self) -> super::vals::Stop {
8101 let val = (self.0 >> 12usize) & 0x03;
8102 super::vals::Stop(val as u8)
8103 }
8104 #[doc = "STOP bits"]
8105 pub fn set_stop(&mut self, val: super::vals::Stop) {
8106 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
8107 }
8108 #[doc = "LIN mode enable"]
8109 pub const fn linen(&self) -> bool {
8110 let val = (self.0 >> 14usize) & 0x01;
8111 val != 0
8112 }
8113 #[doc = "LIN mode enable"]
8114 pub fn set_linen(&mut self, val: bool) {
8115 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
8116 }
8117 } 6215 }
8118 impl Default for Cr2 { 6216 #[repr(transparent)]
8119 fn default() -> Cr2 { 6217 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8120 Cr2(0) 6218 pub struct Circ(pub u8);
8121 } 6219 impl Circ {
6220 #[doc = "Circular buffer disabled"]
6221 pub const DISABLED: Self = Self(0);
6222 #[doc = "Circular buffer enabled"]
6223 pub const ENABLED: Self = Self(0x01);
8122 } 6224 }
8123 #[doc = "Control register 1"]
8124 #[repr(transparent)] 6225 #[repr(transparent)]
8125 #[derive(Copy, Clone, Eq, PartialEq)] 6226 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8126 pub struct Cr1(pub u32); 6227 pub struct Inc(pub u8);
8127 impl Cr1 { 6228 impl Inc {
8128 #[doc = "Send break"] 6229 #[doc = "Increment mode disabled"]
8129 pub const fn sbk(&self) -> super::vals::Sbk { 6230 pub const DISABLED: Self = Self(0);
8130 let val = (self.0 >> 0usize) & 0x01; 6231 #[doc = "Increment mode enabled"]
8131 super::vals::Sbk(val as u8) 6232 pub const ENABLED: Self = Self(0x01);
8132 }
8133 #[doc = "Send break"]
8134 pub fn set_sbk(&mut self, val: super::vals::Sbk) {
8135 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
8136 }
8137 #[doc = "Receiver wakeup"]
8138 pub const fn rwu(&self) -> super::vals::Rwu {
8139 let val = (self.0 >> 1usize) & 0x01;
8140 super::vals::Rwu(val as u8)
8141 }
8142 #[doc = "Receiver wakeup"]
8143 pub fn set_rwu(&mut self, val: super::vals::Rwu) {
8144 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
8145 }
8146 #[doc = "Receiver enable"]
8147 pub const fn re(&self) -> bool {
8148 let val = (self.0 >> 2usize) & 0x01;
8149 val != 0
8150 }
8151 #[doc = "Receiver enable"]
8152 pub fn set_re(&mut self, val: bool) {
8153 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8154 }
8155 #[doc = "Transmitter enable"]
8156 pub const fn te(&self) -> bool {
8157 let val = (self.0 >> 3usize) & 0x01;
8158 val != 0
8159 }
8160 #[doc = "Transmitter enable"]
8161 pub fn set_te(&mut self, val: bool) {
8162 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
8163 }
8164 #[doc = "IDLE interrupt enable"]
8165 pub const fn idleie(&self) -> bool {
8166 let val = (self.0 >> 4usize) & 0x01;
8167 val != 0
8168 }
8169 #[doc = "IDLE interrupt enable"]
8170 pub fn set_idleie(&mut self, val: bool) {
8171 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
8172 }
8173 #[doc = "RXNE interrupt enable"]
8174 pub const fn rxneie(&self) -> bool {
8175 let val = (self.0 >> 5usize) & 0x01;
8176 val != 0
8177 }
8178 #[doc = "RXNE interrupt enable"]
8179 pub fn set_rxneie(&mut self, val: bool) {
8180 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8181 }
8182 #[doc = "Transmission complete interrupt enable"]
8183 pub const fn tcie(&self) -> bool {
8184 let val = (self.0 >> 6usize) & 0x01;
8185 val != 0
8186 }
8187 #[doc = "Transmission complete interrupt enable"]
8188 pub fn set_tcie(&mut self, val: bool) {
8189 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8190 }
8191 #[doc = "TXE interrupt enable"]
8192 pub const fn txeie(&self) -> bool {
8193 let val = (self.0 >> 7usize) & 0x01;
8194 val != 0
8195 }
8196 #[doc = "TXE interrupt enable"]
8197 pub fn set_txeie(&mut self, val: bool) {
8198 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
8199 }
8200 #[doc = "PE interrupt enable"]
8201 pub const fn peie(&self) -> bool {
8202 let val = (self.0 >> 8usize) & 0x01;
8203 val != 0
8204 }
8205 #[doc = "PE interrupt enable"]
8206 pub fn set_peie(&mut self, val: bool) {
8207 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
8208 }
8209 #[doc = "Parity selection"]
8210 pub const fn ps(&self) -> super::vals::Ps {
8211 let val = (self.0 >> 9usize) & 0x01;
8212 super::vals::Ps(val as u8)
8213 }
8214 #[doc = "Parity selection"]
8215 pub fn set_ps(&mut self, val: super::vals::Ps) {
8216 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
8217 }
8218 #[doc = "Parity control enable"]
8219 pub const fn pce(&self) -> bool {
8220 let val = (self.0 >> 10usize) & 0x01;
8221 val != 0
8222 }
8223 #[doc = "Parity control enable"]
8224 pub fn set_pce(&mut self, val: bool) {
8225 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
8226 }
8227 #[doc = "Wakeup method"]
8228 pub const fn wake(&self) -> super::vals::Wake {
8229 let val = (self.0 >> 11usize) & 0x01;
8230 super::vals::Wake(val as u8)
8231 }
8232 #[doc = "Wakeup method"]
8233 pub fn set_wake(&mut self, val: super::vals::Wake) {
8234 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
8235 }
8236 #[doc = "Word length"]
8237 pub const fn m(&self) -> super::vals::M {
8238 let val = (self.0 >> 12usize) & 0x01;
8239 super::vals::M(val as u8)
8240 }
8241 #[doc = "Word length"]
8242 pub fn set_m(&mut self, val: super::vals::M) {
8243 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
8244 }
8245 #[doc = "USART enable"]
8246 pub const fn ue(&self) -> bool {
8247 let val = (self.0 >> 13usize) & 0x01;
8248 val != 0
8249 }
8250 #[doc = "USART enable"]
8251 pub fn set_ue(&mut self, val: bool) {
8252 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
8253 }
8254 } 6233 }
8255 impl Default for Cr1 { 6234 #[repr(transparent)]
8256 fn default() -> Cr1 { 6235 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8257 Cr1(0) 6236 pub struct Memmem(pub u8);
8258 } 6237 impl Memmem {
6238 #[doc = "Memory to memory mode disabled"]
6239 pub const DISABLED: Self = Self(0);
6240 #[doc = "Memory to memory mode enabled"]
6241 pub const ENABLED: Self = Self(0x01);
8259 } 6242 }
8260 #[doc = "Status register"]
8261 #[repr(transparent)] 6243 #[repr(transparent)]
8262 #[derive(Copy, Clone, Eq, PartialEq)] 6244 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8263 pub struct Sr(pub u32); 6245 pub struct Pl(pub u8);
8264 impl Sr { 6246 impl Pl {
8265 #[doc = "Parity error"] 6247 #[doc = "Low priority"]
8266 pub const fn pe(&self) -> bool { 6248 pub const LOW: Self = Self(0);
8267 let val = (self.0 >> 0usize) & 0x01; 6249 #[doc = "Medium priority"]
8268 val != 0 6250 pub const MEDIUM: Self = Self(0x01);
8269 } 6251 #[doc = "High priority"]
8270 #[doc = "Parity error"] 6252 pub const HIGH: Self = Self(0x02);
8271 pub fn set_pe(&mut self, val: bool) { 6253 #[doc = "Very high priority"]
8272 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6254 pub const VERYHIGH: Self = Self(0x03);
8273 }
8274 #[doc = "Framing error"]
8275 pub const fn fe(&self) -> bool {
8276 let val = (self.0 >> 1usize) & 0x01;
8277 val != 0
8278 }
8279 #[doc = "Framing error"]
8280 pub fn set_fe(&mut self, val: bool) {
8281 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8282 }
8283 #[doc = "Noise error flag"]
8284 pub const fn ne(&self) -> bool {
8285 let val = (self.0 >> 2usize) & 0x01;
8286 val != 0
8287 }
8288 #[doc = "Noise error flag"]
8289 pub fn set_ne(&mut self, val: bool) {
8290 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8291 }
8292 #[doc = "Overrun error"]
8293 pub const fn ore(&self) -> bool {
8294 let val = (self.0 >> 3usize) & 0x01;
8295 val != 0
8296 }
8297 #[doc = "Overrun error"]
8298 pub fn set_ore(&mut self, val: bool) {
8299 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
8300 }
8301 #[doc = "IDLE line detected"]
8302 pub const fn idle(&self) -> bool {
8303 let val = (self.0 >> 4usize) & 0x01;
8304 val != 0
8305 }
8306 #[doc = "IDLE line detected"]
8307 pub fn set_idle(&mut self, val: bool) {
8308 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
8309 }
8310 #[doc = "Read data register not empty"]
8311 pub const fn rxne(&self) -> bool {
8312 let val = (self.0 >> 5usize) & 0x01;
8313 val != 0
8314 }
8315 #[doc = "Read data register not empty"]
8316 pub fn set_rxne(&mut self, val: bool) {
8317 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8318 }
8319 #[doc = "Transmission complete"]
8320 pub const fn tc(&self) -> bool {
8321 let val = (self.0 >> 6usize) & 0x01;
8322 val != 0
8323 }
8324 #[doc = "Transmission complete"]
8325 pub fn set_tc(&mut self, val: bool) {
8326 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8327 }
8328 #[doc = "Transmit data register empty"]
8329 pub const fn txe(&self) -> bool {
8330 let val = (self.0 >> 7usize) & 0x01;
8331 val != 0
8332 }
8333 #[doc = "Transmit data register empty"]
8334 pub fn set_txe(&mut self, val: bool) {
8335 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
8336 }
8337 #[doc = "LIN break detection flag"]
8338 pub const fn lbd(&self) -> bool {
8339 let val = (self.0 >> 8usize) & 0x01;
8340 val != 0
8341 }
8342 #[doc = "LIN break detection flag"]
8343 pub fn set_lbd(&mut self, val: bool) {
8344 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
8345 }
8346 } 6255 }
8347 impl Default for Sr { 6256 #[repr(transparent)]
8348 fn default() -> Sr { 6257 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8349 Sr(0) 6258 pub struct Dir(pub u8);
8350 } 6259 impl Dir {
6260 #[doc = "Read from peripheral"]
6261 pub const FROMPERIPHERAL: Self = Self(0);
6262 #[doc = "Read from memory"]
6263 pub const FROMMEMORY: Self = Self(0x01);
6264 }
6265 }
6266}
6267pub mod dma_v2 {
6268 use crate::generic::*;
6269 #[doc = "DMA controller"]
6270 #[derive(Copy, Clone)]
6271 pub struct Dma(pub *mut u8);
6272 unsafe impl Send for Dma {}
6273 unsafe impl Sync for Dma {}
6274 impl Dma {
6275 #[doc = "low interrupt status register"]
6276 pub fn isr(self, n: usize) -> Reg<regs::Ixr, R> {
6277 assert!(n < 2usize);
6278 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
6279 }
6280 #[doc = "low interrupt flag clear register"]
6281 pub fn ifcr(self, n: usize) -> Reg<regs::Ixr, W> {
6282 assert!(n < 2usize);
6283 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
6284 }
6285 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"]
6286 pub fn st(self, n: usize) -> St {
6287 assert!(n < 8usize);
6288 unsafe { St(self.0.add(16usize + n * 24usize)) }
6289 }
6290 }
6291 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"]
6292 #[derive(Copy, Clone)]
6293 pub struct St(pub *mut u8);
6294 unsafe impl Send for St {}
6295 unsafe impl Sync for St {}
6296 impl St {
6297 #[doc = "stream x configuration register"]
6298 pub fn cr(self) -> Reg<regs::Cr, RW> {
6299 unsafe { Reg::from_ptr(self.0.add(0usize)) }
6300 }
6301 #[doc = "stream x number of data register"]
6302 pub fn ndtr(self) -> Reg<regs::Ndtr, RW> {
6303 unsafe { Reg::from_ptr(self.0.add(4usize)) }
6304 }
6305 #[doc = "stream x peripheral address register"]
6306 pub fn par(self) -> Reg<u32, RW> {
6307 unsafe { Reg::from_ptr(self.0.add(8usize)) }
6308 }
6309 #[doc = "stream x memory 0 address register"]
6310 pub fn m0ar(self) -> Reg<u32, RW> {
6311 unsafe { Reg::from_ptr(self.0.add(12usize)) }
6312 }
6313 #[doc = "stream x memory 1 address register"]
6314 pub fn m1ar(self) -> Reg<u32, RW> {
6315 unsafe { Reg::from_ptr(self.0.add(16usize)) }
6316 }
6317 #[doc = "stream x FIFO control register"]
6318 pub fn fcr(self) -> Reg<regs::Fcr, RW> {
6319 unsafe { Reg::from_ptr(self.0.add(20usize)) }
8351 } 6320 }
8352 } 6321 }
8353 pub mod vals { 6322 pub mod vals {
8354 use crate::generic::*; 6323 use crate::generic::*;
8355 #[repr(transparent)] 6324 #[repr(transparent)]
8356 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6325 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8357 pub struct Stop(pub u8); 6326 pub struct Pfctrl(pub u8);
8358 impl Stop { 6327 impl Pfctrl {
8359 #[doc = "1 stop bit"] 6328 #[doc = "The DMA is the flow controller"]
8360 pub const STOP1: Self = Self(0); 6329 pub const DMA: Self = Self(0);
8361 #[doc = "0.5 stop bits"] 6330 #[doc = "The peripheral is the flow controller"]
8362 pub const STOP0P5: Self = Self(0x01); 6331 pub const PERIPHERAL: Self = Self(0x01);
8363 #[doc = "2 stop bits"]
8364 pub const STOP2: Self = Self(0x02);
8365 #[doc = "1.5 stop bits"]
8366 pub const STOP1P5: Self = Self(0x03);
8367 } 6332 }
8368 #[repr(transparent)] 6333 #[repr(transparent)]
8369 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6334 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8370 pub struct Irlp(pub u8); 6335 pub struct Ct(pub u8);
8371 impl Irlp { 6336 impl Ct {
8372 #[doc = "Normal mode"] 6337 #[doc = "The current target memory is Memory 0"]
8373 pub const NORMAL: Self = Self(0); 6338 pub const MEMORY0: Self = Self(0);
8374 #[doc = "Low-power mode"] 6339 #[doc = "The current target memory is Memory 1"]
8375 pub const LOWPOWER: Self = Self(0x01); 6340 pub const MEMORY1: Self = Self(0x01);
8376 } 6341 }
8377 #[repr(transparent)] 6342 #[repr(transparent)]
8378 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6343 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8379 pub struct M(pub u8); 6344 pub struct Fs(pub u8);
8380 impl M { 6345 impl Fs {
8381 #[doc = "8 data bits"] 6346 #[doc = "0 < fifo_level < 1/4"]
8382 pub const M8: Self = Self(0); 6347 pub const QUARTER1: Self = Self(0);
8383 #[doc = "9 data bits"] 6348 #[doc = "1/4 <= fifo_level < 1/2"]
8384 pub const M9: Self = Self(0x01); 6349 pub const QUARTER2: Self = Self(0x01);
6350 #[doc = "1/2 <= fifo_level < 3/4"]
6351 pub const QUARTER3: Self = Self(0x02);
6352 #[doc = "3/4 <= fifo_level < full"]
6353 pub const QUARTER4: Self = Self(0x03);
6354 #[doc = "FIFO is empty"]
6355 pub const EMPTY: Self = Self(0x04);
6356 #[doc = "FIFO is full"]
6357 pub const FULL: Self = Self(0x05);
8385 } 6358 }
8386 #[repr(transparent)] 6359 #[repr(transparent)]
8387 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6360 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8388 pub struct Wake(pub u8); 6361 pub struct Dbm(pub u8);
8389 impl Wake { 6362 impl Dbm {
8390 #[doc = "USART wakeup on idle line"] 6363 #[doc = "No buffer switching at the end of transfer"]
8391 pub const IDLELINE: Self = Self(0); 6364 pub const DISABLED: Self = Self(0);
8392 #[doc = "USART wakeup on address mark"] 6365 #[doc = "Memory target switched at the end of the DMA transfer"]
8393 pub const ADDRESSMARK: Self = Self(0x01); 6366 pub const ENABLED: Self = Self(0x01);
8394 } 6367 }
8395 #[repr(transparent)] 6368 #[repr(transparent)]
8396 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6369 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8397 pub struct Cpol(pub u8); 6370 pub struct Pincos(pub u8);
8398 impl Cpol { 6371 impl Pincos {
8399 #[doc = "Steady low value on CK pin outside transmission window"] 6372 #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"]
8400 pub const LOW: Self = Self(0); 6373 pub const PSIZE: Self = Self(0);
8401 #[doc = "Steady high value on CK pin outside transmission window"] 6374 #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"]
8402 pub const HIGH: Self = Self(0x01); 6375 pub const FIXED4: Self = Self(0x01);
8403 } 6376 }
8404 #[repr(transparent)] 6377 #[repr(transparent)]
8405 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6378 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8406 pub struct Lbdl(pub u8); 6379 pub struct Dmdis(pub u8);
8407 impl Lbdl { 6380 impl Dmdis {
8408 #[doc = "10-bit break detection"] 6381 #[doc = "Direct mode is enabled"]
8409 pub const LBDL10: Self = Self(0); 6382 pub const ENABLED: Self = Self(0);
8410 #[doc = "11-bit break detection"] 6383 #[doc = "Direct mode is disabled"]
8411 pub const LBDL11: Self = Self(0x01); 6384 pub const DISABLED: Self = Self(0x01);
8412 } 6385 }
8413 #[repr(transparent)] 6386 #[repr(transparent)]
8414 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6387 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8415 pub struct Rwu(pub u8); 6388 pub struct Burst(pub u8);
8416 impl Rwu { 6389 impl Burst {
8417 #[doc = "Receiver in active mode"] 6390 #[doc = "Single transfer"]
8418 pub const ACTIVE: Self = Self(0); 6391 pub const SINGLE: Self = Self(0);
8419 #[doc = "Receiver in mute mode"] 6392 #[doc = "Incremental burst of 4 beats"]
8420 pub const MUTE: Self = Self(0x01); 6393 pub const INCR4: Self = Self(0x01);
6394 #[doc = "Incremental burst of 8 beats"]
6395 pub const INCR8: Self = Self(0x02);
6396 #[doc = "Incremental burst of 16 beats"]
6397 pub const INCR16: Self = Self(0x03);
8421 } 6398 }
8422 #[repr(transparent)] 6399 #[repr(transparent)]
8423 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6400 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8424 pub struct Hdsel(pub u8); 6401 pub struct Dir(pub u8);
8425 impl Hdsel { 6402 impl Dir {
8426 #[doc = "Half duplex mode is not selected"] 6403 #[doc = "Peripheral-to-memory"]
8427 pub const FULLDUPLEX: Self = Self(0); 6404 pub const PERIPHERALTOMEMORY: Self = Self(0);
8428 #[doc = "Half duplex mode is selected"] 6405 #[doc = "Memory-to-peripheral"]
8429 pub const HALFDUPLEX: Self = Self(0x01); 6406 pub const MEMORYTOPERIPHERAL: Self = Self(0x01);
6407 #[doc = "Memory-to-memory"]
6408 pub const MEMORYTOMEMORY: Self = Self(0x02);
8430 } 6409 }
8431 #[repr(transparent)] 6410 #[repr(transparent)]
8432 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6411 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8433 pub struct Ps(pub u8); 6412 pub struct Pl(pub u8);
8434 impl Ps { 6413 impl Pl {
8435 #[doc = "Even parity"] 6414 #[doc = "Low"]
8436 pub const EVEN: Self = Self(0); 6415 pub const LOW: Self = Self(0);
8437 #[doc = "Odd parity"] 6416 #[doc = "Medium"]
8438 pub const ODD: Self = Self(0x01); 6417 pub const MEDIUM: Self = Self(0x01);
6418 #[doc = "High"]
6419 pub const HIGH: Self = Self(0x02);
6420 #[doc = "Very high"]
6421 pub const VERYHIGH: Self = Self(0x03);
8439 } 6422 }
8440 #[repr(transparent)] 6423 #[repr(transparent)]
8441 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6424 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8442 pub struct Cpha(pub u8); 6425 pub struct Circ(pub u8);
8443 impl Cpha { 6426 impl Circ {
8444 #[doc = "The first clock transition is the first data capture edge"] 6427 #[doc = "Circular mode disabled"]
8445 pub const FIRST: Self = Self(0); 6428 pub const DISABLED: Self = Self(0);
8446 #[doc = "The second clock transition is the first data capture edge"] 6429 #[doc = "Circular mode enabled"]
8447 pub const SECOND: Self = Self(0x01); 6430 pub const ENABLED: Self = Self(0x01);
8448 } 6431 }
8449 #[repr(transparent)] 6432 #[repr(transparent)]
8450 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 6433 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8451 pub struct Sbk(pub u8); 6434 pub struct Inc(pub u8);
8452 impl Sbk { 6435 impl Inc {
8453 #[doc = "No break character is transmitted"] 6436 #[doc = "Address pointer is fixed"]
8454 pub const NOBREAK: Self = Self(0); 6437 pub const FIXED: Self = Self(0);
8455 #[doc = "Break character transmitted"] 6438 #[doc = "Address pointer is incremented after each data transfer"]
8456 pub const BREAK: Self = Self(0x01); 6439 pub const INCREMENTED: Self = Self(0x01);
8457 }
8458 }
8459}
8460pub mod rng_v1 {
8461 use crate::generic::*;
8462 #[doc = "Random number generator"]
8463 #[derive(Copy, Clone)]
8464 pub struct Rng(pub *mut u8);
8465 unsafe impl Send for Rng {}
8466 unsafe impl Sync for Rng {}
8467 impl Rng {
8468 #[doc = "control register"]
8469 pub fn cr(self) -> Reg<regs::Cr, RW> {
8470 unsafe { Reg::from_ptr(self.0.add(0usize)) }
8471 } 6440 }
8472 #[doc = "status register"] 6441 #[repr(transparent)]
8473 pub fn sr(self) -> Reg<regs::Sr, RW> { 6442 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8474 unsafe { Reg::from_ptr(self.0.add(4usize)) } 6443 pub struct Fth(pub u8);
6444 impl Fth {
6445 #[doc = "1/4 full FIFO"]
6446 pub const QUARTER: Self = Self(0);
6447 #[doc = "1/2 full FIFO"]
6448 pub const HALF: Self = Self(0x01);
6449 #[doc = "3/4 full FIFO"]
6450 pub const THREEQUARTERS: Self = Self(0x02);
6451 #[doc = "Full FIFO"]
6452 pub const FULL: Self = Self(0x03);
8475 } 6453 }
8476 #[doc = "data register"] 6454 #[repr(transparent)]
8477 pub fn dr(self) -> Reg<u32, R> { 6455 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8478 unsafe { Reg::from_ptr(self.0.add(8usize)) } 6456 pub struct Size(pub u8);
6457 impl Size {
6458 #[doc = "Byte (8-bit)"]
6459 pub const BITS8: Self = Self(0);
6460 #[doc = "Half-word (16-bit)"]
6461 pub const BITS16: Self = Self(0x01);
6462 #[doc = "Word (32-bit)"]
6463 pub const BITS32: Self = Self(0x02);
8479 } 6464 }
8480 } 6465 }
8481 pub mod regs { 6466 pub mod regs {
8482 use crate::generic::*; 6467 use crate::generic::*;
8483 #[doc = "control register"] 6468 #[doc = "stream x number of data register"]
8484 #[repr(transparent)] 6469 #[repr(transparent)]
8485 #[derive(Copy, Clone, Eq, PartialEq)] 6470 #[derive(Copy, Clone, Eq, PartialEq)]
8486 pub struct Cr(pub u32); 6471 pub struct Ndtr(pub u32);
8487 impl Cr { 6472 impl Ndtr {
8488 #[doc = "Random number generator enable"] 6473 #[doc = "Number of data items to transfer"]
8489 pub const fn rngen(&self) -> bool { 6474 pub const fn ndt(&self) -> u16 {
8490 let val = (self.0 >> 2usize) & 0x01; 6475 let val = (self.0 >> 0usize) & 0xffff;
8491 val != 0 6476 val as u16
8492 }
8493 #[doc = "Random number generator enable"]
8494 pub fn set_rngen(&mut self, val: bool) {
8495 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8496 }
8497 #[doc = "Interrupt enable"]
8498 pub const fn ie(&self) -> bool {
8499 let val = (self.0 >> 3usize) & 0x01;
8500 val != 0
8501 } 6477 }
8502 #[doc = "Interrupt enable"] 6478 #[doc = "Number of data items to transfer"]
8503 pub fn set_ie(&mut self, val: bool) { 6479 pub fn set_ndt(&mut self, val: u16) {
8504 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 6480 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
8505 } 6481 }
8506 } 6482 }
8507 impl Default for Cr { 6483 impl Default for Ndtr {
8508 fn default() -> Cr { 6484 fn default() -> Ndtr {
8509 Cr(0) 6485 Ndtr(0)
8510 } 6486 }
8511 } 6487 }
8512 #[doc = "status register"] 6488 #[doc = "stream x configuration register"]
8513 #[repr(transparent)] 6489 #[repr(transparent)]
8514 #[derive(Copy, Clone, Eq, PartialEq)] 6490 #[derive(Copy, Clone, Eq, PartialEq)]
8515 pub struct Sr(pub u32); 6491 pub struct Cr(pub u32);
8516 impl Sr { 6492 impl Cr {
8517 #[doc = "Data ready"] 6493 #[doc = "Stream enable / flag stream ready when read low"]
8518 pub const fn drdy(&self) -> bool { 6494 pub const fn en(&self) -> bool {
8519 let val = (self.0 >> 0usize) & 0x01; 6495 let val = (self.0 >> 0usize) & 0x01;
8520 val != 0 6496 val != 0
8521 } 6497 }
8522 #[doc = "Data ready"] 6498 #[doc = "Stream enable / flag stream ready when read low"]
8523 pub fn set_drdy(&mut self, val: bool) { 6499 pub fn set_en(&mut self, val: bool) {
8524 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6500 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8525 } 6501 }
8526 #[doc = "Clock error current status"] 6502 #[doc = "Direct mode error interrupt enable"]
8527 pub const fn cecs(&self) -> bool { 6503 pub const fn dmeie(&self) -> bool {
8528 let val = (self.0 >> 1usize) & 0x01; 6504 let val = (self.0 >> 1usize) & 0x01;
8529 val != 0 6505 val != 0
8530 } 6506 }
8531 #[doc = "Clock error current status"] 6507 #[doc = "Direct mode error interrupt enable"]
8532 pub fn set_cecs(&mut self, val: bool) { 6508 pub fn set_dmeie(&mut self, val: bool) {
8533 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 6509 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8534 } 6510 }
8535 #[doc = "Seed error current status"] 6511 #[doc = "Transfer error interrupt enable"]
8536 pub const fn secs(&self) -> bool { 6512 pub const fn teie(&self) -> bool {
8537 let val = (self.0 >> 2usize) & 0x01; 6513 let val = (self.0 >> 2usize) & 0x01;
8538 val != 0 6514 val != 0
8539 } 6515 }
8540 #[doc = "Seed error current status"] 6516 #[doc = "Transfer error interrupt enable"]
8541 pub fn set_secs(&mut self, val: bool) { 6517 pub fn set_teie(&mut self, val: bool) {
8542 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 6518 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8543 } 6519 }
8544 #[doc = "Clock error interrupt status"] 6520 #[doc = "Half transfer interrupt enable"]
8545 pub const fn ceis(&self) -> bool { 6521 pub const fn htie(&self) -> bool {
8546 let val = (self.0 >> 5usize) & 0x01; 6522 let val = (self.0 >> 3usize) & 0x01;
8547 val != 0
8548 }
8549 #[doc = "Clock error interrupt status"]
8550 pub fn set_ceis(&mut self, val: bool) {
8551 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8552 }
8553 #[doc = "Seed error interrupt status"]
8554 pub const fn seis(&self) -> bool {
8555 let val = (self.0 >> 6usize) & 0x01;
8556 val != 0
8557 }
8558 #[doc = "Seed error interrupt status"]
8559 pub fn set_seis(&mut self, val: bool) {
8560 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8561 }
8562 }
8563 impl Default for Sr {
8564 fn default() -> Sr {
8565 Sr(0)
8566 }
8567 }
8568 }
8569}
8570pub mod generic {
8571 use core::marker::PhantomData;
8572 #[derive(Copy, Clone)]
8573 pub struct RW;
8574 #[derive(Copy, Clone)]
8575 pub struct R;
8576 #[derive(Copy, Clone)]
8577 pub struct W;
8578 mod sealed {
8579 use super::*;
8580 pub trait Access {}
8581 impl Access for R {}
8582 impl Access for W {}
8583 impl Access for RW {}
8584 }
8585 pub trait Access: sealed::Access + Copy {}
8586 impl Access for R {}
8587 impl Access for W {}
8588 impl Access for RW {}
8589 pub trait Read: Access {}
8590 impl Read for RW {}
8591 impl Read for R {}
8592 pub trait Write: Access {}
8593 impl Write for RW {}
8594 impl Write for W {}
8595 #[derive(Copy, Clone)]
8596 pub struct Reg<T: Copy, A: Access> {
8597 ptr: *mut u8,
8598 phantom: PhantomData<*mut (T, A)>,
8599 }
8600 unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {}
8601 unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {}
8602 impl<T: Copy, A: Access> Reg<T, A> {
8603 pub fn from_ptr(ptr: *mut u8) -> Self {
8604 Self {
8605 ptr,
8606 phantom: PhantomData,
8607 }
8608 }
8609 pub fn ptr(&self) -> *mut T {
8610 self.ptr as _
8611 }
8612 }
8613 impl<T: Copy, A: Read> Reg<T, A> {
8614 pub unsafe fn read(&self) -> T {
8615 (self.ptr as *mut T).read_volatile()
8616 }
8617 }
8618 impl<T: Copy, A: Write> Reg<T, A> {
8619 pub unsafe fn write_value(&self, val: T) {
8620 (self.ptr as *mut T).write_volatile(val)
8621 }
8622 }
8623 impl<T: Default + Copy, A: Write> Reg<T, A> {
8624 pub unsafe fn write<R>(&self, f: impl FnOnce(&mut T) -> R) -> R {
8625 let mut val = Default::default();
8626 let res = f(&mut val);
8627 self.write_value(val);
8628 res
8629 }
8630 }
8631 impl<T: Copy, A: Read + Write> Reg<T, A> {
8632 pub unsafe fn modify<R>(&self, f: impl FnOnce(&mut T) -> R) -> R {
8633 let mut val = self.read();
8634 let res = f(&mut val);
8635 self.write_value(val);
8636 res
8637 }
8638 }
8639}
8640pub mod pwr_h7 {
8641 use crate::generic::*;
8642 #[doc = "PWR"]
8643 #[derive(Copy, Clone)]
8644 pub struct Pwr(pub *mut u8);
8645 unsafe impl Send for Pwr {}
8646 unsafe impl Sync for Pwr {}
8647 impl Pwr {
8648 #[doc = "PWR control register 1"]
8649 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
8650 unsafe { Reg::from_ptr(self.0.add(0usize)) }
8651 }
8652 #[doc = "PWR control status register 1"]
8653 pub fn csr1(self) -> Reg<regs::Csr1, R> {
8654 unsafe { Reg::from_ptr(self.0.add(4usize)) }
8655 }
8656 #[doc = "This register is not reset by wakeup from Standby mode, RESET signal and VDD POR. It is only reset by VSW POR and VSWRST reset. This register shall not be accessed when VSWRST bit in RCC_BDCR register resets the VSW domain.After reset, PWR_CR2 register is write-protected. Prior to modifying its content, the DBP bit in PWR_CR1 register must be set to disable the write protection."]
8657 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
8658 unsafe { Reg::from_ptr(self.0.add(8usize)) }
8659 }
8660 #[doc = "Reset only by POR only, not reset by wakeup from Standby mode and RESET pad. The lower byte of this register is written once after POR and shall be written before changing VOS level or ck_sys clock frequency. No limitation applies to the upper bytes.Programming data corresponding to an invalid combination of SDLEVEL, SDEXTHP, SDEN, LDOEN and BYPASS bits (see Table9) will be ignored: data will not be written, the written-once mechanism will lock the register and any further write access will be ignored. The default supply configuration will be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) will go on indicating invalid voltage levels. The system shall be power cycled before writing a new value."]
8661 pub fn cr3(self) -> Reg<regs::Cr3, RW> {
8662 unsafe { Reg::from_ptr(self.0.add(12usize)) }
8663 }
8664 #[doc = "This register allows controlling CPU1 power."]
8665 pub fn cpucr(self) -> Reg<regs::Cpucr, RW> {
8666 unsafe { Reg::from_ptr(self.0.add(16usize)) }
8667 }
8668 #[doc = "This register allows controlling D3 domain power.Following reset VOSRDY will be read 1 by software"]
8669 pub fn d3cr(self) -> Reg<regs::D3cr, RW> {
8670 unsafe { Reg::from_ptr(self.0.add(24usize)) }
8671 }
8672 #[doc = "reset only by system reset, not reset by wakeup from Standby mode5 wait states are required when writing this register (when clearing a WKUPF bit in PWR_WKUPFR, the AHB write access will complete after the WKUPF has been cleared)."]
8673 pub fn wkupcr(self) -> Reg<regs::Wkupcr, RW> {
8674 unsafe { Reg::from_ptr(self.0.add(32usize)) }
8675 }
8676 #[doc = "reset only by system reset, not reset by wakeup from Standby mode"]
8677 pub fn wkupfr(self) -> Reg<regs::Wkupfr, RW> {
8678 unsafe { Reg::from_ptr(self.0.add(36usize)) }
8679 }
8680 #[doc = "Reset only by system reset, not reset by wakeup from Standby mode"]
8681 pub fn wkupepr(self) -> Reg<regs::Wkupepr, RW> {
8682 unsafe { Reg::from_ptr(self.0.add(40usize)) }
8683 }
8684 }
8685 pub mod regs {
8686 use crate::generic::*;
8687 #[doc = "This register is not reset by wakeup from Standby mode, RESET signal and VDD POR. It is only reset by VSW POR and VSWRST reset. This register shall not be accessed when VSWRST bit in RCC_BDCR register resets the VSW domain.After reset, PWR_CR2 register is write-protected. Prior to modifying its content, the DBP bit in PWR_CR1 register must be set to disable the write protection."]
8688 #[repr(transparent)]
8689 #[derive(Copy, Clone, Eq, PartialEq)]
8690 pub struct Cr2(pub u32);
8691 impl Cr2 {
8692 #[doc = "Backup regulator enable When set, the Backup regulator (used to maintain the backup RAM content in Standby and VBAT modes) is enabled. If BREN is reset, the backup regulator is switched off. The backup RAM can still be used in Run and Stop modes. However, its content will be lost in Standby and VBAT modes. If BREN is set, the application must wait till the Backup Regulator Ready flag (BRRDY) is set to indicate that the data written into the SRAM will be maintained in Standby and VBAT modes."]
8693 pub const fn bren(&self) -> bool {
8694 let val = (self.0 >> 0usize) & 0x01;
8695 val != 0 6523 val != 0
8696 } 6524 }
8697 #[doc = "Backup regulator enable When set, the Backup regulator (used to maintain the backup RAM content in Standby and VBAT modes) is enabled. If BREN is reset, the backup regulator is switched off. The backup RAM can still be used in Run and Stop modes. However, its content will be lost in Standby and VBAT modes. If BREN is set, the application must wait till the Backup Regulator Ready flag (BRRDY) is set to indicate that the data written into the SRAM will be maintained in Standby and VBAT modes."] 6525 #[doc = "Half transfer interrupt enable"]
8698 pub fn set_bren(&mut self, val: bool) { 6526 pub fn set_htie(&mut self, val: bool) {
8699 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6527 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
8700 } 6528 }
8701 #[doc = "VBAT and temperature monitoring enable When set, the VBAT supply and temperature monitoring is enabled."] 6529 #[doc = "Transfer complete interrupt enable"]
8702 pub const fn monen(&self) -> bool { 6530 pub const fn tcie(&self) -> bool {
8703 let val = (self.0 >> 4usize) & 0x01; 6531 let val = (self.0 >> 4usize) & 0x01;
8704 val != 0 6532 val != 0
8705 } 6533 }
8706 #[doc = "VBAT and temperature monitoring enable When set, the VBAT supply and temperature monitoring is enabled."] 6534 #[doc = "Transfer complete interrupt enable"]
8707 pub fn set_monen(&mut self, val: bool) { 6535 pub fn set_tcie(&mut self, val: bool) {
8708 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 6536 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
8709 } 6537 }
8710 #[doc = "Backup regulator ready This bit is set by hardware to indicate that the Backup regulator is ready."] 6538 #[doc = "Peripheral flow controller"]
8711 pub const fn brrdy(&self) -> bool { 6539 pub const fn pfctrl(&self) -> super::vals::Pfctrl {
8712 let val = (self.0 >> 16usize) & 0x01; 6540 let val = (self.0 >> 5usize) & 0x01;
8713 val != 0 6541 super::vals::Pfctrl(val as u8)
8714 }
8715 #[doc = "Backup regulator ready This bit is set by hardware to indicate that the Backup regulator is ready."]
8716 pub fn set_brrdy(&mut self, val: bool) {
8717 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
8718 }
8719 #[doc = "VBAT level monitoring versus low threshold"]
8720 pub const fn vbatl(&self) -> bool {
8721 let val = (self.0 >> 20usize) & 0x01;
8722 val != 0
8723 } 6542 }
8724 #[doc = "VBAT level monitoring versus low threshold"] 6543 #[doc = "Peripheral flow controller"]
8725 pub fn set_vbatl(&mut self, val: bool) { 6544 pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) {
8726 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); 6545 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
8727 } 6546 }
8728 #[doc = "VBAT level monitoring versus high threshold"] 6547 #[doc = "Data transfer direction"]
8729 pub const fn vbath(&self) -> bool { 6548 pub const fn dir(&self) -> super::vals::Dir {
8730 let val = (self.0 >> 21usize) & 0x01; 6549 let val = (self.0 >> 6usize) & 0x03;
8731 val != 0 6550 super::vals::Dir(val as u8)
8732 } 6551 }
8733 #[doc = "VBAT level monitoring versus high threshold"] 6552 #[doc = "Data transfer direction"]
8734 pub fn set_vbath(&mut self, val: bool) { 6553 pub fn set_dir(&mut self, val: super::vals::Dir) {
8735 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); 6554 self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize);
8736 } 6555 }
8737 #[doc = "Temperature level monitoring versus low threshold"] 6556 #[doc = "Circular mode"]
8738 pub const fn templ(&self) -> bool { 6557 pub const fn circ(&self) -> super::vals::Circ {
8739 let val = (self.0 >> 22usize) & 0x01; 6558 let val = (self.0 >> 8usize) & 0x01;
8740 val != 0 6559 super::vals::Circ(val as u8)
8741 } 6560 }
8742 #[doc = "Temperature level monitoring versus low threshold"] 6561 #[doc = "Circular mode"]
8743 pub fn set_templ(&mut self, val: bool) { 6562 pub fn set_circ(&mut self, val: super::vals::Circ) {
8744 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 6563 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
8745 } 6564 }
8746 #[doc = "Temperature level monitoring versus high threshold"] 6565 #[doc = "Peripheral increment mode"]
8747 pub const fn temph(&self) -> bool { 6566 pub const fn pinc(&self) -> super::vals::Inc {
8748 let val = (self.0 >> 23usize) & 0x01; 6567 let val = (self.0 >> 9usize) & 0x01;
8749 val != 0 6568 super::vals::Inc(val as u8)
8750 } 6569 }
8751 #[doc = "Temperature level monitoring versus high threshold"] 6570 #[doc = "Peripheral increment mode"]
8752 pub fn set_temph(&mut self, val: bool) { 6571 pub fn set_pinc(&mut self, val: super::vals::Inc) {
8753 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); 6572 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
8754 } 6573 }
8755 } 6574 #[doc = "Memory increment mode"]
8756 impl Default for Cr2 { 6575 pub const fn minc(&self) -> super::vals::Inc {
8757 fn default() -> Cr2 { 6576 let val = (self.0 >> 10usize) & 0x01;
8758 Cr2(0) 6577 super::vals::Inc(val as u8)
8759 } 6578 }
8760 } 6579 #[doc = "Memory increment mode"]
8761 #[doc = "reset only by system reset, not reset by wakeup from Standby mode5 wait states are required when writing this register (when clearing a WKUPF bit in PWR_WKUPFR, the AHB write access will complete after the WKUPF has been cleared)."] 6580 pub fn set_minc(&mut self, val: super::vals::Inc) {
8762 #[repr(transparent)] 6581 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
8763 #[derive(Copy, Clone, Eq, PartialEq)]
8764 pub struct Wkupcr(pub u32);
8765 impl Wkupcr {
8766 #[doc = "Clear Wakeup pin flag for WKUP. These bits are always read as 0."]
8767 pub const fn wkupc(&self) -> u8 {
8768 let val = (self.0 >> 0usize) & 0x3f;
8769 val as u8
8770 } 6582 }
8771 #[doc = "Clear Wakeup pin flag for WKUP. These bits are always read as 0."] 6583 #[doc = "Peripheral data size"]
8772 pub fn set_wkupc(&mut self, val: u8) { 6584 pub const fn psize(&self) -> super::vals::Size {
8773 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); 6585 let val = (self.0 >> 11usize) & 0x03;
6586 super::vals::Size(val as u8)
8774 } 6587 }
8775 } 6588 #[doc = "Peripheral data size"]
8776 impl Default for Wkupcr { 6589 pub fn set_psize(&mut self, val: super::vals::Size) {
8777 fn default() -> Wkupcr { 6590 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize);
8778 Wkupcr(0)
8779 } 6591 }
8780 } 6592 #[doc = "Memory data size"]
8781 #[doc = "Reset only by POR only, not reset by wakeup from Standby mode and RESET pad. The lower byte of this register is written once after POR and shall be written before changing VOS level or ck_sys clock frequency. No limitation applies to the upper bytes.Programming data corresponding to an invalid combination of SDLEVEL, SDEXTHP, SDEN, LDOEN and BYPASS bits (see Table9) will be ignored: data will not be written, the written-once mechanism will lock the register and any further write access will be ignored. The default supply configuration will be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) will go on indicating invalid voltage levels. The system shall be power cycled before writing a new value."] 6593 pub const fn msize(&self) -> super::vals::Size {
8782 #[repr(transparent)] 6594 let val = (self.0 >> 13usize) & 0x03;
8783 #[derive(Copy, Clone, Eq, PartialEq)] 6595 super::vals::Size(val as u8)
8784 pub struct Cr3(pub u32);
8785 impl Cr3 {
8786 #[doc = "Power management unit bypass"]
8787 pub const fn bypass(&self) -> bool {
8788 let val = (self.0 >> 0usize) & 0x01;
8789 val != 0
8790 } 6596 }
8791 #[doc = "Power management unit bypass"] 6597 #[doc = "Memory data size"]
8792 pub fn set_bypass(&mut self, val: bool) { 6598 pub fn set_msize(&mut self, val: super::vals::Size) {
8793 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6599 self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize);
8794 } 6600 }
8795 #[doc = "Low drop-out regulator enable"] 6601 #[doc = "Peripheral increment offset size"]
8796 pub const fn ldoen(&self) -> bool { 6602 pub const fn pincos(&self) -> super::vals::Pincos {
8797 let val = (self.0 >> 1usize) & 0x01; 6603 let val = (self.0 >> 15usize) & 0x01;
8798 val != 0 6604 super::vals::Pincos(val as u8)
8799 } 6605 }
8800 #[doc = "Low drop-out regulator enable"] 6606 #[doc = "Peripheral increment offset size"]
8801 pub fn set_ldoen(&mut self, val: bool) { 6607 pub fn set_pincos(&mut self, val: super::vals::Pincos) {
8802 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 6608 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
8803 } 6609 }
8804 #[doc = "SD converter Enable"] 6610 #[doc = "Priority level"]
8805 pub const fn scuen(&self) -> bool { 6611 pub const fn pl(&self) -> super::vals::Pl {
8806 let val = (self.0 >> 2usize) & 0x01; 6612 let val = (self.0 >> 16usize) & 0x03;
8807 val != 0 6613 super::vals::Pl(val as u8)
8808 } 6614 }
8809 #[doc = "SD converter Enable"] 6615 #[doc = "Priority level"]
8810 pub fn set_scuen(&mut self, val: bool) { 6616 pub fn set_pl(&mut self, val: super::vals::Pl) {
8811 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 6617 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
8812 } 6618 }
8813 #[doc = "VBAT charging enable"] 6619 #[doc = "Double buffer mode"]
8814 pub const fn vbe(&self) -> bool { 6620 pub const fn dbm(&self) -> super::vals::Dbm {
8815 let val = (self.0 >> 8usize) & 0x01; 6621 let val = (self.0 >> 18usize) & 0x01;
8816 val != 0 6622 super::vals::Dbm(val as u8)
8817 } 6623 }
8818 #[doc = "VBAT charging enable"] 6624 #[doc = "Double buffer mode"]
8819 pub fn set_vbe(&mut self, val: bool) { 6625 pub fn set_dbm(&mut self, val: super::vals::Dbm) {
8820 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 6626 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
8821 } 6627 }
8822 #[doc = "VBAT charging resistor selection"] 6628 #[doc = "Current target (only in double buffer mode)"]
8823 pub const fn vbrs(&self) -> bool { 6629 pub const fn ct(&self) -> super::vals::Ct {
8824 let val = (self.0 >> 9usize) & 0x01; 6630 let val = (self.0 >> 19usize) & 0x01;
8825 val != 0 6631 super::vals::Ct(val as u8)
8826 } 6632 }
8827 #[doc = "VBAT charging resistor selection"] 6633 #[doc = "Current target (only in double buffer mode)"]
8828 pub fn set_vbrs(&mut self, val: bool) { 6634 pub fn set_ct(&mut self, val: super::vals::Ct) {
8829 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 6635 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
8830 } 6636 }
8831 #[doc = "VDD33USB voltage level detector enable."] 6637 #[doc = "Peripheral burst transfer configuration"]
8832 pub const fn usb33den(&self) -> bool { 6638 pub const fn pburst(&self) -> super::vals::Burst {
8833 let val = (self.0 >> 24usize) & 0x01; 6639 let val = (self.0 >> 21usize) & 0x03;
8834 val != 0 6640 super::vals::Burst(val as u8)
8835 } 6641 }
8836 #[doc = "VDD33USB voltage level detector enable."] 6642 #[doc = "Peripheral burst transfer configuration"]
8837 pub fn set_usb33den(&mut self, val: bool) { 6643 pub fn set_pburst(&mut self, val: super::vals::Burst) {
8838 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); 6644 self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize);
8839 } 6645 }
8840 #[doc = "USB regulator enable."] 6646 #[doc = "Memory burst transfer configuration"]
8841 pub const fn usbregen(&self) -> bool { 6647 pub const fn mburst(&self) -> super::vals::Burst {
8842 let val = (self.0 >> 25usize) & 0x01; 6648 let val = (self.0 >> 23usize) & 0x03;
8843 val != 0 6649 super::vals::Burst(val as u8)
8844 } 6650 }
8845 #[doc = "USB regulator enable."] 6651 #[doc = "Memory burst transfer configuration"]
8846 pub fn set_usbregen(&mut self, val: bool) { 6652 pub fn set_mburst(&mut self, val: super::vals::Burst) {
8847 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); 6653 self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize);
8848 } 6654 }
8849 #[doc = "USB supply ready."] 6655 #[doc = "Channel selection"]
8850 pub const fn usb33rdy(&self) -> bool { 6656 pub const fn chsel(&self) -> u8 {
8851 let val = (self.0 >> 26usize) & 0x01; 6657 let val = (self.0 >> 25usize) & 0x0f;
8852 val != 0 6658 val as u8
8853 } 6659 }
8854 #[doc = "USB supply ready."] 6660 #[doc = "Channel selection"]
8855 pub fn set_usb33rdy(&mut self, val: bool) { 6661 pub fn set_chsel(&mut self, val: u8) {
8856 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); 6662 self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize);
8857 } 6663 }
8858 } 6664 }
8859 impl Default for Cr3 { 6665 impl Default for Cr {
8860 fn default() -> Cr3 { 6666 fn default() -> Cr {
8861 Cr3(0) 6667 Cr(0)
8862 } 6668 }
8863 } 6669 }
8864 #[doc = "reset only by system reset, not reset by wakeup from Standby mode"] 6670 #[doc = "interrupt register"]
8865 #[repr(transparent)] 6671 #[repr(transparent)]
8866 #[derive(Copy, Clone, Eq, PartialEq)] 6672 #[derive(Copy, Clone, Eq, PartialEq)]
8867 pub struct Wkupfr(pub u32); 6673 pub struct Ixr(pub u32);
8868 impl Wkupfr { 6674 impl Ixr {
8869 #[doc = "Wakeup pin WKUPF flag. This bit is set by hardware and cleared only by a Reset pin or by setting the WKUPCn+1 bit in the PWR wakeup clear register (PWR_WKUPCR)."] 6675 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"]
8870 pub fn wkupf(&self, n: usize) -> bool { 6676 pub fn feif(&self, n: usize) -> bool {
8871 assert!(n < 6usize); 6677 assert!(n < 4usize);
8872 let offs = 0usize + n * 1usize; 6678 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
8873 let val = (self.0 >> offs) & 0x01; 6679 let val = (self.0 >> offs) & 0x01;
8874 val != 0 6680 val != 0
8875 } 6681 }
8876 #[doc = "Wakeup pin WKUPF flag. This bit is set by hardware and cleared only by a Reset pin or by setting the WKUPCn+1 bit in the PWR wakeup clear register (PWR_WKUPCR)."] 6682 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"]
8877 pub fn set_wkupf(&mut self, n: usize, val: bool) { 6683 pub fn set_feif(&mut self, n: usize, val: bool) {
8878 assert!(n < 6usize); 6684 assert!(n < 4usize);
8879 let offs = 0usize + n * 1usize; 6685 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
8880 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); 6686 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8881 } 6687 }
8882 } 6688 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"]
8883 impl Default for Wkupfr { 6689 pub fn dmeif(&self, n: usize) -> bool {
8884 fn default() -> Wkupfr { 6690 assert!(n < 4usize);
8885 Wkupfr(0) 6691 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
8886 } 6692 let val = (self.0 >> offs) & 0x01;
8887 }
8888 #[doc = "This register allows controlling CPU1 power."]
8889 #[repr(transparent)]
8890 #[derive(Copy, Clone, Eq, PartialEq)]
8891 pub struct Cpucr(pub u32);
8892 impl Cpucr {
8893 #[doc = "D1 domain Power Down Deepsleep selection. This bit allows CPU1 to define the Deepsleep mode for D1 domain."]
8894 pub const fn pdds_d1(&self) -> bool {
8895 let val = (self.0 >> 0usize) & 0x01;
8896 val != 0
8897 }
8898 #[doc = "D1 domain Power Down Deepsleep selection. This bit allows CPU1 to define the Deepsleep mode for D1 domain."]
8899 pub fn set_pdds_d1(&mut self, val: bool) {
8900 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8901 }
8902 #[doc = "D2 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for D2 domain."]
8903 pub const fn pdds_d2(&self) -> bool {
8904 let val = (self.0 >> 1usize) & 0x01;
8905 val != 0
8906 }
8907 #[doc = "D2 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for D2 domain."]
8908 pub fn set_pdds_d2(&mut self, val: bool) {
8909 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8910 }
8911 #[doc = "System D3 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for System D3 domain."]
8912 pub const fn pdds_d3(&self) -> bool {
8913 let val = (self.0 >> 2usize) & 0x01;
8914 val != 0
8915 }
8916 #[doc = "System D3 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for System D3 domain."]
8917 pub fn set_pdds_d3(&mut self, val: bool) {
8918 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8919 }
8920 #[doc = "STOP flag This bit is set by hardware and cleared only by any reset or by setting the CPU1 CSSF bit."]
8921 pub const fn stopf(&self) -> bool {
8922 let val = (self.0 >> 5usize) & 0x01;
8923 val != 0
8924 }
8925 #[doc = "STOP flag This bit is set by hardware and cleared only by any reset or by setting the CPU1 CSSF bit."]
8926 pub fn set_stopf(&mut self, val: bool) {
8927 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8928 }
8929 #[doc = "System Standby flag This bit is set by hardware and cleared only by a POR (Power-on Reset) or by setting the CPU1 CSSF bit"]
8930 pub const fn sbf(&self) -> bool {
8931 let val = (self.0 >> 6usize) & 0x01;
8932 val != 0
8933 }
8934 #[doc = "System Standby flag This bit is set by hardware and cleared only by a POR (Power-on Reset) or by setting the CPU1 CSSF bit"]
8935 pub fn set_sbf(&mut self, val: bool) {
8936 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8937 }
8938 #[doc = "D1 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D1 domain is no longer in DStandby mode."]
8939 pub const fn sbf_d1(&self) -> bool {
8940 let val = (self.0 >> 7usize) & 0x01;
8941 val != 0 6693 val != 0
8942 } 6694 }
8943 #[doc = "D1 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D1 domain is no longer in DStandby mode."] 6695 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"]
8944 pub fn set_sbf_d1(&mut self, val: bool) { 6696 pub fn set_dmeif(&mut self, n: usize, val: bool) {
8945 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 6697 assert!(n < 4usize);
6698 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6699 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8946 } 6700 }
8947 #[doc = "D2 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D2 domain is no longer in DStandby mode."] 6701 #[doc = "Stream x transfer error interrupt flag (x=3..0)"]
8948 pub const fn sbf_d2(&self) -> bool { 6702 pub fn teif(&self, n: usize) -> bool {
8949 let val = (self.0 >> 8usize) & 0x01; 6703 assert!(n < 4usize);
6704 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6705 let val = (self.0 >> offs) & 0x01;
8950 val != 0 6706 val != 0
8951 } 6707 }
8952 #[doc = "D2 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D2 domain is no longer in DStandby mode."] 6708 #[doc = "Stream x transfer error interrupt flag (x=3..0)"]
8953 pub fn set_sbf_d2(&mut self, val: bool) { 6709 pub fn set_teif(&mut self, n: usize, val: bool) {
8954 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 6710 assert!(n < 4usize);
6711 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6712 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8955 } 6713 }
8956 #[doc = "Clear D1 domain CPU1 Standby, Stop and HOLD flags (always read as 0) This bit is cleared to 0 by hardware."] 6714 #[doc = "Stream x half transfer interrupt flag (x=3..0)"]
8957 pub const fn cssf(&self) -> bool { 6715 pub fn htif(&self, n: usize) -> bool {
8958 let val = (self.0 >> 9usize) & 0x01; 6716 assert!(n < 4usize);
6717 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6718 let val = (self.0 >> offs) & 0x01;
8959 val != 0 6719 val != 0
8960 } 6720 }
8961 #[doc = "Clear D1 domain CPU1 Standby, Stop and HOLD flags (always read as 0) This bit is cleared to 0 by hardware."] 6721 #[doc = "Stream x half transfer interrupt flag (x=3..0)"]
8962 pub fn set_cssf(&mut self, val: bool) { 6722 pub fn set_htif(&mut self, n: usize, val: bool) {
8963 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 6723 assert!(n < 4usize);
6724 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6725 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8964 } 6726 }
8965 #[doc = "Keep system D3 domain in Run mode regardless of the CPU sub-systems modes"] 6727 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"]
8966 pub const fn run_d3(&self) -> bool { 6728 pub fn tcif(&self, n: usize) -> bool {
8967 let val = (self.0 >> 11usize) & 0x01; 6729 assert!(n < 4usize);
6730 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6731 let val = (self.0 >> offs) & 0x01;
8968 val != 0 6732 val != 0
8969 } 6733 }
8970 #[doc = "Keep system D3 domain in Run mode regardless of the CPU sub-systems modes"] 6734 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"]
8971 pub fn set_run_d3(&mut self, val: bool) { 6735 pub fn set_tcif(&mut self, n: usize, val: bool) {
8972 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 6736 assert!(n < 4usize);
6737 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6738 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8973 } 6739 }
8974 } 6740 }
8975 impl Default for Cpucr { 6741 impl Default for Ixr {
8976 fn default() -> Cpucr { 6742 fn default() -> Ixr {
8977 Cpucr(0) 6743 Ixr(0)
8978 } 6744 }
8979 } 6745 }
8980 #[doc = "PWR control status register 1"] 6746 #[doc = "stream x FIFO control register"]
8981 #[repr(transparent)] 6747 #[repr(transparent)]
8982 #[derive(Copy, Clone, Eq, PartialEq)] 6748 #[derive(Copy, Clone, Eq, PartialEq)]
8983 pub struct Csr1(pub u32); 6749 pub struct Fcr(pub u32);
8984 impl Csr1 { 6750 impl Fcr {
8985 #[doc = "Programmable voltage detect output This bit is set and cleared by hardware. It is valid only if the PVD has been enabled by the PVDE bit. Note: since the PVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the PVDE bit is set."] 6751 #[doc = "FIFO threshold selection"]
8986 pub const fn pvdo(&self) -> bool { 6752 pub const fn fth(&self) -> super::vals::Fth {
8987 let val = (self.0 >> 4usize) & 0x01; 6753 let val = (self.0 >> 0usize) & 0x03;
8988 val != 0 6754 super::vals::Fth(val as u8)
8989 } 6755 }
8990 #[doc = "Programmable voltage detect output This bit is set and cleared by hardware. It is valid only if the PVD has been enabled by the PVDE bit. Note: since the PVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the PVDE bit is set."] 6756 #[doc = "FIFO threshold selection"]
8991 pub fn set_pvdo(&mut self, val: bool) { 6757 pub fn set_fth(&mut self, val: super::vals::Fth) {
8992 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 6758 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
8993 } 6759 }
8994 #[doc = "Voltage levels ready bit for currently used VOS and SDLEVEL This bit is set to 1 by hardware when the voltage regulator and the SD converter are both disabled and Bypass mode is selected in PWR control register 3 (PWR_CR3)."] 6760 #[doc = "Direct mode disable"]
8995 pub const fn actvosrdy(&self) -> bool { 6761 pub const fn dmdis(&self) -> super::vals::Dmdis {
8996 let val = (self.0 >> 13usize) & 0x01; 6762 let val = (self.0 >> 2usize) & 0x01;
8997 val != 0 6763 super::vals::Dmdis(val as u8)
8998 } 6764 }
8999 #[doc = "Voltage levels ready bit for currently used VOS and SDLEVEL This bit is set to 1 by hardware when the voltage regulator and the SD converter are both disabled and Bypass mode is selected in PWR control register 3 (PWR_CR3)."] 6765 #[doc = "Direct mode disable"]
9000 pub fn set_actvosrdy(&mut self, val: bool) { 6766 pub fn set_dmdis(&mut self, val: super::vals::Dmdis) {
9001 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 6767 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
9002 } 6768 }
9003 #[doc = "VOS currently applied for VCORE voltage scaling selection. These bits reflect the last VOS value applied to the PMU."] 6769 #[doc = "FIFO status"]
9004 pub const fn actvos(&self) -> u8 { 6770 pub const fn fs(&self) -> super::vals::Fs {
9005 let val = (self.0 >> 14usize) & 0x03; 6771 let val = (self.0 >> 3usize) & 0x07;
9006 val as u8 6772 super::vals::Fs(val as u8)
9007 } 6773 }
9008 #[doc = "VOS currently applied for VCORE voltage scaling selection. These bits reflect the last VOS value applied to the PMU."] 6774 #[doc = "FIFO status"]
9009 pub fn set_actvos(&mut self, val: u8) { 6775 pub fn set_fs(&mut self, val: super::vals::Fs) {
9010 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); 6776 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
9011 } 6777 }
9012 #[doc = "Analog voltage detector output on VDDA This bit is set and cleared by hardware. It is valid only if AVD on VDDA is enabled by the AVDEN bit. Note: Since the AVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the AVDEN bit is set."] 6778 #[doc = "FIFO error interrupt enable"]
9013 pub const fn avdo(&self) -> bool { 6779 pub const fn feie(&self) -> bool {
9014 let val = (self.0 >> 16usize) & 0x01; 6780 let val = (self.0 >> 7usize) & 0x01;
9015 val != 0 6781 val != 0
9016 } 6782 }
9017 #[doc = "Analog voltage detector output on VDDA This bit is set and cleared by hardware. It is valid only if AVD on VDDA is enabled by the AVDEN bit. Note: Since the AVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the AVDEN bit is set."] 6783 #[doc = "FIFO error interrupt enable"]
9018 pub fn set_avdo(&mut self, val: bool) { 6784 pub fn set_feie(&mut self, val: bool) {
9019 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 6785 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
9020 } 6786 }
9021 } 6787 }
9022 impl Default for Csr1 { 6788 impl Default for Fcr {
9023 fn default() -> Csr1 { 6789 fn default() -> Fcr {
9024 Csr1(0) 6790 Fcr(0)
9025 } 6791 }
9026 } 6792 }
9027 #[doc = "PWR control register 1"] 6793 }
6794}
6795pub mod gpio_v1 {
6796 use crate::generic::*;
6797 #[doc = "General purpose I/O"]
6798 #[derive(Copy, Clone)]
6799 pub struct Gpio(pub *mut u8);
6800 unsafe impl Send for Gpio {}
6801 unsafe impl Sync for Gpio {}
6802 impl Gpio {
6803 #[doc = "Port configuration register low (GPIOn_CRL)"]
6804 pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> {
6805 assert!(n < 2usize);
6806 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
6807 }
6808 #[doc = "Port input data register (GPIOn_IDR)"]
6809 pub fn idr(self) -> Reg<regs::Idr, R> {
6810 unsafe { Reg::from_ptr(self.0.add(8usize)) }
6811 }
6812 #[doc = "Port output data register (GPIOn_ODR)"]
6813 pub fn odr(self) -> Reg<regs::Odr, RW> {
6814 unsafe { Reg::from_ptr(self.0.add(12usize)) }
6815 }
6816 #[doc = "Port bit set/reset register (GPIOn_BSRR)"]
6817 pub fn bsrr(self) -> Reg<regs::Bsrr, W> {
6818 unsafe { Reg::from_ptr(self.0.add(16usize)) }
6819 }
6820 #[doc = "Port bit reset register (GPIOn_BRR)"]
6821 pub fn brr(self) -> Reg<regs::Brr, W> {
6822 unsafe { Reg::from_ptr(self.0.add(20usize)) }
6823 }
6824 #[doc = "Port configuration lock register"]
6825 pub fn lckr(self) -> Reg<regs::Lckr, RW> {
6826 unsafe { Reg::from_ptr(self.0.add(24usize)) }
6827 }
6828 }
6829 pub mod vals {
6830 use crate::generic::*;
6831 #[repr(transparent)]
6832 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6833 pub struct Lckk(pub u8);
6834 impl Lckk {
6835 #[doc = "Port configuration lock key not active"]
6836 pub const NOTACTIVE: Self = Self(0);
6837 #[doc = "Port configuration lock key active"]
6838 pub const ACTIVE: Self = Self(0x01);
6839 }
6840 #[repr(transparent)]
6841 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6842 pub struct Lck(pub u8);
6843 impl Lck {
6844 #[doc = "Port configuration not locked"]
6845 pub const UNLOCKED: Self = Self(0);
6846 #[doc = "Port configuration locked"]
6847 pub const LOCKED: Self = Self(0x01);
6848 }
6849 #[repr(transparent)]
6850 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6851 pub struct Bsw(pub u8);
6852 impl Bsw {
6853 #[doc = "No action on the corresponding ODx bit"]
6854 pub const NOACTION: Self = Self(0);
6855 #[doc = "Sets the corresponding ODRx bit"]
6856 pub const SET: Self = Self(0x01);
6857 }
6858 #[repr(transparent)]
6859 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6860 pub struct Odr(pub u8);
6861 impl Odr {
6862 #[doc = "Set output to logic low"]
6863 pub const LOW: Self = Self(0);
6864 #[doc = "Set output to logic high"]
6865 pub const HIGH: Self = Self(0x01);
6866 }
6867 #[repr(transparent)]
6868 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6869 pub struct Brw(pub u8);
6870 impl Brw {
6871 #[doc = "No action on the corresponding ODx bit"]
6872 pub const NOACTION: Self = Self(0);
6873 #[doc = "Reset the ODx bit"]
6874 pub const RESET: Self = Self(0x01);
6875 }
6876 #[repr(transparent)]
6877 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6878 pub struct Mode(pub u8);
6879 impl Mode {
6880 #[doc = "Input mode (reset state)"]
6881 pub const INPUT: Self = Self(0);
6882 #[doc = "Output mode 10 MHz"]
6883 pub const OUTPUT: Self = Self(0x01);
6884 #[doc = "Output mode 2 MHz"]
6885 pub const OUTPUT2: Self = Self(0x02);
6886 #[doc = "Output mode 50 MHz"]
6887 pub const OUTPUT50: Self = Self(0x03);
6888 }
6889 #[repr(transparent)]
6890 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6891 pub struct Cnf(pub u8);
6892 impl Cnf {
6893 #[doc = "Analog mode / Push-Pull mode"]
6894 pub const PUSHPULL: Self = Self(0);
6895 #[doc = "Floating input (reset state) / Open Drain-Mode"]
6896 pub const OPENDRAIN: Self = Self(0x01);
6897 #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"]
6898 pub const ALTPUSHPULL: Self = Self(0x02);
6899 #[doc = "Alternate Function Open-Drain Mode"]
6900 pub const ALTOPENDRAIN: Self = Self(0x03);
6901 }
6902 #[repr(transparent)]
6903 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6904 pub struct Idr(pub u8);
6905 impl Idr {
6906 #[doc = "Input is logic low"]
6907 pub const LOW: Self = Self(0);
6908 #[doc = "Input is logic high"]
6909 pub const HIGH: Self = Self(0x01);
6910 }
6911 }
6912 pub mod regs {
6913 use crate::generic::*;
6914 #[doc = "Port bit set/reset register (GPIOn_BSRR)"]
9028 #[repr(transparent)] 6915 #[repr(transparent)]
9029 #[derive(Copy, Clone, Eq, PartialEq)] 6916 #[derive(Copy, Clone, Eq, PartialEq)]
9030 pub struct Cr1(pub u32); 6917 pub struct Bsrr(pub u32);
9031 impl Cr1 { 6918 impl Bsrr {
9032 #[doc = "Low-power Deepsleep with SVOS3 (SVOS4 and SVOS5 always use low-power, regardless of the setting of this bit)"] 6919 #[doc = "Set bit"]
9033 pub const fn lpds(&self) -> bool { 6920 pub fn bs(&self, n: usize) -> bool {
9034 let val = (self.0 >> 0usize) & 0x01; 6921 assert!(n < 16usize);
6922 let offs = 0usize + n * 1usize;
6923 let val = (self.0 >> offs) & 0x01;
9035 val != 0 6924 val != 0
9036 } 6925 }
9037 #[doc = "Low-power Deepsleep with SVOS3 (SVOS4 and SVOS5 always use low-power, regardless of the setting of this bit)"] 6926 #[doc = "Set bit"]
9038 pub fn set_lpds(&mut self, val: bool) { 6927 pub fn set_bs(&mut self, n: usize, val: bool) {
9039 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6928 assert!(n < 16usize);
6929 let offs = 0usize + n * 1usize;
6930 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
9040 } 6931 }
9041 #[doc = "Programmable voltage detector enable"] 6932 #[doc = "Reset bit"]
9042 pub const fn pvde(&self) -> bool { 6933 pub fn br(&self, n: usize) -> bool {
9043 let val = (self.0 >> 4usize) & 0x01; 6934 assert!(n < 16usize);
6935 let offs = 16usize + n * 1usize;
6936 let val = (self.0 >> offs) & 0x01;
9044 val != 0 6937 val != 0
9045 } 6938 }
9046 #[doc = "Programmable voltage detector enable"] 6939 #[doc = "Reset bit"]
9047 pub fn set_pvde(&mut self, val: bool) { 6940 pub fn set_br(&mut self, n: usize, val: bool) {
9048 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 6941 assert!(n < 16usize);
9049 } 6942 let offs = 16usize + n * 1usize;
9050 #[doc = "Programmable voltage detector level selection These bits select the voltage threshold detected by the PVD. Note: Refer to Section Electrical characteristics of the product datasheet for more details."] 6943 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
9051 pub const fn pls(&self) -> u8 {
9052 let val = (self.0 >> 5usize) & 0x07;
9053 val as u8
9054 } 6944 }
9055 #[doc = "Programmable voltage detector level selection These bits select the voltage threshold detected by the PVD. Note: Refer to Section Electrical characteristics of the product datasheet for more details."] 6945 }
9056 pub fn set_pls(&mut self, val: u8) { 6946 impl Default for Bsrr {
9057 self.0 = (self.0 & !(0x07 << 5usize)) | (((val as u32) & 0x07) << 5usize); 6947 fn default() -> Bsrr {
6948 Bsrr(0)
9058 } 6949 }
9059 #[doc = "Disable backup domain write protection In reset state, the RCC_BDCR register, the RTC registers (including the backup registers), BREN and MOEN bits in PWR_CR2 register, are protected against parasitic write access. This bit must be set to enable write access to these registers."] 6950 }
9060 pub const fn dbp(&self) -> bool { 6951 #[doc = "Port input data register (GPIOn_IDR)"]
9061 let val = (self.0 >> 8usize) & 0x01; 6952 #[repr(transparent)]
9062 val != 0 6953 #[derive(Copy, Clone, Eq, PartialEq)]
6954 pub struct Idr(pub u32);
6955 impl Idr {
6956 #[doc = "Port input data"]
6957 pub fn idr(&self, n: usize) -> super::vals::Idr {
6958 assert!(n < 16usize);
6959 let offs = 0usize + n * 1usize;
6960 let val = (self.0 >> offs) & 0x01;
6961 super::vals::Idr(val as u8)
9063 } 6962 }
9064 #[doc = "Disable backup domain write protection In reset state, the RCC_BDCR register, the RTC registers (including the backup registers), BREN and MOEN bits in PWR_CR2 register, are protected against parasitic write access. This bit must be set to enable write access to these registers."] 6963 #[doc = "Port input data"]
9065 pub fn set_dbp(&mut self, val: bool) { 6964 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) {
9066 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 6965 assert!(n < 16usize);
6966 let offs = 0usize + n * 1usize;
6967 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
9067 } 6968 }
9068 #[doc = "Flash low-power mode in DStop mode This bit allows to obtain the best trade-off between low-power consumption and restart time when exiting from DStop mode. When it is set, the Flash memory enters low-power mode when D1 domain is in DStop mode."] 6969 }
9069 pub const fn flps(&self) -> bool { 6970 impl Default for Idr {
9070 let val = (self.0 >> 9usize) & 0x01; 6971 fn default() -> Idr {
9071 val != 0 6972 Idr(0)
9072 } 6973 }
9073 #[doc = "Flash low-power mode in DStop mode This bit allows to obtain the best trade-off between low-power consumption and restart time when exiting from DStop mode. When it is set, the Flash memory enters low-power mode when D1 domain is in DStop mode."] 6974 }
9074 pub fn set_flps(&mut self, val: bool) { 6975 #[doc = "Port output data register (GPIOn_ODR)"]
9075 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 6976 #[repr(transparent)]
6977 #[derive(Copy, Clone, Eq, PartialEq)]
6978 pub struct Odr(pub u32);
6979 impl Odr {
6980 #[doc = "Port output data"]
6981 pub fn odr(&self, n: usize) -> super::vals::Odr {
6982 assert!(n < 16usize);
6983 let offs = 0usize + n * 1usize;
6984 let val = (self.0 >> offs) & 0x01;
6985 super::vals::Odr(val as u8)
9076 } 6986 }
9077 #[doc = "System Stop mode voltage scaling selection These bits control the VCORE voltage level in system Stop mode, to obtain the best trade-off between power consumption and performance."] 6987 #[doc = "Port output data"]
9078 pub const fn svos(&self) -> u8 { 6988 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) {
9079 let val = (self.0 >> 14usize) & 0x03; 6989 assert!(n < 16usize);
9080 val as u8 6990 let offs = 0usize + n * 1usize;
6991 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
9081 } 6992 }
9082 #[doc = "System Stop mode voltage scaling selection These bits control the VCORE voltage level in system Stop mode, to obtain the best trade-off between power consumption and performance."] 6993 }
9083 pub fn set_svos(&mut self, val: u8) { 6994 impl Default for Odr {
9084 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); 6995 fn default() -> Odr {
6996 Odr(0)
9085 } 6997 }
9086 #[doc = "Peripheral voltage monitor on VDDA enable"] 6998 }
9087 pub const fn avden(&self) -> bool { 6999 #[doc = "Port configuration register (GPIOn_CRx)"]
9088 let val = (self.0 >> 16usize) & 0x01; 7000 #[repr(transparent)]
9089 val != 0 7001 #[derive(Copy, Clone, Eq, PartialEq)]
7002 pub struct Cr(pub u32);
7003 impl Cr {
7004 #[doc = "Port n mode bits"]
7005 pub fn mode(&self, n: usize) -> super::vals::Mode {
7006 assert!(n < 8usize);
7007 let offs = 0usize + n * 4usize;
7008 let val = (self.0 >> offs) & 0x03;
7009 super::vals::Mode(val as u8)
9090 } 7010 }
9091 #[doc = "Peripheral voltage monitor on VDDA enable"] 7011 #[doc = "Port n mode bits"]
9092 pub fn set_avden(&mut self, val: bool) { 7012 pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) {
9093 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 7013 assert!(n < 8usize);
7014 let offs = 0usize + n * 4usize;
7015 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
9094 } 7016 }
9095 #[doc = "Analog voltage detector level selection These bits select the voltage threshold detected by the AVD."] 7017 #[doc = "Port n configuration bits"]
9096 pub const fn als(&self) -> u8 { 7018 pub fn cnf(&self, n: usize) -> super::vals::Cnf {
9097 let val = (self.0 >> 17usize) & 0x03; 7019 assert!(n < 8usize);
9098 val as u8 7020 let offs = 2usize + n * 4usize;
7021 let val = (self.0 >> offs) & 0x03;
7022 super::vals::Cnf(val as u8)
9099 } 7023 }
9100 #[doc = "Analog voltage detector level selection These bits select the voltage threshold detected by the AVD."] 7024 #[doc = "Port n configuration bits"]
9101 pub fn set_als(&mut self, val: u8) { 7025 pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) {
9102 self.0 = (self.0 & !(0x03 << 17usize)) | (((val as u32) & 0x03) << 17usize); 7026 assert!(n < 8usize);
7027 let offs = 2usize + n * 4usize;
7028 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
9103 } 7029 }
9104 } 7030 }
9105 impl Default for Cr1 { 7031 impl Default for Cr {
9106 fn default() -> Cr1 { 7032 fn default() -> Cr {
9107 Cr1(0) 7033 Cr(0)
9108 } 7034 }
9109 } 7035 }
9110 #[doc = "This register allows controlling D3 domain power.Following reset VOSRDY will be read 1 by software"] 7036 #[doc = "Port configuration lock register"]
9111 #[repr(transparent)] 7037 #[repr(transparent)]
9112 #[derive(Copy, Clone, Eq, PartialEq)] 7038 #[derive(Copy, Clone, Eq, PartialEq)]
9113 pub struct D3cr(pub u32); 7039 pub struct Lckr(pub u32);
9114 impl D3cr { 7040 impl Lckr {
9115 #[doc = "VOS Ready bit for VCORE voltage scaling output selection. This bit is set to 1 by hardware when Bypass mode is selected in PWR control register 3 (PWR_CR3)."] 7041 #[doc = "Port A Lock bit"]
9116 pub const fn vosrdy(&self) -> bool { 7042 pub fn lck(&self, n: usize) -> super::vals::Lck {
9117 let val = (self.0 >> 13usize) & 0x01; 7043 assert!(n < 16usize);
9118 val != 0 7044 let offs = 0usize + n * 1usize;
7045 let val = (self.0 >> offs) & 0x01;
7046 super::vals::Lck(val as u8)
9119 } 7047 }
9120 #[doc = "VOS Ready bit for VCORE voltage scaling output selection. This bit is set to 1 by hardware when Bypass mode is selected in PWR control register 3 (PWR_CR3)."] 7048 #[doc = "Port A Lock bit"]
9121 pub fn set_vosrdy(&mut self, val: bool) { 7049 pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) {
9122 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 7050 assert!(n < 16usize);
7051 let offs = 0usize + n * 1usize;
7052 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
9123 } 7053 }
9124 #[doc = "Voltage scaling selection according to performance These bits control the VCORE voltage level and allow to obtains the best trade-off between power consumption and performance: When increasing the performance, the voltage scaling shall be changed before increasing the system frequency. When decreasing performance, the system frequency shall first be decreased before changing the voltage scaling."] 7054 #[doc = "Lock key"]
9125 pub const fn vos(&self) -> u8 { 7055 pub const fn lckk(&self) -> super::vals::Lckk {
9126 let val = (self.0 >> 14usize) & 0x03; 7056 let val = (self.0 >> 16usize) & 0x01;
9127 val as u8 7057 super::vals::Lckk(val as u8)
9128 } 7058 }
9129 #[doc = "Voltage scaling selection according to performance These bits control the VCORE voltage level and allow to obtains the best trade-off between power consumption and performance: When increasing the performance, the voltage scaling shall be changed before increasing the system frequency. When decreasing performance, the system frequency shall first be decreased before changing the voltage scaling."] 7059 #[doc = "Lock key"]
9130 pub fn set_vos(&mut self, val: u8) { 7060 pub fn set_lckk(&mut self, val: super::vals::Lckk) {
9131 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); 7061 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
9132 } 7062 }
9133 } 7063 }
9134 impl Default for D3cr { 7064 impl Default for Lckr {
9135 fn default() -> D3cr { 7065 fn default() -> Lckr {
9136 D3cr(0) 7066 Lckr(0)
9137 } 7067 }
9138 } 7068 }
9139 #[doc = "Reset only by system reset, not reset by wakeup from Standby mode"] 7069 #[doc = "Port bit reset register (GPIOn_BRR)"]
9140 #[repr(transparent)] 7070 #[repr(transparent)]
9141 #[derive(Copy, Clone, Eq, PartialEq)] 7071 #[derive(Copy, Clone, Eq, PartialEq)]
9142 pub struct Wkupepr(pub u32); 7072 pub struct Brr(pub u32);
9143 impl Wkupepr { 7073 impl Brr {
9144 #[doc = "Enable Wakeup Pin WKUPn+1 Each bit is set and cleared by software. Note: An additional wakeup event is detected if WKUPn+1 pin is enabled (by setting the WKUPENn+1 bit) when WKUPn+1 pin level is already high when WKUPPn+1 selects rising edge, or low when WKUPPn+1 selects falling edge."] 7074 #[doc = "Reset bit"]
9145 pub fn wkupen(&self, n: usize) -> bool { 7075 pub fn br(&self, n: usize) -> bool {
9146 assert!(n < 6usize); 7076 assert!(n < 16usize);
9147 let offs = 0usize + n * 1usize; 7077 let offs = 0usize + n * 1usize;
9148 let val = (self.0 >> offs) & 0x01; 7078 let val = (self.0 >> offs) & 0x01;
9149 val != 0 7079 val != 0
9150 } 7080 }
9151 #[doc = "Enable Wakeup Pin WKUPn+1 Each bit is set and cleared by software. Note: An additional wakeup event is detected if WKUPn+1 pin is enabled (by setting the WKUPENn+1 bit) when WKUPn+1 pin level is already high when WKUPPn+1 selects rising edge, or low when WKUPPn+1 selects falling edge."] 7081 #[doc = "Reset bit"]
9152 pub fn set_wkupen(&mut self, n: usize, val: bool) { 7082 pub fn set_br(&mut self, n: usize, val: bool) {
9153 assert!(n < 6usize); 7083 assert!(n < 16usize);
9154 let offs = 0usize + n * 1usize; 7084 let offs = 0usize + n * 1usize;
9155 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs); 7085 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
9156 } 7086 }
9157 #[doc = "Wakeup pin polarity bit for WKUPn-7 These bits define the polarity used for event detection on WKUPn-7 external wakeup pin."]
9158 pub fn wkupp(&self, n: usize) -> bool {
9159 assert!(n < 6usize);
9160 let offs = 8usize + n * 1usize;
9161 let val = (self.0 >> offs) & 0x01;
9162 val != 0
9163 }
9164 #[doc = "Wakeup pin polarity bit for WKUPn-7 These bits define the polarity used for event detection on WKUPn-7 external wakeup pin."]
9165 pub fn set_wkupp(&mut self, n: usize, val: bool) {
9166 assert!(n < 6usize);
9167 let offs = 8usize + n * 1usize;
9168 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
9169 }
9170 #[doc = "Wakeup pin pull configuration"]
9171 pub fn wkuppupd(&self, n: usize) -> u8 {
9172 assert!(n < 6usize);
9173 let offs = 16usize + n * 2usize;
9174 let val = (self.0 >> offs) & 0x03;
9175 val as u8
9176 }
9177 #[doc = "Wakeup pin pull configuration"]
9178 pub fn set_wkuppupd(&mut self, n: usize, val: u8) {
9179 assert!(n < 6usize);
9180 let offs = 16usize + n * 2usize;
9181 self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs);
9182 }
9183 } 7087 }
9184 impl Default for Wkupepr { 7088 impl Default for Brr {
9185 fn default() -> Wkupepr { 7089 fn default() -> Brr {
9186 Wkupepr(0) 7090 Brr(0)
9187 } 7091 }
9188 } 7092 }
9189 } 7093 }
@@ -9485,666 +7389,60 @@ pub mod rcc_h7 {
9485 } 7389 }
9486 pub mod regs { 7390 pub mod regs {
9487 use crate::generic::*; 7391 use crate::generic::*;
9488 #[doc = "RCC APB2 Sleep Clock Register"] 7392 #[doc = "RCC APB1 Peripheral Reset Register"]
9489 #[repr(transparent)]
9490 #[derive(Copy, Clone, Eq, PartialEq)]
9491 pub struct C1Apb2lpenr(pub u32);
9492 impl C1Apb2lpenr {
9493 #[doc = "TIM1 peripheral clock enable during CSleep mode"]
9494 pub const fn tim1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9495 let val = (self.0 >> 0usize) & 0x01;
9496 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9497 }
9498 #[doc = "TIM1 peripheral clock enable during CSleep mode"]
9499 pub fn set_tim1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9500 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
9501 }
9502 #[doc = "TIM8 peripheral clock enable during CSleep mode"]
9503 pub const fn tim8lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9504 let val = (self.0 >> 1usize) & 0x01;
9505 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9506 }
9507 #[doc = "TIM8 peripheral clock enable during CSleep mode"]
9508 pub fn set_tim8lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9509 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
9510 }
9511 #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"]
9512 pub const fn usart1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9513 let val = (self.0 >> 4usize) & 0x01;
9514 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9515 }
9516 #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"]
9517 pub fn set_usart1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9518 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
9519 }
9520 #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"]
9521 pub const fn usart6lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9522 let val = (self.0 >> 5usize) & 0x01;
9523 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9524 }
9525 #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"]
9526 pub fn set_usart6lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9527 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
9528 }
9529 #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"]
9530 pub const fn spi1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9531 let val = (self.0 >> 12usize) & 0x01;
9532 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9533 }
9534 #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"]
9535 pub fn set_spi1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9536 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
9537 }
9538 #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"]
9539 pub const fn spi4lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9540 let val = (self.0 >> 13usize) & 0x01;
9541 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9542 }
9543 #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"]
9544 pub fn set_spi4lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9545 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
9546 }
9547 #[doc = "TIM15 peripheral clock enable during CSleep mode"]
9548 pub const fn tim15lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9549 let val = (self.0 >> 16usize) & 0x01;
9550 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9551 }
9552 #[doc = "TIM15 peripheral clock enable during CSleep mode"]
9553 pub fn set_tim15lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9554 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
9555 }
9556 #[doc = "TIM16 peripheral clock enable during CSleep mode"]
9557 pub const fn tim16lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9558 let val = (self.0 >> 17usize) & 0x01;
9559 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9560 }
9561 #[doc = "TIM16 peripheral clock enable during CSleep mode"]
9562 pub fn set_tim16lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9563 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
9564 }
9565 #[doc = "TIM17 peripheral clock enable during CSleep mode"]
9566 pub const fn tim17lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9567 let val = (self.0 >> 18usize) & 0x01;
9568 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9569 }
9570 #[doc = "TIM17 peripheral clock enable during CSleep mode"]
9571 pub fn set_tim17lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9572 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
9573 }
9574 #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"]
9575 pub const fn spi5lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9576 let val = (self.0 >> 20usize) & 0x01;
9577 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9578 }
9579 #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"]
9580 pub fn set_spi5lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9581 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
9582 }
9583 #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"]
9584 pub const fn sai1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9585 let val = (self.0 >> 22usize) & 0x01;
9586 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9587 }
9588 #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"]
9589 pub fn set_sai1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9590 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
9591 }
9592 #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"]
9593 pub const fn sai2lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9594 let val = (self.0 >> 23usize) & 0x01;
9595 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9596 }
9597 #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"]
9598 pub fn set_sai2lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9599 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
9600 }
9601 #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"]
9602 pub const fn sai3lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9603 let val = (self.0 >> 24usize) & 0x01;
9604 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9605 }
9606 #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"]
9607 pub fn set_sai3lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9608 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
9609 }
9610 #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"]
9611 pub const fn dfsdm1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9612 let val = (self.0 >> 28usize) & 0x01;
9613 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9614 }
9615 #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"]
9616 pub fn set_dfsdm1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9617 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
9618 }
9619 #[doc = "HRTIM peripheral clock enable during CSleep mode"]
9620 pub const fn hrtimlpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
9621 let val = (self.0 >> 29usize) & 0x01;
9622 super::vals::C1Apb2lpenrTim1lpen(val as u8)
9623 }
9624 #[doc = "HRTIM peripheral clock enable during CSleep mode"]
9625 pub fn set_hrtimlpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
9626 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
9627 }
9628 }
9629 impl Default for C1Apb2lpenr {
9630 fn default() -> C1Apb2lpenr {
9631 C1Apb2lpenr(0)
9632 }
9633 }
9634 #[doc = "RCC AHB2 Clock Register"]
9635 #[repr(transparent)]
9636 #[derive(Copy, Clone, Eq, PartialEq)]
9637 pub struct Ahb2enr(pub u32);
9638 impl Ahb2enr {
9639 #[doc = "DCMI peripheral clock"]
9640 pub const fn dcmien(&self) -> super::vals::Ahb2enrDcmien {
9641 let val = (self.0 >> 0usize) & 0x01;
9642 super::vals::Ahb2enrDcmien(val as u8)
9643 }
9644 #[doc = "DCMI peripheral clock"]
9645 pub fn set_dcmien(&mut self, val: super::vals::Ahb2enrDcmien) {
9646 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
9647 }
9648 #[doc = "CRYPT peripheral clock enable"]
9649 pub const fn crypten(&self) -> super::vals::Ahb2enrDcmien {
9650 let val = (self.0 >> 4usize) & 0x01;
9651 super::vals::Ahb2enrDcmien(val as u8)
9652 }
9653 #[doc = "CRYPT peripheral clock enable"]
9654 pub fn set_crypten(&mut self, val: super::vals::Ahb2enrDcmien) {
9655 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
9656 }
9657 #[doc = "HASH peripheral clock enable"]
9658 pub const fn hashen(&self) -> super::vals::Ahb2enrDcmien {
9659 let val = (self.0 >> 5usize) & 0x01;
9660 super::vals::Ahb2enrDcmien(val as u8)
9661 }
9662 #[doc = "HASH peripheral clock enable"]
9663 pub fn set_hashen(&mut self, val: super::vals::Ahb2enrDcmien) {
9664 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
9665 }
9666 #[doc = "RNG peripheral clocks enable"]
9667 pub const fn rngen(&self) -> super::vals::Ahb2enrDcmien {
9668 let val = (self.0 >> 6usize) & 0x01;
9669 super::vals::Ahb2enrDcmien(val as u8)
9670 }
9671 #[doc = "RNG peripheral clocks enable"]
9672 pub fn set_rngen(&mut self, val: super::vals::Ahb2enrDcmien) {
9673 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
9674 }
9675 #[doc = "SDMMC2 and SDMMC2 delay clock enable"]
9676 pub const fn sdmmc2en(&self) -> super::vals::Ahb2enrDcmien {
9677 let val = (self.0 >> 9usize) & 0x01;
9678 super::vals::Ahb2enrDcmien(val as u8)
9679 }
9680 #[doc = "SDMMC2 and SDMMC2 delay clock enable"]
9681 pub fn set_sdmmc2en(&mut self, val: super::vals::Ahb2enrDcmien) {
9682 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
9683 }
9684 #[doc = "SRAM1 block enable"]
9685 pub const fn sram1en(&self) -> super::vals::Ahb2enrDcmien {
9686 let val = (self.0 >> 29usize) & 0x01;
9687 super::vals::Ahb2enrDcmien(val as u8)
9688 }
9689 #[doc = "SRAM1 block enable"]
9690 pub fn set_sram1en(&mut self, val: super::vals::Ahb2enrDcmien) {
9691 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
9692 }
9693 #[doc = "SRAM2 block enable"]
9694 pub const fn sram2en(&self) -> super::vals::Ahb2enrDcmien {
9695 let val = (self.0 >> 30usize) & 0x01;
9696 super::vals::Ahb2enrDcmien(val as u8)
9697 }
9698 #[doc = "SRAM2 block enable"]
9699 pub fn set_sram2en(&mut self, val: super::vals::Ahb2enrDcmien) {
9700 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
9701 }
9702 #[doc = "SRAM3 block enable"]
9703 pub const fn sram3en(&self) -> super::vals::Ahb2enrDcmien {
9704 let val = (self.0 >> 31usize) & 0x01;
9705 super::vals::Ahb2enrDcmien(val as u8)
9706 }
9707 #[doc = "SRAM3 block enable"]
9708 pub fn set_sram3en(&mut self, val: super::vals::Ahb2enrDcmien) {
9709 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
9710 }
9711 }
9712 impl Default for Ahb2enr {
9713 fn default() -> Ahb2enr {
9714 Ahb2enr(0)
9715 }
9716 }
9717 #[doc = "RCC APB2 Peripheral Reset Register"]
9718 #[repr(transparent)]
9719 #[derive(Copy, Clone, Eq, PartialEq)]
9720 pub struct Apb2rstr(pub u32);
9721 impl Apb2rstr {
9722 #[doc = "TIM1 block reset"]
9723 pub const fn tim1rst(&self) -> super::vals::Tim1rst {
9724 let val = (self.0 >> 0usize) & 0x01;
9725 super::vals::Tim1rst(val as u8)
9726 }
9727 #[doc = "TIM1 block reset"]
9728 pub fn set_tim1rst(&mut self, val: super::vals::Tim1rst) {
9729 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
9730 }
9731 #[doc = "TIM8 block reset"]
9732 pub const fn tim8rst(&self) -> super::vals::Tim1rst {
9733 let val = (self.0 >> 1usize) & 0x01;
9734 super::vals::Tim1rst(val as u8)
9735 }
9736 #[doc = "TIM8 block reset"]
9737 pub fn set_tim8rst(&mut self, val: super::vals::Tim1rst) {
9738 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
9739 }
9740 #[doc = "USART1 block reset"]
9741 pub const fn usart1rst(&self) -> super::vals::Tim1rst {
9742 let val = (self.0 >> 4usize) & 0x01;
9743 super::vals::Tim1rst(val as u8)
9744 }
9745 #[doc = "USART1 block reset"]
9746 pub fn set_usart1rst(&mut self, val: super::vals::Tim1rst) {
9747 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
9748 }
9749 #[doc = "USART6 block reset"]
9750 pub const fn usart6rst(&self) -> super::vals::Tim1rst {
9751 let val = (self.0 >> 5usize) & 0x01;
9752 super::vals::Tim1rst(val as u8)
9753 }
9754 #[doc = "USART6 block reset"]
9755 pub fn set_usart6rst(&mut self, val: super::vals::Tim1rst) {
9756 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
9757 }
9758 #[doc = "SPI1 block reset"]
9759 pub const fn spi1rst(&self) -> super::vals::Tim1rst {
9760 let val = (self.0 >> 12usize) & 0x01;
9761 super::vals::Tim1rst(val as u8)
9762 }
9763 #[doc = "SPI1 block reset"]
9764 pub fn set_spi1rst(&mut self, val: super::vals::Tim1rst) {
9765 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
9766 }
9767 #[doc = "SPI4 block reset"]
9768 pub const fn spi4rst(&self) -> super::vals::Tim1rst {
9769 let val = (self.0 >> 13usize) & 0x01;
9770 super::vals::Tim1rst(val as u8)
9771 }
9772 #[doc = "SPI4 block reset"]
9773 pub fn set_spi4rst(&mut self, val: super::vals::Tim1rst) {
9774 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
9775 }
9776 #[doc = "TIM15 block reset"]
9777 pub const fn tim15rst(&self) -> super::vals::Tim1rst {
9778 let val = (self.0 >> 16usize) & 0x01;
9779 super::vals::Tim1rst(val as u8)
9780 }
9781 #[doc = "TIM15 block reset"]
9782 pub fn set_tim15rst(&mut self, val: super::vals::Tim1rst) {
9783 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
9784 }
9785 #[doc = "TIM16 block reset"]
9786 pub const fn tim16rst(&self) -> super::vals::Tim1rst {
9787 let val = (self.0 >> 17usize) & 0x01;
9788 super::vals::Tim1rst(val as u8)
9789 }
9790 #[doc = "TIM16 block reset"]
9791 pub fn set_tim16rst(&mut self, val: super::vals::Tim1rst) {
9792 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
9793 }
9794 #[doc = "TIM17 block reset"]
9795 pub const fn tim17rst(&self) -> super::vals::Tim1rst {
9796 let val = (self.0 >> 18usize) & 0x01;
9797 super::vals::Tim1rst(val as u8)
9798 }
9799 #[doc = "TIM17 block reset"]
9800 pub fn set_tim17rst(&mut self, val: super::vals::Tim1rst) {
9801 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
9802 }
9803 #[doc = "SPI5 block reset"]
9804 pub const fn spi5rst(&self) -> super::vals::Tim1rst {
9805 let val = (self.0 >> 20usize) & 0x01;
9806 super::vals::Tim1rst(val as u8)
9807 }
9808 #[doc = "SPI5 block reset"]
9809 pub fn set_spi5rst(&mut self, val: super::vals::Tim1rst) {
9810 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
9811 }
9812 #[doc = "SAI1 block reset"]
9813 pub const fn sai1rst(&self) -> super::vals::Tim1rst {
9814 let val = (self.0 >> 22usize) & 0x01;
9815 super::vals::Tim1rst(val as u8)
9816 }
9817 #[doc = "SAI1 block reset"]
9818 pub fn set_sai1rst(&mut self, val: super::vals::Tim1rst) {
9819 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
9820 }
9821 #[doc = "SAI2 block reset"]
9822 pub const fn sai2rst(&self) -> super::vals::Tim1rst {
9823 let val = (self.0 >> 23usize) & 0x01;
9824 super::vals::Tim1rst(val as u8)
9825 }
9826 #[doc = "SAI2 block reset"]
9827 pub fn set_sai2rst(&mut self, val: super::vals::Tim1rst) {
9828 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
9829 }
9830 #[doc = "SAI3 block reset"]
9831 pub const fn sai3rst(&self) -> super::vals::Tim1rst {
9832 let val = (self.0 >> 24usize) & 0x01;
9833 super::vals::Tim1rst(val as u8)
9834 }
9835 #[doc = "SAI3 block reset"]
9836 pub fn set_sai3rst(&mut self, val: super::vals::Tim1rst) {
9837 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
9838 }
9839 #[doc = "DFSDM1 block reset"]
9840 pub const fn dfsdm1rst(&self) -> super::vals::Tim1rst {
9841 let val = (self.0 >> 28usize) & 0x01;
9842 super::vals::Tim1rst(val as u8)
9843 }
9844 #[doc = "DFSDM1 block reset"]
9845 pub fn set_dfsdm1rst(&mut self, val: super::vals::Tim1rst) {
9846 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
9847 }
9848 #[doc = "HRTIM block reset"]
9849 pub const fn hrtimrst(&self) -> super::vals::Tim1rst {
9850 let val = (self.0 >> 29usize) & 0x01;
9851 super::vals::Tim1rst(val as u8)
9852 }
9853 #[doc = "HRTIM block reset"]
9854 pub fn set_hrtimrst(&mut self, val: super::vals::Tim1rst) {
9855 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
9856 }
9857 }
9858 impl Default for Apb2rstr {
9859 fn default() -> Apb2rstr {
9860 Apb2rstr(0)
9861 }
9862 }
9863 #[doc = "RCC APB4 Sleep Clock Register"]
9864 #[repr(transparent)]
9865 #[derive(Copy, Clone, Eq, PartialEq)]
9866 pub struct Apb4lpenr(pub u32);
9867 impl Apb4lpenr {
9868 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
9869 pub const fn syscfglpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9870 let val = (self.0 >> 1usize) & 0x01;
9871 super::vals::Apb4lpenrSyscfglpen(val as u8)
9872 }
9873 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
9874 pub fn set_syscfglpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9875 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
9876 }
9877 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
9878 pub const fn lpuart1lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9879 let val = (self.0 >> 3usize) & 0x01;
9880 super::vals::Apb4lpenrSyscfglpen(val as u8)
9881 }
9882 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
9883 pub fn set_lpuart1lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9884 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
9885 }
9886 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
9887 pub const fn spi6lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9888 let val = (self.0 >> 5usize) & 0x01;
9889 super::vals::Apb4lpenrSyscfglpen(val as u8)
9890 }
9891 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
9892 pub fn set_spi6lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9893 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
9894 }
9895 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
9896 pub const fn i2c4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9897 let val = (self.0 >> 7usize) & 0x01;
9898 super::vals::Apb4lpenrSyscfglpen(val as u8)
9899 }
9900 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
9901 pub fn set_i2c4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9902 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
9903 }
9904 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
9905 pub const fn lptim2lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9906 let val = (self.0 >> 9usize) & 0x01;
9907 super::vals::Apb4lpenrSyscfglpen(val as u8)
9908 }
9909 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
9910 pub fn set_lptim2lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9911 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
9912 }
9913 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
9914 pub const fn lptim3lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9915 let val = (self.0 >> 10usize) & 0x01;
9916 super::vals::Apb4lpenrSyscfglpen(val as u8)
9917 }
9918 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
9919 pub fn set_lptim3lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9920 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
9921 }
9922 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
9923 pub const fn lptim4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9924 let val = (self.0 >> 11usize) & 0x01;
9925 super::vals::Apb4lpenrSyscfglpen(val as u8)
9926 }
9927 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
9928 pub fn set_lptim4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9929 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
9930 }
9931 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
9932 pub const fn lptim5lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9933 let val = (self.0 >> 12usize) & 0x01;
9934 super::vals::Apb4lpenrSyscfglpen(val as u8)
9935 }
9936 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
9937 pub fn set_lptim5lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9938 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
9939 }
9940 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
9941 pub const fn comp12lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9942 let val = (self.0 >> 14usize) & 0x01;
9943 super::vals::Apb4lpenrSyscfglpen(val as u8)
9944 }
9945 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
9946 pub fn set_comp12lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9947 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
9948 }
9949 #[doc = "VREF peripheral clock enable during CSleep mode"]
9950 pub const fn vreflpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9951 let val = (self.0 >> 15usize) & 0x01;
9952 super::vals::Apb4lpenrSyscfglpen(val as u8)
9953 }
9954 #[doc = "VREF peripheral clock enable during CSleep mode"]
9955 pub fn set_vreflpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9956 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
9957 }
9958 #[doc = "RTC APB Clock Enable During CSleep Mode"]
9959 pub const fn rtcapblpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9960 let val = (self.0 >> 16usize) & 0x01;
9961 super::vals::Apb4lpenrSyscfglpen(val as u8)
9962 }
9963 #[doc = "RTC APB Clock Enable During CSleep Mode"]
9964 pub fn set_rtcapblpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9965 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
9966 }
9967 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
9968 pub const fn sai4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
9969 let val = (self.0 >> 21usize) & 0x01;
9970 super::vals::Apb4lpenrSyscfglpen(val as u8)
9971 }
9972 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
9973 pub fn set_sai4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
9974 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
9975 }
9976 }
9977 impl Default for Apb4lpenr {
9978 fn default() -> Apb4lpenr {
9979 Apb4lpenr(0)
9980 }
9981 }
9982 #[doc = "RCC APB3 Clock Register"]
9983 #[repr(transparent)]
9984 #[derive(Copy, Clone, Eq, PartialEq)]
9985 pub struct C1Apb3enr(pub u32);
9986 impl C1Apb3enr {
9987 #[doc = "LTDC peripheral clock enable"]
9988 pub const fn ltdcen(&self) -> super::vals::C1Apb3enrLtdcen {
9989 let val = (self.0 >> 3usize) & 0x01;
9990 super::vals::C1Apb3enrLtdcen(val as u8)
9991 }
9992 #[doc = "LTDC peripheral clock enable"]
9993 pub fn set_ltdcen(&mut self, val: super::vals::C1Apb3enrLtdcen) {
9994 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
9995 }
9996 #[doc = "WWDG1 Clock Enable"]
9997 pub const fn wwdg1en(&self) -> super::vals::C1Apb3enrLtdcen {
9998 let val = (self.0 >> 6usize) & 0x01;
9999 super::vals::C1Apb3enrLtdcen(val as u8)
10000 }
10001 #[doc = "WWDG1 Clock Enable"]
10002 pub fn set_wwdg1en(&mut self, val: super::vals::C1Apb3enrLtdcen) {
10003 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
10004 }
10005 }
10006 impl Default for C1Apb3enr {
10007 fn default() -> C1Apb3enr {
10008 C1Apb3enr(0)
10009 }
10010 }
10011 #[doc = "RCC APB1 Clock Register"]
10012 #[repr(transparent)] 7393 #[repr(transparent)]
10013 #[derive(Copy, Clone, Eq, PartialEq)] 7394 #[derive(Copy, Clone, Eq, PartialEq)]
10014 pub struct Apb1henr(pub u32); 7395 pub struct Apb1hrstr(pub u32);
10015 impl Apb1henr { 7396 impl Apb1hrstr {
10016 #[doc = "Clock Recovery System peripheral clock enable"] 7397 #[doc = "Clock Recovery System reset"]
10017 pub const fn crsen(&self) -> super::vals::Apb1henrCrsen { 7398 pub const fn crsrst(&self) -> super::vals::Crsrst {
10018 let val = (self.0 >> 1usize) & 0x01; 7399 let val = (self.0 >> 1usize) & 0x01;
10019 super::vals::Apb1henrCrsen(val as u8) 7400 super::vals::Crsrst(val as u8)
10020 } 7401 }
10021 #[doc = "Clock Recovery System peripheral clock enable"] 7402 #[doc = "Clock Recovery System reset"]
10022 pub fn set_crsen(&mut self, val: super::vals::Apb1henrCrsen) { 7403 pub fn set_crsrst(&mut self, val: super::vals::Crsrst) {
10023 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 7404 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10024 } 7405 }
10025 #[doc = "SWPMI Peripheral Clocks Enable"] 7406 #[doc = "SWPMI block reset"]
10026 pub const fn swpen(&self) -> super::vals::Apb1henrCrsen { 7407 pub const fn swprst(&self) -> super::vals::Crsrst {
10027 let val = (self.0 >> 2usize) & 0x01; 7408 let val = (self.0 >> 2usize) & 0x01;
10028 super::vals::Apb1henrCrsen(val as u8) 7409 super::vals::Crsrst(val as u8)
10029 } 7410 }
10030 #[doc = "SWPMI Peripheral Clocks Enable"] 7411 #[doc = "SWPMI block reset"]
10031 pub fn set_swpen(&mut self, val: super::vals::Apb1henrCrsen) { 7412 pub fn set_swprst(&mut self, val: super::vals::Crsrst) {
10032 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 7413 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
10033 } 7414 }
10034 #[doc = "OPAMP peripheral clock enable"] 7415 #[doc = "OPAMP block reset"]
10035 pub const fn opampen(&self) -> super::vals::Apb1henrCrsen { 7416 pub const fn opamprst(&self) -> super::vals::Crsrst {
10036 let val = (self.0 >> 4usize) & 0x01; 7417 let val = (self.0 >> 4usize) & 0x01;
10037 super::vals::Apb1henrCrsen(val as u8) 7418 super::vals::Crsrst(val as u8)
10038 } 7419 }
10039 #[doc = "OPAMP peripheral clock enable"] 7420 #[doc = "OPAMP block reset"]
10040 pub fn set_opampen(&mut self, val: super::vals::Apb1henrCrsen) { 7421 pub fn set_opamprst(&mut self, val: super::vals::Crsrst) {
10041 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 7422 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
10042 } 7423 }
10043 #[doc = "MDIOS peripheral clock enable"] 7424 #[doc = "MDIOS block reset"]
10044 pub const fn mdiosen(&self) -> super::vals::Apb1henrCrsen { 7425 pub const fn mdiosrst(&self) -> super::vals::Crsrst {
10045 let val = (self.0 >> 5usize) & 0x01; 7426 let val = (self.0 >> 5usize) & 0x01;
10046 super::vals::Apb1henrCrsen(val as u8) 7427 super::vals::Crsrst(val as u8)
10047 } 7428 }
10048 #[doc = "MDIOS peripheral clock enable"] 7429 #[doc = "MDIOS block reset"]
10049 pub fn set_mdiosen(&mut self, val: super::vals::Apb1henrCrsen) { 7430 pub fn set_mdiosrst(&mut self, val: super::vals::Crsrst) {
10050 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 7431 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10051 } 7432 }
10052 #[doc = "FDCAN Peripheral Clocks Enable"] 7433 #[doc = "FDCAN block reset"]
10053 pub const fn fdcanen(&self) -> super::vals::Apb1henrCrsen { 7434 pub const fn fdcanrst(&self) -> super::vals::Crsrst {
10054 let val = (self.0 >> 8usize) & 0x01; 7435 let val = (self.0 >> 8usize) & 0x01;
10055 super::vals::Apb1henrCrsen(val as u8) 7436 super::vals::Crsrst(val as u8)
10056 } 7437 }
10057 #[doc = "FDCAN Peripheral Clocks Enable"] 7438 #[doc = "FDCAN block reset"]
10058 pub fn set_fdcanen(&mut self, val: super::vals::Apb1henrCrsen) { 7439 pub fn set_fdcanrst(&mut self, val: super::vals::Crsrst) {
10059 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 7440 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
10060 } 7441 }
10061 } 7442 }
10062 impl Default for Apb1henr { 7443 impl Default for Apb1hrstr {
10063 fn default() -> Apb1henr { 7444 fn default() -> Apb1hrstr {
10064 Apb1henr(0) 7445 Apb1hrstr(0)
10065 }
10066 }
10067 #[doc = "RCC AHB2 Sleep Clock Register"]
10068 #[repr(transparent)]
10069 #[derive(Copy, Clone, Eq, PartialEq)]
10070 pub struct C1Ahb2lpenr(pub u32);
10071 impl C1Ahb2lpenr {
10072 #[doc = "DCMI peripheral clock enable during csleep mode"]
10073 pub const fn dcmilpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10074 let val = (self.0 >> 0usize) & 0x01;
10075 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10076 }
10077 #[doc = "DCMI peripheral clock enable during csleep mode"]
10078 pub fn set_dcmilpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10079 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10080 }
10081 #[doc = "CRYPT peripheral clock enable during CSleep mode"]
10082 pub const fn cryptlpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10083 let val = (self.0 >> 4usize) & 0x01;
10084 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10085 }
10086 #[doc = "CRYPT peripheral clock enable during CSleep mode"]
10087 pub fn set_cryptlpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10088 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
10089 }
10090 #[doc = "HASH peripheral clock enable during CSleep mode"]
10091 pub const fn hashlpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10092 let val = (self.0 >> 5usize) & 0x01;
10093 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10094 }
10095 #[doc = "HASH peripheral clock enable during CSleep mode"]
10096 pub fn set_hashlpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10097 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10098 }
10099 #[doc = "RNG peripheral clock enable during CSleep mode"]
10100 pub const fn rnglpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10101 let val = (self.0 >> 6usize) & 0x01;
10102 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10103 }
10104 #[doc = "RNG peripheral clock enable during CSleep mode"]
10105 pub fn set_rnglpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10106 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
10107 }
10108 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"]
10109 pub const fn sdmmc2lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10110 let val = (self.0 >> 9usize) & 0x01;
10111 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10112 }
10113 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"]
10114 pub fn set_sdmmc2lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10115 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
10116 }
10117 #[doc = "SRAM1 Clock Enable During CSleep Mode"]
10118 pub const fn sram1lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10119 let val = (self.0 >> 29usize) & 0x01;
10120 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10121 }
10122 #[doc = "SRAM1 Clock Enable During CSleep Mode"]
10123 pub fn set_sram1lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10124 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
10125 }
10126 #[doc = "SRAM2 Clock Enable During CSleep Mode"]
10127 pub const fn sram2lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10128 let val = (self.0 >> 30usize) & 0x01;
10129 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10130 }
10131 #[doc = "SRAM2 Clock Enable During CSleep Mode"]
10132 pub fn set_sram2lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10133 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
10134 }
10135 #[doc = "SRAM3 Clock Enable During CSleep Mode"]
10136 pub const fn sram3lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
10137 let val = (self.0 >> 31usize) & 0x01;
10138 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
10139 }
10140 #[doc = "SRAM3 Clock Enable During CSleep Mode"]
10141 pub fn set_sram3lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
10142 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
10143 }
10144 }
10145 impl Default for C1Ahb2lpenr {
10146 fn default() -> C1Ahb2lpenr {
10147 C1Ahb2lpenr(0)
10148 } 7446 }
10149 } 7447 }
10150 #[doc = "RCC Clock Source Interrupt Enable Register"] 7448 #[doc = "RCC Clock Source Interrupt Enable Register"]
@@ -10234,306 +7532,6 @@ pub mod rcc_h7 {
10234 Cier(0) 7532 Cier(0)
10235 } 7533 }
10236 } 7534 }
10237 #[doc = "RCC Domain 2 Kernel Clock Configuration Register"]
10238 #[repr(transparent)]
10239 #[derive(Copy, Clone, Eq, PartialEq)]
10240 pub struct D2ccip1r(pub u32);
10241 impl D2ccip1r {
10242 #[doc = "SAI1 and DFSDM1 kernel Aclk clock source selection"]
10243 pub const fn sai1sel(&self) -> super::vals::Sai1sel {
10244 let val = (self.0 >> 0usize) & 0x07;
10245 super::vals::Sai1sel(val as u8)
10246 }
10247 #[doc = "SAI1 and DFSDM1 kernel Aclk clock source selection"]
10248 pub fn set_sai1sel(&mut self, val: super::vals::Sai1sel) {
10249 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
10250 }
10251 #[doc = "SAI2 and SAI3 kernel clock source selection"]
10252 pub const fn sai23sel(&self) -> super::vals::Sai1sel {
10253 let val = (self.0 >> 6usize) & 0x07;
10254 super::vals::Sai1sel(val as u8)
10255 }
10256 #[doc = "SAI2 and SAI3 kernel clock source selection"]
10257 pub fn set_sai23sel(&mut self, val: super::vals::Sai1sel) {
10258 self.0 = (self.0 & !(0x07 << 6usize)) | (((val.0 as u32) & 0x07) << 6usize);
10259 }
10260 #[doc = "SPI/I2S1,2 and 3 kernel clock source selection"]
10261 pub const fn spi123sel(&self) -> super::vals::Sai1sel {
10262 let val = (self.0 >> 12usize) & 0x07;
10263 super::vals::Sai1sel(val as u8)
10264 }
10265 #[doc = "SPI/I2S1,2 and 3 kernel clock source selection"]
10266 pub fn set_spi123sel(&mut self, val: super::vals::Sai1sel) {
10267 self.0 = (self.0 & !(0x07 << 12usize)) | (((val.0 as u32) & 0x07) << 12usize);
10268 }
10269 #[doc = "SPI4 and 5 kernel clock source selection"]
10270 pub const fn spi45sel(&self) -> super::vals::Spi45sel {
10271 let val = (self.0 >> 16usize) & 0x07;
10272 super::vals::Spi45sel(val as u8)
10273 }
10274 #[doc = "SPI4 and 5 kernel clock source selection"]
10275 pub fn set_spi45sel(&mut self, val: super::vals::Spi45sel) {
10276 self.0 = (self.0 & !(0x07 << 16usize)) | (((val.0 as u32) & 0x07) << 16usize);
10277 }
10278 #[doc = "SPDIFRX kernel clock source selection"]
10279 pub const fn spdifsel(&self) -> super::vals::Spdifsel {
10280 let val = (self.0 >> 20usize) & 0x03;
10281 super::vals::Spdifsel(val as u8)
10282 }
10283 #[doc = "SPDIFRX kernel clock source selection"]
10284 pub fn set_spdifsel(&mut self, val: super::vals::Spdifsel) {
10285 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
10286 }
10287 #[doc = "DFSDM1 kernel Clk clock source selection"]
10288 pub const fn dfsdm1sel(&self) -> super::vals::Dfsdm1sel {
10289 let val = (self.0 >> 24usize) & 0x01;
10290 super::vals::Dfsdm1sel(val as u8)
10291 }
10292 #[doc = "DFSDM1 kernel Clk clock source selection"]
10293 pub fn set_dfsdm1sel(&mut self, val: super::vals::Dfsdm1sel) {
10294 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
10295 }
10296 #[doc = "FDCAN kernel clock source selection"]
10297 pub const fn fdcansel(&self) -> super::vals::Fdcansel {
10298 let val = (self.0 >> 28usize) & 0x03;
10299 super::vals::Fdcansel(val as u8)
10300 }
10301 #[doc = "FDCAN kernel clock source selection"]
10302 pub fn set_fdcansel(&mut self, val: super::vals::Fdcansel) {
10303 self.0 = (self.0 & !(0x03 << 28usize)) | (((val.0 as u32) & 0x03) << 28usize);
10304 }
10305 #[doc = "SWPMI kernel clock source selection"]
10306 pub const fn swpsel(&self) -> super::vals::Swpsel {
10307 let val = (self.0 >> 31usize) & 0x01;
10308 super::vals::Swpsel(val as u8)
10309 }
10310 #[doc = "SWPMI kernel clock source selection"]
10311 pub fn set_swpsel(&mut self, val: super::vals::Swpsel) {
10312 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
10313 }
10314 }
10315 impl Default for D2ccip1r {
10316 fn default() -> D2ccip1r {
10317 D2ccip1r(0)
10318 }
10319 }
10320 #[doc = "RCC APB4 Sleep Clock Register"]
10321 #[repr(transparent)]
10322 #[derive(Copy, Clone, Eq, PartialEq)]
10323 pub struct C1Apb4lpenr(pub u32);
10324 impl C1Apb4lpenr {
10325 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
10326 pub const fn syscfglpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10327 let val = (self.0 >> 1usize) & 0x01;
10328 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10329 }
10330 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
10331 pub fn set_syscfglpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10332 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10333 }
10334 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
10335 pub const fn lpuart1lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10336 let val = (self.0 >> 3usize) & 0x01;
10337 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10338 }
10339 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
10340 pub fn set_lpuart1lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10341 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
10342 }
10343 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
10344 pub const fn spi6lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10345 let val = (self.0 >> 5usize) & 0x01;
10346 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10347 }
10348 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
10349 pub fn set_spi6lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10350 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10351 }
10352 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
10353 pub const fn i2c4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10354 let val = (self.0 >> 7usize) & 0x01;
10355 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10356 }
10357 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
10358 pub fn set_i2c4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10359 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
10360 }
10361 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
10362 pub const fn lptim2lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10363 let val = (self.0 >> 9usize) & 0x01;
10364 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10365 }
10366 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
10367 pub fn set_lptim2lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10368 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
10369 }
10370 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
10371 pub const fn lptim3lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10372 let val = (self.0 >> 10usize) & 0x01;
10373 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10374 }
10375 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
10376 pub fn set_lptim3lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10377 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
10378 }
10379 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
10380 pub const fn lptim4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10381 let val = (self.0 >> 11usize) & 0x01;
10382 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10383 }
10384 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
10385 pub fn set_lptim4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10386 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
10387 }
10388 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
10389 pub const fn lptim5lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10390 let val = (self.0 >> 12usize) & 0x01;
10391 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10392 }
10393 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
10394 pub fn set_lptim5lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10395 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
10396 }
10397 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
10398 pub const fn comp12lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10399 let val = (self.0 >> 14usize) & 0x01;
10400 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10401 }
10402 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
10403 pub fn set_comp12lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10404 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
10405 }
10406 #[doc = "VREF peripheral clock enable during CSleep mode"]
10407 pub const fn vreflpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10408 let val = (self.0 >> 15usize) & 0x01;
10409 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10410 }
10411 #[doc = "VREF peripheral clock enable during CSleep mode"]
10412 pub fn set_vreflpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10413 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
10414 }
10415 #[doc = "RTC APB Clock Enable During CSleep Mode"]
10416 pub const fn rtcapblpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10417 let val = (self.0 >> 16usize) & 0x01;
10418 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10419 }
10420 #[doc = "RTC APB Clock Enable During CSleep Mode"]
10421 pub fn set_rtcapblpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10422 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
10423 }
10424 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
10425 pub const fn sai4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
10426 let val = (self.0 >> 21usize) & 0x01;
10427 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
10428 }
10429 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
10430 pub fn set_sai4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
10431 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
10432 }
10433 }
10434 impl Default for C1Apb4lpenr {
10435 fn default() -> C1Apb4lpenr {
10436 C1Apb4lpenr(0)
10437 }
10438 }
10439 #[doc = "RCC AHB1 Peripheral Reset Register"]
10440 #[repr(transparent)]
10441 #[derive(Copy, Clone, Eq, PartialEq)]
10442 pub struct Ahb1rstr(pub u32);
10443 impl Ahb1rstr {
10444 #[doc = "DMA1 block reset"]
10445 pub const fn dma1rst(&self) -> super::vals::Dma1rst {
10446 let val = (self.0 >> 0usize) & 0x01;
10447 super::vals::Dma1rst(val as u8)
10448 }
10449 #[doc = "DMA1 block reset"]
10450 pub fn set_dma1rst(&mut self, val: super::vals::Dma1rst) {
10451 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10452 }
10453 #[doc = "DMA2 block reset"]
10454 pub const fn dma2rst(&self) -> super::vals::Dma1rst {
10455 let val = (self.0 >> 1usize) & 0x01;
10456 super::vals::Dma1rst(val as u8)
10457 }
10458 #[doc = "DMA2 block reset"]
10459 pub fn set_dma2rst(&mut self, val: super::vals::Dma1rst) {
10460 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10461 }
10462 #[doc = "ADC1&2 block reset"]
10463 pub const fn adc12rst(&self) -> super::vals::Dma1rst {
10464 let val = (self.0 >> 5usize) & 0x01;
10465 super::vals::Dma1rst(val as u8)
10466 }
10467 #[doc = "ADC1&2 block reset"]
10468 pub fn set_adc12rst(&mut self, val: super::vals::Dma1rst) {
10469 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10470 }
10471 #[doc = "ETH1MAC block reset"]
10472 pub const fn eth1macrst(&self) -> super::vals::Dma1rst {
10473 let val = (self.0 >> 15usize) & 0x01;
10474 super::vals::Dma1rst(val as u8)
10475 }
10476 #[doc = "ETH1MAC block reset"]
10477 pub fn set_eth1macrst(&mut self, val: super::vals::Dma1rst) {
10478 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
10479 }
10480 #[doc = "USB1OTG block reset"]
10481 pub const fn usb1otgrst(&self) -> super::vals::Dma1rst {
10482 let val = (self.0 >> 25usize) & 0x01;
10483 super::vals::Dma1rst(val as u8)
10484 }
10485 #[doc = "USB1OTG block reset"]
10486 pub fn set_usb1otgrst(&mut self, val: super::vals::Dma1rst) {
10487 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
10488 }
10489 #[doc = "USB2OTG block reset"]
10490 pub const fn usb2otgrst(&self) -> super::vals::Dma1rst {
10491 let val = (self.0 >> 27usize) & 0x01;
10492 super::vals::Dma1rst(val as u8)
10493 }
10494 #[doc = "USB2OTG block reset"]
10495 pub fn set_usb2otgrst(&mut self, val: super::vals::Dma1rst) {
10496 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
10497 }
10498 }
10499 impl Default for Ahb1rstr {
10500 fn default() -> Ahb1rstr {
10501 Ahb1rstr(0)
10502 }
10503 }
10504 #[doc = "RCC PLLs Clock Source Selection Register"]
10505 #[repr(transparent)]
10506 #[derive(Copy, Clone, Eq, PartialEq)]
10507 pub struct Pllckselr(pub u32);
10508 impl Pllckselr {
10509 #[doc = "DIVMx and PLLs clock source selection"]
10510 pub const fn pllsrc(&self) -> super::vals::Pllsrc {
10511 let val = (self.0 >> 0usize) & 0x03;
10512 super::vals::Pllsrc(val as u8)
10513 }
10514 #[doc = "DIVMx and PLLs clock source selection"]
10515 pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) {
10516 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
10517 }
10518 #[doc = "Prescaler for PLL1"]
10519 pub fn divm(&self, n: usize) -> u8 {
10520 assert!(n < 3usize);
10521 let offs = 4usize + n * 8usize;
10522 let val = (self.0 >> offs) & 0x3f;
10523 val as u8
10524 }
10525 #[doc = "Prescaler for PLL1"]
10526 pub fn set_divm(&mut self, n: usize, val: u8) {
10527 assert!(n < 3usize);
10528 let offs = 4usize + n * 8usize;
10529 self.0 = (self.0 & !(0x3f << offs)) | (((val as u32) & 0x3f) << offs);
10530 }
10531 }
10532 impl Default for Pllckselr {
10533 fn default() -> Pllckselr {
10534 Pllckselr(0)
10535 }
10536 }
10537 #[doc = "RCC AHB4 Peripheral Reset Register"] 7535 #[doc = "RCC AHB4 Peripheral Reset Register"]
10538 #[repr(transparent)] 7536 #[repr(transparent)]
10539 #[derive(Copy, Clone, Eq, PartialEq)] 7537 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -10680,1029 +7678,6 @@ pub mod rcc_h7 {
10680 Ahb4rstr(0) 7678 Ahb4rstr(0)
10681 } 7679 }
10682 } 7680 }
10683 #[doc = "RCC Global Control Register"]
10684 #[repr(transparent)]
10685 #[derive(Copy, Clone, Eq, PartialEq)]
10686 pub struct Gcr(pub u32);
10687 impl Gcr {
10688 #[doc = "WWDG1 reset scope control"]
10689 pub const fn ww1rsc(&self) -> super::vals::Ww1rsc {
10690 let val = (self.0 >> 0usize) & 0x01;
10691 super::vals::Ww1rsc(val as u8)
10692 }
10693 #[doc = "WWDG1 reset scope control"]
10694 pub fn set_ww1rsc(&mut self, val: super::vals::Ww1rsc) {
10695 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10696 }
10697 }
10698 impl Default for Gcr {
10699 fn default() -> Gcr {
10700 Gcr(0)
10701 }
10702 }
10703 #[doc = "RCC AHB3 Clock Register"]
10704 #[repr(transparent)]
10705 #[derive(Copy, Clone, Eq, PartialEq)]
10706 pub struct Ahb3enr(pub u32);
10707 impl Ahb3enr {
10708 #[doc = "MDMA Peripheral Clock Enable"]
10709 pub const fn mdmaen(&self) -> super::vals::Ahb3enrMdmaen {
10710 let val = (self.0 >> 0usize) & 0x01;
10711 super::vals::Ahb3enrMdmaen(val as u8)
10712 }
10713 #[doc = "MDMA Peripheral Clock Enable"]
10714 pub fn set_mdmaen(&mut self, val: super::vals::Ahb3enrMdmaen) {
10715 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10716 }
10717 #[doc = "DMA2D Peripheral Clock Enable"]
10718 pub const fn dma2den(&self) -> super::vals::Ahb3enrMdmaen {
10719 let val = (self.0 >> 4usize) & 0x01;
10720 super::vals::Ahb3enrMdmaen(val as u8)
10721 }
10722 #[doc = "DMA2D Peripheral Clock Enable"]
10723 pub fn set_dma2den(&mut self, val: super::vals::Ahb3enrMdmaen) {
10724 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
10725 }
10726 #[doc = "JPGDEC Peripheral Clock Enable"]
10727 pub const fn jpgdecen(&self) -> super::vals::Ahb3enrMdmaen {
10728 let val = (self.0 >> 5usize) & 0x01;
10729 super::vals::Ahb3enrMdmaen(val as u8)
10730 }
10731 #[doc = "JPGDEC Peripheral Clock Enable"]
10732 pub fn set_jpgdecen(&mut self, val: super::vals::Ahb3enrMdmaen) {
10733 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10734 }
10735 #[doc = "FMC Peripheral Clocks Enable"]
10736 pub const fn fmcen(&self) -> super::vals::Ahb3enrMdmaen {
10737 let val = (self.0 >> 12usize) & 0x01;
10738 super::vals::Ahb3enrMdmaen(val as u8)
10739 }
10740 #[doc = "FMC Peripheral Clocks Enable"]
10741 pub fn set_fmcen(&mut self, val: super::vals::Ahb3enrMdmaen) {
10742 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
10743 }
10744 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"]
10745 pub const fn qspien(&self) -> super::vals::Ahb3enrMdmaen {
10746 let val = (self.0 >> 14usize) & 0x01;
10747 super::vals::Ahb3enrMdmaen(val as u8)
10748 }
10749 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"]
10750 pub fn set_qspien(&mut self, val: super::vals::Ahb3enrMdmaen) {
10751 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
10752 }
10753 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"]
10754 pub const fn sdmmc1en(&self) -> super::vals::Ahb3enrMdmaen {
10755 let val = (self.0 >> 16usize) & 0x01;
10756 super::vals::Ahb3enrMdmaen(val as u8)
10757 }
10758 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"]
10759 pub fn set_sdmmc1en(&mut self, val: super::vals::Ahb3enrMdmaen) {
10760 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
10761 }
10762 }
10763 impl Default for Ahb3enr {
10764 fn default() -> Ahb3enr {
10765 Ahb3enr(0)
10766 }
10767 }
10768 #[doc = "RCC PLL2 Dividers Configuration Register"]
10769 #[repr(transparent)]
10770 #[derive(Copy, Clone, Eq, PartialEq)]
10771 pub struct Pll2divr(pub u32);
10772 impl Pll2divr {
10773 #[doc = "Multiplication factor for PLL1 VCO"]
10774 pub const fn divn2(&self) -> u16 {
10775 let val = (self.0 >> 0usize) & 0x01ff;
10776 val as u16
10777 }
10778 #[doc = "Multiplication factor for PLL1 VCO"]
10779 pub fn set_divn2(&mut self, val: u16) {
10780 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
10781 }
10782 #[doc = "PLL1 DIVP division factor"]
10783 pub const fn divp2(&self) -> u8 {
10784 let val = (self.0 >> 9usize) & 0x7f;
10785 val as u8
10786 }
10787 #[doc = "PLL1 DIVP division factor"]
10788 pub fn set_divp2(&mut self, val: u8) {
10789 self.0 = (self.0 & !(0x7f << 9usize)) | (((val as u32) & 0x7f) << 9usize);
10790 }
10791 #[doc = "PLL1 DIVQ division factor"]
10792 pub const fn divq2(&self) -> u8 {
10793 let val = (self.0 >> 16usize) & 0x7f;
10794 val as u8
10795 }
10796 #[doc = "PLL1 DIVQ division factor"]
10797 pub fn set_divq2(&mut self, val: u8) {
10798 self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
10799 }
10800 #[doc = "PLL1 DIVR division factor"]
10801 pub const fn divr2(&self) -> u8 {
10802 let val = (self.0 >> 24usize) & 0x7f;
10803 val as u8
10804 }
10805 #[doc = "PLL1 DIVR division factor"]
10806 pub fn set_divr2(&mut self, val: u8) {
10807 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
10808 }
10809 }
10810 impl Default for Pll2divr {
10811 fn default() -> Pll2divr {
10812 Pll2divr(0)
10813 }
10814 }
10815 #[doc = "RCC APB4 Clock Register"]
10816 #[repr(transparent)]
10817 #[derive(Copy, Clone, Eq, PartialEq)]
10818 pub struct C1Apb4enr(pub u32);
10819 impl C1Apb4enr {
10820 #[doc = "SYSCFG peripheral clock enable"]
10821 pub const fn syscfgen(&self) -> super::vals::C1Apb4enrSyscfgen {
10822 let val = (self.0 >> 1usize) & 0x01;
10823 super::vals::C1Apb4enrSyscfgen(val as u8)
10824 }
10825 #[doc = "SYSCFG peripheral clock enable"]
10826 pub fn set_syscfgen(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10827 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10828 }
10829 #[doc = "LPUART1 Peripheral Clocks Enable"]
10830 pub const fn lpuart1en(&self) -> super::vals::C1Apb4enrSyscfgen {
10831 let val = (self.0 >> 3usize) & 0x01;
10832 super::vals::C1Apb4enrSyscfgen(val as u8)
10833 }
10834 #[doc = "LPUART1 Peripheral Clocks Enable"]
10835 pub fn set_lpuart1en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10836 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
10837 }
10838 #[doc = "SPI6 Peripheral Clocks Enable"]
10839 pub const fn spi6en(&self) -> super::vals::C1Apb4enrSyscfgen {
10840 let val = (self.0 >> 5usize) & 0x01;
10841 super::vals::C1Apb4enrSyscfgen(val as u8)
10842 }
10843 #[doc = "SPI6 Peripheral Clocks Enable"]
10844 pub fn set_spi6en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10845 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10846 }
10847 #[doc = "I2C4 Peripheral Clocks Enable"]
10848 pub const fn i2c4en(&self) -> super::vals::C1Apb4enrSyscfgen {
10849 let val = (self.0 >> 7usize) & 0x01;
10850 super::vals::C1Apb4enrSyscfgen(val as u8)
10851 }
10852 #[doc = "I2C4 Peripheral Clocks Enable"]
10853 pub fn set_i2c4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10854 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
10855 }
10856 #[doc = "LPTIM2 Peripheral Clocks Enable"]
10857 pub const fn lptim2en(&self) -> super::vals::C1Apb4enrSyscfgen {
10858 let val = (self.0 >> 9usize) & 0x01;
10859 super::vals::C1Apb4enrSyscfgen(val as u8)
10860 }
10861 #[doc = "LPTIM2 Peripheral Clocks Enable"]
10862 pub fn set_lptim2en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10863 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
10864 }
10865 #[doc = "LPTIM3 Peripheral Clocks Enable"]
10866 pub const fn lptim3en(&self) -> super::vals::C1Apb4enrSyscfgen {
10867 let val = (self.0 >> 10usize) & 0x01;
10868 super::vals::C1Apb4enrSyscfgen(val as u8)
10869 }
10870 #[doc = "LPTIM3 Peripheral Clocks Enable"]
10871 pub fn set_lptim3en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10872 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
10873 }
10874 #[doc = "LPTIM4 Peripheral Clocks Enable"]
10875 pub const fn lptim4en(&self) -> super::vals::C1Apb4enrSyscfgen {
10876 let val = (self.0 >> 11usize) & 0x01;
10877 super::vals::C1Apb4enrSyscfgen(val as u8)
10878 }
10879 #[doc = "LPTIM4 Peripheral Clocks Enable"]
10880 pub fn set_lptim4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10881 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
10882 }
10883 #[doc = "LPTIM5 Peripheral Clocks Enable"]
10884 pub const fn lptim5en(&self) -> super::vals::C1Apb4enrSyscfgen {
10885 let val = (self.0 >> 12usize) & 0x01;
10886 super::vals::C1Apb4enrSyscfgen(val as u8)
10887 }
10888 #[doc = "LPTIM5 Peripheral Clocks Enable"]
10889 pub fn set_lptim5en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10890 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
10891 }
10892 #[doc = "COMP1/2 peripheral clock enable"]
10893 pub const fn comp12en(&self) -> super::vals::C1Apb4enrSyscfgen {
10894 let val = (self.0 >> 14usize) & 0x01;
10895 super::vals::C1Apb4enrSyscfgen(val as u8)
10896 }
10897 #[doc = "COMP1/2 peripheral clock enable"]
10898 pub fn set_comp12en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10899 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
10900 }
10901 #[doc = "VREF peripheral clock enable"]
10902 pub const fn vrefen(&self) -> super::vals::C1Apb4enrSyscfgen {
10903 let val = (self.0 >> 15usize) & 0x01;
10904 super::vals::C1Apb4enrSyscfgen(val as u8)
10905 }
10906 #[doc = "VREF peripheral clock enable"]
10907 pub fn set_vrefen(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10908 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
10909 }
10910 #[doc = "RTC APB Clock Enable"]
10911 pub const fn rtcapben(&self) -> super::vals::C1Apb4enrSyscfgen {
10912 let val = (self.0 >> 16usize) & 0x01;
10913 super::vals::C1Apb4enrSyscfgen(val as u8)
10914 }
10915 #[doc = "RTC APB Clock Enable"]
10916 pub fn set_rtcapben(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10917 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
10918 }
10919 #[doc = "SAI4 Peripheral Clocks Enable"]
10920 pub const fn sai4en(&self) -> super::vals::C1Apb4enrSyscfgen {
10921 let val = (self.0 >> 21usize) & 0x01;
10922 super::vals::C1Apb4enrSyscfgen(val as u8)
10923 }
10924 #[doc = "SAI4 Peripheral Clocks Enable"]
10925 pub fn set_sai4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
10926 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
10927 }
10928 }
10929 impl Default for C1Apb4enr {
10930 fn default() -> C1Apb4enr {
10931 C1Apb4enr(0)
10932 }
10933 }
10934 #[doc = "RCC APB3 Sleep Clock Register"]
10935 #[repr(transparent)]
10936 #[derive(Copy, Clone, Eq, PartialEq)]
10937 pub struct C1Apb3lpenr(pub u32);
10938 impl C1Apb3lpenr {
10939 #[doc = "LTDC peripheral clock enable during CSleep mode"]
10940 pub const fn ltdclpen(&self) -> super::vals::C1Apb3lpenrLtdclpen {
10941 let val = (self.0 >> 3usize) & 0x01;
10942 super::vals::C1Apb3lpenrLtdclpen(val as u8)
10943 }
10944 #[doc = "LTDC peripheral clock enable during CSleep mode"]
10945 pub fn set_ltdclpen(&mut self, val: super::vals::C1Apb3lpenrLtdclpen) {
10946 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
10947 }
10948 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
10949 pub const fn wwdg1lpen(&self) -> super::vals::C1Apb3lpenrLtdclpen {
10950 let val = (self.0 >> 6usize) & 0x01;
10951 super::vals::C1Apb3lpenrLtdclpen(val as u8)
10952 }
10953 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
10954 pub fn set_wwdg1lpen(&mut self, val: super::vals::C1Apb3lpenrLtdclpen) {
10955 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
10956 }
10957 }
10958 impl Default for C1Apb3lpenr {
10959 fn default() -> C1Apb3lpenr {
10960 C1Apb3lpenr(0)
10961 }
10962 }
10963 #[doc = "RCC AHB3 Sleep Clock Register"]
10964 #[repr(transparent)]
10965 #[derive(Copy, Clone, Eq, PartialEq)]
10966 pub struct C1Ahb3lpenr(pub u32);
10967 impl C1Ahb3lpenr {
10968 #[doc = "MDMA Clock Enable During CSleep Mode"]
10969 pub const fn mdmalpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
10970 let val = (self.0 >> 0usize) & 0x01;
10971 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
10972 }
10973 #[doc = "MDMA Clock Enable During CSleep Mode"]
10974 pub fn set_mdmalpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
10975 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10976 }
10977 #[doc = "DMA2D Clock Enable During CSleep Mode"]
10978 pub const fn dma2dlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
10979 let val = (self.0 >> 4usize) & 0x01;
10980 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
10981 }
10982 #[doc = "DMA2D Clock Enable During CSleep Mode"]
10983 pub fn set_dma2dlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
10984 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
10985 }
10986 #[doc = "JPGDEC Clock Enable During CSleep Mode"]
10987 pub const fn jpgdeclpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
10988 let val = (self.0 >> 5usize) & 0x01;
10989 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
10990 }
10991 #[doc = "JPGDEC Clock Enable During CSleep Mode"]
10992 pub fn set_jpgdeclpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
10993 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10994 }
10995 #[doc = "Flash interface clock enable during csleep mode"]
10996 pub const fn flashpren(&self) -> bool {
10997 let val = (self.0 >> 8usize) & 0x01;
10998 val != 0
10999 }
11000 #[doc = "Flash interface clock enable during csleep mode"]
11001 pub fn set_flashpren(&mut self, val: bool) {
11002 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
11003 }
11004 #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"]
11005 pub const fn fmclpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11006 let val = (self.0 >> 12usize) & 0x01;
11007 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11008 }
11009 #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"]
11010 pub fn set_fmclpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11011 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
11012 }
11013 #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"]
11014 pub const fn qspilpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11015 let val = (self.0 >> 14usize) & 0x01;
11016 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11017 }
11018 #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"]
11019 pub fn set_qspilpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11020 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
11021 }
11022 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"]
11023 pub const fn sdmmc1lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11024 let val = (self.0 >> 16usize) & 0x01;
11025 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11026 }
11027 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"]
11028 pub fn set_sdmmc1lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11029 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
11030 }
11031 #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"]
11032 pub const fn d1dtcm1lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11033 let val = (self.0 >> 28usize) & 0x01;
11034 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11035 }
11036 #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"]
11037 pub fn set_d1dtcm1lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11038 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
11039 }
11040 #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"]
11041 pub const fn dtcm2lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11042 let val = (self.0 >> 29usize) & 0x01;
11043 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11044 }
11045 #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"]
11046 pub fn set_dtcm2lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11047 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
11048 }
11049 #[doc = "D1ITCM Block Clock Enable During CSleep mode"]
11050 pub const fn itcmlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11051 let val = (self.0 >> 30usize) & 0x01;
11052 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11053 }
11054 #[doc = "D1ITCM Block Clock Enable During CSleep mode"]
11055 pub fn set_itcmlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11056 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
11057 }
11058 #[doc = "AXISRAM Block Clock Enable During CSleep mode"]
11059 pub const fn axisramlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
11060 let val = (self.0 >> 31usize) & 0x01;
11061 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
11062 }
11063 #[doc = "AXISRAM Block Clock Enable During CSleep mode"]
11064 pub fn set_axisramlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
11065 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
11066 }
11067 }
11068 impl Default for C1Ahb3lpenr {
11069 fn default() -> C1Ahb3lpenr {
11070 C1Ahb3lpenr(0)
11071 }
11072 }
11073 #[doc = "RCC Clock Configuration Register"]
11074 #[repr(transparent)]
11075 #[derive(Copy, Clone, Eq, PartialEq)]
11076 pub struct Cfgr(pub u32);
11077 impl Cfgr {
11078 #[doc = "System clock switch"]
11079 pub const fn sw(&self) -> super::vals::Sw {
11080 let val = (self.0 >> 0usize) & 0x07;
11081 super::vals::Sw(val as u8)
11082 }
11083 #[doc = "System clock switch"]
11084 pub fn set_sw(&mut self, val: super::vals::Sw) {
11085 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
11086 }
11087 #[doc = "System clock switch status"]
11088 pub const fn sws(&self) -> u8 {
11089 let val = (self.0 >> 3usize) & 0x07;
11090 val as u8
11091 }
11092 #[doc = "System clock switch status"]
11093 pub fn set_sws(&mut self, val: u8) {
11094 self.0 = (self.0 & !(0x07 << 3usize)) | (((val as u32) & 0x07) << 3usize);
11095 }
11096 #[doc = "System clock selection after a wake up from system Stop"]
11097 pub const fn stopwuck(&self) -> super::vals::Stopwuck {
11098 let val = (self.0 >> 6usize) & 0x01;
11099 super::vals::Stopwuck(val as u8)
11100 }
11101 #[doc = "System clock selection after a wake up from system Stop"]
11102 pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) {
11103 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
11104 }
11105 #[doc = "Kernel clock selection after a wake up from system Stop"]
11106 pub const fn stopkerwuck(&self) -> super::vals::Stopwuck {
11107 let val = (self.0 >> 7usize) & 0x01;
11108 super::vals::Stopwuck(val as u8)
11109 }
11110 #[doc = "Kernel clock selection after a wake up from system Stop"]
11111 pub fn set_stopkerwuck(&mut self, val: super::vals::Stopwuck) {
11112 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
11113 }
11114 #[doc = "HSE division factor for RTC clock"]
11115 pub const fn rtcpre(&self) -> u8 {
11116 let val = (self.0 >> 8usize) & 0x3f;
11117 val as u8
11118 }
11119 #[doc = "HSE division factor for RTC clock"]
11120 pub fn set_rtcpre(&mut self, val: u8) {
11121 self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
11122 }
11123 #[doc = "High Resolution Timer clock prescaler selection"]
11124 pub const fn hrtimsel(&self) -> super::vals::Hrtimsel {
11125 let val = (self.0 >> 14usize) & 0x01;
11126 super::vals::Hrtimsel(val as u8)
11127 }
11128 #[doc = "High Resolution Timer clock prescaler selection"]
11129 pub fn set_hrtimsel(&mut self, val: super::vals::Hrtimsel) {
11130 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
11131 }
11132 #[doc = "Timers clocks prescaler selection"]
11133 pub const fn timpre(&self) -> super::vals::Timpre {
11134 let val = (self.0 >> 15usize) & 0x01;
11135 super::vals::Timpre(val as u8)
11136 }
11137 #[doc = "Timers clocks prescaler selection"]
11138 pub fn set_timpre(&mut self, val: super::vals::Timpre) {
11139 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
11140 }
11141 #[doc = "MCO1 prescaler"]
11142 pub const fn mco1pre(&self) -> u8 {
11143 let val = (self.0 >> 18usize) & 0x0f;
11144 val as u8
11145 }
11146 #[doc = "MCO1 prescaler"]
11147 pub fn set_mco1pre(&mut self, val: u8) {
11148 self.0 = (self.0 & !(0x0f << 18usize)) | (((val as u32) & 0x0f) << 18usize);
11149 }
11150 #[doc = "Micro-controller clock output 1"]
11151 pub const fn mco1(&self) -> super::vals::Mco1 {
11152 let val = (self.0 >> 22usize) & 0x07;
11153 super::vals::Mco1(val as u8)
11154 }
11155 #[doc = "Micro-controller clock output 1"]
11156 pub fn set_mco1(&mut self, val: super::vals::Mco1) {
11157 self.0 = (self.0 & !(0x07 << 22usize)) | (((val.0 as u32) & 0x07) << 22usize);
11158 }
11159 #[doc = "MCO2 prescaler"]
11160 pub const fn mco2pre(&self) -> u8 {
11161 let val = (self.0 >> 25usize) & 0x0f;
11162 val as u8
11163 }
11164 #[doc = "MCO2 prescaler"]
11165 pub fn set_mco2pre(&mut self, val: u8) {
11166 self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize);
11167 }
11168 #[doc = "Micro-controller clock output 2"]
11169 pub const fn mco2(&self) -> super::vals::Mco2 {
11170 let val = (self.0 >> 29usize) & 0x07;
11171 super::vals::Mco2(val as u8)
11172 }
11173 #[doc = "Micro-controller clock output 2"]
11174 pub fn set_mco2(&mut self, val: super::vals::Mco2) {
11175 self.0 = (self.0 & !(0x07 << 29usize)) | (((val.0 as u32) & 0x07) << 29usize);
11176 }
11177 }
11178 impl Default for Cfgr {
11179 fn default() -> Cfgr {
11180 Cfgr(0)
11181 }
11182 }
11183 #[doc = "RCC PLL1 Dividers Configuration Register"]
11184 #[repr(transparent)]
11185 #[derive(Copy, Clone, Eq, PartialEq)]
11186 pub struct Pll1divr(pub u32);
11187 impl Pll1divr {
11188 #[doc = "Multiplication factor for PLL1 VCO"]
11189 pub const fn divn1(&self) -> u16 {
11190 let val = (self.0 >> 0usize) & 0x01ff;
11191 val as u16
11192 }
11193 #[doc = "Multiplication factor for PLL1 VCO"]
11194 pub fn set_divn1(&mut self, val: u16) {
11195 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
11196 }
11197 #[doc = "PLL1 DIVP division factor"]
11198 pub const fn divp1(&self) -> super::vals::Divp1 {
11199 let val = (self.0 >> 9usize) & 0x7f;
11200 super::vals::Divp1(val as u8)
11201 }
11202 #[doc = "PLL1 DIVP division factor"]
11203 pub fn set_divp1(&mut self, val: super::vals::Divp1) {
11204 self.0 = (self.0 & !(0x7f << 9usize)) | (((val.0 as u32) & 0x7f) << 9usize);
11205 }
11206 #[doc = "PLL1 DIVQ division factor"]
11207 pub const fn divq1(&self) -> u8 {
11208 let val = (self.0 >> 16usize) & 0x7f;
11209 val as u8
11210 }
11211 #[doc = "PLL1 DIVQ division factor"]
11212 pub fn set_divq1(&mut self, val: u8) {
11213 self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
11214 }
11215 #[doc = "PLL1 DIVR division factor"]
11216 pub const fn divr1(&self) -> u8 {
11217 let val = (self.0 >> 24usize) & 0x7f;
11218 val as u8
11219 }
11220 #[doc = "PLL1 DIVR division factor"]
11221 pub fn set_divr1(&mut self, val: u8) {
11222 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
11223 }
11224 }
11225 impl Default for Pll1divr {
11226 fn default() -> Pll1divr {
11227 Pll1divr(0)
11228 }
11229 }
11230 #[doc = "RCC APB1 Low Sleep Clock Register"]
11231 #[repr(transparent)]
11232 #[derive(Copy, Clone, Eq, PartialEq)]
11233 pub struct Apb1llpenr(pub u32);
11234 impl Apb1llpenr {
11235 #[doc = "TIM2 peripheral clock enable during CSleep mode"]
11236 pub const fn tim2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11237 let val = (self.0 >> 0usize) & 0x01;
11238 super::vals::Apb1llpenrTim2lpen(val as u8)
11239 }
11240 #[doc = "TIM2 peripheral clock enable during CSleep mode"]
11241 pub fn set_tim2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11242 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
11243 }
11244 #[doc = "TIM3 peripheral clock enable during CSleep mode"]
11245 pub const fn tim3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11246 let val = (self.0 >> 1usize) & 0x01;
11247 super::vals::Apb1llpenrTim2lpen(val as u8)
11248 }
11249 #[doc = "TIM3 peripheral clock enable during CSleep mode"]
11250 pub fn set_tim3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11251 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
11252 }
11253 #[doc = "TIM4 peripheral clock enable during CSleep mode"]
11254 pub const fn tim4lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11255 let val = (self.0 >> 2usize) & 0x01;
11256 super::vals::Apb1llpenrTim2lpen(val as u8)
11257 }
11258 #[doc = "TIM4 peripheral clock enable during CSleep mode"]
11259 pub fn set_tim4lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11260 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
11261 }
11262 #[doc = "TIM5 peripheral clock enable during CSleep mode"]
11263 pub const fn tim5lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11264 let val = (self.0 >> 3usize) & 0x01;
11265 super::vals::Apb1llpenrTim2lpen(val as u8)
11266 }
11267 #[doc = "TIM5 peripheral clock enable during CSleep mode"]
11268 pub fn set_tim5lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11269 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
11270 }
11271 #[doc = "TIM6 peripheral clock enable during CSleep mode"]
11272 pub const fn tim6lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11273 let val = (self.0 >> 4usize) & 0x01;
11274 super::vals::Apb1llpenrTim2lpen(val as u8)
11275 }
11276 #[doc = "TIM6 peripheral clock enable during CSleep mode"]
11277 pub fn set_tim6lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11278 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
11279 }
11280 #[doc = "TIM7 peripheral clock enable during CSleep mode"]
11281 pub const fn tim7lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11282 let val = (self.0 >> 5usize) & 0x01;
11283 super::vals::Apb1llpenrTim2lpen(val as u8)
11284 }
11285 #[doc = "TIM7 peripheral clock enable during CSleep mode"]
11286 pub fn set_tim7lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11287 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
11288 }
11289 #[doc = "TIM12 peripheral clock enable during CSleep mode"]
11290 pub const fn tim12lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11291 let val = (self.0 >> 6usize) & 0x01;
11292 super::vals::Apb1llpenrTim2lpen(val as u8)
11293 }
11294 #[doc = "TIM12 peripheral clock enable during CSleep mode"]
11295 pub fn set_tim12lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11296 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
11297 }
11298 #[doc = "TIM13 peripheral clock enable during CSleep mode"]
11299 pub const fn tim13lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11300 let val = (self.0 >> 7usize) & 0x01;
11301 super::vals::Apb1llpenrTim2lpen(val as u8)
11302 }
11303 #[doc = "TIM13 peripheral clock enable during CSleep mode"]
11304 pub fn set_tim13lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11305 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
11306 }
11307 #[doc = "TIM14 peripheral clock enable during CSleep mode"]
11308 pub const fn tim14lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11309 let val = (self.0 >> 8usize) & 0x01;
11310 super::vals::Apb1llpenrTim2lpen(val as u8)
11311 }
11312 #[doc = "TIM14 peripheral clock enable during CSleep mode"]
11313 pub fn set_tim14lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11314 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
11315 }
11316 #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"]
11317 pub const fn lptim1lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11318 let val = (self.0 >> 9usize) & 0x01;
11319 super::vals::Apb1llpenrTim2lpen(val as u8)
11320 }
11321 #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"]
11322 pub fn set_lptim1lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11323 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
11324 }
11325 #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"]
11326 pub const fn spi2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11327 let val = (self.0 >> 14usize) & 0x01;
11328 super::vals::Apb1llpenrTim2lpen(val as u8)
11329 }
11330 #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"]
11331 pub fn set_spi2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11332 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
11333 }
11334 #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"]
11335 pub const fn spi3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11336 let val = (self.0 >> 15usize) & 0x01;
11337 super::vals::Apb1llpenrTim2lpen(val as u8)
11338 }
11339 #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"]
11340 pub fn set_spi3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11341 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
11342 }
11343 #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"]
11344 pub const fn spdifrxlpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11345 let val = (self.0 >> 16usize) & 0x01;
11346 super::vals::Apb1llpenrTim2lpen(val as u8)
11347 }
11348 #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"]
11349 pub fn set_spdifrxlpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11350 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
11351 }
11352 #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"]
11353 pub const fn usart2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11354 let val = (self.0 >> 17usize) & 0x01;
11355 super::vals::Apb1llpenrTim2lpen(val as u8)
11356 }
11357 #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"]
11358 pub fn set_usart2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11359 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
11360 }
11361 #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"]
11362 pub const fn usart3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11363 let val = (self.0 >> 18usize) & 0x01;
11364 super::vals::Apb1llpenrTim2lpen(val as u8)
11365 }
11366 #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"]
11367 pub fn set_usart3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11368 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
11369 }
11370 #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"]
11371 pub const fn uart4lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11372 let val = (self.0 >> 19usize) & 0x01;
11373 super::vals::Apb1llpenrTim2lpen(val as u8)
11374 }
11375 #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"]
11376 pub fn set_uart4lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11377 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
11378 }
11379 #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"]
11380 pub const fn uart5lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11381 let val = (self.0 >> 20usize) & 0x01;
11382 super::vals::Apb1llpenrTim2lpen(val as u8)
11383 }
11384 #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"]
11385 pub fn set_uart5lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11386 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
11387 }
11388 #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"]
11389 pub const fn i2c1lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11390 let val = (self.0 >> 21usize) & 0x01;
11391 super::vals::Apb1llpenrTim2lpen(val as u8)
11392 }
11393 #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"]
11394 pub fn set_i2c1lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11395 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
11396 }
11397 #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"]
11398 pub const fn i2c2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11399 let val = (self.0 >> 22usize) & 0x01;
11400 super::vals::Apb1llpenrTim2lpen(val as u8)
11401 }
11402 #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"]
11403 pub fn set_i2c2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11404 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
11405 }
11406 #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"]
11407 pub const fn i2c3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11408 let val = (self.0 >> 23usize) & 0x01;
11409 super::vals::Apb1llpenrTim2lpen(val as u8)
11410 }
11411 #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"]
11412 pub fn set_i2c3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11413 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
11414 }
11415 #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"]
11416 pub const fn ceclpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11417 let val = (self.0 >> 27usize) & 0x01;
11418 super::vals::Apb1llpenrTim2lpen(val as u8)
11419 }
11420 #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"]
11421 pub fn set_ceclpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11422 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
11423 }
11424 #[doc = "DAC1/2 peripheral clock enable during CSleep mode"]
11425 pub const fn dac12lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11426 let val = (self.0 >> 29usize) & 0x01;
11427 super::vals::Apb1llpenrTim2lpen(val as u8)
11428 }
11429 #[doc = "DAC1/2 peripheral clock enable during CSleep mode"]
11430 pub fn set_dac12lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11431 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
11432 }
11433 #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"]
11434 pub const fn uart7lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11435 let val = (self.0 >> 30usize) & 0x01;
11436 super::vals::Apb1llpenrTim2lpen(val as u8)
11437 }
11438 #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"]
11439 pub fn set_uart7lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11440 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
11441 }
11442 #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"]
11443 pub const fn uart8lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
11444 let val = (self.0 >> 31usize) & 0x01;
11445 super::vals::Apb1llpenrTim2lpen(val as u8)
11446 }
11447 #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"]
11448 pub fn set_uart8lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
11449 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
11450 }
11451 }
11452 impl Default for Apb1llpenr {
11453 fn default() -> Apb1llpenr {
11454 Apb1llpenr(0)
11455 }
11456 }
11457 #[doc = "RCC APB2 Clock Register"]
11458 #[repr(transparent)]
11459 #[derive(Copy, Clone, Eq, PartialEq)]
11460 pub struct C1Apb2enr(pub u32);
11461 impl C1Apb2enr {
11462 #[doc = "TIM1 peripheral clock enable"]
11463 pub const fn tim1en(&self) -> super::vals::C1Apb2enrTim1en {
11464 let val = (self.0 >> 0usize) & 0x01;
11465 super::vals::C1Apb2enrTim1en(val as u8)
11466 }
11467 #[doc = "TIM1 peripheral clock enable"]
11468 pub fn set_tim1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11469 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
11470 }
11471 #[doc = "TIM8 peripheral clock enable"]
11472 pub const fn tim8en(&self) -> super::vals::C1Apb2enrTim1en {
11473 let val = (self.0 >> 1usize) & 0x01;
11474 super::vals::C1Apb2enrTim1en(val as u8)
11475 }
11476 #[doc = "TIM8 peripheral clock enable"]
11477 pub fn set_tim8en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11478 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
11479 }
11480 #[doc = "USART1 Peripheral Clocks Enable"]
11481 pub const fn usart1en(&self) -> super::vals::C1Apb2enrTim1en {
11482 let val = (self.0 >> 4usize) & 0x01;
11483 super::vals::C1Apb2enrTim1en(val as u8)
11484 }
11485 #[doc = "USART1 Peripheral Clocks Enable"]
11486 pub fn set_usart1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11487 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
11488 }
11489 #[doc = "USART6 Peripheral Clocks Enable"]
11490 pub const fn usart6en(&self) -> super::vals::C1Apb2enrTim1en {
11491 let val = (self.0 >> 5usize) & 0x01;
11492 super::vals::C1Apb2enrTim1en(val as u8)
11493 }
11494 #[doc = "USART6 Peripheral Clocks Enable"]
11495 pub fn set_usart6en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11496 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
11497 }
11498 #[doc = "SPI1 Peripheral Clocks Enable"]
11499 pub const fn spi1en(&self) -> super::vals::C1Apb2enrTim1en {
11500 let val = (self.0 >> 12usize) & 0x01;
11501 super::vals::C1Apb2enrTim1en(val as u8)
11502 }
11503 #[doc = "SPI1 Peripheral Clocks Enable"]
11504 pub fn set_spi1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11505 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
11506 }
11507 #[doc = "SPI4 Peripheral Clocks Enable"]
11508 pub const fn spi4en(&self) -> super::vals::C1Apb2enrTim1en {
11509 let val = (self.0 >> 13usize) & 0x01;
11510 super::vals::C1Apb2enrTim1en(val as u8)
11511 }
11512 #[doc = "SPI4 Peripheral Clocks Enable"]
11513 pub fn set_spi4en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11514 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
11515 }
11516 #[doc = "TIM15 peripheral clock enable"]
11517 pub const fn tim15en(&self) -> super::vals::C1Apb2enrTim1en {
11518 let val = (self.0 >> 16usize) & 0x01;
11519 super::vals::C1Apb2enrTim1en(val as u8)
11520 }
11521 #[doc = "TIM15 peripheral clock enable"]
11522 pub fn set_tim15en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11523 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
11524 }
11525 #[doc = "TIM16 peripheral clock enable"]
11526 pub const fn tim16en(&self) -> super::vals::C1Apb2enrTim1en {
11527 let val = (self.0 >> 17usize) & 0x01;
11528 super::vals::C1Apb2enrTim1en(val as u8)
11529 }
11530 #[doc = "TIM16 peripheral clock enable"]
11531 pub fn set_tim16en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11532 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
11533 }
11534 #[doc = "TIM17 peripheral clock enable"]
11535 pub const fn tim17en(&self) -> super::vals::C1Apb2enrTim1en {
11536 let val = (self.0 >> 18usize) & 0x01;
11537 super::vals::C1Apb2enrTim1en(val as u8)
11538 }
11539 #[doc = "TIM17 peripheral clock enable"]
11540 pub fn set_tim17en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11541 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
11542 }
11543 #[doc = "SPI5 Peripheral Clocks Enable"]
11544 pub const fn spi5en(&self) -> super::vals::C1Apb2enrTim1en {
11545 let val = (self.0 >> 20usize) & 0x01;
11546 super::vals::C1Apb2enrTim1en(val as u8)
11547 }
11548 #[doc = "SPI5 Peripheral Clocks Enable"]
11549 pub fn set_spi5en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11550 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
11551 }
11552 #[doc = "SAI1 Peripheral Clocks Enable"]
11553 pub const fn sai1en(&self) -> super::vals::C1Apb2enrTim1en {
11554 let val = (self.0 >> 22usize) & 0x01;
11555 super::vals::C1Apb2enrTim1en(val as u8)
11556 }
11557 #[doc = "SAI1 Peripheral Clocks Enable"]
11558 pub fn set_sai1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11559 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
11560 }
11561 #[doc = "SAI2 Peripheral Clocks Enable"]
11562 pub const fn sai2en(&self) -> super::vals::C1Apb2enrTim1en {
11563 let val = (self.0 >> 23usize) & 0x01;
11564 super::vals::C1Apb2enrTim1en(val as u8)
11565 }
11566 #[doc = "SAI2 Peripheral Clocks Enable"]
11567 pub fn set_sai2en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11568 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
11569 }
11570 #[doc = "SAI3 Peripheral Clocks Enable"]
11571 pub const fn sai3en(&self) -> super::vals::C1Apb2enrTim1en {
11572 let val = (self.0 >> 24usize) & 0x01;
11573 super::vals::C1Apb2enrTim1en(val as u8)
11574 }
11575 #[doc = "SAI3 Peripheral Clocks Enable"]
11576 pub fn set_sai3en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11577 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
11578 }
11579 #[doc = "DFSDM1 Peripheral Clocks Enable"]
11580 pub const fn dfsdm1en(&self) -> super::vals::C1Apb2enrTim1en {
11581 let val = (self.0 >> 28usize) & 0x01;
11582 super::vals::C1Apb2enrTim1en(val as u8)
11583 }
11584 #[doc = "DFSDM1 Peripheral Clocks Enable"]
11585 pub fn set_dfsdm1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
11586 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
11587 }
11588 #[doc = "HRTIM peripheral clock enable"]
11589 pub const fn hrtimen(&self) -> super::vals::C1Apb2enrTim1en {
11590 let val = (self.0 >> 29usize) & 0x01;
11591 super::vals::C1Apb2enrTim1en(val as u8)
11592 }
11593 #[doc = "HRTIM peripheral clock enable"]
11594 pub fn set_hrtimen(&mut self, val: super::vals::C1Apb2enrTim1en) {
11595 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
11596 }
11597 }
11598 impl Default for C1Apb2enr {
11599 fn default() -> C1Apb2enr {
11600 C1Apb2enr(0)
11601 }
11602 }
11603 #[doc = "RCC Domain 1 Kernel Clock Configuration Register"]
11604 #[repr(transparent)]
11605 #[derive(Copy, Clone, Eq, PartialEq)]
11606 pub struct D1ccipr(pub u32);
11607 impl D1ccipr {
11608 #[doc = "FMC kernel clock source selection"]
11609 pub const fn fmcsel(&self) -> super::vals::Fmcsel {
11610 let val = (self.0 >> 0usize) & 0x03;
11611 super::vals::Fmcsel(val as u8)
11612 }
11613 #[doc = "FMC kernel clock source selection"]
11614 pub fn set_fmcsel(&mut self, val: super::vals::Fmcsel) {
11615 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
11616 }
11617 #[doc = "QUADSPI kernel clock source selection"]
11618 pub const fn qspisel(&self) -> super::vals::Fmcsel {
11619 let val = (self.0 >> 4usize) & 0x03;
11620 super::vals::Fmcsel(val as u8)
11621 }
11622 #[doc = "QUADSPI kernel clock source selection"]
11623 pub fn set_qspisel(&mut self, val: super::vals::Fmcsel) {
11624 self.0 = (self.0 & !(0x03 << 4usize)) | (((val.0 as u32) & 0x03) << 4usize);
11625 }
11626 #[doc = "SDMMC kernel clock source selection"]
11627 pub const fn sdmmcsel(&self) -> super::vals::Sdmmcsel {
11628 let val = (self.0 >> 16usize) & 0x01;
11629 super::vals::Sdmmcsel(val as u8)
11630 }
11631 #[doc = "SDMMC kernel clock source selection"]
11632 pub fn set_sdmmcsel(&mut self, val: super::vals::Sdmmcsel) {
11633 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
11634 }
11635 #[doc = "per_ck clock source selection"]
11636 pub const fn ckpersel(&self) -> super::vals::Ckpersel {
11637 let val = (self.0 >> 28usize) & 0x03;
11638 super::vals::Ckpersel(val as u8)
11639 }
11640 #[doc = "per_ck clock source selection"]
11641 pub fn set_ckpersel(&mut self, val: super::vals::Ckpersel) {
11642 self.0 = (self.0 & !(0x03 << 28usize)) | (((val.0 as u32) & 0x03) << 28usize);
11643 }
11644 }
11645 impl Default for D1ccipr {
11646 fn default() -> D1ccipr {
11647 D1ccipr(0)
11648 }
11649 }
11650 #[doc = "RCC APB1 High Sleep Clock Register"]
11651 #[repr(transparent)]
11652 #[derive(Copy, Clone, Eq, PartialEq)]
11653 pub struct Apb1hlpenr(pub u32);
11654 impl Apb1hlpenr {
11655 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
11656 pub const fn crslpen(&self) -> super::vals::Apb1hlpenrCrslpen {
11657 let val = (self.0 >> 1usize) & 0x01;
11658 super::vals::Apb1hlpenrCrslpen(val as u8)
11659 }
11660 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
11661 pub fn set_crslpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
11662 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
11663 }
11664 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
11665 pub const fn swplpen(&self) -> super::vals::Apb1hlpenrCrslpen {
11666 let val = (self.0 >> 2usize) & 0x01;
11667 super::vals::Apb1hlpenrCrslpen(val as u8)
11668 }
11669 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
11670 pub fn set_swplpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
11671 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
11672 }
11673 #[doc = "OPAMP peripheral clock enable during CSleep mode"]
11674 pub const fn opamplpen(&self) -> super::vals::Apb1hlpenrCrslpen {
11675 let val = (self.0 >> 4usize) & 0x01;
11676 super::vals::Apb1hlpenrCrslpen(val as u8)
11677 }
11678 #[doc = "OPAMP peripheral clock enable during CSleep mode"]
11679 pub fn set_opamplpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
11680 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
11681 }
11682 #[doc = "MDIOS peripheral clock enable during CSleep mode"]
11683 pub const fn mdioslpen(&self) -> super::vals::Apb1hlpenrCrslpen {
11684 let val = (self.0 >> 5usize) & 0x01;
11685 super::vals::Apb1hlpenrCrslpen(val as u8)
11686 }
11687 #[doc = "MDIOS peripheral clock enable during CSleep mode"]
11688 pub fn set_mdioslpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
11689 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
11690 }
11691 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"]
11692 pub const fn fdcanlpen(&self) -> super::vals::Apb1hlpenrCrslpen {
11693 let val = (self.0 >> 8usize) & 0x01;
11694 super::vals::Apb1hlpenrCrslpen(val as u8)
11695 }
11696 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"]
11697 pub fn set_fdcanlpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
11698 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
11699 }
11700 }
11701 impl Default for Apb1hlpenr {
11702 fn default() -> Apb1hlpenr {
11703 Apb1hlpenr(0)
11704 }
11705 }
11706 #[doc = "clock control register"] 7681 #[doc = "clock control register"]
11707 #[repr(transparent)] 7682 #[repr(transparent)]
11708 #[derive(Copy, Clone, Eq, PartialEq)] 7683 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -11912,6 +7887,163 @@ pub mod rcc_h7 {
11912 Cr(0) 7887 Cr(0)
11913 } 7888 }
11914 } 7889 }
7890 #[doc = "RCC Domain 3 Kernel Clock Configuration Register"]
7891 #[repr(transparent)]
7892 #[derive(Copy, Clone, Eq, PartialEq)]
7893 pub struct D3ccipr(pub u32);
7894 impl D3ccipr {
7895 #[doc = "LPUART1 kernel clock source selection"]
7896 pub const fn lpuart1sel(&self) -> super::vals::Lpuart1sel {
7897 let val = (self.0 >> 0usize) & 0x07;
7898 super::vals::Lpuart1sel(val as u8)
7899 }
7900 #[doc = "LPUART1 kernel clock source selection"]
7901 pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuart1sel) {
7902 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
7903 }
7904 #[doc = "I2C4 kernel clock source selection"]
7905 pub const fn i2c4sel(&self) -> super::vals::I2c4sel {
7906 let val = (self.0 >> 8usize) & 0x03;
7907 super::vals::I2c4sel(val as u8)
7908 }
7909 #[doc = "I2C4 kernel clock source selection"]
7910 pub fn set_i2c4sel(&mut self, val: super::vals::I2c4sel) {
7911 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
7912 }
7913 #[doc = "LPTIM2 kernel clock source selection"]
7914 pub const fn lptim2sel(&self) -> super::vals::Lptim2sel {
7915 let val = (self.0 >> 10usize) & 0x07;
7916 super::vals::Lptim2sel(val as u8)
7917 }
7918 #[doc = "LPTIM2 kernel clock source selection"]
7919 pub fn set_lptim2sel(&mut self, val: super::vals::Lptim2sel) {
7920 self.0 = (self.0 & !(0x07 << 10usize)) | (((val.0 as u32) & 0x07) << 10usize);
7921 }
7922 #[doc = "LPTIM3,4,5 kernel clock source selection"]
7923 pub const fn lptim345sel(&self) -> super::vals::Lptim2sel {
7924 let val = (self.0 >> 13usize) & 0x07;
7925 super::vals::Lptim2sel(val as u8)
7926 }
7927 #[doc = "LPTIM3,4,5 kernel clock source selection"]
7928 pub fn set_lptim345sel(&mut self, val: super::vals::Lptim2sel) {
7929 self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize);
7930 }
7931 #[doc = "SAR ADC kernel clock source selection"]
7932 pub const fn adcsel(&self) -> super::vals::Adcsel {
7933 let val = (self.0 >> 16usize) & 0x03;
7934 super::vals::Adcsel(val as u8)
7935 }
7936 #[doc = "SAR ADC kernel clock source selection"]
7937 pub fn set_adcsel(&mut self, val: super::vals::Adcsel) {
7938 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
7939 }
7940 #[doc = "Sub-Block A of SAI4 kernel clock source selection"]
7941 pub const fn sai4asel(&self) -> super::vals::Sai4asel {
7942 let val = (self.0 >> 21usize) & 0x07;
7943 super::vals::Sai4asel(val as u8)
7944 }
7945 #[doc = "Sub-Block A of SAI4 kernel clock source selection"]
7946 pub fn set_sai4asel(&mut self, val: super::vals::Sai4asel) {
7947 self.0 = (self.0 & !(0x07 << 21usize)) | (((val.0 as u32) & 0x07) << 21usize);
7948 }
7949 #[doc = "Sub-Block B of SAI4 kernel clock source selection"]
7950 pub const fn sai4bsel(&self) -> super::vals::Sai4asel {
7951 let val = (self.0 >> 24usize) & 0x07;
7952 super::vals::Sai4asel(val as u8)
7953 }
7954 #[doc = "Sub-Block B of SAI4 kernel clock source selection"]
7955 pub fn set_sai4bsel(&mut self, val: super::vals::Sai4asel) {
7956 self.0 = (self.0 & !(0x07 << 24usize)) | (((val.0 as u32) & 0x07) << 24usize);
7957 }
7958 #[doc = "SPI6 kernel clock source selection"]
7959 pub const fn spi6sel(&self) -> super::vals::Spi6sel {
7960 let val = (self.0 >> 28usize) & 0x07;
7961 super::vals::Spi6sel(val as u8)
7962 }
7963 #[doc = "SPI6 kernel clock source selection"]
7964 pub fn set_spi6sel(&mut self, val: super::vals::Spi6sel) {
7965 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize);
7966 }
7967 }
7968 impl Default for D3ccipr {
7969 fn default() -> D3ccipr {
7970 D3ccipr(0)
7971 }
7972 }
7973 #[doc = "RCC AHB3 Reset Register"]
7974 #[repr(transparent)]
7975 #[derive(Copy, Clone, Eq, PartialEq)]
7976 pub struct Ahb3rstr(pub u32);
7977 impl Ahb3rstr {
7978 #[doc = "MDMA block reset"]
7979 pub const fn mdmarst(&self) -> super::vals::Mdmarst {
7980 let val = (self.0 >> 0usize) & 0x01;
7981 super::vals::Mdmarst(val as u8)
7982 }
7983 #[doc = "MDMA block reset"]
7984 pub fn set_mdmarst(&mut self, val: super::vals::Mdmarst) {
7985 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
7986 }
7987 #[doc = "DMA2D block reset"]
7988 pub const fn dma2drst(&self) -> super::vals::Mdmarst {
7989 let val = (self.0 >> 4usize) & 0x01;
7990 super::vals::Mdmarst(val as u8)
7991 }
7992 #[doc = "DMA2D block reset"]
7993 pub fn set_dma2drst(&mut self, val: super::vals::Mdmarst) {
7994 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
7995 }
7996 #[doc = "JPGDEC block reset"]
7997 pub const fn jpgdecrst(&self) -> super::vals::Mdmarst {
7998 let val = (self.0 >> 5usize) & 0x01;
7999 super::vals::Mdmarst(val as u8)
8000 }
8001 #[doc = "JPGDEC block reset"]
8002 pub fn set_jpgdecrst(&mut self, val: super::vals::Mdmarst) {
8003 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
8004 }
8005 #[doc = "FMC block reset"]
8006 pub const fn fmcrst(&self) -> super::vals::Mdmarst {
8007 let val = (self.0 >> 12usize) & 0x01;
8008 super::vals::Mdmarst(val as u8)
8009 }
8010 #[doc = "FMC block reset"]
8011 pub fn set_fmcrst(&mut self, val: super::vals::Mdmarst) {
8012 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
8013 }
8014 #[doc = "QUADSPI and QUADSPI delay block reset"]
8015 pub const fn qspirst(&self) -> super::vals::Mdmarst {
8016 let val = (self.0 >> 14usize) & 0x01;
8017 super::vals::Mdmarst(val as u8)
8018 }
8019 #[doc = "QUADSPI and QUADSPI delay block reset"]
8020 pub fn set_qspirst(&mut self, val: super::vals::Mdmarst) {
8021 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
8022 }
8023 #[doc = "SDMMC1 and SDMMC1 delay block reset"]
8024 pub const fn sdmmc1rst(&self) -> super::vals::Mdmarst {
8025 let val = (self.0 >> 16usize) & 0x01;
8026 super::vals::Mdmarst(val as u8)
8027 }
8028 #[doc = "SDMMC1 and SDMMC1 delay block reset"]
8029 pub fn set_sdmmc1rst(&mut self, val: super::vals::Mdmarst) {
8030 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
8031 }
8032 #[doc = "CPU reset"]
8033 pub const fn cpurst(&self) -> super::vals::Mdmarst {
8034 let val = (self.0 >> 31usize) & 0x01;
8035 super::vals::Mdmarst(val as u8)
8036 }
8037 #[doc = "CPU reset"]
8038 pub fn set_cpurst(&mut self, val: super::vals::Mdmarst) {
8039 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
8040 }
8041 }
8042 impl Default for Ahb3rstr {
8043 fn default() -> Ahb3rstr {
8044 Ahb3rstr(0)
8045 }
8046 }
11915 #[doc = "RCC PLL1 Fractional Divider Register"] 8047 #[doc = "RCC PLL1 Fractional Divider Register"]
11916 #[repr(transparent)] 8048 #[repr(transparent)]
11917 #[derive(Copy, Clone, Eq, PartialEq)] 8049 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -11932,721 +8064,808 @@ pub mod rcc_h7 {
11932 Pll1fracr(0) 8064 Pll1fracr(0)
11933 } 8065 }
11934 } 8066 }
11935 #[doc = "RCC Clock Control and Status Register"] 8067 #[doc = "RCC Global Control Register"]
11936 #[repr(transparent)] 8068 #[repr(transparent)]
11937 #[derive(Copy, Clone, Eq, PartialEq)] 8069 #[derive(Copy, Clone, Eq, PartialEq)]
11938 pub struct Csr(pub u32); 8070 pub struct Gcr(pub u32);
11939 impl Csr { 8071 impl Gcr {
11940 #[doc = "LSI oscillator enable"] 8072 #[doc = "WWDG1 reset scope control"]
11941 pub const fn lsion(&self) -> super::vals::Lsion { 8073 pub const fn ww1rsc(&self) -> super::vals::Ww1rsc {
11942 let val = (self.0 >> 0usize) & 0x01; 8074 let val = (self.0 >> 0usize) & 0x01;
11943 super::vals::Lsion(val as u8) 8075 super::vals::Ww1rsc(val as u8)
11944 } 8076 }
11945 #[doc = "LSI oscillator enable"] 8077 #[doc = "WWDG1 reset scope control"]
11946 pub fn set_lsion(&mut self, val: super::vals::Lsion) { 8078 pub fn set_ww1rsc(&mut self, val: super::vals::Ww1rsc) {
11947 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 8079 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
11948 } 8080 }
11949 #[doc = "LSI oscillator ready"]
11950 pub const fn lsirdy(&self) -> bool {
11951 let val = (self.0 >> 1usize) & 0x01;
11952 val != 0
11953 }
11954 #[doc = "LSI oscillator ready"]
11955 pub fn set_lsirdy(&mut self, val: bool) {
11956 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
11957 }
11958 } 8081 }
11959 impl Default for Csr { 8082 impl Default for Gcr {
11960 fn default() -> Csr { 8083 fn default() -> Gcr {
11961 Csr(0) 8084 Gcr(0)
11962 } 8085 }
11963 } 8086 }
11964 #[doc = "RCC AHB1 Clock Register"] 8087 #[doc = "RCC AHB1 Sleep Clock Register"]
11965 #[repr(transparent)] 8088 #[repr(transparent)]
11966 #[derive(Copy, Clone, Eq, PartialEq)] 8089 #[derive(Copy, Clone, Eq, PartialEq)]
11967 pub struct C1Ahb1enr(pub u32); 8090 pub struct C1Ahb1lpenr(pub u32);
11968 impl C1Ahb1enr { 8091 impl C1Ahb1lpenr {
11969 #[doc = "DMA1 Clock Enable"] 8092 #[doc = "DMA1 Clock Enable During CSleep Mode"]
11970 pub const fn dma1en(&self) -> super::vals::C1Ahb1enrDma1en { 8093 pub const fn dma1lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
11971 let val = (self.0 >> 0usize) & 0x01; 8094 let val = (self.0 >> 0usize) & 0x01;
11972 super::vals::C1Ahb1enrDma1en(val as u8) 8095 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
11973 } 8096 }
11974 #[doc = "DMA1 Clock Enable"] 8097 #[doc = "DMA1 Clock Enable During CSleep Mode"]
11975 pub fn set_dma1en(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8098 pub fn set_dma1lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
11976 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 8099 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
11977 } 8100 }
11978 #[doc = "DMA2 Clock Enable"] 8101 #[doc = "DMA2 Clock Enable During CSleep Mode"]
11979 pub const fn dma2en(&self) -> super::vals::C1Ahb1enrDma1en { 8102 pub const fn dma2lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
11980 let val = (self.0 >> 1usize) & 0x01; 8103 let val = (self.0 >> 1usize) & 0x01;
11981 super::vals::C1Ahb1enrDma1en(val as u8) 8104 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
11982 } 8105 }
11983 #[doc = "DMA2 Clock Enable"] 8106 #[doc = "DMA2 Clock Enable During CSleep Mode"]
11984 pub fn set_dma2en(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8107 pub fn set_dma2lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
11985 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 8108 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
11986 } 8109 }
11987 #[doc = "ADC1/2 Peripheral Clocks Enable"] 8110 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"]
11988 pub const fn adc12en(&self) -> super::vals::C1Ahb1enrDma1en { 8111 pub const fn adc12lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
11989 let val = (self.0 >> 5usize) & 0x01; 8112 let val = (self.0 >> 5usize) & 0x01;
11990 super::vals::C1Ahb1enrDma1en(val as u8) 8113 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
11991 } 8114 }
11992 #[doc = "ADC1/2 Peripheral Clocks Enable"] 8115 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"]
11993 pub fn set_adc12en(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8116 pub fn set_adc12lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
11994 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 8117 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
11995 } 8118 }
11996 #[doc = "Ethernet MAC bus interface Clock Enable"] 8119 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"]
11997 pub const fn eth1macen(&self) -> super::vals::C1Ahb1enrDma1en { 8120 pub const fn eth1maclpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
11998 let val = (self.0 >> 15usize) & 0x01; 8121 let val = (self.0 >> 15usize) & 0x01;
11999 super::vals::C1Ahb1enrDma1en(val as u8) 8122 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12000 } 8123 }
12001 #[doc = "Ethernet MAC bus interface Clock Enable"] 8124 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"]
12002 pub fn set_eth1macen(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8125 pub fn set_eth1maclpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12003 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 8126 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
12004 } 8127 }
12005 #[doc = "Ethernet Transmission Clock Enable"] 8128 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"]
12006 pub const fn eth1txen(&self) -> super::vals::C1Ahb1enrDma1en { 8129 pub const fn eth1txlpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
12007 let val = (self.0 >> 16usize) & 0x01; 8130 let val = (self.0 >> 16usize) & 0x01;
12008 super::vals::C1Ahb1enrDma1en(val as u8) 8131 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12009 } 8132 }
12010 #[doc = "Ethernet Transmission Clock Enable"] 8133 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"]
12011 pub fn set_eth1txen(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8134 pub fn set_eth1txlpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12012 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 8135 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
12013 } 8136 }
12014 #[doc = "Ethernet Reception Clock Enable"] 8137 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"]
12015 pub const fn eth1rxen(&self) -> super::vals::C1Ahb1enrDma1en { 8138 pub const fn eth1rxlpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
12016 let val = (self.0 >> 17usize) & 0x01; 8139 let val = (self.0 >> 17usize) & 0x01;
12017 super::vals::C1Ahb1enrDma1en(val as u8) 8140 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12018 } 8141 }
12019 #[doc = "Ethernet Reception Clock Enable"] 8142 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"]
12020 pub fn set_eth1rxen(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8143 pub fn set_eth1rxlpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12021 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 8144 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
12022 } 8145 }
12023 #[doc = "USB1OTG Peripheral Clocks Enable"] 8146 #[doc = "USB1OTG peripheral clock enable during CSleep mode"]
12024 pub const fn usb1otgen(&self) -> super::vals::C1Ahb1enrDma1en { 8147 pub const fn usb1otglpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
12025 let val = (self.0 >> 25usize) & 0x01; 8148 let val = (self.0 >> 25usize) & 0x01;
12026 super::vals::C1Ahb1enrDma1en(val as u8) 8149 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12027 } 8150 }
12028 #[doc = "USB1OTG Peripheral Clocks Enable"] 8151 #[doc = "USB1OTG peripheral clock enable during CSleep mode"]
12029 pub fn set_usb1otgen(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8152 pub fn set_usb1otglpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12030 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 8153 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
12031 } 8154 }
12032 #[doc = "USB_PHY1 Clocks Enable"] 8155 #[doc = "USB_PHY1 clock enable during CSleep mode"]
12033 pub const fn usb1ulpien(&self) -> super::vals::C1Ahb1enrDma1en { 8156 pub const fn usb1ulpilpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
12034 let val = (self.0 >> 26usize) & 0x01; 8157 let val = (self.0 >> 26usize) & 0x01;
12035 super::vals::C1Ahb1enrDma1en(val as u8) 8158 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12036 } 8159 }
12037 #[doc = "USB_PHY1 Clocks Enable"] 8160 #[doc = "USB_PHY1 clock enable during CSleep mode"]
12038 pub fn set_usb1ulpien(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8161 pub fn set_usb1ulpilpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12039 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); 8162 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize);
12040 } 8163 }
12041 #[doc = "USB2OTG Peripheral Clocks Enable"] 8164 #[doc = "USB2OTG peripheral clock enable during CSleep mode"]
12042 pub const fn usb2otgen(&self) -> super::vals::C1Ahb1enrDma1en { 8165 pub const fn usb2otglpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
12043 let val = (self.0 >> 27usize) & 0x01; 8166 let val = (self.0 >> 27usize) & 0x01;
12044 super::vals::C1Ahb1enrDma1en(val as u8) 8167 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12045 } 8168 }
12046 #[doc = "USB2OTG Peripheral Clocks Enable"] 8169 #[doc = "USB2OTG peripheral clock enable during CSleep mode"]
12047 pub fn set_usb2otgen(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8170 pub fn set_usb2otglpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12048 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 8171 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
12049 } 8172 }
12050 #[doc = "USB_PHY2 Clocks Enable"] 8173 #[doc = "USB_PHY2 clocks enable during CSleep mode"]
12051 pub const fn usb2ulpien(&self) -> super::vals::C1Ahb1enrDma1en { 8174 pub const fn usb2ulpilpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
12052 let val = (self.0 >> 28usize) & 0x01; 8175 let val = (self.0 >> 28usize) & 0x01;
12053 super::vals::C1Ahb1enrDma1en(val as u8) 8176 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
12054 } 8177 }
12055 #[doc = "USB_PHY2 Clocks Enable"] 8178 #[doc = "USB_PHY2 clocks enable during CSleep mode"]
12056 pub fn set_usb2ulpien(&mut self, val: super::vals::C1Ahb1enrDma1en) { 8179 pub fn set_usb2ulpilpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
12057 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 8180 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
12058 } 8181 }
12059 } 8182 }
12060 impl Default for C1Ahb1enr { 8183 impl Default for C1Ahb1lpenr {
12061 fn default() -> C1Ahb1enr { 8184 fn default() -> C1Ahb1lpenr {
12062 C1Ahb1enr(0) 8185 C1Ahb1lpenr(0)
12063 } 8186 }
12064 } 8187 }
12065 #[doc = "RCC APB2 Clock Register"] 8188 #[doc = "RCC Internal Clock Source Calibration Register"]
12066 #[repr(transparent)] 8189 #[repr(transparent)]
12067 #[derive(Copy, Clone, Eq, PartialEq)] 8190 #[derive(Copy, Clone, Eq, PartialEq)]
12068 pub struct Apb2enr(pub u32); 8191 pub struct Icscr(pub u32);
12069 impl Apb2enr { 8192 impl Icscr {
12070 #[doc = "TIM1 peripheral clock enable"] 8193 #[doc = "HSI clock calibration"]
12071 pub const fn tim1en(&self) -> super::vals::Apb2enrTim1en { 8194 pub const fn hsical(&self) -> u16 {
12072 let val = (self.0 >> 0usize) & 0x01; 8195 let val = (self.0 >> 0usize) & 0x0fff;
12073 super::vals::Apb2enrTim1en(val as u8) 8196 val as u16
12074 } 8197 }
12075 #[doc = "TIM1 peripheral clock enable"] 8198 #[doc = "HSI clock calibration"]
12076 pub fn set_tim1en(&mut self, val: super::vals::Apb2enrTim1en) { 8199 pub fn set_hsical(&mut self, val: u16) {
12077 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 8200 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
12078 } 8201 }
12079 #[doc = "TIM8 peripheral clock enable"] 8202 #[doc = "HSI clock trimming"]
12080 pub const fn tim8en(&self) -> super::vals::Apb2enrTim1en { 8203 pub const fn hsitrim(&self) -> u8 {
12081 let val = (self.0 >> 1usize) & 0x01; 8204 let val = (self.0 >> 12usize) & 0x3f;
12082 super::vals::Apb2enrTim1en(val as u8) 8205 val as u8
12083 } 8206 }
12084 #[doc = "TIM8 peripheral clock enable"] 8207 #[doc = "HSI clock trimming"]
12085 pub fn set_tim8en(&mut self, val: super::vals::Apb2enrTim1en) { 8208 pub fn set_hsitrim(&mut self, val: u8) {
12086 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 8209 self.0 = (self.0 & !(0x3f << 12usize)) | (((val as u32) & 0x3f) << 12usize);
12087 } 8210 }
12088 #[doc = "USART1 Peripheral Clocks Enable"] 8211 #[doc = "CSI clock calibration"]
12089 pub const fn usart1en(&self) -> super::vals::Apb2enrTim1en { 8212 pub const fn csical(&self) -> u8 {
8213 let val = (self.0 >> 18usize) & 0xff;
8214 val as u8
8215 }
8216 #[doc = "CSI clock calibration"]
8217 pub fn set_csical(&mut self, val: u8) {
8218 self.0 = (self.0 & !(0xff << 18usize)) | (((val as u32) & 0xff) << 18usize);
8219 }
8220 #[doc = "CSI clock trimming"]
8221 pub const fn csitrim(&self) -> u8 {
8222 let val = (self.0 >> 26usize) & 0x1f;
8223 val as u8
8224 }
8225 #[doc = "CSI clock trimming"]
8226 pub fn set_csitrim(&mut self, val: u8) {
8227 self.0 = (self.0 & !(0x1f << 26usize)) | (((val as u32) & 0x1f) << 26usize);
8228 }
8229 }
8230 impl Default for Icscr {
8231 fn default() -> Icscr {
8232 Icscr(0)
8233 }
8234 }
8235 #[doc = "RCC AHB2 Peripheral Reset Register"]
8236 #[repr(transparent)]
8237 #[derive(Copy, Clone, Eq, PartialEq)]
8238 pub struct Ahb2rstr(pub u32);
8239 impl Ahb2rstr {
8240 #[doc = "CAMITF block reset"]
8241 pub const fn camitfrst(&self) -> super::vals::Camitfrst {
8242 let val = (self.0 >> 0usize) & 0x01;
8243 super::vals::Camitfrst(val as u8)
8244 }
8245 #[doc = "CAMITF block reset"]
8246 pub fn set_camitfrst(&mut self, val: super::vals::Camitfrst) {
8247 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
8248 }
8249 #[doc = "Cryptography block reset"]
8250 pub const fn cryptrst(&self) -> super::vals::Camitfrst {
12090 let val = (self.0 >> 4usize) & 0x01; 8251 let val = (self.0 >> 4usize) & 0x01;
12091 super::vals::Apb2enrTim1en(val as u8) 8252 super::vals::Camitfrst(val as u8)
12092 } 8253 }
12093 #[doc = "USART1 Peripheral Clocks Enable"] 8254 #[doc = "Cryptography block reset"]
12094 pub fn set_usart1en(&mut self, val: super::vals::Apb2enrTim1en) { 8255 pub fn set_cryptrst(&mut self, val: super::vals::Camitfrst) {
12095 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 8256 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
12096 } 8257 }
12097 #[doc = "USART6 Peripheral Clocks Enable"] 8258 #[doc = "Hash block reset"]
12098 pub const fn usart6en(&self) -> super::vals::Apb2enrTim1en { 8259 pub const fn hashrst(&self) -> super::vals::Camitfrst {
12099 let val = (self.0 >> 5usize) & 0x01; 8260 let val = (self.0 >> 5usize) & 0x01;
12100 super::vals::Apb2enrTim1en(val as u8) 8261 super::vals::Camitfrst(val as u8)
12101 } 8262 }
12102 #[doc = "USART6 Peripheral Clocks Enable"] 8263 #[doc = "Hash block reset"]
12103 pub fn set_usart6en(&mut self, val: super::vals::Apb2enrTim1en) { 8264 pub fn set_hashrst(&mut self, val: super::vals::Camitfrst) {
12104 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 8265 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
12105 } 8266 }
12106 #[doc = "SPI1 Peripheral Clocks Enable"] 8267 #[doc = "Random Number Generator block reset"]
12107 pub const fn spi1en(&self) -> super::vals::Apb2enrTim1en { 8268 pub const fn rngrst(&self) -> super::vals::Camitfrst {
12108 let val = (self.0 >> 12usize) & 0x01; 8269 let val = (self.0 >> 6usize) & 0x01;
12109 super::vals::Apb2enrTim1en(val as u8) 8270 super::vals::Camitfrst(val as u8)
12110 } 8271 }
12111 #[doc = "SPI1 Peripheral Clocks Enable"] 8272 #[doc = "Random Number Generator block reset"]
12112 pub fn set_spi1en(&mut self, val: super::vals::Apb2enrTim1en) { 8273 pub fn set_rngrst(&mut self, val: super::vals::Camitfrst) {
12113 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 8274 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
12114 } 8275 }
12115 #[doc = "SPI4 Peripheral Clocks Enable"] 8276 #[doc = "SDMMC2 and SDMMC2 Delay block reset"]
12116 pub const fn spi4en(&self) -> super::vals::Apb2enrTim1en { 8277 pub const fn sdmmc2rst(&self) -> super::vals::Camitfrst {
12117 let val = (self.0 >> 13usize) & 0x01; 8278 let val = (self.0 >> 9usize) & 0x01;
12118 super::vals::Apb2enrTim1en(val as u8) 8279 super::vals::Camitfrst(val as u8)
12119 } 8280 }
12120 #[doc = "SPI4 Peripheral Clocks Enable"] 8281 #[doc = "SDMMC2 and SDMMC2 Delay block reset"]
12121 pub fn set_spi4en(&mut self, val: super::vals::Apb2enrTim1en) { 8282 pub fn set_sdmmc2rst(&mut self, val: super::vals::Camitfrst) {
12122 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); 8283 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
12123 } 8284 }
12124 #[doc = "TIM15 peripheral clock enable"] 8285 }
12125 pub const fn tim15en(&self) -> super::vals::Apb2enrTim1en { 8286 impl Default for Ahb2rstr {
12126 let val = (self.0 >> 16usize) & 0x01; 8287 fn default() -> Ahb2rstr {
12127 super::vals::Apb2enrTim1en(val as u8) 8288 Ahb2rstr(0)
12128 } 8289 }
12129 #[doc = "TIM15 peripheral clock enable"] 8290 }
12130 pub fn set_tim15en(&mut self, val: super::vals::Apb2enrTim1en) { 8291 #[doc = "RCC APB3 Clock Register"]
12131 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 8292 #[repr(transparent)]
8293 #[derive(Copy, Clone, Eq, PartialEq)]
8294 pub struct Apb3enr(pub u32);
8295 impl Apb3enr {
8296 #[doc = "LTDC peripheral clock enable"]
8297 pub const fn ltdcen(&self) -> super::vals::Apb3enrLtdcen {
8298 let val = (self.0 >> 3usize) & 0x01;
8299 super::vals::Apb3enrLtdcen(val as u8)
12132 } 8300 }
12133 #[doc = "TIM16 peripheral clock enable"] 8301 #[doc = "LTDC peripheral clock enable"]
12134 pub const fn tim16en(&self) -> super::vals::Apb2enrTim1en { 8302 pub fn set_ltdcen(&mut self, val: super::vals::Apb3enrLtdcen) {
12135 let val = (self.0 >> 17usize) & 0x01; 8303 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
12136 super::vals::Apb2enrTim1en(val as u8)
12137 } 8304 }
12138 #[doc = "TIM16 peripheral clock enable"] 8305 #[doc = "WWDG1 Clock Enable"]
12139 pub fn set_tim16en(&mut self, val: super::vals::Apb2enrTim1en) { 8306 pub const fn wwdg1en(&self) -> super::vals::Apb3enrLtdcen {
12140 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 8307 let val = (self.0 >> 6usize) & 0x01;
8308 super::vals::Apb3enrLtdcen(val as u8)
12141 } 8309 }
12142 #[doc = "TIM17 peripheral clock enable"] 8310 #[doc = "WWDG1 Clock Enable"]
12143 pub const fn tim17en(&self) -> super::vals::Apb2enrTim1en { 8311 pub fn set_wwdg1en(&mut self, val: super::vals::Apb3enrLtdcen) {
12144 let val = (self.0 >> 18usize) & 0x01; 8312 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
12145 super::vals::Apb2enrTim1en(val as u8)
12146 } 8313 }
12147 #[doc = "TIM17 peripheral clock enable"] 8314 }
12148 pub fn set_tim17en(&mut self, val: super::vals::Apb2enrTim1en) { 8315 impl Default for Apb3enr {
12149 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); 8316 fn default() -> Apb3enr {
8317 Apb3enr(0)
12150 } 8318 }
12151 #[doc = "SPI5 Peripheral Clocks Enable"] 8319 }
12152 pub const fn spi5en(&self) -> super::vals::Apb2enrTim1en { 8320 #[doc = "RCC Domain 1 Clock Configuration Register"]
12153 let val = (self.0 >> 20usize) & 0x01; 8321 #[repr(transparent)]
12154 super::vals::Apb2enrTim1en(val as u8) 8322 #[derive(Copy, Clone, Eq, PartialEq)]
8323 pub struct D1cfgr(pub u32);
8324 impl D1cfgr {
8325 #[doc = "D1 domain AHB prescaler"]
8326 pub const fn hpre(&self) -> super::vals::Hpre {
8327 let val = (self.0 >> 0usize) & 0x0f;
8328 super::vals::Hpre(val as u8)
12155 } 8329 }
12156 #[doc = "SPI5 Peripheral Clocks Enable"] 8330 #[doc = "D1 domain AHB prescaler"]
12157 pub fn set_spi5en(&mut self, val: super::vals::Apb2enrTim1en) { 8331 pub fn set_hpre(&mut self, val: super::vals::Hpre) {
12158 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); 8332 self.0 = (self.0 & !(0x0f << 0usize)) | (((val.0 as u32) & 0x0f) << 0usize);
12159 } 8333 }
12160 #[doc = "SAI1 Peripheral Clocks Enable"] 8334 #[doc = "D1 domain APB3 prescaler"]
12161 pub const fn sai1en(&self) -> super::vals::Apb2enrTim1en { 8335 pub const fn d1ppre(&self) -> super::vals::D1ppre {
12162 let val = (self.0 >> 22usize) & 0x01; 8336 let val = (self.0 >> 4usize) & 0x07;
12163 super::vals::Apb2enrTim1en(val as u8) 8337 super::vals::D1ppre(val as u8)
12164 } 8338 }
12165 #[doc = "SAI1 Peripheral Clocks Enable"] 8339 #[doc = "D1 domain APB3 prescaler"]
12166 pub fn set_sai1en(&mut self, val: super::vals::Apb2enrTim1en) { 8340 pub fn set_d1ppre(&mut self, val: super::vals::D1ppre) {
12167 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); 8341 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
12168 } 8342 }
12169 #[doc = "SAI2 Peripheral Clocks Enable"] 8343 #[doc = "D1 domain Core prescaler"]
12170 pub const fn sai2en(&self) -> super::vals::Apb2enrTim1en { 8344 pub const fn d1cpre(&self) -> super::vals::Hpre {
12171 let val = (self.0 >> 23usize) & 0x01; 8345 let val = (self.0 >> 8usize) & 0x0f;
12172 super::vals::Apb2enrTim1en(val as u8) 8346 super::vals::Hpre(val as u8)
12173 } 8347 }
12174 #[doc = "SAI2 Peripheral Clocks Enable"] 8348 #[doc = "D1 domain Core prescaler"]
12175 pub fn set_sai2en(&mut self, val: super::vals::Apb2enrTim1en) { 8349 pub fn set_d1cpre(&mut self, val: super::vals::Hpre) {
12176 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); 8350 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
12177 } 8351 }
12178 #[doc = "SAI3 Peripheral Clocks Enable"] 8352 }
12179 pub const fn sai3en(&self) -> super::vals::Apb2enrTim1en { 8353 impl Default for D1cfgr {
12180 let val = (self.0 >> 24usize) & 0x01; 8354 fn default() -> D1cfgr {
12181 super::vals::Apb2enrTim1en(val as u8) 8355 D1cfgr(0)
12182 } 8356 }
12183 #[doc = "SAI3 Peripheral Clocks Enable"] 8357 }
12184 pub fn set_sai3en(&mut self, val: super::vals::Apb2enrTim1en) { 8358 #[doc = "RCC AHB2 Clock Register"]
12185 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 8359 #[repr(transparent)]
8360 #[derive(Copy, Clone, Eq, PartialEq)]
8361 pub struct Ahb2enr(pub u32);
8362 impl Ahb2enr {
8363 #[doc = "DCMI peripheral clock"]
8364 pub const fn dcmien(&self) -> super::vals::Ahb2enrDcmien {
8365 let val = (self.0 >> 0usize) & 0x01;
8366 super::vals::Ahb2enrDcmien(val as u8)
12186 } 8367 }
12187 #[doc = "DFSDM1 Peripheral Clocks Enable"] 8368 #[doc = "DCMI peripheral clock"]
12188 pub const fn dfsdm1en(&self) -> super::vals::Apb2enrTim1en { 8369 pub fn set_dcmien(&mut self, val: super::vals::Ahb2enrDcmien) {
12189 let val = (self.0 >> 28usize) & 0x01; 8370 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
12190 super::vals::Apb2enrTim1en(val as u8)
12191 } 8371 }
12192 #[doc = "DFSDM1 Peripheral Clocks Enable"] 8372 #[doc = "CRYPT peripheral clock enable"]
12193 pub fn set_dfsdm1en(&mut self, val: super::vals::Apb2enrTim1en) { 8373 pub const fn crypten(&self) -> super::vals::Ahb2enrDcmien {
12194 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 8374 let val = (self.0 >> 4usize) & 0x01;
8375 super::vals::Ahb2enrDcmien(val as u8)
12195 } 8376 }
12196 #[doc = "HRTIM peripheral clock enable"] 8377 #[doc = "CRYPT peripheral clock enable"]
12197 pub const fn hrtimen(&self) -> super::vals::Apb2enrTim1en { 8378 pub fn set_crypten(&mut self, val: super::vals::Ahb2enrDcmien) {
8379 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
8380 }
8381 #[doc = "HASH peripheral clock enable"]
8382 pub const fn hashen(&self) -> super::vals::Ahb2enrDcmien {
8383 let val = (self.0 >> 5usize) & 0x01;
8384 super::vals::Ahb2enrDcmien(val as u8)
8385 }
8386 #[doc = "HASH peripheral clock enable"]
8387 pub fn set_hashen(&mut self, val: super::vals::Ahb2enrDcmien) {
8388 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
8389 }
8390 #[doc = "RNG peripheral clocks enable"]
8391 pub const fn rngen(&self) -> super::vals::Ahb2enrDcmien {
8392 let val = (self.0 >> 6usize) & 0x01;
8393 super::vals::Ahb2enrDcmien(val as u8)
8394 }
8395 #[doc = "RNG peripheral clocks enable"]
8396 pub fn set_rngen(&mut self, val: super::vals::Ahb2enrDcmien) {
8397 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
8398 }
8399 #[doc = "SDMMC2 and SDMMC2 delay clock enable"]
8400 pub const fn sdmmc2en(&self) -> super::vals::Ahb2enrDcmien {
8401 let val = (self.0 >> 9usize) & 0x01;
8402 super::vals::Ahb2enrDcmien(val as u8)
8403 }
8404 #[doc = "SDMMC2 and SDMMC2 delay clock enable"]
8405 pub fn set_sdmmc2en(&mut self, val: super::vals::Ahb2enrDcmien) {
8406 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
8407 }
8408 #[doc = "SRAM1 block enable"]
8409 pub const fn sram1en(&self) -> super::vals::Ahb2enrDcmien {
12198 let val = (self.0 >> 29usize) & 0x01; 8410 let val = (self.0 >> 29usize) & 0x01;
12199 super::vals::Apb2enrTim1en(val as u8) 8411 super::vals::Ahb2enrDcmien(val as u8)
12200 } 8412 }
12201 #[doc = "HRTIM peripheral clock enable"] 8413 #[doc = "SRAM1 block enable"]
12202 pub fn set_hrtimen(&mut self, val: super::vals::Apb2enrTim1en) { 8414 pub fn set_sram1en(&mut self, val: super::vals::Ahb2enrDcmien) {
12203 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 8415 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
12204 } 8416 }
8417 #[doc = "SRAM2 block enable"]
8418 pub const fn sram2en(&self) -> super::vals::Ahb2enrDcmien {
8419 let val = (self.0 >> 30usize) & 0x01;
8420 super::vals::Ahb2enrDcmien(val as u8)
8421 }
8422 #[doc = "SRAM2 block enable"]
8423 pub fn set_sram2en(&mut self, val: super::vals::Ahb2enrDcmien) {
8424 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
8425 }
8426 #[doc = "SRAM3 block enable"]
8427 pub const fn sram3en(&self) -> super::vals::Ahb2enrDcmien {
8428 let val = (self.0 >> 31usize) & 0x01;
8429 super::vals::Ahb2enrDcmien(val as u8)
8430 }
8431 #[doc = "SRAM3 block enable"]
8432 pub fn set_sram3en(&mut self, val: super::vals::Ahb2enrDcmien) {
8433 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
8434 }
12205 } 8435 }
12206 impl Default for Apb2enr { 8436 impl Default for Ahb2enr {
12207 fn default() -> Apb2enr { 8437 fn default() -> Ahb2enr {
12208 Apb2enr(0) 8438 Ahb2enr(0)
12209 } 8439 }
12210 } 8440 }
12211 #[doc = "RCC Domain 3 Clock Configuration Register"] 8441 #[doc = "RCC APB3 Sleep Clock Register"]
12212 #[repr(transparent)] 8442 #[repr(transparent)]
12213 #[derive(Copy, Clone, Eq, PartialEq)] 8443 #[derive(Copy, Clone, Eq, PartialEq)]
12214 pub struct D3cfgr(pub u32); 8444 pub struct C1Apb3lpenr(pub u32);
12215 impl D3cfgr { 8445 impl C1Apb3lpenr {
12216 #[doc = "D3 domain APB4 prescaler"] 8446 #[doc = "LTDC peripheral clock enable during CSleep mode"]
12217 pub const fn d3ppre(&self) -> super::vals::D3ppre { 8447 pub const fn ltdclpen(&self) -> super::vals::C1Apb3lpenrLtdclpen {
12218 let val = (self.0 >> 4usize) & 0x07; 8448 let val = (self.0 >> 3usize) & 0x01;
12219 super::vals::D3ppre(val as u8) 8449 super::vals::C1Apb3lpenrLtdclpen(val as u8)
12220 } 8450 }
12221 #[doc = "D3 domain APB4 prescaler"] 8451 #[doc = "LTDC peripheral clock enable during CSleep mode"]
12222 pub fn set_d3ppre(&mut self, val: super::vals::D3ppre) { 8452 pub fn set_ltdclpen(&mut self, val: super::vals::C1Apb3lpenrLtdclpen) {
12223 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 8453 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
8454 }
8455 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
8456 pub const fn wwdg1lpen(&self) -> super::vals::C1Apb3lpenrLtdclpen {
8457 let val = (self.0 >> 6usize) & 0x01;
8458 super::vals::C1Apb3lpenrLtdclpen(val as u8)
8459 }
8460 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
8461 pub fn set_wwdg1lpen(&mut self, val: super::vals::C1Apb3lpenrLtdclpen) {
8462 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
12224 } 8463 }
12225 } 8464 }
12226 impl Default for D3cfgr { 8465 impl Default for C1Apb3lpenr {
12227 fn default() -> D3cfgr { 8466 fn default() -> C1Apb3lpenr {
12228 D3cfgr(0) 8467 C1Apb3lpenr(0)
12229 } 8468 }
12230 } 8469 }
12231 #[doc = "RCC PLLs Configuration Register"] 8470 #[doc = "RCC AHB2 Sleep Clock Register"]
12232 #[repr(transparent)] 8471 #[repr(transparent)]
12233 #[derive(Copy, Clone, Eq, PartialEq)] 8472 #[derive(Copy, Clone, Eq, PartialEq)]
12234 pub struct Pllcfgr(pub u32); 8473 pub struct C1Ahb2lpenr(pub u32);
12235 impl Pllcfgr { 8474 impl C1Ahb2lpenr {
12236 #[doc = "PLL1 fractional latch enable"] 8475 #[doc = "DCMI peripheral clock enable during csleep mode"]
12237 pub fn pllfracen(&self, n: usize) -> super::vals::Pll1fracen { 8476 pub const fn dcmilpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12238 assert!(n < 3usize); 8477 let val = (self.0 >> 0usize) & 0x01;
12239 let offs = 0usize + n * 4usize; 8478 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12240 let val = (self.0 >> offs) & 0x01;
12241 super::vals::Pll1fracen(val as u8)
12242 } 8479 }
12243 #[doc = "PLL1 fractional latch enable"] 8480 #[doc = "DCMI peripheral clock enable during csleep mode"]
12244 pub fn set_pllfracen(&mut self, n: usize, val: super::vals::Pll1fracen) { 8481 pub fn set_dcmilpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12245 assert!(n < 3usize); 8482 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
12246 let offs = 0usize + n * 4usize;
12247 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12248 } 8483 }
12249 #[doc = "PLL1 VCO selection"] 8484 #[doc = "CRYPT peripheral clock enable during CSleep mode"]
12250 pub fn pllvcosel(&self, n: usize) -> super::vals::Pll1vcosel { 8485 pub const fn cryptlpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12251 assert!(n < 3usize); 8486 let val = (self.0 >> 4usize) & 0x01;
12252 let offs = 1usize + n * 4usize; 8487 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12253 let val = (self.0 >> offs) & 0x01;
12254 super::vals::Pll1vcosel(val as u8)
12255 } 8488 }
12256 #[doc = "PLL1 VCO selection"] 8489 #[doc = "CRYPT peripheral clock enable during CSleep mode"]
12257 pub fn set_pllvcosel(&mut self, n: usize, val: super::vals::Pll1vcosel) { 8490 pub fn set_cryptlpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12258 assert!(n < 3usize); 8491 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
12259 let offs = 1usize + n * 4usize;
12260 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12261 } 8492 }
12262 #[doc = "PLL1 input frequency range"] 8493 #[doc = "HASH peripheral clock enable during CSleep mode"]
12263 pub fn pllrge(&self, n: usize) -> super::vals::Pll1rge { 8494 pub const fn hashlpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12264 assert!(n < 3usize); 8495 let val = (self.0 >> 5usize) & 0x01;
12265 let offs = 2usize + n * 4usize; 8496 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12266 let val = (self.0 >> offs) & 0x03;
12267 super::vals::Pll1rge(val as u8)
12268 } 8497 }
12269 #[doc = "PLL1 input frequency range"] 8498 #[doc = "HASH peripheral clock enable during CSleep mode"]
12270 pub fn set_pllrge(&mut self, n: usize, val: super::vals::Pll1rge) { 8499 pub fn set_hashlpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12271 assert!(n < 3usize); 8500 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
12272 let offs = 2usize + n * 4usize;
12273 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
12274 } 8501 }
12275 #[doc = "PLL1 DIVP divider output enable"] 8502 #[doc = "RNG peripheral clock enable during CSleep mode"]
12276 pub fn divpen(&self, n: usize) -> super::vals::Divp1en { 8503 pub const fn rnglpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12277 assert!(n < 3usize); 8504 let val = (self.0 >> 6usize) & 0x01;
12278 let offs = 16usize + n * 3usize; 8505 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12279 let val = (self.0 >> offs) & 0x01;
12280 super::vals::Divp1en(val as u8)
12281 } 8506 }
12282 #[doc = "PLL1 DIVP divider output enable"] 8507 #[doc = "RNG peripheral clock enable during CSleep mode"]
12283 pub fn set_divpen(&mut self, n: usize, val: super::vals::Divp1en) { 8508 pub fn set_rnglpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12284 assert!(n < 3usize); 8509 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
12285 let offs = 16usize + n * 3usize;
12286 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12287 } 8510 }
12288 #[doc = "PLL1 DIVQ divider output enable"] 8511 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"]
12289 pub fn divqen(&self, n: usize) -> super::vals::Divp1en { 8512 pub const fn sdmmc2lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12290 assert!(n < 3usize); 8513 let val = (self.0 >> 9usize) & 0x01;
12291 let offs = 17usize + n * 3usize; 8514 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12292 let val = (self.0 >> offs) & 0x01;
12293 super::vals::Divp1en(val as u8)
12294 } 8515 }
12295 #[doc = "PLL1 DIVQ divider output enable"] 8516 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"]
12296 pub fn set_divqen(&mut self, n: usize, val: super::vals::Divp1en) { 8517 pub fn set_sdmmc2lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12297 assert!(n < 3usize); 8518 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
12298 let offs = 17usize + n * 3usize;
12299 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12300 } 8519 }
12301 #[doc = "PLL1 DIVR divider output enable"] 8520 #[doc = "SRAM1 Clock Enable During CSleep Mode"]
12302 pub fn divren(&self, n: usize) -> super::vals::Divp1en { 8521 pub const fn sram1lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12303 assert!(n < 3usize); 8522 let val = (self.0 >> 29usize) & 0x01;
12304 let offs = 18usize + n * 3usize; 8523 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12305 let val = (self.0 >> offs) & 0x01;
12306 super::vals::Divp1en(val as u8)
12307 } 8524 }
12308 #[doc = "PLL1 DIVR divider output enable"] 8525 #[doc = "SRAM1 Clock Enable During CSleep Mode"]
12309 pub fn set_divren(&mut self, n: usize, val: super::vals::Divp1en) { 8526 pub fn set_sram1lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12310 assert!(n < 3usize); 8527 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
12311 let offs = 18usize + n * 3usize;
12312 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12313 } 8528 }
12314 } 8529 #[doc = "SRAM2 Clock Enable During CSleep Mode"]
12315 impl Default for Pllcfgr { 8530 pub const fn sram2lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12316 fn default() -> Pllcfgr { 8531 let val = (self.0 >> 30usize) & 0x01;
12317 Pllcfgr(0) 8532 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12318 } 8533 }
12319 } 8534 #[doc = "SRAM2 Clock Enable During CSleep Mode"]
12320 #[doc = "RCC PLL3 Dividers Configuration Register"] 8535 pub fn set_sram2lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12321 #[repr(transparent)] 8536 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
12322 #[derive(Copy, Clone, Eq, PartialEq)]
12323 pub struct Pll3divr(pub u32);
12324 impl Pll3divr {
12325 #[doc = "Multiplication factor for PLL1 VCO"]
12326 pub const fn divn3(&self) -> u16 {
12327 let val = (self.0 >> 0usize) & 0x01ff;
12328 val as u16
12329 } 8537 }
12330 #[doc = "Multiplication factor for PLL1 VCO"] 8538 #[doc = "SRAM3 Clock Enable During CSleep Mode"]
12331 pub fn set_divn3(&mut self, val: u16) { 8539 pub const fn sram3lpen(&self) -> super::vals::C1Ahb2lpenrDcmilpen {
12332 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); 8540 let val = (self.0 >> 31usize) & 0x01;
8541 super::vals::C1Ahb2lpenrDcmilpen(val as u8)
12333 } 8542 }
12334 #[doc = "PLL DIVP division factor"] 8543 #[doc = "SRAM3 Clock Enable During CSleep Mode"]
12335 pub const fn divp3(&self) -> u8 { 8544 pub fn set_sram3lpen(&mut self, val: super::vals::C1Ahb2lpenrDcmilpen) {
12336 let val = (self.0 >> 9usize) & 0x7f; 8545 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
12337 val as u8
12338 } 8546 }
12339 #[doc = "PLL DIVP division factor"] 8547 }
12340 pub fn set_divp3(&mut self, val: u8) { 8548 impl Default for C1Ahb2lpenr {
12341 self.0 = (self.0 & !(0x7f << 9usize)) | (((val as u32) & 0x7f) << 9usize); 8549 fn default() -> C1Ahb2lpenr {
8550 C1Ahb2lpenr(0)
12342 } 8551 }
12343 #[doc = "PLL DIVQ division factor"] 8552 }
12344 pub const fn divq3(&self) -> u8 { 8553 #[doc = "RCC PLLs Clock Source Selection Register"]
12345 let val = (self.0 >> 16usize) & 0x7f; 8554 #[repr(transparent)]
12346 val as u8 8555 #[derive(Copy, Clone, Eq, PartialEq)]
8556 pub struct Pllckselr(pub u32);
8557 impl Pllckselr {
8558 #[doc = "DIVMx and PLLs clock source selection"]
8559 pub const fn pllsrc(&self) -> super::vals::Pllsrc {
8560 let val = (self.0 >> 0usize) & 0x03;
8561 super::vals::Pllsrc(val as u8)
12347 } 8562 }
12348 #[doc = "PLL DIVQ division factor"] 8563 #[doc = "DIVMx and PLLs clock source selection"]
12349 pub fn set_divq3(&mut self, val: u8) { 8564 pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) {
12350 self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize); 8565 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
12351 } 8566 }
12352 #[doc = "PLL DIVR division factor"] 8567 #[doc = "Prescaler for PLL1"]
12353 pub const fn divr3(&self) -> u8 { 8568 pub fn divm(&self, n: usize) -> u8 {
12354 let val = (self.0 >> 24usize) & 0x7f; 8569 assert!(n < 3usize);
8570 let offs = 4usize + n * 8usize;
8571 let val = (self.0 >> offs) & 0x3f;
12355 val as u8 8572 val as u8
12356 } 8573 }
12357 #[doc = "PLL DIVR division factor"] 8574 #[doc = "Prescaler for PLL1"]
12358 pub fn set_divr3(&mut self, val: u8) { 8575 pub fn set_divm(&mut self, n: usize, val: u8) {
12359 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize); 8576 assert!(n < 3usize);
8577 let offs = 4usize + n * 8usize;
8578 self.0 = (self.0 & !(0x3f << offs)) | (((val as u32) & 0x3f) << offs);
12360 } 8579 }
12361 } 8580 }
12362 impl Default for Pll3divr { 8581 impl Default for Pllckselr {
12363 fn default() -> Pll3divr { 8582 fn default() -> Pllckselr {
12364 Pll3divr(0) 8583 Pllckselr(0)
12365 } 8584 }
12366 } 8585 }
12367 #[doc = "RCC AHB4 Clock Register"] 8586 #[doc = "RCC AHB3 Sleep Clock Register"]
12368 #[repr(transparent)] 8587 #[repr(transparent)]
12369 #[derive(Copy, Clone, Eq, PartialEq)] 8588 #[derive(Copy, Clone, Eq, PartialEq)]
12370 pub struct Ahb4enr(pub u32); 8589 pub struct C1Ahb3lpenr(pub u32);
12371 impl Ahb4enr { 8590 impl C1Ahb3lpenr {
12372 #[doc = "0GPIO peripheral clock enable"] 8591 #[doc = "MDMA Clock Enable During CSleep Mode"]
12373 pub const fn gpioaen(&self) -> super::vals::Ahb4enrGpioaen { 8592 pub const fn mdmalpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12374 let val = (self.0 >> 0usize) & 0x01; 8593 let val = (self.0 >> 0usize) & 0x01;
12375 super::vals::Ahb4enrGpioaen(val as u8) 8594 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12376 } 8595 }
12377 #[doc = "0GPIO peripheral clock enable"] 8596 #[doc = "MDMA Clock Enable During CSleep Mode"]
12378 pub fn set_gpioaen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8597 pub fn set_mdmalpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12379 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 8598 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
12380 } 8599 }
12381 #[doc = "0GPIO peripheral clock enable"] 8600 #[doc = "DMA2D Clock Enable During CSleep Mode"]
12382 pub const fn gpioben(&self) -> super::vals::Ahb4enrGpioaen { 8601 pub const fn dma2dlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12383 let val = (self.0 >> 1usize) & 0x01;
12384 super::vals::Ahb4enrGpioaen(val as u8)
12385 }
12386 #[doc = "0GPIO peripheral clock enable"]
12387 pub fn set_gpioben(&mut self, val: super::vals::Ahb4enrGpioaen) {
12388 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
12389 }
12390 #[doc = "0GPIO peripheral clock enable"]
12391 pub const fn gpiocen(&self) -> super::vals::Ahb4enrGpioaen {
12392 let val = (self.0 >> 2usize) & 0x01;
12393 super::vals::Ahb4enrGpioaen(val as u8)
12394 }
12395 #[doc = "0GPIO peripheral clock enable"]
12396 pub fn set_gpiocen(&mut self, val: super::vals::Ahb4enrGpioaen) {
12397 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
12398 }
12399 #[doc = "0GPIO peripheral clock enable"]
12400 pub const fn gpioden(&self) -> super::vals::Ahb4enrGpioaen {
12401 let val = (self.0 >> 3usize) & 0x01;
12402 super::vals::Ahb4enrGpioaen(val as u8)
12403 }
12404 #[doc = "0GPIO peripheral clock enable"]
12405 pub fn set_gpioden(&mut self, val: super::vals::Ahb4enrGpioaen) {
12406 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
12407 }
12408 #[doc = "0GPIO peripheral clock enable"]
12409 pub const fn gpioeen(&self) -> super::vals::Ahb4enrGpioaen {
12410 let val = (self.0 >> 4usize) & 0x01; 8602 let val = (self.0 >> 4usize) & 0x01;
12411 super::vals::Ahb4enrGpioaen(val as u8) 8603 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12412 } 8604 }
12413 #[doc = "0GPIO peripheral clock enable"] 8605 #[doc = "DMA2D Clock Enable During CSleep Mode"]
12414 pub fn set_gpioeen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8606 pub fn set_dma2dlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12415 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 8607 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
12416 } 8608 }
12417 #[doc = "0GPIO peripheral clock enable"] 8609 #[doc = "JPGDEC Clock Enable During CSleep Mode"]
12418 pub const fn gpiofen(&self) -> super::vals::Ahb4enrGpioaen { 8610 pub const fn jpgdeclpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12419 let val = (self.0 >> 5usize) & 0x01; 8611 let val = (self.0 >> 5usize) & 0x01;
12420 super::vals::Ahb4enrGpioaen(val as u8) 8612 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12421 } 8613 }
12422 #[doc = "0GPIO peripheral clock enable"] 8614 #[doc = "JPGDEC Clock Enable During CSleep Mode"]
12423 pub fn set_gpiofen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8615 pub fn set_jpgdeclpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12424 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 8616 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
12425 } 8617 }
12426 #[doc = "0GPIO peripheral clock enable"] 8618 #[doc = "Flash interface clock enable during csleep mode"]
12427 pub const fn gpiogen(&self) -> super::vals::Ahb4enrGpioaen { 8619 pub const fn flashpren(&self) -> bool {
12428 let val = (self.0 >> 6usize) & 0x01;
12429 super::vals::Ahb4enrGpioaen(val as u8)
12430 }
12431 #[doc = "0GPIO peripheral clock enable"]
12432 pub fn set_gpiogen(&mut self, val: super::vals::Ahb4enrGpioaen) {
12433 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
12434 }
12435 #[doc = "0GPIO peripheral clock enable"]
12436 pub const fn gpiohen(&self) -> super::vals::Ahb4enrGpioaen {
12437 let val = (self.0 >> 7usize) & 0x01;
12438 super::vals::Ahb4enrGpioaen(val as u8)
12439 }
12440 #[doc = "0GPIO peripheral clock enable"]
12441 pub fn set_gpiohen(&mut self, val: super::vals::Ahb4enrGpioaen) {
12442 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
12443 }
12444 #[doc = "0GPIO peripheral clock enable"]
12445 pub const fn gpioien(&self) -> super::vals::Ahb4enrGpioaen {
12446 let val = (self.0 >> 8usize) & 0x01; 8620 let val = (self.0 >> 8usize) & 0x01;
12447 super::vals::Ahb4enrGpioaen(val as u8) 8621 val != 0
12448 } 8622 }
12449 #[doc = "0GPIO peripheral clock enable"] 8623 #[doc = "Flash interface clock enable during csleep mode"]
12450 pub fn set_gpioien(&mut self, val: super::vals::Ahb4enrGpioaen) { 8624 pub fn set_flashpren(&mut self, val: bool) {
12451 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 8625 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
12452 } 8626 }
12453 #[doc = "0GPIO peripheral clock enable"] 8627 #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"]
12454 pub const fn gpiojen(&self) -> super::vals::Ahb4enrGpioaen { 8628 pub const fn fmclpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12455 let val = (self.0 >> 9usize) & 0x01; 8629 let val = (self.0 >> 12usize) & 0x01;
12456 super::vals::Ahb4enrGpioaen(val as u8) 8630 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12457 } 8631 }
12458 #[doc = "0GPIO peripheral clock enable"] 8632 #[doc = "FMC Peripheral Clocks Enable During CSleep Mode"]
12459 pub fn set_gpiojen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8633 pub fn set_fmclpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12460 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 8634 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
12461 } 8635 }
12462 #[doc = "0GPIO peripheral clock enable"] 8636 #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"]
12463 pub const fn gpioken(&self) -> super::vals::Ahb4enrGpioaen { 8637 pub const fn qspilpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12464 let val = (self.0 >> 10usize) & 0x01; 8638 let val = (self.0 >> 14usize) & 0x01;
12465 super::vals::Ahb4enrGpioaen(val as u8) 8639 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12466 } 8640 }
12467 #[doc = "0GPIO peripheral clock enable"] 8641 #[doc = "QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode"]
12468 pub fn set_gpioken(&mut self, val: super::vals::Ahb4enrGpioaen) { 8642 pub fn set_qspilpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12469 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 8643 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
12470 } 8644 }
12471 #[doc = "CRC peripheral clock enable"] 8645 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"]
12472 pub const fn crcen(&self) -> super::vals::Ahb4enrGpioaen { 8646 pub const fn sdmmc1lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12473 let val = (self.0 >> 19usize) & 0x01; 8647 let val = (self.0 >> 16usize) & 0x01;
12474 super::vals::Ahb4enrGpioaen(val as u8) 8648 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12475 } 8649 }
12476 #[doc = "CRC peripheral clock enable"] 8650 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable During CSleep Mode"]
12477 pub fn set_crcen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8651 pub fn set_sdmmc1lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12478 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 8652 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
12479 } 8653 }
12480 #[doc = "BDMA and DMAMUX2 Clock Enable"] 8654 #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"]
12481 pub const fn bdmaen(&self) -> super::vals::Ahb4enrGpioaen { 8655 pub const fn d1dtcm1lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12482 let val = (self.0 >> 21usize) & 0x01; 8656 let val = (self.0 >> 28usize) & 0x01;
12483 super::vals::Ahb4enrGpioaen(val as u8) 8657 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12484 } 8658 }
12485 #[doc = "BDMA and DMAMUX2 Clock Enable"] 8659 #[doc = "D1DTCM1 Block Clock Enable During CSleep mode"]
12486 pub fn set_bdmaen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8660 pub fn set_d1dtcm1lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12487 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 8661 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
12488 } 8662 }
12489 #[doc = "ADC3 Peripheral Clocks Enable"] 8663 #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"]
12490 pub const fn adc3en(&self) -> super::vals::Ahb4enrGpioaen { 8664 pub const fn dtcm2lpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12491 let val = (self.0 >> 24usize) & 0x01; 8665 let val = (self.0 >> 29usize) & 0x01;
12492 super::vals::Ahb4enrGpioaen(val as u8) 8666 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12493 } 8667 }
12494 #[doc = "ADC3 Peripheral Clocks Enable"] 8668 #[doc = "D1 DTCM2 Block Clock Enable During CSleep mode"]
12495 pub fn set_adc3en(&mut self, val: super::vals::Ahb4enrGpioaen) { 8669 pub fn set_dtcm2lpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12496 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 8670 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
12497 } 8671 }
12498 #[doc = "HSEM peripheral clock enable"] 8672 #[doc = "D1ITCM Block Clock Enable During CSleep mode"]
12499 pub const fn hsemen(&self) -> super::vals::Ahb4enrGpioaen { 8673 pub const fn itcmlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12500 let val = (self.0 >> 25usize) & 0x01; 8674 let val = (self.0 >> 30usize) & 0x01;
12501 super::vals::Ahb4enrGpioaen(val as u8) 8675 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12502 } 8676 }
12503 #[doc = "HSEM peripheral clock enable"] 8677 #[doc = "D1ITCM Block Clock Enable During CSleep mode"]
12504 pub fn set_hsemen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8678 pub fn set_itcmlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12505 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 8679 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
12506 } 8680 }
12507 #[doc = "Backup RAM Clock Enable"] 8681 #[doc = "AXISRAM Block Clock Enable During CSleep mode"]
12508 pub const fn bkpramen(&self) -> super::vals::Ahb4enrGpioaen { 8682 pub const fn axisramlpen(&self) -> super::vals::C1Ahb3lpenrMdmalpen {
12509 let val = (self.0 >> 28usize) & 0x01; 8683 let val = (self.0 >> 31usize) & 0x01;
12510 super::vals::Ahb4enrGpioaen(val as u8) 8684 super::vals::C1Ahb3lpenrMdmalpen(val as u8)
12511 } 8685 }
12512 #[doc = "Backup RAM Clock Enable"] 8686 #[doc = "AXISRAM Block Clock Enable During CSleep mode"]
12513 pub fn set_bkpramen(&mut self, val: super::vals::Ahb4enrGpioaen) { 8687 pub fn set_axisramlpen(&mut self, val: super::vals::C1Ahb3lpenrMdmalpen) {
12514 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 8688 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
12515 } 8689 }
12516 } 8690 }
12517 impl Default for Ahb4enr { 8691 impl Default for C1Ahb3lpenr {
12518 fn default() -> Ahb4enr { 8692 fn default() -> C1Ahb3lpenr {
12519 Ahb4enr(0) 8693 C1Ahb3lpenr(0)
12520 } 8694 }
12521 } 8695 }
12522 #[doc = "RCC PLL2 Fractional Divider Register"] 8696 #[doc = "RCC AHB1 Clock Register"]
12523 #[repr(transparent)] 8697 #[repr(transparent)]
12524 #[derive(Copy, Clone, Eq, PartialEq)] 8698 #[derive(Copy, Clone, Eq, PartialEq)]
12525 pub struct Pll2fracr(pub u32); 8699 pub struct Ahb1enr(pub u32);
12526 impl Pll2fracr { 8700 impl Ahb1enr {
12527 #[doc = "Fractional part of the multiplication factor for PLL VCO"] 8701 #[doc = "DMA1 Clock Enable"]
12528 pub const fn fracn2(&self) -> u16 { 8702 pub const fn dma1en(&self) -> super::vals::Ahb1enrDma1en {
12529 let val = (self.0 >> 3usize) & 0x1fff; 8703 let val = (self.0 >> 0usize) & 0x01;
12530 val as u16 8704 super::vals::Ahb1enrDma1en(val as u8)
12531 }
12532 #[doc = "Fractional part of the multiplication factor for PLL VCO"]
12533 pub fn set_fracn2(&mut self, val: u16) {
12534 self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize);
12535 } 8705 }
12536 } 8706 #[doc = "DMA1 Clock Enable"]
12537 impl Default for Pll2fracr { 8707 pub fn set_dma1en(&mut self, val: super::vals::Ahb1enrDma1en) {
12538 fn default() -> Pll2fracr { 8708 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
12539 Pll2fracr(0)
12540 } 8709 }
12541 } 8710 #[doc = "DMA2 Clock Enable"]
12542 #[doc = "RCC APB4 Peripheral Reset Register"] 8711 pub const fn dma2en(&self) -> super::vals::Ahb1enrDma1en {
12543 #[repr(transparent)]
12544 #[derive(Copy, Clone, Eq, PartialEq)]
12545 pub struct Apb4rstr(pub u32);
12546 impl Apb4rstr {
12547 #[doc = "SYSCFG block reset"]
12548 pub const fn syscfgrst(&self) -> super::vals::Syscfgrst {
12549 let val = (self.0 >> 1usize) & 0x01; 8712 let val = (self.0 >> 1usize) & 0x01;
12550 super::vals::Syscfgrst(val as u8) 8713 super::vals::Ahb1enrDma1en(val as u8)
12551 } 8714 }
12552 #[doc = "SYSCFG block reset"] 8715 #[doc = "DMA2 Clock Enable"]
12553 pub fn set_syscfgrst(&mut self, val: super::vals::Syscfgrst) { 8716 pub fn set_dma2en(&mut self, val: super::vals::Ahb1enrDma1en) {
12554 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 8717 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
12555 } 8718 }
12556 #[doc = "LPUART1 block reset"] 8719 #[doc = "ADC1/2 Peripheral Clocks Enable"]
12557 pub const fn lpuart1rst(&self) -> super::vals::Syscfgrst { 8720 pub const fn adc12en(&self) -> super::vals::Ahb1enrDma1en {
12558 let val = (self.0 >> 3usize) & 0x01;
12559 super::vals::Syscfgrst(val as u8)
12560 }
12561 #[doc = "LPUART1 block reset"]
12562 pub fn set_lpuart1rst(&mut self, val: super::vals::Syscfgrst) {
12563 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
12564 }
12565 #[doc = "SPI6 block reset"]
12566 pub const fn spi6rst(&self) -> super::vals::Syscfgrst {
12567 let val = (self.0 >> 5usize) & 0x01; 8721 let val = (self.0 >> 5usize) & 0x01;
12568 super::vals::Syscfgrst(val as u8) 8722 super::vals::Ahb1enrDma1en(val as u8)
12569 } 8723 }
12570 #[doc = "SPI6 block reset"] 8724 #[doc = "ADC1/2 Peripheral Clocks Enable"]
12571 pub fn set_spi6rst(&mut self, val: super::vals::Syscfgrst) { 8725 pub fn set_adc12en(&mut self, val: super::vals::Ahb1enrDma1en) {
12572 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 8726 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
12573 } 8727 }
12574 #[doc = "I2C4 block reset"] 8728 #[doc = "Ethernet MAC bus interface Clock Enable"]
12575 pub const fn i2c4rst(&self) -> super::vals::Syscfgrst { 8729 pub const fn eth1macen(&self) -> super::vals::Ahb1enrDma1en {
12576 let val = (self.0 >> 7usize) & 0x01; 8730 let val = (self.0 >> 15usize) & 0x01;
12577 super::vals::Syscfgrst(val as u8) 8731 super::vals::Ahb1enrDma1en(val as u8)
12578 } 8732 }
12579 #[doc = "I2C4 block reset"] 8733 #[doc = "Ethernet MAC bus interface Clock Enable"]
12580 pub fn set_i2c4rst(&mut self, val: super::vals::Syscfgrst) { 8734 pub fn set_eth1macen(&mut self, val: super::vals::Ahb1enrDma1en) {
12581 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 8735 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
12582 } 8736 }
12583 #[doc = "LPTIM2 block reset"] 8737 #[doc = "Ethernet Transmission Clock Enable"]
12584 pub const fn lptim2rst(&self) -> super::vals::Syscfgrst { 8738 pub const fn eth1txen(&self) -> super::vals::Ahb1enrDma1en {
12585 let val = (self.0 >> 9usize) & 0x01; 8739 let val = (self.0 >> 16usize) & 0x01;
12586 super::vals::Syscfgrst(val as u8) 8740 super::vals::Ahb1enrDma1en(val as u8)
12587 } 8741 }
12588 #[doc = "LPTIM2 block reset"] 8742 #[doc = "Ethernet Transmission Clock Enable"]
12589 pub fn set_lptim2rst(&mut self, val: super::vals::Syscfgrst) { 8743 pub fn set_eth1txen(&mut self, val: super::vals::Ahb1enrDma1en) {
12590 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 8744 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
12591 } 8745 }
12592 #[doc = "LPTIM3 block reset"] 8746 #[doc = "Ethernet Reception Clock Enable"]
12593 pub const fn lptim3rst(&self) -> super::vals::Syscfgrst { 8747 pub const fn eth1rxen(&self) -> super::vals::Ahb1enrDma1en {
12594 let val = (self.0 >> 10usize) & 0x01; 8748 let val = (self.0 >> 17usize) & 0x01;
12595 super::vals::Syscfgrst(val as u8) 8749 super::vals::Ahb1enrDma1en(val as u8)
12596 } 8750 }
12597 #[doc = "LPTIM3 block reset"] 8751 #[doc = "Ethernet Reception Clock Enable"]
12598 pub fn set_lptim3rst(&mut self, val: super::vals::Syscfgrst) { 8752 pub fn set_eth1rxen(&mut self, val: super::vals::Ahb1enrDma1en) {
12599 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 8753 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
12600 } 8754 }
12601 #[doc = "LPTIM4 block reset"] 8755 #[doc = "Enable USB_PHY2 clocks"]
12602 pub const fn lptim4rst(&self) -> super::vals::Syscfgrst { 8756 pub const fn usb2otghsulpien(&self) -> super::vals::Ahb1enrDma1en {
12603 let val = (self.0 >> 11usize) & 0x01; 8757 let val = (self.0 >> 18usize) & 0x01;
12604 super::vals::Syscfgrst(val as u8) 8758 super::vals::Ahb1enrDma1en(val as u8)
12605 } 8759 }
12606 #[doc = "LPTIM4 block reset"] 8760 #[doc = "Enable USB_PHY2 clocks"]
12607 pub fn set_lptim4rst(&mut self, val: super::vals::Syscfgrst) { 8761 pub fn set_usb2otghsulpien(&mut self, val: super::vals::Ahb1enrDma1en) {
12608 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 8762 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
12609 } 8763 }
12610 #[doc = "LPTIM5 block reset"] 8764 #[doc = "USB1OTG Peripheral Clocks Enable"]
12611 pub const fn lptim5rst(&self) -> super::vals::Syscfgrst { 8765 pub const fn usb1otgen(&self) -> super::vals::Ahb1enrDma1en {
12612 let val = (self.0 >> 12usize) & 0x01; 8766 let val = (self.0 >> 25usize) & 0x01;
12613 super::vals::Syscfgrst(val as u8) 8767 super::vals::Ahb1enrDma1en(val as u8)
12614 } 8768 }
12615 #[doc = "LPTIM5 block reset"] 8769 #[doc = "USB1OTG Peripheral Clocks Enable"]
12616 pub fn set_lptim5rst(&mut self, val: super::vals::Syscfgrst) { 8770 pub fn set_usb1otgen(&mut self, val: super::vals::Ahb1enrDma1en) {
12617 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 8771 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
12618 } 8772 }
12619 #[doc = "COMP12 Blocks Reset"] 8773 #[doc = "USB_PHY1 Clocks Enable"]
12620 pub const fn comp12rst(&self) -> super::vals::Syscfgrst { 8774 pub const fn usb1ulpien(&self) -> super::vals::Ahb1enrDma1en {
12621 let val = (self.0 >> 14usize) & 0x01; 8775 let val = (self.0 >> 26usize) & 0x01;
12622 super::vals::Syscfgrst(val as u8) 8776 super::vals::Ahb1enrDma1en(val as u8)
12623 } 8777 }
12624 #[doc = "COMP12 Blocks Reset"] 8778 #[doc = "USB_PHY1 Clocks Enable"]
12625 pub fn set_comp12rst(&mut self, val: super::vals::Syscfgrst) { 8779 pub fn set_usb1ulpien(&mut self, val: super::vals::Ahb1enrDma1en) {
12626 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 8780 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize);
12627 } 8781 }
12628 #[doc = "VREF block reset"] 8782 #[doc = "USB2OTG Peripheral Clocks Enable"]
12629 pub const fn vrefrst(&self) -> super::vals::Syscfgrst { 8783 pub const fn usb2otgen(&self) -> super::vals::Ahb1enrDma1en {
8784 let val = (self.0 >> 27usize) & 0x01;
8785 super::vals::Ahb1enrDma1en(val as u8)
8786 }
8787 #[doc = "USB2OTG Peripheral Clocks Enable"]
8788 pub fn set_usb2otgen(&mut self, val: super::vals::Ahb1enrDma1en) {
8789 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
8790 }
8791 #[doc = "USB_PHY2 Clocks Enable"]
8792 pub const fn usb2ulpien(&self) -> super::vals::Ahb1enrDma1en {
8793 let val = (self.0 >> 28usize) & 0x01;
8794 super::vals::Ahb1enrDma1en(val as u8)
8795 }
8796 #[doc = "USB_PHY2 Clocks Enable"]
8797 pub fn set_usb2ulpien(&mut self, val: super::vals::Ahb1enrDma1en) {
8798 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
8799 }
8800 }
8801 impl Default for Ahb1enr {
8802 fn default() -> Ahb1enr {
8803 Ahb1enr(0)
8804 }
8805 }
8806 #[doc = "RCC AHB1 Peripheral Reset Register"]
8807 #[repr(transparent)]
8808 #[derive(Copy, Clone, Eq, PartialEq)]
8809 pub struct Ahb1rstr(pub u32);
8810 impl Ahb1rstr {
8811 #[doc = "DMA1 block reset"]
8812 pub const fn dma1rst(&self) -> super::vals::Dma1rst {
8813 let val = (self.0 >> 0usize) & 0x01;
8814 super::vals::Dma1rst(val as u8)
8815 }
8816 #[doc = "DMA1 block reset"]
8817 pub fn set_dma1rst(&mut self, val: super::vals::Dma1rst) {
8818 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
8819 }
8820 #[doc = "DMA2 block reset"]
8821 pub const fn dma2rst(&self) -> super::vals::Dma1rst {
8822 let val = (self.0 >> 1usize) & 0x01;
8823 super::vals::Dma1rst(val as u8)
8824 }
8825 #[doc = "DMA2 block reset"]
8826 pub fn set_dma2rst(&mut self, val: super::vals::Dma1rst) {
8827 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
8828 }
8829 #[doc = "ADC1&2 block reset"]
8830 pub const fn adc12rst(&self) -> super::vals::Dma1rst {
8831 let val = (self.0 >> 5usize) & 0x01;
8832 super::vals::Dma1rst(val as u8)
8833 }
8834 #[doc = "ADC1&2 block reset"]
8835 pub fn set_adc12rst(&mut self, val: super::vals::Dma1rst) {
8836 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
8837 }
8838 #[doc = "ETH1MAC block reset"]
8839 pub const fn eth1macrst(&self) -> super::vals::Dma1rst {
12630 let val = (self.0 >> 15usize) & 0x01; 8840 let val = (self.0 >> 15usize) & 0x01;
12631 super::vals::Syscfgrst(val as u8) 8841 super::vals::Dma1rst(val as u8)
12632 } 8842 }
12633 #[doc = "VREF block reset"] 8843 #[doc = "ETH1MAC block reset"]
12634 pub fn set_vrefrst(&mut self, val: super::vals::Syscfgrst) { 8844 pub fn set_eth1macrst(&mut self, val: super::vals::Dma1rst) {
12635 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 8845 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
12636 } 8846 }
12637 #[doc = "SAI4 block reset"] 8847 #[doc = "USB1OTG block reset"]
12638 pub const fn sai4rst(&self) -> super::vals::Syscfgrst { 8848 pub const fn usb1otgrst(&self) -> super::vals::Dma1rst {
12639 let val = (self.0 >> 21usize) & 0x01; 8849 let val = (self.0 >> 25usize) & 0x01;
12640 super::vals::Syscfgrst(val as u8) 8850 super::vals::Dma1rst(val as u8)
12641 } 8851 }
12642 #[doc = "SAI4 block reset"] 8852 #[doc = "USB1OTG block reset"]
12643 pub fn set_sai4rst(&mut self, val: super::vals::Syscfgrst) { 8853 pub fn set_usb1otgrst(&mut self, val: super::vals::Dma1rst) {
12644 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 8854 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
8855 }
8856 #[doc = "USB2OTG block reset"]
8857 pub const fn usb2otgrst(&self) -> super::vals::Dma1rst {
8858 let val = (self.0 >> 27usize) & 0x01;
8859 super::vals::Dma1rst(val as u8)
8860 }
8861 #[doc = "USB2OTG block reset"]
8862 pub fn set_usb2otgrst(&mut self, val: super::vals::Dma1rst) {
8863 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
12645 } 8864 }
12646 } 8865 }
12647 impl Default for Apb4rstr { 8866 impl Default for Ahb1rstr {
12648 fn default() -> Apb4rstr { 8867 fn default() -> Ahb1rstr {
12649 Apb4rstr(0) 8868 Ahb1rstr(0)
12650 } 8869 }
12651 } 8870 }
12652 #[doc = "RCC APB1 Clock Register"] 8871 #[doc = "RCC APB1 Clock Register"]
@@ -12876,840 +9095,1171 @@ pub mod rcc_h7 {
12876 Apb1lenr(0) 9095 Apb1lenr(0)
12877 } 9096 }
12878 } 9097 }
12879 #[doc = "RCC CSI configuration register"] 9098 #[doc = "RCC PLL2 Fractional Divider Register"]
12880 #[repr(transparent)] 9099 #[repr(transparent)]
12881 #[derive(Copy, Clone, Eq, PartialEq)] 9100 #[derive(Copy, Clone, Eq, PartialEq)]
12882 pub struct Csicfgr(pub u32); 9101 pub struct Pll2fracr(pub u32);
12883 impl Csicfgr { 9102 impl Pll2fracr {
12884 #[doc = "CSI clock calibration"] 9103 #[doc = "Fractional part of the multiplication factor for PLL VCO"]
12885 pub const fn csical(&self) -> u16 { 9104 pub const fn fracn2(&self) -> u16 {
12886 let val = (self.0 >> 0usize) & 0x01ff; 9105 let val = (self.0 >> 3usize) & 0x1fff;
12887 val as u16 9106 val as u16
12888 } 9107 }
12889 #[doc = "CSI clock calibration"] 9108 #[doc = "Fractional part of the multiplication factor for PLL VCO"]
12890 pub fn set_csical(&mut self, val: u16) { 9109 pub fn set_fracn2(&mut self, val: u16) {
12891 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); 9110 self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize);
12892 }
12893 #[doc = "CSI clock trimming"]
12894 pub const fn csitrim(&self) -> u8 {
12895 let val = (self.0 >> 24usize) & 0x3f;
12896 val as u8
12897 }
12898 #[doc = "CSI clock trimming"]
12899 pub fn set_csitrim(&mut self, val: u8) {
12900 self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
12901 }
12902 }
12903 impl Default for Csicfgr {
12904 fn default() -> Csicfgr {
12905 Csicfgr(0)
12906 }
12907 }
12908 #[doc = "RCC APB4 Clock Register"]
12909 #[repr(transparent)]
12910 #[derive(Copy, Clone, Eq, PartialEq)]
12911 pub struct Apb4enr(pub u32);
12912 impl Apb4enr {
12913 #[doc = "SYSCFG peripheral clock enable"]
12914 pub const fn syscfgen(&self) -> super::vals::Apb4enrSyscfgen {
12915 let val = (self.0 >> 1usize) & 0x01;
12916 super::vals::Apb4enrSyscfgen(val as u8)
12917 }
12918 #[doc = "SYSCFG peripheral clock enable"]
12919 pub fn set_syscfgen(&mut self, val: super::vals::Apb4enrSyscfgen) {
12920 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
12921 }
12922 #[doc = "LPUART1 Peripheral Clocks Enable"]
12923 pub const fn lpuart1en(&self) -> super::vals::Apb4enrSyscfgen {
12924 let val = (self.0 >> 3usize) & 0x01;
12925 super::vals::Apb4enrSyscfgen(val as u8)
12926 }
12927 #[doc = "LPUART1 Peripheral Clocks Enable"]
12928 pub fn set_lpuart1en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12929 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
12930 }
12931 #[doc = "SPI6 Peripheral Clocks Enable"]
12932 pub const fn spi6en(&self) -> super::vals::Apb4enrSyscfgen {
12933 let val = (self.0 >> 5usize) & 0x01;
12934 super::vals::Apb4enrSyscfgen(val as u8)
12935 }
12936 #[doc = "SPI6 Peripheral Clocks Enable"]
12937 pub fn set_spi6en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12938 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
12939 }
12940 #[doc = "I2C4 Peripheral Clocks Enable"]
12941 pub const fn i2c4en(&self) -> super::vals::Apb4enrSyscfgen {
12942 let val = (self.0 >> 7usize) & 0x01;
12943 super::vals::Apb4enrSyscfgen(val as u8)
12944 }
12945 #[doc = "I2C4 Peripheral Clocks Enable"]
12946 pub fn set_i2c4en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12947 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
12948 }
12949 #[doc = "LPTIM2 Peripheral Clocks Enable"]
12950 pub const fn lptim2en(&self) -> super::vals::Apb4enrSyscfgen {
12951 let val = (self.0 >> 9usize) & 0x01;
12952 super::vals::Apb4enrSyscfgen(val as u8)
12953 }
12954 #[doc = "LPTIM2 Peripheral Clocks Enable"]
12955 pub fn set_lptim2en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12956 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
12957 }
12958 #[doc = "LPTIM3 Peripheral Clocks Enable"]
12959 pub const fn lptim3en(&self) -> super::vals::Apb4enrSyscfgen {
12960 let val = (self.0 >> 10usize) & 0x01;
12961 super::vals::Apb4enrSyscfgen(val as u8)
12962 }
12963 #[doc = "LPTIM3 Peripheral Clocks Enable"]
12964 pub fn set_lptim3en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12965 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
12966 }
12967 #[doc = "LPTIM4 Peripheral Clocks Enable"]
12968 pub const fn lptim4en(&self) -> super::vals::Apb4enrSyscfgen {
12969 let val = (self.0 >> 11usize) & 0x01;
12970 super::vals::Apb4enrSyscfgen(val as u8)
12971 }
12972 #[doc = "LPTIM4 Peripheral Clocks Enable"]
12973 pub fn set_lptim4en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12974 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
12975 }
12976 #[doc = "LPTIM5 Peripheral Clocks Enable"]
12977 pub const fn lptim5en(&self) -> super::vals::Apb4enrSyscfgen {
12978 let val = (self.0 >> 12usize) & 0x01;
12979 super::vals::Apb4enrSyscfgen(val as u8)
12980 }
12981 #[doc = "LPTIM5 Peripheral Clocks Enable"]
12982 pub fn set_lptim5en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12983 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
12984 }
12985 #[doc = "COMP1/2 peripheral clock enable"]
12986 pub const fn comp12en(&self) -> super::vals::Apb4enrSyscfgen {
12987 let val = (self.0 >> 14usize) & 0x01;
12988 super::vals::Apb4enrSyscfgen(val as u8)
12989 }
12990 #[doc = "COMP1/2 peripheral clock enable"]
12991 pub fn set_comp12en(&mut self, val: super::vals::Apb4enrSyscfgen) {
12992 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
12993 }
12994 #[doc = "VREF peripheral clock enable"]
12995 pub const fn vrefen(&self) -> super::vals::Apb4enrSyscfgen {
12996 let val = (self.0 >> 15usize) & 0x01;
12997 super::vals::Apb4enrSyscfgen(val as u8)
12998 }
12999 #[doc = "VREF peripheral clock enable"]
13000 pub fn set_vrefen(&mut self, val: super::vals::Apb4enrSyscfgen) {
13001 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
13002 }
13003 #[doc = "RTC APB Clock Enable"]
13004 pub const fn rtcapben(&self) -> super::vals::Apb4enrSyscfgen {
13005 let val = (self.0 >> 16usize) & 0x01;
13006 super::vals::Apb4enrSyscfgen(val as u8)
13007 }
13008 #[doc = "RTC APB Clock Enable"]
13009 pub fn set_rtcapben(&mut self, val: super::vals::Apb4enrSyscfgen) {
13010 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
13011 }
13012 #[doc = "SAI4 Peripheral Clocks Enable"]
13013 pub const fn sai4en(&self) -> super::vals::Apb4enrSyscfgen {
13014 let val = (self.0 >> 21usize) & 0x01;
13015 super::vals::Apb4enrSyscfgen(val as u8)
13016 }
13017 #[doc = "SAI4 Peripheral Clocks Enable"]
13018 pub fn set_sai4en(&mut self, val: super::vals::Apb4enrSyscfgen) {
13019 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
13020 }
13021 }
13022 impl Default for Apb4enr {
13023 fn default() -> Apb4enr {
13024 Apb4enr(0)
13025 }
13026 }
13027 #[doc = "RCC APB3 Sleep Clock Register"]
13028 #[repr(transparent)]
13029 #[derive(Copy, Clone, Eq, PartialEq)]
13030 pub struct Apb3lpenr(pub u32);
13031 impl Apb3lpenr {
13032 #[doc = "LTDC peripheral clock enable during CSleep mode"]
13033 pub const fn ltdclpen(&self) -> super::vals::Apb3lpenrLtdclpen {
13034 let val = (self.0 >> 3usize) & 0x01;
13035 super::vals::Apb3lpenrLtdclpen(val as u8)
13036 }
13037 #[doc = "LTDC peripheral clock enable during CSleep mode"]
13038 pub fn set_ltdclpen(&mut self, val: super::vals::Apb3lpenrLtdclpen) {
13039 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
13040 }
13041 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
13042 pub const fn wwdg1lpen(&self) -> super::vals::Apb3lpenrLtdclpen {
13043 let val = (self.0 >> 6usize) & 0x01;
13044 super::vals::Apb3lpenrLtdclpen(val as u8)
13045 }
13046 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
13047 pub fn set_wwdg1lpen(&mut self, val: super::vals::Apb3lpenrLtdclpen) {
13048 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
13049 } 9111 }
13050 } 9112 }
13051 impl Default for Apb3lpenr { 9113 impl Default for Pll2fracr {
13052 fn default() -> Apb3lpenr { 9114 fn default() -> Pll2fracr {
13053 Apb3lpenr(0) 9115 Pll2fracr(0)
13054 } 9116 }
13055 } 9117 }
13056 #[doc = "RCC AHB4 Sleep Clock Register"] 9118 #[doc = "RCC AHB4 Sleep Clock Register"]
13057 #[repr(transparent)] 9119 #[repr(transparent)]
13058 #[derive(Copy, Clone, Eq, PartialEq)] 9120 #[derive(Copy, Clone, Eq, PartialEq)]
13059 pub struct Ahb4lpenr(pub u32); 9121 pub struct C1Ahb4lpenr(pub u32);
13060 impl Ahb4lpenr { 9122 impl C1Ahb4lpenr {
13061 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9123 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13062 pub const fn gpioalpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9124 pub const fn gpioalpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13063 let val = (self.0 >> 0usize) & 0x01; 9125 let val = (self.0 >> 0usize) & 0x01;
13064 super::vals::Ahb4lpenrGpioalpen(val as u8) 9126 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13065 } 9127 }
13066 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9128 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13067 pub fn set_gpioalpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9129 pub fn set_gpioalpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13068 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 9130 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13069 } 9131 }
13070 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9132 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13071 pub const fn gpioblpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9133 pub const fn gpioblpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13072 let val = (self.0 >> 1usize) & 0x01; 9134 let val = (self.0 >> 1usize) & 0x01;
13073 super::vals::Ahb4lpenrGpioalpen(val as u8) 9135 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13074 } 9136 }
13075 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9137 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13076 pub fn set_gpioblpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9138 pub fn set_gpioblpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13077 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 9139 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
13078 } 9140 }
13079 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9141 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13080 pub const fn gpioclpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9142 pub const fn gpioclpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13081 let val = (self.0 >> 2usize) & 0x01; 9143 let val = (self.0 >> 2usize) & 0x01;
13082 super::vals::Ahb4lpenrGpioalpen(val as u8) 9144 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13083 } 9145 }
13084 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9146 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13085 pub fn set_gpioclpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9147 pub fn set_gpioclpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13086 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 9148 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
13087 } 9149 }
13088 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9150 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13089 pub const fn gpiodlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9151 pub const fn gpiodlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13090 let val = (self.0 >> 3usize) & 0x01; 9152 let val = (self.0 >> 3usize) & 0x01;
13091 super::vals::Ahb4lpenrGpioalpen(val as u8) 9153 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13092 } 9154 }
13093 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9155 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13094 pub fn set_gpiodlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9156 pub fn set_gpiodlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13095 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 9157 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
13096 } 9158 }
13097 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9159 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13098 pub const fn gpioelpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9160 pub const fn gpioelpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13099 let val = (self.0 >> 4usize) & 0x01; 9161 let val = (self.0 >> 4usize) & 0x01;
13100 super::vals::Ahb4lpenrGpioalpen(val as u8) 9162 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13101 } 9163 }
13102 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9164 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13103 pub fn set_gpioelpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9165 pub fn set_gpioelpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13104 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 9166 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
13105 } 9167 }
13106 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9168 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13107 pub const fn gpioflpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9169 pub const fn gpioflpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13108 let val = (self.0 >> 5usize) & 0x01; 9170 let val = (self.0 >> 5usize) & 0x01;
13109 super::vals::Ahb4lpenrGpioalpen(val as u8) 9171 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13110 } 9172 }
13111 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9173 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13112 pub fn set_gpioflpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9174 pub fn set_gpioflpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13113 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 9175 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13114 } 9176 }
13115 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9177 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13116 pub const fn gpioglpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9178 pub const fn gpioglpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13117 let val = (self.0 >> 6usize) & 0x01; 9179 let val = (self.0 >> 6usize) & 0x01;
13118 super::vals::Ahb4lpenrGpioalpen(val as u8) 9180 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13119 } 9181 }
13120 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9182 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13121 pub fn set_gpioglpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9183 pub fn set_gpioglpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13122 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 9184 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
13123 } 9185 }
13124 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9186 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13125 pub const fn gpiohlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9187 pub const fn gpiohlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13126 let val = (self.0 >> 7usize) & 0x01; 9188 let val = (self.0 >> 7usize) & 0x01;
13127 super::vals::Ahb4lpenrGpioalpen(val as u8) 9189 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13128 } 9190 }
13129 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9191 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13130 pub fn set_gpiohlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9192 pub fn set_gpiohlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13131 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 9193 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
13132 } 9194 }
13133 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9195 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13134 pub const fn gpioilpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9196 pub const fn gpioilpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13135 let val = (self.0 >> 8usize) & 0x01; 9197 let val = (self.0 >> 8usize) & 0x01;
13136 super::vals::Ahb4lpenrGpioalpen(val as u8) 9198 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13137 } 9199 }
13138 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9200 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13139 pub fn set_gpioilpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9201 pub fn set_gpioilpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13140 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 9202 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
13141 } 9203 }
13142 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9204 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13143 pub const fn gpiojlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9205 pub const fn gpiojlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13144 let val = (self.0 >> 9usize) & 0x01; 9206 let val = (self.0 >> 9usize) & 0x01;
13145 super::vals::Ahb4lpenrGpioalpen(val as u8) 9207 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13146 } 9208 }
13147 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9209 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13148 pub fn set_gpiojlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9210 pub fn set_gpiojlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13149 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 9211 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
13150 } 9212 }
13151 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9213 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13152 pub const fn gpioklpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9214 pub const fn gpioklpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13153 let val = (self.0 >> 10usize) & 0x01; 9215 let val = (self.0 >> 10usize) & 0x01;
13154 super::vals::Ahb4lpenrGpioalpen(val as u8) 9216 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13155 } 9217 }
13156 #[doc = "GPIO peripheral clock enable during CSleep mode"] 9218 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13157 pub fn set_gpioklpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9219 pub fn set_gpioklpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13158 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 9220 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
13159 } 9221 }
13160 #[doc = "CRC peripheral clock enable during CSleep mode"] 9222 #[doc = "CRC peripheral clock enable during CSleep mode"]
13161 pub const fn crclpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9223 pub const fn crclpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13162 let val = (self.0 >> 19usize) & 0x01; 9224 let val = (self.0 >> 19usize) & 0x01;
13163 super::vals::Ahb4lpenrGpioalpen(val as u8) 9225 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13164 } 9226 }
13165 #[doc = "CRC peripheral clock enable during CSleep mode"] 9227 #[doc = "CRC peripheral clock enable during CSleep mode"]
13166 pub fn set_crclpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9228 pub fn set_crclpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13167 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 9229 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
13168 } 9230 }
13169 #[doc = "BDMA Clock Enable During CSleep Mode"] 9231 #[doc = "BDMA Clock Enable During CSleep Mode"]
13170 pub const fn bdmalpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9232 pub const fn bdmalpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13171 let val = (self.0 >> 21usize) & 0x01; 9233 let val = (self.0 >> 21usize) & 0x01;
13172 super::vals::Ahb4lpenrGpioalpen(val as u8) 9234 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13173 } 9235 }
13174 #[doc = "BDMA Clock Enable During CSleep Mode"] 9236 #[doc = "BDMA Clock Enable During CSleep Mode"]
13175 pub fn set_bdmalpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9237 pub fn set_bdmalpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13176 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 9238 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
13177 } 9239 }
13178 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] 9240 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"]
13179 pub const fn adc3lpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9241 pub const fn adc3lpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13180 let val = (self.0 >> 24usize) & 0x01; 9242 let val = (self.0 >> 24usize) & 0x01;
13181 super::vals::Ahb4lpenrGpioalpen(val as u8) 9243 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13182 } 9244 }
13183 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] 9245 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"]
13184 pub fn set_adc3lpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9246 pub fn set_adc3lpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13185 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 9247 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
13186 } 9248 }
13187 #[doc = "Backup RAM Clock Enable During CSleep Mode"] 9249 #[doc = "Backup RAM Clock Enable During CSleep Mode"]
13188 pub const fn bkpramlpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9250 pub const fn bkpramlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13189 let val = (self.0 >> 28usize) & 0x01; 9251 let val = (self.0 >> 28usize) & 0x01;
13190 super::vals::Ahb4lpenrGpioalpen(val as u8) 9252 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13191 } 9253 }
13192 #[doc = "Backup RAM Clock Enable During CSleep Mode"] 9254 #[doc = "Backup RAM Clock Enable During CSleep Mode"]
13193 pub fn set_bkpramlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9255 pub fn set_bkpramlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13194 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 9256 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
13195 } 9257 }
13196 #[doc = "SRAM4 Clock Enable During CSleep Mode"] 9258 #[doc = "SRAM4 Clock Enable During CSleep Mode"]
13197 pub const fn sram4lpen(&self) -> super::vals::Ahb4lpenrGpioalpen { 9259 pub const fn sram4lpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
13198 let val = (self.0 >> 29usize) & 0x01; 9260 let val = (self.0 >> 29usize) & 0x01;
13199 super::vals::Ahb4lpenrGpioalpen(val as u8) 9261 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
13200 } 9262 }
13201 #[doc = "SRAM4 Clock Enable During CSleep Mode"] 9263 #[doc = "SRAM4 Clock Enable During CSleep Mode"]
13202 pub fn set_sram4lpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) { 9264 pub fn set_sram4lpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
13203 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 9265 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
13204 } 9266 }
13205 } 9267 }
13206 impl Default for Ahb4lpenr { 9268 impl Default for C1Ahb4lpenr {
13207 fn default() -> Ahb4lpenr { 9269 fn default() -> C1Ahb4lpenr {
13208 Ahb4lpenr(0) 9270 C1Ahb4lpenr(0)
13209 } 9271 }
13210 } 9272 }
13211 #[doc = "RCC Domain 2 Clock Configuration Register"] 9273 #[doc = "RCC D3 Autonomous mode Register"]
13212 #[repr(transparent)] 9274 #[repr(transparent)]
13213 #[derive(Copy, Clone, Eq, PartialEq)] 9275 #[derive(Copy, Clone, Eq, PartialEq)]
13214 pub struct D2cfgr(pub u32); 9276 pub struct D3amr(pub u32);
13215 impl D2cfgr { 9277 impl D3amr {
13216 #[doc = "D2 domain APB1 prescaler"] 9278 #[doc = "BDMA and DMAMUX Autonomous mode enable"]
13217 pub const fn d2ppre1(&self) -> super::vals::D2ppre1 { 9279 pub const fn bdmaamen(&self) -> super::vals::Bdmaamen {
13218 let val = (self.0 >> 4usize) & 0x07; 9280 let val = (self.0 >> 0usize) & 0x01;
13219 super::vals::D2ppre1(val as u8) 9281 super::vals::Bdmaamen(val as u8)
13220 }
13221 #[doc = "D2 domain APB1 prescaler"]
13222 pub fn set_d2ppre1(&mut self, val: super::vals::D2ppre1) {
13223 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
13224 } 9282 }
13225 #[doc = "D2 domain APB2 prescaler"] 9283 #[doc = "BDMA and DMAMUX Autonomous mode enable"]
13226 pub const fn d2ppre2(&self) -> super::vals::D2ppre1 { 9284 pub fn set_bdmaamen(&mut self, val: super::vals::Bdmaamen) {
13227 let val = (self.0 >> 8usize) & 0x07; 9285 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13228 super::vals::D2ppre1(val as u8)
13229 } 9286 }
13230 #[doc = "D2 domain APB2 prescaler"] 9287 #[doc = "LPUART1 Autonomous mode enable"]
13231 pub fn set_d2ppre2(&mut self, val: super::vals::D2ppre1) { 9288 pub const fn lpuart1amen(&self) -> super::vals::Bdmaamen {
13232 self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize); 9289 let val = (self.0 >> 3usize) & 0x01;
9290 super::vals::Bdmaamen(val as u8)
13233 } 9291 }
13234 } 9292 #[doc = "LPUART1 Autonomous mode enable"]
13235 impl Default for D2cfgr { 9293 pub fn set_lpuart1amen(&mut self, val: super::vals::Bdmaamen) {
13236 fn default() -> D2cfgr { 9294 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
13237 D2cfgr(0)
13238 } 9295 }
13239 } 9296 #[doc = "SPI6 Autonomous mode enable"]
13240 #[doc = "RCC Backup Domain Control Register"] 9297 pub const fn spi6amen(&self) -> super::vals::Bdmaamen {
13241 #[repr(transparent)] 9298 let val = (self.0 >> 5usize) & 0x01;
13242 #[derive(Copy, Clone, Eq, PartialEq)] 9299 super::vals::Bdmaamen(val as u8)
13243 pub struct Bdcr(pub u32);
13244 impl Bdcr {
13245 #[doc = "LSE oscillator enabled"]
13246 pub const fn lseon(&self) -> super::vals::Lseon {
13247 let val = (self.0 >> 0usize) & 0x01;
13248 super::vals::Lseon(val as u8)
13249 } 9300 }
13250 #[doc = "LSE oscillator enabled"] 9301 #[doc = "SPI6 Autonomous mode enable"]
13251 pub fn set_lseon(&mut self, val: super::vals::Lseon) { 9302 pub fn set_spi6amen(&mut self, val: super::vals::Bdmaamen) {
13252 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 9303 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13253 } 9304 }
13254 #[doc = "LSE oscillator ready"] 9305 #[doc = "I2C4 Autonomous mode enable"]
13255 pub const fn lserdy(&self) -> bool { 9306 pub const fn i2c4amen(&self) -> super::vals::Bdmaamen {
13256 let val = (self.0 >> 1usize) & 0x01; 9307 let val = (self.0 >> 7usize) & 0x01;
13257 val != 0 9308 super::vals::Bdmaamen(val as u8)
13258 } 9309 }
13259 #[doc = "LSE oscillator ready"] 9310 #[doc = "I2C4 Autonomous mode enable"]
13260 pub fn set_lserdy(&mut self, val: bool) { 9311 pub fn set_i2c4amen(&mut self, val: super::vals::Bdmaamen) {
13261 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 9312 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
13262 } 9313 }
13263 #[doc = "LSE oscillator bypass"] 9314 #[doc = "LPTIM2 Autonomous mode enable"]
13264 pub const fn lsebyp(&self) -> super::vals::Lsebyp { 9315 pub const fn lptim2amen(&self) -> super::vals::Bdmaamen {
13265 let val = (self.0 >> 2usize) & 0x01; 9316 let val = (self.0 >> 9usize) & 0x01;
13266 super::vals::Lsebyp(val as u8) 9317 super::vals::Bdmaamen(val as u8)
13267 } 9318 }
13268 #[doc = "LSE oscillator bypass"] 9319 #[doc = "LPTIM2 Autonomous mode enable"]
13269 pub fn set_lsebyp(&mut self, val: super::vals::Lsebyp) { 9320 pub fn set_lptim2amen(&mut self, val: super::vals::Bdmaamen) {
13270 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 9321 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
13271 } 9322 }
13272 #[doc = "LSE oscillator driving capability"] 9323 #[doc = "LPTIM3 Autonomous mode enable"]
13273 pub const fn lsedrv(&self) -> super::vals::Lsedrv { 9324 pub const fn lptim3amen(&self) -> super::vals::Bdmaamen {
13274 let val = (self.0 >> 3usize) & 0x03; 9325 let val = (self.0 >> 10usize) & 0x01;
13275 super::vals::Lsedrv(val as u8) 9326 super::vals::Bdmaamen(val as u8)
13276 } 9327 }
13277 #[doc = "LSE oscillator driving capability"] 9328 #[doc = "LPTIM3 Autonomous mode enable"]
13278 pub fn set_lsedrv(&mut self, val: super::vals::Lsedrv) { 9329 pub fn set_lptim3amen(&mut self, val: super::vals::Bdmaamen) {
13279 self.0 = (self.0 & !(0x03 << 3usize)) | (((val.0 as u32) & 0x03) << 3usize); 9330 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
13280 } 9331 }
13281 #[doc = "LSE clock security system enable"] 9332 #[doc = "LPTIM4 Autonomous mode enable"]
13282 pub const fn lsecsson(&self) -> super::vals::Lsecsson { 9333 pub const fn lptim4amen(&self) -> super::vals::Bdmaamen {
13283 let val = (self.0 >> 5usize) & 0x01; 9334 let val = (self.0 >> 11usize) & 0x01;
13284 super::vals::Lsecsson(val as u8) 9335 super::vals::Bdmaamen(val as u8)
13285 } 9336 }
13286 #[doc = "LSE clock security system enable"] 9337 #[doc = "LPTIM4 Autonomous mode enable"]
13287 pub fn set_lsecsson(&mut self, val: super::vals::Lsecsson) { 9338 pub fn set_lptim4amen(&mut self, val: super::vals::Bdmaamen) {
13288 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 9339 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
13289 } 9340 }
13290 #[doc = "LSE clock security system failure detection"] 9341 #[doc = "LPTIM5 Autonomous mode enable"]
13291 pub const fn lsecssd(&self) -> bool { 9342 pub const fn lptim5amen(&self) -> super::vals::Bdmaamen {
13292 let val = (self.0 >> 6usize) & 0x01; 9343 let val = (self.0 >> 12usize) & 0x01;
13293 val != 0 9344 super::vals::Bdmaamen(val as u8)
13294 } 9345 }
13295 #[doc = "LSE clock security system failure detection"] 9346 #[doc = "LPTIM5 Autonomous mode enable"]
13296 pub fn set_lsecssd(&mut self, val: bool) { 9347 pub fn set_lptim5amen(&mut self, val: super::vals::Bdmaamen) {
13297 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 9348 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
13298 } 9349 }
13299 #[doc = "RTC clock source selection"] 9350 #[doc = "COMP12 Autonomous mode enable"]
13300 pub const fn rtcsel(&self) -> super::vals::Rtcsel { 9351 pub const fn comp12amen(&self) -> super::vals::Bdmaamen {
13301 let val = (self.0 >> 8usize) & 0x03; 9352 let val = (self.0 >> 14usize) & 0x01;
13302 super::vals::Rtcsel(val as u8) 9353 super::vals::Bdmaamen(val as u8)
13303 } 9354 }
13304 #[doc = "RTC clock source selection"] 9355 #[doc = "COMP12 Autonomous mode enable"]
13305 pub fn set_rtcsel(&mut self, val: super::vals::Rtcsel) { 9356 pub fn set_comp12amen(&mut self, val: super::vals::Bdmaamen) {
13306 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); 9357 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
13307 } 9358 }
13308 #[doc = "RTC clock enable"] 9359 #[doc = "VREF Autonomous mode enable"]
13309 pub const fn rtcen(&self) -> super::vals::Rtcen { 9360 pub const fn vrefamen(&self) -> super::vals::Bdmaamen {
13310 let val = (self.0 >> 15usize) & 0x01; 9361 let val = (self.0 >> 15usize) & 0x01;
13311 super::vals::Rtcen(val as u8) 9362 super::vals::Bdmaamen(val as u8)
13312 } 9363 }
13313 #[doc = "RTC clock enable"] 9364 #[doc = "VREF Autonomous mode enable"]
13314 pub fn set_rtcen(&mut self, val: super::vals::Rtcen) { 9365 pub fn set_vrefamen(&mut self, val: super::vals::Bdmaamen) {
13315 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 9366 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
13316 } 9367 }
13317 #[doc = "VSwitch domain software reset"] 9368 #[doc = "RTC Autonomous mode enable"]
13318 pub const fn bdrst(&self) -> super::vals::Bdrst { 9369 pub const fn rtcamen(&self) -> super::vals::Bdmaamen {
13319 let val = (self.0 >> 16usize) & 0x01; 9370 let val = (self.0 >> 16usize) & 0x01;
13320 super::vals::Bdrst(val as u8) 9371 super::vals::Bdmaamen(val as u8)
13321 } 9372 }
13322 #[doc = "VSwitch domain software reset"] 9373 #[doc = "RTC Autonomous mode enable"]
13323 pub fn set_bdrst(&mut self, val: super::vals::Bdrst) { 9374 pub fn set_rtcamen(&mut self, val: super::vals::Bdmaamen) {
13324 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 9375 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
13325 } 9376 }
9377 #[doc = "CRC Autonomous mode enable"]
9378 pub const fn crcamen(&self) -> super::vals::Bdmaamen {
9379 let val = (self.0 >> 19usize) & 0x01;
9380 super::vals::Bdmaamen(val as u8)
9381 }
9382 #[doc = "CRC Autonomous mode enable"]
9383 pub fn set_crcamen(&mut self, val: super::vals::Bdmaamen) {
9384 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
9385 }
9386 #[doc = "SAI4 Autonomous mode enable"]
9387 pub const fn sai4amen(&self) -> super::vals::Bdmaamen {
9388 let val = (self.0 >> 21usize) & 0x01;
9389 super::vals::Bdmaamen(val as u8)
9390 }
9391 #[doc = "SAI4 Autonomous mode enable"]
9392 pub fn set_sai4amen(&mut self, val: super::vals::Bdmaamen) {
9393 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
9394 }
9395 #[doc = "ADC3 Autonomous mode enable"]
9396 pub const fn adc3amen(&self) -> super::vals::Bdmaamen {
9397 let val = (self.0 >> 24usize) & 0x01;
9398 super::vals::Bdmaamen(val as u8)
9399 }
9400 #[doc = "ADC3 Autonomous mode enable"]
9401 pub fn set_adc3amen(&mut self, val: super::vals::Bdmaamen) {
9402 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
9403 }
9404 #[doc = "Backup RAM Autonomous mode enable"]
9405 pub const fn bkpramamen(&self) -> super::vals::Bdmaamen {
9406 let val = (self.0 >> 28usize) & 0x01;
9407 super::vals::Bdmaamen(val as u8)
9408 }
9409 #[doc = "Backup RAM Autonomous mode enable"]
9410 pub fn set_bkpramamen(&mut self, val: super::vals::Bdmaamen) {
9411 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
9412 }
9413 #[doc = "SRAM4 Autonomous mode enable"]
9414 pub const fn sram4amen(&self) -> super::vals::Bdmaamen {
9415 let val = (self.0 >> 29usize) & 0x01;
9416 super::vals::Bdmaamen(val as u8)
9417 }
9418 #[doc = "SRAM4 Autonomous mode enable"]
9419 pub fn set_sram4amen(&mut self, val: super::vals::Bdmaamen) {
9420 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
9421 }
13326 } 9422 }
13327 impl Default for Bdcr { 9423 impl Default for D3amr {
13328 fn default() -> Bdcr { 9424 fn default() -> D3amr {
13329 Bdcr(0) 9425 D3amr(0)
13330 } 9426 }
13331 } 9427 }
13332 #[doc = "RCC Clock Source Interrupt Flag Register"] 9428 #[doc = "RCC APB3 Sleep Clock Register"]
13333 #[repr(transparent)] 9429 #[repr(transparent)]
13334 #[derive(Copy, Clone, Eq, PartialEq)] 9430 #[derive(Copy, Clone, Eq, PartialEq)]
13335 pub struct Cifr(pub u32); 9431 pub struct Apb3lpenr(pub u32);
13336 impl Cifr { 9432 impl Apb3lpenr {
13337 #[doc = "LSI ready Interrupt Flag"] 9433 #[doc = "LTDC peripheral clock enable during CSleep mode"]
13338 pub const fn lsirdyf(&self) -> bool { 9434 pub const fn ltdclpen(&self) -> super::vals::Apb3lpenrLtdclpen {
9435 let val = (self.0 >> 3usize) & 0x01;
9436 super::vals::Apb3lpenrLtdclpen(val as u8)
9437 }
9438 #[doc = "LTDC peripheral clock enable during CSleep mode"]
9439 pub fn set_ltdclpen(&mut self, val: super::vals::Apb3lpenrLtdclpen) {
9440 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
9441 }
9442 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
9443 pub const fn wwdg1lpen(&self) -> super::vals::Apb3lpenrLtdclpen {
9444 let val = (self.0 >> 6usize) & 0x01;
9445 super::vals::Apb3lpenrLtdclpen(val as u8)
9446 }
9447 #[doc = "WWDG1 Clock Enable During CSleep Mode"]
9448 pub fn set_wwdg1lpen(&mut self, val: super::vals::Apb3lpenrLtdclpen) {
9449 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
9450 }
9451 }
9452 impl Default for Apb3lpenr {
9453 fn default() -> Apb3lpenr {
9454 Apb3lpenr(0)
9455 }
9456 }
9457 #[doc = "RCC AHB1 Clock Register"]
9458 #[repr(transparent)]
9459 #[derive(Copy, Clone, Eq, PartialEq)]
9460 pub struct C1Ahb1enr(pub u32);
9461 impl C1Ahb1enr {
9462 #[doc = "DMA1 Clock Enable"]
9463 pub const fn dma1en(&self) -> super::vals::C1Ahb1enrDma1en {
13339 let val = (self.0 >> 0usize) & 0x01; 9464 let val = (self.0 >> 0usize) & 0x01;
13340 val != 0 9465 super::vals::C1Ahb1enrDma1en(val as u8)
13341 } 9466 }
13342 #[doc = "LSI ready Interrupt Flag"] 9467 #[doc = "DMA1 Clock Enable"]
13343 pub fn set_lsirdyf(&mut self, val: bool) { 9468 pub fn set_dma1en(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13344 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 9469 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13345 } 9470 }
13346 #[doc = "LSE ready Interrupt Flag"] 9471 #[doc = "DMA2 Clock Enable"]
13347 pub const fn lserdyf(&self) -> bool { 9472 pub const fn dma2en(&self) -> super::vals::C1Ahb1enrDma1en {
13348 let val = (self.0 >> 1usize) & 0x01; 9473 let val = (self.0 >> 1usize) & 0x01;
13349 val != 0 9474 super::vals::C1Ahb1enrDma1en(val as u8)
13350 } 9475 }
13351 #[doc = "LSE ready Interrupt Flag"] 9476 #[doc = "DMA2 Clock Enable"]
13352 pub fn set_lserdyf(&mut self, val: bool) { 9477 pub fn set_dma2en(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13353 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 9478 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
13354 } 9479 }
13355 #[doc = "HSI ready Interrupt Flag"] 9480 #[doc = "ADC1/2 Peripheral Clocks Enable"]
13356 pub const fn hsirdyf(&self) -> bool { 9481 pub const fn adc12en(&self) -> super::vals::C1Ahb1enrDma1en {
13357 let val = (self.0 >> 2usize) & 0x01; 9482 let val = (self.0 >> 5usize) & 0x01;
13358 val != 0 9483 super::vals::C1Ahb1enrDma1en(val as u8)
13359 } 9484 }
13360 #[doc = "HSI ready Interrupt Flag"] 9485 #[doc = "ADC1/2 Peripheral Clocks Enable"]
13361 pub fn set_hsirdyf(&mut self, val: bool) { 9486 pub fn set_adc12en(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13362 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 9487 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13363 } 9488 }
13364 #[doc = "HSE ready Interrupt Flag"] 9489 #[doc = "Ethernet MAC bus interface Clock Enable"]
13365 pub const fn hserdyf(&self) -> bool { 9490 pub const fn eth1macen(&self) -> super::vals::C1Ahb1enrDma1en {
13366 let val = (self.0 >> 3usize) & 0x01; 9491 let val = (self.0 >> 15usize) & 0x01;
13367 val != 0 9492 super::vals::C1Ahb1enrDma1en(val as u8)
13368 } 9493 }
13369 #[doc = "HSE ready Interrupt Flag"] 9494 #[doc = "Ethernet MAC bus interface Clock Enable"]
13370 pub fn set_hserdyf(&mut self, val: bool) { 9495 pub fn set_eth1macen(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13371 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 9496 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
13372 } 9497 }
13373 #[doc = "CSI ready Interrupt Flag"] 9498 #[doc = "Ethernet Transmission Clock Enable"]
13374 pub const fn csirdy(&self) -> bool { 9499 pub const fn eth1txen(&self) -> super::vals::C1Ahb1enrDma1en {
13375 let val = (self.0 >> 4usize) & 0x01; 9500 let val = (self.0 >> 16usize) & 0x01;
13376 val != 0 9501 super::vals::C1Ahb1enrDma1en(val as u8)
13377 } 9502 }
13378 #[doc = "CSI ready Interrupt Flag"] 9503 #[doc = "Ethernet Transmission Clock Enable"]
13379 pub fn set_csirdy(&mut self, val: bool) { 9504 pub fn set_eth1txen(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13380 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 9505 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
13381 } 9506 }
13382 #[doc = "RC48 ready Interrupt Flag"] 9507 #[doc = "Ethernet Reception Clock Enable"]
13383 pub const fn hsi48rdyf(&self) -> bool { 9508 pub const fn eth1rxen(&self) -> super::vals::C1Ahb1enrDma1en {
13384 let val = (self.0 >> 5usize) & 0x01; 9509 let val = (self.0 >> 17usize) & 0x01;
13385 val != 0 9510 super::vals::C1Ahb1enrDma1en(val as u8)
13386 } 9511 }
13387 #[doc = "RC48 ready Interrupt Flag"] 9512 #[doc = "Ethernet Reception Clock Enable"]
13388 pub fn set_hsi48rdyf(&mut self, val: bool) { 9513 pub fn set_eth1rxen(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13389 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 9514 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
13390 } 9515 }
13391 #[doc = "PLL1 ready Interrupt Flag"] 9516 #[doc = "USB1OTG Peripheral Clocks Enable"]
13392 pub fn pllrdyf(&self, n: usize) -> bool { 9517 pub const fn usb1otgen(&self) -> super::vals::C1Ahb1enrDma1en {
13393 assert!(n < 3usize); 9518 let val = (self.0 >> 25usize) & 0x01;
13394 let offs = 6usize + n * 1usize; 9519 super::vals::C1Ahb1enrDma1en(val as u8)
13395 let val = (self.0 >> offs) & 0x01;
13396 val != 0
13397 } 9520 }
13398 #[doc = "PLL1 ready Interrupt Flag"] 9521 #[doc = "USB1OTG Peripheral Clocks Enable"]
13399 pub fn set_pllrdyf(&mut self, n: usize, val: bool) { 9522 pub fn set_usb1otgen(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13400 assert!(n < 3usize); 9523 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
13401 let offs = 6usize + n * 1usize;
13402 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
13403 } 9524 }
13404 #[doc = "LSE clock security system Interrupt Flag"] 9525 #[doc = "USB_PHY1 Clocks Enable"]
13405 pub const fn lsecssf(&self) -> bool { 9526 pub const fn usb1ulpien(&self) -> super::vals::C1Ahb1enrDma1en {
13406 let val = (self.0 >> 9usize) & 0x01; 9527 let val = (self.0 >> 26usize) & 0x01;
13407 val != 0 9528 super::vals::C1Ahb1enrDma1en(val as u8)
13408 } 9529 }
13409 #[doc = "LSE clock security system Interrupt Flag"] 9530 #[doc = "USB_PHY1 Clocks Enable"]
13410 pub fn set_lsecssf(&mut self, val: bool) { 9531 pub fn set_usb1ulpien(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13411 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 9532 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize);
13412 } 9533 }
13413 #[doc = "HSE clock security system Interrupt Flag"] 9534 #[doc = "USB2OTG Peripheral Clocks Enable"]
13414 pub const fn hsecssf(&self) -> bool { 9535 pub const fn usb2otgen(&self) -> super::vals::C1Ahb1enrDma1en {
13415 let val = (self.0 >> 10usize) & 0x01; 9536 let val = (self.0 >> 27usize) & 0x01;
13416 val != 0 9537 super::vals::C1Ahb1enrDma1en(val as u8)
13417 } 9538 }
13418 #[doc = "HSE clock security system Interrupt Flag"] 9539 #[doc = "USB2OTG Peripheral Clocks Enable"]
13419 pub fn set_hsecssf(&mut self, val: bool) { 9540 pub fn set_usb2otgen(&mut self, val: super::vals::C1Ahb1enrDma1en) {
13420 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 9541 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
9542 }
9543 #[doc = "USB_PHY2 Clocks Enable"]
9544 pub const fn usb2ulpien(&self) -> super::vals::C1Ahb1enrDma1en {
9545 let val = (self.0 >> 28usize) & 0x01;
9546 super::vals::C1Ahb1enrDma1en(val as u8)
9547 }
9548 #[doc = "USB_PHY2 Clocks Enable"]
9549 pub fn set_usb2ulpien(&mut self, val: super::vals::C1Ahb1enrDma1en) {
9550 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
13421 } 9551 }
13422 } 9552 }
13423 impl Default for Cifr { 9553 impl Default for C1Ahb1enr {
13424 fn default() -> Cifr { 9554 fn default() -> C1Ahb1enr {
13425 Cifr(0) 9555 C1Ahb1enr(0)
13426 } 9556 }
13427 } 9557 }
13428 #[doc = "RCC AHB2 Peripheral Reset Register"] 9558 #[doc = "RCC AHB1 Sleep Clock Register"]
13429 #[repr(transparent)] 9559 #[repr(transparent)]
13430 #[derive(Copy, Clone, Eq, PartialEq)] 9560 #[derive(Copy, Clone, Eq, PartialEq)]
13431 pub struct Ahb2rstr(pub u32); 9561 pub struct Ahb1lpenr(pub u32);
13432 impl Ahb2rstr { 9562 impl Ahb1lpenr {
13433 #[doc = "CAMITF block reset"] 9563 #[doc = "DMA1 Clock Enable During CSleep Mode"]
13434 pub const fn camitfrst(&self) -> super::vals::Camitfrst { 9564 pub const fn dma1lpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
13435 let val = (self.0 >> 0usize) & 0x01; 9565 let val = (self.0 >> 0usize) & 0x01;
13436 super::vals::Camitfrst(val as u8) 9566 super::vals::Ahb1lpenrDma1lpen(val as u8)
13437 } 9567 }
13438 #[doc = "CAMITF block reset"] 9568 #[doc = "DMA1 Clock Enable During CSleep Mode"]
13439 pub fn set_camitfrst(&mut self, val: super::vals::Camitfrst) { 9569 pub fn set_dma1lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
13440 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 9570 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13441 } 9571 }
13442 #[doc = "Cryptography block reset"] 9572 #[doc = "DMA2 Clock Enable During CSleep Mode"]
13443 pub const fn cryptrst(&self) -> super::vals::Camitfrst { 9573 pub const fn dma2lpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
13444 let val = (self.0 >> 4usize) & 0x01; 9574 let val = (self.0 >> 1usize) & 0x01;
13445 super::vals::Camitfrst(val as u8) 9575 super::vals::Ahb1lpenrDma1lpen(val as u8)
13446 } 9576 }
13447 #[doc = "Cryptography block reset"] 9577 #[doc = "DMA2 Clock Enable During CSleep Mode"]
13448 pub fn set_cryptrst(&mut self, val: super::vals::Camitfrst) { 9578 pub fn set_dma2lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
13449 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 9579 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
13450 } 9580 }
13451 #[doc = "Hash block reset"] 9581 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"]
13452 pub const fn hashrst(&self) -> super::vals::Camitfrst { 9582 pub const fn adc12lpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
13453 let val = (self.0 >> 5usize) & 0x01; 9583 let val = (self.0 >> 5usize) & 0x01;
13454 super::vals::Camitfrst(val as u8) 9584 super::vals::Ahb1lpenrDma1lpen(val as u8)
13455 } 9585 }
13456 #[doc = "Hash block reset"] 9586 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"]
13457 pub fn set_hashrst(&mut self, val: super::vals::Camitfrst) { 9587 pub fn set_adc12lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
13458 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 9588 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13459 } 9589 }
13460 #[doc = "Random Number Generator block reset"] 9590 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"]
13461 pub const fn rngrst(&self) -> super::vals::Camitfrst { 9591 pub const fn eth1maclpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
13462 let val = (self.0 >> 6usize) & 0x01; 9592 let val = (self.0 >> 15usize) & 0x01;
13463 super::vals::Camitfrst(val as u8) 9593 super::vals::Ahb1lpenrDma1lpen(val as u8)
13464 } 9594 }
13465 #[doc = "Random Number Generator block reset"] 9595 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"]
13466 pub fn set_rngrst(&mut self, val: super::vals::Camitfrst) { 9596 pub fn set_eth1maclpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
13467 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 9597 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
13468 } 9598 }
13469 #[doc = "SDMMC2 and SDMMC2 Delay block reset"] 9599 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"]
13470 pub const fn sdmmc2rst(&self) -> super::vals::Camitfrst { 9600 pub const fn eth1txlpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
13471 let val = (self.0 >> 9usize) & 0x01; 9601 let val = (self.0 >> 16usize) & 0x01;
13472 super::vals::Camitfrst(val as u8) 9602 super::vals::Ahb1lpenrDma1lpen(val as u8)
13473 } 9603 }
13474 #[doc = "SDMMC2 and SDMMC2 Delay block reset"] 9604 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"]
13475 pub fn set_sdmmc2rst(&mut self, val: super::vals::Camitfrst) { 9605 pub fn set_eth1txlpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
13476 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 9606 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
9607 }
9608 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"]
9609 pub const fn eth1rxlpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
9610 let val = (self.0 >> 17usize) & 0x01;
9611 super::vals::Ahb1lpenrDma1lpen(val as u8)
9612 }
9613 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"]
9614 pub fn set_eth1rxlpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
9615 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
9616 }
9617 #[doc = "USB1OTG peripheral clock enable during CSleep mode"]
9618 pub const fn usb1otglpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
9619 let val = (self.0 >> 25usize) & 0x01;
9620 super::vals::Ahb1lpenrDma1lpen(val as u8)
9621 }
9622 #[doc = "USB1OTG peripheral clock enable during CSleep mode"]
9623 pub fn set_usb1otglpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
9624 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
9625 }
9626 #[doc = "USB_PHY1 clock enable during CSleep mode"]
9627 pub const fn usb1otghsulpilpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
9628 let val = (self.0 >> 26usize) & 0x01;
9629 super::vals::Ahb1lpenrDma1lpen(val as u8)
9630 }
9631 #[doc = "USB_PHY1 clock enable during CSleep mode"]
9632 pub fn set_usb1otghsulpilpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
9633 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize);
9634 }
9635 #[doc = "USB2OTG peripheral clock enable during CSleep mode"]
9636 pub const fn usb2otglpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
9637 let val = (self.0 >> 27usize) & 0x01;
9638 super::vals::Ahb1lpenrDma1lpen(val as u8)
9639 }
9640 #[doc = "USB2OTG peripheral clock enable during CSleep mode"]
9641 pub fn set_usb2otglpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
9642 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
9643 }
9644 #[doc = "USB_PHY2 clocks enable during CSleep mode"]
9645 pub const fn usb2otghsulpilpen(&self) -> super::vals::Ahb1lpenrDma1lpen {
9646 let val = (self.0 >> 28usize) & 0x01;
9647 super::vals::Ahb1lpenrDma1lpen(val as u8)
9648 }
9649 #[doc = "USB_PHY2 clocks enable during CSleep mode"]
9650 pub fn set_usb2otghsulpilpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) {
9651 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
13477 } 9652 }
13478 } 9653 }
13479 impl Default for Ahb2rstr { 9654 impl Default for Ahb1lpenr {
13480 fn default() -> Ahb2rstr { 9655 fn default() -> Ahb1lpenr {
13481 Ahb2rstr(0) 9656 Ahb1lpenr(0)
13482 } 9657 }
13483 } 9658 }
13484 #[doc = "RCC Domain 3 Kernel Clock Configuration Register"] 9659 #[doc = "RCC APB3 Clock Register"]
13485 #[repr(transparent)] 9660 #[repr(transparent)]
13486 #[derive(Copy, Clone, Eq, PartialEq)] 9661 #[derive(Copy, Clone, Eq, PartialEq)]
13487 pub struct D3ccipr(pub u32); 9662 pub struct C1Apb3enr(pub u32);
13488 impl D3ccipr { 9663 impl C1Apb3enr {
13489 #[doc = "LPUART1 kernel clock source selection"] 9664 #[doc = "LTDC peripheral clock enable"]
13490 pub const fn lpuart1sel(&self) -> super::vals::Lpuart1sel { 9665 pub const fn ltdcen(&self) -> super::vals::C1Apb3enrLtdcen {
13491 let val = (self.0 >> 0usize) & 0x07; 9666 let val = (self.0 >> 3usize) & 0x01;
13492 super::vals::Lpuart1sel(val as u8) 9667 super::vals::C1Apb3enrLtdcen(val as u8)
13493 } 9668 }
13494 #[doc = "LPUART1 kernel clock source selection"] 9669 #[doc = "LTDC peripheral clock enable"]
13495 pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuart1sel) { 9670 pub fn set_ltdcen(&mut self, val: super::vals::C1Apb3enrLtdcen) {
13496 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); 9671 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
13497 } 9672 }
13498 #[doc = "I2C4 kernel clock source selection"] 9673 #[doc = "WWDG1 Clock Enable"]
13499 pub const fn i2c4sel(&self) -> super::vals::I2c4sel { 9674 pub const fn wwdg1en(&self) -> super::vals::C1Apb3enrLtdcen {
13500 let val = (self.0 >> 8usize) & 0x03; 9675 let val = (self.0 >> 6usize) & 0x01;
13501 super::vals::I2c4sel(val as u8) 9676 super::vals::C1Apb3enrLtdcen(val as u8)
13502 } 9677 }
13503 #[doc = "I2C4 kernel clock source selection"] 9678 #[doc = "WWDG1 Clock Enable"]
13504 pub fn set_i2c4sel(&mut self, val: super::vals::I2c4sel) { 9679 pub fn set_wwdg1en(&mut self, val: super::vals::C1Apb3enrLtdcen) {
13505 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); 9680 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
13506 } 9681 }
13507 #[doc = "LPTIM2 kernel clock source selection"] 9682 }
13508 pub const fn lptim2sel(&self) -> super::vals::Lptim2sel { 9683 impl Default for C1Apb3enr {
13509 let val = (self.0 >> 10usize) & 0x07; 9684 fn default() -> C1Apb3enr {
13510 super::vals::Lptim2sel(val as u8) 9685 C1Apb3enr(0)
13511 } 9686 }
13512 #[doc = "LPTIM2 kernel clock source selection"] 9687 }
13513 pub fn set_lptim2sel(&mut self, val: super::vals::Lptim2sel) { 9688 #[doc = "RCC PLL2 Dividers Configuration Register"]
13514 self.0 = (self.0 & !(0x07 << 10usize)) | (((val.0 as u32) & 0x07) << 10usize); 9689 #[repr(transparent)]
9690 #[derive(Copy, Clone, Eq, PartialEq)]
9691 pub struct Pll2divr(pub u32);
9692 impl Pll2divr {
9693 #[doc = "Multiplication factor for PLL1 VCO"]
9694 pub const fn divn2(&self) -> u16 {
9695 let val = (self.0 >> 0usize) & 0x01ff;
9696 val as u16
13515 } 9697 }
13516 #[doc = "LPTIM3,4,5 kernel clock source selection"] 9698 #[doc = "Multiplication factor for PLL1 VCO"]
13517 pub const fn lptim345sel(&self) -> super::vals::Lptim2sel { 9699 pub fn set_divn2(&mut self, val: u16) {
13518 let val = (self.0 >> 13usize) & 0x07; 9700 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
13519 super::vals::Lptim2sel(val as u8)
13520 } 9701 }
13521 #[doc = "LPTIM3,4,5 kernel clock source selection"] 9702 #[doc = "PLL1 DIVP division factor"]
13522 pub fn set_lptim345sel(&mut self, val: super::vals::Lptim2sel) { 9703 pub const fn divp2(&self) -> u8 {
13523 self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize); 9704 let val = (self.0 >> 9usize) & 0x7f;
9705 val as u8
13524 } 9706 }
13525 #[doc = "SAR ADC kernel clock source selection"] 9707 #[doc = "PLL1 DIVP division factor"]
13526 pub const fn adcsel(&self) -> super::vals::Adcsel { 9708 pub fn set_divp2(&mut self, val: u8) {
13527 let val = (self.0 >> 16usize) & 0x03; 9709 self.0 = (self.0 & !(0x7f << 9usize)) | (((val as u32) & 0x7f) << 9usize);
13528 super::vals::Adcsel(val as u8)
13529 } 9710 }
13530 #[doc = "SAR ADC kernel clock source selection"] 9711 #[doc = "PLL1 DIVQ division factor"]
13531 pub fn set_adcsel(&mut self, val: super::vals::Adcsel) { 9712 pub const fn divq2(&self) -> u8 {
13532 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize); 9713 let val = (self.0 >> 16usize) & 0x7f;
9714 val as u8
13533 } 9715 }
13534 #[doc = "Sub-Block A of SAI4 kernel clock source selection"] 9716 #[doc = "PLL1 DIVQ division factor"]
13535 pub const fn sai4asel(&self) -> super::vals::Sai4asel { 9717 pub fn set_divq2(&mut self, val: u8) {
13536 let val = (self.0 >> 21usize) & 0x07; 9718 self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
13537 super::vals::Sai4asel(val as u8)
13538 } 9719 }
13539 #[doc = "Sub-Block A of SAI4 kernel clock source selection"] 9720 #[doc = "PLL1 DIVR division factor"]
13540 pub fn set_sai4asel(&mut self, val: super::vals::Sai4asel) { 9721 pub const fn divr2(&self) -> u8 {
13541 self.0 = (self.0 & !(0x07 << 21usize)) | (((val.0 as u32) & 0x07) << 21usize); 9722 let val = (self.0 >> 24usize) & 0x7f;
9723 val as u8
13542 } 9724 }
13543 #[doc = "Sub-Block B of SAI4 kernel clock source selection"] 9725 #[doc = "PLL1 DIVR division factor"]
13544 pub const fn sai4bsel(&self) -> super::vals::Sai4asel { 9726 pub fn set_divr2(&mut self, val: u8) {
13545 let val = (self.0 >> 24usize) & 0x07; 9727 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
13546 super::vals::Sai4asel(val as u8)
13547 } 9728 }
13548 #[doc = "Sub-Block B of SAI4 kernel clock source selection"] 9729 }
13549 pub fn set_sai4bsel(&mut self, val: super::vals::Sai4asel) { 9730 impl Default for Pll2divr {
13550 self.0 = (self.0 & !(0x07 << 24usize)) | (((val.0 as u32) & 0x07) << 24usize); 9731 fn default() -> Pll2divr {
9732 Pll2divr(0)
13551 } 9733 }
13552 #[doc = "SPI6 kernel clock source selection"] 9734 }
13553 pub const fn spi6sel(&self) -> super::vals::Spi6sel { 9735 #[doc = "RCC APB1 High Sleep Clock Register"]
13554 let val = (self.0 >> 28usize) & 0x07; 9736 #[repr(transparent)]
13555 super::vals::Spi6sel(val as u8) 9737 #[derive(Copy, Clone, Eq, PartialEq)]
9738 pub struct C1Apb1hlpenr(pub u32);
9739 impl C1Apb1hlpenr {
9740 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
9741 pub const fn crslpen(&self) -> super::vals::C1Apb1hlpenrCrslpen {
9742 let val = (self.0 >> 1usize) & 0x01;
9743 super::vals::C1Apb1hlpenrCrslpen(val as u8)
13556 } 9744 }
13557 #[doc = "SPI6 kernel clock source selection"] 9745 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
13558 pub fn set_spi6sel(&mut self, val: super::vals::Spi6sel) { 9746 pub fn set_crslpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
13559 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); 9747 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
9748 }
9749 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
9750 pub const fn swplpen(&self) -> super::vals::C1Apb1hlpenrCrslpen {
9751 let val = (self.0 >> 2usize) & 0x01;
9752 super::vals::C1Apb1hlpenrCrslpen(val as u8)
9753 }
9754 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
9755 pub fn set_swplpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
9756 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
9757 }
9758 #[doc = "OPAMP peripheral clock enable during CSleep mode"]
9759 pub const fn opamplpen(&self) -> super::vals::C1Apb1hlpenrCrslpen {
9760 let val = (self.0 >> 4usize) & 0x01;
9761 super::vals::C1Apb1hlpenrCrslpen(val as u8)
9762 }
9763 #[doc = "OPAMP peripheral clock enable during CSleep mode"]
9764 pub fn set_opamplpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
9765 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
9766 }
9767 #[doc = "MDIOS peripheral clock enable during CSleep mode"]
9768 pub const fn mdioslpen(&self) -> super::vals::C1Apb1hlpenrCrslpen {
9769 let val = (self.0 >> 5usize) & 0x01;
9770 super::vals::C1Apb1hlpenrCrslpen(val as u8)
9771 }
9772 #[doc = "MDIOS peripheral clock enable during CSleep mode"]
9773 pub fn set_mdioslpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
9774 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
9775 }
9776 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"]
9777 pub const fn fdcanlpen(&self) -> super::vals::C1Apb1hlpenrCrslpen {
9778 let val = (self.0 >> 8usize) & 0x01;
9779 super::vals::C1Apb1hlpenrCrslpen(val as u8)
9780 }
9781 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"]
9782 pub fn set_fdcanlpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
9783 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
13560 } 9784 }
13561 } 9785 }
13562 impl Default for D3ccipr { 9786 impl Default for C1Apb1hlpenr {
13563 fn default() -> D3ccipr { 9787 fn default() -> C1Apb1hlpenr {
13564 D3ccipr(0) 9788 C1Apb1hlpenr(0)
13565 } 9789 }
13566 } 9790 }
13567 #[doc = "RCC AHB2 Sleep Clock Register"] 9791 #[doc = "RCC APB1 Clock Register"]
13568 #[repr(transparent)] 9792 #[repr(transparent)]
13569 #[derive(Copy, Clone, Eq, PartialEq)] 9793 #[derive(Copy, Clone, Eq, PartialEq)]
13570 pub struct Ahb2lpenr(pub u32); 9794 pub struct C1Apb1lenr(pub u32);
13571 impl Ahb2lpenr { 9795 impl C1Apb1lenr {
13572 #[doc = "DCMI peripheral clock enable during csleep mode"] 9796 #[doc = "TIM peripheral clock enable"]
13573 pub const fn dcmilpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9797 pub const fn tim2en(&self) -> super::vals::C1Apb1lenrTim2en {
13574 let val = (self.0 >> 0usize) & 0x01; 9798 let val = (self.0 >> 0usize) & 0x01;
13575 super::vals::Ahb2lpenrDcmilpen(val as u8) 9799 super::vals::C1Apb1lenrTim2en(val as u8)
13576 } 9800 }
13577 #[doc = "DCMI peripheral clock enable during csleep mode"] 9801 #[doc = "TIM peripheral clock enable"]
13578 pub fn set_dcmilpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 9802 pub fn set_tim2en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13579 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 9803 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13580 } 9804 }
13581 #[doc = "CRYPT peripheral clock enable during CSleep mode"] 9805 #[doc = "TIM peripheral clock enable"]
13582 pub const fn cryptlpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9806 pub const fn tim3en(&self) -> super::vals::C1Apb1lenrTim2en {
9807 let val = (self.0 >> 1usize) & 0x01;
9808 super::vals::C1Apb1lenrTim2en(val as u8)
9809 }
9810 #[doc = "TIM peripheral clock enable"]
9811 pub fn set_tim3en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9812 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
9813 }
9814 #[doc = "TIM peripheral clock enable"]
9815 pub const fn tim4en(&self) -> super::vals::C1Apb1lenrTim2en {
9816 let val = (self.0 >> 2usize) & 0x01;
9817 super::vals::C1Apb1lenrTim2en(val as u8)
9818 }
9819 #[doc = "TIM peripheral clock enable"]
9820 pub fn set_tim4en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9821 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
9822 }
9823 #[doc = "TIM peripheral clock enable"]
9824 pub const fn tim5en(&self) -> super::vals::C1Apb1lenrTim2en {
9825 let val = (self.0 >> 3usize) & 0x01;
9826 super::vals::C1Apb1lenrTim2en(val as u8)
9827 }
9828 #[doc = "TIM peripheral clock enable"]
9829 pub fn set_tim5en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9830 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
9831 }
9832 #[doc = "TIM peripheral clock enable"]
9833 pub const fn tim6en(&self) -> super::vals::C1Apb1lenrTim2en {
13583 let val = (self.0 >> 4usize) & 0x01; 9834 let val = (self.0 >> 4usize) & 0x01;
13584 super::vals::Ahb2lpenrDcmilpen(val as u8) 9835 super::vals::C1Apb1lenrTim2en(val as u8)
13585 } 9836 }
13586 #[doc = "CRYPT peripheral clock enable during CSleep mode"] 9837 #[doc = "TIM peripheral clock enable"]
13587 pub fn set_cryptlpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 9838 pub fn set_tim6en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13588 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 9839 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
13589 } 9840 }
13590 #[doc = "HASH peripheral clock enable during CSleep mode"] 9841 #[doc = "TIM peripheral clock enable"]
13591 pub const fn hashlpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9842 pub const fn tim7en(&self) -> super::vals::C1Apb1lenrTim2en {
13592 let val = (self.0 >> 5usize) & 0x01; 9843 let val = (self.0 >> 5usize) & 0x01;
13593 super::vals::Ahb2lpenrDcmilpen(val as u8) 9844 super::vals::C1Apb1lenrTim2en(val as u8)
13594 } 9845 }
13595 #[doc = "HASH peripheral clock enable during CSleep mode"] 9846 #[doc = "TIM peripheral clock enable"]
13596 pub fn set_hashlpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 9847 pub fn set_tim7en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13597 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 9848 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13598 } 9849 }
13599 #[doc = "RNG peripheral clock enable during CSleep mode"] 9850 #[doc = "TIM peripheral clock enable"]
13600 pub const fn rnglpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9851 pub const fn tim12en(&self) -> super::vals::C1Apb1lenrTim2en {
13601 let val = (self.0 >> 6usize) & 0x01; 9852 let val = (self.0 >> 6usize) & 0x01;
13602 super::vals::Ahb2lpenrDcmilpen(val as u8) 9853 super::vals::C1Apb1lenrTim2en(val as u8)
13603 } 9854 }
13604 #[doc = "RNG peripheral clock enable during CSleep mode"] 9855 #[doc = "TIM peripheral clock enable"]
13605 pub fn set_rnglpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 9856 pub fn set_tim12en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13606 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 9857 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
13607 } 9858 }
13608 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"] 9859 #[doc = "TIM peripheral clock enable"]
13609 pub const fn sdmmc2lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9860 pub const fn tim13en(&self) -> super::vals::C1Apb1lenrTim2en {
9861 let val = (self.0 >> 7usize) & 0x01;
9862 super::vals::C1Apb1lenrTim2en(val as u8)
9863 }
9864 #[doc = "TIM peripheral clock enable"]
9865 pub fn set_tim13en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9866 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
9867 }
9868 #[doc = "TIM peripheral clock enable"]
9869 pub const fn tim14en(&self) -> super::vals::C1Apb1lenrTim2en {
9870 let val = (self.0 >> 8usize) & 0x01;
9871 super::vals::C1Apb1lenrTim2en(val as u8)
9872 }
9873 #[doc = "TIM peripheral clock enable"]
9874 pub fn set_tim14en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9875 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
9876 }
9877 #[doc = "LPTIM1 Peripheral Clocks Enable"]
9878 pub const fn lptim1en(&self) -> super::vals::C1Apb1lenrTim2en {
13610 let val = (self.0 >> 9usize) & 0x01; 9879 let val = (self.0 >> 9usize) & 0x01;
13611 super::vals::Ahb2lpenrDcmilpen(val as u8) 9880 super::vals::C1Apb1lenrTim2en(val as u8)
13612 } 9881 }
13613 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"] 9882 #[doc = "LPTIM1 Peripheral Clocks Enable"]
13614 pub fn set_sdmmc2lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 9883 pub fn set_lptim1en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13615 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 9884 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
13616 } 9885 }
13617 #[doc = "SRAM1 Clock Enable During CSleep Mode"] 9886 #[doc = "SPI2 Peripheral Clocks Enable"]
13618 pub const fn sram1lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9887 pub const fn spi2en(&self) -> super::vals::C1Apb1lenrTim2en {
9888 let val = (self.0 >> 14usize) & 0x01;
9889 super::vals::C1Apb1lenrTim2en(val as u8)
9890 }
9891 #[doc = "SPI2 Peripheral Clocks Enable"]
9892 pub fn set_spi2en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9893 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
9894 }
9895 #[doc = "SPI3 Peripheral Clocks Enable"]
9896 pub const fn spi3en(&self) -> super::vals::C1Apb1lenrTim2en {
9897 let val = (self.0 >> 15usize) & 0x01;
9898 super::vals::C1Apb1lenrTim2en(val as u8)
9899 }
9900 #[doc = "SPI3 Peripheral Clocks Enable"]
9901 pub fn set_spi3en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9902 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
9903 }
9904 #[doc = "SPDIFRX Peripheral Clocks Enable"]
9905 pub const fn spdifrxen(&self) -> super::vals::C1Apb1lenrTim2en {
9906 let val = (self.0 >> 16usize) & 0x01;
9907 super::vals::C1Apb1lenrTim2en(val as u8)
9908 }
9909 #[doc = "SPDIFRX Peripheral Clocks Enable"]
9910 pub fn set_spdifrxen(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9911 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
9912 }
9913 #[doc = "USART2 Peripheral Clocks Enable"]
9914 pub const fn usart2en(&self) -> super::vals::C1Apb1lenrTim2en {
9915 let val = (self.0 >> 17usize) & 0x01;
9916 super::vals::C1Apb1lenrTim2en(val as u8)
9917 }
9918 #[doc = "USART2 Peripheral Clocks Enable"]
9919 pub fn set_usart2en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9920 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
9921 }
9922 #[doc = "USART3 Peripheral Clocks Enable"]
9923 pub const fn usart3en(&self) -> super::vals::C1Apb1lenrTim2en {
9924 let val = (self.0 >> 18usize) & 0x01;
9925 super::vals::C1Apb1lenrTim2en(val as u8)
9926 }
9927 #[doc = "USART3 Peripheral Clocks Enable"]
9928 pub fn set_usart3en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9929 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
9930 }
9931 #[doc = "UART4 Peripheral Clocks Enable"]
9932 pub const fn uart4en(&self) -> super::vals::C1Apb1lenrTim2en {
9933 let val = (self.0 >> 19usize) & 0x01;
9934 super::vals::C1Apb1lenrTim2en(val as u8)
9935 }
9936 #[doc = "UART4 Peripheral Clocks Enable"]
9937 pub fn set_uart4en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9938 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
9939 }
9940 #[doc = "UART5 Peripheral Clocks Enable"]
9941 pub const fn uart5en(&self) -> super::vals::C1Apb1lenrTim2en {
9942 let val = (self.0 >> 20usize) & 0x01;
9943 super::vals::C1Apb1lenrTim2en(val as u8)
9944 }
9945 #[doc = "UART5 Peripheral Clocks Enable"]
9946 pub fn set_uart5en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9947 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
9948 }
9949 #[doc = "I2C1 Peripheral Clocks Enable"]
9950 pub const fn i2c1en(&self) -> super::vals::C1Apb1lenrTim2en {
9951 let val = (self.0 >> 21usize) & 0x01;
9952 super::vals::C1Apb1lenrTim2en(val as u8)
9953 }
9954 #[doc = "I2C1 Peripheral Clocks Enable"]
9955 pub fn set_i2c1en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9956 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
9957 }
9958 #[doc = "I2C2 Peripheral Clocks Enable"]
9959 pub const fn i2c2en(&self) -> super::vals::C1Apb1lenrTim2en {
9960 let val = (self.0 >> 22usize) & 0x01;
9961 super::vals::C1Apb1lenrTim2en(val as u8)
9962 }
9963 #[doc = "I2C2 Peripheral Clocks Enable"]
9964 pub fn set_i2c2en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9965 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
9966 }
9967 #[doc = "I2C3 Peripheral Clocks Enable"]
9968 pub const fn i2c3en(&self) -> super::vals::C1Apb1lenrTim2en {
9969 let val = (self.0 >> 23usize) & 0x01;
9970 super::vals::C1Apb1lenrTim2en(val as u8)
9971 }
9972 #[doc = "I2C3 Peripheral Clocks Enable"]
9973 pub fn set_i2c3en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9974 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
9975 }
9976 #[doc = "HDMI-CEC peripheral clock enable"]
9977 pub const fn cecen(&self) -> super::vals::C1Apb1lenrTim2en {
9978 let val = (self.0 >> 27usize) & 0x01;
9979 super::vals::C1Apb1lenrTim2en(val as u8)
9980 }
9981 #[doc = "HDMI-CEC peripheral clock enable"]
9982 pub fn set_cecen(&mut self, val: super::vals::C1Apb1lenrTim2en) {
9983 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
9984 }
9985 #[doc = "DAC1&2 peripheral clock enable"]
9986 pub const fn dac12en(&self) -> super::vals::C1Apb1lenrTim2en {
13619 let val = (self.0 >> 29usize) & 0x01; 9987 let val = (self.0 >> 29usize) & 0x01;
13620 super::vals::Ahb2lpenrDcmilpen(val as u8) 9988 super::vals::C1Apb1lenrTim2en(val as u8)
13621 } 9989 }
13622 #[doc = "SRAM1 Clock Enable During CSleep Mode"] 9990 #[doc = "DAC1&2 peripheral clock enable"]
13623 pub fn set_sram1lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 9991 pub fn set_dac12en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13624 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 9992 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
13625 } 9993 }
13626 #[doc = "SRAM2 Clock Enable During CSleep Mode"] 9994 #[doc = "UART7 Peripheral Clocks Enable"]
13627 pub const fn sram2lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 9995 pub const fn uart7en(&self) -> super::vals::C1Apb1lenrTim2en {
13628 let val = (self.0 >> 30usize) & 0x01; 9996 let val = (self.0 >> 30usize) & 0x01;
13629 super::vals::Ahb2lpenrDcmilpen(val as u8) 9997 super::vals::C1Apb1lenrTim2en(val as u8)
13630 } 9998 }
13631 #[doc = "SRAM2 Clock Enable During CSleep Mode"] 9999 #[doc = "UART7 Peripheral Clocks Enable"]
13632 pub fn set_sram2lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 10000 pub fn set_uart7en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13633 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); 10001 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
13634 } 10002 }
13635 #[doc = "SRAM3 Clock Enable During CSleep Mode"] 10003 #[doc = "UART8 Peripheral Clocks Enable"]
13636 pub const fn sram3lpen(&self) -> super::vals::Ahb2lpenrDcmilpen { 10004 pub const fn uart8en(&self) -> super::vals::C1Apb1lenrTim2en {
13637 let val = (self.0 >> 31usize) & 0x01; 10005 let val = (self.0 >> 31usize) & 0x01;
13638 super::vals::Ahb2lpenrDcmilpen(val as u8) 10006 super::vals::C1Apb1lenrTim2en(val as u8)
13639 } 10007 }
13640 #[doc = "SRAM3 Clock Enable During CSleep Mode"] 10008 #[doc = "UART8 Peripheral Clocks Enable"]
13641 pub fn set_sram3lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) { 10009 pub fn set_uart8en(&mut self, val: super::vals::C1Apb1lenrTim2en) {
13642 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 10010 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
13643 } 10011 }
13644 } 10012 }
13645 impl Default for Ahb2lpenr { 10013 impl Default for C1Apb1lenr {
13646 fn default() -> Ahb2lpenr { 10014 fn default() -> C1Apb1lenr {
13647 Ahb2lpenr(0) 10015 C1Apb1lenr(0)
13648 } 10016 }
13649 } 10017 }
13650 #[doc = "RCC AHB3 Clock Register"] 10018 #[doc = "RCC APB1 Low Sleep Clock Register"]
13651 #[repr(transparent)] 10019 #[repr(transparent)]
13652 #[derive(Copy, Clone, Eq, PartialEq)] 10020 #[derive(Copy, Clone, Eq, PartialEq)]
13653 pub struct C1Ahb3enr(pub u32); 10021 pub struct Apb1llpenr(pub u32);
13654 impl C1Ahb3enr { 10022 impl Apb1llpenr {
13655 #[doc = "MDMA Peripheral Clock Enable"] 10023 #[doc = "TIM2 peripheral clock enable during CSleep mode"]
13656 pub const fn mdmaen(&self) -> super::vals::C1Ahb3enrMdmaen { 10024 pub const fn tim2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
13657 let val = (self.0 >> 0usize) & 0x01; 10025 let val = (self.0 >> 0usize) & 0x01;
13658 super::vals::C1Ahb3enrMdmaen(val as u8) 10026 super::vals::Apb1llpenrTim2lpen(val as u8)
13659 } 10027 }
13660 #[doc = "MDMA Peripheral Clock Enable"] 10028 #[doc = "TIM2 peripheral clock enable during CSleep mode"]
13661 pub fn set_mdmaen(&mut self, val: super::vals::C1Ahb3enrMdmaen) { 10029 pub fn set_tim2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
13662 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 10030 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13663 } 10031 }
13664 #[doc = "DMA2D Peripheral Clock Enable"] 10032 #[doc = "TIM3 peripheral clock enable during CSleep mode"]
13665 pub const fn dma2den(&self) -> super::vals::C1Ahb3enrMdmaen { 10033 pub const fn tim3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10034 let val = (self.0 >> 1usize) & 0x01;
10035 super::vals::Apb1llpenrTim2lpen(val as u8)
10036 }
10037 #[doc = "TIM3 peripheral clock enable during CSleep mode"]
10038 pub fn set_tim3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10039 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10040 }
10041 #[doc = "TIM4 peripheral clock enable during CSleep mode"]
10042 pub const fn tim4lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10043 let val = (self.0 >> 2usize) & 0x01;
10044 super::vals::Apb1llpenrTim2lpen(val as u8)
10045 }
10046 #[doc = "TIM4 peripheral clock enable during CSleep mode"]
10047 pub fn set_tim4lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10048 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
10049 }
10050 #[doc = "TIM5 peripheral clock enable during CSleep mode"]
10051 pub const fn tim5lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10052 let val = (self.0 >> 3usize) & 0x01;
10053 super::vals::Apb1llpenrTim2lpen(val as u8)
10054 }
10055 #[doc = "TIM5 peripheral clock enable during CSleep mode"]
10056 pub fn set_tim5lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10057 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
10058 }
10059 #[doc = "TIM6 peripheral clock enable during CSleep mode"]
10060 pub const fn tim6lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
13666 let val = (self.0 >> 4usize) & 0x01; 10061 let val = (self.0 >> 4usize) & 0x01;
13667 super::vals::C1Ahb3enrMdmaen(val as u8) 10062 super::vals::Apb1llpenrTim2lpen(val as u8)
13668 } 10063 }
13669 #[doc = "DMA2D Peripheral Clock Enable"] 10064 #[doc = "TIM6 peripheral clock enable during CSleep mode"]
13670 pub fn set_dma2den(&mut self, val: super::vals::C1Ahb3enrMdmaen) { 10065 pub fn set_tim6lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
13671 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 10066 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
13672 } 10067 }
13673 #[doc = "JPGDEC Peripheral Clock Enable"] 10068 #[doc = "TIM7 peripheral clock enable during CSleep mode"]
13674 pub const fn jpgdecen(&self) -> super::vals::C1Ahb3enrMdmaen { 10069 pub const fn tim7lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
13675 let val = (self.0 >> 5usize) & 0x01; 10070 let val = (self.0 >> 5usize) & 0x01;
13676 super::vals::C1Ahb3enrMdmaen(val as u8) 10071 super::vals::Apb1llpenrTim2lpen(val as u8)
13677 } 10072 }
13678 #[doc = "JPGDEC Peripheral Clock Enable"] 10073 #[doc = "TIM7 peripheral clock enable during CSleep mode"]
13679 pub fn set_jpgdecen(&mut self, val: super::vals::C1Ahb3enrMdmaen) { 10074 pub fn set_tim7lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
13680 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 10075 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13681 } 10076 }
13682 #[doc = "FMC Peripheral Clocks Enable"] 10077 #[doc = "TIM12 peripheral clock enable during CSleep mode"]
13683 pub const fn fmcen(&self) -> super::vals::C1Ahb3enrMdmaen { 10078 pub const fn tim12lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
13684 let val = (self.0 >> 12usize) & 0x01; 10079 let val = (self.0 >> 6usize) & 0x01;
13685 super::vals::C1Ahb3enrMdmaen(val as u8) 10080 super::vals::Apb1llpenrTim2lpen(val as u8)
13686 } 10081 }
13687 #[doc = "FMC Peripheral Clocks Enable"] 10082 #[doc = "TIM12 peripheral clock enable during CSleep mode"]
13688 pub fn set_fmcen(&mut self, val: super::vals::C1Ahb3enrMdmaen) { 10083 pub fn set_tim12lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
13689 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 10084 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
13690 } 10085 }
13691 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"] 10086 #[doc = "TIM13 peripheral clock enable during CSleep mode"]
13692 pub const fn qspien(&self) -> super::vals::C1Ahb3enrMdmaen { 10087 pub const fn tim13lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10088 let val = (self.0 >> 7usize) & 0x01;
10089 super::vals::Apb1llpenrTim2lpen(val as u8)
10090 }
10091 #[doc = "TIM13 peripheral clock enable during CSleep mode"]
10092 pub fn set_tim13lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10093 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
10094 }
10095 #[doc = "TIM14 peripheral clock enable during CSleep mode"]
10096 pub const fn tim14lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10097 let val = (self.0 >> 8usize) & 0x01;
10098 super::vals::Apb1llpenrTim2lpen(val as u8)
10099 }
10100 #[doc = "TIM14 peripheral clock enable during CSleep mode"]
10101 pub fn set_tim14lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10102 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
10103 }
10104 #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"]
10105 pub const fn lptim1lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10106 let val = (self.0 >> 9usize) & 0x01;
10107 super::vals::Apb1llpenrTim2lpen(val as u8)
10108 }
10109 #[doc = "LPTIM1 Peripheral Clocks Enable During CSleep Mode"]
10110 pub fn set_lptim1lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10111 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
10112 }
10113 #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"]
10114 pub const fn spi2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
13693 let val = (self.0 >> 14usize) & 0x01; 10115 let val = (self.0 >> 14usize) & 0x01;
13694 super::vals::C1Ahb3enrMdmaen(val as u8) 10116 super::vals::Apb1llpenrTim2lpen(val as u8)
13695 } 10117 }
13696 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"] 10118 #[doc = "SPI2 Peripheral Clocks Enable During CSleep Mode"]
13697 pub fn set_qspien(&mut self, val: super::vals::C1Ahb3enrMdmaen) { 10119 pub fn set_spi2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
13698 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 10120 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
13699 } 10121 }
13700 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"] 10122 #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"]
13701 pub const fn sdmmc1en(&self) -> super::vals::C1Ahb3enrMdmaen { 10123 pub const fn spi3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10124 let val = (self.0 >> 15usize) & 0x01;
10125 super::vals::Apb1llpenrTim2lpen(val as u8)
10126 }
10127 #[doc = "SPI3 Peripheral Clocks Enable During CSleep Mode"]
10128 pub fn set_spi3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10129 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
10130 }
10131 #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"]
10132 pub const fn spdifrxlpen(&self) -> super::vals::Apb1llpenrTim2lpen {
13702 let val = (self.0 >> 16usize) & 0x01; 10133 let val = (self.0 >> 16usize) & 0x01;
13703 super::vals::C1Ahb3enrMdmaen(val as u8) 10134 super::vals::Apb1llpenrTim2lpen(val as u8)
13704 } 10135 }
13705 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"] 10136 #[doc = "SPDIFRX Peripheral Clocks Enable During CSleep Mode"]
13706 pub fn set_sdmmc1en(&mut self, val: super::vals::C1Ahb3enrMdmaen) { 10137 pub fn set_spdifrxlpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
13707 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 10138 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
13708 } 10139 }
10140 #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"]
10141 pub const fn usart2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10142 let val = (self.0 >> 17usize) & 0x01;
10143 super::vals::Apb1llpenrTim2lpen(val as u8)
10144 }
10145 #[doc = "USART2 Peripheral Clocks Enable During CSleep Mode"]
10146 pub fn set_usart2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10147 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
10148 }
10149 #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"]
10150 pub const fn usart3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10151 let val = (self.0 >> 18usize) & 0x01;
10152 super::vals::Apb1llpenrTim2lpen(val as u8)
10153 }
10154 #[doc = "USART3 Peripheral Clocks Enable During CSleep Mode"]
10155 pub fn set_usart3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10156 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
10157 }
10158 #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"]
10159 pub const fn uart4lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10160 let val = (self.0 >> 19usize) & 0x01;
10161 super::vals::Apb1llpenrTim2lpen(val as u8)
10162 }
10163 #[doc = "UART4 Peripheral Clocks Enable During CSleep Mode"]
10164 pub fn set_uart4lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10165 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
10166 }
10167 #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"]
10168 pub const fn uart5lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10169 let val = (self.0 >> 20usize) & 0x01;
10170 super::vals::Apb1llpenrTim2lpen(val as u8)
10171 }
10172 #[doc = "UART5 Peripheral Clocks Enable During CSleep Mode"]
10173 pub fn set_uart5lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10174 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
10175 }
10176 #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"]
10177 pub const fn i2c1lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10178 let val = (self.0 >> 21usize) & 0x01;
10179 super::vals::Apb1llpenrTim2lpen(val as u8)
10180 }
10181 #[doc = "I2C1 Peripheral Clocks Enable During CSleep Mode"]
10182 pub fn set_i2c1lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10183 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
10184 }
10185 #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"]
10186 pub const fn i2c2lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10187 let val = (self.0 >> 22usize) & 0x01;
10188 super::vals::Apb1llpenrTim2lpen(val as u8)
10189 }
10190 #[doc = "I2C2 Peripheral Clocks Enable During CSleep Mode"]
10191 pub fn set_i2c2lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10192 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
10193 }
10194 #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"]
10195 pub const fn i2c3lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10196 let val = (self.0 >> 23usize) & 0x01;
10197 super::vals::Apb1llpenrTim2lpen(val as u8)
10198 }
10199 #[doc = "I2C3 Peripheral Clocks Enable During CSleep Mode"]
10200 pub fn set_i2c3lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10201 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
10202 }
10203 #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"]
10204 pub const fn ceclpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10205 let val = (self.0 >> 27usize) & 0x01;
10206 super::vals::Apb1llpenrTim2lpen(val as u8)
10207 }
10208 #[doc = "HDMI-CEC Peripheral Clocks Enable During CSleep Mode"]
10209 pub fn set_ceclpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10210 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
10211 }
10212 #[doc = "DAC1/2 peripheral clock enable during CSleep mode"]
10213 pub const fn dac12lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10214 let val = (self.0 >> 29usize) & 0x01;
10215 super::vals::Apb1llpenrTim2lpen(val as u8)
10216 }
10217 #[doc = "DAC1/2 peripheral clock enable during CSleep mode"]
10218 pub fn set_dac12lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10219 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
10220 }
10221 #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"]
10222 pub const fn uart7lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10223 let val = (self.0 >> 30usize) & 0x01;
10224 super::vals::Apb1llpenrTim2lpen(val as u8)
10225 }
10226 #[doc = "UART7 Peripheral Clocks Enable During CSleep Mode"]
10227 pub fn set_uart7lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10228 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
10229 }
10230 #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"]
10231 pub const fn uart8lpen(&self) -> super::vals::Apb1llpenrTim2lpen {
10232 let val = (self.0 >> 31usize) & 0x01;
10233 super::vals::Apb1llpenrTim2lpen(val as u8)
10234 }
10235 #[doc = "UART8 Peripheral Clocks Enable During CSleep Mode"]
10236 pub fn set_uart8lpen(&mut self, val: super::vals::Apb1llpenrTim2lpen) {
10237 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
10238 }
13709 } 10239 }
13710 impl Default for C1Ahb3enr { 10240 impl Default for Apb1llpenr {
13711 fn default() -> C1Ahb3enr { 10241 fn default() -> Apb1llpenr {
13712 C1Ahb3enr(0) 10242 Apb1llpenr(0)
10243 }
10244 }
10245 #[doc = "RCC PLL3 Fractional Divider Register"]
10246 #[repr(transparent)]
10247 #[derive(Copy, Clone, Eq, PartialEq)]
10248 pub struct Pll3fracr(pub u32);
10249 impl Pll3fracr {
10250 #[doc = "Fractional part of the multiplication factor for PLL3 VCO"]
10251 pub const fn fracn3(&self) -> u16 {
10252 let val = (self.0 >> 3usize) & 0x1fff;
10253 val as u16
10254 }
10255 #[doc = "Fractional part of the multiplication factor for PLL3 VCO"]
10256 pub fn set_fracn3(&mut self, val: u16) {
10257 self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize);
10258 }
10259 }
10260 impl Default for Pll3fracr {
10261 fn default() -> Pll3fracr {
10262 Pll3fracr(0)
13713 } 10263 }
13714 } 10264 }
13715 #[doc = "RCC APB1 Low Sleep Clock Register"] 10265 #[doc = "RCC APB1 Low Sleep Clock Register"]
@@ -13939,6 +10489,360 @@ pub mod rcc_h7 {
13939 C1Apb1llpenr(0) 10489 C1Apb1llpenr(0)
13940 } 10490 }
13941 } 10491 }
10492 #[doc = "RCC PLL1 Dividers Configuration Register"]
10493 #[repr(transparent)]
10494 #[derive(Copy, Clone, Eq, PartialEq)]
10495 pub struct Pll1divr(pub u32);
10496 impl Pll1divr {
10497 #[doc = "Multiplication factor for PLL1 VCO"]
10498 pub const fn divn1(&self) -> u16 {
10499 let val = (self.0 >> 0usize) & 0x01ff;
10500 val as u16
10501 }
10502 #[doc = "Multiplication factor for PLL1 VCO"]
10503 pub fn set_divn1(&mut self, val: u16) {
10504 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
10505 }
10506 #[doc = "PLL1 DIVP division factor"]
10507 pub const fn divp1(&self) -> super::vals::Divp1 {
10508 let val = (self.0 >> 9usize) & 0x7f;
10509 super::vals::Divp1(val as u8)
10510 }
10511 #[doc = "PLL1 DIVP division factor"]
10512 pub fn set_divp1(&mut self, val: super::vals::Divp1) {
10513 self.0 = (self.0 & !(0x7f << 9usize)) | (((val.0 as u32) & 0x7f) << 9usize);
10514 }
10515 #[doc = "PLL1 DIVQ division factor"]
10516 pub const fn divq1(&self) -> u8 {
10517 let val = (self.0 >> 16usize) & 0x7f;
10518 val as u8
10519 }
10520 #[doc = "PLL1 DIVQ division factor"]
10521 pub fn set_divq1(&mut self, val: u8) {
10522 self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
10523 }
10524 #[doc = "PLL1 DIVR division factor"]
10525 pub const fn divr1(&self) -> u8 {
10526 let val = (self.0 >> 24usize) & 0x7f;
10527 val as u8
10528 }
10529 #[doc = "PLL1 DIVR division factor"]
10530 pub fn set_divr1(&mut self, val: u8) {
10531 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
10532 }
10533 }
10534 impl Default for Pll1divr {
10535 fn default() -> Pll1divr {
10536 Pll1divr(0)
10537 }
10538 }
10539 #[doc = "RCC Clock Control and Status Register"]
10540 #[repr(transparent)]
10541 #[derive(Copy, Clone, Eq, PartialEq)]
10542 pub struct Csr(pub u32);
10543 impl Csr {
10544 #[doc = "LSI oscillator enable"]
10545 pub const fn lsion(&self) -> super::vals::Lsion {
10546 let val = (self.0 >> 0usize) & 0x01;
10547 super::vals::Lsion(val as u8)
10548 }
10549 #[doc = "LSI oscillator enable"]
10550 pub fn set_lsion(&mut self, val: super::vals::Lsion) {
10551 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10552 }
10553 #[doc = "LSI oscillator ready"]
10554 pub const fn lsirdy(&self) -> bool {
10555 let val = (self.0 >> 1usize) & 0x01;
10556 val != 0
10557 }
10558 #[doc = "LSI oscillator ready"]
10559 pub fn set_lsirdy(&mut self, val: bool) {
10560 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
10561 }
10562 }
10563 impl Default for Csr {
10564 fn default() -> Csr {
10565 Csr(0)
10566 }
10567 }
10568 #[doc = "RCC PLL3 Dividers Configuration Register"]
10569 #[repr(transparent)]
10570 #[derive(Copy, Clone, Eq, PartialEq)]
10571 pub struct Pll3divr(pub u32);
10572 impl Pll3divr {
10573 #[doc = "Multiplication factor for PLL1 VCO"]
10574 pub const fn divn3(&self) -> u16 {
10575 let val = (self.0 >> 0usize) & 0x01ff;
10576 val as u16
10577 }
10578 #[doc = "Multiplication factor for PLL1 VCO"]
10579 pub fn set_divn3(&mut self, val: u16) {
10580 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
10581 }
10582 #[doc = "PLL DIVP division factor"]
10583 pub const fn divp3(&self) -> u8 {
10584 let val = (self.0 >> 9usize) & 0x7f;
10585 val as u8
10586 }
10587 #[doc = "PLL DIVP division factor"]
10588 pub fn set_divp3(&mut self, val: u8) {
10589 self.0 = (self.0 & !(0x7f << 9usize)) | (((val as u32) & 0x7f) << 9usize);
10590 }
10591 #[doc = "PLL DIVQ division factor"]
10592 pub const fn divq3(&self) -> u8 {
10593 let val = (self.0 >> 16usize) & 0x7f;
10594 val as u8
10595 }
10596 #[doc = "PLL DIVQ division factor"]
10597 pub fn set_divq3(&mut self, val: u8) {
10598 self.0 = (self.0 & !(0x7f << 16usize)) | (((val as u32) & 0x7f) << 16usize);
10599 }
10600 #[doc = "PLL DIVR division factor"]
10601 pub const fn divr3(&self) -> u8 {
10602 let val = (self.0 >> 24usize) & 0x7f;
10603 val as u8
10604 }
10605 #[doc = "PLL DIVR division factor"]
10606 pub fn set_divr3(&mut self, val: u8) {
10607 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
10608 }
10609 }
10610 impl Default for Pll3divr {
10611 fn default() -> Pll3divr {
10612 Pll3divr(0)
10613 }
10614 }
10615 #[doc = "RCC APB1 High Sleep Clock Register"]
10616 #[repr(transparent)]
10617 #[derive(Copy, Clone, Eq, PartialEq)]
10618 pub struct Apb1hlpenr(pub u32);
10619 impl Apb1hlpenr {
10620 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
10621 pub const fn crslpen(&self) -> super::vals::Apb1hlpenrCrslpen {
10622 let val = (self.0 >> 1usize) & 0x01;
10623 super::vals::Apb1hlpenrCrslpen(val as u8)
10624 }
10625 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
10626 pub fn set_crslpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
10627 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10628 }
10629 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
10630 pub const fn swplpen(&self) -> super::vals::Apb1hlpenrCrslpen {
10631 let val = (self.0 >> 2usize) & 0x01;
10632 super::vals::Apb1hlpenrCrslpen(val as u8)
10633 }
10634 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
10635 pub fn set_swplpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
10636 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
10637 }
10638 #[doc = "OPAMP peripheral clock enable during CSleep mode"]
10639 pub const fn opamplpen(&self) -> super::vals::Apb1hlpenrCrslpen {
10640 let val = (self.0 >> 4usize) & 0x01;
10641 super::vals::Apb1hlpenrCrslpen(val as u8)
10642 }
10643 #[doc = "OPAMP peripheral clock enable during CSleep mode"]
10644 pub fn set_opamplpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
10645 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
10646 }
10647 #[doc = "MDIOS peripheral clock enable during CSleep mode"]
10648 pub const fn mdioslpen(&self) -> super::vals::Apb1hlpenrCrslpen {
10649 let val = (self.0 >> 5usize) & 0x01;
10650 super::vals::Apb1hlpenrCrslpen(val as u8)
10651 }
10652 #[doc = "MDIOS peripheral clock enable during CSleep mode"]
10653 pub fn set_mdioslpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
10654 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10655 }
10656 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"]
10657 pub const fn fdcanlpen(&self) -> super::vals::Apb1hlpenrCrslpen {
10658 let val = (self.0 >> 8usize) & 0x01;
10659 super::vals::Apb1hlpenrCrslpen(val as u8)
10660 }
10661 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"]
10662 pub fn set_fdcanlpen(&mut self, val: super::vals::Apb1hlpenrCrslpen) {
10663 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
10664 }
10665 }
10666 impl Default for Apb1hlpenr {
10667 fn default() -> Apb1hlpenr {
10668 Apb1hlpenr(0)
10669 }
10670 }
10671 #[doc = "RCC HSI configuration register"]
10672 #[repr(transparent)]
10673 #[derive(Copy, Clone, Eq, PartialEq)]
10674 pub struct Hsicfgr(pub u32);
10675 impl Hsicfgr {
10676 #[doc = "HSI clock calibration"]
10677 pub const fn hsical(&self) -> u16 {
10678 let val = (self.0 >> 0usize) & 0x0fff;
10679 val as u16
10680 }
10681 #[doc = "HSI clock calibration"]
10682 pub fn set_hsical(&mut self, val: u16) {
10683 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
10684 }
10685 #[doc = "HSI clock trimming"]
10686 pub const fn hsitrim(&self) -> u8 {
10687 let val = (self.0 >> 24usize) & 0x7f;
10688 val as u8
10689 }
10690 #[doc = "HSI clock trimming"]
10691 pub fn set_hsitrim(&mut self, val: u8) {
10692 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize);
10693 }
10694 }
10695 impl Default for Hsicfgr {
10696 fn default() -> Hsicfgr {
10697 Hsicfgr(0)
10698 }
10699 }
10700 #[doc = "RCC APB2 Clock Register"]
10701 #[repr(transparent)]
10702 #[derive(Copy, Clone, Eq, PartialEq)]
10703 pub struct Apb2enr(pub u32);
10704 impl Apb2enr {
10705 #[doc = "TIM1 peripheral clock enable"]
10706 pub const fn tim1en(&self) -> super::vals::Apb2enrTim1en {
10707 let val = (self.0 >> 0usize) & 0x01;
10708 super::vals::Apb2enrTim1en(val as u8)
10709 }
10710 #[doc = "TIM1 peripheral clock enable"]
10711 pub fn set_tim1en(&mut self, val: super::vals::Apb2enrTim1en) {
10712 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
10713 }
10714 #[doc = "TIM8 peripheral clock enable"]
10715 pub const fn tim8en(&self) -> super::vals::Apb2enrTim1en {
10716 let val = (self.0 >> 1usize) & 0x01;
10717 super::vals::Apb2enrTim1en(val as u8)
10718 }
10719 #[doc = "TIM8 peripheral clock enable"]
10720 pub fn set_tim8en(&mut self, val: super::vals::Apb2enrTim1en) {
10721 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
10722 }
10723 #[doc = "USART1 Peripheral Clocks Enable"]
10724 pub const fn usart1en(&self) -> super::vals::Apb2enrTim1en {
10725 let val = (self.0 >> 4usize) & 0x01;
10726 super::vals::Apb2enrTim1en(val as u8)
10727 }
10728 #[doc = "USART1 Peripheral Clocks Enable"]
10729 pub fn set_usart1en(&mut self, val: super::vals::Apb2enrTim1en) {
10730 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
10731 }
10732 #[doc = "USART6 Peripheral Clocks Enable"]
10733 pub const fn usart6en(&self) -> super::vals::Apb2enrTim1en {
10734 let val = (self.0 >> 5usize) & 0x01;
10735 super::vals::Apb2enrTim1en(val as u8)
10736 }
10737 #[doc = "USART6 Peripheral Clocks Enable"]
10738 pub fn set_usart6en(&mut self, val: super::vals::Apb2enrTim1en) {
10739 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
10740 }
10741 #[doc = "SPI1 Peripheral Clocks Enable"]
10742 pub const fn spi1en(&self) -> super::vals::Apb2enrTim1en {
10743 let val = (self.0 >> 12usize) & 0x01;
10744 super::vals::Apb2enrTim1en(val as u8)
10745 }
10746 #[doc = "SPI1 Peripheral Clocks Enable"]
10747 pub fn set_spi1en(&mut self, val: super::vals::Apb2enrTim1en) {
10748 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
10749 }
10750 #[doc = "SPI4 Peripheral Clocks Enable"]
10751 pub const fn spi4en(&self) -> super::vals::Apb2enrTim1en {
10752 let val = (self.0 >> 13usize) & 0x01;
10753 super::vals::Apb2enrTim1en(val as u8)
10754 }
10755 #[doc = "SPI4 Peripheral Clocks Enable"]
10756 pub fn set_spi4en(&mut self, val: super::vals::Apb2enrTim1en) {
10757 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
10758 }
10759 #[doc = "TIM15 peripheral clock enable"]
10760 pub const fn tim15en(&self) -> super::vals::Apb2enrTim1en {
10761 let val = (self.0 >> 16usize) & 0x01;
10762 super::vals::Apb2enrTim1en(val as u8)
10763 }
10764 #[doc = "TIM15 peripheral clock enable"]
10765 pub fn set_tim15en(&mut self, val: super::vals::Apb2enrTim1en) {
10766 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
10767 }
10768 #[doc = "TIM16 peripheral clock enable"]
10769 pub const fn tim16en(&self) -> super::vals::Apb2enrTim1en {
10770 let val = (self.0 >> 17usize) & 0x01;
10771 super::vals::Apb2enrTim1en(val as u8)
10772 }
10773 #[doc = "TIM16 peripheral clock enable"]
10774 pub fn set_tim16en(&mut self, val: super::vals::Apb2enrTim1en) {
10775 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
10776 }
10777 #[doc = "TIM17 peripheral clock enable"]
10778 pub const fn tim17en(&self) -> super::vals::Apb2enrTim1en {
10779 let val = (self.0 >> 18usize) & 0x01;
10780 super::vals::Apb2enrTim1en(val as u8)
10781 }
10782 #[doc = "TIM17 peripheral clock enable"]
10783 pub fn set_tim17en(&mut self, val: super::vals::Apb2enrTim1en) {
10784 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
10785 }
10786 #[doc = "SPI5 Peripheral Clocks Enable"]
10787 pub const fn spi5en(&self) -> super::vals::Apb2enrTim1en {
10788 let val = (self.0 >> 20usize) & 0x01;
10789 super::vals::Apb2enrTim1en(val as u8)
10790 }
10791 #[doc = "SPI5 Peripheral Clocks Enable"]
10792 pub fn set_spi5en(&mut self, val: super::vals::Apb2enrTim1en) {
10793 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
10794 }
10795 #[doc = "SAI1 Peripheral Clocks Enable"]
10796 pub const fn sai1en(&self) -> super::vals::Apb2enrTim1en {
10797 let val = (self.0 >> 22usize) & 0x01;
10798 super::vals::Apb2enrTim1en(val as u8)
10799 }
10800 #[doc = "SAI1 Peripheral Clocks Enable"]
10801 pub fn set_sai1en(&mut self, val: super::vals::Apb2enrTim1en) {
10802 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
10803 }
10804 #[doc = "SAI2 Peripheral Clocks Enable"]
10805 pub const fn sai2en(&self) -> super::vals::Apb2enrTim1en {
10806 let val = (self.0 >> 23usize) & 0x01;
10807 super::vals::Apb2enrTim1en(val as u8)
10808 }
10809 #[doc = "SAI2 Peripheral Clocks Enable"]
10810 pub fn set_sai2en(&mut self, val: super::vals::Apb2enrTim1en) {
10811 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
10812 }
10813 #[doc = "SAI3 Peripheral Clocks Enable"]
10814 pub const fn sai3en(&self) -> super::vals::Apb2enrTim1en {
10815 let val = (self.0 >> 24usize) & 0x01;
10816 super::vals::Apb2enrTim1en(val as u8)
10817 }
10818 #[doc = "SAI3 Peripheral Clocks Enable"]
10819 pub fn set_sai3en(&mut self, val: super::vals::Apb2enrTim1en) {
10820 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
10821 }
10822 #[doc = "DFSDM1 Peripheral Clocks Enable"]
10823 pub const fn dfsdm1en(&self) -> super::vals::Apb2enrTim1en {
10824 let val = (self.0 >> 28usize) & 0x01;
10825 super::vals::Apb2enrTim1en(val as u8)
10826 }
10827 #[doc = "DFSDM1 Peripheral Clocks Enable"]
10828 pub fn set_dfsdm1en(&mut self, val: super::vals::Apb2enrTim1en) {
10829 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
10830 }
10831 #[doc = "HRTIM peripheral clock enable"]
10832 pub const fn hrtimen(&self) -> super::vals::Apb2enrTim1en {
10833 let val = (self.0 >> 29usize) & 0x01;
10834 super::vals::Apb2enrTim1en(val as u8)
10835 }
10836 #[doc = "HRTIM peripheral clock enable"]
10837 pub fn set_hrtimen(&mut self, val: super::vals::Apb2enrTim1en) {
10838 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
10839 }
10840 }
10841 impl Default for Apb2enr {
10842 fn default() -> Apb2enr {
10843 Apb2enr(0)
10844 }
10845 }
13942 #[doc = "RCC AHB3 Sleep Clock Register"] 10846 #[doc = "RCC AHB3 Sleep Clock Register"]
13943 #[repr(transparent)] 10847 #[repr(transparent)]
13944 #[derive(Copy, Clone, Eq, PartialEq)] 10848 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -14049,471 +10953,882 @@ pub mod rcc_h7 {
14049 Ahb3lpenr(0) 10953 Ahb3lpenr(0)
14050 } 10954 }
14051 } 10955 }
14052 #[doc = "RCC AHB1 Clock Register"] 10956 #[doc = "RCC APB1 Peripheral Reset Register"]
14053 #[repr(transparent)] 10957 #[repr(transparent)]
14054 #[derive(Copy, Clone, Eq, PartialEq)] 10958 #[derive(Copy, Clone, Eq, PartialEq)]
14055 pub struct Ahb1enr(pub u32); 10959 pub struct Apb1lrstr(pub u32);
14056 impl Ahb1enr { 10960 impl Apb1lrstr {
14057 #[doc = "DMA1 Clock Enable"] 10961 #[doc = "TIM block reset"]
14058 pub const fn dma1en(&self) -> super::vals::Ahb1enrDma1en { 10962 pub const fn tim2rst(&self) -> super::vals::Tim2rst {
14059 let val = (self.0 >> 0usize) & 0x01; 10963 let val = (self.0 >> 0usize) & 0x01;
14060 super::vals::Ahb1enrDma1en(val as u8) 10964 super::vals::Tim2rst(val as u8)
14061 } 10965 }
14062 #[doc = "DMA1 Clock Enable"] 10966 #[doc = "TIM block reset"]
14063 pub fn set_dma1en(&mut self, val: super::vals::Ahb1enrDma1en) { 10967 pub fn set_tim2rst(&mut self, val: super::vals::Tim2rst) {
14064 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 10968 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
14065 } 10969 }
14066 #[doc = "DMA2 Clock Enable"] 10970 #[doc = "TIM block reset"]
14067 pub const fn dma2en(&self) -> super::vals::Ahb1enrDma1en { 10971 pub const fn tim3rst(&self) -> super::vals::Tim2rst {
14068 let val = (self.0 >> 1usize) & 0x01; 10972 let val = (self.0 >> 1usize) & 0x01;
14069 super::vals::Ahb1enrDma1en(val as u8) 10973 super::vals::Tim2rst(val as u8)
14070 } 10974 }
14071 #[doc = "DMA2 Clock Enable"] 10975 #[doc = "TIM block reset"]
14072 pub fn set_dma2en(&mut self, val: super::vals::Ahb1enrDma1en) { 10976 pub fn set_tim3rst(&mut self, val: super::vals::Tim2rst) {
14073 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 10977 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
14074 } 10978 }
14075 #[doc = "ADC1/2 Peripheral Clocks Enable"] 10979 #[doc = "TIM block reset"]
14076 pub const fn adc12en(&self) -> super::vals::Ahb1enrDma1en { 10980 pub const fn tim4rst(&self) -> super::vals::Tim2rst {
10981 let val = (self.0 >> 2usize) & 0x01;
10982 super::vals::Tim2rst(val as u8)
10983 }
10984 #[doc = "TIM block reset"]
10985 pub fn set_tim4rst(&mut self, val: super::vals::Tim2rst) {
10986 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
10987 }
10988 #[doc = "TIM block reset"]
10989 pub const fn tim5rst(&self) -> super::vals::Tim2rst {
10990 let val = (self.0 >> 3usize) & 0x01;
10991 super::vals::Tim2rst(val as u8)
10992 }
10993 #[doc = "TIM block reset"]
10994 pub fn set_tim5rst(&mut self, val: super::vals::Tim2rst) {
10995 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
10996 }
10997 #[doc = "TIM block reset"]
10998 pub const fn tim6rst(&self) -> super::vals::Tim2rst {
10999 let val = (self.0 >> 4usize) & 0x01;
11000 super::vals::Tim2rst(val as u8)
11001 }
11002 #[doc = "TIM block reset"]
11003 pub fn set_tim6rst(&mut self, val: super::vals::Tim2rst) {
11004 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
11005 }
11006 #[doc = "TIM block reset"]
11007 pub const fn tim7rst(&self) -> super::vals::Tim2rst {
14077 let val = (self.0 >> 5usize) & 0x01; 11008 let val = (self.0 >> 5usize) & 0x01;
14078 super::vals::Ahb1enrDma1en(val as u8) 11009 super::vals::Tim2rst(val as u8)
14079 } 11010 }
14080 #[doc = "ADC1/2 Peripheral Clocks Enable"] 11011 #[doc = "TIM block reset"]
14081 pub fn set_adc12en(&mut self, val: super::vals::Ahb1enrDma1en) { 11012 pub fn set_tim7rst(&mut self, val: super::vals::Tim2rst) {
14082 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 11013 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14083 } 11014 }
14084 #[doc = "Ethernet MAC bus interface Clock Enable"] 11015 #[doc = "TIM block reset"]
14085 pub const fn eth1macen(&self) -> super::vals::Ahb1enrDma1en { 11016 pub const fn tim12rst(&self) -> super::vals::Tim2rst {
11017 let val = (self.0 >> 6usize) & 0x01;
11018 super::vals::Tim2rst(val as u8)
11019 }
11020 #[doc = "TIM block reset"]
11021 pub fn set_tim12rst(&mut self, val: super::vals::Tim2rst) {
11022 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
11023 }
11024 #[doc = "TIM block reset"]
11025 pub const fn tim13rst(&self) -> super::vals::Tim2rst {
11026 let val = (self.0 >> 7usize) & 0x01;
11027 super::vals::Tim2rst(val as u8)
11028 }
11029 #[doc = "TIM block reset"]
11030 pub fn set_tim13rst(&mut self, val: super::vals::Tim2rst) {
11031 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
11032 }
11033 #[doc = "TIM block reset"]
11034 pub const fn tim14rst(&self) -> super::vals::Tim2rst {
11035 let val = (self.0 >> 8usize) & 0x01;
11036 super::vals::Tim2rst(val as u8)
11037 }
11038 #[doc = "TIM block reset"]
11039 pub fn set_tim14rst(&mut self, val: super::vals::Tim2rst) {
11040 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
11041 }
11042 #[doc = "TIM block reset"]
11043 pub const fn lptim1rst(&self) -> super::vals::Tim2rst {
11044 let val = (self.0 >> 9usize) & 0x01;
11045 super::vals::Tim2rst(val as u8)
11046 }
11047 #[doc = "TIM block reset"]
11048 pub fn set_lptim1rst(&mut self, val: super::vals::Tim2rst) {
11049 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
11050 }
11051 #[doc = "SPI2 block reset"]
11052 pub const fn spi2rst(&self) -> super::vals::Tim2rst {
11053 let val = (self.0 >> 14usize) & 0x01;
11054 super::vals::Tim2rst(val as u8)
11055 }
11056 #[doc = "SPI2 block reset"]
11057 pub fn set_spi2rst(&mut self, val: super::vals::Tim2rst) {
11058 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
11059 }
11060 #[doc = "SPI3 block reset"]
11061 pub const fn spi3rst(&self) -> super::vals::Tim2rst {
14086 let val = (self.0 >> 15usize) & 0x01; 11062 let val = (self.0 >> 15usize) & 0x01;
14087 super::vals::Ahb1enrDma1en(val as u8) 11063 super::vals::Tim2rst(val as u8)
14088 } 11064 }
14089 #[doc = "Ethernet MAC bus interface Clock Enable"] 11065 #[doc = "SPI3 block reset"]
14090 pub fn set_eth1macen(&mut self, val: super::vals::Ahb1enrDma1en) { 11066 pub fn set_spi3rst(&mut self, val: super::vals::Tim2rst) {
14091 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 11067 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
14092 } 11068 }
14093 #[doc = "Ethernet Transmission Clock Enable"] 11069 #[doc = "SPDIFRX block reset"]
14094 pub const fn eth1txen(&self) -> super::vals::Ahb1enrDma1en { 11070 pub const fn spdifrxrst(&self) -> super::vals::Tim2rst {
14095 let val = (self.0 >> 16usize) & 0x01; 11071 let val = (self.0 >> 16usize) & 0x01;
14096 super::vals::Ahb1enrDma1en(val as u8) 11072 super::vals::Tim2rst(val as u8)
14097 } 11073 }
14098 #[doc = "Ethernet Transmission Clock Enable"] 11074 #[doc = "SPDIFRX block reset"]
14099 pub fn set_eth1txen(&mut self, val: super::vals::Ahb1enrDma1en) { 11075 pub fn set_spdifrxrst(&mut self, val: super::vals::Tim2rst) {
14100 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 11076 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
14101 } 11077 }
14102 #[doc = "Ethernet Reception Clock Enable"] 11078 #[doc = "USART2 block reset"]
14103 pub const fn eth1rxen(&self) -> super::vals::Ahb1enrDma1en { 11079 pub const fn usart2rst(&self) -> super::vals::Tim2rst {
14104 let val = (self.0 >> 17usize) & 0x01; 11080 let val = (self.0 >> 17usize) & 0x01;
14105 super::vals::Ahb1enrDma1en(val as u8) 11081 super::vals::Tim2rst(val as u8)
14106 } 11082 }
14107 #[doc = "Ethernet Reception Clock Enable"] 11083 #[doc = "USART2 block reset"]
14108 pub fn set_eth1rxen(&mut self, val: super::vals::Ahb1enrDma1en) { 11084 pub fn set_usart2rst(&mut self, val: super::vals::Tim2rst) {
14109 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 11085 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
14110 } 11086 }
14111 #[doc = "Enable USB_PHY2 clocks"] 11087 #[doc = "USART3 block reset"]
14112 pub const fn usb2otghsulpien(&self) -> super::vals::Ahb1enrDma1en { 11088 pub const fn usart3rst(&self) -> super::vals::Tim2rst {
14113 let val = (self.0 >> 18usize) & 0x01; 11089 let val = (self.0 >> 18usize) & 0x01;
14114 super::vals::Ahb1enrDma1en(val as u8) 11090 super::vals::Tim2rst(val as u8)
14115 } 11091 }
14116 #[doc = "Enable USB_PHY2 clocks"] 11092 #[doc = "USART3 block reset"]
14117 pub fn set_usb2otghsulpien(&mut self, val: super::vals::Ahb1enrDma1en) { 11093 pub fn set_usart3rst(&mut self, val: super::vals::Tim2rst) {
14118 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); 11094 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
14119 } 11095 }
14120 #[doc = "USB1OTG Peripheral Clocks Enable"] 11096 #[doc = "UART4 block reset"]
14121 pub const fn usb1otgen(&self) -> super::vals::Ahb1enrDma1en { 11097 pub const fn uart4rst(&self) -> super::vals::Tim2rst {
14122 let val = (self.0 >> 25usize) & 0x01; 11098 let val = (self.0 >> 19usize) & 0x01;
14123 super::vals::Ahb1enrDma1en(val as u8) 11099 super::vals::Tim2rst(val as u8)
14124 } 11100 }
14125 #[doc = "USB1OTG Peripheral Clocks Enable"] 11101 #[doc = "UART4 block reset"]
14126 pub fn set_usb1otgen(&mut self, val: super::vals::Ahb1enrDma1en) { 11102 pub fn set_uart4rst(&mut self, val: super::vals::Tim2rst) {
14127 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 11103 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
14128 } 11104 }
14129 #[doc = "USB_PHY1 Clocks Enable"] 11105 #[doc = "UART5 block reset"]
14130 pub const fn usb1ulpien(&self) -> super::vals::Ahb1enrDma1en { 11106 pub const fn uart5rst(&self) -> super::vals::Tim2rst {
14131 let val = (self.0 >> 26usize) & 0x01; 11107 let val = (self.0 >> 20usize) & 0x01;
14132 super::vals::Ahb1enrDma1en(val as u8) 11108 super::vals::Tim2rst(val as u8)
14133 } 11109 }
14134 #[doc = "USB_PHY1 Clocks Enable"] 11110 #[doc = "UART5 block reset"]
14135 pub fn set_usb1ulpien(&mut self, val: super::vals::Ahb1enrDma1en) { 11111 pub fn set_uart5rst(&mut self, val: super::vals::Tim2rst) {
14136 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); 11112 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
14137 } 11113 }
14138 #[doc = "USB2OTG Peripheral Clocks Enable"] 11114 #[doc = "I2C1 block reset"]
14139 pub const fn usb2otgen(&self) -> super::vals::Ahb1enrDma1en { 11115 pub const fn i2c1rst(&self) -> super::vals::Tim2rst {
11116 let val = (self.0 >> 21usize) & 0x01;
11117 super::vals::Tim2rst(val as u8)
11118 }
11119 #[doc = "I2C1 block reset"]
11120 pub fn set_i2c1rst(&mut self, val: super::vals::Tim2rst) {
11121 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
11122 }
11123 #[doc = "I2C2 block reset"]
11124 pub const fn i2c2rst(&self) -> super::vals::Tim2rst {
11125 let val = (self.0 >> 22usize) & 0x01;
11126 super::vals::Tim2rst(val as u8)
11127 }
11128 #[doc = "I2C2 block reset"]
11129 pub fn set_i2c2rst(&mut self, val: super::vals::Tim2rst) {
11130 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
11131 }
11132 #[doc = "I2C3 block reset"]
11133 pub const fn i2c3rst(&self) -> super::vals::Tim2rst {
11134 let val = (self.0 >> 23usize) & 0x01;
11135 super::vals::Tim2rst(val as u8)
11136 }
11137 #[doc = "I2C3 block reset"]
11138 pub fn set_i2c3rst(&mut self, val: super::vals::Tim2rst) {
11139 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
11140 }
11141 #[doc = "HDMI-CEC block reset"]
11142 pub const fn cecrst(&self) -> super::vals::Tim2rst {
14140 let val = (self.0 >> 27usize) & 0x01; 11143 let val = (self.0 >> 27usize) & 0x01;
14141 super::vals::Ahb1enrDma1en(val as u8) 11144 super::vals::Tim2rst(val as u8)
14142 } 11145 }
14143 #[doc = "USB2OTG Peripheral Clocks Enable"] 11146 #[doc = "HDMI-CEC block reset"]
14144 pub fn set_usb2otgen(&mut self, val: super::vals::Ahb1enrDma1en) { 11147 pub fn set_cecrst(&mut self, val: super::vals::Tim2rst) {
14145 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 11148 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
14146 } 11149 }
14147 #[doc = "USB_PHY2 Clocks Enable"] 11150 #[doc = "DAC1 and 2 Blocks Reset"]
14148 pub const fn usb2ulpien(&self) -> super::vals::Ahb1enrDma1en { 11151 pub const fn dac12rst(&self) -> super::vals::Tim2rst {
14149 let val = (self.0 >> 28usize) & 0x01; 11152 let val = (self.0 >> 29usize) & 0x01;
14150 super::vals::Ahb1enrDma1en(val as u8) 11153 super::vals::Tim2rst(val as u8)
14151 } 11154 }
14152 #[doc = "USB_PHY2 Clocks Enable"] 11155 #[doc = "DAC1 and 2 Blocks Reset"]
14153 pub fn set_usb2ulpien(&mut self, val: super::vals::Ahb1enrDma1en) { 11156 pub fn set_dac12rst(&mut self, val: super::vals::Tim2rst) {
14154 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 11157 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
11158 }
11159 #[doc = "UART7 block reset"]
11160 pub const fn uart7rst(&self) -> super::vals::Tim2rst {
11161 let val = (self.0 >> 30usize) & 0x01;
11162 super::vals::Tim2rst(val as u8)
11163 }
11164 #[doc = "UART7 block reset"]
11165 pub fn set_uart7rst(&mut self, val: super::vals::Tim2rst) {
11166 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
11167 }
11168 #[doc = "UART8 block reset"]
11169 pub const fn uart8rst(&self) -> super::vals::Tim2rst {
11170 let val = (self.0 >> 31usize) & 0x01;
11171 super::vals::Tim2rst(val as u8)
11172 }
11173 #[doc = "UART8 block reset"]
11174 pub fn set_uart8rst(&mut self, val: super::vals::Tim2rst) {
11175 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
14155 } 11176 }
14156 } 11177 }
14157 impl Default for Ahb1enr { 11178 impl Default for Apb1lrstr {
14158 fn default() -> Ahb1enr { 11179 fn default() -> Apb1lrstr {
14159 Ahb1enr(0) 11180 Apb1lrstr(0)
14160 } 11181 }
14161 } 11182 }
14162 #[doc = "RCC APB3 Clock Register"] 11183 #[doc = "RCC APB4 Clock Register"]
14163 #[repr(transparent)] 11184 #[repr(transparent)]
14164 #[derive(Copy, Clone, Eq, PartialEq)] 11185 #[derive(Copy, Clone, Eq, PartialEq)]
14165 pub struct Apb3enr(pub u32); 11186 pub struct C1Apb4enr(pub u32);
14166 impl Apb3enr { 11187 impl C1Apb4enr {
14167 #[doc = "LTDC peripheral clock enable"] 11188 #[doc = "SYSCFG peripheral clock enable"]
14168 pub const fn ltdcen(&self) -> super::vals::Apb3enrLtdcen { 11189 pub const fn syscfgen(&self) -> super::vals::C1Apb4enrSyscfgen {
11190 let val = (self.0 >> 1usize) & 0x01;
11191 super::vals::C1Apb4enrSyscfgen(val as u8)
11192 }
11193 #[doc = "SYSCFG peripheral clock enable"]
11194 pub fn set_syscfgen(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11195 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
11196 }
11197 #[doc = "LPUART1 Peripheral Clocks Enable"]
11198 pub const fn lpuart1en(&self) -> super::vals::C1Apb4enrSyscfgen {
14169 let val = (self.0 >> 3usize) & 0x01; 11199 let val = (self.0 >> 3usize) & 0x01;
14170 super::vals::Apb3enrLtdcen(val as u8) 11200 super::vals::C1Apb4enrSyscfgen(val as u8)
14171 } 11201 }
14172 #[doc = "LTDC peripheral clock enable"] 11202 #[doc = "LPUART1 Peripheral Clocks Enable"]
14173 pub fn set_ltdcen(&mut self, val: super::vals::Apb3enrLtdcen) { 11203 pub fn set_lpuart1en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
14174 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 11204 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
14175 } 11205 }
14176 #[doc = "WWDG1 Clock Enable"] 11206 #[doc = "SPI6 Peripheral Clocks Enable"]
14177 pub const fn wwdg1en(&self) -> super::vals::Apb3enrLtdcen { 11207 pub const fn spi6en(&self) -> super::vals::C1Apb4enrSyscfgen {
14178 let val = (self.0 >> 6usize) & 0x01; 11208 let val = (self.0 >> 5usize) & 0x01;
14179 super::vals::Apb3enrLtdcen(val as u8) 11209 super::vals::C1Apb4enrSyscfgen(val as u8)
14180 } 11210 }
14181 #[doc = "WWDG1 Clock Enable"] 11211 #[doc = "SPI6 Peripheral Clocks Enable"]
14182 pub fn set_wwdg1en(&mut self, val: super::vals::Apb3enrLtdcen) { 11212 pub fn set_spi6en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
14183 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 11213 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
11214 }
11215 #[doc = "I2C4 Peripheral Clocks Enable"]
11216 pub const fn i2c4en(&self) -> super::vals::C1Apb4enrSyscfgen {
11217 let val = (self.0 >> 7usize) & 0x01;
11218 super::vals::C1Apb4enrSyscfgen(val as u8)
11219 }
11220 #[doc = "I2C4 Peripheral Clocks Enable"]
11221 pub fn set_i2c4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11222 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
11223 }
11224 #[doc = "LPTIM2 Peripheral Clocks Enable"]
11225 pub const fn lptim2en(&self) -> super::vals::C1Apb4enrSyscfgen {
11226 let val = (self.0 >> 9usize) & 0x01;
11227 super::vals::C1Apb4enrSyscfgen(val as u8)
11228 }
11229 #[doc = "LPTIM2 Peripheral Clocks Enable"]
11230 pub fn set_lptim2en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11231 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
11232 }
11233 #[doc = "LPTIM3 Peripheral Clocks Enable"]
11234 pub const fn lptim3en(&self) -> super::vals::C1Apb4enrSyscfgen {
11235 let val = (self.0 >> 10usize) & 0x01;
11236 super::vals::C1Apb4enrSyscfgen(val as u8)
11237 }
11238 #[doc = "LPTIM3 Peripheral Clocks Enable"]
11239 pub fn set_lptim3en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11240 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
11241 }
11242 #[doc = "LPTIM4 Peripheral Clocks Enable"]
11243 pub const fn lptim4en(&self) -> super::vals::C1Apb4enrSyscfgen {
11244 let val = (self.0 >> 11usize) & 0x01;
11245 super::vals::C1Apb4enrSyscfgen(val as u8)
11246 }
11247 #[doc = "LPTIM4 Peripheral Clocks Enable"]
11248 pub fn set_lptim4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11249 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
11250 }
11251 #[doc = "LPTIM5 Peripheral Clocks Enable"]
11252 pub const fn lptim5en(&self) -> super::vals::C1Apb4enrSyscfgen {
11253 let val = (self.0 >> 12usize) & 0x01;
11254 super::vals::C1Apb4enrSyscfgen(val as u8)
11255 }
11256 #[doc = "LPTIM5 Peripheral Clocks Enable"]
11257 pub fn set_lptim5en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11258 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
11259 }
11260 #[doc = "COMP1/2 peripheral clock enable"]
11261 pub const fn comp12en(&self) -> super::vals::C1Apb4enrSyscfgen {
11262 let val = (self.0 >> 14usize) & 0x01;
11263 super::vals::C1Apb4enrSyscfgen(val as u8)
11264 }
11265 #[doc = "COMP1/2 peripheral clock enable"]
11266 pub fn set_comp12en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11267 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
11268 }
11269 #[doc = "VREF peripheral clock enable"]
11270 pub const fn vrefen(&self) -> super::vals::C1Apb4enrSyscfgen {
11271 let val = (self.0 >> 15usize) & 0x01;
11272 super::vals::C1Apb4enrSyscfgen(val as u8)
11273 }
11274 #[doc = "VREF peripheral clock enable"]
11275 pub fn set_vrefen(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11276 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
11277 }
11278 #[doc = "RTC APB Clock Enable"]
11279 pub const fn rtcapben(&self) -> super::vals::C1Apb4enrSyscfgen {
11280 let val = (self.0 >> 16usize) & 0x01;
11281 super::vals::C1Apb4enrSyscfgen(val as u8)
11282 }
11283 #[doc = "RTC APB Clock Enable"]
11284 pub fn set_rtcapben(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11285 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
11286 }
11287 #[doc = "SAI4 Peripheral Clocks Enable"]
11288 pub const fn sai4en(&self) -> super::vals::C1Apb4enrSyscfgen {
11289 let val = (self.0 >> 21usize) & 0x01;
11290 super::vals::C1Apb4enrSyscfgen(val as u8)
11291 }
11292 #[doc = "SAI4 Peripheral Clocks Enable"]
11293 pub fn set_sai4en(&mut self, val: super::vals::C1Apb4enrSyscfgen) {
11294 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
14184 } 11295 }
14185 } 11296 }
14186 impl Default for Apb3enr { 11297 impl Default for C1Apb4enr {
14187 fn default() -> Apb3enr { 11298 fn default() -> C1Apb4enr {
14188 Apb3enr(0) 11299 C1Apb4enr(0)
14189 } 11300 }
14190 } 11301 }
14191 #[doc = "RCC AHB1 Sleep Clock Register"] 11302 #[doc = "RCC AHB4 Clock Register"]
14192 #[repr(transparent)] 11303 #[repr(transparent)]
14193 #[derive(Copy, Clone, Eq, PartialEq)] 11304 #[derive(Copy, Clone, Eq, PartialEq)]
14194 pub struct Ahb1lpenr(pub u32); 11305 pub struct C1Ahb4enr(pub u32);
14195 impl Ahb1lpenr { 11306 impl C1Ahb4enr {
14196 #[doc = "DMA1 Clock Enable During CSleep Mode"] 11307 #[doc = "0GPIO peripheral clock enable"]
14197 pub const fn dma1lpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11308 pub const fn gpioaen(&self) -> super::vals::C1Ahb4enrGpioaen {
14198 let val = (self.0 >> 0usize) & 0x01; 11309 let val = (self.0 >> 0usize) & 0x01;
14199 super::vals::Ahb1lpenrDma1lpen(val as u8) 11310 super::vals::C1Ahb4enrGpioaen(val as u8)
14200 } 11311 }
14201 #[doc = "DMA1 Clock Enable During CSleep Mode"] 11312 #[doc = "0GPIO peripheral clock enable"]
14202 pub fn set_dma1lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11313 pub fn set_gpioaen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14203 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 11314 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
14204 } 11315 }
14205 #[doc = "DMA2 Clock Enable During CSleep Mode"] 11316 #[doc = "0GPIO peripheral clock enable"]
14206 pub const fn dma2lpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11317 pub const fn gpioben(&self) -> super::vals::C1Ahb4enrGpioaen {
14207 let val = (self.0 >> 1usize) & 0x01; 11318 let val = (self.0 >> 1usize) & 0x01;
14208 super::vals::Ahb1lpenrDma1lpen(val as u8) 11319 super::vals::C1Ahb4enrGpioaen(val as u8)
14209 } 11320 }
14210 #[doc = "DMA2 Clock Enable During CSleep Mode"] 11321 #[doc = "0GPIO peripheral clock enable"]
14211 pub fn set_dma2lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11322 pub fn set_gpioben(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14212 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 11323 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
14213 } 11324 }
14214 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] 11325 #[doc = "0GPIO peripheral clock enable"]
14215 pub const fn adc12lpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11326 pub const fn gpiocen(&self) -> super::vals::C1Ahb4enrGpioaen {
11327 let val = (self.0 >> 2usize) & 0x01;
11328 super::vals::C1Ahb4enrGpioaen(val as u8)
11329 }
11330 #[doc = "0GPIO peripheral clock enable"]
11331 pub fn set_gpiocen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
11332 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
11333 }
11334 #[doc = "0GPIO peripheral clock enable"]
11335 pub const fn gpioden(&self) -> super::vals::C1Ahb4enrGpioaen {
11336 let val = (self.0 >> 3usize) & 0x01;
11337 super::vals::C1Ahb4enrGpioaen(val as u8)
11338 }
11339 #[doc = "0GPIO peripheral clock enable"]
11340 pub fn set_gpioden(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
11341 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
11342 }
11343 #[doc = "0GPIO peripheral clock enable"]
11344 pub const fn gpioeen(&self) -> super::vals::C1Ahb4enrGpioaen {
11345 let val = (self.0 >> 4usize) & 0x01;
11346 super::vals::C1Ahb4enrGpioaen(val as u8)
11347 }
11348 #[doc = "0GPIO peripheral clock enable"]
11349 pub fn set_gpioeen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
11350 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
11351 }
11352 #[doc = "0GPIO peripheral clock enable"]
11353 pub const fn gpiofen(&self) -> super::vals::C1Ahb4enrGpioaen {
14216 let val = (self.0 >> 5usize) & 0x01; 11354 let val = (self.0 >> 5usize) & 0x01;
14217 super::vals::Ahb1lpenrDma1lpen(val as u8) 11355 super::vals::C1Ahb4enrGpioaen(val as u8)
14218 } 11356 }
14219 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] 11357 #[doc = "0GPIO peripheral clock enable"]
14220 pub fn set_adc12lpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11358 pub fn set_gpiofen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14221 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 11359 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14222 } 11360 }
14223 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] 11361 #[doc = "0GPIO peripheral clock enable"]
14224 pub const fn eth1maclpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11362 pub const fn gpiogen(&self) -> super::vals::C1Ahb4enrGpioaen {
14225 let val = (self.0 >> 15usize) & 0x01; 11363 let val = (self.0 >> 6usize) & 0x01;
14226 super::vals::Ahb1lpenrDma1lpen(val as u8) 11364 super::vals::C1Ahb4enrGpioaen(val as u8)
14227 } 11365 }
14228 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] 11366 #[doc = "0GPIO peripheral clock enable"]
14229 pub fn set_eth1maclpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11367 pub fn set_gpiogen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14230 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 11368 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
14231 } 11369 }
14232 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] 11370 #[doc = "0GPIO peripheral clock enable"]
14233 pub const fn eth1txlpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11371 pub const fn gpiohen(&self) -> super::vals::C1Ahb4enrGpioaen {
14234 let val = (self.0 >> 16usize) & 0x01; 11372 let val = (self.0 >> 7usize) & 0x01;
14235 super::vals::Ahb1lpenrDma1lpen(val as u8) 11373 super::vals::C1Ahb4enrGpioaen(val as u8)
14236 } 11374 }
14237 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] 11375 #[doc = "0GPIO peripheral clock enable"]
14238 pub fn set_eth1txlpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11376 pub fn set_gpiohen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14239 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 11377 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14240 } 11378 }
14241 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] 11379 #[doc = "0GPIO peripheral clock enable"]
14242 pub const fn eth1rxlpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11380 pub const fn gpioien(&self) -> super::vals::C1Ahb4enrGpioaen {
14243 let val = (self.0 >> 17usize) & 0x01; 11381 let val = (self.0 >> 8usize) & 0x01;
14244 super::vals::Ahb1lpenrDma1lpen(val as u8) 11382 super::vals::C1Ahb4enrGpioaen(val as u8)
14245 } 11383 }
14246 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] 11384 #[doc = "0GPIO peripheral clock enable"]
14247 pub fn set_eth1rxlpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11385 pub fn set_gpioien(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14248 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 11386 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
14249 } 11387 }
14250 #[doc = "USB1OTG peripheral clock enable during CSleep mode"] 11388 #[doc = "0GPIO peripheral clock enable"]
14251 pub const fn usb1otglpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11389 pub const fn gpiojen(&self) -> super::vals::C1Ahb4enrGpioaen {
14252 let val = (self.0 >> 25usize) & 0x01; 11390 let val = (self.0 >> 9usize) & 0x01;
14253 super::vals::Ahb1lpenrDma1lpen(val as u8) 11391 super::vals::C1Ahb4enrGpioaen(val as u8)
14254 } 11392 }
14255 #[doc = "USB1OTG peripheral clock enable during CSleep mode"] 11393 #[doc = "0GPIO peripheral clock enable"]
14256 pub fn set_usb1otglpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11394 pub fn set_gpiojen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14257 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 11395 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
14258 } 11396 }
14259 #[doc = "USB_PHY1 clock enable during CSleep mode"] 11397 #[doc = "0GPIO peripheral clock enable"]
14260 pub const fn usb1otghsulpilpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11398 pub const fn gpioken(&self) -> super::vals::C1Ahb4enrGpioaen {
14261 let val = (self.0 >> 26usize) & 0x01; 11399 let val = (self.0 >> 10usize) & 0x01;
14262 super::vals::Ahb1lpenrDma1lpen(val as u8) 11400 super::vals::C1Ahb4enrGpioaen(val as u8)
14263 } 11401 }
14264 #[doc = "USB_PHY1 clock enable during CSleep mode"] 11402 #[doc = "0GPIO peripheral clock enable"]
14265 pub fn set_usb1otghsulpilpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11403 pub fn set_gpioken(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14266 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); 11404 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
14267 } 11405 }
14268 #[doc = "USB2OTG peripheral clock enable during CSleep mode"] 11406 #[doc = "CRC peripheral clock enable"]
14269 pub const fn usb2otglpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11407 pub const fn crcen(&self) -> super::vals::C1Ahb4enrGpioaen {
14270 let val = (self.0 >> 27usize) & 0x01; 11408 let val = (self.0 >> 19usize) & 0x01;
14271 super::vals::Ahb1lpenrDma1lpen(val as u8) 11409 super::vals::C1Ahb4enrGpioaen(val as u8)
14272 } 11410 }
14273 #[doc = "USB2OTG peripheral clock enable during CSleep mode"] 11411 #[doc = "CRC peripheral clock enable"]
14274 pub fn set_usb2otglpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11412 pub fn set_crcen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14275 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 11413 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
14276 } 11414 }
14277 #[doc = "USB_PHY2 clocks enable during CSleep mode"] 11415 #[doc = "BDMA and DMAMUX2 Clock Enable"]
14278 pub const fn usb2otghsulpilpen(&self) -> super::vals::Ahb1lpenrDma1lpen { 11416 pub const fn bdmaen(&self) -> super::vals::C1Ahb4enrGpioaen {
11417 let val = (self.0 >> 21usize) & 0x01;
11418 super::vals::C1Ahb4enrGpioaen(val as u8)
11419 }
11420 #[doc = "BDMA and DMAMUX2 Clock Enable"]
11421 pub fn set_bdmaen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
11422 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
11423 }
11424 #[doc = "ADC3 Peripheral Clocks Enable"]
11425 pub const fn adc3en(&self) -> super::vals::C1Ahb4enrGpioaen {
11426 let val = (self.0 >> 24usize) & 0x01;
11427 super::vals::C1Ahb4enrGpioaen(val as u8)
11428 }
11429 #[doc = "ADC3 Peripheral Clocks Enable"]
11430 pub fn set_adc3en(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
11431 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
11432 }
11433 #[doc = "HSEM peripheral clock enable"]
11434 pub const fn hsemen(&self) -> super::vals::C1Ahb4enrGpioaen {
11435 let val = (self.0 >> 25usize) & 0x01;
11436 super::vals::C1Ahb4enrGpioaen(val as u8)
11437 }
11438 #[doc = "HSEM peripheral clock enable"]
11439 pub fn set_hsemen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
11440 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
11441 }
11442 #[doc = "Backup RAM Clock Enable"]
11443 pub const fn bkpramen(&self) -> super::vals::C1Ahb4enrGpioaen {
14279 let val = (self.0 >> 28usize) & 0x01; 11444 let val = (self.0 >> 28usize) & 0x01;
14280 super::vals::Ahb1lpenrDma1lpen(val as u8) 11445 super::vals::C1Ahb4enrGpioaen(val as u8)
14281 } 11446 }
14282 #[doc = "USB_PHY2 clocks enable during CSleep mode"] 11447 #[doc = "Backup RAM Clock Enable"]
14283 pub fn set_usb2otghsulpilpen(&mut self, val: super::vals::Ahb1lpenrDma1lpen) { 11448 pub fn set_bkpramen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14284 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 11449 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
14285 } 11450 }
14286 } 11451 }
14287 impl Default for Ahb1lpenr { 11452 impl Default for C1Ahb4enr {
14288 fn default() -> Ahb1lpenr { 11453 fn default() -> C1Ahb4enr {
14289 Ahb1lpenr(0) 11454 C1Ahb4enr(0)
14290 } 11455 }
14291 } 11456 }
14292 #[doc = "RCC APB1 Clock Register"] 11457 #[doc = "RCC AHB2 Clock Register"]
14293 #[repr(transparent)] 11458 #[repr(transparent)]
14294 #[derive(Copy, Clone, Eq, PartialEq)] 11459 #[derive(Copy, Clone, Eq, PartialEq)]
14295 pub struct C1Apb1lenr(pub u32); 11460 pub struct C1Ahb2enr(pub u32);
14296 impl C1Apb1lenr { 11461 impl C1Ahb2enr {
14297 #[doc = "TIM peripheral clock enable"] 11462 #[doc = "DCMI peripheral clock"]
14298 pub const fn tim2en(&self) -> super::vals::C1Apb1lenrTim2en { 11463 pub const fn dcmien(&self) -> super::vals::C1Ahb2enrDcmien {
14299 let val = (self.0 >> 0usize) & 0x01; 11464 let val = (self.0 >> 0usize) & 0x01;
14300 super::vals::C1Apb1lenrTim2en(val as u8) 11465 super::vals::C1Ahb2enrDcmien(val as u8)
14301 } 11466 }
14302 #[doc = "TIM peripheral clock enable"] 11467 #[doc = "DCMI peripheral clock"]
14303 pub fn set_tim2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11468 pub fn set_dcmien(&mut self, val: super::vals::C1Ahb2enrDcmien) {
14304 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 11469 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
14305 } 11470 }
14306 #[doc = "TIM peripheral clock enable"] 11471 #[doc = "CRYPT peripheral clock enable"]
14307 pub const fn tim3en(&self) -> super::vals::C1Apb1lenrTim2en { 11472 pub const fn crypten(&self) -> super::vals::C1Ahb2enrDcmien {
11473 let val = (self.0 >> 4usize) & 0x01;
11474 super::vals::C1Ahb2enrDcmien(val as u8)
11475 }
11476 #[doc = "CRYPT peripheral clock enable"]
11477 pub fn set_crypten(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11478 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
11479 }
11480 #[doc = "HASH peripheral clock enable"]
11481 pub const fn hashen(&self) -> super::vals::C1Ahb2enrDcmien {
11482 let val = (self.0 >> 5usize) & 0x01;
11483 super::vals::C1Ahb2enrDcmien(val as u8)
11484 }
11485 #[doc = "HASH peripheral clock enable"]
11486 pub fn set_hashen(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11487 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
11488 }
11489 #[doc = "RNG peripheral clocks enable"]
11490 pub const fn rngen(&self) -> super::vals::C1Ahb2enrDcmien {
11491 let val = (self.0 >> 6usize) & 0x01;
11492 super::vals::C1Ahb2enrDcmien(val as u8)
11493 }
11494 #[doc = "RNG peripheral clocks enable"]
11495 pub fn set_rngen(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11496 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
11497 }
11498 #[doc = "SDMMC2 and SDMMC2 delay clock enable"]
11499 pub const fn sdmmc2en(&self) -> super::vals::C1Ahb2enrDcmien {
11500 let val = (self.0 >> 9usize) & 0x01;
11501 super::vals::C1Ahb2enrDcmien(val as u8)
11502 }
11503 #[doc = "SDMMC2 and SDMMC2 delay clock enable"]
11504 pub fn set_sdmmc2en(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11505 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
11506 }
11507 #[doc = "SRAM1 block enable"]
11508 pub const fn sram1en(&self) -> super::vals::C1Ahb2enrDcmien {
11509 let val = (self.0 >> 29usize) & 0x01;
11510 super::vals::C1Ahb2enrDcmien(val as u8)
11511 }
11512 #[doc = "SRAM1 block enable"]
11513 pub fn set_sram1en(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11514 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
11515 }
11516 #[doc = "SRAM2 block enable"]
11517 pub const fn sram2en(&self) -> super::vals::C1Ahb2enrDcmien {
11518 let val = (self.0 >> 30usize) & 0x01;
11519 super::vals::C1Ahb2enrDcmien(val as u8)
11520 }
11521 #[doc = "SRAM2 block enable"]
11522 pub fn set_sram2en(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11523 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
11524 }
11525 #[doc = "SRAM3 block enable"]
11526 pub const fn sram3en(&self) -> super::vals::C1Ahb2enrDcmien {
11527 let val = (self.0 >> 31usize) & 0x01;
11528 super::vals::C1Ahb2enrDcmien(val as u8)
11529 }
11530 #[doc = "SRAM3 block enable"]
11531 pub fn set_sram3en(&mut self, val: super::vals::C1Ahb2enrDcmien) {
11532 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
11533 }
11534 }
11535 impl Default for C1Ahb2enr {
11536 fn default() -> C1Ahb2enr {
11537 C1Ahb2enr(0)
11538 }
11539 }
11540 #[doc = "RCC AHB4 Clock Register"]
11541 #[repr(transparent)]
11542 #[derive(Copy, Clone, Eq, PartialEq)]
11543 pub struct Ahb4enr(pub u32);
11544 impl Ahb4enr {
11545 #[doc = "0GPIO peripheral clock enable"]
11546 pub const fn gpioaen(&self) -> super::vals::Ahb4enrGpioaen {
11547 let val = (self.0 >> 0usize) & 0x01;
11548 super::vals::Ahb4enrGpioaen(val as u8)
11549 }
11550 #[doc = "0GPIO peripheral clock enable"]
11551 pub fn set_gpioaen(&mut self, val: super::vals::Ahb4enrGpioaen) {
11552 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
11553 }
11554 #[doc = "0GPIO peripheral clock enable"]
11555 pub const fn gpioben(&self) -> super::vals::Ahb4enrGpioaen {
14308 let val = (self.0 >> 1usize) & 0x01; 11556 let val = (self.0 >> 1usize) & 0x01;
14309 super::vals::C1Apb1lenrTim2en(val as u8) 11557 super::vals::Ahb4enrGpioaen(val as u8)
14310 } 11558 }
14311 #[doc = "TIM peripheral clock enable"] 11559 #[doc = "0GPIO peripheral clock enable"]
14312 pub fn set_tim3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11560 pub fn set_gpioben(&mut self, val: super::vals::Ahb4enrGpioaen) {
14313 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 11561 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
14314 } 11562 }
14315 #[doc = "TIM peripheral clock enable"] 11563 #[doc = "0GPIO peripheral clock enable"]
14316 pub const fn tim4en(&self) -> super::vals::C1Apb1lenrTim2en { 11564 pub const fn gpiocen(&self) -> super::vals::Ahb4enrGpioaen {
14317 let val = (self.0 >> 2usize) & 0x01; 11565 let val = (self.0 >> 2usize) & 0x01;
14318 super::vals::C1Apb1lenrTim2en(val as u8) 11566 super::vals::Ahb4enrGpioaen(val as u8)
14319 } 11567 }
14320 #[doc = "TIM peripheral clock enable"] 11568 #[doc = "0GPIO peripheral clock enable"]
14321 pub fn set_tim4en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11569 pub fn set_gpiocen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14322 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 11570 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
14323 } 11571 }
14324 #[doc = "TIM peripheral clock enable"] 11572 #[doc = "0GPIO peripheral clock enable"]
14325 pub const fn tim5en(&self) -> super::vals::C1Apb1lenrTim2en { 11573 pub const fn gpioden(&self) -> super::vals::Ahb4enrGpioaen {
14326 let val = (self.0 >> 3usize) & 0x01; 11574 let val = (self.0 >> 3usize) & 0x01;
14327 super::vals::C1Apb1lenrTim2en(val as u8) 11575 super::vals::Ahb4enrGpioaen(val as u8)
14328 } 11576 }
14329 #[doc = "TIM peripheral clock enable"] 11577 #[doc = "0GPIO peripheral clock enable"]
14330 pub fn set_tim5en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11578 pub fn set_gpioden(&mut self, val: super::vals::Ahb4enrGpioaen) {
14331 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 11579 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
14332 } 11580 }
14333 #[doc = "TIM peripheral clock enable"] 11581 #[doc = "0GPIO peripheral clock enable"]
14334 pub const fn tim6en(&self) -> super::vals::C1Apb1lenrTim2en { 11582 pub const fn gpioeen(&self) -> super::vals::Ahb4enrGpioaen {
14335 let val = (self.0 >> 4usize) & 0x01; 11583 let val = (self.0 >> 4usize) & 0x01;
14336 super::vals::C1Apb1lenrTim2en(val as u8) 11584 super::vals::Ahb4enrGpioaen(val as u8)
14337 } 11585 }
14338 #[doc = "TIM peripheral clock enable"] 11586 #[doc = "0GPIO peripheral clock enable"]
14339 pub fn set_tim6en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11587 pub fn set_gpioeen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14340 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 11588 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
14341 } 11589 }
14342 #[doc = "TIM peripheral clock enable"] 11590 #[doc = "0GPIO peripheral clock enable"]
14343 pub const fn tim7en(&self) -> super::vals::C1Apb1lenrTim2en { 11591 pub const fn gpiofen(&self) -> super::vals::Ahb4enrGpioaen {
14344 let val = (self.0 >> 5usize) & 0x01; 11592 let val = (self.0 >> 5usize) & 0x01;
14345 super::vals::C1Apb1lenrTim2en(val as u8) 11593 super::vals::Ahb4enrGpioaen(val as u8)
14346 } 11594 }
14347 #[doc = "TIM peripheral clock enable"] 11595 #[doc = "0GPIO peripheral clock enable"]
14348 pub fn set_tim7en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11596 pub fn set_gpiofen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14349 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 11597 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14350 } 11598 }
14351 #[doc = "TIM peripheral clock enable"] 11599 #[doc = "0GPIO peripheral clock enable"]
14352 pub const fn tim12en(&self) -> super::vals::C1Apb1lenrTim2en { 11600 pub const fn gpiogen(&self) -> super::vals::Ahb4enrGpioaen {
14353 let val = (self.0 >> 6usize) & 0x01; 11601 let val = (self.0 >> 6usize) & 0x01;
14354 super::vals::C1Apb1lenrTim2en(val as u8) 11602 super::vals::Ahb4enrGpioaen(val as u8)
14355 } 11603 }
14356 #[doc = "TIM peripheral clock enable"] 11604 #[doc = "0GPIO peripheral clock enable"]
14357 pub fn set_tim12en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11605 pub fn set_gpiogen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14358 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 11606 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
14359 } 11607 }
14360 #[doc = "TIM peripheral clock enable"] 11608 #[doc = "0GPIO peripheral clock enable"]
14361 pub const fn tim13en(&self) -> super::vals::C1Apb1lenrTim2en { 11609 pub const fn gpiohen(&self) -> super::vals::Ahb4enrGpioaen {
14362 let val = (self.0 >> 7usize) & 0x01; 11610 let val = (self.0 >> 7usize) & 0x01;
14363 super::vals::C1Apb1lenrTim2en(val as u8) 11611 super::vals::Ahb4enrGpioaen(val as u8)
14364 } 11612 }
14365 #[doc = "TIM peripheral clock enable"] 11613 #[doc = "0GPIO peripheral clock enable"]
14366 pub fn set_tim13en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11614 pub fn set_gpiohen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14367 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 11615 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14368 } 11616 }
14369 #[doc = "TIM peripheral clock enable"] 11617 #[doc = "0GPIO peripheral clock enable"]
14370 pub const fn tim14en(&self) -> super::vals::C1Apb1lenrTim2en { 11618 pub const fn gpioien(&self) -> super::vals::Ahb4enrGpioaen {
14371 let val = (self.0 >> 8usize) & 0x01; 11619 let val = (self.0 >> 8usize) & 0x01;
14372 super::vals::C1Apb1lenrTim2en(val as u8) 11620 super::vals::Ahb4enrGpioaen(val as u8)
14373 } 11621 }
14374 #[doc = "TIM peripheral clock enable"] 11622 #[doc = "0GPIO peripheral clock enable"]
14375 pub fn set_tim14en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11623 pub fn set_gpioien(&mut self, val: super::vals::Ahb4enrGpioaen) {
14376 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 11624 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
14377 } 11625 }
14378 #[doc = "LPTIM1 Peripheral Clocks Enable"] 11626 #[doc = "0GPIO peripheral clock enable"]
14379 pub const fn lptim1en(&self) -> super::vals::C1Apb1lenrTim2en { 11627 pub const fn gpiojen(&self) -> super::vals::Ahb4enrGpioaen {
14380 let val = (self.0 >> 9usize) & 0x01; 11628 let val = (self.0 >> 9usize) & 0x01;
14381 super::vals::C1Apb1lenrTim2en(val as u8) 11629 super::vals::Ahb4enrGpioaen(val as u8)
14382 } 11630 }
14383 #[doc = "LPTIM1 Peripheral Clocks Enable"] 11631 #[doc = "0GPIO peripheral clock enable"]
14384 pub fn set_lptim1en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11632 pub fn set_gpiojen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14385 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 11633 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
14386 } 11634 }
14387 #[doc = "SPI2 Peripheral Clocks Enable"] 11635 #[doc = "0GPIO peripheral clock enable"]
14388 pub const fn spi2en(&self) -> super::vals::C1Apb1lenrTim2en { 11636 pub const fn gpioken(&self) -> super::vals::Ahb4enrGpioaen {
14389 let val = (self.0 >> 14usize) & 0x01; 11637 let val = (self.0 >> 10usize) & 0x01;
14390 super::vals::C1Apb1lenrTim2en(val as u8) 11638 super::vals::Ahb4enrGpioaen(val as u8)
14391 } 11639 }
14392 #[doc = "SPI2 Peripheral Clocks Enable"] 11640 #[doc = "0GPIO peripheral clock enable"]
14393 pub fn set_spi2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11641 pub fn set_gpioken(&mut self, val: super::vals::Ahb4enrGpioaen) {
14394 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 11642 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
14395 } 11643 }
14396 #[doc = "SPI3 Peripheral Clocks Enable"] 11644 #[doc = "CRC peripheral clock enable"]
14397 pub const fn spi3en(&self) -> super::vals::C1Apb1lenrTim2en { 11645 pub const fn crcen(&self) -> super::vals::Ahb4enrGpioaen {
14398 let val = (self.0 >> 15usize) & 0x01; 11646 let val = (self.0 >> 19usize) & 0x01;
14399 super::vals::C1Apb1lenrTim2en(val as u8) 11647 super::vals::Ahb4enrGpioaen(val as u8)
14400 } 11648 }
14401 #[doc = "SPI3 Peripheral Clocks Enable"] 11649 #[doc = "CRC peripheral clock enable"]
14402 pub fn set_spi3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11650 pub fn set_crcen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14403 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 11651 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
14404 } 11652 }
14405 #[doc = "SPDIFRX Peripheral Clocks Enable"] 11653 #[doc = "BDMA and DMAMUX2 Clock Enable"]
14406 pub const fn spdifrxen(&self) -> super::vals::C1Apb1lenrTim2en { 11654 pub const fn bdmaen(&self) -> super::vals::Ahb4enrGpioaen {
14407 let val = (self.0 >> 16usize) & 0x01; 11655 let val = (self.0 >> 21usize) & 0x01;
14408 super::vals::C1Apb1lenrTim2en(val as u8) 11656 super::vals::Ahb4enrGpioaen(val as u8)
14409 } 11657 }
14410 #[doc = "SPDIFRX Peripheral Clocks Enable"] 11658 #[doc = "BDMA and DMAMUX2 Clock Enable"]
14411 pub fn set_spdifrxen(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11659 pub fn set_bdmaen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14412 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 11660 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
14413 } 11661 }
14414 #[doc = "USART2 Peripheral Clocks Enable"] 11662 #[doc = "ADC3 Peripheral Clocks Enable"]
14415 pub const fn usart2en(&self) -> super::vals::C1Apb1lenrTim2en { 11663 pub const fn adc3en(&self) -> super::vals::Ahb4enrGpioaen {
14416 let val = (self.0 >> 17usize) & 0x01; 11664 let val = (self.0 >> 24usize) & 0x01;
14417 super::vals::C1Apb1lenrTim2en(val as u8) 11665 super::vals::Ahb4enrGpioaen(val as u8)
14418 } 11666 }
14419 #[doc = "USART2 Peripheral Clocks Enable"] 11667 #[doc = "ADC3 Peripheral Clocks Enable"]
14420 pub fn set_usart2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11668 pub fn set_adc3en(&mut self, val: super::vals::Ahb4enrGpioaen) {
14421 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 11669 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
14422 } 11670 }
14423 #[doc = "USART3 Peripheral Clocks Enable"] 11671 #[doc = "HSEM peripheral clock enable"]
14424 pub const fn usart3en(&self) -> super::vals::C1Apb1lenrTim2en { 11672 pub const fn hsemen(&self) -> super::vals::Ahb4enrGpioaen {
14425 let val = (self.0 >> 18usize) & 0x01; 11673 let val = (self.0 >> 25usize) & 0x01;
14426 super::vals::C1Apb1lenrTim2en(val as u8) 11674 super::vals::Ahb4enrGpioaen(val as u8)
14427 } 11675 }
14428 #[doc = "USART3 Peripheral Clocks Enable"] 11676 #[doc = "HSEM peripheral clock enable"]
14429 pub fn set_usart3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11677 pub fn set_hsemen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14430 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); 11678 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
14431 } 11679 }
14432 #[doc = "UART4 Peripheral Clocks Enable"] 11680 #[doc = "Backup RAM Clock Enable"]
14433 pub const fn uart4en(&self) -> super::vals::C1Apb1lenrTim2en { 11681 pub const fn bkpramen(&self) -> super::vals::Ahb4enrGpioaen {
14434 let val = (self.0 >> 19usize) & 0x01; 11682 let val = (self.0 >> 28usize) & 0x01;
14435 super::vals::C1Apb1lenrTim2en(val as u8) 11683 super::vals::Ahb4enrGpioaen(val as u8)
14436 } 11684 }
14437 #[doc = "UART4 Peripheral Clocks Enable"] 11685 #[doc = "Backup RAM Clock Enable"]
14438 pub fn set_uart4en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11686 pub fn set_bkpramen(&mut self, val: super::vals::Ahb4enrGpioaen) {
14439 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 11687 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
14440 } 11688 }
14441 #[doc = "UART5 Peripheral Clocks Enable"] 11689 }
14442 pub const fn uart5en(&self) -> super::vals::C1Apb1lenrTim2en { 11690 impl Default for Ahb4enr {
14443 let val = (self.0 >> 20usize) & 0x01; 11691 fn default() -> Ahb4enr {
14444 super::vals::C1Apb1lenrTim2en(val as u8) 11692 Ahb4enr(0)
14445 } 11693 }
14446 #[doc = "UART5 Peripheral Clocks Enable"] 11694 }
14447 pub fn set_uart5en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11695 #[doc = "RCC APB4 Sleep Clock Register"]
14448 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); 11696 #[repr(transparent)]
11697 #[derive(Copy, Clone, Eq, PartialEq)]
11698 pub struct C1Apb4lpenr(pub u32);
11699 impl C1Apb4lpenr {
11700 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
11701 pub const fn syscfglpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
11702 let val = (self.0 >> 1usize) & 0x01;
11703 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14449 } 11704 }
14450 #[doc = "I2C1 Peripheral Clocks Enable"] 11705 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
14451 pub const fn i2c1en(&self) -> super::vals::C1Apb1lenrTim2en { 11706 pub fn set_syscfglpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14452 let val = (self.0 >> 21usize) & 0x01; 11707 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
14453 super::vals::C1Apb1lenrTim2en(val as u8)
14454 } 11708 }
14455 #[doc = "I2C1 Peripheral Clocks Enable"] 11709 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
14456 pub fn set_i2c1en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11710 pub const fn lpuart1lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14457 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 11711 let val = (self.0 >> 3usize) & 0x01;
11712 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14458 } 11713 }
14459 #[doc = "I2C2 Peripheral Clocks Enable"] 11714 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
14460 pub const fn i2c2en(&self) -> super::vals::C1Apb1lenrTim2en { 11715 pub fn set_lpuart1lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14461 let val = (self.0 >> 22usize) & 0x01; 11716 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
14462 super::vals::C1Apb1lenrTim2en(val as u8)
14463 } 11717 }
14464 #[doc = "I2C2 Peripheral Clocks Enable"] 11718 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
14465 pub fn set_i2c2en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11719 pub const fn spi6lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14466 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); 11720 let val = (self.0 >> 5usize) & 0x01;
11721 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14467 } 11722 }
14468 #[doc = "I2C3 Peripheral Clocks Enable"] 11723 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
14469 pub const fn i2c3en(&self) -> super::vals::C1Apb1lenrTim2en { 11724 pub fn set_spi6lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14470 let val = (self.0 >> 23usize) & 0x01; 11725 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14471 super::vals::C1Apb1lenrTim2en(val as u8)
14472 } 11726 }
14473 #[doc = "I2C3 Peripheral Clocks Enable"] 11727 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
14474 pub fn set_i2c3en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11728 pub const fn i2c4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14475 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); 11729 let val = (self.0 >> 7usize) & 0x01;
11730 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14476 } 11731 }
14477 #[doc = "HDMI-CEC peripheral clock enable"] 11732 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
14478 pub const fn cecen(&self) -> super::vals::C1Apb1lenrTim2en { 11733 pub fn set_i2c4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14479 let val = (self.0 >> 27usize) & 0x01; 11734 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14480 super::vals::C1Apb1lenrTim2en(val as u8)
14481 } 11735 }
14482 #[doc = "HDMI-CEC peripheral clock enable"] 11736 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
14483 pub fn set_cecen(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11737 pub const fn lptim2lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14484 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 11738 let val = (self.0 >> 9usize) & 0x01;
11739 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14485 } 11740 }
14486 #[doc = "DAC1&2 peripheral clock enable"] 11741 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
14487 pub const fn dac12en(&self) -> super::vals::C1Apb1lenrTim2en { 11742 pub fn set_lptim2lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14488 let val = (self.0 >> 29usize) & 0x01; 11743 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
14489 super::vals::C1Apb1lenrTim2en(val as u8)
14490 } 11744 }
14491 #[doc = "DAC1&2 peripheral clock enable"] 11745 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
14492 pub fn set_dac12en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11746 pub const fn lptim3lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14493 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 11747 let val = (self.0 >> 10usize) & 0x01;
11748 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14494 } 11749 }
14495 #[doc = "UART7 Peripheral Clocks Enable"] 11750 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
14496 pub const fn uart7en(&self) -> super::vals::C1Apb1lenrTim2en { 11751 pub fn set_lptim3lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14497 let val = (self.0 >> 30usize) & 0x01; 11752 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
14498 super::vals::C1Apb1lenrTim2en(val as u8)
14499 } 11753 }
14500 #[doc = "UART7 Peripheral Clocks Enable"] 11754 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
14501 pub fn set_uart7en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11755 pub const fn lptim4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14502 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); 11756 let val = (self.0 >> 11usize) & 0x01;
11757 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
14503 } 11758 }
14504 #[doc = "UART8 Peripheral Clocks Enable"] 11759 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
14505 pub const fn uart8en(&self) -> super::vals::C1Apb1lenrTim2en { 11760 pub fn set_lptim4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
14506 let val = (self.0 >> 31usize) & 0x01; 11761 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
14507 super::vals::C1Apb1lenrTim2en(val as u8)
14508 } 11762 }
14509 #[doc = "UART8 Peripheral Clocks Enable"] 11763 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
14510 pub fn set_uart8en(&mut self, val: super::vals::C1Apb1lenrTim2en) { 11764 pub const fn lptim5lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
14511 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 11765 let val = (self.0 >> 12usize) & 0x01;
11766 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
11767 }
11768 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
11769 pub fn set_lptim5lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
11770 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
11771 }
11772 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
11773 pub const fn comp12lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
11774 let val = (self.0 >> 14usize) & 0x01;
11775 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
11776 }
11777 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
11778 pub fn set_comp12lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
11779 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
11780 }
11781 #[doc = "VREF peripheral clock enable during CSleep mode"]
11782 pub const fn vreflpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
11783 let val = (self.0 >> 15usize) & 0x01;
11784 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
11785 }
11786 #[doc = "VREF peripheral clock enable during CSleep mode"]
11787 pub fn set_vreflpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
11788 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
11789 }
11790 #[doc = "RTC APB Clock Enable During CSleep Mode"]
11791 pub const fn rtcapblpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
11792 let val = (self.0 >> 16usize) & 0x01;
11793 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
11794 }
11795 #[doc = "RTC APB Clock Enable During CSleep Mode"]
11796 pub fn set_rtcapblpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
11797 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
11798 }
11799 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
11800 pub const fn sai4lpen(&self) -> super::vals::C1Apb4lpenrSyscfglpen {
11801 let val = (self.0 >> 21usize) & 0x01;
11802 super::vals::C1Apb4lpenrSyscfglpen(val as u8)
11803 }
11804 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
11805 pub fn set_sai4lpen(&mut self, val: super::vals::C1Apb4lpenrSyscfglpen) {
11806 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
14512 } 11807 }
14513 } 11808 }
14514 impl Default for C1Apb1lenr { 11809 impl Default for C1Apb4lpenr {
14515 fn default() -> C1Apb1lenr { 11810 fn default() -> C1Apb4lpenr {
14516 C1Apb1lenr(0) 11811 C1Apb4lpenr(0)
11812 }
11813 }
11814 #[doc = "RCC APB3 Peripheral Reset Register"]
11815 #[repr(transparent)]
11816 #[derive(Copy, Clone, Eq, PartialEq)]
11817 pub struct Apb3rstr(pub u32);
11818 impl Apb3rstr {
11819 #[doc = "LTDC block reset"]
11820 pub const fn ltdcrst(&self) -> super::vals::Ltdcrst {
11821 let val = (self.0 >> 3usize) & 0x01;
11822 super::vals::Ltdcrst(val as u8)
11823 }
11824 #[doc = "LTDC block reset"]
11825 pub fn set_ltdcrst(&mut self, val: super::vals::Ltdcrst) {
11826 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
11827 }
11828 }
11829 impl Default for Apb3rstr {
11830 fn default() -> Apb3rstr {
11831 Apb3rstr(0)
14517 } 11832 }
14518 } 11833 }
14519 #[doc = "RCC Reset Status Register"] 11834 #[doc = "RCC Reset Status Register"]
@@ -14626,87 +11941,114 @@ pub mod rcc_h7 {
14626 Rsr(0) 11941 Rsr(0)
14627 } 11942 }
14628 } 11943 }
14629 #[doc = "RCC AHB2 Clock Register"] 11944 #[doc = "RCC APB4 Peripheral Reset Register"]
14630 #[repr(transparent)] 11945 #[repr(transparent)]
14631 #[derive(Copy, Clone, Eq, PartialEq)] 11946 #[derive(Copy, Clone, Eq, PartialEq)]
14632 pub struct C1Ahb2enr(pub u32); 11947 pub struct Apb4rstr(pub u32);
14633 impl C1Ahb2enr { 11948 impl Apb4rstr {
14634 #[doc = "DCMI peripheral clock"] 11949 #[doc = "SYSCFG block reset"]
14635 pub const fn dcmien(&self) -> super::vals::C1Ahb2enrDcmien { 11950 pub const fn syscfgrst(&self) -> super::vals::Syscfgrst {
14636 let val = (self.0 >> 0usize) & 0x01; 11951 let val = (self.0 >> 1usize) & 0x01;
14637 super::vals::C1Ahb2enrDcmien(val as u8) 11952 super::vals::Syscfgrst(val as u8)
14638 } 11953 }
14639 #[doc = "DCMI peripheral clock"] 11954 #[doc = "SYSCFG block reset"]
14640 pub fn set_dcmien(&mut self, val: super::vals::C1Ahb2enrDcmien) { 11955 pub fn set_syscfgrst(&mut self, val: super::vals::Syscfgrst) {
14641 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 11956 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
14642 } 11957 }
14643 #[doc = "CRYPT peripheral clock enable"] 11958 #[doc = "LPUART1 block reset"]
14644 pub const fn crypten(&self) -> super::vals::C1Ahb2enrDcmien { 11959 pub const fn lpuart1rst(&self) -> super::vals::Syscfgrst {
14645 let val = (self.0 >> 4usize) & 0x01; 11960 let val = (self.0 >> 3usize) & 0x01;
14646 super::vals::C1Ahb2enrDcmien(val as u8) 11961 super::vals::Syscfgrst(val as u8)
14647 } 11962 }
14648 #[doc = "CRYPT peripheral clock enable"] 11963 #[doc = "LPUART1 block reset"]
14649 pub fn set_crypten(&mut self, val: super::vals::C1Ahb2enrDcmien) { 11964 pub fn set_lpuart1rst(&mut self, val: super::vals::Syscfgrst) {
14650 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 11965 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
14651 } 11966 }
14652 #[doc = "HASH peripheral clock enable"] 11967 #[doc = "SPI6 block reset"]
14653 pub const fn hashen(&self) -> super::vals::C1Ahb2enrDcmien { 11968 pub const fn spi6rst(&self) -> super::vals::Syscfgrst {
14654 let val = (self.0 >> 5usize) & 0x01; 11969 let val = (self.0 >> 5usize) & 0x01;
14655 super::vals::C1Ahb2enrDcmien(val as u8) 11970 super::vals::Syscfgrst(val as u8)
14656 } 11971 }
14657 #[doc = "HASH peripheral clock enable"] 11972 #[doc = "SPI6 block reset"]
14658 pub fn set_hashen(&mut self, val: super::vals::C1Ahb2enrDcmien) { 11973 pub fn set_spi6rst(&mut self, val: super::vals::Syscfgrst) {
14659 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 11974 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14660 } 11975 }
14661 #[doc = "RNG peripheral clocks enable"] 11976 #[doc = "I2C4 block reset"]
14662 pub const fn rngen(&self) -> super::vals::C1Ahb2enrDcmien { 11977 pub const fn i2c4rst(&self) -> super::vals::Syscfgrst {
14663 let val = (self.0 >> 6usize) & 0x01; 11978 let val = (self.0 >> 7usize) & 0x01;
14664 super::vals::C1Ahb2enrDcmien(val as u8) 11979 super::vals::Syscfgrst(val as u8)
14665 } 11980 }
14666 #[doc = "RNG peripheral clocks enable"] 11981 #[doc = "I2C4 block reset"]
14667 pub fn set_rngen(&mut self, val: super::vals::C1Ahb2enrDcmien) { 11982 pub fn set_i2c4rst(&mut self, val: super::vals::Syscfgrst) {
14668 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 11983 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14669 } 11984 }
14670 #[doc = "SDMMC2 and SDMMC2 delay clock enable"] 11985 #[doc = "LPTIM2 block reset"]
14671 pub const fn sdmmc2en(&self) -> super::vals::C1Ahb2enrDcmien { 11986 pub const fn lptim2rst(&self) -> super::vals::Syscfgrst {
14672 let val = (self.0 >> 9usize) & 0x01; 11987 let val = (self.0 >> 9usize) & 0x01;
14673 super::vals::C1Ahb2enrDcmien(val as u8) 11988 super::vals::Syscfgrst(val as u8)
14674 } 11989 }
14675 #[doc = "SDMMC2 and SDMMC2 delay clock enable"] 11990 #[doc = "LPTIM2 block reset"]
14676 pub fn set_sdmmc2en(&mut self, val: super::vals::C1Ahb2enrDcmien) { 11991 pub fn set_lptim2rst(&mut self, val: super::vals::Syscfgrst) {
14677 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 11992 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
14678 } 11993 }
14679 #[doc = "SRAM1 block enable"] 11994 #[doc = "LPTIM3 block reset"]
14680 pub const fn sram1en(&self) -> super::vals::C1Ahb2enrDcmien { 11995 pub const fn lptim3rst(&self) -> super::vals::Syscfgrst {
14681 let val = (self.0 >> 29usize) & 0x01; 11996 let val = (self.0 >> 10usize) & 0x01;
14682 super::vals::C1Ahb2enrDcmien(val as u8) 11997 super::vals::Syscfgrst(val as u8)
14683 } 11998 }
14684 #[doc = "SRAM1 block enable"] 11999 #[doc = "LPTIM3 block reset"]
14685 pub fn set_sram1en(&mut self, val: super::vals::C1Ahb2enrDcmien) { 12000 pub fn set_lptim3rst(&mut self, val: super::vals::Syscfgrst) {
14686 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 12001 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
14687 } 12002 }
14688 #[doc = "SRAM2 block enable"] 12003 #[doc = "LPTIM4 block reset"]
14689 pub const fn sram2en(&self) -> super::vals::C1Ahb2enrDcmien { 12004 pub const fn lptim4rst(&self) -> super::vals::Syscfgrst {
14690 let val = (self.0 >> 30usize) & 0x01; 12005 let val = (self.0 >> 11usize) & 0x01;
14691 super::vals::C1Ahb2enrDcmien(val as u8) 12006 super::vals::Syscfgrst(val as u8)
14692 } 12007 }
14693 #[doc = "SRAM2 block enable"] 12008 #[doc = "LPTIM4 block reset"]
14694 pub fn set_sram2en(&mut self, val: super::vals::C1Ahb2enrDcmien) { 12009 pub fn set_lptim4rst(&mut self, val: super::vals::Syscfgrst) {
14695 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); 12010 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
14696 } 12011 }
14697 #[doc = "SRAM3 block enable"] 12012 #[doc = "LPTIM5 block reset"]
14698 pub const fn sram3en(&self) -> super::vals::C1Ahb2enrDcmien { 12013 pub const fn lptim5rst(&self) -> super::vals::Syscfgrst {
14699 let val = (self.0 >> 31usize) & 0x01; 12014 let val = (self.0 >> 12usize) & 0x01;
14700 super::vals::C1Ahb2enrDcmien(val as u8) 12015 super::vals::Syscfgrst(val as u8)
14701 } 12016 }
14702 #[doc = "SRAM3 block enable"] 12017 #[doc = "LPTIM5 block reset"]
14703 pub fn set_sram3en(&mut self, val: super::vals::C1Ahb2enrDcmien) { 12018 pub fn set_lptim5rst(&mut self, val: super::vals::Syscfgrst) {
14704 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 12019 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
12020 }
12021 #[doc = "COMP12 Blocks Reset"]
12022 pub const fn comp12rst(&self) -> super::vals::Syscfgrst {
12023 let val = (self.0 >> 14usize) & 0x01;
12024 super::vals::Syscfgrst(val as u8)
12025 }
12026 #[doc = "COMP12 Blocks Reset"]
12027 pub fn set_comp12rst(&mut self, val: super::vals::Syscfgrst) {
12028 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
12029 }
12030 #[doc = "VREF block reset"]
12031 pub const fn vrefrst(&self) -> super::vals::Syscfgrst {
12032 let val = (self.0 >> 15usize) & 0x01;
12033 super::vals::Syscfgrst(val as u8)
12034 }
12035 #[doc = "VREF block reset"]
12036 pub fn set_vrefrst(&mut self, val: super::vals::Syscfgrst) {
12037 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
12038 }
12039 #[doc = "SAI4 block reset"]
12040 pub const fn sai4rst(&self) -> super::vals::Syscfgrst {
12041 let val = (self.0 >> 21usize) & 0x01;
12042 super::vals::Syscfgrst(val as u8)
12043 }
12044 #[doc = "SAI4 block reset"]
12045 pub fn set_sai4rst(&mut self, val: super::vals::Syscfgrst) {
12046 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
14705 } 12047 }
14706 } 12048 }
14707 impl Default for C1Ahb2enr { 12049 impl Default for Apb4rstr {
14708 fn default() -> C1Ahb2enr { 12050 fn default() -> Apb4rstr {
14709 C1Ahb2enr(0) 12051 Apb4rstr(0)
14710 } 12052 }
14711 } 12053 }
14712 #[doc = "RCC Reset Status Register"] 12054 #[doc = "RCC Reset Status Register"]
@@ -14819,486 +12161,719 @@ pub mod rcc_h7 {
14819 C1Rsr(0) 12161 C1Rsr(0)
14820 } 12162 }
14821 } 12163 }
14822 #[doc = "RCC AHB3 Reset Register"] 12164 #[doc = "RCC PLLs Configuration Register"]
14823 #[repr(transparent)] 12165 #[repr(transparent)]
14824 #[derive(Copy, Clone, Eq, PartialEq)] 12166 #[derive(Copy, Clone, Eq, PartialEq)]
14825 pub struct Ahb3rstr(pub u32); 12167 pub struct Pllcfgr(pub u32);
14826 impl Ahb3rstr { 12168 impl Pllcfgr {
14827 #[doc = "MDMA block reset"] 12169 #[doc = "PLL1 fractional latch enable"]
14828 pub const fn mdmarst(&self) -> super::vals::Mdmarst { 12170 pub fn pllfracen(&self, n: usize) -> super::vals::Pll1fracen {
12171 assert!(n < 3usize);
12172 let offs = 0usize + n * 4usize;
12173 let val = (self.0 >> offs) & 0x01;
12174 super::vals::Pll1fracen(val as u8)
12175 }
12176 #[doc = "PLL1 fractional latch enable"]
12177 pub fn set_pllfracen(&mut self, n: usize, val: super::vals::Pll1fracen) {
12178 assert!(n < 3usize);
12179 let offs = 0usize + n * 4usize;
12180 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12181 }
12182 #[doc = "PLL1 VCO selection"]
12183 pub fn pllvcosel(&self, n: usize) -> super::vals::Pll1vcosel {
12184 assert!(n < 3usize);
12185 let offs = 1usize + n * 4usize;
12186 let val = (self.0 >> offs) & 0x01;
12187 super::vals::Pll1vcosel(val as u8)
12188 }
12189 #[doc = "PLL1 VCO selection"]
12190 pub fn set_pllvcosel(&mut self, n: usize, val: super::vals::Pll1vcosel) {
12191 assert!(n < 3usize);
12192 let offs = 1usize + n * 4usize;
12193 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12194 }
12195 #[doc = "PLL1 input frequency range"]
12196 pub fn pllrge(&self, n: usize) -> super::vals::Pll1rge {
12197 assert!(n < 3usize);
12198 let offs = 2usize + n * 4usize;
12199 let val = (self.0 >> offs) & 0x03;
12200 super::vals::Pll1rge(val as u8)
12201 }
12202 #[doc = "PLL1 input frequency range"]
12203 pub fn set_pllrge(&mut self, n: usize, val: super::vals::Pll1rge) {
12204 assert!(n < 3usize);
12205 let offs = 2usize + n * 4usize;
12206 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
12207 }
12208 #[doc = "PLL1 DIVP divider output enable"]
12209 pub fn divpen(&self, n: usize) -> super::vals::Divp1en {
12210 assert!(n < 3usize);
12211 let offs = 16usize + n * 3usize;
12212 let val = (self.0 >> offs) & 0x01;
12213 super::vals::Divp1en(val as u8)
12214 }
12215 #[doc = "PLL1 DIVP divider output enable"]
12216 pub fn set_divpen(&mut self, n: usize, val: super::vals::Divp1en) {
12217 assert!(n < 3usize);
12218 let offs = 16usize + n * 3usize;
12219 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12220 }
12221 #[doc = "PLL1 DIVQ divider output enable"]
12222 pub fn divqen(&self, n: usize) -> super::vals::Divp1en {
12223 assert!(n < 3usize);
12224 let offs = 17usize + n * 3usize;
12225 let val = (self.0 >> offs) & 0x01;
12226 super::vals::Divp1en(val as u8)
12227 }
12228 #[doc = "PLL1 DIVQ divider output enable"]
12229 pub fn set_divqen(&mut self, n: usize, val: super::vals::Divp1en) {
12230 assert!(n < 3usize);
12231 let offs = 17usize + n * 3usize;
12232 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12233 }
12234 #[doc = "PLL1 DIVR divider output enable"]
12235 pub fn divren(&self, n: usize) -> super::vals::Divp1en {
12236 assert!(n < 3usize);
12237 let offs = 18usize + n * 3usize;
12238 let val = (self.0 >> offs) & 0x01;
12239 super::vals::Divp1en(val as u8)
12240 }
12241 #[doc = "PLL1 DIVR divider output enable"]
12242 pub fn set_divren(&mut self, n: usize, val: super::vals::Divp1en) {
12243 assert!(n < 3usize);
12244 let offs = 18usize + n * 3usize;
12245 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
12246 }
12247 }
12248 impl Default for Pllcfgr {
12249 fn default() -> Pllcfgr {
12250 Pllcfgr(0)
12251 }
12252 }
12253 #[doc = "RCC APB2 Peripheral Reset Register"]
12254 #[repr(transparent)]
12255 #[derive(Copy, Clone, Eq, PartialEq)]
12256 pub struct Apb2rstr(pub u32);
12257 impl Apb2rstr {
12258 #[doc = "TIM1 block reset"]
12259 pub const fn tim1rst(&self) -> super::vals::Tim1rst {
14829 let val = (self.0 >> 0usize) & 0x01; 12260 let val = (self.0 >> 0usize) & 0x01;
14830 super::vals::Mdmarst(val as u8) 12261 super::vals::Tim1rst(val as u8)
14831 } 12262 }
14832 #[doc = "MDMA block reset"] 12263 #[doc = "TIM1 block reset"]
14833 pub fn set_mdmarst(&mut self, val: super::vals::Mdmarst) { 12264 pub fn set_tim1rst(&mut self, val: super::vals::Tim1rst) {
14834 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 12265 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
14835 } 12266 }
14836 #[doc = "DMA2D block reset"] 12267 #[doc = "TIM8 block reset"]
14837 pub const fn dma2drst(&self) -> super::vals::Mdmarst { 12268 pub const fn tim8rst(&self) -> super::vals::Tim1rst {
12269 let val = (self.0 >> 1usize) & 0x01;
12270 super::vals::Tim1rst(val as u8)
12271 }
12272 #[doc = "TIM8 block reset"]
12273 pub fn set_tim8rst(&mut self, val: super::vals::Tim1rst) {
12274 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
12275 }
12276 #[doc = "USART1 block reset"]
12277 pub const fn usart1rst(&self) -> super::vals::Tim1rst {
14838 let val = (self.0 >> 4usize) & 0x01; 12278 let val = (self.0 >> 4usize) & 0x01;
14839 super::vals::Mdmarst(val as u8) 12279 super::vals::Tim1rst(val as u8)
14840 } 12280 }
14841 #[doc = "DMA2D block reset"] 12281 #[doc = "USART1 block reset"]
14842 pub fn set_dma2drst(&mut self, val: super::vals::Mdmarst) { 12282 pub fn set_usart1rst(&mut self, val: super::vals::Tim1rst) {
14843 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 12283 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
14844 } 12284 }
14845 #[doc = "JPGDEC block reset"] 12285 #[doc = "USART6 block reset"]
14846 pub const fn jpgdecrst(&self) -> super::vals::Mdmarst { 12286 pub const fn usart6rst(&self) -> super::vals::Tim1rst {
14847 let val = (self.0 >> 5usize) & 0x01; 12287 let val = (self.0 >> 5usize) & 0x01;
14848 super::vals::Mdmarst(val as u8) 12288 super::vals::Tim1rst(val as u8)
14849 } 12289 }
14850 #[doc = "JPGDEC block reset"] 12290 #[doc = "USART6 block reset"]
14851 pub fn set_jpgdecrst(&mut self, val: super::vals::Mdmarst) { 12291 pub fn set_usart6rst(&mut self, val: super::vals::Tim1rst) {
14852 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 12292 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14853 } 12293 }
14854 #[doc = "FMC block reset"] 12294 #[doc = "SPI1 block reset"]
14855 pub const fn fmcrst(&self) -> super::vals::Mdmarst { 12295 pub const fn spi1rst(&self) -> super::vals::Tim1rst {
14856 let val = (self.0 >> 12usize) & 0x01; 12296 let val = (self.0 >> 12usize) & 0x01;
14857 super::vals::Mdmarst(val as u8) 12297 super::vals::Tim1rst(val as u8)
14858 } 12298 }
14859 #[doc = "FMC block reset"] 12299 #[doc = "SPI1 block reset"]
14860 pub fn set_fmcrst(&mut self, val: super::vals::Mdmarst) { 12300 pub fn set_spi1rst(&mut self, val: super::vals::Tim1rst) {
14861 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 12301 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
14862 } 12302 }
14863 #[doc = "QUADSPI and QUADSPI delay block reset"] 12303 #[doc = "SPI4 block reset"]
14864 pub const fn qspirst(&self) -> super::vals::Mdmarst { 12304 pub const fn spi4rst(&self) -> super::vals::Tim1rst {
14865 let val = (self.0 >> 14usize) & 0x01; 12305 let val = (self.0 >> 13usize) & 0x01;
14866 super::vals::Mdmarst(val as u8) 12306 super::vals::Tim1rst(val as u8)
14867 } 12307 }
14868 #[doc = "QUADSPI and QUADSPI delay block reset"] 12308 #[doc = "SPI4 block reset"]
14869 pub fn set_qspirst(&mut self, val: super::vals::Mdmarst) { 12309 pub fn set_spi4rst(&mut self, val: super::vals::Tim1rst) {
14870 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 12310 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
14871 } 12311 }
14872 #[doc = "SDMMC1 and SDMMC1 delay block reset"] 12312 #[doc = "TIM15 block reset"]
14873 pub const fn sdmmc1rst(&self) -> super::vals::Mdmarst { 12313 pub const fn tim15rst(&self) -> super::vals::Tim1rst {
14874 let val = (self.0 >> 16usize) & 0x01; 12314 let val = (self.0 >> 16usize) & 0x01;
14875 super::vals::Mdmarst(val as u8) 12315 super::vals::Tim1rst(val as u8)
14876 } 12316 }
14877 #[doc = "SDMMC1 and SDMMC1 delay block reset"] 12317 #[doc = "TIM15 block reset"]
14878 pub fn set_sdmmc1rst(&mut self, val: super::vals::Mdmarst) { 12318 pub fn set_tim15rst(&mut self, val: super::vals::Tim1rst) {
14879 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 12319 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
14880 } 12320 }
14881 #[doc = "CPU reset"] 12321 #[doc = "TIM16 block reset"]
14882 pub const fn cpurst(&self) -> super::vals::Mdmarst { 12322 pub const fn tim16rst(&self) -> super::vals::Tim1rst {
14883 let val = (self.0 >> 31usize) & 0x01; 12323 let val = (self.0 >> 17usize) & 0x01;
14884 super::vals::Mdmarst(val as u8) 12324 super::vals::Tim1rst(val as u8)
14885 } 12325 }
14886 #[doc = "CPU reset"] 12326 #[doc = "TIM16 block reset"]
14887 pub fn set_cpurst(&mut self, val: super::vals::Mdmarst) { 12327 pub fn set_tim16rst(&mut self, val: super::vals::Tim1rst) {
14888 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 12328 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
12329 }
12330 #[doc = "TIM17 block reset"]
12331 pub const fn tim17rst(&self) -> super::vals::Tim1rst {
12332 let val = (self.0 >> 18usize) & 0x01;
12333 super::vals::Tim1rst(val as u8)
12334 }
12335 #[doc = "TIM17 block reset"]
12336 pub fn set_tim17rst(&mut self, val: super::vals::Tim1rst) {
12337 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
12338 }
12339 #[doc = "SPI5 block reset"]
12340 pub const fn spi5rst(&self) -> super::vals::Tim1rst {
12341 let val = (self.0 >> 20usize) & 0x01;
12342 super::vals::Tim1rst(val as u8)
12343 }
12344 #[doc = "SPI5 block reset"]
12345 pub fn set_spi5rst(&mut self, val: super::vals::Tim1rst) {
12346 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
12347 }
12348 #[doc = "SAI1 block reset"]
12349 pub const fn sai1rst(&self) -> super::vals::Tim1rst {
12350 let val = (self.0 >> 22usize) & 0x01;
12351 super::vals::Tim1rst(val as u8)
12352 }
12353 #[doc = "SAI1 block reset"]
12354 pub fn set_sai1rst(&mut self, val: super::vals::Tim1rst) {
12355 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
12356 }
12357 #[doc = "SAI2 block reset"]
12358 pub const fn sai2rst(&self) -> super::vals::Tim1rst {
12359 let val = (self.0 >> 23usize) & 0x01;
12360 super::vals::Tim1rst(val as u8)
12361 }
12362 #[doc = "SAI2 block reset"]
12363 pub fn set_sai2rst(&mut self, val: super::vals::Tim1rst) {
12364 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
12365 }
12366 #[doc = "SAI3 block reset"]
12367 pub const fn sai3rst(&self) -> super::vals::Tim1rst {
12368 let val = (self.0 >> 24usize) & 0x01;
12369 super::vals::Tim1rst(val as u8)
12370 }
12371 #[doc = "SAI3 block reset"]
12372 pub fn set_sai3rst(&mut self, val: super::vals::Tim1rst) {
12373 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
12374 }
12375 #[doc = "DFSDM1 block reset"]
12376 pub const fn dfsdm1rst(&self) -> super::vals::Tim1rst {
12377 let val = (self.0 >> 28usize) & 0x01;
12378 super::vals::Tim1rst(val as u8)
12379 }
12380 #[doc = "DFSDM1 block reset"]
12381 pub fn set_dfsdm1rst(&mut self, val: super::vals::Tim1rst) {
12382 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
12383 }
12384 #[doc = "HRTIM block reset"]
12385 pub const fn hrtimrst(&self) -> super::vals::Tim1rst {
12386 let val = (self.0 >> 29usize) & 0x01;
12387 super::vals::Tim1rst(val as u8)
12388 }
12389 #[doc = "HRTIM block reset"]
12390 pub fn set_hrtimrst(&mut self, val: super::vals::Tim1rst) {
12391 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
14889 } 12392 }
14890 } 12393 }
14891 impl Default for Ahb3rstr { 12394 impl Default for Apb2rstr {
14892 fn default() -> Ahb3rstr { 12395 fn default() -> Apb2rstr {
14893 Ahb3rstr(0) 12396 Apb2rstr(0)
14894 } 12397 }
14895 } 12398 }
14896 #[doc = "RCC APB3 Peripheral Reset Register"] 12399 #[doc = "RCC Domain 1 Kernel Clock Configuration Register"]
14897 #[repr(transparent)] 12400 #[repr(transparent)]
14898 #[derive(Copy, Clone, Eq, PartialEq)] 12401 #[derive(Copy, Clone, Eq, PartialEq)]
14899 pub struct Apb3rstr(pub u32); 12402 pub struct D1ccipr(pub u32);
14900 impl Apb3rstr { 12403 impl D1ccipr {
14901 #[doc = "LTDC block reset"] 12404 #[doc = "FMC kernel clock source selection"]
14902 pub const fn ltdcrst(&self) -> super::vals::Ltdcrst { 12405 pub const fn fmcsel(&self) -> super::vals::Fmcsel {
14903 let val = (self.0 >> 3usize) & 0x01; 12406 let val = (self.0 >> 0usize) & 0x03;
14904 super::vals::Ltdcrst(val as u8) 12407 super::vals::Fmcsel(val as u8)
14905 } 12408 }
14906 #[doc = "LTDC block reset"] 12409 #[doc = "FMC kernel clock source selection"]
14907 pub fn set_ltdcrst(&mut self, val: super::vals::Ltdcrst) { 12410 pub fn set_fmcsel(&mut self, val: super::vals::Fmcsel) {
14908 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 12411 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
12412 }
12413 #[doc = "QUADSPI kernel clock source selection"]
12414 pub const fn qspisel(&self) -> super::vals::Fmcsel {
12415 let val = (self.0 >> 4usize) & 0x03;
12416 super::vals::Fmcsel(val as u8)
12417 }
12418 #[doc = "QUADSPI kernel clock source selection"]
12419 pub fn set_qspisel(&mut self, val: super::vals::Fmcsel) {
12420 self.0 = (self.0 & !(0x03 << 4usize)) | (((val.0 as u32) & 0x03) << 4usize);
12421 }
12422 #[doc = "SDMMC kernel clock source selection"]
12423 pub const fn sdmmcsel(&self) -> super::vals::Sdmmcsel {
12424 let val = (self.0 >> 16usize) & 0x01;
12425 super::vals::Sdmmcsel(val as u8)
12426 }
12427 #[doc = "SDMMC kernel clock source selection"]
12428 pub fn set_sdmmcsel(&mut self, val: super::vals::Sdmmcsel) {
12429 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
12430 }
12431 #[doc = "per_ck clock source selection"]
12432 pub const fn ckpersel(&self) -> super::vals::Ckpersel {
12433 let val = (self.0 >> 28usize) & 0x03;
12434 super::vals::Ckpersel(val as u8)
12435 }
12436 #[doc = "per_ck clock source selection"]
12437 pub fn set_ckpersel(&mut self, val: super::vals::Ckpersel) {
12438 self.0 = (self.0 & !(0x03 << 28usize)) | (((val.0 as u32) & 0x03) << 28usize);
14909 } 12439 }
14910 } 12440 }
14911 impl Default for Apb3rstr { 12441 impl Default for D1ccipr {
14912 fn default() -> Apb3rstr { 12442 fn default() -> D1ccipr {
14913 Apb3rstr(0) 12443 D1ccipr(0)
14914 } 12444 }
14915 } 12445 }
14916 #[doc = "RCC AHB4 Clock Register"] 12446 #[doc = "RCC APB4 Sleep Clock Register"]
14917 #[repr(transparent)] 12447 #[repr(transparent)]
14918 #[derive(Copy, Clone, Eq, PartialEq)] 12448 #[derive(Copy, Clone, Eq, PartialEq)]
14919 pub struct C1Ahb4enr(pub u32); 12449 pub struct Apb4lpenr(pub u32);
14920 impl C1Ahb4enr { 12450 impl Apb4lpenr {
14921 #[doc = "0GPIO peripheral clock enable"] 12451 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
14922 pub const fn gpioaen(&self) -> super::vals::C1Ahb4enrGpioaen { 12452 pub const fn syscfglpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
14923 let val = (self.0 >> 0usize) & 0x01;
14924 super::vals::C1Ahb4enrGpioaen(val as u8)
14925 }
14926 #[doc = "0GPIO peripheral clock enable"]
14927 pub fn set_gpioaen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14928 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
14929 }
14930 #[doc = "0GPIO peripheral clock enable"]
14931 pub const fn gpioben(&self) -> super::vals::C1Ahb4enrGpioaen {
14932 let val = (self.0 >> 1usize) & 0x01; 12453 let val = (self.0 >> 1usize) & 0x01;
14933 super::vals::C1Ahb4enrGpioaen(val as u8) 12454 super::vals::Apb4lpenrSyscfglpen(val as u8)
14934 } 12455 }
14935 #[doc = "0GPIO peripheral clock enable"] 12456 #[doc = "SYSCFG peripheral clock enable during CSleep mode"]
14936 pub fn set_gpioben(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12457 pub fn set_syscfglpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
14937 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 12458 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
14938 } 12459 }
14939 #[doc = "0GPIO peripheral clock enable"] 12460 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
14940 pub const fn gpiocen(&self) -> super::vals::C1Ahb4enrGpioaen { 12461 pub const fn lpuart1lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
14941 let val = (self.0 >> 2usize) & 0x01;
14942 super::vals::C1Ahb4enrGpioaen(val as u8)
14943 }
14944 #[doc = "0GPIO peripheral clock enable"]
14945 pub fn set_gpiocen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14946 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
14947 }
14948 #[doc = "0GPIO peripheral clock enable"]
14949 pub const fn gpioden(&self) -> super::vals::C1Ahb4enrGpioaen {
14950 let val = (self.0 >> 3usize) & 0x01; 12462 let val = (self.0 >> 3usize) & 0x01;
14951 super::vals::C1Ahb4enrGpioaen(val as u8) 12463 super::vals::Apb4lpenrSyscfglpen(val as u8)
14952 } 12464 }
14953 #[doc = "0GPIO peripheral clock enable"] 12465 #[doc = "LPUART1 Peripheral Clocks Enable During CSleep Mode"]
14954 pub fn set_gpioden(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12466 pub fn set_lpuart1lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
14955 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 12467 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
14956 } 12468 }
14957 #[doc = "0GPIO peripheral clock enable"] 12469 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
14958 pub const fn gpioeen(&self) -> super::vals::C1Ahb4enrGpioaen { 12470 pub const fn spi6lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
14959 let val = (self.0 >> 4usize) & 0x01;
14960 super::vals::C1Ahb4enrGpioaen(val as u8)
14961 }
14962 #[doc = "0GPIO peripheral clock enable"]
14963 pub fn set_gpioeen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14964 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
14965 }
14966 #[doc = "0GPIO peripheral clock enable"]
14967 pub const fn gpiofen(&self) -> super::vals::C1Ahb4enrGpioaen {
14968 let val = (self.0 >> 5usize) & 0x01; 12471 let val = (self.0 >> 5usize) & 0x01;
14969 super::vals::C1Ahb4enrGpioaen(val as u8) 12472 super::vals::Apb4lpenrSyscfglpen(val as u8)
14970 } 12473 }
14971 #[doc = "0GPIO peripheral clock enable"] 12474 #[doc = "SPI6 Peripheral Clocks Enable During CSleep Mode"]
14972 pub fn set_gpiofen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12475 pub fn set_spi6lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
14973 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 12476 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
14974 } 12477 }
14975 #[doc = "0GPIO peripheral clock enable"] 12478 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
14976 pub const fn gpiogen(&self) -> super::vals::C1Ahb4enrGpioaen { 12479 pub const fn i2c4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
14977 let val = (self.0 >> 6usize) & 0x01;
14978 super::vals::C1Ahb4enrGpioaen(val as u8)
14979 }
14980 #[doc = "0GPIO peripheral clock enable"]
14981 pub fn set_gpiogen(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
14982 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
14983 }
14984 #[doc = "0GPIO peripheral clock enable"]
14985 pub const fn gpiohen(&self) -> super::vals::C1Ahb4enrGpioaen {
14986 let val = (self.0 >> 7usize) & 0x01; 12480 let val = (self.0 >> 7usize) & 0x01;
14987 super::vals::C1Ahb4enrGpioaen(val as u8) 12481 super::vals::Apb4lpenrSyscfglpen(val as u8)
14988 } 12482 }
14989 #[doc = "0GPIO peripheral clock enable"] 12483 #[doc = "I2C4 Peripheral Clocks Enable During CSleep Mode"]
14990 pub fn set_gpiohen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12484 pub fn set_i2c4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
14991 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 12485 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14992 } 12486 }
14993 #[doc = "0GPIO peripheral clock enable"] 12487 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
14994 pub const fn gpioien(&self) -> super::vals::C1Ahb4enrGpioaen { 12488 pub const fn lptim2lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
14995 let val = (self.0 >> 8usize) & 0x01;
14996 super::vals::C1Ahb4enrGpioaen(val as u8)
14997 }
14998 #[doc = "0GPIO peripheral clock enable"]
14999 pub fn set_gpioien(&mut self, val: super::vals::C1Ahb4enrGpioaen) {
15000 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
15001 }
15002 #[doc = "0GPIO peripheral clock enable"]
15003 pub const fn gpiojen(&self) -> super::vals::C1Ahb4enrGpioaen {
15004 let val = (self.0 >> 9usize) & 0x01; 12489 let val = (self.0 >> 9usize) & 0x01;
15005 super::vals::C1Ahb4enrGpioaen(val as u8) 12490 super::vals::Apb4lpenrSyscfglpen(val as u8)
15006 } 12491 }
15007 #[doc = "0GPIO peripheral clock enable"] 12492 #[doc = "LPTIM2 Peripheral Clocks Enable During CSleep Mode"]
15008 pub fn set_gpiojen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12493 pub fn set_lptim2lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15009 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 12494 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
15010 } 12495 }
15011 #[doc = "0GPIO peripheral clock enable"] 12496 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
15012 pub const fn gpioken(&self) -> super::vals::C1Ahb4enrGpioaen { 12497 pub const fn lptim3lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
15013 let val = (self.0 >> 10usize) & 0x01; 12498 let val = (self.0 >> 10usize) & 0x01;
15014 super::vals::C1Ahb4enrGpioaen(val as u8) 12499 super::vals::Apb4lpenrSyscfglpen(val as u8)
15015 } 12500 }
15016 #[doc = "0GPIO peripheral clock enable"] 12501 #[doc = "LPTIM3 Peripheral Clocks Enable During CSleep Mode"]
15017 pub fn set_gpioken(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12502 pub fn set_lptim3lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15018 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 12503 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
15019 } 12504 }
15020 #[doc = "CRC peripheral clock enable"] 12505 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
15021 pub const fn crcen(&self) -> super::vals::C1Ahb4enrGpioaen { 12506 pub const fn lptim4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
15022 let val = (self.0 >> 19usize) & 0x01; 12507 let val = (self.0 >> 11usize) & 0x01;
15023 super::vals::C1Ahb4enrGpioaen(val as u8) 12508 super::vals::Apb4lpenrSyscfglpen(val as u8)
15024 } 12509 }
15025 #[doc = "CRC peripheral clock enable"] 12510 #[doc = "LPTIM4 Peripheral Clocks Enable During CSleep Mode"]
15026 pub fn set_crcen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12511 pub fn set_lptim4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15027 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 12512 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
15028 } 12513 }
15029 #[doc = "BDMA and DMAMUX2 Clock Enable"] 12514 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
15030 pub const fn bdmaen(&self) -> super::vals::C1Ahb4enrGpioaen { 12515 pub const fn lptim5lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
15031 let val = (self.0 >> 21usize) & 0x01; 12516 let val = (self.0 >> 12usize) & 0x01;
15032 super::vals::C1Ahb4enrGpioaen(val as u8) 12517 super::vals::Apb4lpenrSyscfglpen(val as u8)
15033 } 12518 }
15034 #[doc = "BDMA and DMAMUX2 Clock Enable"] 12519 #[doc = "LPTIM5 Peripheral Clocks Enable During CSleep Mode"]
15035 pub fn set_bdmaen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12520 pub fn set_lptim5lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15036 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 12521 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
15037 } 12522 }
15038 #[doc = "ADC3 Peripheral Clocks Enable"] 12523 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
15039 pub const fn adc3en(&self) -> super::vals::C1Ahb4enrGpioaen { 12524 pub const fn comp12lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
15040 let val = (self.0 >> 24usize) & 0x01; 12525 let val = (self.0 >> 14usize) & 0x01;
15041 super::vals::C1Ahb4enrGpioaen(val as u8) 12526 super::vals::Apb4lpenrSyscfglpen(val as u8)
15042 } 12527 }
15043 #[doc = "ADC3 Peripheral Clocks Enable"] 12528 #[doc = "COMP1/2 peripheral clock enable during CSleep mode"]
15044 pub fn set_adc3en(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12529 pub fn set_comp12lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15045 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 12530 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
15046 } 12531 }
15047 #[doc = "HSEM peripheral clock enable"] 12532 #[doc = "VREF peripheral clock enable during CSleep mode"]
15048 pub const fn hsemen(&self) -> super::vals::C1Ahb4enrGpioaen { 12533 pub const fn vreflpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
15049 let val = (self.0 >> 25usize) & 0x01; 12534 let val = (self.0 >> 15usize) & 0x01;
15050 super::vals::C1Ahb4enrGpioaen(val as u8) 12535 super::vals::Apb4lpenrSyscfglpen(val as u8)
15051 } 12536 }
15052 #[doc = "HSEM peripheral clock enable"] 12537 #[doc = "VREF peripheral clock enable during CSleep mode"]
15053 pub fn set_hsemen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12538 pub fn set_vreflpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15054 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 12539 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
15055 } 12540 }
15056 #[doc = "Backup RAM Clock Enable"] 12541 #[doc = "RTC APB Clock Enable During CSleep Mode"]
15057 pub const fn bkpramen(&self) -> super::vals::C1Ahb4enrGpioaen { 12542 pub const fn rtcapblpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
15058 let val = (self.0 >> 28usize) & 0x01; 12543 let val = (self.0 >> 16usize) & 0x01;
15059 super::vals::C1Ahb4enrGpioaen(val as u8) 12544 super::vals::Apb4lpenrSyscfglpen(val as u8)
15060 } 12545 }
15061 #[doc = "Backup RAM Clock Enable"] 12546 #[doc = "RTC APB Clock Enable During CSleep Mode"]
15062 pub fn set_bkpramen(&mut self, val: super::vals::C1Ahb4enrGpioaen) { 12547 pub fn set_rtcapblpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
15063 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 12548 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
12549 }
12550 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
12551 pub const fn sai4lpen(&self) -> super::vals::Apb4lpenrSyscfglpen {
12552 let val = (self.0 >> 21usize) & 0x01;
12553 super::vals::Apb4lpenrSyscfglpen(val as u8)
12554 }
12555 #[doc = "SAI4 Peripheral Clocks Enable During CSleep Mode"]
12556 pub fn set_sai4lpen(&mut self, val: super::vals::Apb4lpenrSyscfglpen) {
12557 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
15064 } 12558 }
15065 } 12559 }
15066 impl Default for C1Ahb4enr { 12560 impl Default for Apb4lpenr {
15067 fn default() -> C1Ahb4enr { 12561 fn default() -> Apb4lpenr {
15068 C1Ahb4enr(0) 12562 Apb4lpenr(0)
15069 } 12563 }
15070 } 12564 }
15071 #[doc = "RCC Clock Recovery RC Register"] 12565 #[doc = "RCC CSI configuration register"]
15072 #[repr(transparent)] 12566 #[repr(transparent)]
15073 #[derive(Copy, Clone, Eq, PartialEq)] 12567 #[derive(Copy, Clone, Eq, PartialEq)]
15074 pub struct Crrcr(pub u32); 12568 pub struct Csicfgr(pub u32);
15075 impl Crrcr { 12569 impl Csicfgr {
15076 #[doc = "Internal RC 48 MHz clock calibration"] 12570 #[doc = "CSI clock calibration"]
15077 pub const fn hsi48cal(&self) -> u16 { 12571 pub const fn csical(&self) -> u16 {
15078 let val = (self.0 >> 0usize) & 0x03ff; 12572 let val = (self.0 >> 0usize) & 0x01ff;
15079 val as u16 12573 val as u16
15080 } 12574 }
15081 #[doc = "Internal RC 48 MHz clock calibration"] 12575 #[doc = "CSI clock calibration"]
15082 pub fn set_hsi48cal(&mut self, val: u16) { 12576 pub fn set_csical(&mut self, val: u16) {
15083 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize); 12577 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
12578 }
12579 #[doc = "CSI clock trimming"]
12580 pub const fn csitrim(&self) -> u8 {
12581 let val = (self.0 >> 24usize) & 0x3f;
12582 val as u8
12583 }
12584 #[doc = "CSI clock trimming"]
12585 pub fn set_csitrim(&mut self, val: u8) {
12586 self.0 = (self.0 & !(0x3f << 24usize)) | (((val as u32) & 0x3f) << 24usize);
15084 } 12587 }
15085 } 12588 }
15086 impl Default for Crrcr { 12589 impl Default for Csicfgr {
15087 fn default() -> Crrcr { 12590 fn default() -> Csicfgr {
15088 Crrcr(0) 12591 Csicfgr(0)
15089 } 12592 }
15090 } 12593 }
15091 #[doc = "RCC PLL3 Fractional Divider Register"] 12594 #[doc = "RCC AHB3 Clock Register"]
15092 #[repr(transparent)] 12595 #[repr(transparent)]
15093 #[derive(Copy, Clone, Eq, PartialEq)] 12596 #[derive(Copy, Clone, Eq, PartialEq)]
15094 pub struct Pll3fracr(pub u32); 12597 pub struct C1Ahb3enr(pub u32);
15095 impl Pll3fracr { 12598 impl C1Ahb3enr {
15096 #[doc = "Fractional part of the multiplication factor for PLL3 VCO"] 12599 #[doc = "MDMA Peripheral Clock Enable"]
15097 pub const fn fracn3(&self) -> u16 { 12600 pub const fn mdmaen(&self) -> super::vals::C1Ahb3enrMdmaen {
15098 let val = (self.0 >> 3usize) & 0x1fff; 12601 let val = (self.0 >> 0usize) & 0x01;
15099 val as u16 12602 super::vals::C1Ahb3enrMdmaen(val as u8)
15100 } 12603 }
15101 #[doc = "Fractional part of the multiplication factor for PLL3 VCO"] 12604 #[doc = "MDMA Peripheral Clock Enable"]
15102 pub fn set_fracn3(&mut self, val: u16) { 12605 pub fn set_mdmaen(&mut self, val: super::vals::C1Ahb3enrMdmaen) {
15103 self.0 = (self.0 & !(0x1fff << 3usize)) | (((val as u32) & 0x1fff) << 3usize); 12606 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
15104 } 12607 }
15105 } 12608 #[doc = "DMA2D Peripheral Clock Enable"]
15106 impl Default for Pll3fracr { 12609 pub const fn dma2den(&self) -> super::vals::C1Ahb3enrMdmaen {
15107 fn default() -> Pll3fracr { 12610 let val = (self.0 >> 4usize) & 0x01;
15108 Pll3fracr(0) 12611 super::vals::C1Ahb3enrMdmaen(val as u8)
15109 } 12612 }
15110 } 12613 #[doc = "DMA2D Peripheral Clock Enable"]
15111 #[doc = "RCC Domain 1 Clock Configuration Register"] 12614 pub fn set_dma2den(&mut self, val: super::vals::C1Ahb3enrMdmaen) {
15112 #[repr(transparent)] 12615 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
15113 #[derive(Copy, Clone, Eq, PartialEq)]
15114 pub struct D1cfgr(pub u32);
15115 impl D1cfgr {
15116 #[doc = "D1 domain AHB prescaler"]
15117 pub const fn hpre(&self) -> super::vals::Hpre {
15118 let val = (self.0 >> 0usize) & 0x0f;
15119 super::vals::Hpre(val as u8)
15120 } 12616 }
15121 #[doc = "D1 domain AHB prescaler"] 12617 #[doc = "JPGDEC Peripheral Clock Enable"]
15122 pub fn set_hpre(&mut self, val: super::vals::Hpre) { 12618 pub const fn jpgdecen(&self) -> super::vals::C1Ahb3enrMdmaen {
15123 self.0 = (self.0 & !(0x0f << 0usize)) | (((val.0 as u32) & 0x0f) << 0usize); 12619 let val = (self.0 >> 5usize) & 0x01;
12620 super::vals::C1Ahb3enrMdmaen(val as u8)
15124 } 12621 }
15125 #[doc = "D1 domain APB3 prescaler"] 12622 #[doc = "JPGDEC Peripheral Clock Enable"]
15126 pub const fn d1ppre(&self) -> super::vals::D1ppre { 12623 pub fn set_jpgdecen(&mut self, val: super::vals::C1Ahb3enrMdmaen) {
15127 let val = (self.0 >> 4usize) & 0x07; 12624 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
15128 super::vals::D1ppre(val as u8)
15129 } 12625 }
15130 #[doc = "D1 domain APB3 prescaler"] 12626 #[doc = "FMC Peripheral Clocks Enable"]
15131 pub fn set_d1ppre(&mut self, val: super::vals::D1ppre) { 12627 pub const fn fmcen(&self) -> super::vals::C1Ahb3enrMdmaen {
15132 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 12628 let val = (self.0 >> 12usize) & 0x01;
12629 super::vals::C1Ahb3enrMdmaen(val as u8)
15133 } 12630 }
15134 #[doc = "D1 domain Core prescaler"] 12631 #[doc = "FMC Peripheral Clocks Enable"]
15135 pub const fn d1cpre(&self) -> super::vals::Hpre { 12632 pub fn set_fmcen(&mut self, val: super::vals::C1Ahb3enrMdmaen) {
15136 let val = (self.0 >> 8usize) & 0x0f; 12633 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
15137 super::vals::Hpre(val as u8)
15138 } 12634 }
15139 #[doc = "D1 domain Core prescaler"] 12635 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"]
15140 pub fn set_d1cpre(&mut self, val: super::vals::Hpre) { 12636 pub const fn qspien(&self) -> super::vals::C1Ahb3enrMdmaen {
15141 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); 12637 let val = (self.0 >> 14usize) & 0x01;
12638 super::vals::C1Ahb3enrMdmaen(val as u8)
12639 }
12640 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"]
12641 pub fn set_qspien(&mut self, val: super::vals::C1Ahb3enrMdmaen) {
12642 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
12643 }
12644 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"]
12645 pub const fn sdmmc1en(&self) -> super::vals::C1Ahb3enrMdmaen {
12646 let val = (self.0 >> 16usize) & 0x01;
12647 super::vals::C1Ahb3enrMdmaen(val as u8)
12648 }
12649 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"]
12650 pub fn set_sdmmc1en(&mut self, val: super::vals::C1Ahb3enrMdmaen) {
12651 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
15142 } 12652 }
15143 } 12653 }
15144 impl Default for D1cfgr { 12654 impl Default for C1Ahb3enr {
15145 fn default() -> D1cfgr { 12655 fn default() -> C1Ahb3enr {
15146 D1cfgr(0) 12656 C1Ahb3enr(0)
15147 } 12657 }
15148 } 12658 }
15149 #[doc = "RCC AHB4 Sleep Clock Register"] 12659 #[doc = "RCC APB2 Sleep Clock Register"]
15150 #[repr(transparent)] 12660 #[repr(transparent)]
15151 #[derive(Copy, Clone, Eq, PartialEq)] 12661 #[derive(Copy, Clone, Eq, PartialEq)]
15152 pub struct C1Ahb4lpenr(pub u32); 12662 pub struct C1Apb2lpenr(pub u32);
15153 impl C1Ahb4lpenr { 12663 impl C1Apb2lpenr {
15154 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12664 #[doc = "TIM1 peripheral clock enable during CSleep mode"]
15155 pub const fn gpioalpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12665 pub const fn tim1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15156 let val = (self.0 >> 0usize) & 0x01; 12666 let val = (self.0 >> 0usize) & 0x01;
15157 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12667 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15158 } 12668 }
15159 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12669 #[doc = "TIM1 peripheral clock enable during CSleep mode"]
15160 pub fn set_gpioalpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12670 pub fn set_tim1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15161 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 12671 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
15162 } 12672 }
15163 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12673 #[doc = "TIM8 peripheral clock enable during CSleep mode"]
15164 pub const fn gpioblpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12674 pub const fn tim8lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15165 let val = (self.0 >> 1usize) & 0x01; 12675 let val = (self.0 >> 1usize) & 0x01;
15166 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12676 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15167 } 12677 }
15168 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12678 #[doc = "TIM8 peripheral clock enable during CSleep mode"]
15169 pub fn set_gpioblpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12679 pub fn set_tim8lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15170 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 12680 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
15171 } 12681 }
15172 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12682 #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"]
15173 pub const fn gpioclpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12683 pub const fn usart1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15174 let val = (self.0 >> 2usize) & 0x01;
15175 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
15176 }
15177 #[doc = "GPIO peripheral clock enable during CSleep mode"]
15178 pub fn set_gpioclpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
15179 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
15180 }
15181 #[doc = "GPIO peripheral clock enable during CSleep mode"]
15182 pub const fn gpiodlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
15183 let val = (self.0 >> 3usize) & 0x01;
15184 super::vals::C1Ahb4lpenrGpioalpen(val as u8)
15185 }
15186 #[doc = "GPIO peripheral clock enable during CSleep mode"]
15187 pub fn set_gpiodlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) {
15188 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
15189 }
15190 #[doc = "GPIO peripheral clock enable during CSleep mode"]
15191 pub const fn gpioelpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen {
15192 let val = (self.0 >> 4usize) & 0x01; 12684 let val = (self.0 >> 4usize) & 0x01;
15193 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12685 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15194 } 12686 }
15195 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12687 #[doc = "USART1 Peripheral Clocks Enable During CSleep Mode"]
15196 pub fn set_gpioelpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12688 pub fn set_usart1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15197 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 12689 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
15198 } 12690 }
15199 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12691 #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"]
15200 pub const fn gpioflpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12692 pub const fn usart6lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15201 let val = (self.0 >> 5usize) & 0x01; 12693 let val = (self.0 >> 5usize) & 0x01;
15202 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12694 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15203 } 12695 }
15204 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12696 #[doc = "USART6 Peripheral Clocks Enable During CSleep Mode"]
15205 pub fn set_gpioflpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12697 pub fn set_usart6lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15206 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 12698 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
15207 } 12699 }
15208 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12700 #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"]
15209 pub const fn gpioglpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12701 pub const fn spi1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15210 let val = (self.0 >> 6usize) & 0x01; 12702 let val = (self.0 >> 12usize) & 0x01;
15211 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12703 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15212 } 12704 }
15213 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12705 #[doc = "SPI1 Peripheral Clocks Enable During CSleep Mode"]
15214 pub fn set_gpioglpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12706 pub fn set_spi1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15215 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 12707 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
15216 } 12708 }
15217 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12709 #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"]
15218 pub const fn gpiohlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12710 pub const fn spi4lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15219 let val = (self.0 >> 7usize) & 0x01; 12711 let val = (self.0 >> 13usize) & 0x01;
15220 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12712 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15221 } 12713 }
15222 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12714 #[doc = "SPI4 Peripheral Clocks Enable During CSleep Mode"]
15223 pub fn set_gpiohlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12715 pub fn set_spi4lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15224 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 12716 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
15225 } 12717 }
15226 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12718 #[doc = "TIM15 peripheral clock enable during CSleep mode"]
15227 pub const fn gpioilpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12719 pub const fn tim15lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15228 let val = (self.0 >> 8usize) & 0x01; 12720 let val = (self.0 >> 16usize) & 0x01;
15229 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12721 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15230 } 12722 }
15231 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12723 #[doc = "TIM15 peripheral clock enable during CSleep mode"]
15232 pub fn set_gpioilpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12724 pub fn set_tim15lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15233 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 12725 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
15234 } 12726 }
15235 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12727 #[doc = "TIM16 peripheral clock enable during CSleep mode"]
15236 pub const fn gpiojlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12728 pub const fn tim16lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15237 let val = (self.0 >> 9usize) & 0x01; 12729 let val = (self.0 >> 17usize) & 0x01;
15238 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12730 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15239 } 12731 }
15240 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12732 #[doc = "TIM16 peripheral clock enable during CSleep mode"]
15241 pub fn set_gpiojlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12733 pub fn set_tim16lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15242 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 12734 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
15243 } 12735 }
15244 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12736 #[doc = "TIM17 peripheral clock enable during CSleep mode"]
15245 pub const fn gpioklpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12737 pub const fn tim17lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15246 let val = (self.0 >> 10usize) & 0x01; 12738 let val = (self.0 >> 18usize) & 0x01;
15247 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12739 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15248 } 12740 }
15249 #[doc = "GPIO peripheral clock enable during CSleep mode"] 12741 #[doc = "TIM17 peripheral clock enable during CSleep mode"]
15250 pub fn set_gpioklpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12742 pub fn set_tim17lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15251 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 12743 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
15252 } 12744 }
15253 #[doc = "CRC peripheral clock enable during CSleep mode"] 12745 #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"]
15254 pub const fn crclpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12746 pub const fn spi5lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15255 let val = (self.0 >> 19usize) & 0x01; 12747 let val = (self.0 >> 20usize) & 0x01;
15256 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12748 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15257 } 12749 }
15258 #[doc = "CRC peripheral clock enable during CSleep mode"] 12750 #[doc = "SPI5 Peripheral Clocks Enable During CSleep Mode"]
15259 pub fn set_crclpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12751 pub fn set_spi5lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15260 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 12752 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
15261 } 12753 }
15262 #[doc = "BDMA Clock Enable During CSleep Mode"] 12754 #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"]
15263 pub const fn bdmalpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12755 pub const fn sai1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15264 let val = (self.0 >> 21usize) & 0x01; 12756 let val = (self.0 >> 22usize) & 0x01;
15265 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12757 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15266 } 12758 }
15267 #[doc = "BDMA Clock Enable During CSleep Mode"] 12759 #[doc = "SAI1 Peripheral Clocks Enable During CSleep Mode"]
15268 pub fn set_bdmalpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12760 pub fn set_sai1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15269 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 12761 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
15270 } 12762 }
15271 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] 12763 #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"]
15272 pub const fn adc3lpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12764 pub const fn sai2lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
12765 let val = (self.0 >> 23usize) & 0x01;
12766 super::vals::C1Apb2lpenrTim1lpen(val as u8)
12767 }
12768 #[doc = "SAI2 Peripheral Clocks Enable During CSleep Mode"]
12769 pub fn set_sai2lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
12770 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
12771 }
12772 #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"]
12773 pub const fn sai3lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15273 let val = (self.0 >> 24usize) & 0x01; 12774 let val = (self.0 >> 24usize) & 0x01;
15274 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12775 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15275 } 12776 }
15276 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"] 12777 #[doc = "SAI3 Peripheral Clocks Enable During CSleep Mode"]
15277 pub fn set_adc3lpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12778 pub fn set_sai3lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15278 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 12779 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
15279 } 12780 }
15280 #[doc = "Backup RAM Clock Enable During CSleep Mode"] 12781 #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"]
15281 pub const fn bkpramlpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12782 pub const fn dfsdm1lpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15282 let val = (self.0 >> 28usize) & 0x01; 12783 let val = (self.0 >> 28usize) & 0x01;
15283 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12784 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15284 } 12785 }
15285 #[doc = "Backup RAM Clock Enable During CSleep Mode"] 12786 #[doc = "DFSDM1 Peripheral Clocks Enable During CSleep Mode"]
15286 pub fn set_bkpramlpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12787 pub fn set_dfsdm1lpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15287 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 12788 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
15288 } 12789 }
15289 #[doc = "SRAM4 Clock Enable During CSleep Mode"] 12790 #[doc = "HRTIM peripheral clock enable during CSleep mode"]
15290 pub const fn sram4lpen(&self) -> super::vals::C1Ahb4lpenrGpioalpen { 12791 pub const fn hrtimlpen(&self) -> super::vals::C1Apb2lpenrTim1lpen {
15291 let val = (self.0 >> 29usize) & 0x01; 12792 let val = (self.0 >> 29usize) & 0x01;
15292 super::vals::C1Ahb4lpenrGpioalpen(val as u8) 12793 super::vals::C1Apb2lpenrTim1lpen(val as u8)
15293 } 12794 }
15294 #[doc = "SRAM4 Clock Enable During CSleep Mode"] 12795 #[doc = "HRTIM peripheral clock enable during CSleep mode"]
15295 pub fn set_sram4lpen(&mut self, val: super::vals::C1Ahb4lpenrGpioalpen) { 12796 pub fn set_hrtimlpen(&mut self, val: super::vals::C1Apb2lpenrTim1lpen) {
15296 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 12797 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
15297 } 12798 }
15298 } 12799 }
15299 impl Default for C1Ahb4lpenr { 12800 impl Default for C1Apb2lpenr {
15300 fn default() -> C1Ahb4lpenr { 12801 fn default() -> C1Apb2lpenr {
15301 C1Ahb4lpenr(0) 12802 C1Apb2lpenr(0)
12803 }
12804 }
12805 #[doc = "RCC Domain 2 Kernel Clock Configuration Register"]
12806 #[repr(transparent)]
12807 #[derive(Copy, Clone, Eq, PartialEq)]
12808 pub struct D2ccip2r(pub u32);
12809 impl D2ccip2r {
12810 #[doc = "USART2/3, UART4,5, 7/8 (APB1) kernel clock source selection"]
12811 pub const fn usart234578sel(&self) -> super::vals::Usart234578sel {
12812 let val = (self.0 >> 0usize) & 0x07;
12813 super::vals::Usart234578sel(val as u8)
12814 }
12815 #[doc = "USART2/3, UART4,5, 7/8 (APB1) kernel clock source selection"]
12816 pub fn set_usart234578sel(&mut self, val: super::vals::Usart234578sel) {
12817 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
12818 }
12819 #[doc = "USART1 and 6 kernel clock source selection"]
12820 pub const fn usart16sel(&self) -> super::vals::Usart16sel {
12821 let val = (self.0 >> 3usize) & 0x07;
12822 super::vals::Usart16sel(val as u8)
12823 }
12824 #[doc = "USART1 and 6 kernel clock source selection"]
12825 pub fn set_usart16sel(&mut self, val: super::vals::Usart16sel) {
12826 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
12827 }
12828 #[doc = "RNG kernel clock source selection"]
12829 pub const fn rngsel(&self) -> super::vals::Rngsel {
12830 let val = (self.0 >> 8usize) & 0x03;
12831 super::vals::Rngsel(val as u8)
12832 }
12833 #[doc = "RNG kernel clock source selection"]
12834 pub fn set_rngsel(&mut self, val: super::vals::Rngsel) {
12835 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
12836 }
12837 #[doc = "I2C1,2,3 kernel clock source selection"]
12838 pub const fn i2c123sel(&self) -> super::vals::I2c123sel {
12839 let val = (self.0 >> 12usize) & 0x03;
12840 super::vals::I2c123sel(val as u8)
12841 }
12842 #[doc = "I2C1,2,3 kernel clock source selection"]
12843 pub fn set_i2c123sel(&mut self, val: super::vals::I2c123sel) {
12844 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
12845 }
12846 #[doc = "USBOTG 1 and 2 kernel clock source selection"]
12847 pub const fn usbsel(&self) -> super::vals::Usbsel {
12848 let val = (self.0 >> 20usize) & 0x03;
12849 super::vals::Usbsel(val as u8)
12850 }
12851 #[doc = "USBOTG 1 and 2 kernel clock source selection"]
12852 pub fn set_usbsel(&mut self, val: super::vals::Usbsel) {
12853 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
12854 }
12855 #[doc = "HDMI-CEC kernel clock source selection"]
12856 pub const fn cecsel(&self) -> super::vals::Cecsel {
12857 let val = (self.0 >> 22usize) & 0x03;
12858 super::vals::Cecsel(val as u8)
12859 }
12860 #[doc = "HDMI-CEC kernel clock source selection"]
12861 pub fn set_cecsel(&mut self, val: super::vals::Cecsel) {
12862 self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize);
12863 }
12864 #[doc = "LPTIM1 kernel clock source selection"]
12865 pub const fn lptim1sel(&self) -> super::vals::Lptim1sel {
12866 let val = (self.0 >> 28usize) & 0x07;
12867 super::vals::Lptim1sel(val as u8)
12868 }
12869 #[doc = "LPTIM1 kernel clock source selection"]
12870 pub fn set_lptim1sel(&mut self, val: super::vals::Lptim1sel) {
12871 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize);
12872 }
12873 }
12874 impl Default for D2ccip2r {
12875 fn default() -> D2ccip2r {
12876 D2ccip2r(0)
15302 } 12877 }
15303 } 12878 }
15304 #[doc = "RCC APB2 Sleep Clock Register"] 12879 #[doc = "RCC APB2 Sleep Clock Register"]
@@ -15447,53 +13022,6 @@ pub mod rcc_h7 {
15447 Apb2lpenr(0) 13022 Apb2lpenr(0)
15448 } 13023 }
15449 } 13024 }
15450 #[doc = "RCC Internal Clock Source Calibration Register"]
15451 #[repr(transparent)]
15452 #[derive(Copy, Clone, Eq, PartialEq)]
15453 pub struct Icscr(pub u32);
15454 impl Icscr {
15455 #[doc = "HSI clock calibration"]
15456 pub const fn hsical(&self) -> u16 {
15457 let val = (self.0 >> 0usize) & 0x0fff;
15458 val as u16
15459 }
15460 #[doc = "HSI clock calibration"]
15461 pub fn set_hsical(&mut self, val: u16) {
15462 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
15463 }
15464 #[doc = "HSI clock trimming"]
15465 pub const fn hsitrim(&self) -> u8 {
15466 let val = (self.0 >> 12usize) & 0x3f;
15467 val as u8
15468 }
15469 #[doc = "HSI clock trimming"]
15470 pub fn set_hsitrim(&mut self, val: u8) {
15471 self.0 = (self.0 & !(0x3f << 12usize)) | (((val as u32) & 0x3f) << 12usize);
15472 }
15473 #[doc = "CSI clock calibration"]
15474 pub const fn csical(&self) -> u8 {
15475 let val = (self.0 >> 18usize) & 0xff;
15476 val as u8
15477 }
15478 #[doc = "CSI clock calibration"]
15479 pub fn set_csical(&mut self, val: u8) {
15480 self.0 = (self.0 & !(0xff << 18usize)) | (((val as u32) & 0xff) << 18usize);
15481 }
15482 #[doc = "CSI clock trimming"]
15483 pub const fn csitrim(&self) -> u8 {
15484 let val = (self.0 >> 26usize) & 0x1f;
15485 val as u8
15486 }
15487 #[doc = "CSI clock trimming"]
15488 pub fn set_csitrim(&mut self, val: u8) {
15489 self.0 = (self.0 & !(0x1f << 26usize)) | (((val as u32) & 0x1f) << 26usize);
15490 }
15491 }
15492 impl Default for Icscr {
15493 fn default() -> Icscr {
15494 Icscr(0)
15495 }
15496 }
15497 #[doc = "RCC APB1 Clock Register"] 13025 #[doc = "RCC APB1 Clock Register"]
15498 #[repr(transparent)] 13026 #[repr(transparent)]
15499 #[derive(Copy, Clone, Eq, PartialEq)] 13027 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -15550,305 +13078,437 @@ pub mod rcc_h7 {
15550 C1Apb1henr(0) 13078 C1Apb1henr(0)
15551 } 13079 }
15552 } 13080 }
15553 #[doc = "RCC Domain 2 Kernel Clock Configuration Register"] 13081 #[doc = "RCC APB2 Clock Register"]
15554 #[repr(transparent)] 13082 #[repr(transparent)]
15555 #[derive(Copy, Clone, Eq, PartialEq)] 13083 #[derive(Copy, Clone, Eq, PartialEq)]
15556 pub struct D2ccip2r(pub u32); 13084 pub struct C1Apb2enr(pub u32);
15557 impl D2ccip2r { 13085 impl C1Apb2enr {
15558 #[doc = "USART2/3, UART4,5, 7/8 (APB1) kernel clock source selection"] 13086 #[doc = "TIM1 peripheral clock enable"]
15559 pub const fn usart234578sel(&self) -> super::vals::Usart234578sel { 13087 pub const fn tim1en(&self) -> super::vals::C1Apb2enrTim1en {
15560 let val = (self.0 >> 0usize) & 0x07; 13088 let val = (self.0 >> 0usize) & 0x01;
15561 super::vals::Usart234578sel(val as u8) 13089 super::vals::C1Apb2enrTim1en(val as u8)
15562 } 13090 }
15563 #[doc = "USART2/3, UART4,5, 7/8 (APB1) kernel clock source selection"] 13091 #[doc = "TIM1 peripheral clock enable"]
15564 pub fn set_usart234578sel(&mut self, val: super::vals::Usart234578sel) { 13092 pub fn set_tim1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15565 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize); 13093 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
15566 } 13094 }
15567 #[doc = "USART1 and 6 kernel clock source selection"] 13095 #[doc = "TIM8 peripheral clock enable"]
15568 pub const fn usart16sel(&self) -> super::vals::Usart16sel { 13096 pub const fn tim8en(&self) -> super::vals::C1Apb2enrTim1en {
15569 let val = (self.0 >> 3usize) & 0x07; 13097 let val = (self.0 >> 1usize) & 0x01;
15570 super::vals::Usart16sel(val as u8) 13098 super::vals::C1Apb2enrTim1en(val as u8)
15571 } 13099 }
15572 #[doc = "USART1 and 6 kernel clock source selection"] 13100 #[doc = "TIM8 peripheral clock enable"]
15573 pub fn set_usart16sel(&mut self, val: super::vals::Usart16sel) { 13101 pub fn set_tim8en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15574 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); 13102 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
15575 } 13103 }
15576 #[doc = "RNG kernel clock source selection"] 13104 #[doc = "USART1 Peripheral Clocks Enable"]
15577 pub const fn rngsel(&self) -> super::vals::Rngsel { 13105 pub const fn usart1en(&self) -> super::vals::C1Apb2enrTim1en {
15578 let val = (self.0 >> 8usize) & 0x03; 13106 let val = (self.0 >> 4usize) & 0x01;
15579 super::vals::Rngsel(val as u8) 13107 super::vals::C1Apb2enrTim1en(val as u8)
15580 } 13108 }
15581 #[doc = "RNG kernel clock source selection"] 13109 #[doc = "USART1 Peripheral Clocks Enable"]
15582 pub fn set_rngsel(&mut self, val: super::vals::Rngsel) { 13110 pub fn set_usart1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15583 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); 13111 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
15584 } 13112 }
15585 #[doc = "I2C1,2,3 kernel clock source selection"] 13113 #[doc = "USART6 Peripheral Clocks Enable"]
15586 pub const fn i2c123sel(&self) -> super::vals::I2c123sel { 13114 pub const fn usart6en(&self) -> super::vals::C1Apb2enrTim1en {
15587 let val = (self.0 >> 12usize) & 0x03; 13115 let val = (self.0 >> 5usize) & 0x01;
15588 super::vals::I2c123sel(val as u8) 13116 super::vals::C1Apb2enrTim1en(val as u8)
15589 } 13117 }
15590 #[doc = "I2C1,2,3 kernel clock source selection"] 13118 #[doc = "USART6 Peripheral Clocks Enable"]
15591 pub fn set_i2c123sel(&mut self, val: super::vals::I2c123sel) { 13119 pub fn set_usart6en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15592 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); 13120 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
15593 } 13121 }
15594 #[doc = "USBOTG 1 and 2 kernel clock source selection"] 13122 #[doc = "SPI1 Peripheral Clocks Enable"]
15595 pub const fn usbsel(&self) -> super::vals::Usbsel { 13123 pub const fn spi1en(&self) -> super::vals::C1Apb2enrTim1en {
15596 let val = (self.0 >> 20usize) & 0x03; 13124 let val = (self.0 >> 12usize) & 0x01;
15597 super::vals::Usbsel(val as u8) 13125 super::vals::C1Apb2enrTim1en(val as u8)
15598 } 13126 }
15599 #[doc = "USBOTG 1 and 2 kernel clock source selection"] 13127 #[doc = "SPI1 Peripheral Clocks Enable"]
15600 pub fn set_usbsel(&mut self, val: super::vals::Usbsel) { 13128 pub fn set_spi1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15601 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize); 13129 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
15602 } 13130 }
15603 #[doc = "HDMI-CEC kernel clock source selection"] 13131 #[doc = "SPI4 Peripheral Clocks Enable"]
15604 pub const fn cecsel(&self) -> super::vals::Cecsel { 13132 pub const fn spi4en(&self) -> super::vals::C1Apb2enrTim1en {
15605 let val = (self.0 >> 22usize) & 0x03; 13133 let val = (self.0 >> 13usize) & 0x01;
15606 super::vals::Cecsel(val as u8) 13134 super::vals::C1Apb2enrTim1en(val as u8)
15607 } 13135 }
15608 #[doc = "HDMI-CEC kernel clock source selection"] 13136 #[doc = "SPI4 Peripheral Clocks Enable"]
15609 pub fn set_cecsel(&mut self, val: super::vals::Cecsel) { 13137 pub fn set_spi4en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15610 self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize); 13138 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
15611 } 13139 }
15612 #[doc = "LPTIM1 kernel clock source selection"] 13140 #[doc = "TIM15 peripheral clock enable"]
15613 pub const fn lptim1sel(&self) -> super::vals::Lptim1sel { 13141 pub const fn tim15en(&self) -> super::vals::C1Apb2enrTim1en {
15614 let val = (self.0 >> 28usize) & 0x07; 13142 let val = (self.0 >> 16usize) & 0x01;
15615 super::vals::Lptim1sel(val as u8) 13143 super::vals::C1Apb2enrTim1en(val as u8)
15616 } 13144 }
15617 #[doc = "LPTIM1 kernel clock source selection"] 13145 #[doc = "TIM15 peripheral clock enable"]
15618 pub fn set_lptim1sel(&mut self, val: super::vals::Lptim1sel) { 13146 pub fn set_tim15en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15619 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); 13147 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
15620 } 13148 }
15621 } 13149 #[doc = "TIM16 peripheral clock enable"]
15622 impl Default for D2ccip2r { 13150 pub const fn tim16en(&self) -> super::vals::C1Apb2enrTim1en {
15623 fn default() -> D2ccip2r { 13151 let val = (self.0 >> 17usize) & 0x01;
15624 D2ccip2r(0) 13152 super::vals::C1Apb2enrTim1en(val as u8)
15625 } 13153 }
15626 } 13154 #[doc = "TIM16 peripheral clock enable"]
15627 #[doc = "RCC APB1 Peripheral Reset Register"] 13155 pub fn set_tim16en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15628 #[repr(transparent)] 13156 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
15629 #[derive(Copy, Clone, Eq, PartialEq)]
15630 pub struct Apb1lrstr(pub u32);
15631 impl Apb1lrstr {
15632 #[doc = "TIM block reset"]
15633 pub const fn tim2rst(&self) -> super::vals::Tim2rst {
15634 let val = (self.0 >> 0usize) & 0x01;
15635 super::vals::Tim2rst(val as u8)
15636 } 13157 }
15637 #[doc = "TIM block reset"] 13158 #[doc = "TIM17 peripheral clock enable"]
15638 pub fn set_tim2rst(&mut self, val: super::vals::Tim2rst) { 13159 pub const fn tim17en(&self) -> super::vals::C1Apb2enrTim1en {
15639 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 13160 let val = (self.0 >> 18usize) & 0x01;
13161 super::vals::C1Apb2enrTim1en(val as u8)
15640 } 13162 }
15641 #[doc = "TIM block reset"] 13163 #[doc = "TIM17 peripheral clock enable"]
15642 pub const fn tim3rst(&self) -> super::vals::Tim2rst { 13164 pub fn set_tim17en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15643 let val = (self.0 >> 1usize) & 0x01; 13165 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
15644 super::vals::Tim2rst(val as u8)
15645 } 13166 }
15646 #[doc = "TIM block reset"] 13167 #[doc = "SPI5 Peripheral Clocks Enable"]
15647 pub fn set_tim3rst(&mut self, val: super::vals::Tim2rst) { 13168 pub const fn spi5en(&self) -> super::vals::C1Apb2enrTim1en {
15648 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 13169 let val = (self.0 >> 20usize) & 0x01;
13170 super::vals::C1Apb2enrTim1en(val as u8)
15649 } 13171 }
15650 #[doc = "TIM block reset"] 13172 #[doc = "SPI5 Peripheral Clocks Enable"]
15651 pub const fn tim4rst(&self) -> super::vals::Tim2rst { 13173 pub fn set_spi5en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15652 let val = (self.0 >> 2usize) & 0x01; 13174 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
15653 super::vals::Tim2rst(val as u8)
15654 } 13175 }
15655 #[doc = "TIM block reset"] 13176 #[doc = "SAI1 Peripheral Clocks Enable"]
15656 pub fn set_tim4rst(&mut self, val: super::vals::Tim2rst) { 13177 pub const fn sai1en(&self) -> super::vals::C1Apb2enrTim1en {
15657 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 13178 let val = (self.0 >> 22usize) & 0x01;
13179 super::vals::C1Apb2enrTim1en(val as u8)
15658 } 13180 }
15659 #[doc = "TIM block reset"] 13181 #[doc = "SAI1 Peripheral Clocks Enable"]
15660 pub const fn tim5rst(&self) -> super::vals::Tim2rst { 13182 pub fn set_sai1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
15661 let val = (self.0 >> 3usize) & 0x01; 13183 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
15662 super::vals::Tim2rst(val as u8)
15663 } 13184 }
15664 #[doc = "TIM block reset"] 13185 #[doc = "SAI2 Peripheral Clocks Enable"]
15665 pub fn set_tim5rst(&mut self, val: super::vals::Tim2rst) { 13186 pub const fn sai2en(&self) -> super::vals::C1Apb2enrTim1en {
15666 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 13187 let val = (self.0 >> 23usize) & 0x01;
13188 super::vals::C1Apb2enrTim1en(val as u8)
15667 } 13189 }
15668 #[doc = "TIM block reset"] 13190 #[doc = "SAI2 Peripheral Clocks Enable"]
15669 pub const fn tim6rst(&self) -> super::vals::Tim2rst { 13191 pub fn set_sai2en(&mut self, val: super::vals::C1Apb2enrTim1en) {
13192 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
13193 }
13194 #[doc = "SAI3 Peripheral Clocks Enable"]
13195 pub const fn sai3en(&self) -> super::vals::C1Apb2enrTim1en {
13196 let val = (self.0 >> 24usize) & 0x01;
13197 super::vals::C1Apb2enrTim1en(val as u8)
13198 }
13199 #[doc = "SAI3 Peripheral Clocks Enable"]
13200 pub fn set_sai3en(&mut self, val: super::vals::C1Apb2enrTim1en) {
13201 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
13202 }
13203 #[doc = "DFSDM1 Peripheral Clocks Enable"]
13204 pub const fn dfsdm1en(&self) -> super::vals::C1Apb2enrTim1en {
13205 let val = (self.0 >> 28usize) & 0x01;
13206 super::vals::C1Apb2enrTim1en(val as u8)
13207 }
13208 #[doc = "DFSDM1 Peripheral Clocks Enable"]
13209 pub fn set_dfsdm1en(&mut self, val: super::vals::C1Apb2enrTim1en) {
13210 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
13211 }
13212 #[doc = "HRTIM peripheral clock enable"]
13213 pub const fn hrtimen(&self) -> super::vals::C1Apb2enrTim1en {
13214 let val = (self.0 >> 29usize) & 0x01;
13215 super::vals::C1Apb2enrTim1en(val as u8)
13216 }
13217 #[doc = "HRTIM peripheral clock enable"]
13218 pub fn set_hrtimen(&mut self, val: super::vals::C1Apb2enrTim1en) {
13219 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
13220 }
13221 }
13222 impl Default for C1Apb2enr {
13223 fn default() -> C1Apb2enr {
13224 C1Apb2enr(0)
13225 }
13226 }
13227 #[doc = "RCC AHB2 Sleep Clock Register"]
13228 #[repr(transparent)]
13229 #[derive(Copy, Clone, Eq, PartialEq)]
13230 pub struct Ahb2lpenr(pub u32);
13231 impl Ahb2lpenr {
13232 #[doc = "DCMI peripheral clock enable during csleep mode"]
13233 pub const fn dcmilpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
13234 let val = (self.0 >> 0usize) & 0x01;
13235 super::vals::Ahb2lpenrDcmilpen(val as u8)
13236 }
13237 #[doc = "DCMI peripheral clock enable during csleep mode"]
13238 pub fn set_dcmilpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
13239 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13240 }
13241 #[doc = "CRYPT peripheral clock enable during CSleep mode"]
13242 pub const fn cryptlpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15670 let val = (self.0 >> 4usize) & 0x01; 13243 let val = (self.0 >> 4usize) & 0x01;
15671 super::vals::Tim2rst(val as u8) 13244 super::vals::Ahb2lpenrDcmilpen(val as u8)
15672 } 13245 }
15673 #[doc = "TIM block reset"] 13246 #[doc = "CRYPT peripheral clock enable during CSleep mode"]
15674 pub fn set_tim6rst(&mut self, val: super::vals::Tim2rst) { 13247 pub fn set_cryptlpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15675 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 13248 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
15676 } 13249 }
15677 #[doc = "TIM block reset"] 13250 #[doc = "HASH peripheral clock enable during CSleep mode"]
15678 pub const fn tim7rst(&self) -> super::vals::Tim2rst { 13251 pub const fn hashlpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15679 let val = (self.0 >> 5usize) & 0x01; 13252 let val = (self.0 >> 5usize) & 0x01;
15680 super::vals::Tim2rst(val as u8) 13253 super::vals::Ahb2lpenrDcmilpen(val as u8)
15681 } 13254 }
15682 #[doc = "TIM block reset"] 13255 #[doc = "HASH peripheral clock enable during CSleep mode"]
15683 pub fn set_tim7rst(&mut self, val: super::vals::Tim2rst) { 13256 pub fn set_hashlpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15684 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 13257 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
15685 } 13258 }
15686 #[doc = "TIM block reset"] 13259 #[doc = "RNG peripheral clock enable during CSleep mode"]
15687 pub const fn tim12rst(&self) -> super::vals::Tim2rst { 13260 pub const fn rnglpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15688 let val = (self.0 >> 6usize) & 0x01; 13261 let val = (self.0 >> 6usize) & 0x01;
15689 super::vals::Tim2rst(val as u8) 13262 super::vals::Ahb2lpenrDcmilpen(val as u8)
15690 } 13263 }
15691 #[doc = "TIM block reset"] 13264 #[doc = "RNG peripheral clock enable during CSleep mode"]
15692 pub fn set_tim12rst(&mut self, val: super::vals::Tim2rst) { 13265 pub fn set_rnglpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15693 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize); 13266 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
15694 } 13267 }
15695 #[doc = "TIM block reset"] 13268 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"]
15696 pub const fn tim13rst(&self) -> super::vals::Tim2rst { 13269 pub const fn sdmmc2lpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15697 let val = (self.0 >> 7usize) & 0x01; 13270 let val = (self.0 >> 9usize) & 0x01;
15698 super::vals::Tim2rst(val as u8) 13271 super::vals::Ahb2lpenrDcmilpen(val as u8)
15699 } 13272 }
15700 #[doc = "TIM block reset"] 13273 #[doc = "SDMMC2 and SDMMC2 Delay Clock Enable During CSleep Mode"]
15701 pub fn set_tim13rst(&mut self, val: super::vals::Tim2rst) { 13274 pub fn set_sdmmc2lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15702 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 13275 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
15703 } 13276 }
15704 #[doc = "TIM block reset"] 13277 #[doc = "SRAM1 Clock Enable During CSleep Mode"]
15705 pub const fn tim14rst(&self) -> super::vals::Tim2rst { 13278 pub const fn sram1lpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15706 let val = (self.0 >> 8usize) & 0x01; 13279 let val = (self.0 >> 29usize) & 0x01;
15707 super::vals::Tim2rst(val as u8) 13280 super::vals::Ahb2lpenrDcmilpen(val as u8)
15708 } 13281 }
15709 #[doc = "TIM block reset"] 13282 #[doc = "SRAM1 Clock Enable During CSleep Mode"]
15710 pub fn set_tim14rst(&mut self, val: super::vals::Tim2rst) { 13283 pub fn set_sram1lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15711 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 13284 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
15712 } 13285 }
15713 #[doc = "TIM block reset"] 13286 #[doc = "SRAM2 Clock Enable During CSleep Mode"]
15714 pub const fn lptim1rst(&self) -> super::vals::Tim2rst { 13287 pub const fn sram2lpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15715 let val = (self.0 >> 9usize) & 0x01; 13288 let val = (self.0 >> 30usize) & 0x01;
15716 super::vals::Tim2rst(val as u8) 13289 super::vals::Ahb2lpenrDcmilpen(val as u8)
15717 } 13290 }
15718 #[doc = "TIM block reset"] 13291 #[doc = "SRAM2 Clock Enable During CSleep Mode"]
15719 pub fn set_lptim1rst(&mut self, val: super::vals::Tim2rst) { 13292 pub fn set_sram2lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15720 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 13293 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
15721 } 13294 }
15722 #[doc = "SPI2 block reset"] 13295 #[doc = "SRAM3 Clock Enable During CSleep Mode"]
15723 pub const fn spi2rst(&self) -> super::vals::Tim2rst { 13296 pub const fn sram3lpen(&self) -> super::vals::Ahb2lpenrDcmilpen {
15724 let val = (self.0 >> 14usize) & 0x01; 13297 let val = (self.0 >> 31usize) & 0x01;
15725 super::vals::Tim2rst(val as u8) 13298 super::vals::Ahb2lpenrDcmilpen(val as u8)
15726 } 13299 }
15727 #[doc = "SPI2 block reset"] 13300 #[doc = "SRAM3 Clock Enable During CSleep Mode"]
15728 pub fn set_spi2rst(&mut self, val: super::vals::Tim2rst) { 13301 pub fn set_sram3lpen(&mut self, val: super::vals::Ahb2lpenrDcmilpen) {
15729 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 13302 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
15730 } 13303 }
15731 #[doc = "SPI3 block reset"] 13304 }
15732 pub const fn spi3rst(&self) -> super::vals::Tim2rst { 13305 impl Default for Ahb2lpenr {
15733 let val = (self.0 >> 15usize) & 0x01; 13306 fn default() -> Ahb2lpenr {
15734 super::vals::Tim2rst(val as u8) 13307 Ahb2lpenr(0)
15735 } 13308 }
15736 #[doc = "SPI3 block reset"] 13309 }
15737 pub fn set_spi3rst(&mut self, val: super::vals::Tim2rst) { 13310 #[doc = "RCC Domain 2 Kernel Clock Configuration Register"]
15738 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 13311 #[repr(transparent)]
13312 #[derive(Copy, Clone, Eq, PartialEq)]
13313 pub struct D2ccip1r(pub u32);
13314 impl D2ccip1r {
13315 #[doc = "SAI1 and DFSDM1 kernel Aclk clock source selection"]
13316 pub const fn sai1sel(&self) -> super::vals::Sai1sel {
13317 let val = (self.0 >> 0usize) & 0x07;
13318 super::vals::Sai1sel(val as u8)
15739 } 13319 }
15740 #[doc = "SPDIFRX block reset"] 13320 #[doc = "SAI1 and DFSDM1 kernel Aclk clock source selection"]
15741 pub const fn spdifrxrst(&self) -> super::vals::Tim2rst { 13321 pub fn set_sai1sel(&mut self, val: super::vals::Sai1sel) {
15742 let val = (self.0 >> 16usize) & 0x01; 13322 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
15743 super::vals::Tim2rst(val as u8)
15744 } 13323 }
15745 #[doc = "SPDIFRX block reset"] 13324 #[doc = "SAI2 and SAI3 kernel clock source selection"]
15746 pub fn set_spdifrxrst(&mut self, val: super::vals::Tim2rst) { 13325 pub const fn sai23sel(&self) -> super::vals::Sai1sel {
15747 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 13326 let val = (self.0 >> 6usize) & 0x07;
13327 super::vals::Sai1sel(val as u8)
15748 } 13328 }
15749 #[doc = "USART2 block reset"] 13329 #[doc = "SAI2 and SAI3 kernel clock source selection"]
15750 pub const fn usart2rst(&self) -> super::vals::Tim2rst { 13330 pub fn set_sai23sel(&mut self, val: super::vals::Sai1sel) {
15751 let val = (self.0 >> 17usize) & 0x01; 13331 self.0 = (self.0 & !(0x07 << 6usize)) | (((val.0 as u32) & 0x07) << 6usize);
15752 super::vals::Tim2rst(val as u8)
15753 } 13332 }
15754 #[doc = "USART2 block reset"] 13333 #[doc = "SPI/I2S1,2 and 3 kernel clock source selection"]
15755 pub fn set_usart2rst(&mut self, val: super::vals::Tim2rst) { 13334 pub const fn spi123sel(&self) -> super::vals::Sai1sel {
15756 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 13335 let val = (self.0 >> 12usize) & 0x07;
13336 super::vals::Sai1sel(val as u8)
15757 } 13337 }
15758 #[doc = "USART3 block reset"] 13338 #[doc = "SPI/I2S1,2 and 3 kernel clock source selection"]
15759 pub const fn usart3rst(&self) -> super::vals::Tim2rst { 13339 pub fn set_spi123sel(&mut self, val: super::vals::Sai1sel) {
15760 let val = (self.0 >> 18usize) & 0x01; 13340 self.0 = (self.0 & !(0x07 << 12usize)) | (((val.0 as u32) & 0x07) << 12usize);
15761 super::vals::Tim2rst(val as u8)
15762 } 13341 }
15763 #[doc = "USART3 block reset"] 13342 #[doc = "SPI4 and 5 kernel clock source selection"]
15764 pub fn set_usart3rst(&mut self, val: super::vals::Tim2rst) { 13343 pub const fn spi45sel(&self) -> super::vals::Spi45sel {
15765 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize); 13344 let val = (self.0 >> 16usize) & 0x07;
13345 super::vals::Spi45sel(val as u8)
15766 } 13346 }
15767 #[doc = "UART4 block reset"] 13347 #[doc = "SPI4 and 5 kernel clock source selection"]
15768 pub const fn uart4rst(&self) -> super::vals::Tim2rst { 13348 pub fn set_spi45sel(&mut self, val: super::vals::Spi45sel) {
15769 let val = (self.0 >> 19usize) & 0x01; 13349 self.0 = (self.0 & !(0x07 << 16usize)) | (((val.0 as u32) & 0x07) << 16usize);
15770 super::vals::Tim2rst(val as u8)
15771 } 13350 }
15772 #[doc = "UART4 block reset"] 13351 #[doc = "SPDIFRX kernel clock source selection"]
15773 pub fn set_uart4rst(&mut self, val: super::vals::Tim2rst) { 13352 pub const fn spdifsel(&self) -> super::vals::Spdifsel {
15774 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 13353 let val = (self.0 >> 20usize) & 0x03;
13354 super::vals::Spdifsel(val as u8)
15775 } 13355 }
15776 #[doc = "UART5 block reset"] 13356 #[doc = "SPDIFRX kernel clock source selection"]
15777 pub const fn uart5rst(&self) -> super::vals::Tim2rst { 13357 pub fn set_spdifsel(&mut self, val: super::vals::Spdifsel) {
15778 let val = (self.0 >> 20usize) & 0x01; 13358 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
15779 super::vals::Tim2rst(val as u8)
15780 } 13359 }
15781 #[doc = "UART5 block reset"] 13360 #[doc = "DFSDM1 kernel Clk clock source selection"]
15782 pub fn set_uart5rst(&mut self, val: super::vals::Tim2rst) { 13361 pub const fn dfsdm1sel(&self) -> super::vals::Dfsdm1sel {
15783 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize); 13362 let val = (self.0 >> 24usize) & 0x01;
13363 super::vals::Dfsdm1sel(val as u8)
15784 } 13364 }
15785 #[doc = "I2C1 block reset"] 13365 #[doc = "DFSDM1 kernel Clk clock source selection"]
15786 pub const fn i2c1rst(&self) -> super::vals::Tim2rst { 13366 pub fn set_dfsdm1sel(&mut self, val: super::vals::Dfsdm1sel) {
15787 let val = (self.0 >> 21usize) & 0x01; 13367 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
15788 super::vals::Tim2rst(val as u8)
15789 } 13368 }
15790 #[doc = "I2C1 block reset"] 13369 #[doc = "FDCAN kernel clock source selection"]
15791 pub fn set_i2c1rst(&mut self, val: super::vals::Tim2rst) { 13370 pub const fn fdcansel(&self) -> super::vals::Fdcansel {
15792 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 13371 let val = (self.0 >> 28usize) & 0x03;
13372 super::vals::Fdcansel(val as u8)
15793 } 13373 }
15794 #[doc = "I2C2 block reset"] 13374 #[doc = "FDCAN kernel clock source selection"]
15795 pub const fn i2c2rst(&self) -> super::vals::Tim2rst { 13375 pub fn set_fdcansel(&mut self, val: super::vals::Fdcansel) {
15796 let val = (self.0 >> 22usize) & 0x01; 13376 self.0 = (self.0 & !(0x03 << 28usize)) | (((val.0 as u32) & 0x03) << 28usize);
15797 super::vals::Tim2rst(val as u8)
15798 } 13377 }
15799 #[doc = "I2C2 block reset"] 13378 #[doc = "SWPMI kernel clock source selection"]
15800 pub fn set_i2c2rst(&mut self, val: super::vals::Tim2rst) { 13379 pub const fn swpsel(&self) -> super::vals::Swpsel {
15801 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); 13380 let val = (self.0 >> 31usize) & 0x01;
13381 super::vals::Swpsel(val as u8)
15802 } 13382 }
15803 #[doc = "I2C3 block reset"] 13383 #[doc = "SWPMI kernel clock source selection"]
15804 pub const fn i2c3rst(&self) -> super::vals::Tim2rst { 13384 pub fn set_swpsel(&mut self, val: super::vals::Swpsel) {
15805 let val = (self.0 >> 23usize) & 0x01; 13385 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
15806 super::vals::Tim2rst(val as u8)
15807 } 13386 }
15808 #[doc = "I2C3 block reset"] 13387 }
15809 pub fn set_i2c3rst(&mut self, val: super::vals::Tim2rst) { 13388 impl Default for D2ccip1r {
15810 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); 13389 fn default() -> D2ccip1r {
13390 D2ccip1r(0)
15811 } 13391 }
15812 #[doc = "HDMI-CEC block reset"] 13392 }
15813 pub const fn cecrst(&self) -> super::vals::Tim2rst { 13393 #[doc = "RCC APB1 Clock Register"]
15814 let val = (self.0 >> 27usize) & 0x01; 13394 #[repr(transparent)]
15815 super::vals::Tim2rst(val as u8) 13395 #[derive(Copy, Clone, Eq, PartialEq)]
13396 pub struct Apb1henr(pub u32);
13397 impl Apb1henr {
13398 #[doc = "Clock Recovery System peripheral clock enable"]
13399 pub const fn crsen(&self) -> super::vals::Apb1henrCrsen {
13400 let val = (self.0 >> 1usize) & 0x01;
13401 super::vals::Apb1henrCrsen(val as u8)
15816 } 13402 }
15817 #[doc = "HDMI-CEC block reset"] 13403 #[doc = "Clock Recovery System peripheral clock enable"]
15818 pub fn set_cecrst(&mut self, val: super::vals::Tim2rst) { 13404 pub fn set_crsen(&mut self, val: super::vals::Apb1henrCrsen) {
15819 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 13405 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
15820 } 13406 }
15821 #[doc = "DAC1 and 2 Blocks Reset"] 13407 #[doc = "SWPMI Peripheral Clocks Enable"]
15822 pub const fn dac12rst(&self) -> super::vals::Tim2rst { 13408 pub const fn swpen(&self) -> super::vals::Apb1henrCrsen {
15823 let val = (self.0 >> 29usize) & 0x01; 13409 let val = (self.0 >> 2usize) & 0x01;
15824 super::vals::Tim2rst(val as u8) 13410 super::vals::Apb1henrCrsen(val as u8)
15825 } 13411 }
15826 #[doc = "DAC1 and 2 Blocks Reset"] 13412 #[doc = "SWPMI Peripheral Clocks Enable"]
15827 pub fn set_dac12rst(&mut self, val: super::vals::Tim2rst) { 13413 pub fn set_swpen(&mut self, val: super::vals::Apb1henrCrsen) {
15828 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 13414 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
15829 } 13415 }
15830 #[doc = "UART7 block reset"] 13416 #[doc = "OPAMP peripheral clock enable"]
15831 pub const fn uart7rst(&self) -> super::vals::Tim2rst { 13417 pub const fn opampen(&self) -> super::vals::Apb1henrCrsen {
15832 let val = (self.0 >> 30usize) & 0x01; 13418 let val = (self.0 >> 4usize) & 0x01;
15833 super::vals::Tim2rst(val as u8) 13419 super::vals::Apb1henrCrsen(val as u8)
15834 } 13420 }
15835 #[doc = "UART7 block reset"] 13421 #[doc = "OPAMP peripheral clock enable"]
15836 pub fn set_uart7rst(&mut self, val: super::vals::Tim2rst) { 13422 pub fn set_opampen(&mut self, val: super::vals::Apb1henrCrsen) {
15837 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); 13423 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
15838 } 13424 }
15839 #[doc = "UART8 block reset"] 13425 #[doc = "MDIOS peripheral clock enable"]
15840 pub const fn uart8rst(&self) -> super::vals::Tim2rst { 13426 pub const fn mdiosen(&self) -> super::vals::Apb1henrCrsen {
15841 let val = (self.0 >> 31usize) & 0x01; 13427 let val = (self.0 >> 5usize) & 0x01;
15842 super::vals::Tim2rst(val as u8) 13428 super::vals::Apb1henrCrsen(val as u8)
15843 } 13429 }
15844 #[doc = "UART8 block reset"] 13430 #[doc = "MDIOS peripheral clock enable"]
15845 pub fn set_uart8rst(&mut self, val: super::vals::Tim2rst) { 13431 pub fn set_mdiosen(&mut self, val: super::vals::Apb1henrCrsen) {
15846 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 13432 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13433 }
13434 #[doc = "FDCAN Peripheral Clocks Enable"]
13435 pub const fn fdcanen(&self) -> super::vals::Apb1henrCrsen {
13436 let val = (self.0 >> 8usize) & 0x01;
13437 super::vals::Apb1henrCrsen(val as u8)
13438 }
13439 #[doc = "FDCAN Peripheral Clocks Enable"]
13440 pub fn set_fdcanen(&mut self, val: super::vals::Apb1henrCrsen) {
13441 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
15847 } 13442 }
15848 } 13443 }
15849 impl Default for Apb1lrstr { 13444 impl Default for Apb1henr {
15850 fn default() -> Apb1lrstr { 13445 fn default() -> Apb1henr {
15851 Apb1lrstr(0) 13446 Apb1henr(0)
13447 }
13448 }
13449 #[doc = "RCC AHB3 Clock Register"]
13450 #[repr(transparent)]
13451 #[derive(Copy, Clone, Eq, PartialEq)]
13452 pub struct Ahb3enr(pub u32);
13453 impl Ahb3enr {
13454 #[doc = "MDMA Peripheral Clock Enable"]
13455 pub const fn mdmaen(&self) -> super::vals::Ahb3enrMdmaen {
13456 let val = (self.0 >> 0usize) & 0x01;
13457 super::vals::Ahb3enrMdmaen(val as u8)
13458 }
13459 #[doc = "MDMA Peripheral Clock Enable"]
13460 pub fn set_mdmaen(&mut self, val: super::vals::Ahb3enrMdmaen) {
13461 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
13462 }
13463 #[doc = "DMA2D Peripheral Clock Enable"]
13464 pub const fn dma2den(&self) -> super::vals::Ahb3enrMdmaen {
13465 let val = (self.0 >> 4usize) & 0x01;
13466 super::vals::Ahb3enrMdmaen(val as u8)
13467 }
13468 #[doc = "DMA2D Peripheral Clock Enable"]
13469 pub fn set_dma2den(&mut self, val: super::vals::Ahb3enrMdmaen) {
13470 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
13471 }
13472 #[doc = "JPGDEC Peripheral Clock Enable"]
13473 pub const fn jpgdecen(&self) -> super::vals::Ahb3enrMdmaen {
13474 let val = (self.0 >> 5usize) & 0x01;
13475 super::vals::Ahb3enrMdmaen(val as u8)
13476 }
13477 #[doc = "JPGDEC Peripheral Clock Enable"]
13478 pub fn set_jpgdecen(&mut self, val: super::vals::Ahb3enrMdmaen) {
13479 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13480 }
13481 #[doc = "FMC Peripheral Clocks Enable"]
13482 pub const fn fmcen(&self) -> super::vals::Ahb3enrMdmaen {
13483 let val = (self.0 >> 12usize) & 0x01;
13484 super::vals::Ahb3enrMdmaen(val as u8)
13485 }
13486 #[doc = "FMC Peripheral Clocks Enable"]
13487 pub fn set_fmcen(&mut self, val: super::vals::Ahb3enrMdmaen) {
13488 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
13489 }
13490 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"]
13491 pub const fn qspien(&self) -> super::vals::Ahb3enrMdmaen {
13492 let val = (self.0 >> 14usize) & 0x01;
13493 super::vals::Ahb3enrMdmaen(val as u8)
13494 }
13495 #[doc = "QUADSPI and QUADSPI Delay Clock Enable"]
13496 pub fn set_qspien(&mut self, val: super::vals::Ahb3enrMdmaen) {
13497 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
13498 }
13499 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"]
13500 pub const fn sdmmc1en(&self) -> super::vals::Ahb3enrMdmaen {
13501 let val = (self.0 >> 16usize) & 0x01;
13502 super::vals::Ahb3enrMdmaen(val as u8)
13503 }
13504 #[doc = "SDMMC1 and SDMMC1 Delay Clock Enable"]
13505 pub fn set_sdmmc1en(&mut self, val: super::vals::Ahb3enrMdmaen) {
13506 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
13507 }
13508 }
13509 impl Default for Ahb3enr {
13510 fn default() -> Ahb3enr {
13511 Ahb3enr(0)
15852 } 13512 }
15853 } 13513 }
15854 #[doc = "RCC Clock Source Interrupt Clear Register"] 13514 #[doc = "RCC Clock Source Interrupt Clear Register"]
@@ -15947,401 +13607,645 @@ pub mod rcc_h7 {
15947 Cicr(0) 13607 Cicr(0)
15948 } 13608 }
15949 } 13609 }
15950 #[doc = "RCC D3 Autonomous mode Register"] 13610 #[doc = "RCC Domain 3 Clock Configuration Register"]
15951 #[repr(transparent)] 13611 #[repr(transparent)]
15952 #[derive(Copy, Clone, Eq, PartialEq)] 13612 #[derive(Copy, Clone, Eq, PartialEq)]
15953 pub struct D3amr(pub u32); 13613 pub struct D3cfgr(pub u32);
15954 impl D3amr { 13614 impl D3cfgr {
15955 #[doc = "BDMA and DMAMUX Autonomous mode enable"] 13615 #[doc = "D3 domain APB4 prescaler"]
15956 pub const fn bdmaamen(&self) -> super::vals::Bdmaamen { 13616 pub const fn d3ppre(&self) -> super::vals::D3ppre {
13617 let val = (self.0 >> 4usize) & 0x07;
13618 super::vals::D3ppre(val as u8)
13619 }
13620 #[doc = "D3 domain APB4 prescaler"]
13621 pub fn set_d3ppre(&mut self, val: super::vals::D3ppre) {
13622 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
13623 }
13624 }
13625 impl Default for D3cfgr {
13626 fn default() -> D3cfgr {
13627 D3cfgr(0)
13628 }
13629 }
13630 #[doc = "RCC Backup Domain Control Register"]
13631 #[repr(transparent)]
13632 #[derive(Copy, Clone, Eq, PartialEq)]
13633 pub struct Bdcr(pub u32);
13634 impl Bdcr {
13635 #[doc = "LSE oscillator enabled"]
13636 pub const fn lseon(&self) -> super::vals::Lseon {
15957 let val = (self.0 >> 0usize) & 0x01; 13637 let val = (self.0 >> 0usize) & 0x01;
15958 super::vals::Bdmaamen(val as u8) 13638 super::vals::Lseon(val as u8)
15959 } 13639 }
15960 #[doc = "BDMA and DMAMUX Autonomous mode enable"] 13640 #[doc = "LSE oscillator enabled"]
15961 pub fn set_bdmaamen(&mut self, val: super::vals::Bdmaamen) { 13641 pub fn set_lseon(&mut self, val: super::vals::Lseon) {
15962 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 13642 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
15963 } 13643 }
15964 #[doc = "LPUART1 Autonomous mode enable"] 13644 #[doc = "LSE oscillator ready"]
15965 pub const fn lpuart1amen(&self) -> super::vals::Bdmaamen { 13645 pub const fn lserdy(&self) -> bool {
15966 let val = (self.0 >> 3usize) & 0x01; 13646 let val = (self.0 >> 1usize) & 0x01;
15967 super::vals::Bdmaamen(val as u8) 13647 val != 0
15968 } 13648 }
15969 #[doc = "LPUART1 Autonomous mode enable"] 13649 #[doc = "LSE oscillator ready"]
15970 pub fn set_lpuart1amen(&mut self, val: super::vals::Bdmaamen) { 13650 pub fn set_lserdy(&mut self, val: bool) {
15971 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 13651 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
15972 } 13652 }
15973 #[doc = "SPI6 Autonomous mode enable"] 13653 #[doc = "LSE oscillator bypass"]
15974 pub const fn spi6amen(&self) -> super::vals::Bdmaamen { 13654 pub const fn lsebyp(&self) -> super::vals::Lsebyp {
13655 let val = (self.0 >> 2usize) & 0x01;
13656 super::vals::Lsebyp(val as u8)
13657 }
13658 #[doc = "LSE oscillator bypass"]
13659 pub fn set_lsebyp(&mut self, val: super::vals::Lsebyp) {
13660 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
13661 }
13662 #[doc = "LSE oscillator driving capability"]
13663 pub const fn lsedrv(&self) -> super::vals::Lsedrv {
13664 let val = (self.0 >> 3usize) & 0x03;
13665 super::vals::Lsedrv(val as u8)
13666 }
13667 #[doc = "LSE oscillator driving capability"]
13668 pub fn set_lsedrv(&mut self, val: super::vals::Lsedrv) {
13669 self.0 = (self.0 & !(0x03 << 3usize)) | (((val.0 as u32) & 0x03) << 3usize);
13670 }
13671 #[doc = "LSE clock security system enable"]
13672 pub const fn lsecsson(&self) -> super::vals::Lsecsson {
15975 let val = (self.0 >> 5usize) & 0x01; 13673 let val = (self.0 >> 5usize) & 0x01;
15976 super::vals::Bdmaamen(val as u8) 13674 super::vals::Lsecsson(val as u8)
15977 } 13675 }
15978 #[doc = "SPI6 Autonomous mode enable"] 13676 #[doc = "LSE clock security system enable"]
15979 pub fn set_spi6amen(&mut self, val: super::vals::Bdmaamen) { 13677 pub fn set_lsecsson(&mut self, val: super::vals::Lsecsson) {
15980 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 13678 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
15981 } 13679 }
15982 #[doc = "I2C4 Autonomous mode enable"] 13680 #[doc = "LSE clock security system failure detection"]
15983 pub const fn i2c4amen(&self) -> super::vals::Bdmaamen { 13681 pub const fn lsecssd(&self) -> bool {
15984 let val = (self.0 >> 7usize) & 0x01; 13682 let val = (self.0 >> 6usize) & 0x01;
15985 super::vals::Bdmaamen(val as u8) 13683 val != 0
15986 } 13684 }
15987 #[doc = "I2C4 Autonomous mode enable"] 13685 #[doc = "LSE clock security system failure detection"]
15988 pub fn set_i2c4amen(&mut self, val: super::vals::Bdmaamen) { 13686 pub fn set_lsecssd(&mut self, val: bool) {
15989 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 13687 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
15990 } 13688 }
15991 #[doc = "LPTIM2 Autonomous mode enable"] 13689 #[doc = "RTC clock source selection"]
15992 pub const fn lptim2amen(&self) -> super::vals::Bdmaamen { 13690 pub const fn rtcsel(&self) -> super::vals::Rtcsel {
15993 let val = (self.0 >> 9usize) & 0x01; 13691 let val = (self.0 >> 8usize) & 0x03;
15994 super::vals::Bdmaamen(val as u8) 13692 super::vals::Rtcsel(val as u8)
15995 } 13693 }
15996 #[doc = "LPTIM2 Autonomous mode enable"] 13694 #[doc = "RTC clock source selection"]
15997 pub fn set_lptim2amen(&mut self, val: super::vals::Bdmaamen) { 13695 pub fn set_rtcsel(&mut self, val: super::vals::Rtcsel) {
15998 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 13696 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
15999 } 13697 }
16000 #[doc = "LPTIM3 Autonomous mode enable"] 13698 #[doc = "RTC clock enable"]
16001 pub const fn lptim3amen(&self) -> super::vals::Bdmaamen { 13699 pub const fn rtcen(&self) -> super::vals::Rtcen {
16002 let val = (self.0 >> 10usize) & 0x01; 13700 let val = (self.0 >> 15usize) & 0x01;
16003 super::vals::Bdmaamen(val as u8) 13701 super::vals::Rtcen(val as u8)
16004 } 13702 }
16005 #[doc = "LPTIM3 Autonomous mode enable"] 13703 #[doc = "RTC clock enable"]
16006 pub fn set_lptim3amen(&mut self, val: super::vals::Bdmaamen) { 13704 pub fn set_rtcen(&mut self, val: super::vals::Rtcen) {
16007 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 13705 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
16008 } 13706 }
16009 #[doc = "LPTIM4 Autonomous mode enable"] 13707 #[doc = "VSwitch domain software reset"]
16010 pub const fn lptim4amen(&self) -> super::vals::Bdmaamen { 13708 pub const fn bdrst(&self) -> super::vals::Bdrst {
16011 let val = (self.0 >> 11usize) & 0x01; 13709 let val = (self.0 >> 16usize) & 0x01;
16012 super::vals::Bdmaamen(val as u8) 13710 super::vals::Bdrst(val as u8)
16013 } 13711 }
16014 #[doc = "LPTIM4 Autonomous mode enable"] 13712 #[doc = "VSwitch domain software reset"]
16015 pub fn set_lptim4amen(&mut self, val: super::vals::Bdmaamen) { 13713 pub fn set_bdrst(&mut self, val: super::vals::Bdrst) {
16016 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 13714 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
16017 } 13715 }
16018 #[doc = "LPTIM5 Autonomous mode enable"] 13716 }
16019 pub const fn lptim5amen(&self) -> super::vals::Bdmaamen { 13717 impl Default for Bdcr {
16020 let val = (self.0 >> 12usize) & 0x01; 13718 fn default() -> Bdcr {
16021 super::vals::Bdmaamen(val as u8) 13719 Bdcr(0)
16022 } 13720 }
16023 #[doc = "LPTIM5 Autonomous mode enable"] 13721 }
16024 pub fn set_lptim5amen(&mut self, val: super::vals::Bdmaamen) { 13722 #[doc = "RCC AHB4 Sleep Clock Register"]
16025 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 13723 #[repr(transparent)]
13724 #[derive(Copy, Clone, Eq, PartialEq)]
13725 pub struct Ahb4lpenr(pub u32);
13726 impl Ahb4lpenr {
13727 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13728 pub const fn gpioalpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13729 let val = (self.0 >> 0usize) & 0x01;
13730 super::vals::Ahb4lpenrGpioalpen(val as u8)
16026 } 13731 }
16027 #[doc = "COMP12 Autonomous mode enable"] 13732 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16028 pub const fn comp12amen(&self) -> super::vals::Bdmaamen { 13733 pub fn set_gpioalpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16029 let val = (self.0 >> 14usize) & 0x01; 13734 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
16030 super::vals::Bdmaamen(val as u8)
16031 } 13735 }
16032 #[doc = "COMP12 Autonomous mode enable"] 13736 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16033 pub fn set_comp12amen(&mut self, val: super::vals::Bdmaamen) { 13737 pub const fn gpioblpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16034 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 13738 let val = (self.0 >> 1usize) & 0x01;
13739 super::vals::Ahb4lpenrGpioalpen(val as u8)
16035 } 13740 }
16036 #[doc = "VREF Autonomous mode enable"] 13741 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16037 pub const fn vrefamen(&self) -> super::vals::Bdmaamen { 13742 pub fn set_gpioblpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16038 let val = (self.0 >> 15usize) & 0x01; 13743 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
16039 super::vals::Bdmaamen(val as u8)
16040 } 13744 }
16041 #[doc = "VREF Autonomous mode enable"] 13745 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16042 pub fn set_vrefamen(&mut self, val: super::vals::Bdmaamen) { 13746 pub const fn gpioclpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16043 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 13747 let val = (self.0 >> 2usize) & 0x01;
13748 super::vals::Ahb4lpenrGpioalpen(val as u8)
16044 } 13749 }
16045 #[doc = "RTC Autonomous mode enable"] 13750 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16046 pub const fn rtcamen(&self) -> super::vals::Bdmaamen { 13751 pub fn set_gpioclpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16047 let val = (self.0 >> 16usize) & 0x01; 13752 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
16048 super::vals::Bdmaamen(val as u8)
16049 } 13753 }
16050 #[doc = "RTC Autonomous mode enable"] 13754 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16051 pub fn set_rtcamen(&mut self, val: super::vals::Bdmaamen) { 13755 pub const fn gpiodlpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16052 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 13756 let val = (self.0 >> 3usize) & 0x01;
13757 super::vals::Ahb4lpenrGpioalpen(val as u8)
16053 } 13758 }
16054 #[doc = "CRC Autonomous mode enable"] 13759 #[doc = "GPIO peripheral clock enable during CSleep mode"]
16055 pub const fn crcamen(&self) -> super::vals::Bdmaamen { 13760 pub fn set_gpiodlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13761 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
13762 }
13763 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13764 pub const fn gpioelpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13765 let val = (self.0 >> 4usize) & 0x01;
13766 super::vals::Ahb4lpenrGpioalpen(val as u8)
13767 }
13768 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13769 pub fn set_gpioelpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13770 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
13771 }
13772 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13773 pub const fn gpioflpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13774 let val = (self.0 >> 5usize) & 0x01;
13775 super::vals::Ahb4lpenrGpioalpen(val as u8)
13776 }
13777 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13778 pub fn set_gpioflpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13779 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
13780 }
13781 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13782 pub const fn gpioglpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13783 let val = (self.0 >> 6usize) & 0x01;
13784 super::vals::Ahb4lpenrGpioalpen(val as u8)
13785 }
13786 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13787 pub fn set_gpioglpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13788 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
13789 }
13790 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13791 pub const fn gpiohlpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13792 let val = (self.0 >> 7usize) & 0x01;
13793 super::vals::Ahb4lpenrGpioalpen(val as u8)
13794 }
13795 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13796 pub fn set_gpiohlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13797 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
13798 }
13799 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13800 pub const fn gpioilpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13801 let val = (self.0 >> 8usize) & 0x01;
13802 super::vals::Ahb4lpenrGpioalpen(val as u8)
13803 }
13804 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13805 pub fn set_gpioilpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13806 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
13807 }
13808 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13809 pub const fn gpiojlpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13810 let val = (self.0 >> 9usize) & 0x01;
13811 super::vals::Ahb4lpenrGpioalpen(val as u8)
13812 }
13813 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13814 pub fn set_gpiojlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13815 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
13816 }
13817 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13818 pub const fn gpioklpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
13819 let val = (self.0 >> 10usize) & 0x01;
13820 super::vals::Ahb4lpenrGpioalpen(val as u8)
13821 }
13822 #[doc = "GPIO peripheral clock enable during CSleep mode"]
13823 pub fn set_gpioklpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
13824 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
13825 }
13826 #[doc = "CRC peripheral clock enable during CSleep mode"]
13827 pub const fn crclpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16056 let val = (self.0 >> 19usize) & 0x01; 13828 let val = (self.0 >> 19usize) & 0x01;
16057 super::vals::Bdmaamen(val as u8) 13829 super::vals::Ahb4lpenrGpioalpen(val as u8)
16058 } 13830 }
16059 #[doc = "CRC Autonomous mode enable"] 13831 #[doc = "CRC peripheral clock enable during CSleep mode"]
16060 pub fn set_crcamen(&mut self, val: super::vals::Bdmaamen) { 13832 pub fn set_crclpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16061 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize); 13833 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
16062 } 13834 }
16063 #[doc = "SAI4 Autonomous mode enable"] 13835 #[doc = "BDMA Clock Enable During CSleep Mode"]
16064 pub const fn sai4amen(&self) -> super::vals::Bdmaamen { 13836 pub const fn bdmalpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16065 let val = (self.0 >> 21usize) & 0x01; 13837 let val = (self.0 >> 21usize) & 0x01;
16066 super::vals::Bdmaamen(val as u8) 13838 super::vals::Ahb4lpenrGpioalpen(val as u8)
16067 } 13839 }
16068 #[doc = "SAI4 Autonomous mode enable"] 13840 #[doc = "BDMA Clock Enable During CSleep Mode"]
16069 pub fn set_sai4amen(&mut self, val: super::vals::Bdmaamen) { 13841 pub fn set_bdmalpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16070 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize); 13842 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
16071 } 13843 }
16072 #[doc = "ADC3 Autonomous mode enable"] 13844 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"]
16073 pub const fn adc3amen(&self) -> super::vals::Bdmaamen { 13845 pub const fn adc3lpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16074 let val = (self.0 >> 24usize) & 0x01; 13846 let val = (self.0 >> 24usize) & 0x01;
16075 super::vals::Bdmaamen(val as u8) 13847 super::vals::Ahb4lpenrGpioalpen(val as u8)
16076 } 13848 }
16077 #[doc = "ADC3 Autonomous mode enable"] 13849 #[doc = "ADC3 Peripheral Clocks Enable During CSleep Mode"]
16078 pub fn set_adc3amen(&mut self, val: super::vals::Bdmaamen) { 13850 pub fn set_adc3lpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16079 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 13851 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
16080 } 13852 }
16081 #[doc = "Backup RAM Autonomous mode enable"] 13853 #[doc = "Backup RAM Clock Enable During CSleep Mode"]
16082 pub const fn bkpramamen(&self) -> super::vals::Bdmaamen { 13854 pub const fn bkpramlpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16083 let val = (self.0 >> 28usize) & 0x01; 13855 let val = (self.0 >> 28usize) & 0x01;
16084 super::vals::Bdmaamen(val as u8) 13856 super::vals::Ahb4lpenrGpioalpen(val as u8)
16085 } 13857 }
16086 #[doc = "Backup RAM Autonomous mode enable"] 13858 #[doc = "Backup RAM Clock Enable During CSleep Mode"]
16087 pub fn set_bkpramamen(&mut self, val: super::vals::Bdmaamen) { 13859 pub fn set_bkpramlpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16088 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 13860 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
16089 } 13861 }
16090 #[doc = "SRAM4 Autonomous mode enable"] 13862 #[doc = "SRAM4 Clock Enable During CSleep Mode"]
16091 pub const fn sram4amen(&self) -> super::vals::Bdmaamen { 13863 pub const fn sram4lpen(&self) -> super::vals::Ahb4lpenrGpioalpen {
16092 let val = (self.0 >> 29usize) & 0x01; 13864 let val = (self.0 >> 29usize) & 0x01;
16093 super::vals::Bdmaamen(val as u8) 13865 super::vals::Ahb4lpenrGpioalpen(val as u8)
16094 } 13866 }
16095 #[doc = "SRAM4 Autonomous mode enable"] 13867 #[doc = "SRAM4 Clock Enable During CSleep Mode"]
16096 pub fn set_sram4amen(&mut self, val: super::vals::Bdmaamen) { 13868 pub fn set_sram4lpen(&mut self, val: super::vals::Ahb4lpenrGpioalpen) {
16097 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize); 13869 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
16098 } 13870 }
16099 } 13871 }
16100 impl Default for D3amr { 13872 impl Default for Ahb4lpenr {
16101 fn default() -> D3amr { 13873 fn default() -> Ahb4lpenr {
16102 D3amr(0) 13874 Ahb4lpenr(0)
16103 } 13875 }
16104 } 13876 }
16105 #[doc = "RCC APB1 High Sleep Clock Register"] 13877 #[doc = "RCC Clock Recovery RC Register"]
16106 #[repr(transparent)] 13878 #[repr(transparent)]
16107 #[derive(Copy, Clone, Eq, PartialEq)] 13879 #[derive(Copy, Clone, Eq, PartialEq)]
16108 pub struct C1Apb1hlpenr(pub u32); 13880 pub struct Crrcr(pub u32);
16109 impl C1Apb1hlpenr { 13881 impl Crrcr {
16110 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"] 13882 #[doc = "Internal RC 48 MHz clock calibration"]
16111 pub const fn crslpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { 13883 pub const fn hsi48cal(&self) -> u16 {
16112 let val = (self.0 >> 1usize) & 0x01; 13884 let val = (self.0 >> 0usize) & 0x03ff;
16113 super::vals::C1Apb1hlpenrCrslpen(val as u8) 13885 val as u16
16114 }
16115 #[doc = "Clock Recovery System peripheral clock enable during CSleep mode"]
16116 pub fn set_crslpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
16117 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
16118 }
16119 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
16120 pub const fn swplpen(&self) -> super::vals::C1Apb1hlpenrCrslpen {
16121 let val = (self.0 >> 2usize) & 0x01;
16122 super::vals::C1Apb1hlpenrCrslpen(val as u8)
16123 }
16124 #[doc = "SWPMI Peripheral Clocks Enable During CSleep Mode"]
16125 pub fn set_swplpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) {
16126 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
16127 } 13886 }
16128 #[doc = "OPAMP peripheral clock enable during CSleep mode"] 13887 #[doc = "Internal RC 48 MHz clock calibration"]
16129 pub const fn opamplpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { 13888 pub fn set_hsi48cal(&mut self, val: u16) {
16130 let val = (self.0 >> 4usize) & 0x01; 13889 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
16131 super::vals::C1Apb1hlpenrCrslpen(val as u8)
16132 } 13890 }
16133 #[doc = "OPAMP peripheral clock enable during CSleep mode"] 13891 }
16134 pub fn set_opamplpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { 13892 impl Default for Crrcr {
16135 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 13893 fn default() -> Crrcr {
13894 Crrcr(0)
16136 } 13895 }
16137 #[doc = "MDIOS peripheral clock enable during CSleep mode"] 13896 }
16138 pub const fn mdioslpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { 13897 #[doc = "RCC Domain 2 Clock Configuration Register"]
16139 let val = (self.0 >> 5usize) & 0x01; 13898 #[repr(transparent)]
16140 super::vals::C1Apb1hlpenrCrslpen(val as u8) 13899 #[derive(Copy, Clone, Eq, PartialEq)]
13900 pub struct D2cfgr(pub u32);
13901 impl D2cfgr {
13902 #[doc = "D2 domain APB1 prescaler"]
13903 pub const fn d2ppre1(&self) -> super::vals::D2ppre1 {
13904 let val = (self.0 >> 4usize) & 0x07;
13905 super::vals::D2ppre1(val as u8)
16141 } 13906 }
16142 #[doc = "MDIOS peripheral clock enable during CSleep mode"] 13907 #[doc = "D2 domain APB1 prescaler"]
16143 pub fn set_mdioslpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { 13908 pub fn set_d2ppre1(&mut self, val: super::vals::D2ppre1) {
16144 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 13909 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
16145 } 13910 }
16146 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"] 13911 #[doc = "D2 domain APB2 prescaler"]
16147 pub const fn fdcanlpen(&self) -> super::vals::C1Apb1hlpenrCrslpen { 13912 pub const fn d2ppre2(&self) -> super::vals::D2ppre1 {
16148 let val = (self.0 >> 8usize) & 0x01; 13913 let val = (self.0 >> 8usize) & 0x07;
16149 super::vals::C1Apb1hlpenrCrslpen(val as u8) 13914 super::vals::D2ppre1(val as u8)
16150 } 13915 }
16151 #[doc = "FDCAN Peripheral Clocks Enable During CSleep Mode"] 13916 #[doc = "D2 domain APB2 prescaler"]
16152 pub fn set_fdcanlpen(&mut self, val: super::vals::C1Apb1hlpenrCrslpen) { 13917 pub fn set_d2ppre2(&mut self, val: super::vals::D2ppre1) {
16153 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 13918 self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize);
16154 } 13919 }
16155 } 13920 }
16156 impl Default for C1Apb1hlpenr { 13921 impl Default for D2cfgr {
16157 fn default() -> C1Apb1hlpenr { 13922 fn default() -> D2cfgr {
16158 C1Apb1hlpenr(0) 13923 D2cfgr(0)
16159 } 13924 }
16160 } 13925 }
16161 #[doc = "RCC APB1 Peripheral Reset Register"] 13926 #[doc = "RCC Clock Source Interrupt Flag Register"]
16162 #[repr(transparent)] 13927 #[repr(transparent)]
16163 #[derive(Copy, Clone, Eq, PartialEq)] 13928 #[derive(Copy, Clone, Eq, PartialEq)]
16164 pub struct Apb1hrstr(pub u32); 13929 pub struct Cifr(pub u32);
16165 impl Apb1hrstr { 13930 impl Cifr {
16166 #[doc = "Clock Recovery System reset"] 13931 #[doc = "LSI ready Interrupt Flag"]
16167 pub const fn crsrst(&self) -> super::vals::Crsrst { 13932 pub const fn lsirdyf(&self) -> bool {
13933 let val = (self.0 >> 0usize) & 0x01;
13934 val != 0
13935 }
13936 #[doc = "LSI ready Interrupt Flag"]
13937 pub fn set_lsirdyf(&mut self, val: bool) {
13938 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
13939 }
13940 #[doc = "LSE ready Interrupt Flag"]
13941 pub const fn lserdyf(&self) -> bool {
16168 let val = (self.0 >> 1usize) & 0x01; 13942 let val = (self.0 >> 1usize) & 0x01;
16169 super::vals::Crsrst(val as u8) 13943 val != 0
16170 } 13944 }
16171 #[doc = "Clock Recovery System reset"] 13945 #[doc = "LSE ready Interrupt Flag"]
16172 pub fn set_crsrst(&mut self, val: super::vals::Crsrst) { 13946 pub fn set_lserdyf(&mut self, val: bool) {
16173 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 13947 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
16174 } 13948 }
16175 #[doc = "SWPMI block reset"] 13949 #[doc = "HSI ready Interrupt Flag"]
16176 pub const fn swprst(&self) -> super::vals::Crsrst { 13950 pub const fn hsirdyf(&self) -> bool {
16177 let val = (self.0 >> 2usize) & 0x01; 13951 let val = (self.0 >> 2usize) & 0x01;
16178 super::vals::Crsrst(val as u8) 13952 val != 0
16179 } 13953 }
16180 #[doc = "SWPMI block reset"] 13954 #[doc = "HSI ready Interrupt Flag"]
16181 pub fn set_swprst(&mut self, val: super::vals::Crsrst) { 13955 pub fn set_hsirdyf(&mut self, val: bool) {
16182 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 13956 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
16183 } 13957 }
16184 #[doc = "OPAMP block reset"] 13958 #[doc = "HSE ready Interrupt Flag"]
16185 pub const fn opamprst(&self) -> super::vals::Crsrst { 13959 pub const fn hserdyf(&self) -> bool {
13960 let val = (self.0 >> 3usize) & 0x01;
13961 val != 0
13962 }
13963 #[doc = "HSE ready Interrupt Flag"]
13964 pub fn set_hserdyf(&mut self, val: bool) {
13965 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
13966 }
13967 #[doc = "CSI ready Interrupt Flag"]
13968 pub const fn csirdy(&self) -> bool {
16186 let val = (self.0 >> 4usize) & 0x01; 13969 let val = (self.0 >> 4usize) & 0x01;
16187 super::vals::Crsrst(val as u8) 13970 val != 0
16188 } 13971 }
16189 #[doc = "OPAMP block reset"] 13972 #[doc = "CSI ready Interrupt Flag"]
16190 pub fn set_opamprst(&mut self, val: super::vals::Crsrst) { 13973 pub fn set_csirdy(&mut self, val: bool) {
16191 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 13974 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
16192 } 13975 }
16193 #[doc = "MDIOS block reset"] 13976 #[doc = "RC48 ready Interrupt Flag"]
16194 pub const fn mdiosrst(&self) -> super::vals::Crsrst { 13977 pub const fn hsi48rdyf(&self) -> bool {
16195 let val = (self.0 >> 5usize) & 0x01; 13978 let val = (self.0 >> 5usize) & 0x01;
16196 super::vals::Crsrst(val as u8) 13979 val != 0
16197 }
16198 #[doc = "MDIOS block reset"]
16199 pub fn set_mdiosrst(&mut self, val: super::vals::Crsrst) {
16200 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
16201 } 13980 }
16202 #[doc = "FDCAN block reset"] 13981 #[doc = "RC48 ready Interrupt Flag"]
16203 pub const fn fdcanrst(&self) -> super::vals::Crsrst { 13982 pub fn set_hsi48rdyf(&mut self, val: bool) {
16204 let val = (self.0 >> 8usize) & 0x01; 13983 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
16205 super::vals::Crsrst(val as u8)
16206 } 13984 }
16207 #[doc = "FDCAN block reset"] 13985 #[doc = "PLL1 ready Interrupt Flag"]
16208 pub fn set_fdcanrst(&mut self, val: super::vals::Crsrst) { 13986 pub fn pllrdyf(&self, n: usize) -> bool {
16209 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize); 13987 assert!(n < 3usize);
13988 let offs = 6usize + n * 1usize;
13989 let val = (self.0 >> offs) & 0x01;
13990 val != 0
16210 } 13991 }
16211 } 13992 #[doc = "PLL1 ready Interrupt Flag"]
16212 impl Default for Apb1hrstr { 13993 pub fn set_pllrdyf(&mut self, n: usize, val: bool) {
16213 fn default() -> Apb1hrstr { 13994 assert!(n < 3usize);
16214 Apb1hrstr(0) 13995 let offs = 6usize + n * 1usize;
13996 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
16215 } 13997 }
16216 } 13998 #[doc = "LSE clock security system Interrupt Flag"]
16217 #[doc = "RCC HSI configuration register"] 13999 pub const fn lsecssf(&self) -> bool {
16218 #[repr(transparent)] 14000 let val = (self.0 >> 9usize) & 0x01;
16219 #[derive(Copy, Clone, Eq, PartialEq)] 14001 val != 0
16220 pub struct Hsicfgr(pub u32);
16221 impl Hsicfgr {
16222 #[doc = "HSI clock calibration"]
16223 pub const fn hsical(&self) -> u16 {
16224 let val = (self.0 >> 0usize) & 0x0fff;
16225 val as u16
16226 } 14002 }
16227 #[doc = "HSI clock calibration"] 14003 #[doc = "LSE clock security system Interrupt Flag"]
16228 pub fn set_hsical(&mut self, val: u16) { 14004 pub fn set_lsecssf(&mut self, val: bool) {
16229 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 14005 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
16230 } 14006 }
16231 #[doc = "HSI clock trimming"] 14007 #[doc = "HSE clock security system Interrupt Flag"]
16232 pub const fn hsitrim(&self) -> u8 { 14008 pub const fn hsecssf(&self) -> bool {
16233 let val = (self.0 >> 24usize) & 0x7f; 14009 let val = (self.0 >> 10usize) & 0x01;
16234 val as u8 14010 val != 0
16235 } 14011 }
16236 #[doc = "HSI clock trimming"] 14012 #[doc = "HSE clock security system Interrupt Flag"]
16237 pub fn set_hsitrim(&mut self, val: u8) { 14013 pub fn set_hsecssf(&mut self, val: bool) {
16238 self.0 = (self.0 & !(0x7f << 24usize)) | (((val as u32) & 0x7f) << 24usize); 14014 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
16239 } 14015 }
16240 } 14016 }
16241 impl Default for Hsicfgr { 14017 impl Default for Cifr {
16242 fn default() -> Hsicfgr { 14018 fn default() -> Cifr {
16243 Hsicfgr(0) 14019 Cifr(0)
16244 } 14020 }
16245 } 14021 }
16246 #[doc = "RCC AHB1 Sleep Clock Register"] 14022 #[doc = "RCC APB4 Clock Register"]
16247 #[repr(transparent)] 14023 #[repr(transparent)]
16248 #[derive(Copy, Clone, Eq, PartialEq)] 14024 #[derive(Copy, Clone, Eq, PartialEq)]
16249 pub struct C1Ahb1lpenr(pub u32); 14025 pub struct Apb4enr(pub u32);
16250 impl C1Ahb1lpenr { 14026 impl Apb4enr {
16251 #[doc = "DMA1 Clock Enable During CSleep Mode"] 14027 #[doc = "SYSCFG peripheral clock enable"]
16252 pub const fn dma1lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14028 pub const fn syscfgen(&self) -> super::vals::Apb4enrSyscfgen {
16253 let val = (self.0 >> 0usize) & 0x01;
16254 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
16255 }
16256 #[doc = "DMA1 Clock Enable During CSleep Mode"]
16257 pub fn set_dma1lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) {
16258 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
16259 }
16260 #[doc = "DMA2 Clock Enable During CSleep Mode"]
16261 pub const fn dma2lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen {
16262 let val = (self.0 >> 1usize) & 0x01; 14029 let val = (self.0 >> 1usize) & 0x01;
16263 super::vals::C1Ahb1lpenrDma1lpen(val as u8) 14030 super::vals::Apb4enrSyscfgen(val as u8)
16264 } 14031 }
16265 #[doc = "DMA2 Clock Enable During CSleep Mode"] 14032 #[doc = "SYSCFG peripheral clock enable"]
16266 pub fn set_dma2lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14033 pub fn set_syscfgen(&mut self, val: super::vals::Apb4enrSyscfgen) {
16267 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 14034 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
16268 } 14035 }
16269 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] 14036 #[doc = "LPUART1 Peripheral Clocks Enable"]
16270 pub const fn adc12lpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14037 pub const fn lpuart1en(&self) -> super::vals::Apb4enrSyscfgen {
14038 let val = (self.0 >> 3usize) & 0x01;
14039 super::vals::Apb4enrSyscfgen(val as u8)
14040 }
14041 #[doc = "LPUART1 Peripheral Clocks Enable"]
14042 pub fn set_lpuart1en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14043 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
14044 }
14045 #[doc = "SPI6 Peripheral Clocks Enable"]
14046 pub const fn spi6en(&self) -> super::vals::Apb4enrSyscfgen {
16271 let val = (self.0 >> 5usize) & 0x01; 14047 let val = (self.0 >> 5usize) & 0x01;
16272 super::vals::C1Ahb1lpenrDma1lpen(val as u8) 14048 super::vals::Apb4enrSyscfgen(val as u8)
16273 } 14049 }
16274 #[doc = "ADC1/2 Peripheral Clocks Enable During CSleep Mode"] 14050 #[doc = "SPI6 Peripheral Clocks Enable"]
16275 pub fn set_adc12lpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14051 pub fn set_spi6en(&mut self, val: super::vals::Apb4enrSyscfgen) {
16276 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize); 14052 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
16277 } 14053 }
16278 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] 14054 #[doc = "I2C4 Peripheral Clocks Enable"]
16279 pub const fn eth1maclpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14055 pub const fn i2c4en(&self) -> super::vals::Apb4enrSyscfgen {
14056 let val = (self.0 >> 7usize) & 0x01;
14057 super::vals::Apb4enrSyscfgen(val as u8)
14058 }
14059 #[doc = "I2C4 Peripheral Clocks Enable"]
14060 pub fn set_i2c4en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14061 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14062 }
14063 #[doc = "LPTIM2 Peripheral Clocks Enable"]
14064 pub const fn lptim2en(&self) -> super::vals::Apb4enrSyscfgen {
14065 let val = (self.0 >> 9usize) & 0x01;
14066 super::vals::Apb4enrSyscfgen(val as u8)
14067 }
14068 #[doc = "LPTIM2 Peripheral Clocks Enable"]
14069 pub fn set_lptim2en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14070 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
14071 }
14072 #[doc = "LPTIM3 Peripheral Clocks Enable"]
14073 pub const fn lptim3en(&self) -> super::vals::Apb4enrSyscfgen {
14074 let val = (self.0 >> 10usize) & 0x01;
14075 super::vals::Apb4enrSyscfgen(val as u8)
14076 }
14077 #[doc = "LPTIM3 Peripheral Clocks Enable"]
14078 pub fn set_lptim3en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14079 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
14080 }
14081 #[doc = "LPTIM4 Peripheral Clocks Enable"]
14082 pub const fn lptim4en(&self) -> super::vals::Apb4enrSyscfgen {
14083 let val = (self.0 >> 11usize) & 0x01;
14084 super::vals::Apb4enrSyscfgen(val as u8)
14085 }
14086 #[doc = "LPTIM4 Peripheral Clocks Enable"]
14087 pub fn set_lptim4en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14088 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
14089 }
14090 #[doc = "LPTIM5 Peripheral Clocks Enable"]
14091 pub const fn lptim5en(&self) -> super::vals::Apb4enrSyscfgen {
14092 let val = (self.0 >> 12usize) & 0x01;
14093 super::vals::Apb4enrSyscfgen(val as u8)
14094 }
14095 #[doc = "LPTIM5 Peripheral Clocks Enable"]
14096 pub fn set_lptim5en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14097 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
14098 }
14099 #[doc = "COMP1/2 peripheral clock enable"]
14100 pub const fn comp12en(&self) -> super::vals::Apb4enrSyscfgen {
14101 let val = (self.0 >> 14usize) & 0x01;
14102 super::vals::Apb4enrSyscfgen(val as u8)
14103 }
14104 #[doc = "COMP1/2 peripheral clock enable"]
14105 pub fn set_comp12en(&mut self, val: super::vals::Apb4enrSyscfgen) {
14106 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
14107 }
14108 #[doc = "VREF peripheral clock enable"]
14109 pub const fn vrefen(&self) -> super::vals::Apb4enrSyscfgen {
16280 let val = (self.0 >> 15usize) & 0x01; 14110 let val = (self.0 >> 15usize) & 0x01;
16281 super::vals::C1Ahb1lpenrDma1lpen(val as u8) 14111 super::vals::Apb4enrSyscfgen(val as u8)
16282 } 14112 }
16283 #[doc = "Ethernet MAC bus interface Clock Enable During CSleep Mode"] 14113 #[doc = "VREF peripheral clock enable"]
16284 pub fn set_eth1maclpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14114 pub fn set_vrefen(&mut self, val: super::vals::Apb4enrSyscfgen) {
16285 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 14115 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
16286 } 14116 }
16287 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] 14117 #[doc = "RTC APB Clock Enable"]
16288 pub const fn eth1txlpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14118 pub const fn rtcapben(&self) -> super::vals::Apb4enrSyscfgen {
16289 let val = (self.0 >> 16usize) & 0x01; 14119 let val = (self.0 >> 16usize) & 0x01;
16290 super::vals::C1Ahb1lpenrDma1lpen(val as u8) 14120 super::vals::Apb4enrSyscfgen(val as u8)
16291 } 14121 }
16292 #[doc = "Ethernet Transmission Clock Enable During CSleep Mode"] 14122 #[doc = "RTC APB Clock Enable"]
16293 pub fn set_eth1txlpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14123 pub fn set_rtcapben(&mut self, val: super::vals::Apb4enrSyscfgen) {
16294 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 14124 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
16295 } 14125 }
16296 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] 14126 #[doc = "SAI4 Peripheral Clocks Enable"]
16297 pub const fn eth1rxlpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14127 pub const fn sai4en(&self) -> super::vals::Apb4enrSyscfgen {
16298 let val = (self.0 >> 17usize) & 0x01; 14128 let val = (self.0 >> 21usize) & 0x01;
16299 super::vals::C1Ahb1lpenrDma1lpen(val as u8) 14129 super::vals::Apb4enrSyscfgen(val as u8)
16300 } 14130 }
16301 #[doc = "Ethernet Reception Clock Enable During CSleep Mode"] 14131 #[doc = "SAI4 Peripheral Clocks Enable"]
16302 pub fn set_eth1rxlpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14132 pub fn set_sai4en(&mut self, val: super::vals::Apb4enrSyscfgen) {
16303 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize); 14133 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
16304 } 14134 }
16305 #[doc = "USB1OTG peripheral clock enable during CSleep mode"] 14135 }
16306 pub const fn usb1otglpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14136 impl Default for Apb4enr {
16307 let val = (self.0 >> 25usize) & 0x01; 14137 fn default() -> Apb4enr {
16308 super::vals::C1Ahb1lpenrDma1lpen(val as u8) 14138 Apb4enr(0)
16309 } 14139 }
16310 #[doc = "USB1OTG peripheral clock enable during CSleep mode"] 14140 }
16311 pub fn set_usb1otglpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14141 #[doc = "RCC Clock Configuration Register"]
16312 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 14142 #[repr(transparent)]
14143 #[derive(Copy, Clone, Eq, PartialEq)]
14144 pub struct Cfgr(pub u32);
14145 impl Cfgr {
14146 #[doc = "System clock switch"]
14147 pub const fn sw(&self) -> super::vals::Sw {
14148 let val = (self.0 >> 0usize) & 0x07;
14149 super::vals::Sw(val as u8)
16313 } 14150 }
16314 #[doc = "USB_PHY1 clock enable during CSleep mode"] 14151 #[doc = "System clock switch"]
16315 pub const fn usb1ulpilpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14152 pub fn set_sw(&mut self, val: super::vals::Sw) {
16316 let val = (self.0 >> 26usize) & 0x01; 14153 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
16317 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
16318 } 14154 }
16319 #[doc = "USB_PHY1 clock enable during CSleep mode"] 14155 #[doc = "System clock switch status"]
16320 pub fn set_usb1ulpilpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14156 pub const fn sws(&self) -> u8 {
16321 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize); 14157 let val = (self.0 >> 3usize) & 0x07;
14158 val as u8
16322 } 14159 }
16323 #[doc = "USB2OTG peripheral clock enable during CSleep mode"] 14160 #[doc = "System clock switch status"]
16324 pub const fn usb2otglpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14161 pub fn set_sws(&mut self, val: u8) {
16325 let val = (self.0 >> 27usize) & 0x01; 14162 self.0 = (self.0 & !(0x07 << 3usize)) | (((val as u32) & 0x07) << 3usize);
16326 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
16327 } 14163 }
16328 #[doc = "USB2OTG peripheral clock enable during CSleep mode"] 14164 #[doc = "System clock selection after a wake up from system Stop"]
16329 pub fn set_usb2otglpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14165 pub const fn stopwuck(&self) -> super::vals::Stopwuck {
16330 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize); 14166 let val = (self.0 >> 6usize) & 0x01;
14167 super::vals::Stopwuck(val as u8)
16331 } 14168 }
16332 #[doc = "USB_PHY2 clocks enable during CSleep mode"] 14169 #[doc = "System clock selection after a wake up from system Stop"]
16333 pub const fn usb2ulpilpen(&self) -> super::vals::C1Ahb1lpenrDma1lpen { 14170 pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) {
16334 let val = (self.0 >> 28usize) & 0x01; 14171 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
16335 super::vals::C1Ahb1lpenrDma1lpen(val as u8)
16336 } 14172 }
16337 #[doc = "USB_PHY2 clocks enable during CSleep mode"] 14173 #[doc = "Kernel clock selection after a wake up from system Stop"]
16338 pub fn set_usb2ulpilpen(&mut self, val: super::vals::C1Ahb1lpenrDma1lpen) { 14174 pub const fn stopkerwuck(&self) -> super::vals::Stopwuck {
16339 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 14175 let val = (self.0 >> 7usize) & 0x01;
14176 super::vals::Stopwuck(val as u8)
14177 }
14178 #[doc = "Kernel clock selection after a wake up from system Stop"]
14179 pub fn set_stopkerwuck(&mut self, val: super::vals::Stopwuck) {
14180 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
14181 }
14182 #[doc = "HSE division factor for RTC clock"]
14183 pub const fn rtcpre(&self) -> u8 {
14184 let val = (self.0 >> 8usize) & 0x3f;
14185 val as u8
14186 }
14187 #[doc = "HSE division factor for RTC clock"]
14188 pub fn set_rtcpre(&mut self, val: u8) {
14189 self.0 = (self.0 & !(0x3f << 8usize)) | (((val as u32) & 0x3f) << 8usize);
14190 }
14191 #[doc = "High Resolution Timer clock prescaler selection"]
14192 pub const fn hrtimsel(&self) -> super::vals::Hrtimsel {
14193 let val = (self.0 >> 14usize) & 0x01;
14194 super::vals::Hrtimsel(val as u8)
14195 }
14196 #[doc = "High Resolution Timer clock prescaler selection"]
14197 pub fn set_hrtimsel(&mut self, val: super::vals::Hrtimsel) {
14198 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
14199 }
14200 #[doc = "Timers clocks prescaler selection"]
14201 pub const fn timpre(&self) -> super::vals::Timpre {
14202 let val = (self.0 >> 15usize) & 0x01;
14203 super::vals::Timpre(val as u8)
14204 }
14205 #[doc = "Timers clocks prescaler selection"]
14206 pub fn set_timpre(&mut self, val: super::vals::Timpre) {
14207 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
14208 }
14209 #[doc = "MCO1 prescaler"]
14210 pub const fn mco1pre(&self) -> u8 {
14211 let val = (self.0 >> 18usize) & 0x0f;
14212 val as u8
14213 }
14214 #[doc = "MCO1 prescaler"]
14215 pub fn set_mco1pre(&mut self, val: u8) {
14216 self.0 = (self.0 & !(0x0f << 18usize)) | (((val as u32) & 0x0f) << 18usize);
14217 }
14218 #[doc = "Micro-controller clock output 1"]
14219 pub const fn mco1(&self) -> super::vals::Mco1 {
14220 let val = (self.0 >> 22usize) & 0x07;
14221 super::vals::Mco1(val as u8)
14222 }
14223 #[doc = "Micro-controller clock output 1"]
14224 pub fn set_mco1(&mut self, val: super::vals::Mco1) {
14225 self.0 = (self.0 & !(0x07 << 22usize)) | (((val.0 as u32) & 0x07) << 22usize);
14226 }
14227 #[doc = "MCO2 prescaler"]
14228 pub const fn mco2pre(&self) -> u8 {
14229 let val = (self.0 >> 25usize) & 0x0f;
14230 val as u8
14231 }
14232 #[doc = "MCO2 prescaler"]
14233 pub fn set_mco2pre(&mut self, val: u8) {
14234 self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize);
14235 }
14236 #[doc = "Micro-controller clock output 2"]
14237 pub const fn mco2(&self) -> super::vals::Mco2 {
14238 let val = (self.0 >> 29usize) & 0x07;
14239 super::vals::Mco2(val as u8)
14240 }
14241 #[doc = "Micro-controller clock output 2"]
14242 pub fn set_mco2(&mut self, val: super::vals::Mco2) {
14243 self.0 = (self.0 & !(0x07 << 29usize)) | (((val.0 as u32) & 0x07) << 29usize);
16340 } 14244 }
16341 } 14245 }
16342 impl Default for C1Ahb1lpenr { 14246 impl Default for Cfgr {
16343 fn default() -> C1Ahb1lpenr { 14247 fn default() -> Cfgr {
16344 C1Ahb1lpenr(0) 14248 Cfgr(0)
16345 } 14249 }
16346 } 14250 }
16347 } 14251 }
@@ -16349,17 +14253,17 @@ pub mod rcc_h7 {
16349 use crate::generic::*; 14253 use crate::generic::*;
16350 #[repr(transparent)] 14254 #[repr(transparent)]
16351 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14255 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16352 pub struct C1Apb3lpenrLtdclpen(pub u8); 14256 pub struct Hsebyp(pub u8);
16353 impl C1Apb3lpenrLtdclpen { 14257 impl Hsebyp {
16354 #[doc = "The selected clock is disabled during csleep mode"] 14258 #[doc = "HSE crystal oscillator not bypassed"]
16355 pub const DISABLED: Self = Self(0); 14259 pub const NOTBYPASSED: Self = Self(0);
16356 #[doc = "The selected clock is enabled during csleep mode"] 14260 #[doc = "HSE crystal oscillator bypassed with external clock"]
16357 pub const ENABLED: Self = Self(0x01); 14261 pub const BYPASSED: Self = Self(0x01);
16358 } 14262 }
16359 #[repr(transparent)] 14263 #[repr(transparent)]
16360 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14264 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16361 pub struct RsrCpurstfr(pub u8); 14265 pub struct C1RsrCpurstfr(pub u8);
16362 impl RsrCpurstfr { 14266 impl C1RsrCpurstfr {
16363 #[doc = "No reset occoured for block"] 14267 #[doc = "No reset occoured for block"]
16364 pub const NORESETOCCOURED: Self = Self(0); 14268 pub const NORESETOCCOURED: Self = Self(0);
16365 #[doc = "Reset occoured for block"] 14269 #[doc = "Reset occoured for block"]
@@ -16367,8 +14271,8 @@ pub mod rcc_h7 {
16367 } 14271 }
16368 #[repr(transparent)] 14272 #[repr(transparent)]
16369 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14273 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16370 pub struct Apb1llpenrTim2lpen(pub u8); 14274 pub struct Ahb1lpenrDma1lpen(pub u8);
16371 impl Apb1llpenrTim2lpen { 14275 impl Ahb1lpenrDma1lpen {
16372 #[doc = "The selected clock is disabled during csleep mode"] 14276 #[doc = "The selected clock is disabled during csleep mode"]
16373 pub const DISABLED: Self = Self(0); 14277 pub const DISABLED: Self = Self(0);
16374 #[doc = "The selected clock is enabled during csleep mode"] 14278 #[doc = "The selected clock is enabled during csleep mode"]
@@ -16389,39 +14293,56 @@ pub mod rcc_h7 {
16389 } 14293 }
16390 #[repr(transparent)] 14294 #[repr(transparent)]
16391 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14295 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16392 pub struct Divp1en(pub u8); 14296 pub struct Apb2enrTim1en(pub u8);
16393 impl Divp1en { 14297 impl Apb2enrTim1en {
16394 #[doc = "Clock ouput is disabled"] 14298 #[doc = "The selected clock is disabled"]
16395 pub const DISABLED: Self = Self(0); 14299 pub const DISABLED: Self = Self(0);
16396 #[doc = "Clock output is enabled"] 14300 #[doc = "The selected clock is enabled"]
16397 pub const ENABLED: Self = Self(0x01); 14301 pub const ENABLED: Self = Self(0x01);
16398 } 14302 }
16399 #[repr(transparent)] 14303 #[repr(transparent)]
16400 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14304 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16401 pub struct D3ppre(pub u8); 14305 pub struct Pll1rge(pub u8);
16402 impl D3ppre { 14306 impl Pll1rge {
16403 #[doc = "rcc_hclk not divided"] 14307 #[doc = "Frequency is between 1 and 2 MHz"]
16404 pub const DIV1: Self = Self(0); 14308 pub const RANGE1: Self = Self(0);
16405 #[doc = "rcc_hclk divided by 2"] 14309 #[doc = "Frequency is between 2 and 4 MHz"]
16406 pub const DIV2: Self = Self(0x04); 14310 pub const RANGE2: Self = Self(0x01);
16407 #[doc = "rcc_hclk divided by 4"] 14311 #[doc = "Frequency is between 4 and 8 MHz"]
16408 pub const DIV4: Self = Self(0x05); 14312 pub const RANGE4: Self = Self(0x02);
16409 #[doc = "rcc_hclk divided by 8"] 14313 #[doc = "Frequency is between 8 and 16 MHz"]
16410 pub const DIV8: Self = Self(0x06); 14314 pub const RANGE8: Self = Self(0x03);
16411 #[doc = "rcc_hclk divided by 16"]
16412 pub const DIV16: Self = Self(0x07);
16413 } 14315 }
16414 #[repr(transparent)] 14316 #[repr(transparent)]
16415 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14317 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16416 pub struct Ltdcrst(pub u8); 14318 pub struct Sw(pub u8);
16417 impl Ltdcrst { 14319 impl Sw {
16418 #[doc = "Reset the selected module"] 14320 #[doc = "HSI selected as system clock"]
16419 pub const RESET: Self = Self(0x01); 14321 pub const HSI: Self = Self(0);
14322 #[doc = "CSI selected as system clock"]
14323 pub const CSI: Self = Self(0x01);
14324 #[doc = "HSE selected as system clock"]
14325 pub const HSE: Self = Self(0x02);
14326 #[doc = "PLL1 selected as system clock"]
14327 pub const PLL1: Self = Self(0x03);
16420 } 14328 }
16421 #[repr(transparent)] 14329 #[repr(transparent)]
16422 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14330 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16423 pub struct C1Apb3enrLtdcen(pub u8); 14331 pub struct Pllsrc(pub u8);
16424 impl C1Apb3enrLtdcen { 14332 impl Pllsrc {
14333 #[doc = "HSI selected as PLL clock"]
14334 pub const HSI: Self = Self(0);
14335 #[doc = "CSI selected as PLL clock"]
14336 pub const CSI: Self = Self(0x01);
14337 #[doc = "HSE selected as PLL clock"]
14338 pub const HSE: Self = Self(0x02);
14339 #[doc = "No clock sent to DIVMx dividers and PLLs"]
14340 pub const NONE: Self = Self(0x03);
14341 }
14342 #[repr(transparent)]
14343 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
14344 pub struct C1Apb1henrCrsen(pub u8);
14345 impl C1Apb1henrCrsen {
16425 #[doc = "The selected clock is disabled"] 14346 #[doc = "The selected clock is disabled"]
16426 pub const DISABLED: Self = Self(0); 14347 pub const DISABLED: Self = Self(0);
16427 #[doc = "The selected clock is enabled"] 14348 #[doc = "The selected clock is enabled"]
@@ -16429,8 +14350,8 @@ pub mod rcc_h7 {
16429 } 14350 }
16430 #[repr(transparent)] 14351 #[repr(transparent)]
16431 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14352 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16432 pub struct C1Apb2enrTim1en(pub u8); 14353 pub struct C1Ahb3enrMdmaen(pub u8);
16433 impl C1Apb2enrTim1en { 14354 impl C1Ahb3enrMdmaen {
16434 #[doc = "The selected clock is disabled"] 14355 #[doc = "The selected clock is disabled"]
16435 pub const DISABLED: Self = Self(0); 14356 pub const DISABLED: Self = Self(0);
16436 #[doc = "The selected clock is enabled"] 14357 #[doc = "The selected clock is enabled"]
@@ -16438,25 +14359,34 @@ pub mod rcc_h7 {
16438 } 14359 }
16439 #[repr(transparent)] 14360 #[repr(transparent)]
16440 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14361 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16441 pub struct Spi45sel(pub u8); 14362 pub struct Spdifsel(pub u8);
16442 impl Spi45sel { 14363 impl Spdifsel {
16443 #[doc = "APB clock selected as peripheral clock"] 14364 #[doc = "pll1_q selected as peripheral clock"]
16444 pub const APB: Self = Self(0); 14365 pub const PLL1_Q: Self = Self(0);
16445 #[doc = "pll2_q selected as peripheral clock"] 14366 #[doc = "pll2_r selected as peripheral clock"]
16446 pub const PLL2_Q: Self = Self(0x01); 14367 pub const PLL2_R: Self = Self(0x01);
16447 #[doc = "pll3_q selected as peripheral clock"] 14368 #[doc = "pll3_r selected as peripheral clock"]
16448 pub const PLL3_Q: Self = Self(0x02); 14369 pub const PLL3_R: Self = Self(0x02);
16449 #[doc = "hsi_ker selected as peripheral clock"] 14370 #[doc = "hsi_ker selected as peripheral clock"]
16450 pub const HSI_KER: Self = Self(0x03); 14371 pub const HSI_KER: Self = Self(0x03);
14372 }
14373 #[repr(transparent)]
14374 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
14375 pub struct I2c123sel(pub u8);
14376 impl I2c123sel {
14377 #[doc = "rcc_pclk1 selected as peripheral clock"]
14378 pub const RCC_PCLK1: Self = Self(0);
14379 #[doc = "pll3_r selected as peripheral clock"]
14380 pub const PLL3_R: Self = Self(0x01);
14381 #[doc = "hsi_ker selected as peripheral clock"]
14382 pub const HSI_KER: Self = Self(0x02);
16451 #[doc = "csi_ker selected as peripheral clock"] 14383 #[doc = "csi_ker selected as peripheral clock"]
16452 pub const CSI_KER: Self = Self(0x04); 14384 pub const CSI_KER: Self = Self(0x03);
16453 #[doc = "HSE selected as peripheral clock"]
16454 pub const HSE: Self = Self(0x05);
16455 } 14385 }
16456 #[repr(transparent)] 14386 #[repr(transparent)]
16457 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14387 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16458 pub struct Apb2enrTim1en(pub u8); 14388 pub struct C1Apb1lenrTim2en(pub u8);
16459 impl Apb2enrTim1en { 14389 impl C1Apb1lenrTim2en {
16460 #[doc = "The selected clock is disabled"] 14390 #[doc = "The selected clock is disabled"]
16461 pub const DISABLED: Self = Self(0); 14391 pub const DISABLED: Self = Self(0);
16462 #[doc = "The selected clock is enabled"] 14392 #[doc = "The selected clock is enabled"]
@@ -16464,55 +14394,52 @@ pub mod rcc_h7 {
16464 } 14394 }
16465 #[repr(transparent)] 14395 #[repr(transparent)]
16466 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14396 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16467 pub struct C1RsrRmvf(pub u8); 14397 pub struct Pll1fracen(pub u8);
16468 impl C1RsrRmvf { 14398 impl Pll1fracen {
16469 #[doc = "Not clearing the the reset flags"] 14399 #[doc = "Reset latch to tranfer FRACN to the Sigma-Delta modulator"]
16470 pub const NOTACTIVE: Self = Self(0); 14400 pub const RESET: Self = Self(0);
16471 #[doc = "Clear the reset flags"] 14401 #[doc = "Set latch to tranfer FRACN to the Sigma-Delta modulator"]
16472 pub const CLEAR: Self = Self(0x01); 14402 pub const SET: Self = Self(0x01);
16473 }
16474 #[repr(transparent)]
16475 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16476 pub struct Apb3lpenrLtdclpen(pub u8);
16477 impl Apb3lpenrLtdclpen {
16478 #[doc = "The selected clock is disabled during csleep mode"]
16479 pub const DISABLED: Self = Self(0);
16480 #[doc = "The selected clock is enabled during csleep mode"]
16481 pub const ENABLED: Self = Self(0x01);
16482 } 14403 }
16483 #[repr(transparent)] 14404 #[repr(transparent)]
16484 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14405 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16485 pub struct Ahb3lpenrMdmalpen(pub u8); 14406 pub struct Lsecssdr(pub u8);
16486 impl Ahb3lpenrMdmalpen { 14407 impl Lsecssdr {
16487 #[doc = "The selected clock is disabled during csleep mode"] 14408 #[doc = "No failure detected on 32 kHz oscillator"]
16488 pub const DISABLED: Self = Self(0); 14409 pub const NOFAILURE: Self = Self(0);
16489 #[doc = "The selected clock is enabled during csleep mode"] 14410 #[doc = "Failure detected on 32 kHz oscillator"]
16490 pub const ENABLED: Self = Self(0x01); 14411 pub const FAILURE: Self = Self(0x01);
16491 } 14412 }
16492 #[repr(transparent)] 14413 #[repr(transparent)]
16493 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14414 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16494 pub struct I2c123sel(pub u8); 14415 pub struct Spi6sel(pub u8);
16495 impl I2c123sel { 14416 impl Spi6sel {
16496 #[doc = "rcc_pclk1 selected as peripheral clock"] 14417 #[doc = "rcc_pclk4 selected as peripheral clock"]
16497 pub const RCC_PCLK1: Self = Self(0); 14418 pub const RCC_PCLK4: Self = Self(0);
16498 #[doc = "pll3_r selected as peripheral clock"] 14419 #[doc = "pll2_q selected as peripheral clock"]
16499 pub const PLL3_R: Self = Self(0x01); 14420 pub const PLL2_Q: Self = Self(0x01);
14421 #[doc = "pll3_q selected as peripheral clock"]
14422 pub const PLL3_Q: Self = Self(0x02);
16500 #[doc = "hsi_ker selected as peripheral clock"] 14423 #[doc = "hsi_ker selected as peripheral clock"]
16501 pub const HSI_KER: Self = Self(0x02); 14424 pub const HSI_KER: Self = Self(0x03);
16502 #[doc = "csi_ker selected as peripheral clock"] 14425 #[doc = "csi_ker selected as peripheral clock"]
16503 pub const CSI_KER: Self = Self(0x03); 14426 pub const CSI_KER: Self = Self(0x04);
14427 #[doc = "HSE selected as peripheral clock"]
14428 pub const HSE: Self = Self(0x05);
16504 } 14429 }
16505 #[repr(transparent)] 14430 #[repr(transparent)]
16506 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14431 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16507 pub struct Bdrst(pub u8); 14432 pub struct Apb3lpenrLtdclpen(pub u8);
16508 impl Bdrst { 14433 impl Apb3lpenrLtdclpen {
16509 #[doc = "Resets the entire VSW domain"] 14434 #[doc = "The selected clock is disabled during csleep mode"]
16510 pub const RESET: Self = Self(0x01); 14435 pub const DISABLED: Self = Self(0);
14436 #[doc = "The selected clock is enabled during csleep mode"]
14437 pub const ENABLED: Self = Self(0x01);
16511 } 14438 }
16512 #[repr(transparent)] 14439 #[repr(transparent)]
16513 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14440 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16514 pub struct Apb2lpenrTim1lpen(pub u8); 14441 pub struct C1Ahb1lpenrDma1lpen(pub u8);
16515 impl Apb2lpenrTim1lpen { 14442 impl C1Ahb1lpenrDma1lpen {
16516 #[doc = "The selected clock is disabled during csleep mode"] 14443 #[doc = "The selected clock is disabled during csleep mode"]
16517 pub const DISABLED: Self = Self(0); 14444 pub const DISABLED: Self = Self(0);
16518 #[doc = "The selected clock is enabled during csleep mode"] 14445 #[doc = "The selected clock is enabled during csleep mode"]
@@ -16520,15 +14447,17 @@ pub mod rcc_h7 {
16520 } 14447 }
16521 #[repr(transparent)] 14448 #[repr(transparent)]
16522 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14449 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16523 pub struct Syscfgrst(pub u8); 14450 pub struct Divp1en(pub u8);
16524 impl Syscfgrst { 14451 impl Divp1en {
16525 #[doc = "Reset the selected module"] 14452 #[doc = "Clock ouput is disabled"]
16526 pub const RESET: Self = Self(0x01); 14453 pub const DISABLED: Self = Self(0);
14454 #[doc = "Clock output is enabled"]
14455 pub const ENABLED: Self = Self(0x01);
16527 } 14456 }
16528 #[repr(transparent)] 14457 #[repr(transparent)]
16529 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14458 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16530 pub struct Apb1lenrTim2en(pub u8); 14459 pub struct Apb4enrSyscfgen(pub u8);
16531 impl Apb1lenrTim2en { 14460 impl Apb4enrSyscfgen {
16532 #[doc = "The selected clock is disabled"] 14461 #[doc = "The selected clock is disabled"]
16533 pub const DISABLED: Self = Self(0); 14462 pub const DISABLED: Self = Self(0);
16534 #[doc = "The selected clock is enabled"] 14463 #[doc = "The selected clock is enabled"]
@@ -16536,102 +14465,118 @@ pub mod rcc_h7 {
16536 } 14465 }
16537 #[repr(transparent)] 14466 #[repr(transparent)]
16538 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14467 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16539 pub struct Pll1vcosel(pub u8); 14468 pub struct Lptim2sel(pub u8);
16540 impl Pll1vcosel { 14469 impl Lptim2sel {
16541 #[doc = "VCO frequency range 192 to 836 MHz"]
16542 pub const WIDEVCO: Self = Self(0);
16543 #[doc = "VCO frequency range 150 to 420 MHz"]
16544 pub const MEDIUMVCO: Self = Self(0x01);
16545 }
16546 #[repr(transparent)]
16547 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16548 pub struct I2c4sel(pub u8);
16549 impl I2c4sel {
16550 #[doc = "rcc_pclk4 selected as peripheral clock"] 14470 #[doc = "rcc_pclk4 selected as peripheral clock"]
16551 pub const RCC_PCLK4: Self = Self(0); 14471 pub const RCC_PCLK4: Self = Self(0);
14472 #[doc = "pll2_p selected as peripheral clock"]
14473 pub const PLL2_P: Self = Self(0x01);
16552 #[doc = "pll3_r selected as peripheral clock"] 14474 #[doc = "pll3_r selected as peripheral clock"]
16553 pub const PLL3_R: Self = Self(0x01); 14475 pub const PLL3_R: Self = Self(0x02);
16554 #[doc = "hsi_ker selected as peripheral clock"] 14476 #[doc = "LSE selected as peripheral clock"]
16555 pub const HSI_KER: Self = Self(0x02); 14477 pub const LSE: Self = Self(0x03);
16556 #[doc = "csi_ker selected as peripheral clock"] 14478 #[doc = "LSI selected as peripheral clock"]
16557 pub const CSI_KER: Self = Self(0x03); 14479 pub const LSI: Self = Self(0x04);
14480 #[doc = "PER selected as peripheral clock"]
14481 pub const PER: Self = Self(0x05);
16558 } 14482 }
16559 #[repr(transparent)] 14483 #[repr(transparent)]
16560 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14484 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16561 pub struct Lseon(pub u8); 14485 pub struct Dfsdm1sel(pub u8);
16562 impl Lseon { 14486 impl Dfsdm1sel {
16563 #[doc = "LSE oscillator Off"] 14487 #[doc = "rcc_pclk2 selected as peripheral clock"]
16564 pub const OFF: Self = Self(0); 14488 pub const RCC_PCLK2: Self = Self(0);
16565 #[doc = "LSE oscillator On"] 14489 #[doc = "System clock selected as peripheral clock"]
16566 pub const ON: Self = Self(0x01); 14490 pub const SYS: Self = Self(0x01);
16567 } 14491 }
16568 #[repr(transparent)] 14492 #[repr(transparent)]
16569 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14493 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16570 pub struct C1Apb4lpenrSyscfglpen(pub u8); 14494 pub struct Mco2(pub u8);
16571 impl C1Apb4lpenrSyscfglpen { 14495 impl Mco2 {
16572 #[doc = "The selected clock is disabled during csleep mode"] 14496 #[doc = "System clock selected for micro-controller clock output"]
16573 pub const DISABLED: Self = Self(0); 14497 pub const SYSCLK: Self = Self(0);
16574 #[doc = "The selected clock is enabled during csleep mode"] 14498 #[doc = "pll2_p selected for micro-controller clock output"]
16575 pub const ENABLED: Self = Self(0x01); 14499 pub const PLL2_P: Self = Self(0x01);
14500 #[doc = "HSE selected for micro-controller clock output"]
14501 pub const HSE: Self = Self(0x02);
14502 #[doc = "pll1_p selected for micro-controller clock output"]
14503 pub const PLL1_P: Self = Self(0x03);
14504 #[doc = "CSI selected for micro-controller clock output"]
14505 pub const CSI: Self = Self(0x04);
14506 #[doc = "LSI selected for micro-controller clock output"]
14507 pub const LSI: Self = Self(0x05);
16576 } 14508 }
16577 #[repr(transparent)] 14509 #[repr(transparent)]
16578 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14510 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16579 pub struct Dma1rst(pub u8); 14511 pub struct Lsebyp(pub u8);
16580 impl Dma1rst { 14512 impl Lsebyp {
16581 #[doc = "Reset the selected module"] 14513 #[doc = "LSE crystal oscillator not bypassed"]
16582 pub const RESET: Self = Self(0x01); 14514 pub const NOTBYPASSED: Self = Self(0);
14515 #[doc = "LSE crystal oscillator bypassed with external clock"]
14516 pub const BYPASSED: Self = Self(0x01);
16583 } 14517 }
16584 #[repr(transparent)] 14518 #[repr(transparent)]
16585 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14519 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16586 pub struct Lpuart1sel(pub u8); 14520 pub struct D2ppre1(pub u8);
16587 impl Lpuart1sel { 14521 impl D2ppre1 {
16588 #[doc = "rcc_pclk_d3 selected as peripheral clock"] 14522 #[doc = "rcc_hclk not divided"]
16589 pub const RCC_PCLK_D3: Self = Self(0); 14523 pub const DIV1: Self = Self(0);
16590 #[doc = "pll2_q selected as peripheral clock"] 14524 #[doc = "rcc_hclk divided by 2"]
16591 pub const PLL2_Q: Self = Self(0x01); 14525 pub const DIV2: Self = Self(0x04);
14526 #[doc = "rcc_hclk divided by 4"]
14527 pub const DIV4: Self = Self(0x05);
14528 #[doc = "rcc_hclk divided by 8"]
14529 pub const DIV8: Self = Self(0x06);
14530 #[doc = "rcc_hclk divided by 16"]
14531 pub const DIV16: Self = Self(0x07);
14532 }
14533 #[repr(transparent)]
14534 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
14535 pub struct Usbsel(pub u8);
14536 impl Usbsel {
14537 #[doc = "Disable the kernel clock"]
14538 pub const DISABLE: Self = Self(0);
14539 #[doc = "pll1_q selected as peripheral clock"]
14540 pub const PLL1_Q: Self = Self(0x01);
16592 #[doc = "pll3_q selected as peripheral clock"] 14541 #[doc = "pll3_q selected as peripheral clock"]
16593 pub const PLL3_Q: Self = Self(0x02); 14542 pub const PLL3_Q: Self = Self(0x02);
16594 #[doc = "hsi_ker selected as peripheral clock"] 14543 #[doc = "HSI48 selected as peripheral clock"]
16595 pub const HSI_KER: Self = Self(0x03); 14544 pub const HSI48: Self = Self(0x03);
16596 #[doc = "csi_ker selected as peripheral clock"]
16597 pub const CSI_KER: Self = Self(0x04);
16598 #[doc = "LSE selected as peripheral clock"]
16599 pub const LSE: Self = Self(0x05);
16600 } 14545 }
16601 #[repr(transparent)] 14546 #[repr(transparent)]
16602 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14547 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16603 pub struct Rtcen(pub u8); 14548 pub struct Ahb1enrDma1en(pub u8);
16604 impl Rtcen { 14549 impl Ahb1enrDma1en {
16605 #[doc = "RTC clock disabled"] 14550 #[doc = "The selected clock is disabled"]
16606 pub const DISABLED: Self = Self(0); 14551 pub const DISABLED: Self = Self(0);
16607 #[doc = "RTC clock enabled"] 14552 #[doc = "The selected clock is enabled"]
16608 pub const ENABLED: Self = Self(0x01); 14553 pub const ENABLED: Self = Self(0x01);
16609 } 14554 }
16610 #[repr(transparent)] 14555 #[repr(transparent)]
16611 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14556 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16612 pub struct Mco1(pub u8); 14557 pub struct Ahb2lpenrDcmilpen(pub u8);
16613 impl Mco1 { 14558 impl Ahb2lpenrDcmilpen {
16614 #[doc = "HSI selected for micro-controller clock output"] 14559 #[doc = "The selected clock is disabled during csleep mode"]
16615 pub const HSI: Self = Self(0); 14560 pub const DISABLED: Self = Self(0);
16616 #[doc = "LSE selected for micro-controller clock output"] 14561 #[doc = "The selected clock is enabled during csleep mode"]
16617 pub const LSE: Self = Self(0x01); 14562 pub const ENABLED: Self = Self(0x01);
16618 #[doc = "HSE selected for micro-controller clock output"]
16619 pub const HSE: Self = Self(0x02);
16620 #[doc = "pll1_q selected for micro-controller clock output"]
16621 pub const PLL1_Q: Self = Self(0x03);
16622 #[doc = "HSI48 selected for micro-controller clock output"]
16623 pub const HSI48: Self = Self(0x04);
16624 } 14563 }
16625 #[repr(transparent)] 14564 #[repr(transparent)]
16626 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14565 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16627 pub struct Fdcansel(pub u8); 14566 pub struct Spi45sel(pub u8);
16628 impl Fdcansel { 14567 impl Spi45sel {
16629 #[doc = "HSE selected as peripheral clock"] 14568 #[doc = "APB clock selected as peripheral clock"]
16630 pub const HSE: Self = Self(0); 14569 pub const APB: Self = Self(0);
16631 #[doc = "pll1_q selected as peripheral clock"]
16632 pub const PLL1_Q: Self = Self(0x01);
16633 #[doc = "pll2_q selected as peripheral clock"] 14570 #[doc = "pll2_q selected as peripheral clock"]
16634 pub const PLL2_Q: Self = Self(0x02); 14571 pub const PLL2_Q: Self = Self(0x01);
14572 #[doc = "pll3_q selected as peripheral clock"]
14573 pub const PLL3_Q: Self = Self(0x02);
14574 #[doc = "hsi_ker selected as peripheral clock"]
14575 pub const HSI_KER: Self = Self(0x03);
14576 #[doc = "csi_ker selected as peripheral clock"]
14577 pub const CSI_KER: Self = Self(0x04);
14578 #[doc = "HSE selected as peripheral clock"]
14579 pub const HSE: Self = Self(0x05);
16635 } 14580 }
16636 #[repr(transparent)] 14581 #[repr(transparent)]
16637 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14582 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -16644,54 +14589,48 @@ pub mod rcc_h7 {
16644 } 14589 }
16645 #[repr(transparent)] 14590 #[repr(transparent)]
16646 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14591 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16647 pub struct Cecsel(pub u8); 14592 pub struct I2c4sel(pub u8);
16648 impl Cecsel { 14593 impl I2c4sel {
16649 #[doc = "LSE selected as peripheral clock"] 14594 #[doc = "rcc_pclk4 selected as peripheral clock"]
16650 pub const LSE: Self = Self(0); 14595 pub const RCC_PCLK4: Self = Self(0);
16651 #[doc = "LSI selected as peripheral clock"] 14596 #[doc = "pll3_r selected as peripheral clock"]
16652 pub const LSI: Self = Self(0x01); 14597 pub const PLL3_R: Self = Self(0x01);
14598 #[doc = "hsi_ker selected as peripheral clock"]
14599 pub const HSI_KER: Self = Self(0x02);
16653 #[doc = "csi_ker selected as peripheral clock"] 14600 #[doc = "csi_ker selected as peripheral clock"]
16654 pub const CSI_KER: Self = Self(0x02); 14601 pub const CSI_KER: Self = Self(0x03);
16655 } 14602 }
16656 #[repr(transparent)] 14603 #[repr(transparent)]
16657 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14604 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16658 pub struct Bdmaamen(pub u8); 14605 pub struct Usart16sel(pub u8);
16659 impl Bdmaamen { 14606 impl Usart16sel {
16660 #[doc = "Clock disabled in autonomous mode"] 14607 #[doc = "rcc_pclk2 selected as peripheral clock"]
16661 pub const DISABLED: Self = Self(0); 14608 pub const RCC_PCLK2: Self = Self(0);
16662 #[doc = "Clock enabled in autonomous mode"] 14609 #[doc = "pll2_q selected as peripheral clock"]
16663 pub const ENABLED: Self = Self(0x01); 14610 pub const PLL2_Q: Self = Self(0x01);
14611 #[doc = "pll3_q selected as peripheral clock"]
14612 pub const PLL3_Q: Self = Self(0x02);
14613 #[doc = "hsi_ker selected as peripheral clock"]
14614 pub const HSI_KER: Self = Self(0x03);
14615 #[doc = "csi_ker selected as peripheral clock"]
14616 pub const CSI_KER: Self = Self(0x04);
14617 #[doc = "LSE selected as peripheral clock"]
14618 pub const LSE: Self = Self(0x05);
16664 } 14619 }
16665 #[repr(transparent)] 14620 #[repr(transparent)]
16666 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14621 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16667 pub struct Adcsel(pub u8); 14622 pub struct Sai4asel(pub u8);
16668 impl Adcsel { 14623 impl Sai4asel {
14624 #[doc = "pll1_q selected as peripheral clock"]
14625 pub const PLL1_Q: Self = Self(0);
16669 #[doc = "pll2_p selected as peripheral clock"] 14626 #[doc = "pll2_p selected as peripheral clock"]
16670 pub const PLL2_P: Self = Self(0); 14627 pub const PLL2_P: Self = Self(0x01);
16671 #[doc = "pll3_r selected as peripheral clock"] 14628 #[doc = "pll3_p selected as peripheral clock"]
16672 pub const PLL3_R: Self = Self(0x01); 14629 pub const PLL3_P: Self = Self(0x02);
14630 #[doc = "i2s_ckin selected as peripheral clock"]
14631 pub const I2S_CKIN: Self = Self(0x03);
16673 #[doc = "PER selected as peripheral clock"] 14632 #[doc = "PER selected as peripheral clock"]
16674 pub const PER: Self = Self(0x02); 14633 pub const PER: Self = Self(0x04);
16675 }
16676 #[repr(transparent)]
16677 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16678 pub struct Ckpersel(pub u8);
16679 impl Ckpersel {
16680 #[doc = "HSI selected as peripheral clock"]
16681 pub const HSI: Self = Self(0);
16682 #[doc = "CSI selected as peripheral clock"]
16683 pub const CSI: Self = Self(0x01);
16684 #[doc = "HSE selected as peripheral clock"]
16685 pub const HSE: Self = Self(0x02);
16686 }
16687 #[repr(transparent)]
16688 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16689 pub struct Lsecsson(pub u8);
16690 impl Lsecsson {
16691 #[doc = "Clock security system on 32 kHz oscillator off"]
16692 pub const SECURITYOFF: Self = Self(0);
16693 #[doc = "Clock security system on 32 kHz oscillator on"]
16694 pub const SECURITYON: Self = Self(0x01);
16695 } 14634 }
16696 #[repr(transparent)] 14635 #[repr(transparent)]
16697 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14636 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -16708,48 +14647,44 @@ pub mod rcc_h7 {
16708 } 14647 }
16709 #[repr(transparent)] 14648 #[repr(transparent)]
16710 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14649 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16711 pub struct Rngsel(pub u8); 14650 pub struct Apb1llpenrTim2lpen(pub u8);
16712 impl Rngsel { 14651 impl Apb1llpenrTim2lpen {
16713 #[doc = "HSI48 selected as peripheral clock"] 14652 #[doc = "The selected clock is disabled during csleep mode"]
16714 pub const HSI48: Self = Self(0); 14653 pub const DISABLED: Self = Self(0);
16715 #[doc = "pll1_q selected as peripheral clock"] 14654 #[doc = "The selected clock is enabled during csleep mode"]
16716 pub const PLL1_Q: Self = Self(0x01); 14655 pub const ENABLED: Self = Self(0x01);
16717 #[doc = "LSE selected as peripheral clock"]
16718 pub const LSE: Self = Self(0x02);
16719 #[doc = "LSI selected as peripheral clock"]
16720 pub const LSI: Self = Self(0x03);
16721 } 14656 }
16722 #[repr(transparent)] 14657 #[repr(transparent)]
16723 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14658 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16724 pub struct Timpre(pub u8); 14659 pub struct C1Ahb4enrGpioaen(pub u8);
16725 impl Timpre { 14660 impl C1Ahb4enrGpioaen {
16726 #[doc = "Timer kernel clock equal to 2x pclk by default"] 14661 #[doc = "The selected clock is disabled"]
16727 pub const DEFAULTX2: Self = Self(0); 14662 pub const DISABLED: Self = Self(0);
16728 #[doc = "Timer kernel clock equal to 4x pclk by default"] 14663 #[doc = "The selected clock is enabled"]
16729 pub const DEFAULTX4: Self = Self(0x01); 14664 pub const ENABLED: Self = Self(0x01);
16730 } 14665 }
16731 #[repr(transparent)] 14666 #[repr(transparent)]
16732 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14667 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16733 pub struct Ww1rsc(pub u8); 14668 pub struct C1RsrRmvf(pub u8);
16734 impl Ww1rsc { 14669 impl C1RsrRmvf {
16735 #[doc = "Clear WWDG1 scope control"] 14670 #[doc = "Not clearing the the reset flags"]
16736 pub const CLEAR: Self = Self(0); 14671 pub const NOTACTIVE: Self = Self(0);
16737 #[doc = "Set WWDG1 scope control"] 14672 #[doc = "Clear the reset flags"]
16738 pub const SET: Self = Self(0x01); 14673 pub const CLEAR: Self = Self(0x01);
16739 } 14674 }
16740 #[repr(transparent)] 14675 #[repr(transparent)]
16741 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14676 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16742 pub struct Sdmmcsel(pub u8); 14677 pub struct C1Ahb1enrDma1en(pub u8);
16743 impl Sdmmcsel { 14678 impl C1Ahb1enrDma1en {
16744 #[doc = "pll1_q selected as peripheral clock"] 14679 #[doc = "The selected clock is disabled"]
16745 pub const PLL1_Q: Self = Self(0); 14680 pub const DISABLED: Self = Self(0);
16746 #[doc = "pll2_r selected as peripheral clock"] 14681 #[doc = "The selected clock is enabled"]
16747 pub const PLL2_R: Self = Self(0x01); 14682 pub const ENABLED: Self = Self(0x01);
16748 } 14683 }
16749 #[repr(transparent)] 14684 #[repr(transparent)]
16750 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14685 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16751 pub struct Apb4enrSyscfgen(pub u8); 14686 pub struct C1Ahb2enrDcmien(pub u8);
16752 impl Apb4enrSyscfgen { 14687 impl C1Ahb2enrDcmien {
16753 #[doc = "The selected clock is disabled"] 14688 #[doc = "The selected clock is disabled"]
16754 pub const DISABLED: Self = Self(0); 14689 pub const DISABLED: Self = Self(0);
16755 #[doc = "The selected clock is enabled"] 14690 #[doc = "The selected clock is enabled"]
@@ -16757,93 +14692,101 @@ pub mod rcc_h7 {
16757 } 14692 }
16758 #[repr(transparent)] 14693 #[repr(transparent)]
16759 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14694 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16760 pub struct Lptim2sel(pub u8); 14695 pub struct Rtcen(pub u8);
16761 impl Lptim2sel { 14696 impl Rtcen {
16762 #[doc = "rcc_pclk4 selected as peripheral clock"] 14697 #[doc = "RTC clock disabled"]
16763 pub const RCC_PCLK4: Self = Self(0); 14698 pub const DISABLED: Self = Self(0);
14699 #[doc = "RTC clock enabled"]
14700 pub const ENABLED: Self = Self(0x01);
14701 }
14702 #[repr(transparent)]
14703 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
14704 pub struct Adcsel(pub u8);
14705 impl Adcsel {
16764 #[doc = "pll2_p selected as peripheral clock"] 14706 #[doc = "pll2_p selected as peripheral clock"]
16765 pub const PLL2_P: Self = Self(0x01); 14707 pub const PLL2_P: Self = Self(0);
16766 #[doc = "pll3_r selected as peripheral clock"] 14708 #[doc = "pll3_r selected as peripheral clock"]
16767 pub const PLL3_R: Self = Self(0x02); 14709 pub const PLL3_R: Self = Self(0x01);
16768 #[doc = "LSE selected as peripheral clock"]
16769 pub const LSE: Self = Self(0x03);
16770 #[doc = "LSI selected as peripheral clock"]
16771 pub const LSI: Self = Self(0x04);
16772 #[doc = "PER selected as peripheral clock"] 14710 #[doc = "PER selected as peripheral clock"]
16773 pub const PER: Self = Self(0x05); 14711 pub const PER: Self = Self(0x02);
16774 } 14712 }
16775 #[repr(transparent)] 14713 #[repr(transparent)]
16776 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14714 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16777 pub struct Ahb1lpenrDma1lpen(pub u8); 14715 pub struct Bdmaamen(pub u8);
16778 impl Ahb1lpenrDma1lpen { 14716 impl Bdmaamen {
16779 #[doc = "The selected clock is disabled during csleep mode"] 14717 #[doc = "Clock disabled in autonomous mode"]
16780 pub const DISABLED: Self = Self(0); 14718 pub const DISABLED: Self = Self(0);
16781 #[doc = "The selected clock is enabled during csleep mode"] 14719 #[doc = "Clock enabled in autonomous mode"]
16782 pub const ENABLED: Self = Self(0x01); 14720 pub const ENABLED: Self = Self(0x01);
16783 } 14721 }
16784 #[repr(transparent)] 14722 #[repr(transparent)]
16785 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14723 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16786 pub struct Rtcsel(pub u8); 14724 pub struct Apb1lenrTim2en(pub u8);
16787 impl Rtcsel { 14725 impl Apb1lenrTim2en {
16788 #[doc = "No clock"] 14726 #[doc = "The selected clock is disabled"]
16789 pub const NOCLOCK: Self = Self(0); 14727 pub const DISABLED: Self = Self(0);
16790 #[doc = "LSE oscillator clock used as RTC clock"] 14728 #[doc = "The selected clock is enabled"]
16791 pub const LSE: Self = Self(0x01); 14729 pub const ENABLED: Self = Self(0x01);
16792 #[doc = "LSI oscillator clock used as RTC clock"]
16793 pub const LSI: Self = Self(0x02);
16794 #[doc = "HSE oscillator clock divided by a prescaler used as RTC clock"]
16795 pub const HSE: Self = Self(0x03);
16796 } 14730 }
16797 #[repr(transparent)] 14731 #[repr(transparent)]
16798 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14732 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16799 pub struct Pllsrc(pub u8); 14733 pub struct Apb1hlpenrCrslpen(pub u8);
16800 impl Pllsrc { 14734 impl Apb1hlpenrCrslpen {
16801 #[doc = "HSI selected as PLL clock"] 14735 #[doc = "The selected clock is disabled during csleep mode"]
16802 pub const HSI: Self = Self(0); 14736 pub const DISABLED: Self = Self(0);
16803 #[doc = "CSI selected as PLL clock"] 14737 #[doc = "The selected clock is enabled during csleep mode"]
16804 pub const CSI: Self = Self(0x01); 14738 pub const ENABLED: Self = Self(0x01);
16805 #[doc = "HSE selected as PLL clock"]
16806 pub const HSE: Self = Self(0x02);
16807 #[doc = "No clock sent to DIVMx dividers and PLLs"]
16808 pub const NONE: Self = Self(0x03);
16809 } 14739 }
16810 #[repr(transparent)] 14740 #[repr(transparent)]
16811 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14741 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16812 pub struct Mdmarst(pub u8); 14742 pub struct Lsirdyie(pub u8);
16813 impl Mdmarst { 14743 impl Lsirdyie {
16814 #[doc = "Reset the selected module"] 14744 #[doc = "Interrupt disabled"]
16815 pub const RESET: Self = Self(0x01); 14745 pub const DISABLED: Self = Self(0);
14746 #[doc = "Interrupt enabled"]
14747 pub const ENABLED: Self = Self(0x01);
16816 } 14748 }
16817 #[repr(transparent)] 14749 #[repr(transparent)]
16818 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14750 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16819 pub struct Lsecssdr(pub u8); 14751 pub struct Rngsel(pub u8);
16820 impl Lsecssdr { 14752 impl Rngsel {
16821 #[doc = "No failure detected on 32 kHz oscillator"] 14753 #[doc = "HSI48 selected as peripheral clock"]
16822 pub const NOFAILURE: Self = Self(0); 14754 pub const HSI48: Self = Self(0);
16823 #[doc = "Failure detected on 32 kHz oscillator"] 14755 #[doc = "pll1_q selected as peripheral clock"]
16824 pub const FAILURE: Self = Self(0x01); 14756 pub const PLL1_Q: Self = Self(0x01);
14757 #[doc = "LSE selected as peripheral clock"]
14758 pub const LSE: Self = Self(0x02);
14759 #[doc = "LSI selected as peripheral clock"]
14760 pub const LSI: Self = Self(0x03);
16825 } 14761 }
16826 #[repr(transparent)] 14762 #[repr(transparent)]
16827 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14763 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16828 pub struct Lsedrv(pub u8); 14764 pub struct Ahb2enrDcmien(pub u8);
16829 impl Lsedrv { 14765 impl Ahb2enrDcmien {
16830 #[doc = "Lowest LSE oscillator driving capability"] 14766 #[doc = "The selected clock is disabled"]
16831 pub const LOWEST: Self = Self(0); 14767 pub const DISABLED: Self = Self(0);
16832 #[doc = "Medium low LSE oscillator driving capability"] 14768 #[doc = "The selected clock is enabled"]
16833 pub const MEDIUMLOW: Self = Self(0x01); 14769 pub const ENABLED: Self = Self(0x01);
16834 #[doc = "Medium high LSE oscillator driving capability"]
16835 pub const MEDIUMHIGH: Self = Self(0x02);
16836 #[doc = "Highest LSE oscillator driving capability"]
16837 pub const HIGHEST: Self = Self(0x03);
16838 } 14770 }
16839 #[repr(transparent)] 14771 #[repr(transparent)]
16840 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14772 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16841 pub struct C1Apb1llpenrTim2lpen(pub u8); 14773 pub struct Lsecsson(pub u8);
16842 impl C1Apb1llpenrTim2lpen { 14774 impl Lsecsson {
16843 #[doc = "The selected clock is disabled during csleep mode"] 14775 #[doc = "Clock security system on 32 kHz oscillator off"]
16844 pub const DISABLED: Self = Self(0); 14776 pub const SECURITYOFF: Self = Self(0);
16845 #[doc = "The selected clock is enabled during csleep mode"] 14777 #[doc = "Clock security system on 32 kHz oscillator on"]
16846 pub const ENABLED: Self = Self(0x01); 14778 pub const SECURITYON: Self = Self(0x01);
14779 }
14780 #[repr(transparent)]
14781 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
14782 pub struct Fdcansel(pub u8);
14783 impl Fdcansel {
14784 #[doc = "HSE selected as peripheral clock"]
14785 pub const HSE: Self = Self(0);
14786 #[doc = "pll1_q selected as peripheral clock"]
14787 pub const PLL1_Q: Self = Self(0x01);
14788 #[doc = "pll2_q selected as peripheral clock"]
14789 pub const PLL2_Q: Self = Self(0x02);
16847 } 14790 }
16848 #[repr(transparent)] 14791 #[repr(transparent)]
16849 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14792 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -16856,72 +14799,38 @@ pub mod rcc_h7 {
16856 } 14799 }
16857 #[repr(transparent)] 14800 #[repr(transparent)]
16858 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14801 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16859 pub struct Lsirdyie(pub u8); 14802 pub struct D3ppre(pub u8);
16860 impl Lsirdyie { 14803 impl D3ppre {
16861 #[doc = "Interrupt disabled"] 14804 #[doc = "rcc_hclk not divided"]
16862 pub const DISABLED: Self = Self(0);
16863 #[doc = "Interrupt enabled"]
16864 pub const ENABLED: Self = Self(0x01);
16865 }
16866 #[repr(transparent)]
16867 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16868 pub struct Sai4asel(pub u8);
16869 impl Sai4asel {
16870 #[doc = "pll1_q selected as peripheral clock"]
16871 pub const PLL1_Q: Self = Self(0);
16872 #[doc = "pll2_p selected as peripheral clock"]
16873 pub const PLL2_P: Self = Self(0x01);
16874 #[doc = "pll3_p selected as peripheral clock"]
16875 pub const PLL3_P: Self = Self(0x02);
16876 #[doc = "i2s_ckin selected as peripheral clock"]
16877 pub const I2S_CKIN: Self = Self(0x03);
16878 #[doc = "PER selected as peripheral clock"]
16879 pub const PER: Self = Self(0x04);
16880 }
16881 #[repr(transparent)]
16882 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16883 pub struct Hpre(pub u8);
16884 impl Hpre {
16885 #[doc = "sys_ck not divided"]
16886 pub const DIV1: Self = Self(0); 14805 pub const DIV1: Self = Self(0);
16887 #[doc = "sys_ck divided by 2"] 14806 #[doc = "rcc_hclk divided by 2"]
16888 pub const DIV2: Self = Self(0x08); 14807 pub const DIV2: Self = Self(0x04);
16889 #[doc = "sys_ck divided by 4"] 14808 #[doc = "rcc_hclk divided by 4"]
16890 pub const DIV4: Self = Self(0x09); 14809 pub const DIV4: Self = Self(0x05);
16891 #[doc = "sys_ck divided by 8"] 14810 #[doc = "rcc_hclk divided by 8"]
16892 pub const DIV8: Self = Self(0x0a); 14811 pub const DIV8: Self = Self(0x06);
16893 #[doc = "sys_ck divided by 16"] 14812 #[doc = "rcc_hclk divided by 16"]
16894 pub const DIV16: Self = Self(0x0b); 14813 pub const DIV16: Self = Self(0x07);
16895 #[doc = "sys_ck divided by 64"]
16896 pub const DIV64: Self = Self(0x0c);
16897 #[doc = "sys_ck divided by 128"]
16898 pub const DIV128: Self = Self(0x0d);
16899 #[doc = "sys_ck divided by 256"]
16900 pub const DIV256: Self = Self(0x0e);
16901 #[doc = "sys_ck divided by 512"]
16902 pub const DIV512: Self = Self(0x0f);
16903 } 14814 }
16904 #[repr(transparent)] 14815 #[repr(transparent)]
16905 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14816 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16906 pub struct Spi6sel(pub u8); 14817 pub struct Mco1(pub u8);
16907 impl Spi6sel { 14818 impl Mco1 {
16908 #[doc = "rcc_pclk4 selected as peripheral clock"] 14819 #[doc = "HSI selected for micro-controller clock output"]
16909 pub const RCC_PCLK4: Self = Self(0); 14820 pub const HSI: Self = Self(0);
16910 #[doc = "pll2_q selected as peripheral clock"] 14821 #[doc = "LSE selected for micro-controller clock output"]
16911 pub const PLL2_Q: Self = Self(0x01); 14822 pub const LSE: Self = Self(0x01);
16912 #[doc = "pll3_q selected as peripheral clock"] 14823 #[doc = "HSE selected for micro-controller clock output"]
16913 pub const PLL3_Q: Self = Self(0x02); 14824 pub const HSE: Self = Self(0x02);
16914 #[doc = "hsi_ker selected as peripheral clock"] 14825 #[doc = "pll1_q selected for micro-controller clock output"]
16915 pub const HSI_KER: Self = Self(0x03); 14826 pub const PLL1_Q: Self = Self(0x03);
16916 #[doc = "csi_ker selected as peripheral clock"] 14827 #[doc = "HSI48 selected for micro-controller clock output"]
16917 pub const CSI_KER: Self = Self(0x04); 14828 pub const HSI48: Self = Self(0x04);
16918 #[doc = "HSE selected as peripheral clock"]
16919 pub const HSE: Self = Self(0x05);
16920 } 14829 }
16921 #[repr(transparent)] 14830 #[repr(transparent)]
16922 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14831 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16923 pub struct C1Ahb4lpenrGpioalpen(pub u8); 14832 pub struct C1Apb4lpenrSyscfglpen(pub u8);
16924 impl C1Ahb4lpenrGpioalpen { 14833 impl C1Apb4lpenrSyscfglpen {
16925 #[doc = "The selected clock is disabled during csleep mode"] 14834 #[doc = "The selected clock is disabled during csleep mode"]
16926 pub const DISABLED: Self = Self(0); 14835 pub const DISABLED: Self = Self(0);
16927 #[doc = "The selected clock is enabled during csleep mode"] 14836 #[doc = "The selected clock is enabled during csleep mode"]
@@ -16929,38 +14838,28 @@ pub mod rcc_h7 {
16929 } 14838 }
16930 #[repr(transparent)] 14839 #[repr(transparent)]
16931 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14840 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16932 pub struct Apb4lpenrSyscfglpen(pub u8); 14841 pub struct Ahb4enrGpioaen(pub u8);
16933 impl Apb4lpenrSyscfglpen { 14842 impl Ahb4enrGpioaen {
16934 #[doc = "The selected clock is disabled during csleep mode"] 14843 #[doc = "The selected clock is disabled"]
16935 pub const DISABLED: Self = Self(0); 14844 pub const DISABLED: Self = Self(0);
16936 #[doc = "The selected clock is enabled during csleep mode"] 14845 #[doc = "The selected clock is enabled"]
16937 pub const ENABLED: Self = Self(0x01); 14846 pub const ENABLED: Self = Self(0x01);
16938 } 14847 }
16939 #[repr(transparent)] 14848 #[repr(transparent)]
16940 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14849 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16941 pub struct Usart16sel(pub u8); 14850 pub struct Bdrst(pub u8);
16942 impl Usart16sel { 14851 impl Bdrst {
16943 #[doc = "rcc_pclk2 selected as peripheral clock"] 14852 #[doc = "Resets the entire VSW domain"]
16944 pub const RCC_PCLK2: Self = Self(0); 14853 pub const RESET: Self = Self(0x01);
16945 #[doc = "pll2_q selected as peripheral clock"]
16946 pub const PLL2_Q: Self = Self(0x01);
16947 #[doc = "pll3_q selected as peripheral clock"]
16948 pub const PLL3_Q: Self = Self(0x02);
16949 #[doc = "hsi_ker selected as peripheral clock"]
16950 pub const HSI_KER: Self = Self(0x03);
16951 #[doc = "csi_ker selected as peripheral clock"]
16952 pub const CSI_KER: Self = Self(0x04);
16953 #[doc = "LSE selected as peripheral clock"]
16954 pub const LSE: Self = Self(0x05);
16955 } 14854 }
16956 #[repr(transparent)] 14855 #[repr(transparent)]
16957 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14856 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
16958 pub struct Dfsdm1sel(pub u8); 14857 pub struct Hsion(pub u8);
16959 impl Dfsdm1sel { 14858 impl Hsion {
16960 #[doc = "rcc_pclk2 selected as peripheral clock"] 14859 #[doc = "Clock Off"]
16961 pub const RCC_PCLK2: Self = Self(0); 14860 pub const OFF: Self = Self(0);
16962 #[doc = "System clock selected as peripheral clock"] 14861 #[doc = "Clock On"]
16963 pub const SYS: Self = Self(0x01); 14862 pub const ON: Self = Self(0x01);
16964 } 14863 }
16965 #[repr(transparent)] 14864 #[repr(transparent)]
16966 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 14865 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -17108,48 +15007,8 @@ pub mod rcc_h7 {
17108 } 15007 }
17109 #[repr(transparent)] 15008 #[repr(transparent)]
17110 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15009 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17111 pub struct C1Ahb1enrDma1en(pub u8); 15010 pub struct C1Ahb2lpenrDcmilpen(pub u8);
17112 impl C1Ahb1enrDma1en { 15011 impl C1Ahb2lpenrDcmilpen {
17113 #[doc = "The selected clock is disabled"]
17114 pub const DISABLED: Self = Self(0);
17115 #[doc = "The selected clock is enabled"]
17116 pub const ENABLED: Self = Self(0x01);
17117 }
17118 #[repr(transparent)]
17119 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17120 pub struct Ahb3enrMdmaen(pub u8);
17121 impl Ahb3enrMdmaen {
17122 #[doc = "The selected clock is disabled"]
17123 pub const DISABLED: Self = Self(0);
17124 #[doc = "The selected clock is enabled"]
17125 pub const ENABLED: Self = Self(0x01);
17126 }
17127 #[repr(transparent)]
17128 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17129 pub struct Hsidiv(pub u8);
17130 impl Hsidiv {
17131 #[doc = "No division"]
17132 pub const DIV1: Self = Self(0);
17133 #[doc = "Division by 2"]
17134 pub const DIV2: Self = Self(0x01);
17135 #[doc = "Division by 4"]
17136 pub const DIV4: Self = Self(0x02);
17137 #[doc = "Division by 8"]
17138 pub const DIV8: Self = Self(0x03);
17139 }
17140 #[repr(transparent)]
17141 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17142 pub struct Lsirdyr(pub u8);
17143 impl Lsirdyr {
17144 #[doc = "LSI oscillator not ready"]
17145 pub const NOTREADY: Self = Self(0);
17146 #[doc = "LSI oscillator ready"]
17147 pub const READY: Self = Self(0x01);
17148 }
17149 #[repr(transparent)]
17150 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17151 pub struct Ahb2lpenrDcmilpen(pub u8);
17152 impl Ahb2lpenrDcmilpen {
17153 #[doc = "The selected clock is disabled during csleep mode"] 15012 #[doc = "The selected clock is disabled during csleep mode"]
17154 pub const DISABLED: Self = Self(0); 15013 pub const DISABLED: Self = Self(0);
17155 #[doc = "The selected clock is enabled during csleep mode"] 15014 #[doc = "The selected clock is enabled during csleep mode"]
@@ -17157,21 +15016,15 @@ pub mod rcc_h7 {
17157 } 15016 }
17158 #[repr(transparent)] 15017 #[repr(transparent)]
17159 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15018 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17160 pub struct Usbsel(pub u8); 15019 pub struct Gpioarst(pub u8);
17161 impl Usbsel { 15020 impl Gpioarst {
17162 #[doc = "Disable the kernel clock"] 15021 #[doc = "Reset the selected module"]
17163 pub const DISABLE: Self = Self(0); 15022 pub const RESET: Self = Self(0x01);
17164 #[doc = "pll1_q selected as peripheral clock"]
17165 pub const PLL1_Q: Self = Self(0x01);
17166 #[doc = "pll3_q selected as peripheral clock"]
17167 pub const PLL3_Q: Self = Self(0x02);
17168 #[doc = "HSI48 selected as peripheral clock"]
17169 pub const HSI48: Self = Self(0x03);
17170 } 15023 }
17171 #[repr(transparent)] 15024 #[repr(transparent)]
17172 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15025 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17173 pub struct Apb1hlpenrCrslpen(pub u8); 15026 pub struct Apb2lpenrTim1lpen(pub u8);
17174 impl Apb1hlpenrCrslpen { 15027 impl Apb2lpenrTim1lpen {
17175 #[doc = "The selected clock is disabled during csleep mode"] 15028 #[doc = "The selected clock is disabled during csleep mode"]
17176 pub const DISABLED: Self = Self(0); 15029 pub const DISABLED: Self = Self(0);
17177 #[doc = "The selected clock is enabled during csleep mode"] 15030 #[doc = "The selected clock is enabled during csleep mode"]
@@ -17179,47 +15032,21 @@ pub mod rcc_h7 {
17179 } 15032 }
17180 #[repr(transparent)] 15033 #[repr(transparent)]
17181 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15034 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17182 pub struct Swpsel(pub u8); 15035 pub struct Pll1vcosel(pub u8);
17183 impl Swpsel { 15036 impl Pll1vcosel {
17184 #[doc = "pclk selected as peripheral clock"] 15037 #[doc = "VCO frequency range 192 to 836 MHz"]
17185 pub const PCLK: Self = Self(0); 15038 pub const WIDEVCO: Self = Self(0);
17186 #[doc = "hsi_ker selected as peripheral clock"] 15039 #[doc = "VCO frequency range 150 to 420 MHz"]
17187 pub const HSI_KER: Self = Self(0x01); 15040 pub const MEDIUMVCO: Self = Self(0x01);
17188 }
17189 #[repr(transparent)]
17190 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17191 pub struct Sai1sel(pub u8);
17192 impl Sai1sel {
17193 #[doc = "pll1_q selected as peripheral clock"]
17194 pub const PLL1_Q: Self = Self(0);
17195 #[doc = "pll2_p selected as peripheral clock"]
17196 pub const PLL2_P: Self = Self(0x01);
17197 #[doc = "pll3_p selected as peripheral clock"]
17198 pub const PLL3_P: Self = Self(0x02);
17199 #[doc = "I2S_CKIN selected as peripheral clock"]
17200 pub const I2S_CKIN: Self = Self(0x03);
17201 #[doc = "PER selected as peripheral clock"]
17202 pub const PER: Self = Self(0x04);
17203 }
17204 #[repr(transparent)]
17205 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17206 pub struct Spdifsel(pub u8);
17207 impl Spdifsel {
17208 #[doc = "pll1_q selected as peripheral clock"]
17209 pub const PLL1_Q: Self = Self(0);
17210 #[doc = "pll2_r selected as peripheral clock"]
17211 pub const PLL2_R: Self = Self(0x01);
17212 #[doc = "pll3_r selected as peripheral clock"]
17213 pub const PLL3_R: Self = Self(0x02);
17214 #[doc = "hsi_ker selected as peripheral clock"]
17215 pub const HSI_KER: Self = Self(0x03);
17216 } 15041 }
17217 #[repr(transparent)] 15042 #[repr(transparent)]
17218 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15043 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17219 pub struct Camitfrst(pub u8); 15044 pub struct Apb1henrCrsen(pub u8);
17220 impl Camitfrst { 15045 impl Apb1henrCrsen {
17221 #[doc = "Reset the selected module"] 15046 #[doc = "The selected clock is disabled"]
17222 pub const RESET: Self = Self(0x01); 15047 pub const DISABLED: Self = Self(0);
15048 #[doc = "The selected clock is enabled"]
15049 pub const ENABLED: Self = Self(0x01);
17223 } 15050 }
17224 #[repr(transparent)] 15051 #[repr(transparent)]
17225 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15052 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -17240,67 +15067,49 @@ pub mod rcc_h7 {
17240 } 15067 }
17241 #[repr(transparent)] 15068 #[repr(transparent)]
17242 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15069 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17243 pub struct D2ppre1(pub u8); 15070 pub struct C1Apb2lpenrTim1lpen(pub u8);
17244 impl D2ppre1 { 15071 impl C1Apb2lpenrTim1lpen {
17245 #[doc = "rcc_hclk not divided"] 15072 #[doc = "The selected clock is disabled during csleep mode"]
17246 pub const DIV1: Self = Self(0);
17247 #[doc = "rcc_hclk divided by 2"]
17248 pub const DIV2: Self = Self(0x04);
17249 #[doc = "rcc_hclk divided by 4"]
17250 pub const DIV4: Self = Self(0x05);
17251 #[doc = "rcc_hclk divided by 8"]
17252 pub const DIV8: Self = Self(0x06);
17253 #[doc = "rcc_hclk divided by 16"]
17254 pub const DIV16: Self = Self(0x07);
17255 }
17256 #[repr(transparent)]
17257 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17258 pub struct C1Ahb3enrMdmaen(pub u8);
17259 impl C1Ahb3enrMdmaen {
17260 #[doc = "The selected clock is disabled"]
17261 pub const DISABLED: Self = Self(0); 15073 pub const DISABLED: Self = Self(0);
17262 #[doc = "The selected clock is enabled"] 15074 #[doc = "The selected clock is enabled during csleep mode"]
17263 pub const ENABLED: Self = Self(0x01); 15075 pub const ENABLED: Self = Self(0x01);
17264 } 15076 }
17265 #[repr(transparent)] 15077 #[repr(transparent)]
17266 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15078 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17267 pub struct Gpioarst(pub u8); 15079 pub struct Lpuart1sel(pub u8);
17268 impl Gpioarst { 15080 impl Lpuart1sel {
17269 #[doc = "Reset the selected module"] 15081 #[doc = "rcc_pclk_d3 selected as peripheral clock"]
17270 pub const RESET: Self = Self(0x01); 15082 pub const RCC_PCLK_D3: Self = Self(0);
17271 } 15083 #[doc = "pll2_q selected as peripheral clock"]
17272 #[repr(transparent)] 15084 pub const PLL2_Q: Self = Self(0x01);
17273 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15085 #[doc = "pll3_q selected as peripheral clock"]
17274 pub struct Ahb2enrDcmien(pub u8); 15086 pub const PLL3_Q: Self = Self(0x02);
17275 impl Ahb2enrDcmien { 15087 #[doc = "hsi_ker selected as peripheral clock"]
17276 #[doc = "The selected clock is disabled"] 15088 pub const HSI_KER: Self = Self(0x03);
17277 pub const DISABLED: Self = Self(0); 15089 #[doc = "csi_ker selected as peripheral clock"]
17278 #[doc = "The selected clock is enabled"] 15090 pub const CSI_KER: Self = Self(0x04);
17279 pub const ENABLED: Self = Self(0x01); 15091 #[doc = "LSE selected as peripheral clock"]
15092 pub const LSE: Self = Self(0x05);
17280 } 15093 }
17281 #[repr(transparent)] 15094 #[repr(transparent)]
17282 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15095 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17283 pub struct Apb3enrLtdcen(pub u8); 15096 pub struct C1Apb3lpenrLtdclpen(pub u8);
17284 impl Apb3enrLtdcen { 15097 impl C1Apb3lpenrLtdclpen {
17285 #[doc = "The selected clock is disabled"] 15098 #[doc = "The selected clock is disabled during csleep mode"]
17286 pub const DISABLED: Self = Self(0); 15099 pub const DISABLED: Self = Self(0);
17287 #[doc = "The selected clock is enabled"] 15100 #[doc = "The selected clock is enabled during csleep mode"]
17288 pub const ENABLED: Self = Self(0x01); 15101 pub const ENABLED: Self = Self(0x01);
17289 } 15102 }
17290 #[repr(transparent)] 15103 #[repr(transparent)]
17291 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15104 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17292 pub struct D1ppre(pub u8); 15105 pub struct Ckpersel(pub u8);
17293 impl D1ppre { 15106 impl Ckpersel {
17294 #[doc = "rcc_hclk not divided"] 15107 #[doc = "HSI selected as peripheral clock"]
17295 pub const DIV1: Self = Self(0); 15108 pub const HSI: Self = Self(0);
17296 #[doc = "rcc_hclk divided by 2"] 15109 #[doc = "CSI selected as peripheral clock"]
17297 pub const DIV2: Self = Self(0x04); 15110 pub const CSI: Self = Self(0x01);
17298 #[doc = "rcc_hclk divided by 4"] 15111 #[doc = "HSE selected as peripheral clock"]
17299 pub const DIV4: Self = Self(0x05); 15112 pub const HSE: Self = Self(0x02);
17300 #[doc = "rcc_hclk divided by 8"]
17301 pub const DIV8: Self = Self(0x06);
17302 #[doc = "rcc_hclk divided by 16"]
17303 pub const DIV16: Self = Self(0x07);
17304 } 15113 }
17305 #[repr(transparent)] 15114 #[repr(transparent)]
17306 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15115 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -17313,102 +15122,79 @@ pub mod rcc_h7 {
17313 } 15122 }
17314 #[repr(transparent)] 15123 #[repr(transparent)]
17315 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15124 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17316 pub struct C1Apb4enrSyscfgen(pub u8); 15125 pub struct Ltdcrst(pub u8);
17317 impl C1Apb4enrSyscfgen { 15126 impl Ltdcrst {
17318 #[doc = "The selected clock is disabled"] 15127 #[doc = "Reset the selected module"]
17319 pub const DISABLED: Self = Self(0); 15128 pub const RESET: Self = Self(0x01);
17320 #[doc = "The selected clock is enabled"]
17321 pub const ENABLED: Self = Self(0x01);
17322 } 15129 }
17323 #[repr(transparent)] 15130 #[repr(transparent)]
17324 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15131 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17325 pub struct C1Apb2lpenrTim1lpen(pub u8); 15132 pub struct Cecsel(pub u8);
17326 impl C1Apb2lpenrTim1lpen { 15133 impl Cecsel {
17327 #[doc = "The selected clock is disabled during csleep mode"] 15134 #[doc = "LSE selected as peripheral clock"]
17328 pub const DISABLED: Self = Self(0); 15135 pub const LSE: Self = Self(0);
17329 #[doc = "The selected clock is enabled during csleep mode"] 15136 #[doc = "LSI selected as peripheral clock"]
17330 pub const ENABLED: Self = Self(0x01); 15137 pub const LSI: Self = Self(0x01);
15138 #[doc = "csi_ker selected as peripheral clock"]
15139 pub const CSI_KER: Self = Self(0x02);
17331 } 15140 }
17332 #[repr(transparent)] 15141 #[repr(transparent)]
17333 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15142 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17334 pub struct Ahb4enrGpioaen(pub u8); 15143 pub struct C1Apb1hlpenrCrslpen(pub u8);
17335 impl Ahb4enrGpioaen { 15144 impl C1Apb1hlpenrCrslpen {
17336 #[doc = "The selected clock is disabled"] 15145 #[doc = "The selected clock is disabled during csleep mode"]
17337 pub const DISABLED: Self = Self(0); 15146 pub const DISABLED: Self = Self(0);
17338 #[doc = "The selected clock is enabled"] 15147 #[doc = "The selected clock is enabled during csleep mode"]
17339 pub const ENABLED: Self = Self(0x01); 15148 pub const ENABLED: Self = Self(0x01);
17340 } 15149 }
17341 #[repr(transparent)] 15150 #[repr(transparent)]
17342 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15151 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17343 pub struct Crsrst(pub u8); 15152 pub struct Hsidiv(pub u8);
17344 impl Crsrst { 15153 impl Hsidiv {
17345 #[doc = "Reset the selected module"] 15154 #[doc = "No division"]
17346 pub const RESET: Self = Self(0x01); 15155 pub const DIV1: Self = Self(0);
17347 } 15156 #[doc = "Division by 2"]
17348 #[repr(transparent)] 15157 pub const DIV2: Self = Self(0x01);
17349 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15158 #[doc = "Division by 4"]
17350 pub struct C1RsrCpurstfr(pub u8); 15159 pub const DIV4: Self = Self(0x02);
17351 impl C1RsrCpurstfr { 15160 #[doc = "Division by 8"]
17352 #[doc = "No reset occoured for block"] 15161 pub const DIV8: Self = Self(0x03);
17353 pub const NORESETOCCOURED: Self = Self(0);
17354 #[doc = "Reset occoured for block"]
17355 pub const RESETOCCOURRED: Self = Self(0x01);
17356 }
17357 #[repr(transparent)]
17358 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17359 pub struct Hrtimsel(pub u8);
17360 impl Hrtimsel {
17361 #[doc = "The HRTIM prescaler clock source is the same as other timers (rcc_timy_ker_ck)"]
17362 pub const TIMY_KER: Self = Self(0);
17363 #[doc = "The HRTIM prescaler clock source is the CPU clock (c_ck)"]
17364 pub const C_CK: Self = Self(0x01);
17365 } 15162 }
17366 #[repr(transparent)] 15163 #[repr(transparent)]
17367 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15164 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17368 pub struct Lsebyp(pub u8); 15165 pub struct Swpsel(pub u8);
17369 impl Lsebyp { 15166 impl Swpsel {
17370 #[doc = "LSE crystal oscillator not bypassed"] 15167 #[doc = "pclk selected as peripheral clock"]
17371 pub const NOTBYPASSED: Self = Self(0); 15168 pub const PCLK: Self = Self(0);
17372 #[doc = "LSE crystal oscillator bypassed with external clock"] 15169 #[doc = "hsi_ker selected as peripheral clock"]
17373 pub const BYPASSED: Self = Self(0x01); 15170 pub const HSI_KER: Self = Self(0x01);
17374 } 15171 }
17375 #[repr(transparent)] 15172 #[repr(transparent)]
17376 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15173 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17377 pub struct Tim1rst(pub u8); 15174 pub struct Mdmarst(pub u8);
17378 impl Tim1rst { 15175 impl Mdmarst {
17379 #[doc = "Reset the selected module"] 15176 #[doc = "Reset the selected module"]
17380 pub const RESET: Self = Self(0x01); 15177 pub const RESET: Self = Self(0x01);
17381 } 15178 }
17382 #[repr(transparent)] 15179 #[repr(transparent)]
17383 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15180 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17384 pub struct C1Ahb2lpenrDcmilpen(pub u8); 15181 pub struct Sai1sel(pub u8);
17385 impl C1Ahb2lpenrDcmilpen { 15182 impl Sai1sel {
17386 #[doc = "The selected clock is disabled during csleep mode"] 15183 #[doc = "pll1_q selected as peripheral clock"]
17387 pub const DISABLED: Self = Self(0); 15184 pub const PLL1_Q: Self = Self(0);
17388 #[doc = "The selected clock is enabled during csleep mode"] 15185 #[doc = "pll2_p selected as peripheral clock"]
17389 pub const ENABLED: Self = Self(0x01); 15186 pub const PLL2_P: Self = Self(0x01);
17390 } 15187 #[doc = "pll3_p selected as peripheral clock"]
17391 #[repr(transparent)] 15188 pub const PLL3_P: Self = Self(0x02);
17392 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15189 #[doc = "I2S_CKIN selected as peripheral clock"]
17393 pub struct Usart234578sel(pub u8); 15190 pub const I2S_CKIN: Self = Self(0x03);
17394 impl Usart234578sel { 15191 #[doc = "PER selected as peripheral clock"]
17395 #[doc = "rcc_pclk1 selected as peripheral clock"] 15192 pub const PER: Self = Self(0x04);
17396 pub const RCC_PCLK1: Self = Self(0);
17397 #[doc = "pll2_q selected as peripheral clock"]
17398 pub const PLL2_Q: Self = Self(0x01);
17399 #[doc = "pll3_q selected as peripheral clock"]
17400 pub const PLL3_Q: Self = Self(0x02);
17401 #[doc = "hsi_ker selected as peripheral clock"]
17402 pub const HSI_KER: Self = Self(0x03);
17403 #[doc = "csi_ker selected as peripheral clock"]
17404 pub const CSI_KER: Self = Self(0x04);
17405 #[doc = "LSE selected as peripheral clock"]
17406 pub const LSE: Self = Self(0x05);
17407 } 15193 }
17408 #[repr(transparent)] 15194 #[repr(transparent)]
17409 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15195 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17410 pub struct C1Apb1hlpenrCrslpen(pub u8); 15196 pub struct Ahb3lpenrMdmalpen(pub u8);
17411 impl C1Apb1hlpenrCrslpen { 15197 impl Ahb3lpenrMdmalpen {
17412 #[doc = "The selected clock is disabled during csleep mode"] 15198 #[doc = "The selected clock is disabled during csleep mode"]
17413 pub const DISABLED: Self = Self(0); 15199 pub const DISABLED: Self = Self(0);
17414 #[doc = "The selected clock is enabled during csleep mode"] 15200 #[doc = "The selected clock is enabled during csleep mode"]
@@ -17416,17 +15202,8 @@ pub mod rcc_h7 {
17416 } 15202 }
17417 #[repr(transparent)] 15203 #[repr(transparent)]
17418 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15204 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17419 pub struct Ahb1enrDma1en(pub u8); 15205 pub struct C1Apb3enrLtdcen(pub u8);
17420 impl Ahb1enrDma1en { 15206 impl C1Apb3enrLtdcen {
17421 #[doc = "The selected clock is disabled"]
17422 pub const DISABLED: Self = Self(0);
17423 #[doc = "The selected clock is enabled"]
17424 pub const ENABLED: Self = Self(0x01);
17425 }
17426 #[repr(transparent)]
17427 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17428 pub struct C1Apb1lenrTim2en(pub u8);
17429 impl C1Apb1lenrTim2en {
17430 #[doc = "The selected clock is disabled"] 15207 #[doc = "The selected clock is disabled"]
17431 pub const DISABLED: Self = Self(0); 15208 pub const DISABLED: Self = Self(0);
17432 #[doc = "The selected clock is enabled"] 15209 #[doc = "The selected clock is enabled"]
@@ -17434,34 +15211,21 @@ pub mod rcc_h7 {
17434 } 15211 }
17435 #[repr(transparent)] 15212 #[repr(transparent)]
17436 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15213 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17437 pub struct Mco2(pub u8); 15214 pub struct Lsedrv(pub u8);
17438 impl Mco2 { 15215 impl Lsedrv {
17439 #[doc = "System clock selected for micro-controller clock output"] 15216 #[doc = "Lowest LSE oscillator driving capability"]
17440 pub const SYSCLK: Self = Self(0); 15217 pub const LOWEST: Self = Self(0);
17441 #[doc = "pll2_p selected for micro-controller clock output"] 15218 #[doc = "Medium low LSE oscillator driving capability"]
17442 pub const PLL2_P: Self = Self(0x01); 15219 pub const MEDIUMLOW: Self = Self(0x01);
17443 #[doc = "HSE selected for micro-controller clock output"] 15220 #[doc = "Medium high LSE oscillator driving capability"]
17444 pub const HSE: Self = Self(0x02); 15221 pub const MEDIUMHIGH: Self = Self(0x02);
17445 #[doc = "pll1_p selected for micro-controller clock output"] 15222 #[doc = "Highest LSE oscillator driving capability"]
17446 pub const PLL1_P: Self = Self(0x03); 15223 pub const HIGHEST: Self = Self(0x03);
17447 #[doc = "CSI selected for micro-controller clock output"]
17448 pub const CSI: Self = Self(0x04);
17449 #[doc = "LSI selected for micro-controller clock output"]
17450 pub const LSI: Self = Self(0x05);
17451 }
17452 #[repr(transparent)]
17453 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17454 pub struct Hsebyp(pub u8);
17455 impl Hsebyp {
17456 #[doc = "HSE crystal oscillator not bypassed"]
17457 pub const NOTBYPASSED: Self = Self(0);
17458 #[doc = "HSE crystal oscillator bypassed with external clock"]
17459 pub const BYPASSED: Self = Self(0x01);
17460 } 15224 }
17461 #[repr(transparent)] 15225 #[repr(transparent)]
17462 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15226 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17463 pub struct C1Apb1henrCrsen(pub u8); 15227 pub struct Ahb3enrMdmaen(pub u8);
17464 impl C1Apb1henrCrsen { 15228 impl Ahb3enrMdmaen {
17465 #[doc = "The selected clock is disabled"] 15229 #[doc = "The selected clock is disabled"]
17466 pub const DISABLED: Self = Self(0); 15230 pub const DISABLED: Self = Self(0);
17467 #[doc = "The selected clock is enabled"] 15231 #[doc = "The selected clock is enabled"]
@@ -17469,68 +15233,26 @@ pub mod rcc_h7 {
17469 } 15233 }
17470 #[repr(transparent)] 15234 #[repr(transparent)]
17471 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15235 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17472 pub struct Ahb4lpenrGpioalpen(pub u8); 15236 pub struct Apb3enrLtdcen(pub u8);
17473 impl Ahb4lpenrGpioalpen { 15237 impl Apb3enrLtdcen {
17474 #[doc = "The selected clock is disabled during csleep mode"] 15238 #[doc = "The selected clock is disabled"]
17475 pub const DISABLED: Self = Self(0); 15239 pub const DISABLED: Self = Self(0);
17476 #[doc = "The selected clock is enabled during csleep mode"] 15240 #[doc = "The selected clock is enabled"]
17477 pub const ENABLED: Self = Self(0x01); 15241 pub const ENABLED: Self = Self(0x01);
17478 } 15242 }
17479 #[repr(transparent)] 15243 #[repr(transparent)]
17480 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15244 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17481 pub struct Lsirdyc(pub u8); 15245 pub struct Timpre(pub u8);
17482 impl Lsirdyc { 15246 impl Timpre {
17483 #[doc = "Clear interrupt flag"] 15247 #[doc = "Timer kernel clock equal to 2x pclk by default"]
17484 pub const CLEAR: Self = Self(0x01); 15248 pub const DEFAULTX2: Self = Self(0);
17485 } 15249 #[doc = "Timer kernel clock equal to 4x pclk by default"]
17486 #[repr(transparent)] 15250 pub const DEFAULTX4: Self = Self(0x01);
17487 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17488 pub struct Lserdyr(pub u8);
17489 impl Lserdyr {
17490 #[doc = "LSE oscillator not ready"]
17491 pub const NOTREADY: Self = Self(0);
17492 #[doc = "LSE oscillator ready"]
17493 pub const READY: Self = Self(0x01);
17494 }
17495 #[repr(transparent)]
17496 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17497 pub struct Pll1rge(pub u8);
17498 impl Pll1rge {
17499 #[doc = "Frequency is between 1 and 2 MHz"]
17500 pub const RANGE1: Self = Self(0);
17501 #[doc = "Frequency is between 2 and 4 MHz"]
17502 pub const RANGE2: Self = Self(0x01);
17503 #[doc = "Frequency is between 4 and 8 MHz"]
17504 pub const RANGE4: Self = Self(0x02);
17505 #[doc = "Frequency is between 8 and 16 MHz"]
17506 pub const RANGE8: Self = Self(0x03);
17507 }
17508 #[repr(transparent)]
17509 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17510 pub struct Hsion(pub u8);
17511 impl Hsion {
17512 #[doc = "Clock Off"]
17513 pub const OFF: Self = Self(0);
17514 #[doc = "Clock On"]
17515 pub const ON: Self = Self(0x01);
17516 }
17517 #[repr(transparent)]
17518 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17519 pub struct Sw(pub u8);
17520 impl Sw {
17521 #[doc = "HSI selected as system clock"]
17522 pub const HSI: Self = Self(0);
17523 #[doc = "CSI selected as system clock"]
17524 pub const CSI: Self = Self(0x01);
17525 #[doc = "HSE selected as system clock"]
17526 pub const HSE: Self = Self(0x02);
17527 #[doc = "PLL1 selected as system clock"]
17528 pub const PLL1: Self = Self(0x03);
17529 } 15251 }
17530 #[repr(transparent)] 15252 #[repr(transparent)]
17531 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15253 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17532 pub struct C1Ahb4enrGpioaen(pub u8); 15254 pub struct C1Apb2enrTim1en(pub u8);
17533 impl C1Ahb4enrGpioaen { 15255 impl C1Apb2enrTim1en {
17534 #[doc = "The selected clock is disabled"] 15256 #[doc = "The selected clock is disabled"]
17535 pub const DISABLED: Self = Self(0); 15257 pub const DISABLED: Self = Self(0);
17536 #[doc = "The selected clock is enabled"] 15258 #[doc = "The selected clock is enabled"]
@@ -17538,42 +15260,50 @@ pub mod rcc_h7 {
17538 } 15260 }
17539 #[repr(transparent)] 15261 #[repr(transparent)]
17540 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15262 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17541 pub struct Apb1henrCrsen(pub u8); 15263 pub struct C1Ahb4lpenrGpioalpen(pub u8);
17542 impl Apb1henrCrsen { 15264 impl C1Ahb4lpenrGpioalpen {
17543 #[doc = "The selected clock is disabled"] 15265 #[doc = "The selected clock is disabled during csleep mode"]
17544 pub const DISABLED: Self = Self(0); 15266 pub const DISABLED: Self = Self(0);
17545 #[doc = "The selected clock is enabled"] 15267 #[doc = "The selected clock is enabled during csleep mode"]
17546 pub const ENABLED: Self = Self(0x01); 15268 pub const ENABLED: Self = Self(0x01);
17547 } 15269 }
17548 #[repr(transparent)] 15270 #[repr(transparent)]
17549 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15271 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17550 pub struct Tim2rst(pub u8); 15272 pub struct Ahb4lpenrGpioalpen(pub u8);
17551 impl Tim2rst { 15273 impl Ahb4lpenrGpioalpen {
17552 #[doc = "Reset the selected module"] 15274 #[doc = "The selected clock is disabled during csleep mode"]
17553 pub const RESET: Self = Self(0x01); 15275 pub const DISABLED: Self = Self(0);
15276 #[doc = "The selected clock is enabled during csleep mode"]
15277 pub const ENABLED: Self = Self(0x01);
17554 } 15278 }
17555 #[repr(transparent)] 15279 #[repr(transparent)]
17556 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15280 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17557 pub struct Pll1fracen(pub u8); 15281 pub struct Sdmmcsel(pub u8);
17558 impl Pll1fracen { 15282 impl Sdmmcsel {
17559 #[doc = "Reset latch to tranfer FRACN to the Sigma-Delta modulator"] 15283 #[doc = "pll1_q selected as peripheral clock"]
17560 pub const RESET: Self = Self(0); 15284 pub const PLL1_Q: Self = Self(0);
17561 #[doc = "Set latch to tranfer FRACN to the Sigma-Delta modulator"] 15285 #[doc = "pll2_r selected as peripheral clock"]
17562 pub const SET: Self = Self(0x01); 15286 pub const PLL2_R: Self = Self(0x01);
17563 } 15287 }
17564 #[repr(transparent)] 15288 #[repr(transparent)]
17565 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15289 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17566 pub struct C1Ahb2enrDcmien(pub u8); 15290 pub struct D1ppre(pub u8);
17567 impl C1Ahb2enrDcmien { 15291 impl D1ppre {
17568 #[doc = "The selected clock is disabled"] 15292 #[doc = "rcc_hclk not divided"]
17569 pub const DISABLED: Self = Self(0); 15293 pub const DIV1: Self = Self(0);
17570 #[doc = "The selected clock is enabled"] 15294 #[doc = "rcc_hclk divided by 2"]
17571 pub const ENABLED: Self = Self(0x01); 15295 pub const DIV2: Self = Self(0x04);
15296 #[doc = "rcc_hclk divided by 4"]
15297 pub const DIV4: Self = Self(0x05);
15298 #[doc = "rcc_hclk divided by 8"]
15299 pub const DIV8: Self = Self(0x06);
15300 #[doc = "rcc_hclk divided by 16"]
15301 pub const DIV16: Self = Self(0x07);
17572 } 15302 }
17573 #[repr(transparent)] 15303 #[repr(transparent)]
17574 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15304 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17575 pub struct C1Ahb1lpenrDma1lpen(pub u8); 15305 pub struct Apb4lpenrSyscfglpen(pub u8);
17576 impl C1Ahb1lpenrDma1lpen { 15306 impl Apb4lpenrSyscfglpen {
17577 #[doc = "The selected clock is disabled during csleep mode"] 15307 #[doc = "The selected clock is disabled during csleep mode"]
17578 pub const DISABLED: Self = Self(0); 15308 pub const DISABLED: Self = Self(0);
17579 #[doc = "The selected clock is enabled during csleep mode"] 15309 #[doc = "The selected clock is enabled during csleep mode"]
@@ -17597,3462 +15327,1948 @@ pub mod rcc_h7 {
17597 #[doc = "The selected clock is enabled during csleep mode"] 15327 #[doc = "The selected clock is enabled during csleep mode"]
17598 pub const ENABLED: Self = Self(0x01); 15328 pub const ENABLED: Self = Self(0x01);
17599 } 15329 }
17600 }
17601}
17602pub mod timer_v1 {
17603 use crate::generic::*;
17604 #[doc = "Basic timer"]
17605 #[derive(Copy, Clone)]
17606 pub struct TimBasic(pub *mut u8);
17607 unsafe impl Send for TimBasic {}
17608 unsafe impl Sync for TimBasic {}
17609 impl TimBasic {
17610 #[doc = "control register 1"]
17611 pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> {
17612 unsafe { Reg::from_ptr(self.0.add(0usize)) }
17613 }
17614 #[doc = "control register 2"]
17615 pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> {
17616 unsafe { Reg::from_ptr(self.0.add(4usize)) }
17617 }
17618 #[doc = "DMA/Interrupt enable register"]
17619 pub fn dier(self) -> Reg<regs::DierBasic, RW> {
17620 unsafe { Reg::from_ptr(self.0.add(12usize)) }
17621 }
17622 #[doc = "status register"]
17623 pub fn sr(self) -> Reg<regs::SrBasic, RW> {
17624 unsafe { Reg::from_ptr(self.0.add(16usize)) }
17625 }
17626 #[doc = "event generation register"]
17627 pub fn egr(self) -> Reg<regs::EgrBasic, W> {
17628 unsafe { Reg::from_ptr(self.0.add(20usize)) }
17629 }
17630 #[doc = "counter"]
17631 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
17632 unsafe { Reg::from_ptr(self.0.add(36usize)) }
17633 }
17634 #[doc = "prescaler"]
17635 pub fn psc(self) -> Reg<regs::Psc, RW> {
17636 unsafe { Reg::from_ptr(self.0.add(40usize)) }
17637 }
17638 #[doc = "auto-reload register"]
17639 pub fn arr(self) -> Reg<regs::Arr16, RW> {
17640 unsafe { Reg::from_ptr(self.0.add(44usize)) }
17641 }
17642 }
17643 #[doc = "General purpose 32-bit timer"]
17644 #[derive(Copy, Clone)]
17645 pub struct TimGp32(pub *mut u8);
17646 unsafe impl Send for TimGp32 {}
17647 unsafe impl Sync for TimGp32 {}
17648 impl TimGp32 {
17649 #[doc = "control register 1"]
17650 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
17651 unsafe { Reg::from_ptr(self.0.add(0usize)) }
17652 }
17653 #[doc = "control register 2"]
17654 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
17655 unsafe { Reg::from_ptr(self.0.add(4usize)) }
17656 }
17657 #[doc = "slave mode control register"]
17658 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
17659 unsafe { Reg::from_ptr(self.0.add(8usize)) }
17660 }
17661 #[doc = "DMA/Interrupt enable register"]
17662 pub fn dier(self) -> Reg<regs::DierGp, RW> {
17663 unsafe { Reg::from_ptr(self.0.add(12usize)) }
17664 }
17665 #[doc = "status register"]
17666 pub fn sr(self) -> Reg<regs::SrGp, RW> {
17667 unsafe { Reg::from_ptr(self.0.add(16usize)) }
17668 }
17669 #[doc = "event generation register"]
17670 pub fn egr(self) -> Reg<regs::EgrGp, W> {
17671 unsafe { Reg::from_ptr(self.0.add(20usize)) }
17672 }
17673 #[doc = "capture/compare mode register 1 (input mode)"]
17674 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
17675 assert!(n < 2usize);
17676 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
17677 }
17678 #[doc = "capture/compare mode register 1 (output mode)"]
17679 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
17680 assert!(n < 2usize);
17681 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
17682 }
17683 #[doc = "capture/compare enable register"]
17684 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
17685 unsafe { Reg::from_ptr(self.0.add(32usize)) }
17686 }
17687 #[doc = "counter"]
17688 pub fn cnt(self) -> Reg<regs::Cnt32, RW> {
17689 unsafe { Reg::from_ptr(self.0.add(36usize)) }
17690 }
17691 #[doc = "prescaler"]
17692 pub fn psc(self) -> Reg<regs::Psc, RW> {
17693 unsafe { Reg::from_ptr(self.0.add(40usize)) }
17694 }
17695 #[doc = "auto-reload register"]
17696 pub fn arr(self) -> Reg<regs::Arr32, RW> {
17697 unsafe { Reg::from_ptr(self.0.add(44usize)) }
17698 }
17699 #[doc = "capture/compare register"]
17700 pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> {
17701 assert!(n < 4usize);
17702 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
17703 }
17704 #[doc = "DMA control register"]
17705 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
17706 unsafe { Reg::from_ptr(self.0.add(72usize)) }
17707 }
17708 #[doc = "DMA address for full transfer"]
17709 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
17710 unsafe { Reg::from_ptr(self.0.add(76usize)) }
17711 }
17712 }
17713 #[doc = "Advanced-timers"]
17714 #[derive(Copy, Clone)]
17715 pub struct TimAdv(pub *mut u8);
17716 unsafe impl Send for TimAdv {}
17717 unsafe impl Sync for TimAdv {}
17718 impl TimAdv {
17719 #[doc = "control register 1"]
17720 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
17721 unsafe { Reg::from_ptr(self.0.add(0usize)) }
17722 }
17723 #[doc = "control register 2"]
17724 pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> {
17725 unsafe { Reg::from_ptr(self.0.add(4usize)) }
17726 }
17727 #[doc = "slave mode control register"]
17728 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
17729 unsafe { Reg::from_ptr(self.0.add(8usize)) }
17730 }
17731 #[doc = "DMA/Interrupt enable register"]
17732 pub fn dier(self) -> Reg<regs::DierAdv, RW> {
17733 unsafe { Reg::from_ptr(self.0.add(12usize)) }
17734 }
17735 #[doc = "status register"]
17736 pub fn sr(self) -> Reg<regs::SrAdv, RW> {
17737 unsafe { Reg::from_ptr(self.0.add(16usize)) }
17738 }
17739 #[doc = "event generation register"]
17740 pub fn egr(self) -> Reg<regs::EgrAdv, W> {
17741 unsafe { Reg::from_ptr(self.0.add(20usize)) }
17742 }
17743 #[doc = "capture/compare mode register 1 (input mode)"]
17744 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
17745 assert!(n < 2usize);
17746 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
17747 }
17748 #[doc = "capture/compare mode register 1 (output mode)"]
17749 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
17750 assert!(n < 2usize);
17751 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
17752 }
17753 #[doc = "capture/compare enable register"]
17754 pub fn ccer(self) -> Reg<regs::CcerAdv, RW> {
17755 unsafe { Reg::from_ptr(self.0.add(32usize)) }
17756 }
17757 #[doc = "counter"]
17758 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
17759 unsafe { Reg::from_ptr(self.0.add(36usize)) }
17760 }
17761 #[doc = "prescaler"]
17762 pub fn psc(self) -> Reg<regs::Psc, RW> {
17763 unsafe { Reg::from_ptr(self.0.add(40usize)) }
17764 }
17765 #[doc = "auto-reload register"]
17766 pub fn arr(self) -> Reg<regs::Arr16, RW> {
17767 unsafe { Reg::from_ptr(self.0.add(44usize)) }
17768 }
17769 #[doc = "repetition counter register"]
17770 pub fn rcr(self) -> Reg<regs::Rcr, RW> {
17771 unsafe { Reg::from_ptr(self.0.add(48usize)) }
17772 }
17773 #[doc = "capture/compare register"]
17774 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
17775 assert!(n < 4usize);
17776 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
17777 }
17778 #[doc = "break and dead-time register"]
17779 pub fn bdtr(self) -> Reg<regs::Bdtr, RW> {
17780 unsafe { Reg::from_ptr(self.0.add(68usize)) }
17781 }
17782 #[doc = "DMA control register"]
17783 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
17784 unsafe { Reg::from_ptr(self.0.add(72usize)) }
17785 }
17786 #[doc = "DMA address for full transfer"]
17787 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
17788 unsafe { Reg::from_ptr(self.0.add(76usize)) }
17789 }
17790 }
17791 #[doc = "General purpose 16-bit timer"]
17792 #[derive(Copy, Clone)]
17793 pub struct TimGp16(pub *mut u8);
17794 unsafe impl Send for TimGp16 {}
17795 unsafe impl Sync for TimGp16 {}
17796 impl TimGp16 {
17797 #[doc = "control register 1"]
17798 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
17799 unsafe { Reg::from_ptr(self.0.add(0usize)) }
17800 }
17801 #[doc = "control register 2"]
17802 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
17803 unsafe { Reg::from_ptr(self.0.add(4usize)) }
17804 }
17805 #[doc = "slave mode control register"]
17806 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
17807 unsafe { Reg::from_ptr(self.0.add(8usize)) }
17808 }
17809 #[doc = "DMA/Interrupt enable register"]
17810 pub fn dier(self) -> Reg<regs::DierGp, RW> {
17811 unsafe { Reg::from_ptr(self.0.add(12usize)) }
17812 }
17813 #[doc = "status register"]
17814 pub fn sr(self) -> Reg<regs::SrGp, RW> {
17815 unsafe { Reg::from_ptr(self.0.add(16usize)) }
17816 }
17817 #[doc = "event generation register"]
17818 pub fn egr(self) -> Reg<regs::EgrGp, W> {
17819 unsafe { Reg::from_ptr(self.0.add(20usize)) }
17820 }
17821 #[doc = "capture/compare mode register 1 (input mode)"]
17822 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
17823 assert!(n < 2usize);
17824 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
17825 }
17826 #[doc = "capture/compare mode register 1 (output mode)"]
17827 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
17828 assert!(n < 2usize);
17829 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
17830 }
17831 #[doc = "capture/compare enable register"]
17832 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
17833 unsafe { Reg::from_ptr(self.0.add(32usize)) }
17834 }
17835 #[doc = "counter"]
17836 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
17837 unsafe { Reg::from_ptr(self.0.add(36usize)) }
17838 }
17839 #[doc = "prescaler"]
17840 pub fn psc(self) -> Reg<regs::Psc, RW> {
17841 unsafe { Reg::from_ptr(self.0.add(40usize)) }
17842 }
17843 #[doc = "auto-reload register"]
17844 pub fn arr(self) -> Reg<regs::Arr16, RW> {
17845 unsafe { Reg::from_ptr(self.0.add(44usize)) }
17846 }
17847 #[doc = "capture/compare register"]
17848 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
17849 assert!(n < 4usize);
17850 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
17851 }
17852 #[doc = "DMA control register"]
17853 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
17854 unsafe { Reg::from_ptr(self.0.add(72usize)) }
17855 }
17856 #[doc = "DMA address for full transfer"]
17857 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
17858 unsafe { Reg::from_ptr(self.0.add(76usize)) }
17859 }
17860 }
17861 pub mod vals {
17862 use crate::generic::*;
17863 #[repr(transparent)] 15330 #[repr(transparent)]
17864 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15331 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17865 pub struct Urs(pub u8); 15332 pub struct Lserdyr(pub u8);
17866 impl Urs { 15333 impl Lserdyr {
17867 #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"] 15334 #[doc = "LSE oscillator not ready"]
17868 pub const ANYEVENT: Self = Self(0); 15335 pub const NOTREADY: Self = Self(0);
17869 #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"] 15336 #[doc = "LSE oscillator ready"]
17870 pub const COUNTERONLY: Self = Self(0x01); 15337 pub const READY: Self = Self(0x01);
17871 } 15338 }
17872 #[repr(transparent)] 15339 #[repr(transparent)]
17873 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15340 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17874 pub struct CcmrOutputCcs(pub u8); 15341 pub struct Syscfgrst(pub u8);
17875 impl CcmrOutputCcs { 15342 impl Syscfgrst {
17876 #[doc = "CCx channel is configured as output"] 15343 #[doc = "Reset the selected module"]
17877 pub const OUTPUT: Self = Self(0); 15344 pub const RESET: Self = Self(0x01);
17878 } 15345 }
17879 #[repr(transparent)] 15346 #[repr(transparent)]
17880 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15347 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17881 pub struct Msm(pub u8); 15348 pub struct Lsirdyr(pub u8);
17882 impl Msm { 15349 impl Lsirdyr {
17883 #[doc = "No action"] 15350 #[doc = "LSI oscillator not ready"]
17884 pub const NOSYNC: Self = Self(0); 15351 pub const NOTREADY: Self = Self(0);
17885 #[doc = "The effect of an event on the trigger input (TRGI) is delayed to allow a perfect synchronization between the current timer and its slaves (through TRGO). It is useful if we want to synchronize several timers on a single external event."] 15352 #[doc = "LSI oscillator ready"]
17886 pub const SYNC: Self = Self(0x01); 15353 pub const READY: Self = Self(0x01);
17887 } 15354 }
17888 #[repr(transparent)] 15355 #[repr(transparent)]
17889 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15356 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17890 pub struct Ocm(pub u8); 15357 pub struct Dma1rst(pub u8);
17891 impl Ocm { 15358 impl Dma1rst {
17892 #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"] 15359 #[doc = "Reset the selected module"]
17893 pub const FROZEN: Self = Self(0); 15360 pub const RESET: Self = Self(0x01);
17894 #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"]
17895 pub const ACTIVEONMATCH: Self = Self(0x01);
17896 #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"]
17897 pub const INACTIVEONMATCH: Self = Self(0x02);
17898 #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"]
17899 pub const TOGGLE: Self = Self(0x03);
17900 #[doc = "OCyREF is forced low"]
17901 pub const FORCEINACTIVE: Self = Self(0x04);
17902 #[doc = "OCyREF is forced high"]
17903 pub const FORCEACTIVE: Self = Self(0x05);
17904 #[doc = "In upcounting, channel is active as long as TIMx_CNT<TIMx_CCRy else inactive. In downcounting, channel is inactive as long as TIMx_CNT>TIMx_CCRy else active"]
17905 pub const PWMMODE1: Self = Self(0x06);
17906 #[doc = "Inversely to PwmMode1"]
17907 pub const PWMMODE2: Self = Self(0x07);
17908 } 15361 }
17909 #[repr(transparent)] 15362 #[repr(transparent)]
17910 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15363 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17911 pub struct Ocpe(pub u8); 15364 pub struct Camitfrst(pub u8);
17912 impl Ocpe { 15365 impl Camitfrst {
17913 #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"] 15366 #[doc = "Reset the selected module"]
17914 pub const DISABLED: Self = Self(0); 15367 pub const RESET: Self = Self(0x01);
17915 #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"]
17916 pub const ENABLED: Self = Self(0x01);
17917 } 15368 }
17918 #[repr(transparent)] 15369 #[repr(transparent)]
17919 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15370 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17920 pub struct Arpe(pub u8); 15371 pub struct C1Apb1llpenrTim2lpen(pub u8);
17921 impl Arpe { 15372 impl C1Apb1llpenrTim2lpen {
17922 #[doc = "TIMx_APRR register is not buffered"] 15373 #[doc = "The selected clock is disabled during csleep mode"]
17923 pub const DISABLED: Self = Self(0); 15374 pub const DISABLED: Self = Self(0);
17924 #[doc = "TIMx_APRR register is buffered"] 15375 #[doc = "The selected clock is enabled during csleep mode"]
17925 pub const ENABLED: Self = Self(0x01); 15376 pub const ENABLED: Self = Self(0x01);
17926 } 15377 }
17927 #[repr(transparent)] 15378 #[repr(transparent)]
17928 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15379 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17929 pub struct Ossr(pub u8); 15380 pub struct Crsrst(pub u8);
17930 impl Ossr { 15381 impl Crsrst {
17931 #[doc = "When inactive, OC/OCN outputs are disabled"] 15382 #[doc = "Reset the selected module"]
17932 pub const DISABLED: Self = Self(0); 15383 pub const RESET: Self = Self(0x01);
17933 #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"]
17934 pub const IDLELEVEL: Self = Self(0x01);
17935 }
17936 #[repr(transparent)]
17937 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17938 pub struct Etp(pub u8);
17939 impl Etp {
17940 #[doc = "ETR is noninverted, active at high level or rising edge"]
17941 pub const NOTINVERTED: Self = Self(0);
17942 #[doc = "ETR is inverted, active at low level or falling edge"]
17943 pub const INVERTED: Self = Self(0x01);
17944 } 15384 }
17945 #[repr(transparent)] 15385 #[repr(transparent)]
17946 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15386 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17947 pub struct Ece(pub u8); 15387 pub struct Lseon(pub u8);
17948 impl Ece { 15388 impl Lseon {
17949 #[doc = "External clock mode 2 disabled"] 15389 #[doc = "LSE oscillator Off"]
17950 pub const DISABLED: Self = Self(0); 15390 pub const OFF: Self = Self(0);
17951 #[doc = "External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal."] 15391 #[doc = "LSE oscillator On"]
17952 pub const ENABLED: Self = Self(0x01); 15392 pub const ON: Self = Self(0x01);
17953 } 15393 }
17954 #[repr(transparent)] 15394 #[repr(transparent)]
17955 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15395 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17956 pub struct Sms(pub u8); 15396 pub struct RsrCpurstfr(pub u8);
17957 impl Sms { 15397 impl RsrCpurstfr {
17958 #[doc = "Slave mode disabled - if CEN = ‘1 then the prescaler is clocked directly by the internal clock."] 15398 #[doc = "No reset occoured for block"]
17959 pub const DISABLED: Self = Self(0); 15399 pub const NORESETOCCOURED: Self = Self(0);
17960 #[doc = "Encoder mode 1 - Counter counts up/down on TI2FP1 edge depending on TI1FP2 level."] 15400 #[doc = "Reset occoured for block"]
17961 pub const ENCODER_MODE_1: Self = Self(0x01); 15401 pub const RESETOCCOURRED: Self = Self(0x01);
17962 #[doc = "Encoder mode 2 - Counter counts up/down on TI1FP2 edge depending on TI2FP1 level."]
17963 pub const ENCODER_MODE_2: Self = Self(0x02);
17964 #[doc = "Encoder mode 3 - Counter counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input."]
17965 pub const ENCODER_MODE_3: Self = Self(0x03);
17966 #[doc = "Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers."]
17967 pub const RESET_MODE: Self = Self(0x04);
17968 #[doc = "Gated Mode - The counter clock is enabled when the trigger input (TRGI) is high. The counter stops (but is not reset) as soon as the trigger becomes low. Both start and stop of the counter are controlled."]
17969 pub const GATED_MODE: Self = Self(0x05);
17970 #[doc = "Trigger Mode - The counter starts at a rising edge of the trigger TRGI (but it is not reset). Only the start of the counter is controlled."]
17971 pub const TRIGGER_MODE: Self = Self(0x06);
17972 #[doc = "External Clock Mode 1 - Rising edges of the selected trigger (TRGI) clock the counter."]
17973 pub const EXT_CLOCK_MODE: Self = Self(0x07);
17974 } 15402 }
17975 #[repr(transparent)] 15403 #[repr(transparent)]
17976 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15404 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17977 pub struct Ossi(pub u8); 15405 pub struct Tim2rst(pub u8);
17978 impl Ossi { 15406 impl Tim2rst {
17979 #[doc = "When inactive, OC/OCN outputs are disabled"] 15407 #[doc = "Reset the selected module"]
17980 pub const DISABLED: Self = Self(0); 15408 pub const RESET: Self = Self(0x01);
17981 #[doc = "When inactive, OC/OCN outputs are forced to idle level"]
17982 pub const IDLELEVEL: Self = Self(0x01);
17983 } 15409 }
17984 #[repr(transparent)] 15410 #[repr(transparent)]
17985 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15411 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17986 pub struct Ts(pub u8); 15412 pub struct Rtcsel(pub u8);
17987 impl Ts { 15413 impl Rtcsel {
17988 #[doc = "Internal Trigger 0 (ITR0)"] 15414 #[doc = "No clock"]
17989 pub const ITR0: Self = Self(0); 15415 pub const NOCLOCK: Self = Self(0);
17990 #[doc = "Internal Trigger 1 (ITR1)"] 15416 #[doc = "LSE oscillator clock used as RTC clock"]
17991 pub const ITR1: Self = Self(0x01); 15417 pub const LSE: Self = Self(0x01);
17992 #[doc = "Internal Trigger 2 (ITR2)"] 15418 #[doc = "LSI oscillator clock used as RTC clock"]
17993 pub const ITR2: Self = Self(0x02); 15419 pub const LSI: Self = Self(0x02);
17994 #[doc = "TI1 Edge Detector (TI1F_ED)"] 15420 #[doc = "HSE oscillator clock divided by a prescaler used as RTC clock"]
17995 pub const TI1F_ED: Self = Self(0x04); 15421 pub const HSE: Self = Self(0x03);
17996 #[doc = "Filtered Timer Input 1 (TI1FP1)"]
17997 pub const TI1FP1: Self = Self(0x05);
17998 #[doc = "Filtered Timer Input 2 (TI2FP2)"]
17999 pub const TI2FP2: Self = Self(0x06);
18000 #[doc = "External Trigger input (ETRF)"]
18001 pub const ETRF: Self = Self(0x07);
18002 } 15422 }
18003 #[repr(transparent)] 15423 #[repr(transparent)]
18004 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15424 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18005 pub struct Opm(pub u8); 15425 pub struct C1Apb4enrSyscfgen(pub u8);
18006 impl Opm { 15426 impl C1Apb4enrSyscfgen {
18007 #[doc = "Counter is not stopped at update event"] 15427 #[doc = "The selected clock is disabled"]
18008 pub const DISABLED: Self = Self(0); 15428 pub const DISABLED: Self = Self(0);
18009 #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"] 15429 #[doc = "The selected clock is enabled"]
18010 pub const ENABLED: Self = Self(0x01); 15430 pub const ENABLED: Self = Self(0x01);
18011 } 15431 }
18012 #[repr(transparent)] 15432 #[repr(transparent)]
18013 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15433 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18014 pub struct Etps(pub u8); 15434 pub struct Tim1rst(pub u8);
18015 impl Etps { 15435 impl Tim1rst {
18016 #[doc = "Prescaler OFF"] 15436 #[doc = "Reset the selected module"]
18017 pub const DIV1: Self = Self(0); 15437 pub const RESET: Self = Self(0x01);
18018 #[doc = "ETRP frequency divided by 2"]
18019 pub const DIV2: Self = Self(0x01);
18020 #[doc = "ETRP frequency divided by 4"]
18021 pub const DIV4: Self = Self(0x02);
18022 #[doc = "ETRP frequency divided by 8"]
18023 pub const DIV8: Self = Self(0x03);
18024 } 15438 }
18025 #[repr(transparent)] 15439 #[repr(transparent)]
18026 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15440 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18027 pub struct Tis(pub u8); 15441 pub struct Usart234578sel(pub u8);
18028 impl Tis { 15442 impl Usart234578sel {
18029 #[doc = "The TIMx_CH1 pin is connected to TI1 input"] 15443 #[doc = "rcc_pclk1 selected as peripheral clock"]
18030 pub const NORMAL: Self = Self(0); 15444 pub const RCC_PCLK1: Self = Self(0);
18031 #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"] 15445 #[doc = "pll2_q selected as peripheral clock"]
18032 pub const XOR: Self = Self(0x01); 15446 pub const PLL2_Q: Self = Self(0x01);
15447 #[doc = "pll3_q selected as peripheral clock"]
15448 pub const PLL3_Q: Self = Self(0x02);
15449 #[doc = "hsi_ker selected as peripheral clock"]
15450 pub const HSI_KER: Self = Self(0x03);
15451 #[doc = "csi_ker selected as peripheral clock"]
15452 pub const CSI_KER: Self = Self(0x04);
15453 #[doc = "LSE selected as peripheral clock"]
15454 pub const LSE: Self = Self(0x05);
18033 } 15455 }
18034 #[repr(transparent)] 15456 #[repr(transparent)]
18035 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15457 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18036 pub struct Etf(pub u8); 15458 pub struct Hrtimsel(pub u8);
18037 impl Etf { 15459 impl Hrtimsel {
18038 #[doc = "No filter, sampling is done at fDTS"] 15460 #[doc = "The HRTIM prescaler clock source is the same as other timers (rcc_timy_ker_ck)"]
18039 pub const NOFILTER: Self = Self(0); 15461 pub const TIMY_KER: Self = Self(0);
18040 #[doc = "fSAMPLING=fCK_INT, N=2"] 15462 #[doc = "The HRTIM prescaler clock source is the CPU clock (c_ck)"]
18041 pub const FCK_INT_N2: Self = Self(0x01); 15463 pub const C_CK: Self = Self(0x01);
18042 #[doc = "fSAMPLING=fCK_INT, N=4"]
18043 pub const FCK_INT_N4: Self = Self(0x02);
18044 #[doc = "fSAMPLING=fCK_INT, N=8"]
18045 pub const FCK_INT_N8: Self = Self(0x03);
18046 #[doc = "fSAMPLING=fDTS/2, N=6"]
18047 pub const FDTS_DIV2_N6: Self = Self(0x04);
18048 #[doc = "fSAMPLING=fDTS/2, N=8"]
18049 pub const FDTS_DIV2_N8: Self = Self(0x05);
18050 #[doc = "fSAMPLING=fDTS/4, N=6"]
18051 pub const FDTS_DIV4_N6: Self = Self(0x06);
18052 #[doc = "fSAMPLING=fDTS/4, N=8"]
18053 pub const FDTS_DIV4_N8: Self = Self(0x07);
18054 #[doc = "fSAMPLING=fDTS/8, N=6"]
18055 pub const FDTS_DIV8_N6: Self = Self(0x08);
18056 #[doc = "fSAMPLING=fDTS/8, N=8"]
18057 pub const FDTS_DIV8_N8: Self = Self(0x09);
18058 #[doc = "fSAMPLING=fDTS/16, N=5"]
18059 pub const FDTS_DIV16_N5: Self = Self(0x0a);
18060 #[doc = "fSAMPLING=fDTS/16, N=6"]
18061 pub const FDTS_DIV16_N6: Self = Self(0x0b);
18062 #[doc = "fSAMPLING=fDTS/16, N=8"]
18063 pub const FDTS_DIV16_N8: Self = Self(0x0c);
18064 #[doc = "fSAMPLING=fDTS/32, N=5"]
18065 pub const FDTS_DIV32_N5: Self = Self(0x0d);
18066 #[doc = "fSAMPLING=fDTS/32, N=6"]
18067 pub const FDTS_DIV32_N6: Self = Self(0x0e);
18068 #[doc = "fSAMPLING=fDTS/32, N=8"]
18069 pub const FDTS_DIV32_N8: Self = Self(0x0f);
18070 } 15464 }
18071 #[repr(transparent)] 15465 #[repr(transparent)]
18072 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15466 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18073 pub struct Mms(pub u8); 15467 pub struct Ww1rsc(pub u8);
18074 impl Mms { 15468 impl Ww1rsc {
18075 #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"] 15469 #[doc = "Clear WWDG1 scope control"]
18076 pub const RESET: Self = Self(0); 15470 pub const CLEAR: Self = Self(0);
18077 #[doc = "The counter enable signal, CNT_EN, is used as trigger output"] 15471 #[doc = "Set WWDG1 scope control"]
18078 pub const ENABLE: Self = Self(0x01); 15472 pub const SET: Self = Self(0x01);
18079 #[doc = "The update event is selected as trigger output"]
18080 pub const UPDATE: Self = Self(0x02);
18081 #[doc = "The trigger output send a positive pulse when the CC1IF flag it to be set, as soon as a capture or a compare match occurred"]
18082 pub const COMPAREPULSE: Self = Self(0x03);
18083 #[doc = "OC1REF signal is used as trigger output"]
18084 pub const COMPAREOC1: Self = Self(0x04);
18085 #[doc = "OC2REF signal is used as trigger output"]
18086 pub const COMPAREOC2: Self = Self(0x05);
18087 #[doc = "OC3REF signal is used as trigger output"]
18088 pub const COMPAREOC3: Self = Self(0x06);
18089 #[doc = "OC4REF signal is used as trigger output"]
18090 pub const COMPAREOC4: Self = Self(0x07);
18091 } 15473 }
18092 #[repr(transparent)] 15474 #[repr(transparent)]
18093 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15475 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18094 pub struct CcmrInputCcs(pub u8); 15476 pub struct Hpre(pub u8);
18095 impl CcmrInputCcs { 15477 impl Hpre {
18096 #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"] 15478 #[doc = "sys_ck not divided"]
18097 pub const TI4: Self = Self(0x01); 15479 pub const DIV1: Self = Self(0);
18098 #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"] 15480 #[doc = "sys_ck divided by 2"]
18099 pub const TI3: Self = Self(0x02); 15481 pub const DIV2: Self = Self(0x08);
18100 #[doc = "CCx channel is configured as input, ICx is mapped on TRC"] 15482 #[doc = "sys_ck divided by 4"]
18101 pub const TRC: Self = Self(0x03); 15483 pub const DIV4: Self = Self(0x09);
15484 #[doc = "sys_ck divided by 8"]
15485 pub const DIV8: Self = Self(0x0a);
15486 #[doc = "sys_ck divided by 16"]
15487 pub const DIV16: Self = Self(0x0b);
15488 #[doc = "sys_ck divided by 64"]
15489 pub const DIV64: Self = Self(0x0c);
15490 #[doc = "sys_ck divided by 128"]
15491 pub const DIV128: Self = Self(0x0d);
15492 #[doc = "sys_ck divided by 256"]
15493 pub const DIV256: Self = Self(0x0e);
15494 #[doc = "sys_ck divided by 512"]
15495 pub const DIV512: Self = Self(0x0f);
18102 } 15496 }
18103 #[repr(transparent)] 15497 #[repr(transparent)]
18104 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15498 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
18105 pub struct Icf(pub u8); 15499 pub struct Lsirdyc(pub u8);
18106 impl Icf { 15500 impl Lsirdyc {
18107 #[doc = "No filter, sampling is done at fDTS"] 15501 #[doc = "Clear interrupt flag"]
18108 pub const NOFILTER: Self = Self(0); 15502 pub const CLEAR: Self = Self(0x01);
18109 #[doc = "fSAMPLING=fCK_INT, N=2"]
18110 pub const FCK_INT_N2: Self = Self(0x01);
18111 #[doc = "fSAMPLING=fCK_INT, N=4"]
18112 pub const FCK_INT_N4: Self = Self(0x02);
18113 #[doc = "fSAMPLING=fCK_INT, N=8"]
18114 pub const FCK_INT_N8: Self = Self(0x03);
18115 #[doc = "fSAMPLING=fDTS/2, N=6"]
18116 pub const FDTS_DIV2_N6: Self = Self(0x04);
18117 #[doc = "fSAMPLING=fDTS/2, N=8"]
18118 pub const FDTS_DIV2_N8: Self = Self(0x05);
18119 #[doc = "fSAMPLING=fDTS/4, N=6"]
18120 pub const FDTS_DIV4_N6: Self = Self(0x06);
18121 #[doc = "fSAMPLING=fDTS/4, N=8"]
18122 pub const FDTS_DIV4_N8: Self = Self(0x07);
18123 #[doc = "fSAMPLING=fDTS/8, N=6"]
18124 pub const FDTS_DIV8_N6: Self = Self(0x08);
18125 #[doc = "fSAMPLING=fDTS/8, N=8"]
18126 pub const FDTS_DIV8_N8: Self = Self(0x09);
18127 #[doc = "fSAMPLING=fDTS/16, N=5"]
18128 pub const FDTS_DIV16_N5: Self = Self(0x0a);
18129 #[doc = "fSAMPLING=fDTS/16, N=6"]
18130 pub const FDTS_DIV16_N6: Self = Self(0x0b);
18131 #[doc = "fSAMPLING=fDTS/16, N=8"]
18132 pub const FDTS_DIV16_N8: Self = Self(0x0c);
18133 #[doc = "fSAMPLING=fDTS/32, N=5"]
18134 pub const FDTS_DIV32_N5: Self = Self(0x0d);
18135 #[doc = "fSAMPLING=fDTS/32, N=6"]
18136 pub const FDTS_DIV32_N6: Self = Self(0x0e);
18137 #[doc = "fSAMPLING=fDTS/32, N=8"]
18138 pub const FDTS_DIV32_N8: Self = Self(0x0f);
18139 } 15503 }
18140 #[repr(transparent)] 15504 }
18141 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15505}
18142 pub struct Dir(pub u8); 15506pub mod usart_v1 {
18143 impl Dir { 15507 use crate::generic::*;
18144 #[doc = "Counter used as upcounter"] 15508 #[doc = "Universal asynchronous receiver transmitter"]
18145 pub const UP: Self = Self(0); 15509 #[derive(Copy, Clone)]
18146 #[doc = "Counter used as downcounter"] 15510 pub struct Uart(pub *mut u8);
18147 pub const DOWN: Self = Self(0x01); 15511 unsafe impl Send for Uart {}
15512 unsafe impl Sync for Uart {}
15513 impl Uart {
15514 #[doc = "Status register"]
15515 pub fn sr(self) -> Reg<regs::Sr, RW> {
15516 unsafe { Reg::from_ptr(self.0.add(0usize)) }
18148 } 15517 }
18149 #[repr(transparent)] 15518 #[doc = "Data register"]
18150 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15519 pub fn dr(self) -> Reg<regs::Dr, RW> {
18151 pub struct Ccds(pub u8); 15520 unsafe { Reg::from_ptr(self.0.add(4usize)) }
18152 impl Ccds {
18153 #[doc = "CCx DMA request sent when CCx event occurs"]
18154 pub const ONCOMPARE: Self = Self(0);
18155 #[doc = "CCx DMA request sent when update event occurs"]
18156 pub const ONUPDATE: Self = Self(0x01);
18157 } 15521 }
18158 #[repr(transparent)] 15522 #[doc = "Baud rate register"]
18159 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15523 pub fn brr(self) -> Reg<regs::Brr, RW> {
18160 pub struct Cms(pub u8); 15524 unsafe { Reg::from_ptr(self.0.add(8usize)) }
18161 impl Cms {
18162 #[doc = "The counter counts up or down depending on the direction bit"]
18163 pub const EDGEALIGNED: Self = Self(0);
18164 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting down."]
18165 pub const CENTERALIGNED1: Self = Self(0x01);
18166 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting up."]
18167 pub const CENTERALIGNED2: Self = Self(0x02);
18168 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set both when the counter is counting up or down."]
18169 pub const CENTERALIGNED3: Self = Self(0x03);
18170 } 15525 }
18171 #[repr(transparent)] 15526 #[doc = "Control register 1"]
18172 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 15527 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
18173 pub struct Ckd(pub u8); 15528 unsafe { Reg::from_ptr(self.0.add(12usize)) }
18174 impl Ckd { 15529 }
18175 #[doc = "t_DTS = t_CK_INT"] 15530 #[doc = "Control register 2"]
18176 pub const DIV1: Self = Self(0); 15531 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
18177 #[doc = "t_DTS = 2 × t_CK_INT"] 15532 unsafe { Reg::from_ptr(self.0.add(16usize)) }
18178 pub const DIV2: Self = Self(0x01); 15533 }
18179 #[doc = "t_DTS = 4 × t_CK_INT"] 15534 #[doc = "Control register 3"]
18180 pub const DIV4: Self = Self(0x02); 15535 pub fn cr3(self) -> Reg<regs::Cr3, RW> {
15536 unsafe { Reg::from_ptr(self.0.add(20usize)) }
18181 } 15537 }
18182 } 15538 }
18183 pub mod regs { 15539 #[doc = "Universal synchronous asynchronous receiver transmitter"]
18184 use crate::generic::*; 15540 #[derive(Copy, Clone)]
18185 #[doc = "capture/compare enable register"] 15541 pub struct Usart(pub *mut u8);
18186 #[repr(transparent)] 15542 unsafe impl Send for Usart {}
18187 #[derive(Copy, Clone, Eq, PartialEq)] 15543 unsafe impl Sync for Usart {}
18188 pub struct CcerGp(pub u32); 15544 impl Usart {
18189 impl CcerGp { 15545 #[doc = "Status register"]
18190 #[doc = "Capture/Compare 1 output enable"] 15546 pub fn sr(self) -> Reg<regs::Sr, RW> {
18191 pub fn cce(&self, n: usize) -> bool { 15547 unsafe { Reg::from_ptr(self.0.add(0usize)) }
18192 assert!(n < 4usize);
18193 let offs = 0usize + n * 4usize;
18194 let val = (self.0 >> offs) & 0x01;
18195 val != 0
18196 }
18197 #[doc = "Capture/Compare 1 output enable"]
18198 pub fn set_cce(&mut self, n: usize, val: bool) {
18199 assert!(n < 4usize);
18200 let offs = 0usize + n * 4usize;
18201 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18202 }
18203 #[doc = "Capture/Compare 1 output Polarity"]
18204 pub fn ccp(&self, n: usize) -> bool {
18205 assert!(n < 4usize);
18206 let offs = 1usize + n * 4usize;
18207 let val = (self.0 >> offs) & 0x01;
18208 val != 0
18209 }
18210 #[doc = "Capture/Compare 1 output Polarity"]
18211 pub fn set_ccp(&mut self, n: usize, val: bool) {
18212 assert!(n < 4usize);
18213 let offs = 1usize + n * 4usize;
18214 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18215 }
18216 #[doc = "Capture/Compare 1 output Polarity"]
18217 pub fn ccnp(&self, n: usize) -> bool {
18218 assert!(n < 4usize);
18219 let offs = 3usize + n * 4usize;
18220 let val = (self.0 >> offs) & 0x01;
18221 val != 0
18222 }
18223 #[doc = "Capture/Compare 1 output Polarity"]
18224 pub fn set_ccnp(&mut self, n: usize, val: bool) {
18225 assert!(n < 4usize);
18226 let offs = 3usize + n * 4usize;
18227 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18228 }
18229 } 15548 }
18230 impl Default for CcerGp { 15549 #[doc = "Data register"]
18231 fn default() -> CcerGp { 15550 pub fn dr(self) -> Reg<regs::Dr, RW> {
18232 CcerGp(0) 15551 unsafe { Reg::from_ptr(self.0.add(4usize)) }
18233 }
18234 } 15552 }
18235 #[doc = "status register"] 15553 #[doc = "Baud rate register"]
18236 #[repr(transparent)] 15554 pub fn brr(self) -> Reg<regs::Brr, RW> {
18237 #[derive(Copy, Clone, Eq, PartialEq)] 15555 unsafe { Reg::from_ptr(self.0.add(8usize)) }
18238 pub struct SrGp(pub u32);
18239 impl SrGp {
18240 #[doc = "Update interrupt flag"]
18241 pub const fn uif(&self) -> bool {
18242 let val = (self.0 >> 0usize) & 0x01;
18243 val != 0
18244 }
18245 #[doc = "Update interrupt flag"]
18246 pub fn set_uif(&mut self, val: bool) {
18247 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18248 }
18249 #[doc = "Capture/compare 1 interrupt flag"]
18250 pub fn ccif(&self, n: usize) -> bool {
18251 assert!(n < 4usize);
18252 let offs = 1usize + n * 1usize;
18253 let val = (self.0 >> offs) & 0x01;
18254 val != 0
18255 }
18256 #[doc = "Capture/compare 1 interrupt flag"]
18257 pub fn set_ccif(&mut self, n: usize, val: bool) {
18258 assert!(n < 4usize);
18259 let offs = 1usize + n * 1usize;
18260 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18261 }
18262 #[doc = "COM interrupt flag"]
18263 pub const fn comif(&self) -> bool {
18264 let val = (self.0 >> 5usize) & 0x01;
18265 val != 0
18266 }
18267 #[doc = "COM interrupt flag"]
18268 pub fn set_comif(&mut self, val: bool) {
18269 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
18270 }
18271 #[doc = "Trigger interrupt flag"]
18272 pub const fn tif(&self) -> bool {
18273 let val = (self.0 >> 6usize) & 0x01;
18274 val != 0
18275 }
18276 #[doc = "Trigger interrupt flag"]
18277 pub fn set_tif(&mut self, val: bool) {
18278 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
18279 }
18280 #[doc = "Break interrupt flag"]
18281 pub const fn bif(&self) -> bool {
18282 let val = (self.0 >> 7usize) & 0x01;
18283 val != 0
18284 }
18285 #[doc = "Break interrupt flag"]
18286 pub fn set_bif(&mut self, val: bool) {
18287 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
18288 }
18289 #[doc = "Capture/Compare 1 overcapture flag"]
18290 pub fn ccof(&self, n: usize) -> bool {
18291 assert!(n < 4usize);
18292 let offs = 9usize + n * 1usize;
18293 let val = (self.0 >> offs) & 0x01;
18294 val != 0
18295 }
18296 #[doc = "Capture/Compare 1 overcapture flag"]
18297 pub fn set_ccof(&mut self, n: usize, val: bool) {
18298 assert!(n < 4usize);
18299 let offs = 9usize + n * 1usize;
18300 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18301 }
18302 } 15556 }
18303 impl Default for SrGp { 15557 #[doc = "Control register 1"]
18304 fn default() -> SrGp { 15558 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
18305 SrGp(0) 15559 unsafe { Reg::from_ptr(self.0.add(12usize)) }
18306 }
18307 } 15560 }
18308 #[doc = "capture/compare register 1"] 15561 #[doc = "Control register 2"]
18309 #[repr(transparent)] 15562 pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> {
18310 #[derive(Copy, Clone, Eq, PartialEq)] 15563 unsafe { Reg::from_ptr(self.0.add(16usize)) }
18311 pub struct Ccr16(pub u32);
18312 impl Ccr16 {
18313 #[doc = "Capture/Compare 1 value"]
18314 pub const fn ccr(&self) -> u16 {
18315 let val = (self.0 >> 0usize) & 0xffff;
18316 val as u16
18317 }
18318 #[doc = "Capture/Compare 1 value"]
18319 pub fn set_ccr(&mut self, val: u16) {
18320 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
18321 }
18322 } 15564 }
18323 impl Default for Ccr16 { 15565 #[doc = "Control register 3"]
18324 fn default() -> Ccr16 { 15566 pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> {
18325 Ccr16(0) 15567 unsafe { Reg::from_ptr(self.0.add(20usize)) }
18326 }
18327 } 15568 }
18328 #[doc = "status register"] 15569 #[doc = "Guard time and prescaler register"]
15570 pub fn gtpr(self) -> Reg<regs::Gtpr, RW> {
15571 unsafe { Reg::from_ptr(self.0.add(24usize)) }
15572 }
15573 }
15574 pub mod regs {
15575 use crate::generic::*;
15576 #[doc = "Data register"]
18329 #[repr(transparent)] 15577 #[repr(transparent)]
18330 #[derive(Copy, Clone, Eq, PartialEq)] 15578 #[derive(Copy, Clone, Eq, PartialEq)]
18331 pub struct SrBasic(pub u32); 15579 pub struct Dr(pub u32);
18332 impl SrBasic { 15580 impl Dr {
18333 #[doc = "Update interrupt flag"] 15581 #[doc = "Data value"]
18334 pub const fn uif(&self) -> bool { 15582 pub const fn dr(&self) -> u16 {
18335 let val = (self.0 >> 0usize) & 0x01; 15583 let val = (self.0 >> 0usize) & 0x01ff;
18336 val != 0 15584 val as u16
18337 } 15585 }
18338 #[doc = "Update interrupt flag"] 15586 #[doc = "Data value"]
18339 pub fn set_uif(&mut self, val: bool) { 15587 pub fn set_dr(&mut self, val: u16) {
18340 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 15588 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
18341 } 15589 }
18342 } 15590 }
18343 impl Default for SrBasic { 15591 impl Default for Dr {
18344 fn default() -> SrBasic { 15592 fn default() -> Dr {
18345 SrBasic(0) 15593 Dr(0)
18346 } 15594 }
18347 } 15595 }
18348 #[doc = "control register 1"] 15596 #[doc = "Control register 3"]
18349 #[repr(transparent)] 15597 #[repr(transparent)]
18350 #[derive(Copy, Clone, Eq, PartialEq)] 15598 #[derive(Copy, Clone, Eq, PartialEq)]
18351 pub struct Cr1Gp(pub u32); 15599 pub struct Cr3(pub u32);
18352 impl Cr1Gp { 15600 impl Cr3 {
18353 #[doc = "Counter enable"] 15601 #[doc = "Error interrupt enable"]
18354 pub const fn cen(&self) -> bool { 15602 pub const fn eie(&self) -> bool {
18355 let val = (self.0 >> 0usize) & 0x01; 15603 let val = (self.0 >> 0usize) & 0x01;
18356 val != 0 15604 val != 0
18357 } 15605 }
18358 #[doc = "Counter enable"] 15606 #[doc = "Error interrupt enable"]
18359 pub fn set_cen(&mut self, val: bool) { 15607 pub fn set_eie(&mut self, val: bool) {
18360 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 15608 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18361 } 15609 }
18362 #[doc = "Update disable"] 15610 #[doc = "IrDA mode enable"]
18363 pub const fn udis(&self) -> bool { 15611 pub const fn iren(&self) -> bool {
18364 let val = (self.0 >> 1usize) & 0x01; 15612 let val = (self.0 >> 1usize) & 0x01;
18365 val != 0 15613 val != 0
18366 } 15614 }
18367 #[doc = "Update disable"] 15615 #[doc = "IrDA mode enable"]
18368 pub fn set_udis(&mut self, val: bool) { 15616 pub fn set_iren(&mut self, val: bool) {
18369 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 15617 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
18370 } 15618 }
18371 #[doc = "Update request source"] 15619 #[doc = "IrDA low-power"]
18372 pub const fn urs(&self) -> super::vals::Urs { 15620 pub const fn irlp(&self) -> super::vals::Irlp {
18373 let val = (self.0 >> 2usize) & 0x01; 15621 let val = (self.0 >> 2usize) & 0x01;
18374 super::vals::Urs(val as u8) 15622 super::vals::Irlp(val as u8)
18375 } 15623 }
18376 #[doc = "Update request source"] 15624 #[doc = "IrDA low-power"]
18377 pub fn set_urs(&mut self, val: super::vals::Urs) { 15625 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
18378 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 15626 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
18379 } 15627 }
18380 #[doc = "One-pulse mode"] 15628 #[doc = "Half-duplex selection"]
18381 pub const fn opm(&self) -> super::vals::Opm { 15629 pub const fn hdsel(&self) -> super::vals::Hdsel {
18382 let val = (self.0 >> 3usize) & 0x01; 15630 let val = (self.0 >> 3usize) & 0x01;
18383 super::vals::Opm(val as u8) 15631 super::vals::Hdsel(val as u8)
18384 } 15632 }
18385 #[doc = "One-pulse mode"] 15633 #[doc = "Half-duplex selection"]
18386 pub fn set_opm(&mut self, val: super::vals::Opm) { 15634 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
18387 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 15635 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
18388 } 15636 }
18389 #[doc = "Direction"] 15637 #[doc = "DMA enable receiver"]
18390 pub const fn dir(&self) -> super::vals::Dir { 15638 pub const fn dmar(&self) -> bool {
18391 let val = (self.0 >> 4usize) & 0x01; 15639 let val = (self.0 >> 6usize) & 0x01;
18392 super::vals::Dir(val as u8) 15640 val != 0
18393 }
18394 #[doc = "Direction"]
18395 pub fn set_dir(&mut self, val: super::vals::Dir) {
18396 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
18397 }
18398 #[doc = "Center-aligned mode selection"]
18399 pub const fn cms(&self) -> super::vals::Cms {
18400 let val = (self.0 >> 5usize) & 0x03;
18401 super::vals::Cms(val as u8)
18402 } 15641 }
18403 #[doc = "Center-aligned mode selection"] 15642 #[doc = "DMA enable receiver"]
18404 pub fn set_cms(&mut self, val: super::vals::Cms) { 15643 pub fn set_dmar(&mut self, val: bool) {
18405 self.0 = (self.0 & !(0x03 << 5usize)) | (((val.0 as u32) & 0x03) << 5usize); 15644 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
18406 } 15645 }
18407 #[doc = "Auto-reload preload enable"] 15646 #[doc = "DMA enable transmitter"]
18408 pub const fn arpe(&self) -> super::vals::Arpe { 15647 pub const fn dmat(&self) -> bool {
18409 let val = (self.0 >> 7usize) & 0x01; 15648 let val = (self.0 >> 7usize) & 0x01;
18410 super::vals::Arpe(val as u8) 15649 val != 0
18411 }
18412 #[doc = "Auto-reload preload enable"]
18413 pub fn set_arpe(&mut self, val: super::vals::Arpe) {
18414 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
18415 }
18416 #[doc = "Clock division"]
18417 pub const fn ckd(&self) -> super::vals::Ckd {
18418 let val = (self.0 >> 8usize) & 0x03;
18419 super::vals::Ckd(val as u8)
18420 }
18421 #[doc = "Clock division"]
18422 pub fn set_ckd(&mut self, val: super::vals::Ckd) {
18423 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
18424 }
18425 }
18426 impl Default for Cr1Gp {
18427 fn default() -> Cr1Gp {
18428 Cr1Gp(0)
18429 }
18430 }
18431 #[doc = "counter"]
18432 #[repr(transparent)]
18433 #[derive(Copy, Clone, Eq, PartialEq)]
18434 pub struct Cnt32(pub u32);
18435 impl Cnt32 {
18436 #[doc = "counter value"]
18437 pub const fn cnt(&self) -> u32 {
18438 let val = (self.0 >> 0usize) & 0xffff_ffff;
18439 val as u32
18440 } 15650 }
18441 #[doc = "counter value"] 15651 #[doc = "DMA enable transmitter"]
18442 pub fn set_cnt(&mut self, val: u32) { 15652 pub fn set_dmat(&mut self, val: bool) {
18443 self.0 = 15653 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
18444 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
18445 } 15654 }
18446 } 15655 }
18447 impl Default for Cnt32 { 15656 impl Default for Cr3 {
18448 fn default() -> Cnt32 { 15657 fn default() -> Cr3 {
18449 Cnt32(0) 15658 Cr3(0)
18450 } 15659 }
18451 } 15660 }
18452 #[doc = "control register 1"] 15661 #[doc = "Control register 3"]
18453 #[repr(transparent)] 15662 #[repr(transparent)]
18454 #[derive(Copy, Clone, Eq, PartialEq)] 15663 #[derive(Copy, Clone, Eq, PartialEq)]
18455 pub struct Cr1Basic(pub u32); 15664 pub struct Cr3Usart(pub u32);
18456 impl Cr1Basic { 15665 impl Cr3Usart {
18457 #[doc = "Counter enable"] 15666 #[doc = "Error interrupt enable"]
18458 pub const fn cen(&self) -> bool { 15667 pub const fn eie(&self) -> bool {
18459 let val = (self.0 >> 0usize) & 0x01; 15668 let val = (self.0 >> 0usize) & 0x01;
18460 val != 0 15669 val != 0
18461 } 15670 }
18462 #[doc = "Counter enable"] 15671 #[doc = "Error interrupt enable"]
18463 pub fn set_cen(&mut self, val: bool) { 15672 pub fn set_eie(&mut self, val: bool) {
18464 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 15673 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18465 } 15674 }
18466 #[doc = "Update disable"] 15675 #[doc = "IrDA mode enable"]
18467 pub const fn udis(&self) -> bool { 15676 pub const fn iren(&self) -> bool {
18468 let val = (self.0 >> 1usize) & 0x01; 15677 let val = (self.0 >> 1usize) & 0x01;
18469 val != 0 15678 val != 0
18470 } 15679 }
18471 #[doc = "Update disable"] 15680 #[doc = "IrDA mode enable"]
18472 pub fn set_udis(&mut self, val: bool) { 15681 pub fn set_iren(&mut self, val: bool) {
18473 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 15682 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
18474 } 15683 }
18475 #[doc = "Update request source"] 15684 #[doc = "IrDA low-power"]
18476 pub const fn urs(&self) -> super::vals::Urs { 15685 pub const fn irlp(&self) -> super::vals::Irlp {
18477 let val = (self.0 >> 2usize) & 0x01; 15686 let val = (self.0 >> 2usize) & 0x01;
18478 super::vals::Urs(val as u8) 15687 super::vals::Irlp(val as u8)
18479 } 15688 }
18480 #[doc = "Update request source"] 15689 #[doc = "IrDA low-power"]
18481 pub fn set_urs(&mut self, val: super::vals::Urs) { 15690 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
18482 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 15691 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
18483 } 15692 }
18484 #[doc = "One-pulse mode"] 15693 #[doc = "Half-duplex selection"]
18485 pub const fn opm(&self) -> super::vals::Opm { 15694 pub const fn hdsel(&self) -> super::vals::Hdsel {
18486 let val = (self.0 >> 3usize) & 0x01;
18487 super::vals::Opm(val as u8)
18488 }
18489 #[doc = "One-pulse mode"]
18490 pub fn set_opm(&mut self, val: super::vals::Opm) {
18491 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
18492 }
18493 #[doc = "Auto-reload preload enable"]
18494 pub const fn arpe(&self) -> super::vals::Arpe {
18495 let val = (self.0 >> 7usize) & 0x01;
18496 super::vals::Arpe(val as u8)
18497 }
18498 #[doc = "Auto-reload preload enable"]
18499 pub fn set_arpe(&mut self, val: super::vals::Arpe) {
18500 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
18501 }
18502 }
18503 impl Default for Cr1Basic {
18504 fn default() -> Cr1Basic {
18505 Cr1Basic(0)
18506 }
18507 }
18508 #[doc = "control register 2"]
18509 #[repr(transparent)]
18510 #[derive(Copy, Clone, Eq, PartialEq)]
18511 pub struct Cr2Adv(pub u32);
18512 impl Cr2Adv {
18513 #[doc = "Capture/compare preloaded control"]
18514 pub const fn ccpc(&self) -> bool {
18515 let val = (self.0 >> 0usize) & 0x01;
18516 val != 0
18517 }
18518 #[doc = "Capture/compare preloaded control"]
18519 pub fn set_ccpc(&mut self, val: bool) {
18520 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18521 }
18522 #[doc = "Capture/compare control update selection"]
18523 pub const fn ccus(&self) -> bool {
18524 let val = (self.0 >> 2usize) & 0x01;
18525 val != 0
18526 }
18527 #[doc = "Capture/compare control update selection"]
18528 pub fn set_ccus(&mut self, val: bool) {
18529 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
18530 }
18531 #[doc = "Capture/compare DMA selection"]
18532 pub const fn ccds(&self) -> super::vals::Ccds {
18533 let val = (self.0 >> 3usize) & 0x01; 15695 let val = (self.0 >> 3usize) & 0x01;
18534 super::vals::Ccds(val as u8) 15696 super::vals::Hdsel(val as u8)
18535 } 15697 }
18536 #[doc = "Capture/compare DMA selection"] 15698 #[doc = "Half-duplex selection"]
18537 pub fn set_ccds(&mut self, val: super::vals::Ccds) { 15699 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
18538 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 15700 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
18539 } 15701 }
18540 #[doc = "Master mode selection"] 15702 #[doc = "Smartcard NACK enable"]
18541 pub const fn mms(&self) -> super::vals::Mms { 15703 pub const fn nack(&self) -> bool {
18542 let val = (self.0 >> 4usize) & 0x07; 15704 let val = (self.0 >> 4usize) & 0x01;
18543 super::vals::Mms(val as u8)
18544 }
18545 #[doc = "Master mode selection"]
18546 pub fn set_mms(&mut self, val: super::vals::Mms) {
18547 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
18548 }
18549 #[doc = "TI1 selection"]
18550 pub const fn ti1s(&self) -> super::vals::Tis {
18551 let val = (self.0 >> 7usize) & 0x01;
18552 super::vals::Tis(val as u8)
18553 }
18554 #[doc = "TI1 selection"]
18555 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
18556 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
18557 }
18558 #[doc = "Output Idle state 1"]
18559 pub fn ois(&self, n: usize) -> bool {
18560 assert!(n < 4usize);
18561 let offs = 8usize + n * 2usize;
18562 let val = (self.0 >> offs) & 0x01;
18563 val != 0
18564 }
18565 #[doc = "Output Idle state 1"]
18566 pub fn set_ois(&mut self, n: usize, val: bool) {
18567 assert!(n < 4usize);
18568 let offs = 8usize + n * 2usize;
18569 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18570 }
18571 #[doc = "Output Idle state 1"]
18572 pub const fn ois1n(&self) -> bool {
18573 let val = (self.0 >> 9usize) & 0x01;
18574 val != 0
18575 }
18576 #[doc = "Output Idle state 1"]
18577 pub fn set_ois1n(&mut self, val: bool) {
18578 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
18579 }
18580 #[doc = "Output Idle state 2"]
18581 pub const fn ois2n(&self) -> bool {
18582 let val = (self.0 >> 11usize) & 0x01;
18583 val != 0
18584 }
18585 #[doc = "Output Idle state 2"]
18586 pub fn set_ois2n(&mut self, val: bool) {
18587 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
18588 }
18589 #[doc = "Output Idle state 3"]
18590 pub const fn ois3n(&self) -> bool {
18591 let val = (self.0 >> 13usize) & 0x01;
18592 val != 0
18593 }
18594 #[doc = "Output Idle state 3"]
18595 pub fn set_ois3n(&mut self, val: bool) {
18596 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
18597 }
18598 }
18599 impl Default for Cr2Adv {
18600 fn default() -> Cr2Adv {
18601 Cr2Adv(0)
18602 }
18603 }
18604 #[doc = "status register"]
18605 #[repr(transparent)]
18606 #[derive(Copy, Clone, Eq, PartialEq)]
18607 pub struct SrAdv(pub u32);
18608 impl SrAdv {
18609 #[doc = "Update interrupt flag"]
18610 pub const fn uif(&self) -> bool {
18611 let val = (self.0 >> 0usize) & 0x01;
18612 val != 0
18613 }
18614 #[doc = "Update interrupt flag"]
18615 pub fn set_uif(&mut self, val: bool) {
18616 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18617 }
18618 #[doc = "Capture/compare 1 interrupt flag"]
18619 pub fn ccif(&self, n: usize) -> bool {
18620 assert!(n < 4usize);
18621 let offs = 1usize + n * 1usize;
18622 let val = (self.0 >> offs) & 0x01;
18623 val != 0 15705 val != 0
18624 } 15706 }
18625 #[doc = "Capture/compare 1 interrupt flag"] 15707 #[doc = "Smartcard NACK enable"]
18626 pub fn set_ccif(&mut self, n: usize, val: bool) { 15708 pub fn set_nack(&mut self, val: bool) {
18627 assert!(n < 4usize); 15709 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
18628 let offs = 1usize + n * 1usize;
18629 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18630 } 15710 }
18631 #[doc = "COM interrupt flag"] 15711 #[doc = "Smartcard mode enable"]
18632 pub const fn comif(&self) -> bool { 15712 pub const fn scen(&self) -> bool {
18633 let val = (self.0 >> 5usize) & 0x01; 15713 let val = (self.0 >> 5usize) & 0x01;
18634 val != 0 15714 val != 0
18635 } 15715 }
18636 #[doc = "COM interrupt flag"] 15716 #[doc = "Smartcard mode enable"]
18637 pub fn set_comif(&mut self, val: bool) { 15717 pub fn set_scen(&mut self, val: bool) {
18638 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 15718 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
18639 } 15719 }
18640 #[doc = "Trigger interrupt flag"] 15720 #[doc = "DMA enable receiver"]
18641 pub const fn tif(&self) -> bool { 15721 pub const fn dmar(&self) -> bool {
18642 let val = (self.0 >> 6usize) & 0x01; 15722 let val = (self.0 >> 6usize) & 0x01;
18643 val != 0 15723 val != 0
18644 } 15724 }
18645 #[doc = "Trigger interrupt flag"] 15725 #[doc = "DMA enable receiver"]
18646 pub fn set_tif(&mut self, val: bool) { 15726 pub fn set_dmar(&mut self, val: bool) {
18647 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 15727 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
18648 } 15728 }
18649 #[doc = "Break interrupt flag"] 15729 #[doc = "DMA enable transmitter"]
18650 pub const fn bif(&self) -> bool { 15730 pub const fn dmat(&self) -> bool {
18651 let val = (self.0 >> 7usize) & 0x01; 15731 let val = (self.0 >> 7usize) & 0x01;
18652 val != 0 15732 val != 0
18653 } 15733 }
18654 #[doc = "Break interrupt flag"] 15734 #[doc = "DMA enable transmitter"]
18655 pub fn set_bif(&mut self, val: bool) { 15735 pub fn set_dmat(&mut self, val: bool) {
18656 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 15736 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
18657 } 15737 }
18658 #[doc = "Capture/Compare 1 overcapture flag"] 15738 #[doc = "RTS enable"]
18659 pub fn ccof(&self, n: usize) -> bool { 15739 pub const fn rtse(&self) -> bool {
18660 assert!(n < 4usize); 15740 let val = (self.0 >> 8usize) & 0x01;
18661 let offs = 9usize + n * 1usize;
18662 let val = (self.0 >> offs) & 0x01;
18663 val != 0
18664 }
18665 #[doc = "Capture/Compare 1 overcapture flag"]
18666 pub fn set_ccof(&mut self, n: usize, val: bool) {
18667 assert!(n < 4usize);
18668 let offs = 9usize + n * 1usize;
18669 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18670 }
18671 }
18672 impl Default for SrAdv {
18673 fn default() -> SrAdv {
18674 SrAdv(0)
18675 }
18676 }
18677 #[doc = "capture/compare enable register"]
18678 #[repr(transparent)]
18679 #[derive(Copy, Clone, Eq, PartialEq)]
18680 pub struct CcerAdv(pub u32);
18681 impl CcerAdv {
18682 #[doc = "Capture/Compare 1 output enable"]
18683 pub fn cce(&self, n: usize) -> bool {
18684 assert!(n < 4usize);
18685 let offs = 0usize + n * 4usize;
18686 let val = (self.0 >> offs) & 0x01;
18687 val != 0
18688 }
18689 #[doc = "Capture/Compare 1 output enable"]
18690 pub fn set_cce(&mut self, n: usize, val: bool) {
18691 assert!(n < 4usize);
18692 let offs = 0usize + n * 4usize;
18693 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18694 }
18695 #[doc = "Capture/Compare 1 output Polarity"]
18696 pub fn ccp(&self, n: usize) -> bool {
18697 assert!(n < 4usize);
18698 let offs = 1usize + n * 4usize;
18699 let val = (self.0 >> offs) & 0x01;
18700 val != 0 15741 val != 0
18701 } 15742 }
18702 #[doc = "Capture/Compare 1 output Polarity"] 15743 #[doc = "RTS enable"]
18703 pub fn set_ccp(&mut self, n: usize, val: bool) { 15744 pub fn set_rtse(&mut self, val: bool) {
18704 assert!(n < 4usize); 15745 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
18705 let offs = 1usize + n * 4usize;
18706 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18707 } 15746 }
18708 #[doc = "Capture/Compare 1 complementary output enable"] 15747 #[doc = "CTS enable"]
18709 pub fn ccne(&self, n: usize) -> bool { 15748 pub const fn ctse(&self) -> bool {
18710 assert!(n < 4usize); 15749 let val = (self.0 >> 9usize) & 0x01;
18711 let offs = 2usize + n * 4usize;
18712 let val = (self.0 >> offs) & 0x01;
18713 val != 0 15750 val != 0
18714 } 15751 }
18715 #[doc = "Capture/Compare 1 complementary output enable"] 15752 #[doc = "CTS enable"]
18716 pub fn set_ccne(&mut self, n: usize, val: bool) { 15753 pub fn set_ctse(&mut self, val: bool) {
18717 assert!(n < 4usize); 15754 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
18718 let offs = 2usize + n * 4usize;
18719 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18720 } 15755 }
18721 #[doc = "Capture/Compare 1 output Polarity"] 15756 #[doc = "CTS interrupt enable"]
18722 pub fn ccnp(&self, n: usize) -> bool { 15757 pub const fn ctsie(&self) -> bool {
18723 assert!(n < 4usize); 15758 let val = (self.0 >> 10usize) & 0x01;
18724 let offs = 3usize + n * 4usize;
18725 let val = (self.0 >> offs) & 0x01;
18726 val != 0 15759 val != 0
18727 } 15760 }
18728 #[doc = "Capture/Compare 1 output Polarity"] 15761 #[doc = "CTS interrupt enable"]
18729 pub fn set_ccnp(&mut self, n: usize, val: bool) { 15762 pub fn set_ctsie(&mut self, val: bool) {
18730 assert!(n < 4usize); 15763 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
18731 let offs = 3usize + n * 4usize;
18732 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18733 } 15764 }
18734 } 15765 }
18735 impl Default for CcerAdv { 15766 impl Default for Cr3Usart {
18736 fn default() -> CcerAdv { 15767 fn default() -> Cr3Usart {
18737 CcerAdv(0) 15768 Cr3Usart(0)
18738 } 15769 }
18739 } 15770 }
18740 #[doc = "auto-reload register"] 15771 #[doc = "Status register"]
18741 #[repr(transparent)] 15772 #[repr(transparent)]
18742 #[derive(Copy, Clone, Eq, PartialEq)] 15773 #[derive(Copy, Clone, Eq, PartialEq)]
18743 pub struct Arr16(pub u32); 15774 pub struct SrUsart(pub u32);
18744 impl Arr16 { 15775 impl SrUsart {
18745 #[doc = "Auto-reload value"] 15776 #[doc = "Parity error"]
18746 pub const fn arr(&self) -> u16 { 15777 pub const fn pe(&self) -> bool {
18747 let val = (self.0 >> 0usize) & 0xffff; 15778 let val = (self.0 >> 0usize) & 0x01;
18748 val as u16 15779 val != 0
18749 } 15780 }
18750 #[doc = "Auto-reload value"] 15781 #[doc = "Parity error"]
18751 pub fn set_arr(&mut self, val: u16) { 15782 pub fn set_pe(&mut self, val: bool) {
18752 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 15783 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18753 } 15784 }
18754 } 15785 #[doc = "Framing error"]
18755 impl Default for Arr16 { 15786 pub const fn fe(&self) -> bool {
18756 fn default() -> Arr16 { 15787 let val = (self.0 >> 1usize) & 0x01;
18757 Arr16(0) 15788 val != 0
18758 } 15789 }
18759 } 15790 #[doc = "Framing error"]
18760 #[doc = "capture/compare register 1"] 15791 pub fn set_fe(&mut self, val: bool) {
18761 #[repr(transparent)] 15792 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
18762 #[derive(Copy, Clone, Eq, PartialEq)]
18763 pub struct Ccr32(pub u32);
18764 impl Ccr32 {
18765 #[doc = "Capture/Compare 1 value"]
18766 pub const fn ccr(&self) -> u32 {
18767 let val = (self.0 >> 0usize) & 0xffff_ffff;
18768 val as u32
18769 } 15793 }
18770 #[doc = "Capture/Compare 1 value"] 15794 #[doc = "Noise error flag"]
18771 pub fn set_ccr(&mut self, val: u32) { 15795 pub const fn ne(&self) -> bool {
18772 self.0 = 15796 let val = (self.0 >> 2usize) & 0x01;
18773 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 15797 val != 0
18774 } 15798 }
18775 } 15799 #[doc = "Noise error flag"]
18776 impl Default for Ccr32 { 15800 pub fn set_ne(&mut self, val: bool) {
18777 fn default() -> Ccr32 { 15801 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
18778 Ccr32(0)
18779 } 15802 }
18780 } 15803 #[doc = "Overrun error"]
18781 #[doc = "event generation register"] 15804 pub const fn ore(&self) -> bool {
18782 #[repr(transparent)] 15805 let val = (self.0 >> 3usize) & 0x01;
18783 #[derive(Copy, Clone, Eq, PartialEq)]
18784 pub struct EgrAdv(pub u32);
18785 impl EgrAdv {
18786 #[doc = "Update generation"]
18787 pub const fn ug(&self) -> bool {
18788 let val = (self.0 >> 0usize) & 0x01;
18789 val != 0 15806 val != 0
18790 } 15807 }
18791 #[doc = "Update generation"] 15808 #[doc = "Overrun error"]
18792 pub fn set_ug(&mut self, val: bool) { 15809 pub fn set_ore(&mut self, val: bool) {
18793 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 15810 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
18794 } 15811 }
18795 #[doc = "Capture/compare 1 generation"] 15812 #[doc = "IDLE line detected"]
18796 pub fn ccg(&self, n: usize) -> bool { 15813 pub const fn idle(&self) -> bool {
18797 assert!(n < 4usize); 15814 let val = (self.0 >> 4usize) & 0x01;
18798 let offs = 1usize + n * 1usize;
18799 let val = (self.0 >> offs) & 0x01;
18800 val != 0 15815 val != 0
18801 } 15816 }
18802 #[doc = "Capture/compare 1 generation"] 15817 #[doc = "IDLE line detected"]
18803 pub fn set_ccg(&mut self, n: usize, val: bool) { 15818 pub fn set_idle(&mut self, val: bool) {
18804 assert!(n < 4usize); 15819 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
18805 let offs = 1usize + n * 1usize;
18806 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18807 } 15820 }
18808 #[doc = "Capture/Compare control update generation"] 15821 #[doc = "Read data register not empty"]
18809 pub const fn comg(&self) -> bool { 15822 pub const fn rxne(&self) -> bool {
18810 let val = (self.0 >> 5usize) & 0x01; 15823 let val = (self.0 >> 5usize) & 0x01;
18811 val != 0 15824 val != 0
18812 } 15825 }
18813 #[doc = "Capture/Compare control update generation"] 15826 #[doc = "Read data register not empty"]
18814 pub fn set_comg(&mut self, val: bool) { 15827 pub fn set_rxne(&mut self, val: bool) {
18815 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 15828 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
18816 } 15829 }
18817 #[doc = "Trigger generation"] 15830 #[doc = "Transmission complete"]
18818 pub const fn tg(&self) -> bool { 15831 pub const fn tc(&self) -> bool {
18819 let val = (self.0 >> 6usize) & 0x01; 15832 let val = (self.0 >> 6usize) & 0x01;
18820 val != 0 15833 val != 0
18821 } 15834 }
18822 #[doc = "Trigger generation"] 15835 #[doc = "Transmission complete"]
18823 pub fn set_tg(&mut self, val: bool) { 15836 pub fn set_tc(&mut self, val: bool) {
18824 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 15837 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
18825 } 15838 }
18826 #[doc = "Break generation"] 15839 #[doc = "Transmit data register empty"]
18827 pub const fn bg(&self) -> bool { 15840 pub const fn txe(&self) -> bool {
18828 let val = (self.0 >> 7usize) & 0x01; 15841 let val = (self.0 >> 7usize) & 0x01;
18829 val != 0 15842 val != 0
18830 } 15843 }
18831 #[doc = "Break generation"] 15844 #[doc = "Transmit data register empty"]
18832 pub fn set_bg(&mut self, val: bool) { 15845 pub fn set_txe(&mut self, val: bool) {
18833 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 15846 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
18834 } 15847 }
18835 } 15848 #[doc = "LIN break detection flag"]
18836 impl Default for EgrAdv { 15849 pub const fn lbd(&self) -> bool {
18837 fn default() -> EgrAdv { 15850 let val = (self.0 >> 8usize) & 0x01;
18838 EgrAdv(0)
18839 }
18840 }
18841 #[doc = "prescaler"]
18842 #[repr(transparent)]
18843 #[derive(Copy, Clone, Eq, PartialEq)]
18844 pub struct Psc(pub u32);
18845 impl Psc {
18846 #[doc = "Prescaler value"]
18847 pub const fn psc(&self) -> u16 {
18848 let val = (self.0 >> 0usize) & 0xffff;
18849 val as u16
18850 }
18851 #[doc = "Prescaler value"]
18852 pub fn set_psc(&mut self, val: u16) {
18853 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
18854 }
18855 }
18856 impl Default for Psc {
18857 fn default() -> Psc {
18858 Psc(0)
18859 }
18860 }
18861 #[doc = "event generation register"]
18862 #[repr(transparent)]
18863 #[derive(Copy, Clone, Eq, PartialEq)]
18864 pub struct EgrBasic(pub u32);
18865 impl EgrBasic {
18866 #[doc = "Update generation"]
18867 pub const fn ug(&self) -> bool {
18868 let val = (self.0 >> 0usize) & 0x01;
18869 val != 0 15851 val != 0
18870 } 15852 }
18871 #[doc = "Update generation"] 15853 #[doc = "LIN break detection flag"]
18872 pub fn set_ug(&mut self, val: bool) { 15854 pub fn set_lbd(&mut self, val: bool) {
18873 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 15855 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
18874 }
18875 }
18876 impl Default for EgrBasic {
18877 fn default() -> EgrBasic {
18878 EgrBasic(0)
18879 } 15856 }
18880 } 15857 #[doc = "CTS flag"]
18881 #[doc = "repetition counter register"] 15858 pub const fn cts(&self) -> bool {
18882 #[repr(transparent)] 15859 let val = (self.0 >> 9usize) & 0x01;
18883 #[derive(Copy, Clone, Eq, PartialEq)] 15860 val != 0
18884 pub struct Rcr(pub u32);
18885 impl Rcr {
18886 #[doc = "Repetition counter value"]
18887 pub const fn rep(&self) -> u8 {
18888 let val = (self.0 >> 0usize) & 0xff;
18889 val as u8
18890 } 15861 }
18891 #[doc = "Repetition counter value"] 15862 #[doc = "CTS flag"]
18892 pub fn set_rep(&mut self, val: u8) { 15863 pub fn set_cts(&mut self, val: bool) {
18893 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 15864 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
18894 } 15865 }
18895 } 15866 }
18896 impl Default for Rcr { 15867 impl Default for SrUsart {
18897 fn default() -> Rcr { 15868 fn default() -> SrUsart {
18898 Rcr(0) 15869 SrUsart(0)
18899 } 15870 }
18900 } 15871 }
18901 #[doc = "break and dead-time register"] 15872 #[doc = "Status register"]
18902 #[repr(transparent)] 15873 #[repr(transparent)]
18903 #[derive(Copy, Clone, Eq, PartialEq)] 15874 #[derive(Copy, Clone, Eq, PartialEq)]
18904 pub struct Bdtr(pub u32); 15875 pub struct Sr(pub u32);
18905 impl Bdtr { 15876 impl Sr {
18906 #[doc = "Dead-time generator setup"] 15877 #[doc = "Parity error"]
18907 pub const fn dtg(&self) -> u8 { 15878 pub const fn pe(&self) -> bool {
18908 let val = (self.0 >> 0usize) & 0xff; 15879 let val = (self.0 >> 0usize) & 0x01;
18909 val as u8
18910 }
18911 #[doc = "Dead-time generator setup"]
18912 pub fn set_dtg(&mut self, val: u8) {
18913 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
18914 }
18915 #[doc = "Lock configuration"]
18916 pub const fn lock(&self) -> u8 {
18917 let val = (self.0 >> 8usize) & 0x03;
18918 val as u8
18919 }
18920 #[doc = "Lock configuration"]
18921 pub fn set_lock(&mut self, val: u8) {
18922 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
18923 }
18924 #[doc = "Off-state selection for Idle mode"]
18925 pub const fn ossi(&self) -> super::vals::Ossi {
18926 let val = (self.0 >> 10usize) & 0x01;
18927 super::vals::Ossi(val as u8)
18928 }
18929 #[doc = "Off-state selection for Idle mode"]
18930 pub fn set_ossi(&mut self, val: super::vals::Ossi) {
18931 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
18932 }
18933 #[doc = "Off-state selection for Run mode"]
18934 pub const fn ossr(&self) -> super::vals::Ossr {
18935 let val = (self.0 >> 11usize) & 0x01;
18936 super::vals::Ossr(val as u8)
18937 }
18938 #[doc = "Off-state selection for Run mode"]
18939 pub fn set_ossr(&mut self, val: super::vals::Ossr) {
18940 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
18941 }
18942 #[doc = "Break enable"]
18943 pub const fn bke(&self) -> bool {
18944 let val = (self.0 >> 12usize) & 0x01;
18945 val != 0
18946 }
18947 #[doc = "Break enable"]
18948 pub fn set_bke(&mut self, val: bool) {
18949 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
18950 }
18951 #[doc = "Break polarity"]
18952 pub const fn bkp(&self) -> bool {
18953 let val = (self.0 >> 13usize) & 0x01;
18954 val != 0 15880 val != 0
18955 } 15881 }
18956 #[doc = "Break polarity"] 15882 #[doc = "Parity error"]
18957 pub fn set_bkp(&mut self, val: bool) { 15883 pub fn set_pe(&mut self, val: bool) {
18958 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 15884 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18959 } 15885 }
18960 #[doc = "Automatic output enable"] 15886 #[doc = "Framing error"]
18961 pub const fn aoe(&self) -> bool { 15887 pub const fn fe(&self) -> bool {
18962 let val = (self.0 >> 14usize) & 0x01; 15888 let val = (self.0 >> 1usize) & 0x01;
18963 val != 0 15889 val != 0
18964 } 15890 }
18965 #[doc = "Automatic output enable"] 15891 #[doc = "Framing error"]
18966 pub fn set_aoe(&mut self, val: bool) { 15892 pub fn set_fe(&mut self, val: bool) {
18967 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 15893 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
18968 } 15894 }
18969 #[doc = "Main output enable"] 15895 #[doc = "Noise error flag"]
18970 pub const fn moe(&self) -> bool { 15896 pub const fn ne(&self) -> bool {
18971 let val = (self.0 >> 15usize) & 0x01; 15897 let val = (self.0 >> 2usize) & 0x01;
18972 val != 0 15898 val != 0
18973 } 15899 }
18974 #[doc = "Main output enable"] 15900 #[doc = "Noise error flag"]
18975 pub fn set_moe(&mut self, val: bool) { 15901 pub fn set_ne(&mut self, val: bool) {
18976 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); 15902 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
18977 }
18978 }
18979 impl Default for Bdtr {
18980 fn default() -> Bdtr {
18981 Bdtr(0)
18982 } 15903 }
18983 } 15904 #[doc = "Overrun error"]
18984 #[doc = "DMA/Interrupt enable register"] 15905 pub const fn ore(&self) -> bool {
18985 #[repr(transparent)] 15906 let val = (self.0 >> 3usize) & 0x01;
18986 #[derive(Copy, Clone, Eq, PartialEq)]
18987 pub struct DierAdv(pub u32);
18988 impl DierAdv {
18989 #[doc = "Update interrupt enable"]
18990 pub const fn uie(&self) -> bool {
18991 let val = (self.0 >> 0usize) & 0x01;
18992 val != 0 15907 val != 0
18993 } 15908 }
18994 #[doc = "Update interrupt enable"] 15909 #[doc = "Overrun error"]
18995 pub fn set_uie(&mut self, val: bool) { 15910 pub fn set_ore(&mut self, val: bool) {
18996 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 15911 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
18997 } 15912 }
18998 #[doc = "Capture/Compare 1 interrupt enable"] 15913 #[doc = "IDLE line detected"]
18999 pub fn ccie(&self, n: usize) -> bool { 15914 pub const fn idle(&self) -> bool {
19000 assert!(n < 4usize); 15915 let val = (self.0 >> 4usize) & 0x01;
19001 let offs = 1usize + n * 1usize;
19002 let val = (self.0 >> offs) & 0x01;
19003 val != 0 15916 val != 0
19004 } 15917 }
19005 #[doc = "Capture/Compare 1 interrupt enable"] 15918 #[doc = "IDLE line detected"]
19006 pub fn set_ccie(&mut self, n: usize, val: bool) { 15919 pub fn set_idle(&mut self, val: bool) {
19007 assert!(n < 4usize); 15920 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
19008 let offs = 1usize + n * 1usize;
19009 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19010 } 15921 }
19011 #[doc = "COM interrupt enable"] 15922 #[doc = "Read data register not empty"]
19012 pub const fn comie(&self) -> bool { 15923 pub const fn rxne(&self) -> bool {
19013 let val = (self.0 >> 5usize) & 0x01; 15924 let val = (self.0 >> 5usize) & 0x01;
19014 val != 0 15925 val != 0
19015 } 15926 }
19016 #[doc = "COM interrupt enable"] 15927 #[doc = "Read data register not empty"]
19017 pub fn set_comie(&mut self, val: bool) { 15928 pub fn set_rxne(&mut self, val: bool) {
19018 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 15929 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
19019 } 15930 }
19020 #[doc = "Trigger interrupt enable"] 15931 #[doc = "Transmission complete"]
19021 pub const fn tie(&self) -> bool { 15932 pub const fn tc(&self) -> bool {
19022 let val = (self.0 >> 6usize) & 0x01; 15933 let val = (self.0 >> 6usize) & 0x01;
19023 val != 0 15934 val != 0
19024 } 15935 }
19025 #[doc = "Trigger interrupt enable"] 15936 #[doc = "Transmission complete"]
19026 pub fn set_tie(&mut self, val: bool) { 15937 pub fn set_tc(&mut self, val: bool) {
19027 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 15938 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
19028 } 15939 }
19029 #[doc = "Break interrupt enable"] 15940 #[doc = "Transmit data register empty"]
19030 pub const fn bie(&self) -> bool { 15941 pub const fn txe(&self) -> bool {
19031 let val = (self.0 >> 7usize) & 0x01; 15942 let val = (self.0 >> 7usize) & 0x01;
19032 val != 0 15943 val != 0
19033 } 15944 }
19034 #[doc = "Break interrupt enable"] 15945 #[doc = "Transmit data register empty"]
19035 pub fn set_bie(&mut self, val: bool) { 15946 pub fn set_txe(&mut self, val: bool) {
19036 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 15947 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
19037 } 15948 }
19038 #[doc = "Update DMA request enable"] 15949 #[doc = "LIN break detection flag"]
19039 pub const fn ude(&self) -> bool { 15950 pub const fn lbd(&self) -> bool {
19040 let val = (self.0 >> 8usize) & 0x01; 15951 let val = (self.0 >> 8usize) & 0x01;
19041 val != 0 15952 val != 0
19042 } 15953 }
19043 #[doc = "Update DMA request enable"] 15954 #[doc = "LIN break detection flag"]
19044 pub fn set_ude(&mut self, val: bool) { 15955 pub fn set_lbd(&mut self, val: bool) {
19045 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 15956 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
19046 } 15957 }
19047 #[doc = "Capture/Compare 1 DMA request enable"]
19048 pub fn ccde(&self, n: usize) -> bool {
19049 assert!(n < 4usize);
19050 let offs = 9usize + n * 1usize;
19051 let val = (self.0 >> offs) & 0x01;
19052 val != 0
19053 }
19054 #[doc = "Capture/Compare 1 DMA request enable"]
19055 pub fn set_ccde(&mut self, n: usize, val: bool) {
19056 assert!(n < 4usize);
19057 let offs = 9usize + n * 1usize;
19058 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19059 }
19060 #[doc = "COM DMA request enable"]
19061 pub const fn comde(&self) -> bool {
19062 let val = (self.0 >> 13usize) & 0x01;
19063 val != 0
19064 }
19065 #[doc = "COM DMA request enable"]
19066 pub fn set_comde(&mut self, val: bool) {
19067 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
19068 }
19069 #[doc = "Trigger DMA request enable"]
19070 pub const fn tde(&self) -> bool {
19071 let val = (self.0 >> 14usize) & 0x01;
19072 val != 0
19073 }
19074 #[doc = "Trigger DMA request enable"]
19075 pub fn set_tde(&mut self, val: bool) {
19076 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
19077 }
19078 } 15958 }
19079 impl Default for DierAdv { 15959 impl Default for Sr {
19080 fn default() -> DierAdv { 15960 fn default() -> Sr {
19081 DierAdv(0) 15961 Sr(0)
19082 } 15962 }
19083 } 15963 }
19084 #[doc = "DMA control register"] 15964 #[doc = "Baud rate register"]
19085 #[repr(transparent)] 15965 #[repr(transparent)]
19086 #[derive(Copy, Clone, Eq, PartialEq)] 15966 #[derive(Copy, Clone, Eq, PartialEq)]
19087 pub struct Dcr(pub u32); 15967 pub struct Brr(pub u32);
19088 impl Dcr { 15968 impl Brr {
19089 #[doc = "DMA base address"] 15969 #[doc = "fraction of USARTDIV"]
19090 pub const fn dba(&self) -> u8 { 15970 pub const fn div_fraction(&self) -> u8 {
19091 let val = (self.0 >> 0usize) & 0x1f; 15971 let val = (self.0 >> 0usize) & 0x0f;
19092 val as u8
19093 }
19094 #[doc = "DMA base address"]
19095 pub fn set_dba(&mut self, val: u8) {
19096 self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
19097 }
19098 #[doc = "DMA burst length"]
19099 pub const fn dbl(&self) -> u8 {
19100 let val = (self.0 >> 8usize) & 0x1f;
19101 val as u8 15972 val as u8
19102 } 15973 }
19103 #[doc = "DMA burst length"] 15974 #[doc = "fraction of USARTDIV"]
19104 pub fn set_dbl(&mut self, val: u8) { 15975 pub fn set_div_fraction(&mut self, val: u8) {
19105 self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize); 15976 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
19106 }
19107 }
19108 impl Default for Dcr {
19109 fn default() -> Dcr {
19110 Dcr(0)
19111 } 15977 }
19112 } 15978 #[doc = "mantissa of USARTDIV"]
19113 #[doc = "auto-reload register"] 15979 pub const fn div_mantissa(&self) -> u16 {
19114 #[repr(transparent)] 15980 let val = (self.0 >> 4usize) & 0x0fff;
19115 #[derive(Copy, Clone, Eq, PartialEq)] 15981 val as u16
19116 pub struct Arr32(pub u32);
19117 impl Arr32 {
19118 #[doc = "Auto-reload value"]
19119 pub const fn arr(&self) -> u32 {
19120 let val = (self.0 >> 0usize) & 0xffff_ffff;
19121 val as u32
19122 } 15982 }
19123 #[doc = "Auto-reload value"] 15983 #[doc = "mantissa of USARTDIV"]
19124 pub fn set_arr(&mut self, val: u32) { 15984 pub fn set_div_mantissa(&mut self, val: u16) {
19125 self.0 = 15985 self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize);
19126 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
19127 } 15986 }
19128 } 15987 }
19129 impl Default for Arr32 { 15988 impl Default for Brr {
19130 fn default() -> Arr32 { 15989 fn default() -> Brr {
19131 Arr32(0) 15990 Brr(0)
19132 } 15991 }
19133 } 15992 }
19134 #[doc = "DMA/Interrupt enable register"] 15993 #[doc = "Control register 2"]
19135 #[repr(transparent)] 15994 #[repr(transparent)]
19136 #[derive(Copy, Clone, Eq, PartialEq)] 15995 #[derive(Copy, Clone, Eq, PartialEq)]
19137 pub struct DierGp(pub u32); 15996 pub struct Cr2Usart(pub u32);
19138 impl DierGp { 15997 impl Cr2Usart {
19139 #[doc = "Update interrupt enable"] 15998 #[doc = "Address of the USART node"]
19140 pub const fn uie(&self) -> bool { 15999 pub const fn add(&self) -> u8 {
19141 let val = (self.0 >> 0usize) & 0x01; 16000 let val = (self.0 >> 0usize) & 0x0f;
19142 val != 0 16001 val as u8
19143 } 16002 }
19144 #[doc = "Update interrupt enable"] 16003 #[doc = "Address of the USART node"]
19145 pub fn set_uie(&mut self, val: bool) { 16004 pub fn set_add(&mut self, val: u8) {
19146 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 16005 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
19147 } 16006 }
19148 #[doc = "Capture/Compare 1 interrupt enable"] 16007 #[doc = "lin break detection length"]
19149 pub fn ccie(&self, n: usize) -> bool { 16008 pub const fn lbdl(&self) -> super::vals::Lbdl {
19150 assert!(n < 4usize); 16009 let val = (self.0 >> 5usize) & 0x01;
19151 let offs = 1usize + n * 1usize; 16010 super::vals::Lbdl(val as u8)
19152 let val = (self.0 >> offs) & 0x01;
19153 val != 0
19154 } 16011 }
19155 #[doc = "Capture/Compare 1 interrupt enable"] 16012 #[doc = "lin break detection length"]
19156 pub fn set_ccie(&mut self, n: usize, val: bool) { 16013 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
19157 assert!(n < 4usize); 16014 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
19158 let offs = 1usize + n * 1usize;
19159 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19160 } 16015 }
19161 #[doc = "Trigger interrupt enable"] 16016 #[doc = "LIN break detection interrupt enable"]
19162 pub const fn tie(&self) -> bool { 16017 pub const fn lbdie(&self) -> bool {
19163 let val = (self.0 >> 6usize) & 0x01; 16018 let val = (self.0 >> 6usize) & 0x01;
19164 val != 0 16019 val != 0
19165 } 16020 }
19166 #[doc = "Trigger interrupt enable"] 16021 #[doc = "LIN break detection interrupt enable"]
19167 pub fn set_tie(&mut self, val: bool) { 16022 pub fn set_lbdie(&mut self, val: bool) {
19168 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 16023 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
19169 } 16024 }
19170 #[doc = "Update DMA request enable"] 16025 #[doc = "Last bit clock pulse"]
19171 pub const fn ude(&self) -> bool { 16026 pub const fn lbcl(&self) -> bool {
19172 let val = (self.0 >> 8usize) & 0x01; 16027 let val = (self.0 >> 8usize) & 0x01;
19173 val != 0 16028 val != 0
19174 } 16029 }
19175 #[doc = "Update DMA request enable"] 16030 #[doc = "Last bit clock pulse"]
19176 pub fn set_ude(&mut self, val: bool) { 16031 pub fn set_lbcl(&mut self, val: bool) {
19177 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 16032 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
19178 } 16033 }
19179 #[doc = "Capture/Compare 1 DMA request enable"] 16034 #[doc = "Clock phase"]
19180 pub fn ccde(&self, n: usize) -> bool { 16035 pub const fn cpha(&self) -> super::vals::Cpha {
19181 assert!(n < 4usize); 16036 let val = (self.0 >> 9usize) & 0x01;
19182 let offs = 9usize + n * 1usize; 16037 super::vals::Cpha(val as u8)
19183 let val = (self.0 >> offs) & 0x01;
19184 val != 0
19185 } 16038 }
19186 #[doc = "Capture/Compare 1 DMA request enable"] 16039 #[doc = "Clock phase"]
19187 pub fn set_ccde(&mut self, n: usize, val: bool) { 16040 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
19188 assert!(n < 4usize); 16041 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
19189 let offs = 9usize + n * 1usize;
19190 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19191 } 16042 }
19192 #[doc = "Trigger DMA request enable"] 16043 #[doc = "Clock polarity"]
19193 pub const fn tde(&self) -> bool { 16044 pub const fn cpol(&self) -> super::vals::Cpol {
19194 let val = (self.0 >> 14usize) & 0x01; 16045 let val = (self.0 >> 10usize) & 0x01;
19195 val != 0 16046 super::vals::Cpol(val as u8)
19196 } 16047 }
19197 #[doc = "Trigger DMA request enable"] 16048 #[doc = "Clock polarity"]
19198 pub fn set_tde(&mut self, val: bool) { 16049 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
19199 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 16050 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
19200 } 16051 }
19201 } 16052 #[doc = "Clock enable"]
19202 impl Default for DierGp { 16053 pub const fn clken(&self) -> bool {
19203 fn default() -> DierGp { 16054 let val = (self.0 >> 11usize) & 0x01;
19204 DierGp(0) 16055 val != 0
19205 } 16056 }
19206 } 16057 #[doc = "Clock enable"]
19207 #[doc = "DMA address for full transfer"] 16058 pub fn set_clken(&mut self, val: bool) {
19208 #[repr(transparent)] 16059 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
19209 #[derive(Copy, Clone, Eq, PartialEq)]
19210 pub struct Dmar(pub u32);
19211 impl Dmar {
19212 #[doc = "DMA register for burst accesses"]
19213 pub const fn dmab(&self) -> u16 {
19214 let val = (self.0 >> 0usize) & 0xffff;
19215 val as u16
19216 } 16060 }
19217 #[doc = "DMA register for burst accesses"] 16061 #[doc = "STOP bits"]
19218 pub fn set_dmab(&mut self, val: u16) { 16062 pub const fn stop(&self) -> super::vals::Stop {
19219 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 16063 let val = (self.0 >> 12usize) & 0x03;
16064 super::vals::Stop(val as u8)
19220 } 16065 }
19221 } 16066 #[doc = "STOP bits"]
19222 impl Default for Dmar { 16067 pub fn set_stop(&mut self, val: super::vals::Stop) {
19223 fn default() -> Dmar { 16068 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
19224 Dmar(0)
19225 } 16069 }
19226 } 16070 #[doc = "LIN mode enable"]
19227 #[doc = "counter"] 16071 pub const fn linen(&self) -> bool {
19228 #[repr(transparent)] 16072 let val = (self.0 >> 14usize) & 0x01;
19229 #[derive(Copy, Clone, Eq, PartialEq)] 16073 val != 0
19230 pub struct Cnt16(pub u32);
19231 impl Cnt16 {
19232 #[doc = "counter value"]
19233 pub const fn cnt(&self) -> u16 {
19234 let val = (self.0 >> 0usize) & 0xffff;
19235 val as u16
19236 } 16074 }
19237 #[doc = "counter value"] 16075 #[doc = "LIN mode enable"]
19238 pub fn set_cnt(&mut self, val: u16) { 16076 pub fn set_linen(&mut self, val: bool) {
19239 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 16077 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
19240 } 16078 }
19241 } 16079 }
19242 impl Default for Cnt16 { 16080 impl Default for Cr2Usart {
19243 fn default() -> Cnt16 { 16081 fn default() -> Cr2Usart {
19244 Cnt16(0) 16082 Cr2Usart(0)
19245 } 16083 }
19246 } 16084 }
19247 #[doc = "capture/compare mode register 2 (output mode)"] 16085 #[doc = "Control register 1"]
19248 #[repr(transparent)] 16086 #[repr(transparent)]
19249 #[derive(Copy, Clone, Eq, PartialEq)] 16087 #[derive(Copy, Clone, Eq, PartialEq)]
19250 pub struct CcmrOutput(pub u32); 16088 pub struct Cr1(pub u32);
19251 impl CcmrOutput { 16089 impl Cr1 {
19252 #[doc = "Capture/Compare 3 selection"] 16090 #[doc = "Send break"]
19253 pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs { 16091 pub const fn sbk(&self) -> super::vals::Sbk {
19254 assert!(n < 2usize); 16092 let val = (self.0 >> 0usize) & 0x01;
19255 let offs = 0usize + n * 8usize; 16093 super::vals::Sbk(val as u8)
19256 let val = (self.0 >> offs) & 0x03;
19257 super::vals::CcmrOutputCcs(val as u8)
19258 } 16094 }
19259 #[doc = "Capture/Compare 3 selection"] 16095 #[doc = "Send break"]
19260 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) { 16096 pub fn set_sbk(&mut self, val: super::vals::Sbk) {
19261 assert!(n < 2usize); 16097 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
19262 let offs = 0usize + n * 8usize;
19263 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
19264 } 16098 }
19265 #[doc = "Output compare 3 fast enable"] 16099 #[doc = "Receiver wakeup"]
19266 pub fn ocfe(&self, n: usize) -> bool { 16100 pub const fn rwu(&self) -> super::vals::Rwu {
19267 assert!(n < 2usize); 16101 let val = (self.0 >> 1usize) & 0x01;
19268 let offs = 2usize + n * 8usize; 16102 super::vals::Rwu(val as u8)
19269 let val = (self.0 >> offs) & 0x01;
19270 val != 0
19271 } 16103 }
19272 #[doc = "Output compare 3 fast enable"] 16104 #[doc = "Receiver wakeup"]
19273 pub fn set_ocfe(&mut self, n: usize, val: bool) { 16105 pub fn set_rwu(&mut self, val: super::vals::Rwu) {
19274 assert!(n < 2usize); 16106 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
19275 let offs = 2usize + n * 8usize;
19276 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19277 } 16107 }
19278 #[doc = "Output compare 3 preload enable"] 16108 #[doc = "Receiver enable"]
19279 pub fn ocpe(&self, n: usize) -> super::vals::Ocpe { 16109 pub const fn re(&self) -> bool {
19280 assert!(n < 2usize); 16110 let val = (self.0 >> 2usize) & 0x01;
19281 let offs = 3usize + n * 8usize; 16111 val != 0
19282 let val = (self.0 >> offs) & 0x01;
19283 super::vals::Ocpe(val as u8)
19284 } 16112 }
19285 #[doc = "Output compare 3 preload enable"] 16113 #[doc = "Receiver enable"]
19286 pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) { 16114 pub fn set_re(&mut self, val: bool) {
19287 assert!(n < 2usize); 16115 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
19288 let offs = 3usize + n * 8usize;
19289 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
19290 } 16116 }
19291 #[doc = "Output compare 3 mode"] 16117 #[doc = "Transmitter enable"]
19292 pub fn ocm(&self, n: usize) -> super::vals::Ocm { 16118 pub const fn te(&self) -> bool {
19293 assert!(n < 2usize); 16119 let val = (self.0 >> 3usize) & 0x01;
19294 let offs = 4usize + n * 8usize; 16120 val != 0
19295 let val = (self.0 >> offs) & 0x07;
19296 super::vals::Ocm(val as u8)
19297 } 16121 }
19298 #[doc = "Output compare 3 mode"] 16122 #[doc = "Transmitter enable"]
19299 pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) { 16123 pub fn set_te(&mut self, val: bool) {
19300 assert!(n < 2usize); 16124 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
19301 let offs = 4usize + n * 8usize;
19302 self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs);
19303 } 16125 }
19304 #[doc = "Output compare 3 clear enable"] 16126 #[doc = "IDLE interrupt enable"]
19305 pub fn occe(&self, n: usize) -> bool { 16127 pub const fn idleie(&self) -> bool {
19306 assert!(n < 2usize); 16128 let val = (self.0 >> 4usize) & 0x01;
19307 let offs = 7usize + n * 8usize;
19308 let val = (self.0 >> offs) & 0x01;
19309 val != 0 16129 val != 0
19310 } 16130 }
19311 #[doc = "Output compare 3 clear enable"] 16131 #[doc = "IDLE interrupt enable"]
19312 pub fn set_occe(&mut self, n: usize, val: bool) { 16132 pub fn set_idleie(&mut self, val: bool) {
19313 assert!(n < 2usize); 16133 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
19314 let offs = 7usize + n * 8usize;
19315 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19316 }
19317 }
19318 impl Default for CcmrOutput {
19319 fn default() -> CcmrOutput {
19320 CcmrOutput(0)
19321 } 16134 }
19322 } 16135 #[doc = "RXNE interrupt enable"]
19323 #[doc = "control register 2"] 16136 pub const fn rxneie(&self) -> bool {
19324 #[repr(transparent)] 16137 let val = (self.0 >> 5usize) & 0x01;
19325 #[derive(Copy, Clone, Eq, PartialEq)] 16138 val != 0
19326 pub struct Cr2Gp(pub u32);
19327 impl Cr2Gp {
19328 #[doc = "Capture/compare DMA selection"]
19329 pub const fn ccds(&self) -> super::vals::Ccds {
19330 let val = (self.0 >> 3usize) & 0x01;
19331 super::vals::Ccds(val as u8)
19332 } 16139 }
19333 #[doc = "Capture/compare DMA selection"] 16140 #[doc = "RXNE interrupt enable"]
19334 pub fn set_ccds(&mut self, val: super::vals::Ccds) { 16141 pub fn set_rxneie(&mut self, val: bool) {
19335 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 16142 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
19336 } 16143 }
19337 #[doc = "Master mode selection"] 16144 #[doc = "Transmission complete interrupt enable"]
19338 pub const fn mms(&self) -> super::vals::Mms { 16145 pub const fn tcie(&self) -> bool {
19339 let val = (self.0 >> 4usize) & 0x07; 16146 let val = (self.0 >> 6usize) & 0x01;
19340 super::vals::Mms(val as u8) 16147 val != 0
19341 } 16148 }
19342 #[doc = "Master mode selection"] 16149 #[doc = "Transmission complete interrupt enable"]
19343 pub fn set_mms(&mut self, val: super::vals::Mms) { 16150 pub fn set_tcie(&mut self, val: bool) {
19344 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 16151 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
19345 } 16152 }
19346 #[doc = "TI1 selection"] 16153 #[doc = "TXE interrupt enable"]
19347 pub const fn ti1s(&self) -> super::vals::Tis { 16154 pub const fn txeie(&self) -> bool {
19348 let val = (self.0 >> 7usize) & 0x01; 16155 let val = (self.0 >> 7usize) & 0x01;
19349 super::vals::Tis(val as u8)
19350 }
19351 #[doc = "TI1 selection"]
19352 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
19353 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
19354 }
19355 }
19356 impl Default for Cr2Gp {
19357 fn default() -> Cr2Gp {
19358 Cr2Gp(0)
19359 }
19360 }
19361 #[doc = "DMA/Interrupt enable register"]
19362 #[repr(transparent)]
19363 #[derive(Copy, Clone, Eq, PartialEq)]
19364 pub struct DierBasic(pub u32);
19365 impl DierBasic {
19366 #[doc = "Update interrupt enable"]
19367 pub const fn uie(&self) -> bool {
19368 let val = (self.0 >> 0usize) & 0x01;
19369 val != 0 16156 val != 0
19370 } 16157 }
19371 #[doc = "Update interrupt enable"] 16158 #[doc = "TXE interrupt enable"]
19372 pub fn set_uie(&mut self, val: bool) { 16159 pub fn set_txeie(&mut self, val: bool) {
19373 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 16160 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
19374 } 16161 }
19375 #[doc = "Update DMA request enable"] 16162 #[doc = "PE interrupt enable"]
19376 pub const fn ude(&self) -> bool { 16163 pub const fn peie(&self) -> bool {
19377 let val = (self.0 >> 8usize) & 0x01; 16164 let val = (self.0 >> 8usize) & 0x01;
19378 val != 0 16165 val != 0
19379 } 16166 }
19380 #[doc = "Update DMA request enable"] 16167 #[doc = "PE interrupt enable"]
19381 pub fn set_ude(&mut self, val: bool) { 16168 pub fn set_peie(&mut self, val: bool) {
19382 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 16169 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
19383 } 16170 }
19384 } 16171 #[doc = "Parity selection"]
19385 impl Default for DierBasic { 16172 pub const fn ps(&self) -> super::vals::Ps {
19386 fn default() -> DierBasic { 16173 let val = (self.0 >> 9usize) & 0x01;
19387 DierBasic(0) 16174 super::vals::Ps(val as u8)
19388 }
19389 }
19390 #[doc = "capture/compare mode register 1 (input mode)"]
19391 #[repr(transparent)]
19392 #[derive(Copy, Clone, Eq, PartialEq)]
19393 pub struct CcmrInput(pub u32);
19394 impl CcmrInput {
19395 #[doc = "Capture/Compare 1 selection"]
19396 pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs {
19397 assert!(n < 2usize);
19398 let offs = 0usize + n * 8usize;
19399 let val = (self.0 >> offs) & 0x03;
19400 super::vals::CcmrInputCcs(val as u8)
19401 }
19402 #[doc = "Capture/Compare 1 selection"]
19403 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) {
19404 assert!(n < 2usize);
19405 let offs = 0usize + n * 8usize;
19406 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
19407 }
19408 #[doc = "Input capture 1 prescaler"]
19409 pub fn icpsc(&self, n: usize) -> u8 {
19410 assert!(n < 2usize);
19411 let offs = 2usize + n * 8usize;
19412 let val = (self.0 >> offs) & 0x03;
19413 val as u8
19414 }
19415 #[doc = "Input capture 1 prescaler"]
19416 pub fn set_icpsc(&mut self, n: usize, val: u8) {
19417 assert!(n < 2usize);
19418 let offs = 2usize + n * 8usize;
19419 self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs);
19420 }
19421 #[doc = "Input capture 1 filter"]
19422 pub fn icf(&self, n: usize) -> super::vals::Icf {
19423 assert!(n < 2usize);
19424 let offs = 4usize + n * 8usize;
19425 let val = (self.0 >> offs) & 0x0f;
19426 super::vals::Icf(val as u8)
19427 }
19428 #[doc = "Input capture 1 filter"]
19429 pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) {
19430 assert!(n < 2usize);
19431 let offs = 4usize + n * 8usize;
19432 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
19433 }
19434 }
19435 impl Default for CcmrInput {
19436 fn default() -> CcmrInput {
19437 CcmrInput(0)
19438 }
19439 }
19440 #[doc = "slave mode control register"]
19441 #[repr(transparent)]
19442 #[derive(Copy, Clone, Eq, PartialEq)]
19443 pub struct Smcr(pub u32);
19444 impl Smcr {
19445 #[doc = "Slave mode selection"]
19446 pub const fn sms(&self) -> super::vals::Sms {
19447 let val = (self.0 >> 0usize) & 0x07;
19448 super::vals::Sms(val as u8)
19449 }
19450 #[doc = "Slave mode selection"]
19451 pub fn set_sms(&mut self, val: super::vals::Sms) {
19452 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
19453 }
19454 #[doc = "Trigger selection"]
19455 pub const fn ts(&self) -> super::vals::Ts {
19456 let val = (self.0 >> 4usize) & 0x07;
19457 super::vals::Ts(val as u8)
19458 }
19459 #[doc = "Trigger selection"]
19460 pub fn set_ts(&mut self, val: super::vals::Ts) {
19461 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
19462 }
19463 #[doc = "Master/Slave mode"]
19464 pub const fn msm(&self) -> super::vals::Msm {
19465 let val = (self.0 >> 7usize) & 0x01;
19466 super::vals::Msm(val as u8)
19467 } 16175 }
19468 #[doc = "Master/Slave mode"] 16176 #[doc = "Parity selection"]
19469 pub fn set_msm(&mut self, val: super::vals::Msm) { 16177 pub fn set_ps(&mut self, val: super::vals::Ps) {
19470 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 16178 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
19471 } 16179 }
19472 #[doc = "External trigger filter"] 16180 #[doc = "Parity control enable"]
19473 pub const fn etf(&self) -> super::vals::Etf { 16181 pub const fn pce(&self) -> bool {
19474 let val = (self.0 >> 8usize) & 0x0f; 16182 let val = (self.0 >> 10usize) & 0x01;
19475 super::vals::Etf(val as u8) 16183 val != 0
19476 } 16184 }
19477 #[doc = "External trigger filter"] 16185 #[doc = "Parity control enable"]
19478 pub fn set_etf(&mut self, val: super::vals::Etf) { 16186 pub fn set_pce(&mut self, val: bool) {
19479 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); 16187 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
19480 } 16188 }
19481 #[doc = "External trigger prescaler"] 16189 #[doc = "Wakeup method"]
19482 pub const fn etps(&self) -> super::vals::Etps { 16190 pub const fn wake(&self) -> super::vals::Wake {
19483 let val = (self.0 >> 12usize) & 0x03; 16191 let val = (self.0 >> 11usize) & 0x01;
19484 super::vals::Etps(val as u8) 16192 super::vals::Wake(val as u8)
19485 } 16193 }
19486 #[doc = "External trigger prescaler"] 16194 #[doc = "Wakeup method"]
19487 pub fn set_etps(&mut self, val: super::vals::Etps) { 16195 pub fn set_wake(&mut self, val: super::vals::Wake) {
19488 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); 16196 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
19489 } 16197 }
19490 #[doc = "External clock enable"] 16198 #[doc = "Word length"]
19491 pub const fn ece(&self) -> super::vals::Ece { 16199 pub const fn m(&self) -> super::vals::M {
19492 let val = (self.0 >> 14usize) & 0x01; 16200 let val = (self.0 >> 12usize) & 0x01;
19493 super::vals::Ece(val as u8) 16201 super::vals::M(val as u8)
19494 } 16202 }
19495 #[doc = "External clock enable"] 16203 #[doc = "Word length"]
19496 pub fn set_ece(&mut self, val: super::vals::Ece) { 16204 pub fn set_m(&mut self, val: super::vals::M) {
19497 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 16205 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
19498 } 16206 }
19499 #[doc = "External trigger polarity"] 16207 #[doc = "USART enable"]
19500 pub const fn etp(&self) -> super::vals::Etp { 16208 pub const fn ue(&self) -> bool {
19501 let val = (self.0 >> 15usize) & 0x01; 16209 let val = (self.0 >> 13usize) & 0x01;
19502 super::vals::Etp(val as u8) 16210 val != 0
19503 } 16211 }
19504 #[doc = "External trigger polarity"] 16212 #[doc = "USART enable"]
19505 pub fn set_etp(&mut self, val: super::vals::Etp) { 16213 pub fn set_ue(&mut self, val: bool) {
19506 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 16214 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
19507 } 16215 }
19508 } 16216 }
19509 impl Default for Smcr { 16217 impl Default for Cr1 {
19510 fn default() -> Smcr { 16218 fn default() -> Cr1 {
19511 Smcr(0) 16219 Cr1(0)
19512 } 16220 }
19513 } 16221 }
19514 #[doc = "event generation register"] 16222 #[doc = "Control register 2"]
19515 #[repr(transparent)] 16223 #[repr(transparent)]
19516 #[derive(Copy, Clone, Eq, PartialEq)] 16224 #[derive(Copy, Clone, Eq, PartialEq)]
19517 pub struct EgrGp(pub u32); 16225 pub struct Cr2(pub u32);
19518 impl EgrGp { 16226 impl Cr2 {
19519 #[doc = "Update generation"] 16227 #[doc = "Address of the USART node"]
19520 pub const fn ug(&self) -> bool { 16228 pub const fn add(&self) -> u8 {
19521 let val = (self.0 >> 0usize) & 0x01; 16229 let val = (self.0 >> 0usize) & 0x0f;
19522 val != 0 16230 val as u8
19523 }
19524 #[doc = "Update generation"]
19525 pub fn set_ug(&mut self, val: bool) {
19526 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
19527 }
19528 #[doc = "Capture/compare 1 generation"]
19529 pub fn ccg(&self, n: usize) -> bool {
19530 assert!(n < 4usize);
19531 let offs = 1usize + n * 1usize;
19532 let val = (self.0 >> offs) & 0x01;
19533 val != 0
19534 } 16231 }
19535 #[doc = "Capture/compare 1 generation"] 16232 #[doc = "Address of the USART node"]
19536 pub fn set_ccg(&mut self, n: usize, val: bool) { 16233 pub fn set_add(&mut self, val: u8) {
19537 assert!(n < 4usize); 16234 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
19538 let offs = 1usize + n * 1usize;
19539 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19540 } 16235 }
19541 #[doc = "Capture/Compare control update generation"] 16236 #[doc = "lin break detection length"]
19542 pub const fn comg(&self) -> bool { 16237 pub const fn lbdl(&self) -> super::vals::Lbdl {
19543 let val = (self.0 >> 5usize) & 0x01; 16238 let val = (self.0 >> 5usize) & 0x01;
19544 val != 0 16239 super::vals::Lbdl(val as u8)
19545 } 16240 }
19546 #[doc = "Capture/Compare control update generation"] 16241 #[doc = "lin break detection length"]
19547 pub fn set_comg(&mut self, val: bool) { 16242 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
19548 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 16243 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
19549 } 16244 }
19550 #[doc = "Trigger generation"] 16245 #[doc = "LIN break detection interrupt enable"]
19551 pub const fn tg(&self) -> bool { 16246 pub const fn lbdie(&self) -> bool {
19552 let val = (self.0 >> 6usize) & 0x01; 16247 let val = (self.0 >> 6usize) & 0x01;
19553 val != 0 16248 val != 0
19554 } 16249 }
19555 #[doc = "Trigger generation"] 16250 #[doc = "LIN break detection interrupt enable"]
19556 pub fn set_tg(&mut self, val: bool) { 16251 pub fn set_lbdie(&mut self, val: bool) {
19557 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 16252 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
19558 } 16253 }
19559 #[doc = "Break generation"] 16254 #[doc = "STOP bits"]
19560 pub const fn bg(&self) -> bool { 16255 pub const fn stop(&self) -> super::vals::Stop {
19561 let val = (self.0 >> 7usize) & 0x01; 16256 let val = (self.0 >> 12usize) & 0x03;
16257 super::vals::Stop(val as u8)
16258 }
16259 #[doc = "STOP bits"]
16260 pub fn set_stop(&mut self, val: super::vals::Stop) {
16261 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
16262 }
16263 #[doc = "LIN mode enable"]
16264 pub const fn linen(&self) -> bool {
16265 let val = (self.0 >> 14usize) & 0x01;
19562 val != 0 16266 val != 0
19563 } 16267 }
19564 #[doc = "Break generation"] 16268 #[doc = "LIN mode enable"]
19565 pub fn set_bg(&mut self, val: bool) { 16269 pub fn set_linen(&mut self, val: bool) {
19566 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 16270 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
19567 } 16271 }
19568 } 16272 }
19569 impl Default for EgrGp { 16273 impl Default for Cr2 {
19570 fn default() -> EgrGp { 16274 fn default() -> Cr2 {
19571 EgrGp(0) 16275 Cr2(0)
19572 } 16276 }
19573 } 16277 }
19574 #[doc = "control register 2"] 16278 #[doc = "Guard time and prescaler register"]
19575 #[repr(transparent)] 16279 #[repr(transparent)]
19576 #[derive(Copy, Clone, Eq, PartialEq)] 16280 #[derive(Copy, Clone, Eq, PartialEq)]
19577 pub struct Cr2Basic(pub u32); 16281 pub struct Gtpr(pub u32);
19578 impl Cr2Basic { 16282 impl Gtpr {
19579 #[doc = "Master mode selection"] 16283 #[doc = "Prescaler value"]
19580 pub const fn mms(&self) -> super::vals::Mms { 16284 pub const fn psc(&self) -> u8 {
19581 let val = (self.0 >> 4usize) & 0x07; 16285 let val = (self.0 >> 0usize) & 0xff;
19582 super::vals::Mms(val as u8) 16286 val as u8
19583 } 16287 }
19584 #[doc = "Master mode selection"] 16288 #[doc = "Prescaler value"]
19585 pub fn set_mms(&mut self, val: super::vals::Mms) { 16289 pub fn set_psc(&mut self, val: u8) {
19586 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 16290 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
19587 } 16291 }
19588 } 16292 #[doc = "Guard time value"]
19589 impl Default for Cr2Basic { 16293 pub const fn gt(&self) -> u8 {
19590 fn default() -> Cr2Basic { 16294 let val = (self.0 >> 8usize) & 0xff;
19591 Cr2Basic(0) 16295 val as u8
16296 }
16297 #[doc = "Guard time value"]
16298 pub fn set_gt(&mut self, val: u8) {
16299 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
19592 } 16300 }
19593 } 16301 }
19594 } 16302 impl Default for Gtpr {
19595} 16303 fn default() -> Gtpr {
19596pub mod gpio_v2 { 16304 Gtpr(0)
19597 use crate::generic::*; 16305 }
19598 #[doc = "General-purpose I/Os"]
19599 #[derive(Copy, Clone)]
19600 pub struct Gpio(pub *mut u8);
19601 unsafe impl Send for Gpio {}
19602 unsafe impl Sync for Gpio {}
19603 impl Gpio {
19604 #[doc = "GPIO port mode register"]
19605 pub fn moder(self) -> Reg<regs::Moder, RW> {
19606 unsafe { Reg::from_ptr(self.0.add(0usize)) }
19607 }
19608 #[doc = "GPIO port output type register"]
19609 pub fn otyper(self) -> Reg<regs::Otyper, RW> {
19610 unsafe { Reg::from_ptr(self.0.add(4usize)) }
19611 }
19612 #[doc = "GPIO port output speed register"]
19613 pub fn ospeedr(self) -> Reg<regs::Ospeedr, RW> {
19614 unsafe { Reg::from_ptr(self.0.add(8usize)) }
19615 }
19616 #[doc = "GPIO port pull-up/pull-down register"]
19617 pub fn pupdr(self) -> Reg<regs::Pupdr, RW> {
19618 unsafe { Reg::from_ptr(self.0.add(12usize)) }
19619 }
19620 #[doc = "GPIO port input data register"]
19621 pub fn idr(self) -> Reg<regs::Idr, R> {
19622 unsafe { Reg::from_ptr(self.0.add(16usize)) }
19623 }
19624 #[doc = "GPIO port output data register"]
19625 pub fn odr(self) -> Reg<regs::Odr, RW> {
19626 unsafe { Reg::from_ptr(self.0.add(20usize)) }
19627 }
19628 #[doc = "GPIO port bit set/reset register"]
19629 pub fn bsrr(self) -> Reg<regs::Bsrr, W> {
19630 unsafe { Reg::from_ptr(self.0.add(24usize)) }
19631 }
19632 #[doc = "GPIO port configuration lock register"]
19633 pub fn lckr(self) -> Reg<regs::Lckr, RW> {
19634 unsafe { Reg::from_ptr(self.0.add(28usize)) }
19635 }
19636 #[doc = "GPIO alternate function register (low, high)"]
19637 pub fn afr(self, n: usize) -> Reg<regs::Afr, RW> {
19638 assert!(n < 2usize);
19639 unsafe { Reg::from_ptr(self.0.add(32usize + n * 4usize)) }
19640 } 16306 }
19641 } 16307 }
19642 pub mod vals { 16308 pub mod vals {
19643 use crate::generic::*; 16309 use crate::generic::*;
19644 #[repr(transparent)] 16310 #[repr(transparent)]
19645 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16311 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19646 pub struct Bsw(pub u8); 16312 pub struct Rwu(pub u8);
19647 impl Bsw { 16313 impl Rwu {
19648 #[doc = "Sets the corresponding ODRx bit"] 16314 #[doc = "Receiver in active mode"]
19649 pub const SET: Self = Self(0x01); 16315 pub const ACTIVE: Self = Self(0);
16316 #[doc = "Receiver in mute mode"]
16317 pub const MUTE: Self = Self(0x01);
19650 } 16318 }
19651 #[repr(transparent)] 16319 #[repr(transparent)]
19652 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16320 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19653 pub struct Pupdr(pub u8); 16321 pub struct Lbdl(pub u8);
19654 impl Pupdr { 16322 impl Lbdl {
19655 #[doc = "No pull-up, pull-down"] 16323 #[doc = "10-bit break detection"]
19656 pub const FLOATING: Self = Self(0); 16324 pub const LBDL10: Self = Self(0);
19657 #[doc = "Pull-up"] 16325 #[doc = "11-bit break detection"]
19658 pub const PULLUP: Self = Self(0x01); 16326 pub const LBDL11: Self = Self(0x01);
19659 #[doc = "Pull-down"]
19660 pub const PULLDOWN: Self = Self(0x02);
19661 } 16327 }
19662 #[repr(transparent)] 16328 #[repr(transparent)]
19663 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16329 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19664 pub struct Odr(pub u8); 16330 pub struct Wake(pub u8);
19665 impl Odr { 16331 impl Wake {
19666 #[doc = "Set output to logic low"] 16332 #[doc = "USART wakeup on idle line"]
19667 pub const LOW: Self = Self(0); 16333 pub const IDLELINE: Self = Self(0);
19668 #[doc = "Set output to logic high"] 16334 #[doc = "USART wakeup on address mark"]
19669 pub const HIGH: Self = Self(0x01); 16335 pub const ADDRESSMARK: Self = Self(0x01);
19670 } 16336 }
19671 #[repr(transparent)] 16337 #[repr(transparent)]
19672 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16338 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19673 pub struct Idr(pub u8); 16339 pub struct Cpol(pub u8);
19674 impl Idr { 16340 impl Cpol {
19675 #[doc = "Input is logic low"] 16341 #[doc = "Steady low value on CK pin outside transmission window"]
19676 pub const LOW: Self = Self(0); 16342 pub const LOW: Self = Self(0);
19677 #[doc = "Input is logic high"] 16343 #[doc = "Steady high value on CK pin outside transmission window"]
19678 pub const HIGH: Self = Self(0x01); 16344 pub const HIGH: Self = Self(0x01);
19679 } 16345 }
19680 #[repr(transparent)] 16346 #[repr(transparent)]
19681 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16347 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19682 pub struct Lckk(pub u8); 16348 pub struct Cpha(pub u8);
19683 impl Lckk { 16349 impl Cpha {
19684 #[doc = "Port configuration lock key not active"] 16350 #[doc = "The first clock transition is the first data capture edge"]
19685 pub const NOTACTIVE: Self = Self(0); 16351 pub const FIRST: Self = Self(0);
19686 #[doc = "Port configuration lock key active"] 16352 #[doc = "The second clock transition is the first data capture edge"]
19687 pub const ACTIVE: Self = Self(0x01); 16353 pub const SECOND: Self = Self(0x01);
19688 } 16354 }
19689 #[repr(transparent)] 16355 #[repr(transparent)]
19690 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16356 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19691 pub struct Brw(pub u8); 16357 pub struct Sbk(pub u8);
19692 impl Brw { 16358 impl Sbk {
19693 #[doc = "Resets the corresponding ODRx bit"] 16359 #[doc = "No break character is transmitted"]
19694 pub const RESET: Self = Self(0x01); 16360 pub const NOBREAK: Self = Self(0);
16361 #[doc = "Break character transmitted"]
16362 pub const BREAK: Self = Self(0x01);
19695 } 16363 }
19696 #[repr(transparent)] 16364 #[repr(transparent)]
19697 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16365 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19698 pub struct Moder(pub u8); 16366 pub struct M(pub u8);
19699 impl Moder { 16367 impl M {
19700 #[doc = "Input mode (reset state)"] 16368 #[doc = "8 data bits"]
19701 pub const INPUT: Self = Self(0); 16369 pub const M8: Self = Self(0);
19702 #[doc = "General purpose output mode"] 16370 #[doc = "9 data bits"]
19703 pub const OUTPUT: Self = Self(0x01); 16371 pub const M9: Self = Self(0x01);
19704 #[doc = "Alternate function mode"]
19705 pub const ALTERNATE: Self = Self(0x02);
19706 #[doc = "Analog mode"]
19707 pub const ANALOG: Self = Self(0x03);
19708 } 16372 }
19709 #[repr(transparent)] 16373 #[repr(transparent)]
19710 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16374 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19711 pub struct Afr(pub u8); 16375 pub struct Hdsel(pub u8);
19712 impl Afr { 16376 impl Hdsel {
19713 #[doc = "AF0"] 16377 #[doc = "Half duplex mode is not selected"]
19714 pub const AF0: Self = Self(0); 16378 pub const FULLDUPLEX: Self = Self(0);
19715 #[doc = "AF1"] 16379 #[doc = "Half duplex mode is selected"]
19716 pub const AF1: Self = Self(0x01); 16380 pub const HALFDUPLEX: Self = Self(0x01);
19717 #[doc = "AF2"]
19718 pub const AF2: Self = Self(0x02);
19719 #[doc = "AF3"]
19720 pub const AF3: Self = Self(0x03);
19721 #[doc = "AF4"]
19722 pub const AF4: Self = Self(0x04);
19723 #[doc = "AF5"]
19724 pub const AF5: Self = Self(0x05);
19725 #[doc = "AF6"]
19726 pub const AF6: Self = Self(0x06);
19727 #[doc = "AF7"]
19728 pub const AF7: Self = Self(0x07);
19729 #[doc = "AF8"]
19730 pub const AF8: Self = Self(0x08);
19731 #[doc = "AF9"]
19732 pub const AF9: Self = Self(0x09);
19733 #[doc = "AF10"]
19734 pub const AF10: Self = Self(0x0a);
19735 #[doc = "AF11"]
19736 pub const AF11: Self = Self(0x0b);
19737 #[doc = "AF12"]
19738 pub const AF12: Self = Self(0x0c);
19739 #[doc = "AF13"]
19740 pub const AF13: Self = Self(0x0d);
19741 #[doc = "AF14"]
19742 pub const AF14: Self = Self(0x0e);
19743 #[doc = "AF15"]
19744 pub const AF15: Self = Self(0x0f);
19745 } 16381 }
19746 #[repr(transparent)] 16382 #[repr(transparent)]
19747 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16383 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19748 pub struct Ospeedr(pub u8); 16384 pub struct Stop(pub u8);
19749 impl Ospeedr { 16385 impl Stop {
19750 #[doc = "Low speed"] 16386 #[doc = "1 stop bit"]
19751 pub const LOWSPEED: Self = Self(0); 16387 pub const STOP1: Self = Self(0);
19752 #[doc = "Medium speed"] 16388 #[doc = "0.5 stop bits"]
19753 pub const MEDIUMSPEED: Self = Self(0x01); 16389 pub const STOP0P5: Self = Self(0x01);
19754 #[doc = "High speed"] 16390 #[doc = "2 stop bits"]
19755 pub const HIGHSPEED: Self = Self(0x02); 16391 pub const STOP2: Self = Self(0x02);
19756 #[doc = "Very high speed"] 16392 #[doc = "1.5 stop bits"]
19757 pub const VERYHIGHSPEED: Self = Self(0x03); 16393 pub const STOP1P5: Self = Self(0x03);
19758 } 16394 }
19759 #[repr(transparent)] 16395 #[repr(transparent)]
19760 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16396 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19761 pub struct Ot(pub u8); 16397 pub struct Ps(pub u8);
19762 impl Ot { 16398 impl Ps {
19763 #[doc = "Output push-pull (reset state)"] 16399 #[doc = "Even parity"]
19764 pub const PUSHPULL: Self = Self(0); 16400 pub const EVEN: Self = Self(0);
19765 #[doc = "Output open-drain"] 16401 #[doc = "Odd parity"]
19766 pub const OPENDRAIN: Self = Self(0x01); 16402 pub const ODD: Self = Self(0x01);
19767 } 16403 }
19768 #[repr(transparent)] 16404 #[repr(transparent)]
19769 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 16405 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
19770 pub struct Lck(pub u8); 16406 pub struct Irlp(pub u8);
19771 impl Lck { 16407 impl Irlp {
19772 #[doc = "Port configuration not locked"] 16408 #[doc = "Normal mode"]
19773 pub const UNLOCKED: Self = Self(0); 16409 pub const NORMAL: Self = Self(0);
19774 #[doc = "Port configuration locked"] 16410 #[doc = "Low-power mode"]
19775 pub const LOCKED: Self = Self(0x01); 16411 pub const LOWPOWER: Self = Self(0x01);
19776 } 16412 }
19777 } 16413 }
19778 pub mod regs { 16414}
19779 use crate::generic::*; 16415pub mod rng_v1 {
19780 #[doc = "GPIO port pull-up/pull-down register"] 16416 use crate::generic::*;
19781 #[repr(transparent)] 16417 #[doc = "Random number generator"]
19782 #[derive(Copy, Clone, Eq, PartialEq)] 16418 #[derive(Copy, Clone)]
19783 pub struct Pupdr(pub u32); 16419 pub struct Rng(pub *mut u8);
19784 impl Pupdr { 16420 unsafe impl Send for Rng {}
19785 #[doc = "Port x configuration bits (y = 0..15)"] 16421 unsafe impl Sync for Rng {}
19786 pub fn pupdr(&self, n: usize) -> super::vals::Pupdr { 16422 impl Rng {
19787 assert!(n < 16usize); 16423 #[doc = "control register"]
19788 let offs = 0usize + n * 2usize; 16424 pub fn cr(self) -> Reg<regs::Cr, RW> {
19789 let val = (self.0 >> offs) & 0x03; 16425 unsafe { Reg::from_ptr(self.0.add(0usize)) }
19790 super::vals::Pupdr(val as u8)
19791 }
19792 #[doc = "Port x configuration bits (y = 0..15)"]
19793 pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) {
19794 assert!(n < 16usize);
19795 let offs = 0usize + n * 2usize;
19796 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
19797 }
19798 }
19799 impl Default for Pupdr {
19800 fn default() -> Pupdr {
19801 Pupdr(0)
19802 }
19803 } 16426 }
19804 #[doc = "GPIO port configuration lock register"] 16427 #[doc = "status register"]
19805 #[repr(transparent)] 16428 pub fn sr(self) -> Reg<regs::Sr, RW> {
19806 #[derive(Copy, Clone, Eq, PartialEq)] 16429 unsafe { Reg::from_ptr(self.0.add(4usize)) }
19807 pub struct Lckr(pub u32);
19808 impl Lckr {
19809 #[doc = "Port x lock bit y (y= 0..15)"]
19810 pub fn lck(&self, n: usize) -> super::vals::Lck {
19811 assert!(n < 16usize);
19812 let offs = 0usize + n * 1usize;
19813 let val = (self.0 >> offs) & 0x01;
19814 super::vals::Lck(val as u8)
19815 }
19816 #[doc = "Port x lock bit y (y= 0..15)"]
19817 pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) {
19818 assert!(n < 16usize);
19819 let offs = 0usize + n * 1usize;
19820 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
19821 }
19822 #[doc = "Port x lock bit y (y= 0..15)"]
19823 pub const fn lckk(&self) -> super::vals::Lckk {
19824 let val = (self.0 >> 16usize) & 0x01;
19825 super::vals::Lckk(val as u8)
19826 }
19827 #[doc = "Port x lock bit y (y= 0..15)"]
19828 pub fn set_lckk(&mut self, val: super::vals::Lckk) {
19829 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
19830 }
19831 } 16430 }
19832 impl Default for Lckr { 16431 #[doc = "data register"]
19833 fn default() -> Lckr { 16432 pub fn dr(self) -> Reg<u32, R> {
19834 Lckr(0) 16433 unsafe { Reg::from_ptr(self.0.add(8usize)) }
19835 }
19836 } 16434 }
19837 #[doc = "GPIO port output type register"] 16435 }
16436 pub mod regs {
16437 use crate::generic::*;
16438 #[doc = "status register"]
19838 #[repr(transparent)] 16439 #[repr(transparent)]
19839 #[derive(Copy, Clone, Eq, PartialEq)] 16440 #[derive(Copy, Clone, Eq, PartialEq)]
19840 pub struct Otyper(pub u32); 16441 pub struct Sr(pub u32);
19841 impl Otyper { 16442 impl Sr {
19842 #[doc = "Port x configuration bits (y = 0..15)"] 16443 #[doc = "Data ready"]
19843 pub fn ot(&self, n: usize) -> super::vals::Ot { 16444 pub const fn drdy(&self) -> bool {
19844 assert!(n < 16usize); 16445 let val = (self.0 >> 0usize) & 0x01;
19845 let offs = 0usize + n * 1usize; 16446 val != 0
19846 let val = (self.0 >> offs) & 0x01;
19847 super::vals::Ot(val as u8)
19848 }
19849 #[doc = "Port x configuration bits (y = 0..15)"]
19850 pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) {
19851 assert!(n < 16usize);
19852 let offs = 0usize + n * 1usize;
19853 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
19854 } 16447 }
19855 } 16448 #[doc = "Data ready"]
19856 impl Default for Otyper { 16449 pub fn set_drdy(&mut self, val: bool) {
19857 fn default() -> Otyper { 16450 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
19858 Otyper(0)
19859 } 16451 }
19860 } 16452 #[doc = "Clock error current status"]
19861 #[doc = "GPIO port output speed register"] 16453 pub const fn cecs(&self) -> bool {
19862 #[repr(transparent)] 16454 let val = (self.0 >> 1usize) & 0x01;
19863 #[derive(Copy, Clone, Eq, PartialEq)] 16455 val != 0
19864 pub struct Ospeedr(pub u32);
19865 impl Ospeedr {
19866 #[doc = "Port x configuration bits (y = 0..15)"]
19867 pub fn ospeedr(&self, n: usize) -> super::vals::Ospeedr {
19868 assert!(n < 16usize);
19869 let offs = 0usize + n * 2usize;
19870 let val = (self.0 >> offs) & 0x03;
19871 super::vals::Ospeedr(val as u8)
19872 } 16456 }
19873 #[doc = "Port x configuration bits (y = 0..15)"] 16457 #[doc = "Clock error current status"]
19874 pub fn set_ospeedr(&mut self, n: usize, val: super::vals::Ospeedr) { 16458 pub fn set_cecs(&mut self, val: bool) {
19875 assert!(n < 16usize); 16459 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
19876 let offs = 0usize + n * 2usize;
19877 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
19878 } 16460 }
19879 } 16461 #[doc = "Seed error current status"]
19880 impl Default for Ospeedr { 16462 pub const fn secs(&self) -> bool {
19881 fn default() -> Ospeedr { 16463 let val = (self.0 >> 2usize) & 0x01;
19882 Ospeedr(0) 16464 val != 0
19883 } 16465 }
19884 } 16466 #[doc = "Seed error current status"]
19885 #[doc = "GPIO port output data register"] 16467 pub fn set_secs(&mut self, val: bool) {
19886 #[repr(transparent)] 16468 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
19887 #[derive(Copy, Clone, Eq, PartialEq)]
19888 pub struct Odr(pub u32);
19889 impl Odr {
19890 #[doc = "Port output data (y = 0..15)"]
19891 pub fn odr(&self, n: usize) -> super::vals::Odr {
19892 assert!(n < 16usize);
19893 let offs = 0usize + n * 1usize;
19894 let val = (self.0 >> offs) & 0x01;
19895 super::vals::Odr(val as u8)
19896 } 16469 }
19897 #[doc = "Port output data (y = 0..15)"] 16470 #[doc = "Clock error interrupt status"]
19898 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { 16471 pub const fn ceis(&self) -> bool {
19899 assert!(n < 16usize); 16472 let val = (self.0 >> 5usize) & 0x01;
19900 let offs = 0usize + n * 1usize; 16473 val != 0
19901 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
19902 } 16474 }
19903 } 16475 #[doc = "Clock error interrupt status"]
19904 impl Default for Odr { 16476 pub fn set_ceis(&mut self, val: bool) {
19905 fn default() -> Odr { 16477 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
19906 Odr(0)
19907 } 16478 }
19908 } 16479 #[doc = "Seed error interrupt status"]
19909 #[doc = "GPIO alternate function register"] 16480 pub const fn seis(&self) -> bool {
19910 #[repr(transparent)] 16481 let val = (self.0 >> 6usize) & 0x01;
19911 #[derive(Copy, Clone, Eq, PartialEq)] 16482 val != 0
19912 pub struct Afr(pub u32);
19913 impl Afr {
19914 #[doc = "Alternate function selection for port x bit y (y = 0..15)"]
19915 pub fn afr(&self, n: usize) -> super::vals::Afr {
19916 assert!(n < 8usize);
19917 let offs = 0usize + n * 4usize;
19918 let val = (self.0 >> offs) & 0x0f;
19919 super::vals::Afr(val as u8)
19920 } 16483 }
19921 #[doc = "Alternate function selection for port x bit y (y = 0..15)"] 16484 #[doc = "Seed error interrupt status"]
19922 pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) { 16485 pub fn set_seis(&mut self, val: bool) {
19923 assert!(n < 8usize); 16486 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
19924 let offs = 0usize + n * 4usize;
19925 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
19926 } 16487 }
19927 } 16488 }
19928 impl Default for Afr { 16489 impl Default for Sr {
19929 fn default() -> Afr { 16490 fn default() -> Sr {
19930 Afr(0) 16491 Sr(0)
19931 } 16492 }
19932 } 16493 }
19933 #[doc = "GPIO port bit set/reset register"] 16494 #[doc = "control register"]
19934 #[repr(transparent)] 16495 #[repr(transparent)]
19935 #[derive(Copy, Clone, Eq, PartialEq)] 16496 #[derive(Copy, Clone, Eq, PartialEq)]
19936 pub struct Bsrr(pub u32); 16497 pub struct Cr(pub u32);
19937 impl Bsrr { 16498 impl Cr {
19938 #[doc = "Port x set bit y (y= 0..15)"] 16499 #[doc = "Random number generator enable"]
19939 pub fn bs(&self, n: usize) -> bool { 16500 pub const fn rngen(&self) -> bool {
19940 assert!(n < 16usize); 16501 let val = (self.0 >> 2usize) & 0x01;
19941 let offs = 0usize + n * 1usize;
19942 let val = (self.0 >> offs) & 0x01;
19943 val != 0 16502 val != 0
19944 } 16503 }
19945 #[doc = "Port x set bit y (y= 0..15)"] 16504 #[doc = "Random number generator enable"]
19946 pub fn set_bs(&mut self, n: usize, val: bool) { 16505 pub fn set_rngen(&mut self, val: bool) {
19947 assert!(n < 16usize); 16506 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
19948 let offs = 0usize + n * 1usize;
19949 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19950 } 16507 }
19951 #[doc = "Port x set bit y (y= 0..15)"] 16508 #[doc = "Interrupt enable"]
19952 pub fn br(&self, n: usize) -> bool { 16509 pub const fn ie(&self) -> bool {
19953 assert!(n < 16usize); 16510 let val = (self.0 >> 3usize) & 0x01;
19954 let offs = 16usize + n * 1usize;
19955 let val = (self.0 >> offs) & 0x01;
19956 val != 0 16511 val != 0
19957 } 16512 }
19958 #[doc = "Port x set bit y (y= 0..15)"] 16513 #[doc = "Interrupt enable"]
19959 pub fn set_br(&mut self, n: usize, val: bool) { 16514 pub fn set_ie(&mut self, val: bool) {
19960 assert!(n < 16usize); 16515 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
19961 let offs = 16usize + n * 1usize;
19962 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
19963 } 16516 }
19964 } 16517 }
19965 impl Default for Bsrr { 16518 impl Default for Cr {
19966 fn default() -> Bsrr { 16519 fn default() -> Cr {
19967 Bsrr(0) 16520 Cr(0)
19968 } 16521 }
19969 } 16522 }
19970 #[doc = "GPIO port input data register"] 16523 }
19971 #[repr(transparent)] 16524}
19972 #[derive(Copy, Clone, Eq, PartialEq)] 16525pub mod generic {
19973 pub struct Idr(pub u32); 16526 use core::marker::PhantomData;
19974 impl Idr { 16527 #[derive(Copy, Clone)]
19975 #[doc = "Port input data (y = 0..15)"] 16528 pub struct RW;
19976 pub fn idr(&self, n: usize) -> super::vals::Idr { 16529 #[derive(Copy, Clone)]
19977 assert!(n < 16usize); 16530 pub struct R;
19978 let offs = 0usize + n * 1usize; 16531 #[derive(Copy, Clone)]
19979 let val = (self.0 >> offs) & 0x01; 16532 pub struct W;
19980 super::vals::Idr(val as u8) 16533 mod sealed {
19981 } 16534 use super::*;
19982 #[doc = "Port input data (y = 0..15)"] 16535 pub trait Access {}
19983 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { 16536 impl Access for R {}
19984 assert!(n < 16usize); 16537 impl Access for W {}
19985 let offs = 0usize + n * 1usize; 16538 impl Access for RW {}
19986 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); 16539 }
16540 pub trait Access: sealed::Access + Copy {}
16541 impl Access for R {}
16542 impl Access for W {}
16543 impl Access for RW {}
16544 pub trait Read: Access {}
16545 impl Read for RW {}
16546 impl Read for R {}
16547 pub trait Write: Access {}
16548 impl Write for RW {}
16549 impl Write for W {}
16550 #[derive(Copy, Clone)]
16551 pub struct Reg<T: Copy, A: Access> {
16552 ptr: *mut u8,
16553 phantom: PhantomData<*mut (T, A)>,
16554 }
16555 unsafe impl<T: Copy, A: Access> Send for Reg<T, A> {}
16556 unsafe impl<T: Copy, A: Access> Sync for Reg<T, A> {}
16557 impl<T: Copy, A: Access> Reg<T, A> {
16558 pub fn from_ptr(ptr: *mut u8) -> Self {
16559 Self {
16560 ptr,
16561 phantom: PhantomData,
19987 } 16562 }
19988 } 16563 }
19989 impl Default for Idr { 16564 pub fn ptr(&self) -> *mut T {
19990 fn default() -> Idr { 16565 self.ptr as _
19991 Idr(0)
19992 }
19993 } 16566 }
19994 #[doc = "GPIO port mode register"] 16567 }
19995 #[repr(transparent)] 16568 impl<T: Copy, A: Read> Reg<T, A> {
19996 #[derive(Copy, Clone, Eq, PartialEq)] 16569 pub unsafe fn read(&self) -> T {
19997 pub struct Moder(pub u32); 16570 (self.ptr as *mut T).read_volatile()
19998 impl Moder {
19999 #[doc = "Port x configuration bits (y = 0..15)"]
20000 pub fn moder(&self, n: usize) -> super::vals::Moder {
20001 assert!(n < 16usize);
20002 let offs = 0usize + n * 2usize;
20003 let val = (self.0 >> offs) & 0x03;
20004 super::vals::Moder(val as u8)
20005 }
20006 #[doc = "Port x configuration bits (y = 0..15)"]
20007 pub fn set_moder(&mut self, n: usize, val: super::vals::Moder) {
20008 assert!(n < 16usize);
20009 let offs = 0usize + n * 2usize;
20010 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
20011 }
20012 } 16571 }
20013 impl Default for Moder { 16572 }
20014 fn default() -> Moder { 16573 impl<T: Copy, A: Write> Reg<T, A> {
20015 Moder(0) 16574 pub unsafe fn write_value(&self, val: T) {
20016 } 16575 (self.ptr as *mut T).write_volatile(val)
16576 }
16577 }
16578 impl<T: Default + Copy, A: Write> Reg<T, A> {
16579 pub unsafe fn write<R>(&self, f: impl FnOnce(&mut T) -> R) -> R {
16580 let mut val = Default::default();
16581 let res = f(&mut val);
16582 self.write_value(val);
16583 res
16584 }
16585 }
16586 impl<T: Copy, A: Read + Write> Reg<T, A> {
16587 pub unsafe fn modify<R>(&self, f: impl FnOnce(&mut T) -> R) -> R {
16588 let mut val = self.read();
16589 let res = f(&mut val);
16590 self.write_value(val);
16591 res
20017 } 16592 }
20018 } 16593 }
20019} 16594}
20020pub mod i2c_v2 { 16595pub mod spi_v2 {
20021 use crate::generic::*; 16596 use crate::generic::*;
20022 #[doc = "Inter-integrated circuit"] 16597 #[doc = "Serial peripheral interface"]
20023 #[derive(Copy, Clone)] 16598 #[derive(Copy, Clone)]
20024 pub struct I2c(pub *mut u8); 16599 pub struct Spi(pub *mut u8);
20025 unsafe impl Send for I2c {} 16600 unsafe impl Send for Spi {}
20026 unsafe impl Sync for I2c {} 16601 unsafe impl Sync for Spi {}
20027 impl I2c { 16602 impl Spi {
20028 #[doc = "Control register 1"] 16603 #[doc = "control register 1"]
20029 pub fn cr1(self) -> Reg<regs::Cr1, RW> { 16604 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
20030 unsafe { Reg::from_ptr(self.0.add(0usize)) } 16605 unsafe { Reg::from_ptr(self.0.add(0usize)) }
20031 } 16606 }
20032 #[doc = "Control register 2"] 16607 #[doc = "control register 2"]
20033 pub fn cr2(self) -> Reg<regs::Cr2, RW> { 16608 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
20034 unsafe { Reg::from_ptr(self.0.add(4usize)) } 16609 unsafe { Reg::from_ptr(self.0.add(4usize)) }
20035 } 16610 }
20036 #[doc = "Own address register 1"] 16611 #[doc = "status register"]
20037 pub fn oar1(self) -> Reg<regs::Oar1, RW> { 16612 pub fn sr(self) -> Reg<regs::Sr, RW> {
20038 unsafe { Reg::from_ptr(self.0.add(8usize)) } 16613 unsafe { Reg::from_ptr(self.0.add(8usize)) }
20039 } 16614 }
20040 #[doc = "Own address register 2"] 16615 #[doc = "data register"]
20041 pub fn oar2(self) -> Reg<regs::Oar2, RW> { 16616 pub fn dr(self) -> Reg<regs::Dr, RW> {
20042 unsafe { Reg::from_ptr(self.0.add(12usize)) } 16617 unsafe { Reg::from_ptr(self.0.add(12usize)) }
20043 } 16618 }
20044 #[doc = "Timing register"] 16619 #[doc = "CRC polynomial register"]
20045 pub fn timingr(self) -> Reg<regs::Timingr, RW> { 16620 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
20046 unsafe { Reg::from_ptr(self.0.add(16usize)) } 16621 unsafe { Reg::from_ptr(self.0.add(16usize)) }
20047 } 16622 }
20048 #[doc = "Status register 1"] 16623 #[doc = "RX CRC register"]
20049 pub fn timeoutr(self) -> Reg<regs::Timeoutr, RW> { 16624 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
20050 unsafe { Reg::from_ptr(self.0.add(20usize)) } 16625 unsafe { Reg::from_ptr(self.0.add(20usize)) }
20051 } 16626 }
20052 #[doc = "Interrupt and Status register"] 16627 #[doc = "TX CRC register"]
20053 pub fn isr(self) -> Reg<regs::Isr, RW> { 16628 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
20054 unsafe { Reg::from_ptr(self.0.add(24usize)) } 16629 unsafe { Reg::from_ptr(self.0.add(24usize)) }
20055 } 16630 }
20056 #[doc = "Interrupt clear register"]
20057 pub fn icr(self) -> Reg<regs::Icr, W> {
20058 unsafe { Reg::from_ptr(self.0.add(28usize)) }
20059 }
20060 #[doc = "PEC register"]
20061 pub fn pecr(self) -> Reg<regs::Pecr, R> {
20062 unsafe { Reg::from_ptr(self.0.add(32usize)) }
20063 }
20064 #[doc = "Receive data register"]
20065 pub fn rxdr(self) -> Reg<regs::Rxdr, R> {
20066 unsafe { Reg::from_ptr(self.0.add(36usize)) }
20067 }
20068 #[doc = "Transmit data register"]
20069 pub fn txdr(self) -> Reg<regs::Txdr, RW> {
20070 unsafe { Reg::from_ptr(self.0.add(40usize)) }
20071 }
20072 }
20073 pub mod vals {
20074 use crate::generic::*;
20075 #[repr(transparent)]
20076 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20077 pub struct Oamode(pub u8);
20078 impl Oamode {
20079 #[doc = "Own address 1 is a 7-bit address"]
20080 pub const BIT7: Self = Self(0);
20081 #[doc = "Own address 1 is a 10-bit address"]
20082 pub const BIT10: Self = Self(0x01);
20083 }
20084 #[repr(transparent)]
20085 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20086 pub struct Headr(pub u8);
20087 impl Headr {
20088 #[doc = "The master sends the complete 10 bit slave address read sequence"]
20089 pub const COMPLETE: Self = Self(0);
20090 #[doc = "The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction"]
20091 pub const PARTIAL: Self = Self(0x01);
20092 }
20093 #[repr(transparent)]
20094 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20095 pub struct Start(pub u8);
20096 impl Start {
20097 #[doc = "No Start generation"]
20098 pub const NOSTART: Self = Self(0);
20099 #[doc = "Restart/Start generation"]
20100 pub const START: Self = Self(0x01);
20101 }
20102 #[repr(transparent)]
20103 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20104 pub struct Autoend(pub u8);
20105 impl Autoend {
20106 #[doc = "Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low"]
20107 pub const SOFTWARE: Self = Self(0);
20108 #[doc = "Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred"]
20109 pub const AUTOMATIC: Self = Self(0x01);
20110 }
20111 #[repr(transparent)]
20112 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20113 pub struct Add(pub u8);
20114 impl Add {
20115 #[doc = "The master operates in 7-bit addressing mode"]
20116 pub const BIT7: Self = Self(0);
20117 #[doc = "The master operates in 10-bit addressing mode"]
20118 pub const BIT10: Self = Self(0x01);
20119 }
20120 #[repr(transparent)]
20121 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20122 pub struct Stop(pub u8);
20123 impl Stop {
20124 #[doc = "No Stop generation"]
20125 pub const NOSTOP: Self = Self(0);
20126 #[doc = "Stop generation after current byte transfer"]
20127 pub const STOP: Self = Self(0x01);
20128 }
20129 #[repr(transparent)]
20130 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20131 pub struct RdWrn(pub u8);
20132 impl RdWrn {
20133 #[doc = "Master requests a write transfer"]
20134 pub const WRITE: Self = Self(0);
20135 #[doc = "Master requests a read transfer"]
20136 pub const READ: Self = Self(0x01);
20137 }
20138 #[repr(transparent)]
20139 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20140 pub struct Reload(pub u8);
20141 impl Reload {
20142 #[doc = "The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)"]
20143 pub const COMPLETED: Self = Self(0);
20144 #[doc = "The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)"]
20145 pub const NOTCOMPLETED: Self = Self(0x01);
20146 }
20147 #[repr(transparent)]
20148 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20149 pub struct Oamsk(pub u8);
20150 impl Oamsk {
20151 #[doc = "No mask"]
20152 pub const NOMASK: Self = Self(0);
20153 #[doc = "OA2[1]
20154is masked and don’t care. Only OA2[7:2]
20155are compared"]
20156 pub const MASK1: Self = Self(0x01);
20157 #[doc = "OA2[2:1]
20158are masked and don’t care. Only OA2[7:3]
20159are compared"]
20160 pub const MASK2: Self = Self(0x02);
20161 #[doc = "OA2[3:1]
20162are masked and don’t care. Only OA2[7:4]
20163are compared"]
20164 pub const MASK3: Self = Self(0x03);
20165 #[doc = "OA2[4:1]
20166are masked and don’t care. Only OA2[7:5]
20167are compared"]
20168 pub const MASK4: Self = Self(0x04);
20169 #[doc = "OA2[5:1]
20170are masked and don’t care. Only OA2[7:6]
20171are compared"]
20172 pub const MASK5: Self = Self(0x05);
20173 #[doc = "OA2[6:1]
20174are masked and don’t care. Only OA2[7]
20175is compared."]
20176 pub const MASK6: Self = Self(0x06);
20177 #[doc = "OA2[7:1]
20178are masked and don’t care. No comparison is done, and all (except reserved) 7-bit received addresses are acknowledged"]
20179 pub const MASK7: Self = Self(0x07);
20180 }
20181 #[repr(transparent)]
20182 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20183 pub struct Nack(pub u8);
20184 impl Nack {
20185 #[doc = "an ACK is sent after current received byte"]
20186 pub const ACK: Self = Self(0);
20187 #[doc = "a NACK is sent after current received byte"]
20188 pub const NACK: Self = Self(0x01);
20189 }
20190 #[repr(transparent)]
20191 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20192 pub struct Pecerr(pub u8);
20193 impl Pecerr {
20194 #[doc = "Received PEC does match with PEC register"]
20195 pub const MATCH: Self = Self(0);
20196 #[doc = "Received PEC does not match with PEC register"]
20197 pub const NOMATCH: Self = Self(0x01);
20198 }
20199 #[repr(transparent)]
20200 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20201 pub struct Pecbyte(pub u8);
20202 impl Pecbyte {
20203 #[doc = "No PEC transfer"]
20204 pub const NOPEC: Self = Self(0);
20205 #[doc = "PEC transmission/reception is requested"]
20206 pub const PEC: Self = Self(0x01);
20207 }
20208 #[repr(transparent)]
20209 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20210 pub struct Dir(pub u8);
20211 impl Dir {
20212 #[doc = "Write transfer, slave enters receiver mode"]
20213 pub const WRITE: Self = Self(0);
20214 #[doc = "Read transfer, slave enters transmitter mode"]
20215 pub const READ: Self = Self(0x01);
20216 }
20217 #[repr(transparent)]
20218 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20219 pub struct Dnf(pub u8);
20220 impl Dnf {
20221 #[doc = "Digital filter disabled"]
20222 pub const NOFILTER: Self = Self(0);
20223 #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
20224 pub const FILTER1: Self = Self(0x01);
20225 #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
20226 pub const FILTER2: Self = Self(0x02);
20227 #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
20228 pub const FILTER3: Self = Self(0x03);
20229 #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
20230 pub const FILTER4: Self = Self(0x04);
20231 #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
20232 pub const FILTER5: Self = Self(0x05);
20233 #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
20234 pub const FILTER6: Self = Self(0x06);
20235 #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
20236 pub const FILTER7: Self = Self(0x07);
20237 #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
20238 pub const FILTER8: Self = Self(0x08);
20239 #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
20240 pub const FILTER9: Self = Self(0x09);
20241 #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
20242 pub const FILTER10: Self = Self(0x0a);
20243 #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
20244 pub const FILTER11: Self = Self(0x0b);
20245 #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
20246 pub const FILTER12: Self = Self(0x0c);
20247 #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
20248 pub const FILTER13: Self = Self(0x0d);
20249 #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
20250 pub const FILTER14: Self = Self(0x0e);
20251 #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
20252 pub const FILTER15: Self = Self(0x0f);
20253 }
20254 } 16631 }
20255 pub mod regs { 16632 pub mod regs {
20256 use crate::generic::*; 16633 use crate::generic::*;
20257 #[doc = "Interrupt and Status register"] 16634 #[doc = "control register 1"]
20258 #[repr(transparent)] 16635 #[repr(transparent)]
20259 #[derive(Copy, Clone, Eq, PartialEq)] 16636 #[derive(Copy, Clone, Eq, PartialEq)]
20260 pub struct Isr(pub u32); 16637 pub struct Cr1(pub u32);
20261 impl Isr { 16638 impl Cr1 {
20262 #[doc = "Transmit data register empty (transmitters)"] 16639 #[doc = "Clock phase"]
20263 pub const fn txe(&self) -> bool { 16640 pub const fn cpha(&self) -> super::vals::Cpha {
20264 let val = (self.0 >> 0usize) & 0x01; 16641 let val = (self.0 >> 0usize) & 0x01;
20265 val != 0 16642 super::vals::Cpha(val as u8)
20266 } 16643 }
20267 #[doc = "Transmit data register empty (transmitters)"] 16644 #[doc = "Clock phase"]
20268 pub fn set_txe(&mut self, val: bool) { 16645 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
20269 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 16646 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
20270 } 16647 }
20271 #[doc = "Transmit interrupt status (transmitters)"] 16648 #[doc = "Clock polarity"]
20272 pub const fn txis(&self) -> bool { 16649 pub const fn cpol(&self) -> super::vals::Cpol {
20273 let val = (self.0 >> 1usize) & 0x01; 16650 let val = (self.0 >> 1usize) & 0x01;
20274 val != 0 16651 super::vals::Cpol(val as u8)
20275 } 16652 }
20276 #[doc = "Transmit interrupt status (transmitters)"] 16653 #[doc = "Clock polarity"]
20277 pub fn set_txis(&mut self, val: bool) { 16654 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
20278 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 16655 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
20279 } 16656 }
20280 #[doc = "Receive data register not empty (receivers)"] 16657 #[doc = "Master selection"]
20281 pub const fn rxne(&self) -> bool { 16658 pub const fn mstr(&self) -> super::vals::Mstr {
20282 let val = (self.0 >> 2usize) & 0x01; 16659 let val = (self.0 >> 2usize) & 0x01;
20283 val != 0 16660 super::vals::Mstr(val as u8)
20284 }
20285 #[doc = "Receive data register not empty (receivers)"]
20286 pub fn set_rxne(&mut self, val: bool) {
20287 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
20288 }
20289 #[doc = "Address matched (slave mode)"]
20290 pub const fn addr(&self) -> bool {
20291 let val = (self.0 >> 3usize) & 0x01;
20292 val != 0
20293 }
20294 #[doc = "Address matched (slave mode)"]
20295 pub fn set_addr(&mut self, val: bool) {
20296 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
20297 }
20298 #[doc = "Not acknowledge received flag"]
20299 pub const fn nackf(&self) -> bool {
20300 let val = (self.0 >> 4usize) & 0x01;
20301 val != 0
20302 } 16661 }
20303 #[doc = "Not acknowledge received flag"] 16662 #[doc = "Master selection"]
20304 pub fn set_nackf(&mut self, val: bool) { 16663 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
20305 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 16664 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
20306 } 16665 }
20307 #[doc = "Stop detection flag"] 16666 #[doc = "Baud rate control"]
20308 pub const fn stopf(&self) -> bool { 16667 pub const fn br(&self) -> super::vals::Br {
20309 let val = (self.0 >> 5usize) & 0x01; 16668 let val = (self.0 >> 3usize) & 0x07;
20310 val != 0 16669 super::vals::Br(val as u8)
20311 } 16670 }
20312 #[doc = "Stop detection flag"] 16671 #[doc = "Baud rate control"]
20313 pub fn set_stopf(&mut self, val: bool) { 16672 pub fn set_br(&mut self, val: super::vals::Br) {
20314 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 16673 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
20315 } 16674 }
20316 #[doc = "Transfer Complete (master mode)"] 16675 #[doc = "SPI enable"]
20317 pub const fn tc(&self) -> bool { 16676 pub const fn spe(&self) -> bool {
20318 let val = (self.0 >> 6usize) & 0x01; 16677 let val = (self.0 >> 6usize) & 0x01;
20319 val != 0 16678 val != 0
20320 } 16679 }
20321 #[doc = "Transfer Complete (master mode)"] 16680 #[doc = "SPI enable"]
20322 pub fn set_tc(&mut self, val: bool) { 16681 pub fn set_spe(&mut self, val: bool) {
20323 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 16682 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
20324 } 16683 }
20325 #[doc = "Transfer Complete Reload"] 16684 #[doc = "Frame format"]
20326 pub const fn tcr(&self) -> bool { 16685 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst {
20327 let val = (self.0 >> 7usize) & 0x01; 16686 let val = (self.0 >> 7usize) & 0x01;
20328 val != 0 16687 super::vals::Lsbfirst(val as u8)
20329 } 16688 }
20330 #[doc = "Transfer Complete Reload"] 16689 #[doc = "Frame format"]
20331 pub fn set_tcr(&mut self, val: bool) { 16690 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) {
20332 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 16691 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
20333 } 16692 }
20334 #[doc = "Bus error"] 16693 #[doc = "Internal slave select"]
20335 pub const fn berr(&self) -> bool { 16694 pub const fn ssi(&self) -> bool {
20336 let val = (self.0 >> 8usize) & 0x01; 16695 let val = (self.0 >> 8usize) & 0x01;
20337 val != 0 16696 val != 0
20338 } 16697 }
20339 #[doc = "Bus error"] 16698 #[doc = "Internal slave select"]
20340 pub fn set_berr(&mut self, val: bool) { 16699 pub fn set_ssi(&mut self, val: bool) {
20341 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 16700 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
20342 } 16701 }
20343 #[doc = "Arbitration lost"] 16702 #[doc = "Software slave management"]
20344 pub const fn arlo(&self) -> bool { 16703 pub const fn ssm(&self) -> bool {
20345 let val = (self.0 >> 9usize) & 0x01; 16704 let val = (self.0 >> 9usize) & 0x01;
20346 val != 0 16705 val != 0
20347 } 16706 }
20348 #[doc = "Arbitration lost"] 16707 #[doc = "Software slave management"]
20349 pub fn set_arlo(&mut self, val: bool) { 16708 pub fn set_ssm(&mut self, val: bool) {
20350 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 16709 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
20351 } 16710 }
20352 #[doc = "Overrun/Underrun (slave mode)"] 16711 #[doc = "Receive only"]
20353 pub const fn ovr(&self) -> bool { 16712 pub const fn rxonly(&self) -> super::vals::Rxonly {
20354 let val = (self.0 >> 10usize) & 0x01; 16713 let val = (self.0 >> 10usize) & 0x01;
20355 val != 0 16714 super::vals::Rxonly(val as u8)
20356 } 16715 }
20357 #[doc = "Overrun/Underrun (slave mode)"] 16716 #[doc = "Receive only"]
20358 pub fn set_ovr(&mut self, val: bool) { 16717 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
20359 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 16718 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
20360 } 16719 }
20361 #[doc = "PEC Error in reception"] 16720 #[doc = "CRC length"]
20362 pub const fn pecerr(&self) -> super::vals::Pecerr { 16721 pub const fn crcl(&self) -> super::vals::Crcl {
20363 let val = (self.0 >> 11usize) & 0x01; 16722 let val = (self.0 >> 11usize) & 0x01;
20364 super::vals::Pecerr(val as u8) 16723 super::vals::Crcl(val as u8)
20365 } 16724 }
20366 #[doc = "PEC Error in reception"] 16725 #[doc = "CRC length"]
20367 pub fn set_pecerr(&mut self, val: super::vals::Pecerr) { 16726 pub fn set_crcl(&mut self, val: super::vals::Crcl) {
20368 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 16727 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
20369 } 16728 }
20370 #[doc = "Timeout or t_low detection flag"] 16729 #[doc = "CRC transfer next"]
20371 pub const fn timeout(&self) -> bool { 16730 pub const fn crcnext(&self) -> super::vals::Crcnext {
20372 let val = (self.0 >> 12usize) & 0x01; 16731 let val = (self.0 >> 12usize) & 0x01;
20373 val != 0 16732 super::vals::Crcnext(val as u8)
20374 } 16733 }
20375 #[doc = "Timeout or t_low detection flag"] 16734 #[doc = "CRC transfer next"]
20376 pub fn set_timeout(&mut self, val: bool) { 16735 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
20377 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 16736 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
20378 } 16737 }
20379 #[doc = "SMBus alert"] 16738 #[doc = "Hardware CRC calculation enable"]
20380 pub const fn alert(&self) -> bool { 16739 pub const fn crcen(&self) -> bool {
20381 let val = (self.0 >> 13usize) & 0x01; 16740 let val = (self.0 >> 13usize) & 0x01;
20382 val != 0 16741 val != 0
20383 } 16742 }
20384 #[doc = "SMBus alert"] 16743 #[doc = "Hardware CRC calculation enable"]
20385 pub fn set_alert(&mut self, val: bool) { 16744 pub fn set_crcen(&mut self, val: bool) {
20386 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 16745 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
20387 } 16746 }
20388 #[doc = "Bus busy"] 16747 #[doc = "Output enable in bidirectional mode"]
20389 pub const fn busy(&self) -> bool { 16748 pub const fn bidioe(&self) -> super::vals::Bidioe {
20390 let val = (self.0 >> 15usize) & 0x01; 16749 let val = (self.0 >> 14usize) & 0x01;
20391 val != 0 16750 super::vals::Bidioe(val as u8)
20392 }
20393 #[doc = "Bus busy"]
20394 pub fn set_busy(&mut self, val: bool) {
20395 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20396 }
20397 #[doc = "Transfer direction (Slave mode)"]
20398 pub const fn dir(&self) -> super::vals::Dir {
20399 let val = (self.0 >> 16usize) & 0x01;
20400 super::vals::Dir(val as u8)
20401 } 16751 }
20402 #[doc = "Transfer direction (Slave mode)"] 16752 #[doc = "Output enable in bidirectional mode"]
20403 pub fn set_dir(&mut self, val: super::vals::Dir) { 16753 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) {
20404 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize); 16754 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
20405 } 16755 }
20406 #[doc = "Address match code (Slave mode)"] 16756 #[doc = "Bidirectional data mode enable"]
20407 pub const fn addcode(&self) -> u8 { 16757 pub const fn bidimode(&self) -> super::vals::Bidimode {
20408 let val = (self.0 >> 17usize) & 0x7f; 16758 let val = (self.0 >> 15usize) & 0x01;
20409 val as u8 16759 super::vals::Bidimode(val as u8)
20410 } 16760 }
20411 #[doc = "Address match code (Slave mode)"] 16761 #[doc = "Bidirectional data mode enable"]
20412 pub fn set_addcode(&mut self, val: u8) { 16762 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) {
20413 self.0 = (self.0 & !(0x7f << 17usize)) | (((val as u32) & 0x7f) << 17usize); 16763 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
20414 } 16764 }
20415 } 16765 }
20416 impl Default for Isr { 16766 impl Default for Cr1 {
20417 fn default() -> Isr { 16767 fn default() -> Cr1 {
20418 Isr(0) 16768 Cr1(0)
20419 } 16769 }
20420 } 16770 }
20421 #[doc = "Status register 1"] 16771 #[doc = "TX CRC register"]
20422 #[repr(transparent)] 16772 #[repr(transparent)]
20423 #[derive(Copy, Clone, Eq, PartialEq)] 16773 #[derive(Copy, Clone, Eq, PartialEq)]
20424 pub struct Timeoutr(pub u32); 16774 pub struct Txcrcr(pub u32);
20425 impl Timeoutr { 16775 impl Txcrcr {
20426 #[doc = "Bus timeout A"] 16776 #[doc = "Tx CRC register"]
20427 pub const fn timeouta(&self) -> u16 { 16777 pub const fn tx_crc(&self) -> u16 {
20428 let val = (self.0 >> 0usize) & 0x0fff; 16778 let val = (self.0 >> 0usize) & 0xffff;
20429 val as u16 16779 val as u16
20430 } 16780 }
20431 #[doc = "Bus timeout A"] 16781 #[doc = "Tx CRC register"]
20432 pub fn set_timeouta(&mut self, val: u16) { 16782 pub fn set_tx_crc(&mut self, val: u16) {
20433 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 16783 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
20434 } 16784 }
20435 #[doc = "Idle clock timeout detection"] 16785 }
20436 pub const fn tidle(&self) -> bool { 16786 impl Default for Txcrcr {
20437 let val = (self.0 >> 12usize) & 0x01; 16787 fn default() -> Txcrcr {
20438 val != 0 16788 Txcrcr(0)
20439 } 16789 }
20440 #[doc = "Idle clock timeout detection"] 16790 }
20441 pub fn set_tidle(&mut self, val: bool) { 16791 #[doc = "CRC polynomial register"]
20442 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 16792 #[repr(transparent)]
16793 #[derive(Copy, Clone, Eq, PartialEq)]
16794 pub struct Crcpr(pub u32);
16795 impl Crcpr {
16796 #[doc = "CRC polynomial register"]
16797 pub const fn crcpoly(&self) -> u16 {
16798 let val = (self.0 >> 0usize) & 0xffff;
16799 val as u16
20443 } 16800 }
20444 #[doc = "Clock timeout enable"] 16801 #[doc = "CRC polynomial register"]
20445 pub const fn timouten(&self) -> bool { 16802 pub fn set_crcpoly(&mut self, val: u16) {
20446 let val = (self.0 >> 15usize) & 0x01; 16803 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
20447 val != 0
20448 } 16804 }
20449 #[doc = "Clock timeout enable"] 16805 }
20450 pub fn set_timouten(&mut self, val: bool) { 16806 impl Default for Crcpr {
20451 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); 16807 fn default() -> Crcpr {
16808 Crcpr(0)
20452 } 16809 }
20453 #[doc = "Bus timeout B"] 16810 }
20454 pub const fn timeoutb(&self) -> u16 { 16811 #[doc = "data register"]
20455 let val = (self.0 >> 16usize) & 0x0fff; 16812 #[repr(transparent)]
16813 #[derive(Copy, Clone, Eq, PartialEq)]
16814 pub struct Dr(pub u32);
16815 impl Dr {
16816 #[doc = "Data register"]
16817 pub const fn dr(&self) -> u16 {
16818 let val = (self.0 >> 0usize) & 0xffff;
20456 val as u16 16819 val as u16
20457 } 16820 }
20458 #[doc = "Bus timeout B"] 16821 #[doc = "Data register"]
20459 pub fn set_timeoutb(&mut self, val: u16) { 16822 pub fn set_dr(&mut self, val: u16) {
20460 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); 16823 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
20461 }
20462 #[doc = "Extended clock timeout enable"]
20463 pub const fn texten(&self) -> bool {
20464 let val = (self.0 >> 31usize) & 0x01;
20465 val != 0
20466 }
20467 #[doc = "Extended clock timeout enable"]
20468 pub fn set_texten(&mut self, val: bool) {
20469 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
20470 } 16824 }
20471 } 16825 }
20472 impl Default for Timeoutr { 16826 impl Default for Dr {
20473 fn default() -> Timeoutr { 16827 fn default() -> Dr {
20474 Timeoutr(0) 16828 Dr(0)
20475 } 16829 }
20476 } 16830 }
20477 #[doc = "Control register 1"] 16831 #[doc = "control register 2"]
20478 #[repr(transparent)] 16832 #[repr(transparent)]
20479 #[derive(Copy, Clone, Eq, PartialEq)] 16833 #[derive(Copy, Clone, Eq, PartialEq)]
20480 pub struct Cr1(pub u32); 16834 pub struct Cr2(pub u32);
20481 impl Cr1 { 16835 impl Cr2 {
20482 #[doc = "Peripheral enable"] 16836 #[doc = "Rx buffer DMA enable"]
20483 pub const fn pe(&self) -> bool { 16837 pub const fn rxdmaen(&self) -> bool {
20484 let val = (self.0 >> 0usize) & 0x01; 16838 let val = (self.0 >> 0usize) & 0x01;
20485 val != 0 16839 val != 0
20486 } 16840 }
20487 #[doc = "Peripheral enable"] 16841 #[doc = "Rx buffer DMA enable"]
20488 pub fn set_pe(&mut self, val: bool) { 16842 pub fn set_rxdmaen(&mut self, val: bool) {
20489 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 16843 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
20490 } 16844 }
20491 #[doc = "TX Interrupt enable"] 16845 #[doc = "Tx buffer DMA enable"]
20492 pub const fn txie(&self) -> bool { 16846 pub const fn txdmaen(&self) -> bool {
20493 let val = (self.0 >> 1usize) & 0x01; 16847 let val = (self.0 >> 1usize) & 0x01;
20494 val != 0 16848 val != 0
20495 } 16849 }
20496 #[doc = "TX Interrupt enable"] 16850 #[doc = "Tx buffer DMA enable"]
20497 pub fn set_txie(&mut self, val: bool) { 16851 pub fn set_txdmaen(&mut self, val: bool) {
20498 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 16852 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
20499 } 16853 }
20500 #[doc = "RX Interrupt enable"] 16854 #[doc = "SS output enable"]
20501 pub const fn rxie(&self) -> bool { 16855 pub const fn ssoe(&self) -> bool {
20502 let val = (self.0 >> 2usize) & 0x01; 16856 let val = (self.0 >> 2usize) & 0x01;
20503 val != 0 16857 val != 0
20504 } 16858 }
20505 #[doc = "RX Interrupt enable"] 16859 #[doc = "SS output enable"]
20506 pub fn set_rxie(&mut self, val: bool) { 16860 pub fn set_ssoe(&mut self, val: bool) {
20507 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 16861 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
20508 } 16862 }
20509 #[doc = "Address match interrupt enable (slave only)"] 16863 #[doc = "NSS pulse management"]
20510 pub const fn addrie(&self) -> bool { 16864 pub const fn nssp(&self) -> bool {
20511 let val = (self.0 >> 3usize) & 0x01; 16865 let val = (self.0 >> 3usize) & 0x01;
20512 val != 0 16866 val != 0
20513 } 16867 }
20514 #[doc = "Address match interrupt enable (slave only)"] 16868 #[doc = "NSS pulse management"]
20515 pub fn set_addrie(&mut self, val: bool) { 16869 pub fn set_nssp(&mut self, val: bool) {
20516 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 16870 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
20517 } 16871 }
20518 #[doc = "Not acknowledge received interrupt enable"] 16872 #[doc = "Frame format"]
20519 pub const fn nackie(&self) -> bool { 16873 pub const fn frf(&self) -> super::vals::Frf {
20520 let val = (self.0 >> 4usize) & 0x01; 16874 let val = (self.0 >> 4usize) & 0x01;
20521 val != 0 16875 super::vals::Frf(val as u8)
20522 } 16876 }
20523 #[doc = "Not acknowledge received interrupt enable"] 16877 #[doc = "Frame format"]
20524 pub fn set_nackie(&mut self, val: bool) { 16878 pub fn set_frf(&mut self, val: super::vals::Frf) {
20525 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 16879 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
20526 } 16880 }
20527 #[doc = "STOP detection Interrupt enable"] 16881 #[doc = "Error interrupt enable"]
20528 pub const fn stopie(&self) -> bool { 16882 pub const fn errie(&self) -> bool {
20529 let val = (self.0 >> 5usize) & 0x01; 16883 let val = (self.0 >> 5usize) & 0x01;
20530 val != 0 16884 val != 0
20531 } 16885 }
20532 #[doc = "STOP detection Interrupt enable"] 16886 #[doc = "Error interrupt enable"]
20533 pub fn set_stopie(&mut self, val: bool) { 16887 pub fn set_errie(&mut self, val: bool) {
20534 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 16888 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
20535 } 16889 }
20536 #[doc = "Transfer Complete interrupt enable"] 16890 #[doc = "RX buffer not empty interrupt enable"]
20537 pub const fn tcie(&self) -> bool { 16891 pub const fn rxneie(&self) -> bool {
20538 let val = (self.0 >> 6usize) & 0x01; 16892 let val = (self.0 >> 6usize) & 0x01;
20539 val != 0 16893 val != 0
20540 } 16894 }
20541 #[doc = "Transfer Complete interrupt enable"] 16895 #[doc = "RX buffer not empty interrupt enable"]
20542 pub fn set_tcie(&mut self, val: bool) { 16896 pub fn set_rxneie(&mut self, val: bool) {
20543 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 16897 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
20544 } 16898 }
20545 #[doc = "Error interrupts enable"] 16899 #[doc = "Tx buffer empty interrupt enable"]
20546 pub const fn errie(&self) -> bool { 16900 pub const fn txeie(&self) -> bool {
20547 let val = (self.0 >> 7usize) & 0x01; 16901 let val = (self.0 >> 7usize) & 0x01;
20548 val != 0 16902 val != 0
20549 } 16903 }
20550 #[doc = "Error interrupts enable"] 16904 #[doc = "Tx buffer empty interrupt enable"]
20551 pub fn set_errie(&mut self, val: bool) { 16905 pub fn set_txeie(&mut self, val: bool) {
20552 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 16906 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
20553 } 16907 }
20554 #[doc = "Digital noise filter"] 16908 #[doc = "Data size"]
20555 pub const fn dnf(&self) -> super::vals::Dnf { 16909 pub const fn ds(&self) -> super::vals::Ds {
20556 let val = (self.0 >> 8usize) & 0x0f; 16910 let val = (self.0 >> 8usize) & 0x0f;
20557 super::vals::Dnf(val as u8) 16911 super::vals::Ds(val as u8)
20558 } 16912 }
20559 #[doc = "Digital noise filter"] 16913 #[doc = "Data size"]
20560 pub fn set_dnf(&mut self, val: super::vals::Dnf) { 16914 pub fn set_ds(&mut self, val: super::vals::Ds) {
20561 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize); 16915 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
20562 } 16916 }
20563 #[doc = "Analog noise filter OFF"] 16917 #[doc = "FIFO reception threshold"]
20564 pub const fn anfoff(&self) -> bool { 16918 pub const fn frxth(&self) -> super::vals::Frxth {
20565 let val = (self.0 >> 12usize) & 0x01;
20566 val != 0
20567 }
20568 #[doc = "Analog noise filter OFF"]
20569 pub fn set_anfoff(&mut self, val: bool) {
20570 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
20571 }
20572 #[doc = "DMA transmission requests enable"]
20573 pub const fn txdmaen(&self) -> bool {
20574 let val = (self.0 >> 14usize) & 0x01;
20575 val != 0
20576 }
20577 #[doc = "DMA transmission requests enable"]
20578 pub fn set_txdmaen(&mut self, val: bool) {
20579 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
20580 }
20581 #[doc = "DMA reception requests enable"]
20582 pub const fn rxdmaen(&self) -> bool {
20583 let val = (self.0 >> 15usize) & 0x01;
20584 val != 0
20585 }
20586 #[doc = "DMA reception requests enable"]
20587 pub fn set_rxdmaen(&mut self, val: bool) {
20588 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20589 }
20590 #[doc = "Slave byte control"]
20591 pub const fn sbc(&self) -> bool {
20592 let val = (self.0 >> 16usize) & 0x01;
20593 val != 0
20594 }
20595 #[doc = "Slave byte control"]
20596 pub fn set_sbc(&mut self, val: bool) {
20597 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
20598 }
20599 #[doc = "Clock stretching disable"]
20600 pub const fn nostretch(&self) -> bool {
20601 let val = (self.0 >> 17usize) & 0x01;
20602 val != 0
20603 }
20604 #[doc = "Clock stretching disable"]
20605 pub fn set_nostretch(&mut self, val: bool) {
20606 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
20607 }
20608 #[doc = "General call enable"]
20609 pub const fn gcen(&self) -> bool {
20610 let val = (self.0 >> 19usize) & 0x01;
20611 val != 0
20612 }
20613 #[doc = "General call enable"]
20614 pub fn set_gcen(&mut self, val: bool) {
20615 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
20616 }
20617 #[doc = "SMBus Host address enable"]
20618 pub const fn smbhen(&self) -> bool {
20619 let val = (self.0 >> 20usize) & 0x01;
20620 val != 0
20621 }
20622 #[doc = "SMBus Host address enable"]
20623 pub fn set_smbhen(&mut self, val: bool) {
20624 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
20625 }
20626 #[doc = "SMBus Device Default address enable"]
20627 pub const fn smbden(&self) -> bool {
20628 let val = (self.0 >> 21usize) & 0x01;
20629 val != 0
20630 }
20631 #[doc = "SMBus Device Default address enable"]
20632 pub fn set_smbden(&mut self, val: bool) {
20633 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
20634 }
20635 #[doc = "SMBUS alert enable"]
20636 pub const fn alerten(&self) -> bool {
20637 let val = (self.0 >> 22usize) & 0x01;
20638 val != 0
20639 }
20640 #[doc = "SMBUS alert enable"]
20641 pub fn set_alerten(&mut self, val: bool) {
20642 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
20643 }
20644 #[doc = "PEC enable"]
20645 pub const fn pecen(&self) -> bool {
20646 let val = (self.0 >> 23usize) & 0x01;
20647 val != 0
20648 }
20649 #[doc = "PEC enable"]
20650 pub fn set_pecen(&mut self, val: bool) {
20651 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
20652 }
20653 }
20654 impl Default for Cr1 {
20655 fn default() -> Cr1 {
20656 Cr1(0)
20657 }
20658 }
20659 #[doc = "Control register 2"]
20660 #[repr(transparent)]
20661 #[derive(Copy, Clone, Eq, PartialEq)]
20662 pub struct Cr2(pub u32);
20663 impl Cr2 {
20664 #[doc = "Slave address bit (master mode)"]
20665 pub const fn sadd(&self) -> u16 {
20666 let val = (self.0 >> 0usize) & 0x03ff;
20667 val as u16
20668 }
20669 #[doc = "Slave address bit (master mode)"]
20670 pub fn set_sadd(&mut self, val: u16) {
20671 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
20672 }
20673 #[doc = "Transfer direction (master mode)"]
20674 pub const fn rd_wrn(&self) -> super::vals::RdWrn {
20675 let val = (self.0 >> 10usize) & 0x01;
20676 super::vals::RdWrn(val as u8)
20677 }
20678 #[doc = "Transfer direction (master mode)"]
20679 pub fn set_rd_wrn(&mut self, val: super::vals::RdWrn) {
20680 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
20681 }
20682 #[doc = "10-bit addressing mode (master mode)"]
20683 pub const fn add10(&self) -> super::vals::Add {
20684 let val = (self.0 >> 11usize) & 0x01;
20685 super::vals::Add(val as u8)
20686 }
20687 #[doc = "10-bit addressing mode (master mode)"]
20688 pub fn set_add10(&mut self, val: super::vals::Add) {
20689 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
20690 }
20691 #[doc = "10-bit address header only read direction (master receiver mode)"]
20692 pub const fn head10r(&self) -> super::vals::Headr {
20693 let val = (self.0 >> 12usize) & 0x01; 16919 let val = (self.0 >> 12usize) & 0x01;
20694 super::vals::Headr(val as u8) 16920 super::vals::Frxth(val as u8)
20695 } 16921 }
20696 #[doc = "10-bit address header only read direction (master receiver mode)"] 16922 #[doc = "FIFO reception threshold"]
20697 pub fn set_head10r(&mut self, val: super::vals::Headr) { 16923 pub fn set_frxth(&mut self, val: super::vals::Frxth) {
20698 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 16924 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
20699 } 16925 }
20700 #[doc = "Start generation"] 16926 #[doc = "Last DMA transfer for reception"]
20701 pub const fn start(&self) -> super::vals::Start { 16927 pub const fn ldma_rx(&self) -> super::vals::LdmaRx {
20702 let val = (self.0 >> 13usize) & 0x01; 16928 let val = (self.0 >> 13usize) & 0x01;
20703 super::vals::Start(val as u8) 16929 super::vals::LdmaRx(val as u8)
20704 } 16930 }
20705 #[doc = "Start generation"] 16931 #[doc = "Last DMA transfer for reception"]
20706 pub fn set_start(&mut self, val: super::vals::Start) { 16932 pub fn set_ldma_rx(&mut self, val: super::vals::LdmaRx) {
20707 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); 16933 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
20708 } 16934 }
20709 #[doc = "Stop generation (master mode)"] 16935 #[doc = "Last DMA transfer for transmission"]
20710 pub const fn stop(&self) -> super::vals::Stop { 16936 pub const fn ldma_tx(&self) -> super::vals::LdmaTx {
20711 let val = (self.0 >> 14usize) & 0x01; 16937 let val = (self.0 >> 14usize) & 0x01;
20712 super::vals::Stop(val as u8) 16938 super::vals::LdmaTx(val as u8)
20713 } 16939 }
20714 #[doc = "Stop generation (master mode)"] 16940 #[doc = "Last DMA transfer for transmission"]
20715 pub fn set_stop(&mut self, val: super::vals::Stop) { 16941 pub fn set_ldma_tx(&mut self, val: super::vals::LdmaTx) {
20716 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 16942 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
20717 } 16943 }
20718 #[doc = "NACK generation (slave mode)"]
20719 pub const fn nack(&self) -> super::vals::Nack {
20720 let val = (self.0 >> 15usize) & 0x01;
20721 super::vals::Nack(val as u8)
20722 }
20723 #[doc = "NACK generation (slave mode)"]
20724 pub fn set_nack(&mut self, val: super::vals::Nack) {
20725 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
20726 }
20727 #[doc = "Number of bytes"]
20728 pub const fn nbytes(&self) -> u8 {
20729 let val = (self.0 >> 16usize) & 0xff;
20730 val as u8
20731 }
20732 #[doc = "Number of bytes"]
20733 pub fn set_nbytes(&mut self, val: u8) {
20734 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
20735 }
20736 #[doc = "NBYTES reload mode"]
20737 pub const fn reload(&self) -> super::vals::Reload {
20738 let val = (self.0 >> 24usize) & 0x01;
20739 super::vals::Reload(val as u8)
20740 }
20741 #[doc = "NBYTES reload mode"]
20742 pub fn set_reload(&mut self, val: super::vals::Reload) {
20743 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
20744 }
20745 #[doc = "Automatic end mode (master mode)"]
20746 pub const fn autoend(&self) -> super::vals::Autoend {
20747 let val = (self.0 >> 25usize) & 0x01;
20748 super::vals::Autoend(val as u8)
20749 }
20750 #[doc = "Automatic end mode (master mode)"]
20751 pub fn set_autoend(&mut self, val: super::vals::Autoend) {
20752 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
20753 }
20754 #[doc = "Packet error checking byte"]
20755 pub const fn pecbyte(&self) -> super::vals::Pecbyte {
20756 let val = (self.0 >> 26usize) & 0x01;
20757 super::vals::Pecbyte(val as u8)
20758 }
20759 #[doc = "Packet error checking byte"]
20760 pub fn set_pecbyte(&mut self, val: super::vals::Pecbyte) {
20761 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize);
20762 }
20763 } 16944 }
20764 impl Default for Cr2 { 16945 impl Default for Cr2 {
20765 fn default() -> Cr2 { 16946 fn default() -> Cr2 {
20766 Cr2(0) 16947 Cr2(0)
20767 } 16948 }
20768 } 16949 }
20769 #[doc = "Own address register 2"] 16950 #[doc = "status register"]
20770 #[repr(transparent)]
20771 #[derive(Copy, Clone, Eq, PartialEq)]
20772 pub struct Oar2(pub u32);
20773 impl Oar2 {
20774 #[doc = "Interface address"]
20775 pub const fn oa2(&self) -> u8 {
20776 let val = (self.0 >> 1usize) & 0x7f;
20777 val as u8
20778 }
20779 #[doc = "Interface address"]
20780 pub fn set_oa2(&mut self, val: u8) {
20781 self.0 = (self.0 & !(0x7f << 1usize)) | (((val as u32) & 0x7f) << 1usize);
20782 }
20783 #[doc = "Own Address 2 masks"]
20784 pub const fn oa2msk(&self) -> super::vals::Oamsk {
20785 let val = (self.0 >> 8usize) & 0x07;
20786 super::vals::Oamsk(val as u8)
20787 }
20788 #[doc = "Own Address 2 masks"]
20789 pub fn set_oa2msk(&mut self, val: super::vals::Oamsk) {
20790 self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize);
20791 }
20792 #[doc = "Own Address 2 enable"]
20793 pub const fn oa2en(&self) -> bool {
20794 let val = (self.0 >> 15usize) & 0x01;
20795 val != 0
20796 }
20797 #[doc = "Own Address 2 enable"]
20798 pub fn set_oa2en(&mut self, val: bool) {
20799 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20800 }
20801 }
20802 impl Default for Oar2 {
20803 fn default() -> Oar2 {
20804 Oar2(0)
20805 }
20806 }
20807 #[doc = "Own address register 1"]
20808 #[repr(transparent)] 16951 #[repr(transparent)]
20809 #[derive(Copy, Clone, Eq, PartialEq)] 16952 #[derive(Copy, Clone, Eq, PartialEq)]
20810 pub struct Oar1(pub u32); 16953 pub struct Sr(pub u32);
20811 impl Oar1 { 16954 impl Sr {
20812 #[doc = "Interface address"] 16955 #[doc = "Receive buffer not empty"]
20813 pub const fn oa1(&self) -> u16 { 16956 pub const fn rxne(&self) -> bool {
20814 let val = (self.0 >> 0usize) & 0x03ff; 16957 let val = (self.0 >> 0usize) & 0x01;
20815 val as u16
20816 }
20817 #[doc = "Interface address"]
20818 pub fn set_oa1(&mut self, val: u16) {
20819 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
20820 }
20821 #[doc = "Own Address 1 10-bit mode"]
20822 pub const fn oa1mode(&self) -> super::vals::Oamode {
20823 let val = (self.0 >> 10usize) & 0x01;
20824 super::vals::Oamode(val as u8)
20825 }
20826 #[doc = "Own Address 1 10-bit mode"]
20827 pub fn set_oa1mode(&mut self, val: super::vals::Oamode) {
20828 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
20829 }
20830 #[doc = "Own Address 1 enable"]
20831 pub const fn oa1en(&self) -> bool {
20832 let val = (self.0 >> 15usize) & 0x01;
20833 val != 0 16958 val != 0
20834 } 16959 }
20835 #[doc = "Own Address 1 enable"] 16960 #[doc = "Receive buffer not empty"]
20836 pub fn set_oa1en(&mut self, val: bool) { 16961 pub fn set_rxne(&mut self, val: bool) {
20837 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); 16962 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
20838 }
20839 }
20840 impl Default for Oar1 {
20841 fn default() -> Oar1 {
20842 Oar1(0)
20843 }
20844 }
20845 #[doc = "Transmit data register"]
20846 #[repr(transparent)]
20847 #[derive(Copy, Clone, Eq, PartialEq)]
20848 pub struct Txdr(pub u32);
20849 impl Txdr {
20850 #[doc = "8-bit transmit data"]
20851 pub const fn txdata(&self) -> u8 {
20852 let val = (self.0 >> 0usize) & 0xff;
20853 val as u8
20854 }
20855 #[doc = "8-bit transmit data"]
20856 pub fn set_txdata(&mut self, val: u8) {
20857 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
20858 }
20859 }
20860 impl Default for Txdr {
20861 fn default() -> Txdr {
20862 Txdr(0)
20863 }
20864 }
20865 #[doc = "Timing register"]
20866 #[repr(transparent)]
20867 #[derive(Copy, Clone, Eq, PartialEq)]
20868 pub struct Timingr(pub u32);
20869 impl Timingr {
20870 #[doc = "SCL low period (master mode)"]
20871 pub const fn scll(&self) -> u8 {
20872 let val = (self.0 >> 0usize) & 0xff;
20873 val as u8
20874 }
20875 #[doc = "SCL low period (master mode)"]
20876 pub fn set_scll(&mut self, val: u8) {
20877 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
20878 }
20879 #[doc = "SCL high period (master mode)"]
20880 pub const fn sclh(&self) -> u8 {
20881 let val = (self.0 >> 8usize) & 0xff;
20882 val as u8
20883 }
20884 #[doc = "SCL high period (master mode)"]
20885 pub fn set_sclh(&mut self, val: u8) {
20886 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
20887 }
20888 #[doc = "Data hold time"]
20889 pub const fn sdadel(&self) -> u8 {
20890 let val = (self.0 >> 16usize) & 0x0f;
20891 val as u8
20892 }
20893 #[doc = "Data hold time"]
20894 pub fn set_sdadel(&mut self, val: u8) {
20895 self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
20896 }
20897 #[doc = "Data setup time"]
20898 pub const fn scldel(&self) -> u8 {
20899 let val = (self.0 >> 20usize) & 0x0f;
20900 val as u8
20901 }
20902 #[doc = "Data setup time"]
20903 pub fn set_scldel(&mut self, val: u8) {
20904 self.0 = (self.0 & !(0x0f << 20usize)) | (((val as u32) & 0x0f) << 20usize);
20905 }
20906 #[doc = "Timing prescaler"]
20907 pub const fn presc(&self) -> u8 {
20908 let val = (self.0 >> 28usize) & 0x0f;
20909 val as u8
20910 }
20911 #[doc = "Timing prescaler"]
20912 pub fn set_presc(&mut self, val: u8) {
20913 self.0 = (self.0 & !(0x0f << 28usize)) | (((val as u32) & 0x0f) << 28usize);
20914 }
20915 }
20916 impl Default for Timingr {
20917 fn default() -> Timingr {
20918 Timingr(0)
20919 } 16963 }
20920 } 16964 #[doc = "Transmit buffer empty"]
20921 #[doc = "Interrupt clear register"] 16965 pub const fn txe(&self) -> bool {
20922 #[repr(transparent)] 16966 let val = (self.0 >> 1usize) & 0x01;
20923 #[derive(Copy, Clone, Eq, PartialEq)]
20924 pub struct Icr(pub u32);
20925 impl Icr {
20926 #[doc = "Address Matched flag clear"]
20927 pub const fn addrcf(&self) -> bool {
20928 let val = (self.0 >> 3usize) & 0x01;
20929 val != 0 16967 val != 0
20930 } 16968 }
20931 #[doc = "Address Matched flag clear"] 16969 #[doc = "Transmit buffer empty"]
20932 pub fn set_addrcf(&mut self, val: bool) { 16970 pub fn set_txe(&mut self, val: bool) {
20933 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 16971 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
20934 } 16972 }
20935 #[doc = "Not Acknowledge flag clear"] 16973 #[doc = "CRC error flag"]
20936 pub const fn nackcf(&self) -> bool { 16974 pub const fn crcerr(&self) -> bool {
20937 let val = (self.0 >> 4usize) & 0x01; 16975 let val = (self.0 >> 4usize) & 0x01;
20938 val != 0 16976 val != 0
20939 } 16977 }
20940 #[doc = "Not Acknowledge flag clear"] 16978 #[doc = "CRC error flag"]
20941 pub fn set_nackcf(&mut self, val: bool) { 16979 pub fn set_crcerr(&mut self, val: bool) {
20942 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 16980 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
20943 } 16981 }
20944 #[doc = "Stop detection flag clear"] 16982 #[doc = "Mode fault"]
20945 pub const fn stopcf(&self) -> bool { 16983 pub const fn modf(&self) -> bool {
20946 let val = (self.0 >> 5usize) & 0x01; 16984 let val = (self.0 >> 5usize) & 0x01;
20947 val != 0 16985 val != 0
20948 } 16986 }
20949 #[doc = "Stop detection flag clear"] 16987 #[doc = "Mode fault"]
20950 pub fn set_stopcf(&mut self, val: bool) { 16988 pub fn set_modf(&mut self, val: bool) {
20951 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 16989 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
20952 } 16990 }
20953 #[doc = "Bus error flag clear"] 16991 #[doc = "Overrun flag"]
20954 pub const fn berrcf(&self) -> bool { 16992 pub const fn ovr(&self) -> bool {
20955 let val = (self.0 >> 8usize) & 0x01; 16993 let val = (self.0 >> 6usize) & 0x01;
20956 val != 0
20957 }
20958 #[doc = "Bus error flag clear"]
20959 pub fn set_berrcf(&mut self, val: bool) {
20960 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
20961 }
20962 #[doc = "Arbitration lost flag clear"]
20963 pub const fn arlocf(&self) -> bool {
20964 let val = (self.0 >> 9usize) & 0x01;
20965 val != 0 16994 val != 0
20966 } 16995 }
20967 #[doc = "Arbitration lost flag clear"] 16996 #[doc = "Overrun flag"]
20968 pub fn set_arlocf(&mut self, val: bool) { 16997 pub fn set_ovr(&mut self, val: bool) {
20969 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 16998 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
20970 } 16999 }
20971 #[doc = "Overrun/Underrun flag clear"] 17000 #[doc = "Busy flag"]
20972 pub const fn ovrcf(&self) -> bool { 17001 pub const fn bsy(&self) -> bool {
20973 let val = (self.0 >> 10usize) & 0x01; 17002 let val = (self.0 >> 7usize) & 0x01;
20974 val != 0 17003 val != 0
20975 } 17004 }
20976 #[doc = "Overrun/Underrun flag clear"] 17005 #[doc = "Busy flag"]
20977 pub fn set_ovrcf(&mut self, val: bool) { 17006 pub fn set_bsy(&mut self, val: bool) {
20978 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 17007 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
20979 } 17008 }
20980 #[doc = "PEC Error flag clear"] 17009 #[doc = "Frame format error"]
20981 pub const fn peccf(&self) -> bool { 17010 pub const fn fre(&self) -> bool {
20982 let val = (self.0 >> 11usize) & 0x01; 17011 let val = (self.0 >> 8usize) & 0x01;
20983 val != 0 17012 val != 0
20984 } 17013 }
20985 #[doc = "PEC Error flag clear"] 17014 #[doc = "Frame format error"]
20986 pub fn set_peccf(&mut self, val: bool) { 17015 pub fn set_fre(&mut self, val: bool) {
20987 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 17016 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
20988 } 17017 }
20989 #[doc = "Timeout detection flag clear"] 17018 #[doc = "FIFO reception level"]
20990 pub const fn timoutcf(&self) -> bool { 17019 pub const fn frlvl(&self) -> u8 {
20991 let val = (self.0 >> 12usize) & 0x01; 17020 let val = (self.0 >> 9usize) & 0x03;
20992 val != 0 17021 val as u8
20993 } 17022 }
20994 #[doc = "Timeout detection flag clear"] 17023 #[doc = "FIFO reception level"]
20995 pub fn set_timoutcf(&mut self, val: bool) { 17024 pub fn set_frlvl(&mut self, val: u8) {
20996 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 17025 self.0 = (self.0 & !(0x03 << 9usize)) | (((val as u32) & 0x03) << 9usize);
20997 } 17026 }
20998 #[doc = "Alert flag clear"] 17027 #[doc = "FIFO Transmission Level"]
20999 pub const fn alertcf(&self) -> bool { 17028 pub const fn ftlvl(&self) -> u8 {
21000 let val = (self.0 >> 13usize) & 0x01; 17029 let val = (self.0 >> 11usize) & 0x03;
21001 val != 0 17030 val as u8
21002 } 17031 }
21003 #[doc = "Alert flag clear"] 17032 #[doc = "FIFO Transmission Level"]
21004 pub fn set_alertcf(&mut self, val: bool) { 17033 pub fn set_ftlvl(&mut self, val: u8) {
21005 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 17034 self.0 = (self.0 & !(0x03 << 11usize)) | (((val as u32) & 0x03) << 11usize);
21006 } 17035 }
21007 } 17036 }
21008 impl Default for Icr { 17037 impl Default for Sr {
21009 fn default() -> Icr { 17038 fn default() -> Sr {
21010 Icr(0) 17039 Sr(0)
21011 } 17040 }
21012 } 17041 }
21013 #[doc = "PEC register"] 17042 #[doc = "RX CRC register"]
21014 #[repr(transparent)] 17043 #[repr(transparent)]
21015 #[derive(Copy, Clone, Eq, PartialEq)] 17044 #[derive(Copy, Clone, Eq, PartialEq)]
21016 pub struct Pecr(pub u32); 17045 pub struct Rxcrcr(pub u32);
21017 impl Pecr { 17046 impl Rxcrcr {
21018 #[doc = "Packet error checking register"] 17047 #[doc = "Rx CRC register"]
21019 pub const fn pec(&self) -> u8 { 17048 pub const fn rx_crc(&self) -> u16 {
21020 let val = (self.0 >> 0usize) & 0xff; 17049 let val = (self.0 >> 0usize) & 0xffff;
21021 val as u8 17050 val as u16
21022 } 17051 }
21023 #[doc = "Packet error checking register"] 17052 #[doc = "Rx CRC register"]
21024 pub fn set_pec(&mut self, val: u8) { 17053 pub fn set_rx_crc(&mut self, val: u16) {
21025 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 17054 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
21026 } 17055 }
21027 } 17056 }
21028 impl Default for Pecr { 17057 impl Default for Rxcrcr {
21029 fn default() -> Pecr { 17058 fn default() -> Rxcrcr {
21030 Pecr(0) 17059 Rxcrcr(0)
21031 } 17060 }
21032 } 17061 }
21033 #[doc = "Receive data register"] 17062 }
17063 pub mod vals {
17064 use crate::generic::*;
21034 #[repr(transparent)] 17065 #[repr(transparent)]
21035 #[derive(Copy, Clone, Eq, PartialEq)] 17066 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
21036 pub struct Rxdr(pub u32); 17067 pub struct Rxonly(pub u8);
21037 impl Rxdr { 17068 impl Rxonly {
21038 #[doc = "8-bit receive data"] 17069 #[doc = "Full duplex (Transmit and receive)"]
21039 pub const fn rxdata(&self) -> u8 { 17070 pub const FULLDUPLEX: Self = Self(0);
21040 let val = (self.0 >> 0usize) & 0xff; 17071 #[doc = "Output disabled (Receive-only mode)"]
21041 val as u8 17072 pub const OUTPUTDISABLED: Self = Self(0x01);
21042 }
21043 #[doc = "8-bit receive data"]
21044 pub fn set_rxdata(&mut self, val: u8) {
21045 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
21046 }
21047 } 17073 }
21048 impl Default for Rxdr { 17074 #[repr(transparent)]
21049 fn default() -> Rxdr { 17075 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
21050 Rxdr(0) 17076 pub struct Bidimode(pub u8);
21051 } 17077 impl Bidimode {
17078 #[doc = "2-line unidirectional data mode selected"]
17079 pub const UNIDIRECTIONAL: Self = Self(0);
17080 #[doc = "1-line bidirectional data mode selected"]
17081 pub const BIDIRECTIONAL: Self = Self(0x01);
17082 }
17083 #[repr(transparent)]
17084 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17085 pub struct Cpol(pub u8);
17086 impl Cpol {
17087 #[doc = "CK to 0 when idle"]
17088 pub const IDLELOW: Self = Self(0);
17089 #[doc = "CK to 1 when idle"]
17090 pub const IDLEHIGH: Self = Self(0x01);
17091 }
17092 #[repr(transparent)]
17093 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17094 pub struct Bidioe(pub u8);
17095 impl Bidioe {
17096 #[doc = "Output disabled (receive-only mode)"]
17097 pub const OUTPUTDISABLED: Self = Self(0);
17098 #[doc = "Output enabled (transmit-only mode)"]
17099 pub const OUTPUTENABLED: Self = Self(0x01);
17100 }
17101 #[repr(transparent)]
17102 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17103 pub struct Ftlvlr(pub u8);
17104 impl Ftlvlr {
17105 #[doc = "Tx FIFO Empty"]
17106 pub const EMPTY: Self = Self(0);
17107 #[doc = "Tx 1/4 FIFO"]
17108 pub const QUARTER: Self = Self(0x01);
17109 #[doc = "Tx 1/2 FIFO"]
17110 pub const HALF: Self = Self(0x02);
17111 #[doc = "Tx FIFO full"]
17112 pub const FULL: Self = Self(0x03);
17113 }
17114 #[repr(transparent)]
17115 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17116 pub struct LdmaTx(pub u8);
17117 impl LdmaTx {
17118 #[doc = "Number of data to transfer for transmit is even"]
17119 pub const EVEN: Self = Self(0);
17120 #[doc = "Number of data to transfer for transmit is odd"]
17121 pub const ODD: Self = Self(0x01);
17122 }
17123 #[repr(transparent)]
17124 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17125 pub struct Frlvlr(pub u8);
17126 impl Frlvlr {
17127 #[doc = "Rx FIFO Empty"]
17128 pub const EMPTY: Self = Self(0);
17129 #[doc = "Rx 1/4 FIFO"]
17130 pub const QUARTER: Self = Self(0x01);
17131 #[doc = "Rx 1/2 FIFO"]
17132 pub const HALF: Self = Self(0x02);
17133 #[doc = "Rx FIFO full"]
17134 pub const FULL: Self = Self(0x03);
17135 }
17136 #[repr(transparent)]
17137 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17138 pub struct Crcl(pub u8);
17139 impl Crcl {
17140 #[doc = "8-bit CRC length"]
17141 pub const EIGHTBIT: Self = Self(0);
17142 #[doc = "16-bit CRC length"]
17143 pub const SIXTEENBIT: Self = Self(0x01);
17144 }
17145 #[repr(transparent)]
17146 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17147 pub struct Frf(pub u8);
17148 impl Frf {
17149 #[doc = "SPI Motorola mode"]
17150 pub const MOTOROLA: Self = Self(0);
17151 #[doc = "SPI TI mode"]
17152 pub const TI: Self = Self(0x01);
17153 }
17154 #[repr(transparent)]
17155 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17156 pub struct LdmaRx(pub u8);
17157 impl LdmaRx {
17158 #[doc = "Number of data to transfer for receive is even"]
17159 pub const EVEN: Self = Self(0);
17160 #[doc = "Number of data to transfer for receive is odd"]
17161 pub const ODD: Self = Self(0x01);
17162 }
17163 #[repr(transparent)]
17164 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17165 pub struct Br(pub u8);
17166 impl Br {
17167 #[doc = "f_PCLK / 2"]
17168 pub const DIV2: Self = Self(0);
17169 #[doc = "f_PCLK / 4"]
17170 pub const DIV4: Self = Self(0x01);
17171 #[doc = "f_PCLK / 8"]
17172 pub const DIV8: Self = Self(0x02);
17173 #[doc = "f_PCLK / 16"]
17174 pub const DIV16: Self = Self(0x03);
17175 #[doc = "f_PCLK / 32"]
17176 pub const DIV32: Self = Self(0x04);
17177 #[doc = "f_PCLK / 64"]
17178 pub const DIV64: Self = Self(0x05);
17179 #[doc = "f_PCLK / 128"]
17180 pub const DIV128: Self = Self(0x06);
17181 #[doc = "f_PCLK / 256"]
17182 pub const DIV256: Self = Self(0x07);
17183 }
17184 #[repr(transparent)]
17185 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17186 pub struct Lsbfirst(pub u8);
17187 impl Lsbfirst {
17188 #[doc = "Data is transmitted/received with the MSB first"]
17189 pub const MSBFIRST: Self = Self(0);
17190 #[doc = "Data is transmitted/received with the LSB first"]
17191 pub const LSBFIRST: Self = Self(0x01);
17192 }
17193 #[repr(transparent)]
17194 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17195 pub struct Ds(pub u8);
17196 impl Ds {
17197 #[doc = "4-bit"]
17198 pub const FOURBIT: Self = Self(0x03);
17199 #[doc = "5-bit"]
17200 pub const FIVEBIT: Self = Self(0x04);
17201 #[doc = "6-bit"]
17202 pub const SIXBIT: Self = Self(0x05);
17203 #[doc = "7-bit"]
17204 pub const SEVENBIT: Self = Self(0x06);
17205 #[doc = "8-bit"]
17206 pub const EIGHTBIT: Self = Self(0x07);
17207 #[doc = "9-bit"]
17208 pub const NINEBIT: Self = Self(0x08);
17209 #[doc = "10-bit"]
17210 pub const TENBIT: Self = Self(0x09);
17211 #[doc = "11-bit"]
17212 pub const ELEVENBIT: Self = Self(0x0a);
17213 #[doc = "12-bit"]
17214 pub const TWELVEBIT: Self = Self(0x0b);
17215 #[doc = "13-bit"]
17216 pub const THIRTEENBIT: Self = Self(0x0c);
17217 #[doc = "14-bit"]
17218 pub const FOURTEENBIT: Self = Self(0x0d);
17219 #[doc = "15-bit"]
17220 pub const FIFTEENBIT: Self = Self(0x0e);
17221 #[doc = "16-bit"]
17222 pub const SIXTEENBIT: Self = Self(0x0f);
17223 }
17224 #[repr(transparent)]
17225 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17226 pub struct Cpha(pub u8);
17227 impl Cpha {
17228 #[doc = "The first clock transition is the first data capture edge"]
17229 pub const FIRSTEDGE: Self = Self(0);
17230 #[doc = "The second clock transition is the first data capture edge"]
17231 pub const SECONDEDGE: Self = Self(0x01);
17232 }
17233 #[repr(transparent)]
17234 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17235 pub struct Mstr(pub u8);
17236 impl Mstr {
17237 #[doc = "Slave configuration"]
17238 pub const SLAVE: Self = Self(0);
17239 #[doc = "Master configuration"]
17240 pub const MASTER: Self = Self(0x01);
17241 }
17242 #[repr(transparent)]
17243 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17244 pub struct Frer(pub u8);
17245 impl Frer {
17246 #[doc = "No frame format error"]
17247 pub const NOERROR: Self = Self(0);
17248 #[doc = "A frame format error occurred"]
17249 pub const ERROR: Self = Self(0x01);
17250 }
17251 #[repr(transparent)]
17252 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17253 pub struct Crcnext(pub u8);
17254 impl Crcnext {
17255 #[doc = "Next transmit value is from Tx buffer"]
17256 pub const TXBUFFER: Self = Self(0);
17257 #[doc = "Next transmit value is from Tx CRC register"]
17258 pub const CRC: Self = Self(0x01);
17259 }
17260 #[repr(transparent)]
17261 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
17262 pub struct Frxth(pub u8);
17263 impl Frxth {
17264 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"]
17265 pub const HALF: Self = Self(0);
17266 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"]
17267 pub const QUARTER: Self = Self(0x01);
21052 } 17268 }
21053 } 17269 }
21054} 17270}
21055pub mod syscfg_l0 { 17271pub mod syscfg_f4 {
21056 use crate::generic::*; 17272 use crate::generic::*;
21057 #[doc = "System configuration controller"] 17273 #[doc = "System configuration controller"]
21058 #[derive(Copy, Clone)] 17274 #[derive(Copy, Clone)]
@@ -21060,12 +17276,12 @@ pub mod syscfg_l0 {
21060 unsafe impl Send for Syscfg {} 17276 unsafe impl Send for Syscfg {}
21061 unsafe impl Sync for Syscfg {} 17277 unsafe impl Sync for Syscfg {}
21062 impl Syscfg { 17278 impl Syscfg {
21063 #[doc = "configuration register 1"] 17279 #[doc = "memory remap register"]
21064 pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { 17280 pub fn memrm(self) -> Reg<regs::Memrm, RW> {
21065 unsafe { Reg::from_ptr(self.0.add(0usize)) } 17281 unsafe { Reg::from_ptr(self.0.add(0usize)) }
21066 } 17282 }
21067 #[doc = "CFGR2"] 17283 #[doc = "peripheral mode configuration register"]
21068 pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { 17284 pub fn pmc(self) -> Reg<regs::Pmc, RW> {
21069 unsafe { Reg::from_ptr(self.0.add(4usize)) } 17285 unsafe { Reg::from_ptr(self.0.add(4usize)) }
21070 } 17286 }
21071 #[doc = "external interrupt configuration register"] 17287 #[doc = "external interrupt configuration register"]
@@ -21073,239 +17289,149 @@ pub mod syscfg_l0 {
21073 assert!(n < 4usize); 17289 assert!(n < 4usize);
21074 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) } 17290 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
21075 } 17291 }
21076 #[doc = "CFGR3"] 17292 #[doc = "Compensation cell control register"]
21077 pub fn cfgr3(self) -> Reg<regs::Cfgr3, RW> { 17293 pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> {
21078 unsafe { Reg::from_ptr(self.0.add(32usize)) } 17294 unsafe { Reg::from_ptr(self.0.add(32usize)) }
21079 } 17295 }
21080 } 17296 }
21081 pub mod regs { 17297 pub mod regs {
21082 use crate::generic::*; 17298 use crate::generic::*;
21083 #[doc = "external interrupt configuration register 1-4"] 17299 #[doc = "memory remap register"]
21084 #[repr(transparent)] 17300 #[repr(transparent)]
21085 #[derive(Copy, Clone, Eq, PartialEq)] 17301 #[derive(Copy, Clone, Eq, PartialEq)]
21086 pub struct Exticr(pub u32); 17302 pub struct Memrm(pub u32);
21087 impl Exticr { 17303 impl Memrm {
21088 #[doc = "EXTI configuration bits"] 17304 #[doc = "Memory mapping selection"]
21089 pub fn exti(&self, n: usize) -> u8 { 17305 pub const fn mem_mode(&self) -> u8 {
21090 assert!(n < 4usize); 17306 let val = (self.0 >> 0usize) & 0x07;
21091 let offs = 0usize + n * 4usize;
21092 let val = (self.0 >> offs) & 0x0f;
21093 val as u8 17307 val as u8
21094 } 17308 }
21095 #[doc = "EXTI configuration bits"] 17309 #[doc = "Memory mapping selection"]
21096 pub fn set_exti(&mut self, n: usize, val: u8) { 17310 pub fn set_mem_mode(&mut self, val: u8) {
21097 assert!(n < 4usize); 17311 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
21098 let offs = 0usize + n * 4usize; 17312 }
21099 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); 17313 #[doc = "Flash bank mode selection"]
17314 pub const fn fb_mode(&self) -> bool {
17315 let val = (self.0 >> 8usize) & 0x01;
17316 val != 0
17317 }
17318 #[doc = "Flash bank mode selection"]
17319 pub fn set_fb_mode(&mut self, val: bool) {
17320 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
17321 }
17322 #[doc = "FMC memory mapping swap"]
17323 pub const fn swp_fmc(&self) -> u8 {
17324 let val = (self.0 >> 10usize) & 0x03;
17325 val as u8
17326 }
17327 #[doc = "FMC memory mapping swap"]
17328 pub fn set_swp_fmc(&mut self, val: u8) {
17329 self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize);
21100 } 17330 }
21101 } 17331 }
21102 impl Default for Exticr { 17332 impl Default for Memrm {
21103 fn default() -> Exticr { 17333 fn default() -> Memrm {
21104 Exticr(0) 17334 Memrm(0)
21105 } 17335 }
21106 } 17336 }
21107 #[doc = "CFGR2"] 17337 #[doc = "Compensation cell control register"]
21108 #[repr(transparent)] 17338 #[repr(transparent)]
21109 #[derive(Copy, Clone, Eq, PartialEq)] 17339 #[derive(Copy, Clone, Eq, PartialEq)]
21110 pub struct Cfgr2(pub u32); 17340 pub struct Cmpcr(pub u32);
21111 impl Cfgr2 { 17341 impl Cmpcr {
21112 #[doc = "Firewall disable bit"] 17342 #[doc = "Compensation cell power-down"]
21113 pub const fn fwdis(&self) -> bool { 17343 pub const fn cmp_pd(&self) -> bool {
21114 let val = (self.0 >> 0usize) & 0x01; 17344 let val = (self.0 >> 0usize) & 0x01;
21115 val != 0 17345 val != 0
21116 } 17346 }
21117 #[doc = "Firewall disable bit"] 17347 #[doc = "Compensation cell power-down"]
21118 pub fn set_fwdis(&mut self, val: bool) { 17348 pub fn set_cmp_pd(&mut self, val: bool) {
21119 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 17349 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
21120 } 17350 }
21121 #[doc = "Fm+ drive capability on PB6 enable bit"] 17351 #[doc = "READY"]
21122 pub const fn i2c_pb6_fmp(&self) -> bool { 17352 pub const fn ready(&self) -> bool {
21123 let val = (self.0 >> 8usize) & 0x01; 17353 let val = (self.0 >> 8usize) & 0x01;
21124 val != 0 17354 val != 0
21125 } 17355 }
21126 #[doc = "Fm+ drive capability on PB6 enable bit"] 17356 #[doc = "READY"]
21127 pub fn set_i2c_pb6_fmp(&mut self, val: bool) { 17357 pub fn set_ready(&mut self, val: bool) {
21128 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 17358 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
21129 } 17359 }
21130 #[doc = "Fm+ drive capability on PB7 enable bit"]
21131 pub const fn i2c_pb7_fmp(&self) -> bool {
21132 let val = (self.0 >> 9usize) & 0x01;
21133 val != 0
21134 }
21135 #[doc = "Fm+ drive capability on PB7 enable bit"]
21136 pub fn set_i2c_pb7_fmp(&mut self, val: bool) {
21137 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
21138 }
21139 #[doc = "Fm+ drive capability on PB8 enable bit"]
21140 pub const fn i2c_pb8_fmp(&self) -> bool {
21141 let val = (self.0 >> 10usize) & 0x01;
21142 val != 0
21143 }
21144 #[doc = "Fm+ drive capability on PB8 enable bit"]
21145 pub fn set_i2c_pb8_fmp(&mut self, val: bool) {
21146 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
21147 }
21148 #[doc = "Fm+ drive capability on PB9 enable bit"]
21149 pub const fn i2c_pb9_fmp(&self) -> bool {
21150 let val = (self.0 >> 11usize) & 0x01;
21151 val != 0
21152 }
21153 #[doc = "Fm+ drive capability on PB9 enable bit"]
21154 pub fn set_i2c_pb9_fmp(&mut self, val: bool) {
21155 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
21156 }
21157 #[doc = "I2C1 Fm+ drive capability enable bit"]
21158 pub const fn i2c1_fmp(&self) -> bool {
21159 let val = (self.0 >> 12usize) & 0x01;
21160 val != 0
21161 }
21162 #[doc = "I2C1 Fm+ drive capability enable bit"]
21163 pub fn set_i2c1_fmp(&mut self, val: bool) {
21164 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
21165 }
21166 #[doc = "I2C2 Fm+ drive capability enable bit"]
21167 pub const fn i2c2_fmp(&self) -> bool {
21168 let val = (self.0 >> 13usize) & 0x01;
21169 val != 0
21170 }
21171 #[doc = "I2C2 Fm+ drive capability enable bit"]
21172 pub fn set_i2c2_fmp(&mut self, val: bool) {
21173 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
21174 }
21175 #[doc = "I2C3 Fm+ drive capability enable bit"]
21176 pub const fn i2c3_fmp(&self) -> bool {
21177 let val = (self.0 >> 14usize) & 0x01;
21178 val != 0
21179 }
21180 #[doc = "I2C3 Fm+ drive capability enable bit"]
21181 pub fn set_i2c3_fmp(&mut self, val: bool) {
21182 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
21183 }
21184 } 17360 }
21185 impl Default for Cfgr2 { 17361 impl Default for Cmpcr {
21186 fn default() -> Cfgr2 { 17362 fn default() -> Cmpcr {
21187 Cfgr2(0) 17363 Cmpcr(0)
21188 } 17364 }
21189 } 17365 }
21190 #[doc = "configuration register 1"] 17366 #[doc = "external interrupt configuration register"]
21191 #[repr(transparent)] 17367 #[repr(transparent)]
21192 #[derive(Copy, Clone, Eq, PartialEq)] 17368 #[derive(Copy, Clone, Eq, PartialEq)]
21193 pub struct Cfgr1(pub u32); 17369 pub struct Exticr(pub u32);
21194 impl Cfgr1 { 17370 impl Exticr {
21195 #[doc = "Memory mapping selection bits"] 17371 #[doc = "EXTI x configuration"]
21196 pub const fn mem_mode(&self) -> u8 { 17372 pub fn exti(&self, n: usize) -> u8 {
21197 let val = (self.0 >> 0usize) & 0x03; 17373 assert!(n < 4usize);
21198 val as u8 17374 let offs = 0usize + n * 4usize;
21199 } 17375 let val = (self.0 >> offs) & 0x0f;
21200 #[doc = "Memory mapping selection bits"]
21201 pub fn set_mem_mode(&mut self, val: u8) {
21202 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
21203 }
21204 #[doc = "User bank swapping"]
21205 pub const fn ufb(&self) -> bool {
21206 let val = (self.0 >> 3usize) & 0x01;
21207 val != 0
21208 }
21209 #[doc = "User bank swapping"]
21210 pub fn set_ufb(&mut self, val: bool) {
21211 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
21212 }
21213 #[doc = "Boot mode selected by the boot pins status bits"]
21214 pub const fn boot_mode(&self) -> u8 {
21215 let val = (self.0 >> 8usize) & 0x03;
21216 val as u8 17376 val as u8
21217 } 17377 }
21218 #[doc = "Boot mode selected by the boot pins status bits"] 17378 #[doc = "EXTI x configuration"]
21219 pub fn set_boot_mode(&mut self, val: u8) { 17379 pub fn set_exti(&mut self, n: usize, val: u8) {
21220 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); 17380 assert!(n < 4usize);
17381 let offs = 0usize + n * 4usize;
17382 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
21221 } 17383 }
21222 } 17384 }
21223 impl Default for Cfgr1 { 17385 impl Default for Exticr {
21224 fn default() -> Cfgr1 { 17386 fn default() -> Exticr {
21225 Cfgr1(0) 17387 Exticr(0)
21226 } 17388 }
21227 } 17389 }
21228 #[doc = "CFGR3"] 17390 #[doc = "peripheral mode configuration register"]
21229 #[repr(transparent)] 17391 #[repr(transparent)]
21230 #[derive(Copy, Clone, Eq, PartialEq)] 17392 #[derive(Copy, Clone, Eq, PartialEq)]
21231 pub struct Cfgr3(pub u32); 17393 pub struct Pmc(pub u32);
21232 impl Cfgr3 { 17394 impl Pmc {
21233 #[doc = "VREFINT enable and scaler control for COMP2 enable bit"] 17395 #[doc = "ADC1DC2"]
21234 pub const fn en_vrefint(&self) -> bool { 17396 pub const fn adc1dc2(&self) -> bool {
21235 let val = (self.0 >> 0usize) & 0x01; 17397 let val = (self.0 >> 16usize) & 0x01;
21236 val != 0
21237 }
21238 #[doc = "VREFINT enable and scaler control for COMP2 enable bit"]
21239 pub fn set_en_vrefint(&mut self, val: bool) {
21240 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
21241 }
21242 #[doc = "VREFINT_ADC connection bit"]
21243 pub const fn sel_vref_out(&self) -> u8 {
21244 let val = (self.0 >> 4usize) & 0x03;
21245 val as u8
21246 }
21247 #[doc = "VREFINT_ADC connection bit"]
21248 pub fn set_sel_vref_out(&mut self, val: u8) {
21249 self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize);
21250 }
21251 #[doc = "VREFINT reference for ADC enable bit"]
21252 pub const fn enbuf_vrefint_adc(&self) -> bool {
21253 let val = (self.0 >> 8usize) & 0x01;
21254 val != 0
21255 }
21256 #[doc = "VREFINT reference for ADC enable bit"]
21257 pub fn set_enbuf_vrefint_adc(&mut self, val: bool) {
21258 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
21259 }
21260 #[doc = "Temperature sensor reference for ADC enable bit"]
21261 pub const fn enbuf_sensor_adc(&self) -> bool {
21262 let val = (self.0 >> 9usize) & 0x01;
21263 val != 0
21264 }
21265 #[doc = "Temperature sensor reference for ADC enable bit"]
21266 pub fn set_enbuf_sensor_adc(&mut self, val: bool) {
21267 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
21268 }
21269 #[doc = "VREFINT reference for COMP2 scaler enable bit"]
21270 pub const fn enbuf_vrefint_comp2(&self) -> bool {
21271 let val = (self.0 >> 12usize) & 0x01;
21272 val != 0 17398 val != 0
21273 } 17399 }
21274 #[doc = "VREFINT reference for COMP2 scaler enable bit"] 17400 #[doc = "ADC1DC2"]
21275 pub fn set_enbuf_vrefint_comp2(&mut self, val: bool) { 17401 pub fn set_adc1dc2(&mut self, val: bool) {
21276 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 17402 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
21277 } 17403 }
21278 #[doc = "VREFINT reference for HSI48 oscillator enable bit"] 17404 #[doc = "ADC2DC2"]
21279 pub const fn enref_hsi48(&self) -> bool { 17405 pub const fn adc2dc2(&self) -> bool {
21280 let val = (self.0 >> 13usize) & 0x01; 17406 let val = (self.0 >> 17usize) & 0x01;
21281 val != 0 17407 val != 0
21282 } 17408 }
21283 #[doc = "VREFINT reference for HSI48 oscillator enable bit"] 17409 #[doc = "ADC2DC2"]
21284 pub fn set_enref_hsi48(&mut self, val: bool) { 17410 pub fn set_adc2dc2(&mut self, val: bool) {
21285 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 17411 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
21286 } 17412 }
21287 #[doc = "VREFINT ready flag"] 17413 #[doc = "ADC3DC2"]
21288 pub const fn vrefint_rdyf(&self) -> bool { 17414 pub const fn adc3dc2(&self) -> bool {
21289 let val = (self.0 >> 30usize) & 0x01; 17415 let val = (self.0 >> 18usize) & 0x01;
21290 val != 0 17416 val != 0
21291 } 17417 }
21292 #[doc = "VREFINT ready flag"] 17418 #[doc = "ADC3DC2"]
21293 pub fn set_vrefint_rdyf(&mut self, val: bool) { 17419 pub fn set_adc3dc2(&mut self, val: bool) {
21294 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); 17420 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
21295 } 17421 }
21296 #[doc = "SYSCFG_CFGR3 lock bit"] 17422 #[doc = "Ethernet PHY interface selection"]
21297 pub const fn ref_lock(&self) -> bool { 17423 pub const fn mii_rmii_sel(&self) -> bool {
21298 let val = (self.0 >> 31usize) & 0x01; 17424 let val = (self.0 >> 23usize) & 0x01;
21299 val != 0 17425 val != 0
21300 } 17426 }
21301 #[doc = "SYSCFG_CFGR3 lock bit"] 17427 #[doc = "Ethernet PHY interface selection"]
21302 pub fn set_ref_lock(&mut self, val: bool) { 17428 pub fn set_mii_rmii_sel(&mut self, val: bool) {
21303 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); 17429 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
21304 } 17430 }
21305 } 17431 }
21306 impl Default for Cfgr3 { 17432 impl Default for Pmc {
21307 fn default() -> Cfgr3 { 17433 fn default() -> Pmc {
21308 Cfgr3(0) 17434 Pmc(0)
21309 } 17435 }
21310 } 17436 }
21311 } 17437 }
@@ -21350,101 +17476,62 @@ pub mod syscfg_l4 {
21350 } 17476 }
21351 pub mod regs { 17477 pub mod regs {
21352 use crate::generic::*; 17478 use crate::generic::*;
21353 #[doc = "SWPR"] 17479 #[doc = "SKR"]
21354 #[repr(transparent)] 17480 #[repr(transparent)]
21355 #[derive(Copy, Clone, Eq, PartialEq)] 17481 #[derive(Copy, Clone, Eq, PartialEq)]
21356 pub struct Swpr(pub u32); 17482 pub struct Skr(pub u32);
21357 impl Swpr { 17483 impl Skr {
21358 #[doc = "SRAWM2 write protection."] 17484 #[doc = "SRAM2 write protection key for software erase"]
21359 pub fn pwp(&self, n: usize) -> bool { 17485 pub const fn key(&self) -> u8 {
21360 assert!(n < 32usize); 17486 let val = (self.0 >> 0usize) & 0xff;
21361 let offs = 0usize + n * 1usize; 17487 val as u8
21362 let val = (self.0 >> offs) & 0x01;
21363 val != 0
21364 } 17488 }
21365 #[doc = "SRAWM2 write protection."] 17489 #[doc = "SRAM2 write protection key for software erase"]
21366 pub fn set_pwp(&mut self, n: usize, val: bool) { 17490 pub fn set_key(&mut self, val: u8) {
21367 assert!(n < 32usize); 17491 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
21368 let offs = 0usize + n * 1usize;
21369 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
21370 } 17492 }
21371 } 17493 }
21372 impl Default for Swpr { 17494 impl Default for Skr {
21373 fn default() -> Swpr { 17495 fn default() -> Skr {
21374 Swpr(0) 17496 Skr(0)
21375 } 17497 }
21376 } 17498 }
21377 #[doc = "external interrupt configuration register 4"] 17499 #[doc = "memory remap register"]
21378 #[repr(transparent)] 17500 #[repr(transparent)]
21379 #[derive(Copy, Clone, Eq, PartialEq)] 17501 #[derive(Copy, Clone, Eq, PartialEq)]
21380 pub struct Exticr(pub u32); 17502 pub struct Memrmp(pub u32);
21381 impl Exticr { 17503 impl Memrmp {
21382 #[doc = "EXTI12 configuration bits"] 17504 #[doc = "Memory mapping selection"]
21383 pub fn exti(&self, n: usize) -> u8 { 17505 pub const fn mem_mode(&self) -> u8 {
21384 assert!(n < 4usize); 17506 let val = (self.0 >> 0usize) & 0x07;
21385 let offs = 0usize + n * 4usize;
21386 let val = (self.0 >> offs) & 0x0f;
21387 val as u8 17507 val as u8
21388 } 17508 }
21389 #[doc = "EXTI12 configuration bits"] 17509 #[doc = "Memory mapping selection"]
21390 pub fn set_exti(&mut self, n: usize, val: u8) { 17510 pub fn set_mem_mode(&mut self, val: u8) {
21391 assert!(n < 4usize); 17511 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
21392 let offs = 0usize + n * 4usize;
21393 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
21394 }
21395 }
21396 impl Default for Exticr {
21397 fn default() -> Exticr {
21398 Exticr(0)
21399 } 17512 }
21400 } 17513 #[doc = "QUADSPI memory mapping swap"]
21401 #[doc = "SCSR"] 17514 pub const fn qfs(&self) -> bool {
21402 #[repr(transparent)] 17515 let val = (self.0 >> 3usize) & 0x01;
21403 #[derive(Copy, Clone, Eq, PartialEq)]
21404 pub struct Scsr(pub u32);
21405 impl Scsr {
21406 #[doc = "SRAM2 Erase"]
21407 pub const fn sram2er(&self) -> bool {
21408 let val = (self.0 >> 0usize) & 0x01;
21409 val != 0 17516 val != 0
21410 } 17517 }
21411 #[doc = "SRAM2 Erase"] 17518 #[doc = "QUADSPI memory mapping swap"]
21412 pub fn set_sram2er(&mut self, val: bool) { 17519 pub fn set_qfs(&mut self, val: bool) {
21413 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 17520 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
21414 } 17521 }
21415 #[doc = "SRAM2 busy by erase operation"] 17522 #[doc = "Flash Bank mode selection"]
21416 pub const fn sram2bsy(&self) -> bool { 17523 pub const fn fb_mode(&self) -> bool {
21417 let val = (self.0 >> 1usize) & 0x01; 17524 let val = (self.0 >> 8usize) & 0x01;
21418 val != 0 17525 val != 0
21419 } 17526 }
21420 #[doc = "SRAM2 busy by erase operation"] 17527 #[doc = "Flash Bank mode selection"]
21421 pub fn set_sram2bsy(&mut self, val: bool) { 17528 pub fn set_fb_mode(&mut self, val: bool) {
21422 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 17529 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
21423 }
21424 }
21425 impl Default for Scsr {
21426 fn default() -> Scsr {
21427 Scsr(0)
21428 }
21429 }
21430 #[doc = "SKR"]
21431 #[repr(transparent)]
21432 #[derive(Copy, Clone, Eq, PartialEq)]
21433 pub struct Skr(pub u32);
21434 impl Skr {
21435 #[doc = "SRAM2 write protection key for software erase"]
21436 pub const fn key(&self) -> u8 {
21437 let val = (self.0 >> 0usize) & 0xff;
21438 val as u8
21439 }
21440 #[doc = "SRAM2 write protection key for software erase"]
21441 pub fn set_key(&mut self, val: u8) {
21442 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
21443 } 17530 }
21444 } 17531 }
21445 impl Default for Skr { 17532 impl Default for Memrmp {
21446 fn default() -> Skr { 17533 fn default() -> Memrmp {
21447 Skr(0) 17534 Memrmp(0)
21448 } 17535 }
21449 } 17536 }
21450 #[doc = "CFGR2"] 17537 #[doc = "CFGR2"]
@@ -21503,42 +17590,81 @@ pub mod syscfg_l4 {
21503 Cfgr2(0) 17590 Cfgr2(0)
21504 } 17591 }
21505 } 17592 }
21506 #[doc = "memory remap register"] 17593 #[doc = "SCSR"]
21507 #[repr(transparent)] 17594 #[repr(transparent)]
21508 #[derive(Copy, Clone, Eq, PartialEq)] 17595 #[derive(Copy, Clone, Eq, PartialEq)]
21509 pub struct Memrmp(pub u32); 17596 pub struct Scsr(pub u32);
21510 impl Memrmp { 17597 impl Scsr {
21511 #[doc = "Memory mapping selection"] 17598 #[doc = "SRAM2 Erase"]
21512 pub const fn mem_mode(&self) -> u8 { 17599 pub const fn sram2er(&self) -> bool {
21513 let val = (self.0 >> 0usize) & 0x07; 17600 let val = (self.0 >> 0usize) & 0x01;
21514 val as u8 17601 val != 0
21515 } 17602 }
21516 #[doc = "Memory mapping selection"] 17603 #[doc = "SRAM2 Erase"]
21517 pub fn set_mem_mode(&mut self, val: u8) { 17604 pub fn set_sram2er(&mut self, val: bool) {
21518 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); 17605 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
21519 } 17606 }
21520 #[doc = "QUADSPI memory mapping swap"] 17607 #[doc = "SRAM2 busy by erase operation"]
21521 pub const fn qfs(&self) -> bool { 17608 pub const fn sram2bsy(&self) -> bool {
21522 let val = (self.0 >> 3usize) & 0x01; 17609 let val = (self.0 >> 1usize) & 0x01;
21523 val != 0 17610 val != 0
21524 } 17611 }
21525 #[doc = "QUADSPI memory mapping swap"] 17612 #[doc = "SRAM2 busy by erase operation"]
21526 pub fn set_qfs(&mut self, val: bool) { 17613 pub fn set_sram2bsy(&mut self, val: bool) {
21527 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 17614 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
21528 } 17615 }
21529 #[doc = "Flash Bank mode selection"] 17616 }
21530 pub const fn fb_mode(&self) -> bool { 17617 impl Default for Scsr {
21531 let val = (self.0 >> 8usize) & 0x01; 17618 fn default() -> Scsr {
17619 Scsr(0)
17620 }
17621 }
17622 #[doc = "external interrupt configuration register 4"]
17623 #[repr(transparent)]
17624 #[derive(Copy, Clone, Eq, PartialEq)]
17625 pub struct Exticr(pub u32);
17626 impl Exticr {
17627 #[doc = "EXTI12 configuration bits"]
17628 pub fn exti(&self, n: usize) -> u8 {
17629 assert!(n < 4usize);
17630 let offs = 0usize + n * 4usize;
17631 let val = (self.0 >> offs) & 0x0f;
17632 val as u8
17633 }
17634 #[doc = "EXTI12 configuration bits"]
17635 pub fn set_exti(&mut self, n: usize, val: u8) {
17636 assert!(n < 4usize);
17637 let offs = 0usize + n * 4usize;
17638 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
17639 }
17640 }
17641 impl Default for Exticr {
17642 fn default() -> Exticr {
17643 Exticr(0)
17644 }
17645 }
17646 #[doc = "SWPR"]
17647 #[repr(transparent)]
17648 #[derive(Copy, Clone, Eq, PartialEq)]
17649 pub struct Swpr(pub u32);
17650 impl Swpr {
17651 #[doc = "SRAWM2 write protection."]
17652 pub fn pwp(&self, n: usize) -> bool {
17653 assert!(n < 32usize);
17654 let offs = 0usize + n * 1usize;
17655 let val = (self.0 >> offs) & 0x01;
21532 val != 0 17656 val != 0
21533 } 17657 }
21534 #[doc = "Flash Bank mode selection"] 17658 #[doc = "SRAWM2 write protection."]
21535 pub fn set_fb_mode(&mut self, val: bool) { 17659 pub fn set_pwp(&mut self, n: usize, val: bool) {
21536 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 17660 assert!(n < 32usize);
17661 let offs = 0usize + n * 1usize;
17662 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
21537 } 17663 }
21538 } 17664 }
21539 impl Default for Memrmp { 17665 impl Default for Swpr {
21540 fn default() -> Memrmp { 17666 fn default() -> Swpr {
21541 Memrmp(0) 17667 Swpr(0)
21542 } 17668 }
21543 } 17669 }
21544 #[doc = "configuration register 1"] 17670 #[doc = "configuration register 1"]
@@ -21644,6 +17770,557 @@ pub mod syscfg_l4 {
21644 } 17770 }
21645 } 17771 }
21646} 17772}
17773pub mod pwr_h7 {
17774 use crate::generic::*;
17775 #[doc = "PWR"]
17776 #[derive(Copy, Clone)]
17777 pub struct Pwr(pub *mut u8);
17778 unsafe impl Send for Pwr {}
17779 unsafe impl Sync for Pwr {}
17780 impl Pwr {
17781 #[doc = "PWR control register 1"]
17782 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
17783 unsafe { Reg::from_ptr(self.0.add(0usize)) }
17784 }
17785 #[doc = "PWR control status register 1"]
17786 pub fn csr1(self) -> Reg<regs::Csr1, R> {
17787 unsafe { Reg::from_ptr(self.0.add(4usize)) }
17788 }
17789 #[doc = "This register is not reset by wakeup from Standby mode, RESET signal and VDD POR. It is only reset by VSW POR and VSWRST reset. This register shall not be accessed when VSWRST bit in RCC_BDCR register resets the VSW domain.After reset, PWR_CR2 register is write-protected. Prior to modifying its content, the DBP bit in PWR_CR1 register must be set to disable the write protection."]
17790 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
17791 unsafe { Reg::from_ptr(self.0.add(8usize)) }
17792 }
17793 #[doc = "Reset only by POR only, not reset by wakeup from Standby mode and RESET pad. The lower byte of this register is written once after POR and shall be written before changing VOS level or ck_sys clock frequency. No limitation applies to the upper bytes.Programming data corresponding to an invalid combination of SDLEVEL, SDEXTHP, SDEN, LDOEN and BYPASS bits (see Table9) will be ignored: data will not be written, the written-once mechanism will lock the register and any further write access will be ignored. The default supply configuration will be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) will go on indicating invalid voltage levels. The system shall be power cycled before writing a new value."]
17794 pub fn cr3(self) -> Reg<regs::Cr3, RW> {
17795 unsafe { Reg::from_ptr(self.0.add(12usize)) }
17796 }
17797 #[doc = "This register allows controlling CPU1 power."]
17798 pub fn cpucr(self) -> Reg<regs::Cpucr, RW> {
17799 unsafe { Reg::from_ptr(self.0.add(16usize)) }
17800 }
17801 #[doc = "This register allows controlling D3 domain power.Following reset VOSRDY will be read 1 by software"]
17802 pub fn d3cr(self) -> Reg<regs::D3cr, RW> {
17803 unsafe { Reg::from_ptr(self.0.add(24usize)) }
17804 }
17805 #[doc = "reset only by system reset, not reset by wakeup from Standby mode5 wait states are required when writing this register (when clearing a WKUPF bit in PWR_WKUPFR, the AHB write access will complete after the WKUPF has been cleared)."]
17806 pub fn wkupcr(self) -> Reg<regs::Wkupcr, RW> {
17807 unsafe { Reg::from_ptr(self.0.add(32usize)) }
17808 }
17809 #[doc = "reset only by system reset, not reset by wakeup from Standby mode"]
17810 pub fn wkupfr(self) -> Reg<regs::Wkupfr, RW> {
17811 unsafe { Reg::from_ptr(self.0.add(36usize)) }
17812 }
17813 #[doc = "Reset only by system reset, not reset by wakeup from Standby mode"]
17814 pub fn wkupepr(self) -> Reg<regs::Wkupepr, RW> {
17815 unsafe { Reg::from_ptr(self.0.add(40usize)) }
17816 }
17817 }
17818 pub mod regs {
17819 use crate::generic::*;
17820 #[doc = "This register is not reset by wakeup from Standby mode, RESET signal and VDD POR. It is only reset by VSW POR and VSWRST reset. This register shall not be accessed when VSWRST bit in RCC_BDCR register resets the VSW domain.After reset, PWR_CR2 register is write-protected. Prior to modifying its content, the DBP bit in PWR_CR1 register must be set to disable the write protection."]
17821 #[repr(transparent)]
17822 #[derive(Copy, Clone, Eq, PartialEq)]
17823 pub struct Cr2(pub u32);
17824 impl Cr2 {
17825 #[doc = "Backup regulator enable When set, the Backup regulator (used to maintain the backup RAM content in Standby and VBAT modes) is enabled. If BREN is reset, the backup regulator is switched off. The backup RAM can still be used in Run and Stop modes. However, its content will be lost in Standby and VBAT modes. If BREN is set, the application must wait till the Backup Regulator Ready flag (BRRDY) is set to indicate that the data written into the SRAM will be maintained in Standby and VBAT modes."]
17826 pub const fn bren(&self) -> bool {
17827 let val = (self.0 >> 0usize) & 0x01;
17828 val != 0
17829 }
17830 #[doc = "Backup regulator enable When set, the Backup regulator (used to maintain the backup RAM content in Standby and VBAT modes) is enabled. If BREN is reset, the backup regulator is switched off. The backup RAM can still be used in Run and Stop modes. However, its content will be lost in Standby and VBAT modes. If BREN is set, the application must wait till the Backup Regulator Ready flag (BRRDY) is set to indicate that the data written into the SRAM will be maintained in Standby and VBAT modes."]
17831 pub fn set_bren(&mut self, val: bool) {
17832 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
17833 }
17834 #[doc = "VBAT and temperature monitoring enable When set, the VBAT supply and temperature monitoring is enabled."]
17835 pub const fn monen(&self) -> bool {
17836 let val = (self.0 >> 4usize) & 0x01;
17837 val != 0
17838 }
17839 #[doc = "VBAT and temperature monitoring enable When set, the VBAT supply and temperature monitoring is enabled."]
17840 pub fn set_monen(&mut self, val: bool) {
17841 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
17842 }
17843 #[doc = "Backup regulator ready This bit is set by hardware to indicate that the Backup regulator is ready."]
17844 pub const fn brrdy(&self) -> bool {
17845 let val = (self.0 >> 16usize) & 0x01;
17846 val != 0
17847 }
17848 #[doc = "Backup regulator ready This bit is set by hardware to indicate that the Backup regulator is ready."]
17849 pub fn set_brrdy(&mut self, val: bool) {
17850 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
17851 }
17852 #[doc = "VBAT level monitoring versus low threshold"]
17853 pub const fn vbatl(&self) -> bool {
17854 let val = (self.0 >> 20usize) & 0x01;
17855 val != 0
17856 }
17857 #[doc = "VBAT level monitoring versus low threshold"]
17858 pub fn set_vbatl(&mut self, val: bool) {
17859 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
17860 }
17861 #[doc = "VBAT level monitoring versus high threshold"]
17862 pub const fn vbath(&self) -> bool {
17863 let val = (self.0 >> 21usize) & 0x01;
17864 val != 0
17865 }
17866 #[doc = "VBAT level monitoring versus high threshold"]
17867 pub fn set_vbath(&mut self, val: bool) {
17868 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
17869 }
17870 #[doc = "Temperature level monitoring versus low threshold"]
17871 pub const fn templ(&self) -> bool {
17872 let val = (self.0 >> 22usize) & 0x01;
17873 val != 0
17874 }
17875 #[doc = "Temperature level monitoring versus low threshold"]
17876 pub fn set_templ(&mut self, val: bool) {
17877 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
17878 }
17879 #[doc = "Temperature level monitoring versus high threshold"]
17880 pub const fn temph(&self) -> bool {
17881 let val = (self.0 >> 23usize) & 0x01;
17882 val != 0
17883 }
17884 #[doc = "Temperature level monitoring versus high threshold"]
17885 pub fn set_temph(&mut self, val: bool) {
17886 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
17887 }
17888 }
17889 impl Default for Cr2 {
17890 fn default() -> Cr2 {
17891 Cr2(0)
17892 }
17893 }
17894 #[doc = "Reset only by POR only, not reset by wakeup from Standby mode and RESET pad. The lower byte of this register is written once after POR and shall be written before changing VOS level or ck_sys clock frequency. No limitation applies to the upper bytes.Programming data corresponding to an invalid combination of SDLEVEL, SDEXTHP, SDEN, LDOEN and BYPASS bits (see Table9) will be ignored: data will not be written, the written-once mechanism will lock the register and any further write access will be ignored. The default supply configuration will be kept and the ACTVOSRDY bit in PWR control status register 1 (PWR_CSR1) will go on indicating invalid voltage levels. The system shall be power cycled before writing a new value."]
17895 #[repr(transparent)]
17896 #[derive(Copy, Clone, Eq, PartialEq)]
17897 pub struct Cr3(pub u32);
17898 impl Cr3 {
17899 #[doc = "Power management unit bypass"]
17900 pub const fn bypass(&self) -> bool {
17901 let val = (self.0 >> 0usize) & 0x01;
17902 val != 0
17903 }
17904 #[doc = "Power management unit bypass"]
17905 pub fn set_bypass(&mut self, val: bool) {
17906 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
17907 }
17908 #[doc = "Low drop-out regulator enable"]
17909 pub const fn ldoen(&self) -> bool {
17910 let val = (self.0 >> 1usize) & 0x01;
17911 val != 0
17912 }
17913 #[doc = "Low drop-out regulator enable"]
17914 pub fn set_ldoen(&mut self, val: bool) {
17915 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
17916 }
17917 #[doc = "SD converter Enable"]
17918 pub const fn scuen(&self) -> bool {
17919 let val = (self.0 >> 2usize) & 0x01;
17920 val != 0
17921 }
17922 #[doc = "SD converter Enable"]
17923 pub fn set_scuen(&mut self, val: bool) {
17924 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
17925 }
17926 #[doc = "VBAT charging enable"]
17927 pub const fn vbe(&self) -> bool {
17928 let val = (self.0 >> 8usize) & 0x01;
17929 val != 0
17930 }
17931 #[doc = "VBAT charging enable"]
17932 pub fn set_vbe(&mut self, val: bool) {
17933 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
17934 }
17935 #[doc = "VBAT charging resistor selection"]
17936 pub const fn vbrs(&self) -> bool {
17937 let val = (self.0 >> 9usize) & 0x01;
17938 val != 0
17939 }
17940 #[doc = "VBAT charging resistor selection"]
17941 pub fn set_vbrs(&mut self, val: bool) {
17942 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
17943 }
17944 #[doc = "VDD33USB voltage level detector enable."]
17945 pub const fn usb33den(&self) -> bool {
17946 let val = (self.0 >> 24usize) & 0x01;
17947 val != 0
17948 }
17949 #[doc = "VDD33USB voltage level detector enable."]
17950 pub fn set_usb33den(&mut self, val: bool) {
17951 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
17952 }
17953 #[doc = "USB regulator enable."]
17954 pub const fn usbregen(&self) -> bool {
17955 let val = (self.0 >> 25usize) & 0x01;
17956 val != 0
17957 }
17958 #[doc = "USB regulator enable."]
17959 pub fn set_usbregen(&mut self, val: bool) {
17960 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
17961 }
17962 #[doc = "USB supply ready."]
17963 pub const fn usb33rdy(&self) -> bool {
17964 let val = (self.0 >> 26usize) & 0x01;
17965 val != 0
17966 }
17967 #[doc = "USB supply ready."]
17968 pub fn set_usb33rdy(&mut self, val: bool) {
17969 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
17970 }
17971 }
17972 impl Default for Cr3 {
17973 fn default() -> Cr3 {
17974 Cr3(0)
17975 }
17976 }
17977 #[doc = "PWR control register 1"]
17978 #[repr(transparent)]
17979 #[derive(Copy, Clone, Eq, PartialEq)]
17980 pub struct Cr1(pub u32);
17981 impl Cr1 {
17982 #[doc = "Low-power Deepsleep with SVOS3 (SVOS4 and SVOS5 always use low-power, regardless of the setting of this bit)"]
17983 pub const fn lpds(&self) -> bool {
17984 let val = (self.0 >> 0usize) & 0x01;
17985 val != 0
17986 }
17987 #[doc = "Low-power Deepsleep with SVOS3 (SVOS4 and SVOS5 always use low-power, regardless of the setting of this bit)"]
17988 pub fn set_lpds(&mut self, val: bool) {
17989 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
17990 }
17991 #[doc = "Programmable voltage detector enable"]
17992 pub const fn pvde(&self) -> bool {
17993 let val = (self.0 >> 4usize) & 0x01;
17994 val != 0
17995 }
17996 #[doc = "Programmable voltage detector enable"]
17997 pub fn set_pvde(&mut self, val: bool) {
17998 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
17999 }
18000 #[doc = "Programmable voltage detector level selection These bits select the voltage threshold detected by the PVD. Note: Refer to Section Electrical characteristics of the product datasheet for more details."]
18001 pub const fn pls(&self) -> u8 {
18002 let val = (self.0 >> 5usize) & 0x07;
18003 val as u8
18004 }
18005 #[doc = "Programmable voltage detector level selection These bits select the voltage threshold detected by the PVD. Note: Refer to Section Electrical characteristics of the product datasheet for more details."]
18006 pub fn set_pls(&mut self, val: u8) {
18007 self.0 = (self.0 & !(0x07 << 5usize)) | (((val as u32) & 0x07) << 5usize);
18008 }
18009 #[doc = "Disable backup domain write protection In reset state, the RCC_BDCR register, the RTC registers (including the backup registers), BREN and MOEN bits in PWR_CR2 register, are protected against parasitic write access. This bit must be set to enable write access to these registers."]
18010 pub const fn dbp(&self) -> bool {
18011 let val = (self.0 >> 8usize) & 0x01;
18012 val != 0
18013 }
18014 #[doc = "Disable backup domain write protection In reset state, the RCC_BDCR register, the RTC registers (including the backup registers), BREN and MOEN bits in PWR_CR2 register, are protected against parasitic write access. This bit must be set to enable write access to these registers."]
18015 pub fn set_dbp(&mut self, val: bool) {
18016 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
18017 }
18018 #[doc = "Flash low-power mode in DStop mode This bit allows to obtain the best trade-off between low-power consumption and restart time when exiting from DStop mode. When it is set, the Flash memory enters low-power mode when D1 domain is in DStop mode."]
18019 pub const fn flps(&self) -> bool {
18020 let val = (self.0 >> 9usize) & 0x01;
18021 val != 0
18022 }
18023 #[doc = "Flash low-power mode in DStop mode This bit allows to obtain the best trade-off between low-power consumption and restart time when exiting from DStop mode. When it is set, the Flash memory enters low-power mode when D1 domain is in DStop mode."]
18024 pub fn set_flps(&mut self, val: bool) {
18025 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
18026 }
18027 #[doc = "System Stop mode voltage scaling selection These bits control the VCORE voltage level in system Stop mode, to obtain the best trade-off between power consumption and performance."]
18028 pub const fn svos(&self) -> u8 {
18029 let val = (self.0 >> 14usize) & 0x03;
18030 val as u8
18031 }
18032 #[doc = "System Stop mode voltage scaling selection These bits control the VCORE voltage level in system Stop mode, to obtain the best trade-off between power consumption and performance."]
18033 pub fn set_svos(&mut self, val: u8) {
18034 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize);
18035 }
18036 #[doc = "Peripheral voltage monitor on VDDA enable"]
18037 pub const fn avden(&self) -> bool {
18038 let val = (self.0 >> 16usize) & 0x01;
18039 val != 0
18040 }
18041 #[doc = "Peripheral voltage monitor on VDDA enable"]
18042 pub fn set_avden(&mut self, val: bool) {
18043 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
18044 }
18045 #[doc = "Analog voltage detector level selection These bits select the voltage threshold detected by the AVD."]
18046 pub const fn als(&self) -> u8 {
18047 let val = (self.0 >> 17usize) & 0x03;
18048 val as u8
18049 }
18050 #[doc = "Analog voltage detector level selection These bits select the voltage threshold detected by the AVD."]
18051 pub fn set_als(&mut self, val: u8) {
18052 self.0 = (self.0 & !(0x03 << 17usize)) | (((val as u32) & 0x03) << 17usize);
18053 }
18054 }
18055 impl Default for Cr1 {
18056 fn default() -> Cr1 {
18057 Cr1(0)
18058 }
18059 }
18060 #[doc = "reset only by system reset, not reset by wakeup from Standby mode5 wait states are required when writing this register (when clearing a WKUPF bit in PWR_WKUPFR, the AHB write access will complete after the WKUPF has been cleared)."]
18061 #[repr(transparent)]
18062 #[derive(Copy, Clone, Eq, PartialEq)]
18063 pub struct Wkupcr(pub u32);
18064 impl Wkupcr {
18065 #[doc = "Clear Wakeup pin flag for WKUP. These bits are always read as 0."]
18066 pub const fn wkupc(&self) -> u8 {
18067 let val = (self.0 >> 0usize) & 0x3f;
18068 val as u8
18069 }
18070 #[doc = "Clear Wakeup pin flag for WKUP. These bits are always read as 0."]
18071 pub fn set_wkupc(&mut self, val: u8) {
18072 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
18073 }
18074 }
18075 impl Default for Wkupcr {
18076 fn default() -> Wkupcr {
18077 Wkupcr(0)
18078 }
18079 }
18080 #[doc = "This register allows controlling D3 domain power.Following reset VOSRDY will be read 1 by software"]
18081 #[repr(transparent)]
18082 #[derive(Copy, Clone, Eq, PartialEq)]
18083 pub struct D3cr(pub u32);
18084 impl D3cr {
18085 #[doc = "VOS Ready bit for VCORE voltage scaling output selection. This bit is set to 1 by hardware when Bypass mode is selected in PWR control register 3 (PWR_CR3)."]
18086 pub const fn vosrdy(&self) -> bool {
18087 let val = (self.0 >> 13usize) & 0x01;
18088 val != 0
18089 }
18090 #[doc = "VOS Ready bit for VCORE voltage scaling output selection. This bit is set to 1 by hardware when Bypass mode is selected in PWR control register 3 (PWR_CR3)."]
18091 pub fn set_vosrdy(&mut self, val: bool) {
18092 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
18093 }
18094 #[doc = "Voltage scaling selection according to performance These bits control the VCORE voltage level and allow to obtains the best trade-off between power consumption and performance: When increasing the performance, the voltage scaling shall be changed before increasing the system frequency. When decreasing performance, the system frequency shall first be decreased before changing the voltage scaling."]
18095 pub const fn vos(&self) -> u8 {
18096 let val = (self.0 >> 14usize) & 0x03;
18097 val as u8
18098 }
18099 #[doc = "Voltage scaling selection according to performance These bits control the VCORE voltage level and allow to obtains the best trade-off between power consumption and performance: When increasing the performance, the voltage scaling shall be changed before increasing the system frequency. When decreasing performance, the system frequency shall first be decreased before changing the voltage scaling."]
18100 pub fn set_vos(&mut self, val: u8) {
18101 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize);
18102 }
18103 }
18104 impl Default for D3cr {
18105 fn default() -> D3cr {
18106 D3cr(0)
18107 }
18108 }
18109 #[doc = "This register allows controlling CPU1 power."]
18110 #[repr(transparent)]
18111 #[derive(Copy, Clone, Eq, PartialEq)]
18112 pub struct Cpucr(pub u32);
18113 impl Cpucr {
18114 #[doc = "D1 domain Power Down Deepsleep selection. This bit allows CPU1 to define the Deepsleep mode for D1 domain."]
18115 pub const fn pdds_d1(&self) -> bool {
18116 let val = (self.0 >> 0usize) & 0x01;
18117 val != 0
18118 }
18119 #[doc = "D1 domain Power Down Deepsleep selection. This bit allows CPU1 to define the Deepsleep mode for D1 domain."]
18120 pub fn set_pdds_d1(&mut self, val: bool) {
18121 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18122 }
18123 #[doc = "D2 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for D2 domain."]
18124 pub const fn pdds_d2(&self) -> bool {
18125 let val = (self.0 >> 1usize) & 0x01;
18126 val != 0
18127 }
18128 #[doc = "D2 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for D2 domain."]
18129 pub fn set_pdds_d2(&mut self, val: bool) {
18130 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
18131 }
18132 #[doc = "System D3 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for System D3 domain."]
18133 pub const fn pdds_d3(&self) -> bool {
18134 let val = (self.0 >> 2usize) & 0x01;
18135 val != 0
18136 }
18137 #[doc = "System D3 domain Power Down Deepsleep. This bit allows CPU1 to define the Deepsleep mode for System D3 domain."]
18138 pub fn set_pdds_d3(&mut self, val: bool) {
18139 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
18140 }
18141 #[doc = "STOP flag This bit is set by hardware and cleared only by any reset or by setting the CPU1 CSSF bit."]
18142 pub const fn stopf(&self) -> bool {
18143 let val = (self.0 >> 5usize) & 0x01;
18144 val != 0
18145 }
18146 #[doc = "STOP flag This bit is set by hardware and cleared only by any reset or by setting the CPU1 CSSF bit."]
18147 pub fn set_stopf(&mut self, val: bool) {
18148 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
18149 }
18150 #[doc = "System Standby flag This bit is set by hardware and cleared only by a POR (Power-on Reset) or by setting the CPU1 CSSF bit"]
18151 pub const fn sbf(&self) -> bool {
18152 let val = (self.0 >> 6usize) & 0x01;
18153 val != 0
18154 }
18155 #[doc = "System Standby flag This bit is set by hardware and cleared only by a POR (Power-on Reset) or by setting the CPU1 CSSF bit"]
18156 pub fn set_sbf(&mut self, val: bool) {
18157 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
18158 }
18159 #[doc = "D1 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D1 domain is no longer in DStandby mode."]
18160 pub const fn sbf_d1(&self) -> bool {
18161 let val = (self.0 >> 7usize) & 0x01;
18162 val != 0
18163 }
18164 #[doc = "D1 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D1 domain is no longer in DStandby mode."]
18165 pub fn set_sbf_d1(&mut self, val: bool) {
18166 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
18167 }
18168 #[doc = "D2 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D2 domain is no longer in DStandby mode."]
18169 pub const fn sbf_d2(&self) -> bool {
18170 let val = (self.0 >> 8usize) & 0x01;
18171 val != 0
18172 }
18173 #[doc = "D2 domain DStandby flag This bit is set by hardware and cleared by any system reset or by setting the CPU1 CSSF bit. Once set, this bit can be cleared only when the D2 domain is no longer in DStandby mode."]
18174 pub fn set_sbf_d2(&mut self, val: bool) {
18175 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
18176 }
18177 #[doc = "Clear D1 domain CPU1 Standby, Stop and HOLD flags (always read as 0) This bit is cleared to 0 by hardware."]
18178 pub const fn cssf(&self) -> bool {
18179 let val = (self.0 >> 9usize) & 0x01;
18180 val != 0
18181 }
18182 #[doc = "Clear D1 domain CPU1 Standby, Stop and HOLD flags (always read as 0) This bit is cleared to 0 by hardware."]
18183 pub fn set_cssf(&mut self, val: bool) {
18184 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
18185 }
18186 #[doc = "Keep system D3 domain in Run mode regardless of the CPU sub-systems modes"]
18187 pub const fn run_d3(&self) -> bool {
18188 let val = (self.0 >> 11usize) & 0x01;
18189 val != 0
18190 }
18191 #[doc = "Keep system D3 domain in Run mode regardless of the CPU sub-systems modes"]
18192 pub fn set_run_d3(&mut self, val: bool) {
18193 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
18194 }
18195 }
18196 impl Default for Cpucr {
18197 fn default() -> Cpucr {
18198 Cpucr(0)
18199 }
18200 }
18201 #[doc = "reset only by system reset, not reset by wakeup from Standby mode"]
18202 #[repr(transparent)]
18203 #[derive(Copy, Clone, Eq, PartialEq)]
18204 pub struct Wkupfr(pub u32);
18205 impl Wkupfr {
18206 #[doc = "Wakeup pin WKUPF flag. This bit is set by hardware and cleared only by a Reset pin or by setting the WKUPCn+1 bit in the PWR wakeup clear register (PWR_WKUPCR)."]
18207 pub fn wkupf(&self, n: usize) -> bool {
18208 assert!(n < 6usize);
18209 let offs = 0usize + n * 1usize;
18210 let val = (self.0 >> offs) & 0x01;
18211 val != 0
18212 }
18213 #[doc = "Wakeup pin WKUPF flag. This bit is set by hardware and cleared only by a Reset pin or by setting the WKUPCn+1 bit in the PWR wakeup clear register (PWR_WKUPCR)."]
18214 pub fn set_wkupf(&mut self, n: usize, val: bool) {
18215 assert!(n < 6usize);
18216 let offs = 0usize + n * 1usize;
18217 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18218 }
18219 }
18220 impl Default for Wkupfr {
18221 fn default() -> Wkupfr {
18222 Wkupfr(0)
18223 }
18224 }
18225 #[doc = "Reset only by system reset, not reset by wakeup from Standby mode"]
18226 #[repr(transparent)]
18227 #[derive(Copy, Clone, Eq, PartialEq)]
18228 pub struct Wkupepr(pub u32);
18229 impl Wkupepr {
18230 #[doc = "Enable Wakeup Pin WKUPn+1 Each bit is set and cleared by software. Note: An additional wakeup event is detected if WKUPn+1 pin is enabled (by setting the WKUPENn+1 bit) when WKUPn+1 pin level is already high when WKUPPn+1 selects rising edge, or low when WKUPPn+1 selects falling edge."]
18231 pub fn wkupen(&self, n: usize) -> bool {
18232 assert!(n < 6usize);
18233 let offs = 0usize + n * 1usize;
18234 let val = (self.0 >> offs) & 0x01;
18235 val != 0
18236 }
18237 #[doc = "Enable Wakeup Pin WKUPn+1 Each bit is set and cleared by software. Note: An additional wakeup event is detected if WKUPn+1 pin is enabled (by setting the WKUPENn+1 bit) when WKUPn+1 pin level is already high when WKUPPn+1 selects rising edge, or low when WKUPPn+1 selects falling edge."]
18238 pub fn set_wkupen(&mut self, n: usize, val: bool) {
18239 assert!(n < 6usize);
18240 let offs = 0usize + n * 1usize;
18241 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18242 }
18243 #[doc = "Wakeup pin polarity bit for WKUPn-7 These bits define the polarity used for event detection on WKUPn-7 external wakeup pin."]
18244 pub fn wkupp(&self, n: usize) -> bool {
18245 assert!(n < 6usize);
18246 let offs = 8usize + n * 1usize;
18247 let val = (self.0 >> offs) & 0x01;
18248 val != 0
18249 }
18250 #[doc = "Wakeup pin polarity bit for WKUPn-7 These bits define the polarity used for event detection on WKUPn-7 external wakeup pin."]
18251 pub fn set_wkupp(&mut self, n: usize, val: bool) {
18252 assert!(n < 6usize);
18253 let offs = 8usize + n * 1usize;
18254 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
18255 }
18256 #[doc = "Wakeup pin pull configuration"]
18257 pub fn wkuppupd(&self, n: usize) -> u8 {
18258 assert!(n < 6usize);
18259 let offs = 16usize + n * 2usize;
18260 let val = (self.0 >> offs) & 0x03;
18261 val as u8
18262 }
18263 #[doc = "Wakeup pin pull configuration"]
18264 pub fn set_wkuppupd(&mut self, n: usize, val: u8) {
18265 assert!(n < 6usize);
18266 let offs = 16usize + n * 2usize;
18267 self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs);
18268 }
18269 }
18270 impl Default for Wkupepr {
18271 fn default() -> Wkupepr {
18272 Wkupepr(0)
18273 }
18274 }
18275 #[doc = "PWR control status register 1"]
18276 #[repr(transparent)]
18277 #[derive(Copy, Clone, Eq, PartialEq)]
18278 pub struct Csr1(pub u32);
18279 impl Csr1 {
18280 #[doc = "Programmable voltage detect output This bit is set and cleared by hardware. It is valid only if the PVD has been enabled by the PVDE bit. Note: since the PVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the PVDE bit is set."]
18281 pub const fn pvdo(&self) -> bool {
18282 let val = (self.0 >> 4usize) & 0x01;
18283 val != 0
18284 }
18285 #[doc = "Programmable voltage detect output This bit is set and cleared by hardware. It is valid only if the PVD has been enabled by the PVDE bit. Note: since the PVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the PVDE bit is set."]
18286 pub fn set_pvdo(&mut self, val: bool) {
18287 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
18288 }
18289 #[doc = "Voltage levels ready bit for currently used VOS and SDLEVEL This bit is set to 1 by hardware when the voltage regulator and the SD converter are both disabled and Bypass mode is selected in PWR control register 3 (PWR_CR3)."]
18290 pub const fn actvosrdy(&self) -> bool {
18291 let val = (self.0 >> 13usize) & 0x01;
18292 val != 0
18293 }
18294 #[doc = "Voltage levels ready bit for currently used VOS and SDLEVEL This bit is set to 1 by hardware when the voltage regulator and the SD converter are both disabled and Bypass mode is selected in PWR control register 3 (PWR_CR3)."]
18295 pub fn set_actvosrdy(&mut self, val: bool) {
18296 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
18297 }
18298 #[doc = "VOS currently applied for VCORE voltage scaling selection. These bits reflect the last VOS value applied to the PMU."]
18299 pub const fn actvos(&self) -> u8 {
18300 let val = (self.0 >> 14usize) & 0x03;
18301 val as u8
18302 }
18303 #[doc = "VOS currently applied for VCORE voltage scaling selection. These bits reflect the last VOS value applied to the PMU."]
18304 pub fn set_actvos(&mut self, val: u8) {
18305 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize);
18306 }
18307 #[doc = "Analog voltage detector output on VDDA This bit is set and cleared by hardware. It is valid only if AVD on VDDA is enabled by the AVDEN bit. Note: Since the AVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the AVDEN bit is set."]
18308 pub const fn avdo(&self) -> bool {
18309 let val = (self.0 >> 16usize) & 0x01;
18310 val != 0
18311 }
18312 #[doc = "Analog voltage detector output on VDDA This bit is set and cleared by hardware. It is valid only if AVD on VDDA is enabled by the AVDEN bit. Note: Since the AVD is disabled in Standby mode, this bit is equal to 0 after Standby or reset until the AVDEN bit is set."]
18313 pub fn set_avdo(&mut self, val: bool) {
18314 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
18315 }
18316 }
18317 impl Default for Csr1 {
18318 fn default() -> Csr1 {
18319 Csr1(0)
18320 }
18321 }
18322 }
18323}
21647pub mod flash_h7 { 18324pub mod flash_h7 {
21648 use crate::generic::*; 18325 use crate::generic::*;
21649 #[doc = "Flash"] 18326 #[doc = "Flash"]
@@ -21759,6 +18436,152 @@ pub mod flash_h7 {
21759 } 18436 }
21760 pub mod regs { 18437 pub mod regs {
21761 use crate::generic::*; 18438 use crate::generic::*;
18439 #[doc = "FLASH status register for bank 1"]
18440 #[repr(transparent)]
18441 #[derive(Copy, Clone, Eq, PartialEq)]
18442 pub struct Sr(pub u32);
18443 impl Sr {
18444 #[doc = "Bank 1 ongoing program flag"]
18445 pub const fn bsy(&self) -> bool {
18446 let val = (self.0 >> 0usize) & 0x01;
18447 val != 0
18448 }
18449 #[doc = "Bank 1 ongoing program flag"]
18450 pub fn set_bsy(&mut self, val: bool) {
18451 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
18452 }
18453 #[doc = "Bank 1 write buffer not empty flag"]
18454 pub const fn wbne(&self) -> bool {
18455 let val = (self.0 >> 1usize) & 0x01;
18456 val != 0
18457 }
18458 #[doc = "Bank 1 write buffer not empty flag"]
18459 pub fn set_wbne(&mut self, val: bool) {
18460 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
18461 }
18462 #[doc = "Bank 1 wait queue flag"]
18463 pub const fn qw(&self) -> bool {
18464 let val = (self.0 >> 2usize) & 0x01;
18465 val != 0
18466 }
18467 #[doc = "Bank 1 wait queue flag"]
18468 pub fn set_qw(&mut self, val: bool) {
18469 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
18470 }
18471 #[doc = "Bank 1 CRC busy flag"]
18472 pub const fn crc_busy(&self) -> bool {
18473 let val = (self.0 >> 3usize) & 0x01;
18474 val != 0
18475 }
18476 #[doc = "Bank 1 CRC busy flag"]
18477 pub fn set_crc_busy(&mut self, val: bool) {
18478 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
18479 }
18480 #[doc = "Bank 1 end-of-program flag"]
18481 pub const fn eop(&self) -> bool {
18482 let val = (self.0 >> 16usize) & 0x01;
18483 val != 0
18484 }
18485 #[doc = "Bank 1 end-of-program flag"]
18486 pub fn set_eop(&mut self, val: bool) {
18487 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
18488 }
18489 #[doc = "Bank 1 write protection error flag"]
18490 pub const fn wrperr(&self) -> bool {
18491 let val = (self.0 >> 17usize) & 0x01;
18492 val != 0
18493 }
18494 #[doc = "Bank 1 write protection error flag"]
18495 pub fn set_wrperr(&mut self, val: bool) {
18496 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
18497 }
18498 #[doc = "Bank 1 programming sequence error flag"]
18499 pub const fn pgserr(&self) -> bool {
18500 let val = (self.0 >> 18usize) & 0x01;
18501 val != 0
18502 }
18503 #[doc = "Bank 1 programming sequence error flag"]
18504 pub fn set_pgserr(&mut self, val: bool) {
18505 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
18506 }
18507 #[doc = "Bank 1 strobe error flag"]
18508 pub const fn strberr(&self) -> bool {
18509 let val = (self.0 >> 19usize) & 0x01;
18510 val != 0
18511 }
18512 #[doc = "Bank 1 strobe error flag"]
18513 pub fn set_strberr(&mut self, val: bool) {
18514 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
18515 }
18516 #[doc = "Bank 1 inconsistency error flag"]
18517 pub const fn incerr(&self) -> bool {
18518 let val = (self.0 >> 21usize) & 0x01;
18519 val != 0
18520 }
18521 #[doc = "Bank 1 inconsistency error flag"]
18522 pub fn set_incerr(&mut self, val: bool) {
18523 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
18524 }
18525 #[doc = "Bank 1 write/erase error flag"]
18526 pub const fn operr(&self) -> bool {
18527 let val = (self.0 >> 22usize) & 0x01;
18528 val != 0
18529 }
18530 #[doc = "Bank 1 write/erase error flag"]
18531 pub fn set_operr(&mut self, val: bool) {
18532 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
18533 }
18534 #[doc = "Bank 1 read protection error flag"]
18535 pub const fn rdperr(&self) -> bool {
18536 let val = (self.0 >> 23usize) & 0x01;
18537 val != 0
18538 }
18539 #[doc = "Bank 1 read protection error flag"]
18540 pub fn set_rdperr(&mut self, val: bool) {
18541 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
18542 }
18543 #[doc = "Bank 1 secure error flag"]
18544 pub const fn rdserr(&self) -> bool {
18545 let val = (self.0 >> 24usize) & 0x01;
18546 val != 0
18547 }
18548 #[doc = "Bank 1 secure error flag"]
18549 pub fn set_rdserr(&mut self, val: bool) {
18550 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
18551 }
18552 #[doc = "Bank 1 single correction error flag"]
18553 pub const fn sneccerr1(&self) -> bool {
18554 let val = (self.0 >> 25usize) & 0x01;
18555 val != 0
18556 }
18557 #[doc = "Bank 1 single correction error flag"]
18558 pub fn set_sneccerr1(&mut self, val: bool) {
18559 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
18560 }
18561 #[doc = "Bank 1 ECC double detection error flag"]
18562 pub const fn dbeccerr(&self) -> bool {
18563 let val = (self.0 >> 26usize) & 0x01;
18564 val != 0
18565 }
18566 #[doc = "Bank 1 ECC double detection error flag"]
18567 pub fn set_dbeccerr(&mut self, val: bool) {
18568 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
18569 }
18570 #[doc = "Bank 1 CRC-complete flag"]
18571 pub const fn crcend(&self) -> bool {
18572 let val = (self.0 >> 27usize) & 0x01;
18573 val != 0
18574 }
18575 #[doc = "Bank 1 CRC-complete flag"]
18576 pub fn set_crcend(&mut self, val: bool) {
18577 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
18578 }
18579 }
18580 impl Default for Sr {
18581 fn default() -> Sr {
18582 Sr(0)
18583 }
18584 }
21762 #[doc = "FLASH control register for bank 1"] 18585 #[doc = "FLASH control register for bank 1"]
21763 #[repr(transparent)] 18586 #[repr(transparent)]
21764 #[derive(Copy, Clone, Eq, PartialEq)] 18587 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -21950,188 +18773,278 @@ pub mod flash_h7 {
21950 Cr(0) 18773 Cr(0)
21951 } 18774 }
21952 } 18775 }
21953 #[doc = "FLASH secure address for bank 1"] 18776 #[doc = "FLASH protection address for bank 1"]
21954 #[repr(transparent)] 18777 #[repr(transparent)]
21955 #[derive(Copy, Clone, Eq, PartialEq)] 18778 #[derive(Copy, Clone, Eq, PartialEq)]
21956 pub struct ScarPrg(pub u32); 18779 pub struct PrarPrg(pub u32);
21957 impl ScarPrg { 18780 impl PrarPrg {
21958 #[doc = "Bank 1 lowest secure protected address configuration"] 18781 #[doc = "Bank 1 lowest PCROP protected address configuration"]
21959 pub const fn sec_area_start(&self) -> u16 { 18782 pub const fn prot_area_start(&self) -> u16 {
21960 let val = (self.0 >> 0usize) & 0x0fff; 18783 let val = (self.0 >> 0usize) & 0x0fff;
21961 val as u16 18784 val as u16
21962 } 18785 }
21963 #[doc = "Bank 1 lowest secure protected address configuration"] 18786 #[doc = "Bank 1 lowest PCROP protected address configuration"]
21964 pub fn set_sec_area_start(&mut self, val: u16) { 18787 pub fn set_prot_area_start(&mut self, val: u16) {
21965 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 18788 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
21966 } 18789 }
21967 #[doc = "Bank 1 highest secure protected address configuration"] 18790 #[doc = "Bank 1 highest PCROP protected address configuration"]
21968 pub const fn sec_area_end(&self) -> u16 { 18791 pub const fn prot_area_end(&self) -> u16 {
21969 let val = (self.0 >> 16usize) & 0x0fff; 18792 let val = (self.0 >> 16usize) & 0x0fff;
21970 val as u16 18793 val as u16
21971 } 18794 }
21972 #[doc = "Bank 1 highest secure protected address configuration"] 18795 #[doc = "Bank 1 highest PCROP protected address configuration"]
21973 pub fn set_sec_area_end(&mut self, val: u16) { 18796 pub fn set_prot_area_end(&mut self, val: u16) {
21974 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); 18797 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
21975 } 18798 }
21976 #[doc = "Bank 1 secure protected erase enable option configuration bit"] 18799 #[doc = "Bank 1 PCROP protected erase enable option configuration bit"]
21977 pub const fn dmes(&self) -> bool { 18800 pub const fn dmep(&self) -> bool {
21978 let val = (self.0 >> 31usize) & 0x01; 18801 let val = (self.0 >> 31usize) & 0x01;
21979 val != 0 18802 val != 0
21980 } 18803 }
21981 #[doc = "Bank 1 secure protected erase enable option configuration bit"] 18804 #[doc = "Bank 1 PCROP protected erase enable option configuration bit"]
21982 pub fn set_dmes(&mut self, val: bool) { 18805 pub fn set_dmep(&mut self, val: bool) {
21983 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); 18806 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
21984 } 18807 }
21985 } 18808 }
21986 impl Default for ScarPrg { 18809 impl Default for PrarPrg {
21987 fn default() -> ScarPrg { 18810 fn default() -> PrarPrg {
21988 ScarPrg(0) 18811 PrarPrg(0)
21989 } 18812 }
21990 } 18813 }
21991 #[doc = "FLASH status register for bank 1"] 18814 #[doc = "FLASH option status register"]
21992 #[repr(transparent)] 18815 #[repr(transparent)]
21993 #[derive(Copy, Clone, Eq, PartialEq)] 18816 #[derive(Copy, Clone, Eq, PartialEq)]
21994 pub struct Sr(pub u32); 18817 pub struct OptsrPrg(pub u32);
21995 impl Sr { 18818 impl OptsrPrg {
21996 #[doc = "Bank 1 ongoing program flag"] 18819 #[doc = "BOR reset level option configuration bits"]
21997 pub const fn bsy(&self) -> bool { 18820 pub const fn bor_lev(&self) -> u8 {
21998 let val = (self.0 >> 0usize) & 0x01; 18821 let val = (self.0 >> 2usize) & 0x03;
21999 val != 0 18822 val as u8
22000 } 18823 }
22001 #[doc = "Bank 1 ongoing program flag"] 18824 #[doc = "BOR reset level option configuration bits"]
22002 pub fn set_bsy(&mut self, val: bool) { 18825 pub fn set_bor_lev(&mut self, val: u8) {
22003 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 18826 self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize);
22004 } 18827 }
22005 #[doc = "Bank 1 write buffer not empty flag"] 18828 #[doc = "IWDG1 option configuration bit"]
22006 pub const fn wbne(&self) -> bool { 18829 pub const fn iwdg1_hw(&self) -> bool {
22007 let val = (self.0 >> 1usize) & 0x01; 18830 let val = (self.0 >> 4usize) & 0x01;
22008 val != 0 18831 val != 0
22009 } 18832 }
22010 #[doc = "Bank 1 write buffer not empty flag"] 18833 #[doc = "IWDG1 option configuration bit"]
22011 pub fn set_wbne(&mut self, val: bool) { 18834 pub fn set_iwdg1_hw(&mut self, val: bool) {
22012 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 18835 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
22013 } 18836 }
22014 #[doc = "Bank 1 wait queue flag"] 18837 #[doc = "Option byte erase after D1 DStop option configuration bit"]
22015 pub const fn qw(&self) -> bool { 18838 pub const fn n_rst_stop_d1(&self) -> bool {
22016 let val = (self.0 >> 2usize) & 0x01; 18839 let val = (self.0 >> 6usize) & 0x01;
22017 val != 0 18840 val != 0
22018 } 18841 }
22019 #[doc = "Bank 1 wait queue flag"] 18842 #[doc = "Option byte erase after D1 DStop option configuration bit"]
22020 pub fn set_qw(&mut self, val: bool) { 18843 pub fn set_n_rst_stop_d1(&mut self, val: bool) {
22021 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 18844 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
22022 } 18845 }
22023 #[doc = "Bank 1 CRC busy flag"] 18846 #[doc = "Option byte erase after D1 DStandby option configuration bit"]
22024 pub const fn crc_busy(&self) -> bool { 18847 pub const fn n_rst_stby_d1(&self) -> bool {
22025 let val = (self.0 >> 3usize) & 0x01; 18848 let val = (self.0 >> 7usize) & 0x01;
22026 val != 0 18849 val != 0
22027 } 18850 }
22028 #[doc = "Bank 1 CRC busy flag"] 18851 #[doc = "Option byte erase after D1 DStandby option configuration bit"]
22029 pub fn set_crc_busy(&mut self, val: bool) { 18852 pub fn set_n_rst_stby_d1(&mut self, val: bool) {
22030 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 18853 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
22031 } 18854 }
22032 #[doc = "Bank 1 end-of-program flag"] 18855 #[doc = "Readout protection level option configuration byte"]
22033 pub const fn eop(&self) -> bool { 18856 pub const fn rdp(&self) -> u8 {
22034 let val = (self.0 >> 16usize) & 0x01; 18857 let val = (self.0 >> 8usize) & 0xff;
22035 val != 0 18858 val as u8
22036 } 18859 }
22037 #[doc = "Bank 1 end-of-program flag"] 18860 #[doc = "Readout protection level option configuration byte"]
22038 pub fn set_eop(&mut self, val: bool) { 18861 pub fn set_rdp(&mut self, val: u8) {
22039 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 18862 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
22040 } 18863 }
22041 #[doc = "Bank 1 write protection error flag"] 18864 #[doc = "IWDG Stop mode freeze option configuration bit"]
22042 pub const fn wrperr(&self) -> bool { 18865 pub const fn fz_iwdg_stop(&self) -> bool {
22043 let val = (self.0 >> 17usize) & 0x01; 18866 let val = (self.0 >> 17usize) & 0x01;
22044 val != 0 18867 val != 0
22045 } 18868 }
22046 #[doc = "Bank 1 write protection error flag"] 18869 #[doc = "IWDG Stop mode freeze option configuration bit"]
22047 pub fn set_wrperr(&mut self, val: bool) { 18870 pub fn set_fz_iwdg_stop(&mut self, val: bool) {
22048 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 18871 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
22049 } 18872 }
22050 #[doc = "Bank 1 programming sequence error flag"] 18873 #[doc = "IWDG Standby mode freeze option configuration bit"]
22051 pub const fn pgserr(&self) -> bool { 18874 pub const fn fz_iwdg_sdby(&self) -> bool {
22052 let val = (self.0 >> 18usize) & 0x01; 18875 let val = (self.0 >> 18usize) & 0x01;
22053 val != 0 18876 val != 0
22054 } 18877 }
22055 #[doc = "Bank 1 programming sequence error flag"] 18878 #[doc = "IWDG Standby mode freeze option configuration bit"]
22056 pub fn set_pgserr(&mut self, val: bool) { 18879 pub fn set_fz_iwdg_sdby(&mut self, val: bool) {
22057 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 18880 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
22058 } 18881 }
22059 #[doc = "Bank 1 strobe error flag"] 18882 #[doc = "DTCM size select option configuration bits"]
22060 pub const fn strberr(&self) -> bool { 18883 pub const fn st_ram_size(&self) -> u8 {
22061 let val = (self.0 >> 19usize) & 0x01; 18884 let val = (self.0 >> 19usize) & 0x03;
22062 val != 0 18885 val as u8
22063 } 18886 }
22064 #[doc = "Bank 1 strobe error flag"] 18887 #[doc = "DTCM size select option configuration bits"]
22065 pub fn set_strberr(&mut self, val: bool) { 18888 pub fn set_st_ram_size(&mut self, val: u8) {
22066 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); 18889 self.0 = (self.0 & !(0x03 << 19usize)) | (((val as u32) & 0x03) << 19usize);
22067 } 18890 }
22068 #[doc = "Bank 1 inconsistency error flag"] 18891 #[doc = "Security option configuration bit"]
22069 pub const fn incerr(&self) -> bool { 18892 pub const fn security(&self) -> bool {
22070 let val = (self.0 >> 21usize) & 0x01; 18893 let val = (self.0 >> 21usize) & 0x01;
22071 val != 0 18894 val != 0
22072 } 18895 }
22073 #[doc = "Bank 1 inconsistency error flag"] 18896 #[doc = "Security option configuration bit"]
22074 pub fn set_incerr(&mut self, val: bool) { 18897 pub fn set_security(&mut self, val: bool) {
22075 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); 18898 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
22076 } 18899 }
22077 #[doc = "Bank 1 write/erase error flag"] 18900 #[doc = "User option configuration bit 1"]
22078 pub const fn operr(&self) -> bool { 18901 pub const fn rss1(&self) -> bool {
22079 let val = (self.0 >> 22usize) & 0x01; 18902 let val = (self.0 >> 26usize) & 0x01;
22080 val != 0 18903 val != 0
22081 } 18904 }
22082 #[doc = "Bank 1 write/erase error flag"] 18905 #[doc = "User option configuration bit 1"]
22083 pub fn set_operr(&mut self, val: bool) { 18906 pub fn set_rss1(&mut self, val: bool) {
22084 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 18907 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
22085 } 18908 }
22086 #[doc = "Bank 1 read protection error flag"] 18909 #[doc = "User option configuration bit 2"]
22087 pub const fn rdperr(&self) -> bool { 18910 pub const fn rss2(&self) -> bool {
22088 let val = (self.0 >> 23usize) & 0x01; 18911 let val = (self.0 >> 27usize) & 0x01;
22089 val != 0 18912 val != 0
22090 } 18913 }
22091 #[doc = "Bank 1 read protection error flag"] 18914 #[doc = "User option configuration bit 2"]
22092 pub fn set_rdperr(&mut self, val: bool) { 18915 pub fn set_rss2(&mut self, val: bool) {
22093 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); 18916 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
22094 } 18917 }
22095 #[doc = "Bank 1 secure error flag"] 18918 #[doc = "I/O high-speed at low-voltage (PRODUCT_BELOW_25V)"]
22096 pub const fn rdserr(&self) -> bool { 18919 pub const fn io_hslv(&self) -> bool {
22097 let val = (self.0 >> 24usize) & 0x01; 18920 let val = (self.0 >> 29usize) & 0x01;
22098 val != 0 18921 val != 0
22099 } 18922 }
22100 #[doc = "Bank 1 secure error flag"] 18923 #[doc = "I/O high-speed at low-voltage (PRODUCT_BELOW_25V)"]
22101 pub fn set_rdserr(&mut self, val: bool) { 18924 pub fn set_io_hslv(&mut self, val: bool) {
22102 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize); 18925 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
22103 } 18926 }
22104 #[doc = "Bank 1 single correction error flag"] 18927 #[doc = "Bank swapping option configuration bit"]
22105 pub const fn sneccerr1(&self) -> bool { 18928 pub const fn swap_bank_opt(&self) -> bool {
22106 let val = (self.0 >> 25usize) & 0x01; 18929 let val = (self.0 >> 31usize) & 0x01;
22107 val != 0 18930 val != 0
22108 } 18931 }
22109 #[doc = "Bank 1 single correction error flag"] 18932 #[doc = "Bank swapping option configuration bit"]
22110 pub fn set_sneccerr1(&mut self, val: bool) { 18933 pub fn set_swap_bank_opt(&mut self, val: bool) {
22111 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize); 18934 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
22112 } 18935 }
22113 #[doc = "Bank 1 ECC double detection error flag"] 18936 }
22114 pub const fn dbeccerr(&self) -> bool { 18937 impl Default for OptsrPrg {
22115 let val = (self.0 >> 26usize) & 0x01; 18938 fn default() -> OptsrPrg {
22116 val != 0 18939 OptsrPrg(0)
22117 } 18940 }
22118 #[doc = "Bank 1 ECC double detection error flag"] 18941 }
22119 pub fn set_dbeccerr(&mut self, val: bool) { 18942 #[doc = "FLASH register with boot address"]
22120 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); 18943 #[repr(transparent)]
18944 #[derive(Copy, Clone, Eq, PartialEq)]
18945 pub struct BootCurr(pub u32);
18946 impl BootCurr {
18947 #[doc = "Boot address 0"]
18948 pub const fn boot_add0(&self) -> u16 {
18949 let val = (self.0 >> 0usize) & 0xffff;
18950 val as u16
22121 } 18951 }
22122 #[doc = "Bank 1 CRC-complete flag"] 18952 #[doc = "Boot address 0"]
22123 pub const fn crcend(&self) -> bool { 18953 pub fn set_boot_add0(&mut self, val: u16) {
22124 let val = (self.0 >> 27usize) & 0x01; 18954 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
18955 }
18956 #[doc = "Boot address 1"]
18957 pub const fn boot_add1(&self) -> u16 {
18958 let val = (self.0 >> 16usize) & 0xffff;
18959 val as u16
18960 }
18961 #[doc = "Boot address 1"]
18962 pub fn set_boot_add1(&mut self, val: u16) {
18963 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
18964 }
18965 }
18966 impl Default for BootCurr {
18967 fn default() -> BootCurr {
18968 BootCurr(0)
18969 }
18970 }
18971 #[doc = "FLASH protection address for bank 1"]
18972 #[repr(transparent)]
18973 #[derive(Copy, Clone, Eq, PartialEq)]
18974 pub struct PrarCur(pub u32);
18975 impl PrarCur {
18976 #[doc = "Bank 1 lowest PCROP protected address"]
18977 pub const fn prot_area_start(&self) -> u16 {
18978 let val = (self.0 >> 0usize) & 0x0fff;
18979 val as u16
18980 }
18981 #[doc = "Bank 1 lowest PCROP protected address"]
18982 pub fn set_prot_area_start(&mut self, val: u16) {
18983 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
18984 }
18985 #[doc = "Bank 1 highest PCROP protected address"]
18986 pub const fn prot_area_end(&self) -> u16 {
18987 let val = (self.0 >> 16usize) & 0x0fff;
18988 val as u16
18989 }
18990 #[doc = "Bank 1 highest PCROP protected address"]
18991 pub fn set_prot_area_end(&mut self, val: u16) {
18992 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
18993 }
18994 #[doc = "Bank 1 PCROP protected erase enable option status bit"]
18995 pub const fn dmep(&self) -> bool {
18996 let val = (self.0 >> 31usize) & 0x01;
22125 val != 0 18997 val != 0
22126 } 18998 }
22127 #[doc = "Bank 1 CRC-complete flag"] 18999 #[doc = "Bank 1 PCROP protected erase enable option status bit"]
22128 pub fn set_crcend(&mut self, val: bool) { 19000 pub fn set_dmep(&mut self, val: bool) {
22129 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); 19001 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
22130 } 19002 }
22131 } 19003 }
22132 impl Default for Sr { 19004 impl Default for PrarCur {
22133 fn default() -> Sr { 19005 fn default() -> PrarCur {
22134 Sr(0) 19006 PrarCur(0)
19007 }
19008 }
19009 #[doc = "FLASH CRC start address register for bank 1"]
19010 #[repr(transparent)]
19011 #[derive(Copy, Clone, Eq, PartialEq)]
19012 pub struct Crcsaddr(pub u32);
19013 impl Crcsaddr {
19014 #[doc = "CRC start address on bank 1"]
19015 pub const fn crc_start_addr(&self) -> u32 {
19016 let val = (self.0 >> 0usize) & 0xffff_ffff;
19017 val as u32
19018 }
19019 #[doc = "CRC start address on bank 1"]
19020 pub fn set_crc_start_addr(&mut self, val: u32) {
19021 self.0 =
19022 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
19023 }
19024 }
19025 impl Default for Crcsaddr {
19026 fn default() -> Crcsaddr {
19027 Crcsaddr(0)
19028 }
19029 }
19030 #[doc = "FLASH write sector protection for bank 1"]
19031 #[repr(transparent)]
19032 #[derive(Copy, Clone, Eq, PartialEq)]
19033 pub struct WpsnPrgr(pub u32);
19034 impl WpsnPrgr {
19035 #[doc = "Bank 1 sector write protection configuration byte"]
19036 pub const fn wrpsn(&self) -> u8 {
19037 let val = (self.0 >> 0usize) & 0xff;
19038 val as u8
19039 }
19040 #[doc = "Bank 1 sector write protection configuration byte"]
19041 pub fn set_wrpsn(&mut self, val: u8) {
19042 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
19043 }
19044 }
19045 impl Default for WpsnPrgr {
19046 fn default() -> WpsnPrgr {
19047 WpsnPrgr(0)
22135 } 19048 }
22136 } 19049 }
22137 #[doc = "FLASH option control register"] 19050 #[doc = "FLASH option control register"]
@@ -22190,25 +19103,66 @@ pub mod flash_h7 {
22190 Optcr(0) 19103 Optcr(0)
22191 } 19104 }
22192 } 19105 }
22193 #[doc = "FLASH CRC start address register for bank 1"] 19106 #[doc = "FLASH ECC fail address for bank 1"]
22194 #[repr(transparent)] 19107 #[repr(transparent)]
22195 #[derive(Copy, Clone, Eq, PartialEq)] 19108 #[derive(Copy, Clone, Eq, PartialEq)]
22196 pub struct Crcsaddr(pub u32); 19109 pub struct Far(pub u32);
22197 impl Crcsaddr { 19110 impl Far {
22198 #[doc = "CRC start address on bank 1"] 19111 #[doc = "Bank 1 ECC error address"]
22199 pub const fn crc_start_addr(&self) -> u32 { 19112 pub const fn fail_ecc_addr(&self) -> u16 {
19113 let val = (self.0 >> 0usize) & 0x7fff;
19114 val as u16
19115 }
19116 #[doc = "Bank 1 ECC error address"]
19117 pub fn set_fail_ecc_addr(&mut self, val: u16) {
19118 self.0 = (self.0 & !(0x7fff << 0usize)) | (((val as u32) & 0x7fff) << 0usize);
19119 }
19120 }
19121 impl Default for Far {
19122 fn default() -> Far {
19123 Far(0)
19124 }
19125 }
19126 #[doc = "FLASH key register for bank 1"]
19127 #[repr(transparent)]
19128 #[derive(Copy, Clone, Eq, PartialEq)]
19129 pub struct Keyr(pub u32);
19130 impl Keyr {
19131 #[doc = "Bank 1 access configuration unlock key"]
19132 pub const fn keyr(&self) -> u32 {
22200 let val = (self.0 >> 0usize) & 0xffff_ffff; 19133 let val = (self.0 >> 0usize) & 0xffff_ffff;
22201 val as u32 19134 val as u32
22202 } 19135 }
22203 #[doc = "CRC start address on bank 1"] 19136 #[doc = "Bank 1 access configuration unlock key"]
22204 pub fn set_crc_start_addr(&mut self, val: u32) { 19137 pub fn set_keyr(&mut self, val: u32) {
22205 self.0 = 19138 self.0 =
22206 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 19139 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
22207 } 19140 }
22208 } 19141 }
22209 impl Default for Crcsaddr { 19142 impl Default for Keyr {
22210 fn default() -> Crcsaddr { 19143 fn default() -> Keyr {
22211 Crcsaddr(0) 19144 Keyr(0)
19145 }
19146 }
19147 #[doc = "FLASH CRC data register"]
19148 #[repr(transparent)]
19149 #[derive(Copy, Clone, Eq, PartialEq)]
19150 pub struct Crcdatar(pub u32);
19151 impl Crcdatar {
19152 #[doc = "CRC result"]
19153 pub const fn crc_data(&self) -> u32 {
19154 let val = (self.0 >> 0usize) & 0xffff_ffff;
19155 val as u32
19156 }
19157 #[doc = "CRC result"]
19158 pub fn set_crc_data(&mut self, val: u32) {
19159 self.0 =
19160 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
19161 }
19162 }
19163 impl Default for Crcdatar {
19164 fn default() -> Crcdatar {
19165 Crcdatar(0)
22212 } 19166 }
22213 } 19167 }
22214 #[doc = "FLASH clear control register for bank 1"] 19168 #[doc = "FLASH clear control register for bank 1"]
@@ -22321,124 +19275,91 @@ pub mod flash_h7 {
22321 Ccr(0) 19275 Ccr(0)
22322 } 19276 }
22323 } 19277 }
22324 #[doc = "FLASH key register for bank 1"] 19278 #[doc = "Access control register"]
22325 #[repr(transparent)] 19279 #[repr(transparent)]
22326 #[derive(Copy, Clone, Eq, PartialEq)] 19280 #[derive(Copy, Clone, Eq, PartialEq)]
22327 pub struct Keyr(pub u32); 19281 pub struct Acr(pub u32);
22328 impl Keyr { 19282 impl Acr {
22329 #[doc = "Bank 1 access configuration unlock key"] 19283 #[doc = "Read latency"]
22330 pub const fn keyr(&self) -> u32 { 19284 pub const fn latency(&self) -> u8 {
22331 let val = (self.0 >> 0usize) & 0xffff_ffff; 19285 let val = (self.0 >> 0usize) & 0x07;
22332 val as u32 19286 val as u8
22333 } 19287 }
22334 #[doc = "Bank 1 access configuration unlock key"] 19288 #[doc = "Read latency"]
22335 pub fn set_keyr(&mut self, val: u32) { 19289 pub fn set_latency(&mut self, val: u8) {
22336 self.0 = 19290 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
22337 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 19291 }
19292 #[doc = "Flash signal delay"]
19293 pub const fn wrhighfreq(&self) -> u8 {
19294 let val = (self.0 >> 4usize) & 0x03;
19295 val as u8
19296 }
19297 #[doc = "Flash signal delay"]
19298 pub fn set_wrhighfreq(&mut self, val: u8) {
19299 self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize);
22338 } 19300 }
22339 } 19301 }
22340 impl Default for Keyr { 19302 impl Default for Acr {
22341 fn default() -> Keyr { 19303 fn default() -> Acr {
22342 Keyr(0) 19304 Acr(0)
22343 } 19305 }
22344 } 19306 }
22345 #[doc = "FLASH CRC data register"] 19307 #[doc = "FLASH secure address for bank 1"]
22346 #[repr(transparent)] 19308 #[repr(transparent)]
22347 #[derive(Copy, Clone, Eq, PartialEq)] 19309 #[derive(Copy, Clone, Eq, PartialEq)]
22348 pub struct Crcdatar(pub u32); 19310 pub struct ScarPrg(pub u32);
22349 impl Crcdatar { 19311 impl ScarPrg {
22350 #[doc = "CRC result"] 19312 #[doc = "Bank 1 lowest secure protected address configuration"]
22351 pub const fn crc_data(&self) -> u32 { 19313 pub const fn sec_area_start(&self) -> u16 {
22352 let val = (self.0 >> 0usize) & 0xffff_ffff; 19314 let val = (self.0 >> 0usize) & 0x0fff;
22353 val as u32 19315 val as u16
22354 } 19316 }
22355 #[doc = "CRC result"] 19317 #[doc = "Bank 1 lowest secure protected address configuration"]
22356 pub fn set_crc_data(&mut self, val: u32) { 19318 pub fn set_sec_area_start(&mut self, val: u16) {
22357 self.0 = 19319 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
22358 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
22359 } 19320 }
22360 } 19321 #[doc = "Bank 1 highest secure protected address configuration"]
22361 impl Default for Crcdatar { 19322 pub const fn sec_area_end(&self) -> u16 {
22362 fn default() -> Crcdatar { 19323 let val = (self.0 >> 16usize) & 0x0fff;
22363 Crcdatar(0) 19324 val as u16
22364 } 19325 }
22365 } 19326 #[doc = "Bank 1 highest secure protected address configuration"]
22366 #[doc = "FLASH option clear control register"] 19327 pub fn set_sec_area_end(&mut self, val: u16) {
22367 #[repr(transparent)] 19328 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
22368 #[derive(Copy, Clone, Eq, PartialEq)] 19329 }
22369 pub struct Optccr(pub u32); 19330 #[doc = "Bank 1 secure protected erase enable option configuration bit"]
22370 impl Optccr { 19331 pub const fn dmes(&self) -> bool {
22371 #[doc = "OPTCHANGEERR reset bit"] 19332 let val = (self.0 >> 31usize) & 0x01;
22372 pub const fn clr_optchangeerr(&self) -> bool {
22373 let val = (self.0 >> 30usize) & 0x01;
22374 val != 0 19333 val != 0
22375 } 19334 }
22376 #[doc = "OPTCHANGEERR reset bit"] 19335 #[doc = "Bank 1 secure protected erase enable option configuration bit"]
22377 pub fn set_clr_optchangeerr(&mut self, val: bool) { 19336 pub fn set_dmes(&mut self, val: bool) {
22378 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize); 19337 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
22379 } 19338 }
22380 } 19339 }
22381 impl Default for Optccr { 19340 impl Default for ScarPrg {
22382 fn default() -> Optccr { 19341 fn default() -> ScarPrg {
22383 Optccr(0) 19342 ScarPrg(0)
22384 } 19343 }
22385 } 19344 }
22386 #[doc = "FLASH write sector protection for bank 1"] 19345 #[doc = "FLASH write sector protection for bank 1"]
22387 #[repr(transparent)] 19346 #[repr(transparent)]
22388 #[derive(Copy, Clone, Eq, PartialEq)] 19347 #[derive(Copy, Clone, Eq, PartialEq)]
22389 pub struct WpsnPrgr(pub u32); 19348 pub struct WpsnCurr(pub u32);
22390 impl WpsnPrgr { 19349 impl WpsnCurr {
22391 #[doc = "Bank 1 sector write protection configuration byte"] 19350 #[doc = "Bank 1 sector write protection option status byte"]
22392 pub const fn wrpsn(&self) -> u8 { 19351 pub const fn wrpsn(&self) -> u8 {
22393 let val = (self.0 >> 0usize) & 0xff; 19352 let val = (self.0 >> 0usize) & 0xff;
22394 val as u8 19353 val as u8
22395 } 19354 }
22396 #[doc = "Bank 1 sector write protection configuration byte"] 19355 #[doc = "Bank 1 sector write protection option status byte"]
22397 pub fn set_wrpsn(&mut self, val: u8) { 19356 pub fn set_wrpsn(&mut self, val: u8) {
22398 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 19357 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
22399 } 19358 }
22400 } 19359 }
22401 impl Default for WpsnPrgr { 19360 impl Default for WpsnCurr {
22402 fn default() -> WpsnPrgr { 19361 fn default() -> WpsnCurr {
22403 WpsnPrgr(0) 19362 WpsnCurr(0)
22404 }
22405 }
22406 #[doc = "FLASH protection address for bank 1"]
22407 #[repr(transparent)]
22408 #[derive(Copy, Clone, Eq, PartialEq)]
22409 pub struct PrarCur(pub u32);
22410 impl PrarCur {
22411 #[doc = "Bank 1 lowest PCROP protected address"]
22412 pub const fn prot_area_start(&self) -> u16 {
22413 let val = (self.0 >> 0usize) & 0x0fff;
22414 val as u16
22415 }
22416 #[doc = "Bank 1 lowest PCROP protected address"]
22417 pub fn set_prot_area_start(&mut self, val: u16) {
22418 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
22419 }
22420 #[doc = "Bank 1 highest PCROP protected address"]
22421 pub const fn prot_area_end(&self) -> u16 {
22422 let val = (self.0 >> 16usize) & 0x0fff;
22423 val as u16
22424 }
22425 #[doc = "Bank 1 highest PCROP protected address"]
22426 pub fn set_prot_area_end(&mut self, val: u16) {
22427 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
22428 }
22429 #[doc = "Bank 1 PCROP protected erase enable option status bit"]
22430 pub const fn dmep(&self) -> bool {
22431 let val = (self.0 >> 31usize) & 0x01;
22432 val != 0
22433 }
22434 #[doc = "Bank 1 PCROP protected erase enable option status bit"]
22435 pub fn set_dmep(&mut self, val: bool) {
22436 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
22437 }
22438 }
22439 impl Default for PrarCur {
22440 fn default() -> PrarCur {
22441 PrarCur(0)
22442 } 19363 }
22443 } 19364 }
22444 #[doc = "FLASH register with boot address"] 19365 #[doc = "FLASH register with boot address"]
@@ -22470,6 +19391,27 @@ pub mod flash_h7 {
22470 BootPrgr(0) 19391 BootPrgr(0)
22471 } 19392 }
22472 } 19393 }
19394 #[doc = "FLASH CRC end address register for bank 1"]
19395 #[repr(transparent)]
19396 #[derive(Copy, Clone, Eq, PartialEq)]
19397 pub struct Crceaddr(pub u32);
19398 impl Crceaddr {
19399 #[doc = "CRC end address on bank 1"]
19400 pub const fn crc_end_addr(&self) -> u32 {
19401 let val = (self.0 >> 0usize) & 0xffff_ffff;
19402 val as u32
19403 }
19404 #[doc = "CRC end address on bank 1"]
19405 pub fn set_crc_end_addr(&mut self, val: u32) {
19406 self.0 =
19407 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
19408 }
19409 }
19410 impl Default for Crceaddr {
19411 fn default() -> Crceaddr {
19412 Crceaddr(0)
19413 }
19414 }
22473 #[doc = "FLASH secure address for bank 1"] 19415 #[doc = "FLASH secure address for bank 1"]
22474 #[repr(transparent)] 19416 #[repr(transparent)]
22475 #[derive(Copy, Clone, Eq, PartialEq)] 19417 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -22508,173 +19450,87 @@ pub mod flash_h7 {
22508 ScarCur(0) 19450 ScarCur(0)
22509 } 19451 }
22510 } 19452 }
22511 #[doc = "FLASH CRC end address register for bank 1"] 19453 #[doc = "FLASH CRC control register for bank 1"]
22512 #[repr(transparent)]
22513 #[derive(Copy, Clone, Eq, PartialEq)]
22514 pub struct Crceaddr(pub u32);
22515 impl Crceaddr {
22516 #[doc = "CRC end address on bank 1"]
22517 pub const fn crc_end_addr(&self) -> u32 {
22518 let val = (self.0 >> 0usize) & 0xffff_ffff;
22519 val as u32
22520 }
22521 #[doc = "CRC end address on bank 1"]
22522 pub fn set_crc_end_addr(&mut self, val: u32) {
22523 self.0 =
22524 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
22525 }
22526 }
22527 impl Default for Crceaddr {
22528 fn default() -> Crceaddr {
22529 Crceaddr(0)
22530 }
22531 }
22532 #[doc = "FLASH option status register"]
22533 #[repr(transparent)] 19454 #[repr(transparent)]
22534 #[derive(Copy, Clone, Eq, PartialEq)] 19455 #[derive(Copy, Clone, Eq, PartialEq)]
22535 pub struct OptsrPrg(pub u32); 19456 pub struct Crccr(pub u32);
22536 impl OptsrPrg { 19457 impl Crccr {
22537 #[doc = "BOR reset level option configuration bits"] 19458 #[doc = "Bank 1 CRC sector number"]
22538 pub const fn bor_lev(&self) -> u8 { 19459 pub const fn crc_sect(&self) -> u8 {
22539 let val = (self.0 >> 2usize) & 0x03; 19460 let val = (self.0 >> 0usize) & 0x07;
22540 val as u8 19461 val as u8
22541 } 19462 }
22542 #[doc = "BOR reset level option configuration bits"] 19463 #[doc = "Bank 1 CRC sector number"]
22543 pub fn set_bor_lev(&mut self, val: u8) { 19464 pub fn set_crc_sect(&mut self, val: u8) {
22544 self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize); 19465 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
22545 }
22546 #[doc = "IWDG1 option configuration bit"]
22547 pub const fn iwdg1_hw(&self) -> bool {
22548 let val = (self.0 >> 4usize) & 0x01;
22549 val != 0
22550 }
22551 #[doc = "IWDG1 option configuration bit"]
22552 pub fn set_iwdg1_hw(&mut self, val: bool) {
22553 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
22554 }
22555 #[doc = "Option byte erase after D1 DStop option configuration bit"]
22556 pub const fn n_rst_stop_d1(&self) -> bool {
22557 let val = (self.0 >> 6usize) & 0x01;
22558 val != 0
22559 }
22560 #[doc = "Option byte erase after D1 DStop option configuration bit"]
22561 pub fn set_n_rst_stop_d1(&mut self, val: bool) {
22562 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
22563 } 19466 }
22564 #[doc = "Option byte erase after D1 DStandby option configuration bit"] 19467 #[doc = "Bank 1 CRC select bit"]
22565 pub const fn n_rst_stby_d1(&self) -> bool { 19468 pub const fn all_bank(&self) -> bool {
22566 let val = (self.0 >> 7usize) & 0x01; 19469 let val = (self.0 >> 7usize) & 0x01;
22567 val != 0 19470 val != 0
22568 } 19471 }
22569 #[doc = "Option byte erase after D1 DStandby option configuration bit"] 19472 #[doc = "Bank 1 CRC select bit"]
22570 pub fn set_n_rst_stby_d1(&mut self, val: bool) { 19473 pub fn set_all_bank(&mut self, val: bool) {
22571 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 19474 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
22572 } 19475 }
22573 #[doc = "Readout protection level option configuration byte"] 19476 #[doc = "Bank 1 CRC sector mode select bit"]
22574 pub const fn rdp(&self) -> u8 { 19477 pub const fn crc_by_sect(&self) -> bool {
22575 let val = (self.0 >> 8usize) & 0xff; 19478 let val = (self.0 >> 8usize) & 0x01;
22576 val as u8
22577 }
22578 #[doc = "Readout protection level option configuration byte"]
22579 pub fn set_rdp(&mut self, val: u8) {
22580 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
22581 }
22582 #[doc = "IWDG Stop mode freeze option configuration bit"]
22583 pub const fn fz_iwdg_stop(&self) -> bool {
22584 let val = (self.0 >> 17usize) & 0x01;
22585 val != 0
22586 }
22587 #[doc = "IWDG Stop mode freeze option configuration bit"]
22588 pub fn set_fz_iwdg_stop(&mut self, val: bool) {
22589 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
22590 }
22591 #[doc = "IWDG Standby mode freeze option configuration bit"]
22592 pub const fn fz_iwdg_sdby(&self) -> bool {
22593 let val = (self.0 >> 18usize) & 0x01;
22594 val != 0
22595 }
22596 #[doc = "IWDG Standby mode freeze option configuration bit"]
22597 pub fn set_fz_iwdg_sdby(&mut self, val: bool) {
22598 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
22599 }
22600 #[doc = "DTCM size select option configuration bits"]
22601 pub const fn st_ram_size(&self) -> u8 {
22602 let val = (self.0 >> 19usize) & 0x03;
22603 val as u8
22604 }
22605 #[doc = "DTCM size select option configuration bits"]
22606 pub fn set_st_ram_size(&mut self, val: u8) {
22607 self.0 = (self.0 & !(0x03 << 19usize)) | (((val as u32) & 0x03) << 19usize);
22608 }
22609 #[doc = "Security option configuration bit"]
22610 pub const fn security(&self) -> bool {
22611 let val = (self.0 >> 21usize) & 0x01;
22612 val != 0 19479 val != 0
22613 } 19480 }
22614 #[doc = "Security option configuration bit"] 19481 #[doc = "Bank 1 CRC sector mode select bit"]
22615 pub fn set_security(&mut self, val: bool) { 19482 pub fn set_crc_by_sect(&mut self, val: bool) {
22616 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); 19483 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
22617 } 19484 }
22618 #[doc = "User option configuration bit 1"] 19485 #[doc = "Bank 1 CRC sector select bit"]
22619 pub const fn rss1(&self) -> bool { 19486 pub const fn add_sect(&self) -> bool {
22620 let val = (self.0 >> 26usize) & 0x01; 19487 let val = (self.0 >> 9usize) & 0x01;
22621 val != 0 19488 val != 0
22622 } 19489 }
22623 #[doc = "User option configuration bit 1"] 19490 #[doc = "Bank 1 CRC sector select bit"]
22624 pub fn set_rss1(&mut self, val: bool) { 19491 pub fn set_add_sect(&mut self, val: bool) {
22625 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); 19492 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
22626 } 19493 }
22627 #[doc = "User option configuration bit 2"] 19494 #[doc = "Bank 1 CRC sector list clear bit"]
22628 pub const fn rss2(&self) -> bool { 19495 pub const fn clean_sect(&self) -> bool {
22629 let val = (self.0 >> 27usize) & 0x01; 19496 let val = (self.0 >> 10usize) & 0x01;
22630 val != 0 19497 val != 0
22631 } 19498 }
22632 #[doc = "User option configuration bit 2"] 19499 #[doc = "Bank 1 CRC sector list clear bit"]
22633 pub fn set_rss2(&mut self, val: bool) { 19500 pub fn set_clean_sect(&mut self, val: bool) {
22634 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize); 19501 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
22635 } 19502 }
22636 #[doc = "I/O high-speed at low-voltage (PRODUCT_BELOW_25V)"] 19503 #[doc = "Bank 1 CRC start bit"]
22637 pub const fn io_hslv(&self) -> bool { 19504 pub const fn start_crc(&self) -> bool {
22638 let val = (self.0 >> 29usize) & 0x01; 19505 let val = (self.0 >> 16usize) & 0x01;
22639 val != 0 19506 val != 0
22640 } 19507 }
22641 #[doc = "I/O high-speed at low-voltage (PRODUCT_BELOW_25V)"] 19508 #[doc = "Bank 1 CRC start bit"]
22642 pub fn set_io_hslv(&mut self, val: bool) { 19509 pub fn set_start_crc(&mut self, val: bool) {
22643 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); 19510 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
22644 } 19511 }
22645 #[doc = "Bank swapping option configuration bit"] 19512 #[doc = "Bank 1 CRC clear bit"]
22646 pub const fn swap_bank_opt(&self) -> bool { 19513 pub const fn clean_crc(&self) -> bool {
22647 let val = (self.0 >> 31usize) & 0x01; 19514 let val = (self.0 >> 17usize) & 0x01;
22648 val != 0 19515 val != 0
22649 } 19516 }
22650 #[doc = "Bank swapping option configuration bit"] 19517 #[doc = "Bank 1 CRC clear bit"]
22651 pub fn set_swap_bank_opt(&mut self, val: bool) { 19518 pub fn set_clean_crc(&mut self, val: bool) {
22652 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); 19519 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
22653 }
22654 }
22655 impl Default for OptsrPrg {
22656 fn default() -> OptsrPrg {
22657 OptsrPrg(0)
22658 } 19520 }
22659 } 19521 #[doc = "Bank 1 CRC burst size"]
22660 #[doc = "FLASH ECC fail address for bank 1"] 19522 pub const fn crc_burst(&self) -> u8 {
22661 #[repr(transparent)] 19523 let val = (self.0 >> 20usize) & 0x03;
22662 #[derive(Copy, Clone, Eq, PartialEq)] 19524 val as u8
22663 pub struct Far(pub u32);
22664 impl Far {
22665 #[doc = "Bank 1 ECC error address"]
22666 pub const fn fail_ecc_addr(&self) -> u16 {
22667 let val = (self.0 >> 0usize) & 0x7fff;
22668 val as u16
22669 } 19525 }
22670 #[doc = "Bank 1 ECC error address"] 19526 #[doc = "Bank 1 CRC burst size"]
22671 pub fn set_fail_ecc_addr(&mut self, val: u16) { 19527 pub fn set_crc_burst(&mut self, val: u8) {
22672 self.0 = (self.0 & !(0x7fff << 0usize)) | (((val as u32) & 0x7fff) << 0usize); 19528 self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize);
22673 } 19529 }
22674 } 19530 }
22675 impl Default for Far { 19531 impl Default for Crccr {
22676 fn default() -> Far { 19532 fn default() -> Crccr {
22677 Far(0) 19533 Crccr(0)
22678 } 19534 }
22679 } 19535 }
22680 #[doc = "FLASH option key register"] 19536 #[doc = "FLASH option key register"]
@@ -22698,33 +19554,24 @@ pub mod flash_h7 {
22698 Optkeyr(0) 19554 Optkeyr(0)
22699 } 19555 }
22700 } 19556 }
22701 #[doc = "FLASH register with boot address"] 19557 #[doc = "FLASH option clear control register"]
22702 #[repr(transparent)] 19558 #[repr(transparent)]
22703 #[derive(Copy, Clone, Eq, PartialEq)] 19559 #[derive(Copy, Clone, Eq, PartialEq)]
22704 pub struct BootCurr(pub u32); 19560 pub struct Optccr(pub u32);
22705 impl BootCurr { 19561 impl Optccr {
22706 #[doc = "Boot address 0"] 19562 #[doc = "OPTCHANGEERR reset bit"]
22707 pub const fn boot_add0(&self) -> u16 { 19563 pub const fn clr_optchangeerr(&self) -> bool {
22708 let val = (self.0 >> 0usize) & 0xffff; 19564 let val = (self.0 >> 30usize) & 0x01;
22709 val as u16 19565 val != 0
22710 }
22711 #[doc = "Boot address 0"]
22712 pub fn set_boot_add0(&mut self, val: u16) {
22713 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
22714 }
22715 #[doc = "Boot address 1"]
22716 pub const fn boot_add1(&self) -> u16 {
22717 let val = (self.0 >> 16usize) & 0xffff;
22718 val as u16
22719 } 19566 }
22720 #[doc = "Boot address 1"] 19567 #[doc = "OPTCHANGEERR reset bit"]
22721 pub fn set_boot_add1(&mut self, val: u16) { 19568 pub fn set_clr_optchangeerr(&mut self, val: bool) {
22722 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); 19569 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
22723 } 19570 }
22724 } 19571 }
22725 impl Default for BootCurr { 19572 impl Default for Optccr {
22726 fn default() -> BootCurr { 19573 fn default() -> Optccr {
22727 BootCurr(0) 19574 Optccr(0)
22728 } 19575 }
22729 } 19576 }
22730 #[doc = "FLASH option status register"] 19577 #[doc = "FLASH option status register"]
@@ -22873,1081 +19720,4666 @@ pub mod flash_h7 {
22873 OptsrCur(0) 19720 OptsrCur(0)
22874 } 19721 }
22875 } 19722 }
22876 #[doc = "FLASH protection address for bank 1"] 19723 }
19724}
19725pub mod i2c_v2 {
19726 use crate::generic::*;
19727 #[doc = "Inter-integrated circuit"]
19728 #[derive(Copy, Clone)]
19729 pub struct I2c(pub *mut u8);
19730 unsafe impl Send for I2c {}
19731 unsafe impl Sync for I2c {}
19732 impl I2c {
19733 #[doc = "Control register 1"]
19734 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
19735 unsafe { Reg::from_ptr(self.0.add(0usize)) }
19736 }
19737 #[doc = "Control register 2"]
19738 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
19739 unsafe { Reg::from_ptr(self.0.add(4usize)) }
19740 }
19741 #[doc = "Own address register 1"]
19742 pub fn oar1(self) -> Reg<regs::Oar1, RW> {
19743 unsafe { Reg::from_ptr(self.0.add(8usize)) }
19744 }
19745 #[doc = "Own address register 2"]
19746 pub fn oar2(self) -> Reg<regs::Oar2, RW> {
19747 unsafe { Reg::from_ptr(self.0.add(12usize)) }
19748 }
19749 #[doc = "Timing register"]
19750 pub fn timingr(self) -> Reg<regs::Timingr, RW> {
19751 unsafe { Reg::from_ptr(self.0.add(16usize)) }
19752 }
19753 #[doc = "Status register 1"]
19754 pub fn timeoutr(self) -> Reg<regs::Timeoutr, RW> {
19755 unsafe { Reg::from_ptr(self.0.add(20usize)) }
19756 }
19757 #[doc = "Interrupt and Status register"]
19758 pub fn isr(self) -> Reg<regs::Isr, RW> {
19759 unsafe { Reg::from_ptr(self.0.add(24usize)) }
19760 }
19761 #[doc = "Interrupt clear register"]
19762 pub fn icr(self) -> Reg<regs::Icr, W> {
19763 unsafe { Reg::from_ptr(self.0.add(28usize)) }
19764 }
19765 #[doc = "PEC register"]
19766 pub fn pecr(self) -> Reg<regs::Pecr, R> {
19767 unsafe { Reg::from_ptr(self.0.add(32usize)) }
19768 }
19769 #[doc = "Receive data register"]
19770 pub fn rxdr(self) -> Reg<regs::Rxdr, R> {
19771 unsafe { Reg::from_ptr(self.0.add(36usize)) }
19772 }
19773 #[doc = "Transmit data register"]
19774 pub fn txdr(self) -> Reg<regs::Txdr, RW> {
19775 unsafe { Reg::from_ptr(self.0.add(40usize)) }
19776 }
19777 }
19778 pub mod regs {
19779 use crate::generic::*;
19780 #[doc = "Control register 1"]
22877 #[repr(transparent)] 19781 #[repr(transparent)]
22878 #[derive(Copy, Clone, Eq, PartialEq)] 19782 #[derive(Copy, Clone, Eq, PartialEq)]
22879 pub struct PrarPrg(pub u32); 19783 pub struct Cr1(pub u32);
22880 impl PrarPrg { 19784 impl Cr1 {
22881 #[doc = "Bank 1 lowest PCROP protected address configuration"] 19785 #[doc = "Peripheral enable"]
22882 pub const fn prot_area_start(&self) -> u16 { 19786 pub const fn pe(&self) -> bool {
22883 let val = (self.0 >> 0usize) & 0x0fff; 19787 let val = (self.0 >> 0usize) & 0x01;
22884 val as u16 19788 val != 0
22885 } 19789 }
22886 #[doc = "Bank 1 lowest PCROP protected address configuration"] 19790 #[doc = "Peripheral enable"]
22887 pub fn set_prot_area_start(&mut self, val: u16) { 19791 pub fn set_pe(&mut self, val: bool) {
22888 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize); 19792 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
22889 } 19793 }
22890 #[doc = "Bank 1 highest PCROP protected address configuration"] 19794 #[doc = "TX Interrupt enable"]
22891 pub const fn prot_area_end(&self) -> u16 { 19795 pub const fn txie(&self) -> bool {
22892 let val = (self.0 >> 16usize) & 0x0fff; 19796 let val = (self.0 >> 1usize) & 0x01;
22893 val as u16 19797 val != 0
22894 } 19798 }
22895 #[doc = "Bank 1 highest PCROP protected address configuration"] 19799 #[doc = "TX Interrupt enable"]
22896 pub fn set_prot_area_end(&mut self, val: u16) { 19800 pub fn set_txie(&mut self, val: bool) {
22897 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize); 19801 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
22898 } 19802 }
22899 #[doc = "Bank 1 PCROP protected erase enable option configuration bit"] 19803 #[doc = "RX Interrupt enable"]
22900 pub const fn dmep(&self) -> bool { 19804 pub const fn rxie(&self) -> bool {
22901 let val = (self.0 >> 31usize) & 0x01; 19805 let val = (self.0 >> 2usize) & 0x01;
22902 val != 0 19806 val != 0
22903 } 19807 }
22904 #[doc = "Bank 1 PCROP protected erase enable option configuration bit"] 19808 #[doc = "RX Interrupt enable"]
22905 pub fn set_dmep(&mut self, val: bool) { 19809 pub fn set_rxie(&mut self, val: bool) {
22906 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize); 19810 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
19811 }
19812 #[doc = "Address match interrupt enable (slave only)"]
19813 pub const fn addrie(&self) -> bool {
19814 let val = (self.0 >> 3usize) & 0x01;
19815 val != 0
19816 }
19817 #[doc = "Address match interrupt enable (slave only)"]
19818 pub fn set_addrie(&mut self, val: bool) {
19819 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
19820 }
19821 #[doc = "Not acknowledge received interrupt enable"]
19822 pub const fn nackie(&self) -> bool {
19823 let val = (self.0 >> 4usize) & 0x01;
19824 val != 0
19825 }
19826 #[doc = "Not acknowledge received interrupt enable"]
19827 pub fn set_nackie(&mut self, val: bool) {
19828 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
19829 }
19830 #[doc = "STOP detection Interrupt enable"]
19831 pub const fn stopie(&self) -> bool {
19832 let val = (self.0 >> 5usize) & 0x01;
19833 val != 0
19834 }
19835 #[doc = "STOP detection Interrupt enable"]
19836 pub fn set_stopie(&mut self, val: bool) {
19837 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
19838 }
19839 #[doc = "Transfer Complete interrupt enable"]
19840 pub const fn tcie(&self) -> bool {
19841 let val = (self.0 >> 6usize) & 0x01;
19842 val != 0
19843 }
19844 #[doc = "Transfer Complete interrupt enable"]
19845 pub fn set_tcie(&mut self, val: bool) {
19846 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
19847 }
19848 #[doc = "Error interrupts enable"]
19849 pub const fn errie(&self) -> bool {
19850 let val = (self.0 >> 7usize) & 0x01;
19851 val != 0
19852 }
19853 #[doc = "Error interrupts enable"]
19854 pub fn set_errie(&mut self, val: bool) {
19855 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
19856 }
19857 #[doc = "Digital noise filter"]
19858 pub const fn dnf(&self) -> super::vals::Dnf {
19859 let val = (self.0 >> 8usize) & 0x0f;
19860 super::vals::Dnf(val as u8)
19861 }
19862 #[doc = "Digital noise filter"]
19863 pub fn set_dnf(&mut self, val: super::vals::Dnf) {
19864 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
19865 }
19866 #[doc = "Analog noise filter OFF"]
19867 pub const fn anfoff(&self) -> bool {
19868 let val = (self.0 >> 12usize) & 0x01;
19869 val != 0
19870 }
19871 #[doc = "Analog noise filter OFF"]
19872 pub fn set_anfoff(&mut self, val: bool) {
19873 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
19874 }
19875 #[doc = "DMA transmission requests enable"]
19876 pub const fn txdmaen(&self) -> bool {
19877 let val = (self.0 >> 14usize) & 0x01;
19878 val != 0
19879 }
19880 #[doc = "DMA transmission requests enable"]
19881 pub fn set_txdmaen(&mut self, val: bool) {
19882 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
19883 }
19884 #[doc = "DMA reception requests enable"]
19885 pub const fn rxdmaen(&self) -> bool {
19886 let val = (self.0 >> 15usize) & 0x01;
19887 val != 0
19888 }
19889 #[doc = "DMA reception requests enable"]
19890 pub fn set_rxdmaen(&mut self, val: bool) {
19891 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
19892 }
19893 #[doc = "Slave byte control"]
19894 pub const fn sbc(&self) -> bool {
19895 let val = (self.0 >> 16usize) & 0x01;
19896 val != 0
19897 }
19898 #[doc = "Slave byte control"]
19899 pub fn set_sbc(&mut self, val: bool) {
19900 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
19901 }
19902 #[doc = "Clock stretching disable"]
19903 pub const fn nostretch(&self) -> bool {
19904 let val = (self.0 >> 17usize) & 0x01;
19905 val != 0
19906 }
19907 #[doc = "Clock stretching disable"]
19908 pub fn set_nostretch(&mut self, val: bool) {
19909 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
19910 }
19911 #[doc = "General call enable"]
19912 pub const fn gcen(&self) -> bool {
19913 let val = (self.0 >> 19usize) & 0x01;
19914 val != 0
19915 }
19916 #[doc = "General call enable"]
19917 pub fn set_gcen(&mut self, val: bool) {
19918 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
19919 }
19920 #[doc = "SMBus Host address enable"]
19921 pub const fn smbhen(&self) -> bool {
19922 let val = (self.0 >> 20usize) & 0x01;
19923 val != 0
19924 }
19925 #[doc = "SMBus Host address enable"]
19926 pub fn set_smbhen(&mut self, val: bool) {
19927 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
19928 }
19929 #[doc = "SMBus Device Default address enable"]
19930 pub const fn smbden(&self) -> bool {
19931 let val = (self.0 >> 21usize) & 0x01;
19932 val != 0
19933 }
19934 #[doc = "SMBus Device Default address enable"]
19935 pub fn set_smbden(&mut self, val: bool) {
19936 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
19937 }
19938 #[doc = "SMBUS alert enable"]
19939 pub const fn alerten(&self) -> bool {
19940 let val = (self.0 >> 22usize) & 0x01;
19941 val != 0
19942 }
19943 #[doc = "SMBUS alert enable"]
19944 pub fn set_alerten(&mut self, val: bool) {
19945 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
19946 }
19947 #[doc = "PEC enable"]
19948 pub const fn pecen(&self) -> bool {
19949 let val = (self.0 >> 23usize) & 0x01;
19950 val != 0
19951 }
19952 #[doc = "PEC enable"]
19953 pub fn set_pecen(&mut self, val: bool) {
19954 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
22907 } 19955 }
22908 } 19956 }
22909 impl Default for PrarPrg { 19957 impl Default for Cr1 {
22910 fn default() -> PrarPrg { 19958 fn default() -> Cr1 {
22911 PrarPrg(0) 19959 Cr1(0)
22912 } 19960 }
22913 } 19961 }
22914 #[doc = "Access control register"] 19962 #[doc = "Timing register"]
22915 #[repr(transparent)] 19963 #[repr(transparent)]
22916 #[derive(Copy, Clone, Eq, PartialEq)] 19964 #[derive(Copy, Clone, Eq, PartialEq)]
22917 pub struct Acr(pub u32); 19965 pub struct Timingr(pub u32);
22918 impl Acr { 19966 impl Timingr {
22919 #[doc = "Read latency"] 19967 #[doc = "SCL low period (master mode)"]
22920 pub const fn latency(&self) -> u8 { 19968 pub const fn scll(&self) -> u8 {
22921 let val = (self.0 >> 0usize) & 0x07; 19969 let val = (self.0 >> 0usize) & 0xff;
22922 val as u8 19970 val as u8
22923 } 19971 }
22924 #[doc = "Read latency"] 19972 #[doc = "SCL low period (master mode)"]
22925 pub fn set_latency(&mut self, val: u8) { 19973 pub fn set_scll(&mut self, val: u8) {
22926 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); 19974 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
22927 } 19975 }
22928 #[doc = "Flash signal delay"] 19976 #[doc = "SCL high period (master mode)"]
22929 pub const fn wrhighfreq(&self) -> u8 { 19977 pub const fn sclh(&self) -> u8 {
22930 let val = (self.0 >> 4usize) & 0x03; 19978 let val = (self.0 >> 8usize) & 0xff;
22931 val as u8 19979 val as u8
22932 } 19980 }
22933 #[doc = "Flash signal delay"] 19981 #[doc = "SCL high period (master mode)"]
22934 pub fn set_wrhighfreq(&mut self, val: u8) { 19982 pub fn set_sclh(&mut self, val: u8) {
22935 self.0 = (self.0 & !(0x03 << 4usize)) | (((val as u32) & 0x03) << 4usize); 19983 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
19984 }
19985 #[doc = "Data hold time"]
19986 pub const fn sdadel(&self) -> u8 {
19987 let val = (self.0 >> 16usize) & 0x0f;
19988 val as u8
19989 }
19990 #[doc = "Data hold time"]
19991 pub fn set_sdadel(&mut self, val: u8) {
19992 self.0 = (self.0 & !(0x0f << 16usize)) | (((val as u32) & 0x0f) << 16usize);
19993 }
19994 #[doc = "Data setup time"]
19995 pub const fn scldel(&self) -> u8 {
19996 let val = (self.0 >> 20usize) & 0x0f;
19997 val as u8
19998 }
19999 #[doc = "Data setup time"]
20000 pub fn set_scldel(&mut self, val: u8) {
20001 self.0 = (self.0 & !(0x0f << 20usize)) | (((val as u32) & 0x0f) << 20usize);
20002 }
20003 #[doc = "Timing prescaler"]
20004 pub const fn presc(&self) -> u8 {
20005 let val = (self.0 >> 28usize) & 0x0f;
20006 val as u8
20007 }
20008 #[doc = "Timing prescaler"]
20009 pub fn set_presc(&mut self, val: u8) {
20010 self.0 = (self.0 & !(0x0f << 28usize)) | (((val as u32) & 0x0f) << 28usize);
22936 } 20011 }
22937 } 20012 }
22938 impl Default for Acr { 20013 impl Default for Timingr {
22939 fn default() -> Acr { 20014 fn default() -> Timingr {
22940 Acr(0) 20015 Timingr(0)
22941 } 20016 }
22942 } 20017 }
22943 #[doc = "FLASH write sector protection for bank 1"] 20018 #[doc = "Receive data register"]
22944 #[repr(transparent)] 20019 #[repr(transparent)]
22945 #[derive(Copy, Clone, Eq, PartialEq)] 20020 #[derive(Copy, Clone, Eq, PartialEq)]
22946 pub struct WpsnCurr(pub u32); 20021 pub struct Rxdr(pub u32);
22947 impl WpsnCurr { 20022 impl Rxdr {
22948 #[doc = "Bank 1 sector write protection option status byte"] 20023 #[doc = "8-bit receive data"]
22949 pub const fn wrpsn(&self) -> u8 { 20024 pub const fn rxdata(&self) -> u8 {
22950 let val = (self.0 >> 0usize) & 0xff; 20025 let val = (self.0 >> 0usize) & 0xff;
22951 val as u8 20026 val as u8
22952 } 20027 }
22953 #[doc = "Bank 1 sector write protection option status byte"] 20028 #[doc = "8-bit receive data"]
22954 pub fn set_wrpsn(&mut self, val: u8) { 20029 pub fn set_rxdata(&mut self, val: u8) {
22955 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 20030 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
22956 } 20031 }
22957 } 20032 }
22958 impl Default for WpsnCurr { 20033 impl Default for Rxdr {
22959 fn default() -> WpsnCurr { 20034 fn default() -> Rxdr {
22960 WpsnCurr(0) 20035 Rxdr(0)
22961 } 20036 }
22962 } 20037 }
22963 #[doc = "FLASH CRC control register for bank 1"] 20038 #[doc = "PEC register"]
22964 #[repr(transparent)] 20039 #[repr(transparent)]
22965 #[derive(Copy, Clone, Eq, PartialEq)] 20040 #[derive(Copy, Clone, Eq, PartialEq)]
22966 pub struct Crccr(pub u32); 20041 pub struct Pecr(pub u32);
22967 impl Crccr { 20042 impl Pecr {
22968 #[doc = "Bank 1 CRC sector number"] 20043 #[doc = "Packet error checking register"]
22969 pub const fn crc_sect(&self) -> u8 { 20044 pub const fn pec(&self) -> u8 {
22970 let val = (self.0 >> 0usize) & 0x07; 20045 let val = (self.0 >> 0usize) & 0xff;
22971 val as u8 20046 val as u8
22972 } 20047 }
22973 #[doc = "Bank 1 CRC sector number"] 20048 #[doc = "Packet error checking register"]
22974 pub fn set_crc_sect(&mut self, val: u8) { 20049 pub fn set_pec(&mut self, val: u8) {
22975 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); 20050 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
22976 } 20051 }
22977 #[doc = "Bank 1 CRC select bit"] 20052 }
22978 pub const fn all_bank(&self) -> bool { 20053 impl Default for Pecr {
20054 fn default() -> Pecr {
20055 Pecr(0)
20056 }
20057 }
20058 #[doc = "Control register 2"]
20059 #[repr(transparent)]
20060 #[derive(Copy, Clone, Eq, PartialEq)]
20061 pub struct Cr2(pub u32);
20062 impl Cr2 {
20063 #[doc = "Slave address bit (master mode)"]
20064 pub const fn sadd(&self) -> u16 {
20065 let val = (self.0 >> 0usize) & 0x03ff;
20066 val as u16
20067 }
20068 #[doc = "Slave address bit (master mode)"]
20069 pub fn set_sadd(&mut self, val: u16) {
20070 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
20071 }
20072 #[doc = "Transfer direction (master mode)"]
20073 pub const fn rd_wrn(&self) -> super::vals::RdWrn {
20074 let val = (self.0 >> 10usize) & 0x01;
20075 super::vals::RdWrn(val as u8)
20076 }
20077 #[doc = "Transfer direction (master mode)"]
20078 pub fn set_rd_wrn(&mut self, val: super::vals::RdWrn) {
20079 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
20080 }
20081 #[doc = "10-bit addressing mode (master mode)"]
20082 pub const fn add10(&self) -> super::vals::Add {
20083 let val = (self.0 >> 11usize) & 0x01;
20084 super::vals::Add(val as u8)
20085 }
20086 #[doc = "10-bit addressing mode (master mode)"]
20087 pub fn set_add10(&mut self, val: super::vals::Add) {
20088 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
20089 }
20090 #[doc = "10-bit address header only read direction (master receiver mode)"]
20091 pub const fn head10r(&self) -> super::vals::Headr {
20092 let val = (self.0 >> 12usize) & 0x01;
20093 super::vals::Headr(val as u8)
20094 }
20095 #[doc = "10-bit address header only read direction (master receiver mode)"]
20096 pub fn set_head10r(&mut self, val: super::vals::Headr) {
20097 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
20098 }
20099 #[doc = "Start generation"]
20100 pub const fn start(&self) -> super::vals::Start {
20101 let val = (self.0 >> 13usize) & 0x01;
20102 super::vals::Start(val as u8)
20103 }
20104 #[doc = "Start generation"]
20105 pub fn set_start(&mut self, val: super::vals::Start) {
20106 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
20107 }
20108 #[doc = "Stop generation (master mode)"]
20109 pub const fn stop(&self) -> super::vals::Stop {
20110 let val = (self.0 >> 14usize) & 0x01;
20111 super::vals::Stop(val as u8)
20112 }
20113 #[doc = "Stop generation (master mode)"]
20114 pub fn set_stop(&mut self, val: super::vals::Stop) {
20115 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
20116 }
20117 #[doc = "NACK generation (slave mode)"]
20118 pub const fn nack(&self) -> super::vals::Nack {
20119 let val = (self.0 >> 15usize) & 0x01;
20120 super::vals::Nack(val as u8)
20121 }
20122 #[doc = "NACK generation (slave mode)"]
20123 pub fn set_nack(&mut self, val: super::vals::Nack) {
20124 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
20125 }
20126 #[doc = "Number of bytes"]
20127 pub const fn nbytes(&self) -> u8 {
20128 let val = (self.0 >> 16usize) & 0xff;
20129 val as u8
20130 }
20131 #[doc = "Number of bytes"]
20132 pub fn set_nbytes(&mut self, val: u8) {
20133 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
20134 }
20135 #[doc = "NBYTES reload mode"]
20136 pub const fn reload(&self) -> super::vals::Reload {
20137 let val = (self.0 >> 24usize) & 0x01;
20138 super::vals::Reload(val as u8)
20139 }
20140 #[doc = "NBYTES reload mode"]
20141 pub fn set_reload(&mut self, val: super::vals::Reload) {
20142 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
20143 }
20144 #[doc = "Automatic end mode (master mode)"]
20145 pub const fn autoend(&self) -> super::vals::Autoend {
20146 let val = (self.0 >> 25usize) & 0x01;
20147 super::vals::Autoend(val as u8)
20148 }
20149 #[doc = "Automatic end mode (master mode)"]
20150 pub fn set_autoend(&mut self, val: super::vals::Autoend) {
20151 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize);
20152 }
20153 #[doc = "Packet error checking byte"]
20154 pub const fn pecbyte(&self) -> super::vals::Pecbyte {
20155 let val = (self.0 >> 26usize) & 0x01;
20156 super::vals::Pecbyte(val as u8)
20157 }
20158 #[doc = "Packet error checking byte"]
20159 pub fn set_pecbyte(&mut self, val: super::vals::Pecbyte) {
20160 self.0 = (self.0 & !(0x01 << 26usize)) | (((val.0 as u32) & 0x01) << 26usize);
20161 }
20162 }
20163 impl Default for Cr2 {
20164 fn default() -> Cr2 {
20165 Cr2(0)
20166 }
20167 }
20168 #[doc = "Interrupt clear register"]
20169 #[repr(transparent)]
20170 #[derive(Copy, Clone, Eq, PartialEq)]
20171 pub struct Icr(pub u32);
20172 impl Icr {
20173 #[doc = "Address Matched flag clear"]
20174 pub const fn addrcf(&self) -> bool {
20175 let val = (self.0 >> 3usize) & 0x01;
20176 val != 0
20177 }
20178 #[doc = "Address Matched flag clear"]
20179 pub fn set_addrcf(&mut self, val: bool) {
20180 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
20181 }
20182 #[doc = "Not Acknowledge flag clear"]
20183 pub const fn nackcf(&self) -> bool {
20184 let val = (self.0 >> 4usize) & 0x01;
20185 val != 0
20186 }
20187 #[doc = "Not Acknowledge flag clear"]
20188 pub fn set_nackcf(&mut self, val: bool) {
20189 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
20190 }
20191 #[doc = "Stop detection flag clear"]
20192 pub const fn stopcf(&self) -> bool {
20193 let val = (self.0 >> 5usize) & 0x01;
20194 val != 0
20195 }
20196 #[doc = "Stop detection flag clear"]
20197 pub fn set_stopcf(&mut self, val: bool) {
20198 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
20199 }
20200 #[doc = "Bus error flag clear"]
20201 pub const fn berrcf(&self) -> bool {
20202 let val = (self.0 >> 8usize) & 0x01;
20203 val != 0
20204 }
20205 #[doc = "Bus error flag clear"]
20206 pub fn set_berrcf(&mut self, val: bool) {
20207 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
20208 }
20209 #[doc = "Arbitration lost flag clear"]
20210 pub const fn arlocf(&self) -> bool {
20211 let val = (self.0 >> 9usize) & 0x01;
20212 val != 0
20213 }
20214 #[doc = "Arbitration lost flag clear"]
20215 pub fn set_arlocf(&mut self, val: bool) {
20216 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
20217 }
20218 #[doc = "Overrun/Underrun flag clear"]
20219 pub const fn ovrcf(&self) -> bool {
20220 let val = (self.0 >> 10usize) & 0x01;
20221 val != 0
20222 }
20223 #[doc = "Overrun/Underrun flag clear"]
20224 pub fn set_ovrcf(&mut self, val: bool) {
20225 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
20226 }
20227 #[doc = "PEC Error flag clear"]
20228 pub const fn peccf(&self) -> bool {
20229 let val = (self.0 >> 11usize) & 0x01;
20230 val != 0
20231 }
20232 #[doc = "PEC Error flag clear"]
20233 pub fn set_peccf(&mut self, val: bool) {
20234 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
20235 }
20236 #[doc = "Timeout detection flag clear"]
20237 pub const fn timoutcf(&self) -> bool {
20238 let val = (self.0 >> 12usize) & 0x01;
20239 val != 0
20240 }
20241 #[doc = "Timeout detection flag clear"]
20242 pub fn set_timoutcf(&mut self, val: bool) {
20243 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
20244 }
20245 #[doc = "Alert flag clear"]
20246 pub const fn alertcf(&self) -> bool {
20247 let val = (self.0 >> 13usize) & 0x01;
20248 val != 0
20249 }
20250 #[doc = "Alert flag clear"]
20251 pub fn set_alertcf(&mut self, val: bool) {
20252 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
20253 }
20254 }
20255 impl Default for Icr {
20256 fn default() -> Icr {
20257 Icr(0)
20258 }
20259 }
20260 #[doc = "Transmit data register"]
20261 #[repr(transparent)]
20262 #[derive(Copy, Clone, Eq, PartialEq)]
20263 pub struct Txdr(pub u32);
20264 impl Txdr {
20265 #[doc = "8-bit transmit data"]
20266 pub const fn txdata(&self) -> u8 {
20267 let val = (self.0 >> 0usize) & 0xff;
20268 val as u8
20269 }
20270 #[doc = "8-bit transmit data"]
20271 pub fn set_txdata(&mut self, val: u8) {
20272 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
20273 }
20274 }
20275 impl Default for Txdr {
20276 fn default() -> Txdr {
20277 Txdr(0)
20278 }
20279 }
20280 #[doc = "Own address register 1"]
20281 #[repr(transparent)]
20282 #[derive(Copy, Clone, Eq, PartialEq)]
20283 pub struct Oar1(pub u32);
20284 impl Oar1 {
20285 #[doc = "Interface address"]
20286 pub const fn oa1(&self) -> u16 {
20287 let val = (self.0 >> 0usize) & 0x03ff;
20288 val as u16
20289 }
20290 #[doc = "Interface address"]
20291 pub fn set_oa1(&mut self, val: u16) {
20292 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
20293 }
20294 #[doc = "Own Address 1 10-bit mode"]
20295 pub const fn oa1mode(&self) -> super::vals::Oamode {
20296 let val = (self.0 >> 10usize) & 0x01;
20297 super::vals::Oamode(val as u8)
20298 }
20299 #[doc = "Own Address 1 10-bit mode"]
20300 pub fn set_oa1mode(&mut self, val: super::vals::Oamode) {
20301 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
20302 }
20303 #[doc = "Own Address 1 enable"]
20304 pub const fn oa1en(&self) -> bool {
20305 let val = (self.0 >> 15usize) & 0x01;
20306 val != 0
20307 }
20308 #[doc = "Own Address 1 enable"]
20309 pub fn set_oa1en(&mut self, val: bool) {
20310 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20311 }
20312 }
20313 impl Default for Oar1 {
20314 fn default() -> Oar1 {
20315 Oar1(0)
20316 }
20317 }
20318 #[doc = "Interrupt and Status register"]
20319 #[repr(transparent)]
20320 #[derive(Copy, Clone, Eq, PartialEq)]
20321 pub struct Isr(pub u32);
20322 impl Isr {
20323 #[doc = "Transmit data register empty (transmitters)"]
20324 pub const fn txe(&self) -> bool {
20325 let val = (self.0 >> 0usize) & 0x01;
20326 val != 0
20327 }
20328 #[doc = "Transmit data register empty (transmitters)"]
20329 pub fn set_txe(&mut self, val: bool) {
20330 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
20331 }
20332 #[doc = "Transmit interrupt status (transmitters)"]
20333 pub const fn txis(&self) -> bool {
20334 let val = (self.0 >> 1usize) & 0x01;
20335 val != 0
20336 }
20337 #[doc = "Transmit interrupt status (transmitters)"]
20338 pub fn set_txis(&mut self, val: bool) {
20339 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
20340 }
20341 #[doc = "Receive data register not empty (receivers)"]
20342 pub const fn rxne(&self) -> bool {
20343 let val = (self.0 >> 2usize) & 0x01;
20344 val != 0
20345 }
20346 #[doc = "Receive data register not empty (receivers)"]
20347 pub fn set_rxne(&mut self, val: bool) {
20348 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
20349 }
20350 #[doc = "Address matched (slave mode)"]
20351 pub const fn addr(&self) -> bool {
20352 let val = (self.0 >> 3usize) & 0x01;
20353 val != 0
20354 }
20355 #[doc = "Address matched (slave mode)"]
20356 pub fn set_addr(&mut self, val: bool) {
20357 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
20358 }
20359 #[doc = "Not acknowledge received flag"]
20360 pub const fn nackf(&self) -> bool {
20361 let val = (self.0 >> 4usize) & 0x01;
20362 val != 0
20363 }
20364 #[doc = "Not acknowledge received flag"]
20365 pub fn set_nackf(&mut self, val: bool) {
20366 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
20367 }
20368 #[doc = "Stop detection flag"]
20369 pub const fn stopf(&self) -> bool {
20370 let val = (self.0 >> 5usize) & 0x01;
20371 val != 0
20372 }
20373 #[doc = "Stop detection flag"]
20374 pub fn set_stopf(&mut self, val: bool) {
20375 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
20376 }
20377 #[doc = "Transfer Complete (master mode)"]
20378 pub const fn tc(&self) -> bool {
20379 let val = (self.0 >> 6usize) & 0x01;
20380 val != 0
20381 }
20382 #[doc = "Transfer Complete (master mode)"]
20383 pub fn set_tc(&mut self, val: bool) {
20384 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
20385 }
20386 #[doc = "Transfer Complete Reload"]
20387 pub const fn tcr(&self) -> bool {
22979 let val = (self.0 >> 7usize) & 0x01; 20388 let val = (self.0 >> 7usize) & 0x01;
22980 val != 0 20389 val != 0
22981 } 20390 }
22982 #[doc = "Bank 1 CRC select bit"] 20391 #[doc = "Transfer Complete Reload"]
22983 pub fn set_all_bank(&mut self, val: bool) { 20392 pub fn set_tcr(&mut self, val: bool) {
22984 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 20393 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
22985 } 20394 }
22986 #[doc = "Bank 1 CRC sector mode select bit"] 20395 #[doc = "Bus error"]
22987 pub const fn crc_by_sect(&self) -> bool { 20396 pub const fn berr(&self) -> bool {
22988 let val = (self.0 >> 8usize) & 0x01; 20397 let val = (self.0 >> 8usize) & 0x01;
22989 val != 0 20398 val != 0
22990 } 20399 }
22991 #[doc = "Bank 1 CRC sector mode select bit"] 20400 #[doc = "Bus error"]
22992 pub fn set_crc_by_sect(&mut self, val: bool) { 20401 pub fn set_berr(&mut self, val: bool) {
22993 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 20402 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
22994 } 20403 }
22995 #[doc = "Bank 1 CRC sector select bit"] 20404 #[doc = "Arbitration lost"]
22996 pub const fn add_sect(&self) -> bool { 20405 pub const fn arlo(&self) -> bool {
22997 let val = (self.0 >> 9usize) & 0x01; 20406 let val = (self.0 >> 9usize) & 0x01;
22998 val != 0 20407 val != 0
22999 } 20408 }
23000 #[doc = "Bank 1 CRC sector select bit"] 20409 #[doc = "Arbitration lost"]
23001 pub fn set_add_sect(&mut self, val: bool) { 20410 pub fn set_arlo(&mut self, val: bool) {
23002 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 20411 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
23003 } 20412 }
23004 #[doc = "Bank 1 CRC sector list clear bit"] 20413 #[doc = "Overrun/Underrun (slave mode)"]
23005 pub const fn clean_sect(&self) -> bool { 20414 pub const fn ovr(&self) -> bool {
23006 let val = (self.0 >> 10usize) & 0x01; 20415 let val = (self.0 >> 10usize) & 0x01;
23007 val != 0 20416 val != 0
23008 } 20417 }
23009 #[doc = "Bank 1 CRC sector list clear bit"] 20418 #[doc = "Overrun/Underrun (slave mode)"]
23010 pub fn set_clean_sect(&mut self, val: bool) { 20419 pub fn set_ovr(&mut self, val: bool) {
23011 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 20420 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
23012 } 20421 }
23013 #[doc = "Bank 1 CRC start bit"] 20422 #[doc = "PEC Error in reception"]
23014 pub const fn start_crc(&self) -> bool { 20423 pub const fn pecerr(&self) -> super::vals::Pecerr {
23015 let val = (self.0 >> 16usize) & 0x01; 20424 let val = (self.0 >> 11usize) & 0x01;
20425 super::vals::Pecerr(val as u8)
20426 }
20427 #[doc = "PEC Error in reception"]
20428 pub fn set_pecerr(&mut self, val: super::vals::Pecerr) {
20429 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
20430 }
20431 #[doc = "Timeout or t_low detection flag"]
20432 pub const fn timeout(&self) -> bool {
20433 let val = (self.0 >> 12usize) & 0x01;
23016 val != 0 20434 val != 0
23017 } 20435 }
23018 #[doc = "Bank 1 CRC start bit"] 20436 #[doc = "Timeout or t_low detection flag"]
23019 pub fn set_start_crc(&mut self, val: bool) { 20437 pub fn set_timeout(&mut self, val: bool) {
23020 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 20438 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
23021 } 20439 }
23022 #[doc = "Bank 1 CRC clear bit"] 20440 #[doc = "SMBus alert"]
23023 pub const fn clean_crc(&self) -> bool { 20441 pub const fn alert(&self) -> bool {
23024 let val = (self.0 >> 17usize) & 0x01; 20442 let val = (self.0 >> 13usize) & 0x01;
23025 val != 0 20443 val != 0
23026 } 20444 }
23027 #[doc = "Bank 1 CRC clear bit"] 20445 #[doc = "SMBus alert"]
23028 pub fn set_clean_crc(&mut self, val: bool) { 20446 pub fn set_alert(&mut self, val: bool) {
23029 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 20447 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
23030 } 20448 }
23031 #[doc = "Bank 1 CRC burst size"] 20449 #[doc = "Bus busy"]
23032 pub const fn crc_burst(&self) -> u8 { 20450 pub const fn busy(&self) -> bool {
23033 let val = (self.0 >> 20usize) & 0x03; 20451 let val = (self.0 >> 15usize) & 0x01;
20452 val != 0
20453 }
20454 #[doc = "Bus busy"]
20455 pub fn set_busy(&mut self, val: bool) {
20456 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20457 }
20458 #[doc = "Transfer direction (Slave mode)"]
20459 pub const fn dir(&self) -> super::vals::Dir {
20460 let val = (self.0 >> 16usize) & 0x01;
20461 super::vals::Dir(val as u8)
20462 }
20463 #[doc = "Transfer direction (Slave mode)"]
20464 pub fn set_dir(&mut self, val: super::vals::Dir) {
20465 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
20466 }
20467 #[doc = "Address match code (Slave mode)"]
20468 pub const fn addcode(&self) -> u8 {
20469 let val = (self.0 >> 17usize) & 0x7f;
23034 val as u8 20470 val as u8
23035 } 20471 }
23036 #[doc = "Bank 1 CRC burst size"] 20472 #[doc = "Address match code (Slave mode)"]
23037 pub fn set_crc_burst(&mut self, val: u8) { 20473 pub fn set_addcode(&mut self, val: u8) {
23038 self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); 20474 self.0 = (self.0 & !(0x7f << 17usize)) | (((val as u32) & 0x7f) << 17usize);
23039 } 20475 }
23040 } 20476 }
23041 impl Default for Crccr { 20477 impl Default for Isr {
23042 fn default() -> Crccr { 20478 fn default() -> Isr {
23043 Crccr(0) 20479 Isr(0)
20480 }
20481 }
20482 #[doc = "Own address register 2"]
20483 #[repr(transparent)]
20484 #[derive(Copy, Clone, Eq, PartialEq)]
20485 pub struct Oar2(pub u32);
20486 impl Oar2 {
20487 #[doc = "Interface address"]
20488 pub const fn oa2(&self) -> u8 {
20489 let val = (self.0 >> 1usize) & 0x7f;
20490 val as u8
20491 }
20492 #[doc = "Interface address"]
20493 pub fn set_oa2(&mut self, val: u8) {
20494 self.0 = (self.0 & !(0x7f << 1usize)) | (((val as u32) & 0x7f) << 1usize);
20495 }
20496 #[doc = "Own Address 2 masks"]
20497 pub const fn oa2msk(&self) -> super::vals::Oamsk {
20498 let val = (self.0 >> 8usize) & 0x07;
20499 super::vals::Oamsk(val as u8)
20500 }
20501 #[doc = "Own Address 2 masks"]
20502 pub fn set_oa2msk(&mut self, val: super::vals::Oamsk) {
20503 self.0 = (self.0 & !(0x07 << 8usize)) | (((val.0 as u32) & 0x07) << 8usize);
20504 }
20505 #[doc = "Own Address 2 enable"]
20506 pub const fn oa2en(&self) -> bool {
20507 let val = (self.0 >> 15usize) & 0x01;
20508 val != 0
20509 }
20510 #[doc = "Own Address 2 enable"]
20511 pub fn set_oa2en(&mut self, val: bool) {
20512 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20513 }
20514 }
20515 impl Default for Oar2 {
20516 fn default() -> Oar2 {
20517 Oar2(0)
20518 }
20519 }
20520 #[doc = "Status register 1"]
20521 #[repr(transparent)]
20522 #[derive(Copy, Clone, Eq, PartialEq)]
20523 pub struct Timeoutr(pub u32);
20524 impl Timeoutr {
20525 #[doc = "Bus timeout A"]
20526 pub const fn timeouta(&self) -> u16 {
20527 let val = (self.0 >> 0usize) & 0x0fff;
20528 val as u16
20529 }
20530 #[doc = "Bus timeout A"]
20531 pub fn set_timeouta(&mut self, val: u16) {
20532 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
20533 }
20534 #[doc = "Idle clock timeout detection"]
20535 pub const fn tidle(&self) -> bool {
20536 let val = (self.0 >> 12usize) & 0x01;
20537 val != 0
20538 }
20539 #[doc = "Idle clock timeout detection"]
20540 pub fn set_tidle(&mut self, val: bool) {
20541 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
20542 }
20543 #[doc = "Clock timeout enable"]
20544 pub const fn timouten(&self) -> bool {
20545 let val = (self.0 >> 15usize) & 0x01;
20546 val != 0
20547 }
20548 #[doc = "Clock timeout enable"]
20549 pub fn set_timouten(&mut self, val: bool) {
20550 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
20551 }
20552 #[doc = "Bus timeout B"]
20553 pub const fn timeoutb(&self) -> u16 {
20554 let val = (self.0 >> 16usize) & 0x0fff;
20555 val as u16
20556 }
20557 #[doc = "Bus timeout B"]
20558 pub fn set_timeoutb(&mut self, val: u16) {
20559 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
20560 }
20561 #[doc = "Extended clock timeout enable"]
20562 pub const fn texten(&self) -> bool {
20563 let val = (self.0 >> 31usize) & 0x01;
20564 val != 0
20565 }
20566 #[doc = "Extended clock timeout enable"]
20567 pub fn set_texten(&mut self, val: bool) {
20568 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
20569 }
20570 }
20571 impl Default for Timeoutr {
20572 fn default() -> Timeoutr {
20573 Timeoutr(0)
23044 } 20574 }
23045 } 20575 }
23046 } 20576 }
20577 pub mod vals {
20578 use crate::generic::*;
20579 #[repr(transparent)]
20580 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20581 pub struct Headr(pub u8);
20582 impl Headr {
20583 #[doc = "The master sends the complete 10 bit slave address read sequence"]
20584 pub const COMPLETE: Self = Self(0);
20585 #[doc = "The master only sends the 1st 7 bits of the 10 bit address, followed by Read direction"]
20586 pub const PARTIAL: Self = Self(0x01);
20587 }
20588 #[repr(transparent)]
20589 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20590 pub struct Stop(pub u8);
20591 impl Stop {
20592 #[doc = "No Stop generation"]
20593 pub const NOSTOP: Self = Self(0);
20594 #[doc = "Stop generation after current byte transfer"]
20595 pub const STOP: Self = Self(0x01);
20596 }
20597 #[repr(transparent)]
20598 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20599 pub struct Autoend(pub u8);
20600 impl Autoend {
20601 #[doc = "Software end mode: TC flag is set when NBYTES data are transferred, stretching SCL low"]
20602 pub const SOFTWARE: Self = Self(0);
20603 #[doc = "Automatic end mode: a STOP condition is automatically sent when NBYTES data are transferred"]
20604 pub const AUTOMATIC: Self = Self(0x01);
20605 }
20606 #[repr(transparent)]
20607 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20608 pub struct Start(pub u8);
20609 impl Start {
20610 #[doc = "No Start generation"]
20611 pub const NOSTART: Self = Self(0);
20612 #[doc = "Restart/Start generation"]
20613 pub const START: Self = Self(0x01);
20614 }
20615 #[repr(transparent)]
20616 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20617 pub struct Nack(pub u8);
20618 impl Nack {
20619 #[doc = "an ACK is sent after current received byte"]
20620 pub const ACK: Self = Self(0);
20621 #[doc = "a NACK is sent after current received byte"]
20622 pub const NACK: Self = Self(0x01);
20623 }
20624 #[repr(transparent)]
20625 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20626 pub struct RdWrn(pub u8);
20627 impl RdWrn {
20628 #[doc = "Master requests a write transfer"]
20629 pub const WRITE: Self = Self(0);
20630 #[doc = "Master requests a read transfer"]
20631 pub const READ: Self = Self(0x01);
20632 }
20633 #[repr(transparent)]
20634 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20635 pub struct Pecerr(pub u8);
20636 impl Pecerr {
20637 #[doc = "Received PEC does match with PEC register"]
20638 pub const MATCH: Self = Self(0);
20639 #[doc = "Received PEC does not match with PEC register"]
20640 pub const NOMATCH: Self = Self(0x01);
20641 }
20642 #[repr(transparent)]
20643 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20644 pub struct Dnf(pub u8);
20645 impl Dnf {
20646 #[doc = "Digital filter disabled"]
20647 pub const NOFILTER: Self = Self(0);
20648 #[doc = "Digital filter enabled and filtering capability up to 1 tI2CCLK"]
20649 pub const FILTER1: Self = Self(0x01);
20650 #[doc = "Digital filter enabled and filtering capability up to 2 tI2CCLK"]
20651 pub const FILTER2: Self = Self(0x02);
20652 #[doc = "Digital filter enabled and filtering capability up to 3 tI2CCLK"]
20653 pub const FILTER3: Self = Self(0x03);
20654 #[doc = "Digital filter enabled and filtering capability up to 4 tI2CCLK"]
20655 pub const FILTER4: Self = Self(0x04);
20656 #[doc = "Digital filter enabled and filtering capability up to 5 tI2CCLK"]
20657 pub const FILTER5: Self = Self(0x05);
20658 #[doc = "Digital filter enabled and filtering capability up to 6 tI2CCLK"]
20659 pub const FILTER6: Self = Self(0x06);
20660 #[doc = "Digital filter enabled and filtering capability up to 7 tI2CCLK"]
20661 pub const FILTER7: Self = Self(0x07);
20662 #[doc = "Digital filter enabled and filtering capability up to 8 tI2CCLK"]
20663 pub const FILTER8: Self = Self(0x08);
20664 #[doc = "Digital filter enabled and filtering capability up to 9 tI2CCLK"]
20665 pub const FILTER9: Self = Self(0x09);
20666 #[doc = "Digital filter enabled and filtering capability up to 10 tI2CCLK"]
20667 pub const FILTER10: Self = Self(0x0a);
20668 #[doc = "Digital filter enabled and filtering capability up to 11 tI2CCLK"]
20669 pub const FILTER11: Self = Self(0x0b);
20670 #[doc = "Digital filter enabled and filtering capability up to 12 tI2CCLK"]
20671 pub const FILTER12: Self = Self(0x0c);
20672 #[doc = "Digital filter enabled and filtering capability up to 13 tI2CCLK"]
20673 pub const FILTER13: Self = Self(0x0d);
20674 #[doc = "Digital filter enabled and filtering capability up to 14 tI2CCLK"]
20675 pub const FILTER14: Self = Self(0x0e);
20676 #[doc = "Digital filter enabled and filtering capability up to 15 tI2CCLK"]
20677 pub const FILTER15: Self = Self(0x0f);
20678 }
20679 #[repr(transparent)]
20680 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20681 pub struct Dir(pub u8);
20682 impl Dir {
20683 #[doc = "Write transfer, slave enters receiver mode"]
20684 pub const WRITE: Self = Self(0);
20685 #[doc = "Read transfer, slave enters transmitter mode"]
20686 pub const READ: Self = Self(0x01);
20687 }
20688 #[repr(transparent)]
20689 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20690 pub struct Oamode(pub u8);
20691 impl Oamode {
20692 #[doc = "Own address 1 is a 7-bit address"]
20693 pub const BIT7: Self = Self(0);
20694 #[doc = "Own address 1 is a 10-bit address"]
20695 pub const BIT10: Self = Self(0x01);
20696 }
20697 #[repr(transparent)]
20698 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20699 pub struct Reload(pub u8);
20700 impl Reload {
20701 #[doc = "The transfer is completed after the NBYTES data transfer (STOP or RESTART will follow)"]
20702 pub const COMPLETED: Self = Self(0);
20703 #[doc = "The transfer is not completed after the NBYTES data transfer (NBYTES will be reloaded)"]
20704 pub const NOTCOMPLETED: Self = Self(0x01);
20705 }
20706 #[repr(transparent)]
20707 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20708 pub struct Add(pub u8);
20709 impl Add {
20710 #[doc = "The master operates in 7-bit addressing mode"]
20711 pub const BIT7: Self = Self(0);
20712 #[doc = "The master operates in 10-bit addressing mode"]
20713 pub const BIT10: Self = Self(0x01);
20714 }
20715 #[repr(transparent)]
20716 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20717 pub struct Oamsk(pub u8);
20718 impl Oamsk {
20719 #[doc = "No mask"]
20720 pub const NOMASK: Self = Self(0);
20721 #[doc = "OA2[1]
20722is masked and don’t care. Only OA2[7:2]
20723are compared"]
20724 pub const MASK1: Self = Self(0x01);
20725 #[doc = "OA2[2:1]
20726are masked and don’t care. Only OA2[7:3]
20727are compared"]
20728 pub const MASK2: Self = Self(0x02);
20729 #[doc = "OA2[3:1]
20730are masked and don’t care. Only OA2[7:4]
20731are compared"]
20732 pub const MASK3: Self = Self(0x03);
20733 #[doc = "OA2[4:1]
20734are masked and don’t care. Only OA2[7:5]
20735are compared"]
20736 pub const MASK4: Self = Self(0x04);
20737 #[doc = "OA2[5:1]
20738are masked and don’t care. Only OA2[7:6]
20739are compared"]
20740 pub const MASK5: Self = Self(0x05);
20741 #[doc = "OA2[6:1]
20742are masked and don’t care. Only OA2[7]
20743is compared."]
20744 pub const MASK6: Self = Self(0x06);
20745 #[doc = "OA2[7:1]
20746are masked and don’t care. No comparison is done, and all (except reserved) 7-bit received addresses are acknowledged"]
20747 pub const MASK7: Self = Self(0x07);
20748 }
20749 #[repr(transparent)]
20750 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
20751 pub struct Pecbyte(pub u8);
20752 impl Pecbyte {
20753 #[doc = "No PEC transfer"]
20754 pub const NOPEC: Self = Self(0);
20755 #[doc = "PEC transmission/reception is requested"]
20756 pub const PEC: Self = Self(0x01);
20757 }
20758 }
23047} 20759}
23048pub mod spi_v3 { 20760pub mod sdmmc_v2 {
23049 use crate::generic::*; 20761 use crate::generic::*;
23050 #[doc = "Serial peripheral interface"] 20762 #[doc = "SDMMC"]
23051 #[derive(Copy, Clone)] 20763 #[derive(Copy, Clone)]
23052 pub struct Spi(pub *mut u8); 20764 pub struct Sdmmc(pub *mut u8);
23053 unsafe impl Send for Spi {} 20765 unsafe impl Send for Sdmmc {}
23054 unsafe impl Sync for Spi {} 20766 unsafe impl Sync for Sdmmc {}
23055 impl Spi { 20767 impl Sdmmc {
23056 #[doc = "control register 1"] 20768 #[doc = "SDMMC power control register"]
23057 pub fn cr1(self) -> Reg<regs::Cr1, RW> { 20769 pub fn power(self) -> Reg<regs::Power, RW> {
23058 unsafe { Reg::from_ptr(self.0.add(0usize)) } 20770 unsafe { Reg::from_ptr(self.0.add(0usize)) }
23059 } 20771 }
23060 #[doc = "control register 2"] 20772 #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."]
23061 pub fn cr2(self) -> Reg<regs::Cr2, RW> { 20773 pub fn clkcr(self) -> Reg<regs::Clkcr, RW> {
23062 unsafe { Reg::from_ptr(self.0.add(4usize)) } 20774 unsafe { Reg::from_ptr(self.0.add(4usize)) }
23063 } 20775 }
23064 #[doc = "configuration register 1"] 20776 #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."]
23065 pub fn cfg1(self) -> Reg<regs::Cfg1, RW> { 20777 pub fn argr(self) -> Reg<regs::Argr, RW> {
23066 unsafe { Reg::from_ptr(self.0.add(8usize)) } 20778 unsafe { Reg::from_ptr(self.0.add(8usize)) }
23067 } 20779 }
23068 #[doc = "configuration register 2"] 20780 #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."]
23069 pub fn cfg2(self) -> Reg<regs::Cfg2, RW> { 20781 pub fn cmdr(self) -> Reg<regs::Cmdr, RW> {
23070 unsafe { Reg::from_ptr(self.0.add(12usize)) } 20782 unsafe { Reg::from_ptr(self.0.add(12usize)) }
23071 } 20783 }
23072 #[doc = "Interrupt Enable Register"] 20784 #[doc = "SDMMC command response register"]
23073 pub fn ier(self) -> Reg<regs::Ier, RW> { 20785 pub fn respcmdr(self) -> Reg<regs::Respcmdr, R> {
23074 unsafe { Reg::from_ptr(self.0.add(16usize)) } 20786 unsafe { Reg::from_ptr(self.0.add(16usize)) }
23075 } 20787 }
23076 #[doc = "Status Register"] 20788 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
23077 pub fn sr(self) -> Reg<regs::Sr, R> { 20789 pub fn respr(self, n: usize) -> Reg<regs::Resp1r, R> {
23078 unsafe { Reg::from_ptr(self.0.add(20usize)) } 20790 assert!(n < 4usize);
20791 unsafe { Reg::from_ptr(self.0.add(20usize + n * 4usize)) }
23079 } 20792 }
23080 #[doc = "Interrupt/Status Flags Clear Register"] 20793 #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."]
23081 pub fn ifcr(self) -> Reg<regs::Ifcr, W> { 20794 pub fn dtimer(self) -> Reg<regs::Dtimer, RW> {
23082 unsafe { Reg::from_ptr(self.0.add(24usize)) } 20795 unsafe { Reg::from_ptr(self.0.add(36usize)) }
23083 } 20796 }
23084 #[doc = "Transmit Data Register"] 20797 #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."]
23085 pub fn txdr(self) -> Reg<regs::Txdr, W> { 20798 pub fn dlenr(self) -> Reg<regs::Dlenr, RW> {
23086 unsafe { Reg::from_ptr(self.0.add(32usize)) } 20799 unsafe { Reg::from_ptr(self.0.add(40usize)) }
23087 } 20800 }
23088 #[doc = "Receive Data Register"] 20801 #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."]
23089 pub fn rxdr(self) -> Reg<regs::Rxdr, R> { 20802 pub fn dctrl(self) -> Reg<regs::Dctrl, RW> {
20803 unsafe { Reg::from_ptr(self.0.add(44usize)) }
20804 }
20805 #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."]
20806 pub fn dcntr(self) -> Reg<regs::Dcntr, R> {
23090 unsafe { Reg::from_ptr(self.0.add(48usize)) } 20807 unsafe { Reg::from_ptr(self.0.add(48usize)) }
23091 } 20808 }
23092 #[doc = "Polynomial Register"] 20809 #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"]
23093 pub fn crcpoly(self) -> Reg<regs::Crcpoly, RW> { 20810 pub fn star(self) -> Reg<regs::Star, R> {
20811 unsafe { Reg::from_ptr(self.0.add(52usize)) }
20812 }
20813 #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."]
20814 pub fn icr(self) -> Reg<regs::Icr, RW> {
20815 unsafe { Reg::from_ptr(self.0.add(56usize)) }
20816 }
20817 #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."]
20818 pub fn maskr(self) -> Reg<regs::Maskr, RW> {
20819 unsafe { Reg::from_ptr(self.0.add(60usize)) }
20820 }
20821 #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."]
20822 pub fn acktimer(self) -> Reg<regs::Acktimer, RW> {
23094 unsafe { Reg::from_ptr(self.0.add(64usize)) } 20823 unsafe { Reg::from_ptr(self.0.add(64usize)) }
23095 } 20824 }
23096 #[doc = "Transmitter CRC Register"] 20825 #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."]
23097 pub fn txcrc(self) -> Reg<regs::Txcrc, RW> { 20826 pub fn idmactrlr(self) -> Reg<regs::Idmactrlr, RW> {
23098 unsafe { Reg::from_ptr(self.0.add(68usize)) } 20827 unsafe { Reg::from_ptr(self.0.add(80usize)) }
23099 } 20828 }
23100 #[doc = "Receiver CRC Register"] 20829 #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."]
23101 pub fn rxcrc(self) -> Reg<regs::Rxcrc, RW> { 20830 pub fn idmabsizer(self) -> Reg<regs::Idmabsizer, RW> {
23102 unsafe { Reg::from_ptr(self.0.add(72usize)) } 20831 unsafe { Reg::from_ptr(self.0.add(84usize)) }
23103 } 20832 }
23104 #[doc = "Underrun Data Register"] 20833 #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."]
23105 pub fn udrdr(self) -> Reg<regs::Udrdr, RW> { 20834 pub fn idmabase0r(self) -> Reg<regs::Idmabase0r, RW> {
23106 unsafe { Reg::from_ptr(self.0.add(76usize)) } 20835 unsafe { Reg::from_ptr(self.0.add(88usize)) }
20836 }
20837 #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."]
20838 pub fn idmabase1r(self) -> Reg<regs::Idmabase1r, RW> {
20839 unsafe { Reg::from_ptr(self.0.add(92usize)) }
20840 }
20841 #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."]
20842 pub fn fifor(self) -> Reg<regs::Fifor, RW> {
20843 unsafe { Reg::from_ptr(self.0.add(128usize)) }
20844 }
20845 #[doc = "SDMMC IP version register"]
20846 pub fn ver(self) -> Reg<regs::Ver, R> {
20847 unsafe { Reg::from_ptr(self.0.add(1012usize)) }
20848 }
20849 #[doc = "SDMMC IP identification register"]
20850 pub fn id(self) -> Reg<regs::Id, R> {
20851 unsafe { Reg::from_ptr(self.0.add(1016usize)) }
23107 } 20852 }
23108 } 20853 }
23109 pub mod regs { 20854 pub mod regs {
23110 use crate::generic::*; 20855 use crate::generic::*;
23111 #[doc = "Underrun Data Register"] 20856 #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."]
23112 #[repr(transparent)] 20857 #[repr(transparent)]
23113 #[derive(Copy, Clone, Eq, PartialEq)] 20858 #[derive(Copy, Clone, Eq, PartialEq)]
23114 pub struct Udrdr(pub u32); 20859 pub struct Clkcr(pub u32);
23115 impl Udrdr { 20860 impl Clkcr {
23116 #[doc = "Data at slave underrun condition"] 20861 #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."]
23117 pub const fn udrdr(&self) -> u32 { 20862 pub const fn clkdiv(&self) -> u16 {
20863 let val = (self.0 >> 0usize) & 0x03ff;
20864 val as u16
20865 }
20866 #[doc = "Clock divide factor This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). This field defines the divide factor between the input clock (SDMMCCLK) and the output clock (SDMMC_CK): SDMMC_CK frequency = SDMMCCLK / [2 * CLKDIV]. 0xx: etc.. xxx: etc.."]
20867 pub fn set_clkdiv(&mut self, val: u16) {
20868 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
20869 }
20870 #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"]
20871 pub const fn pwrsav(&self) -> bool {
20872 let val = (self.0 >> 12usize) & 0x01;
20873 val != 0
20874 }
20875 #[doc = "Power saving configuration bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) For power saving, the SDMMC_CK clock output can be disabled when the bus is idle by setting PWRSAV:"]
20876 pub fn set_pwrsav(&mut self, val: bool) {
20877 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
20878 }
20879 #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
20880 pub const fn widbus(&self) -> u8 {
20881 let val = (self.0 >> 14usize) & 0x03;
20882 val as u8
20883 }
20884 #[doc = "Wide bus mode enable bit This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
20885 pub fn set_widbus(&mut self, val: u8) {
20886 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize);
20887 }
20888 #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division &gt;1 (CLKDIV &gt; 0) &amp; DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."]
20889 pub const fn negedge(&self) -> bool {
20890 let val = (self.0 >> 16usize) & 0x01;
20891 val != 0
20892 }
20893 #[doc = "SDMMC_CK dephasing selection bit for data and Command. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). When clock division = 1 (CLKDIV = 0), this bit has no effect. Data and Command change on SDMMC_CK falling edge. When clock division &gt;1 (CLKDIV &gt; 0) &amp; DDR = 0: - SDMMC_CK edge occurs on SDMMCCLK rising edge. When clock division >1 (CLKDIV > 0) & DDR = 1: - Data changed on the SDMMCCLK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge. - Data changed on the SDMMC_CK falling edge succeeding a SDMMC_CK edge. - SDMMC_CK edge occurs on SDMMCCLK rising edge."]
20894 pub fn set_negedge(&mut self, val: bool) {
20895 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
20896 }
20897 #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."]
20898 pub const fn hwfc_en(&self) -> bool {
20899 let val = (self.0 >> 17usize) & 0x01;
20900 val != 0
20901 }
20902 #[doc = "Hardware flow control enable This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) When Hardware flow control is enabled, the meaning of the TXFIFOE and RXFIFOF flags change, please see SDMMC status register definition in Section56.8.11."]
20903 pub fn set_hwfc_en(&mut self, val: bool) {
20904 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
20905 }
20906 #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS &gt; 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division &gt;1. (CLKDIV &gt; 0)"]
20907 pub const fn ddr(&self) -> bool {
20908 let val = (self.0 >> 18usize) & 0x01;
20909 val != 0
20910 }
20911 #[doc = "Data rate signaling selection This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0) DDR rate shall only be selected with 4-bit or 8-bit wide bus mode. (WIDBUS &gt; 00). DDR = 1 has no effect when WIDBUS = 00 (1-bit wide bus). DDR rate shall only be selected with clock division &gt;1. (CLKDIV &gt; 0)"]
20912 pub fn set_ddr(&mut self, val: bool) {
20913 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
20914 }
20915 #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
20916 pub const fn busspeed(&self) -> bool {
20917 let val = (self.0 >> 19usize) & 0x01;
20918 val != 0
20919 }
20920 #[doc = "Bus speed mode selection between DS, HS, SDR12, SDR25 and SDR50, DDR50, SDR104. This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
20921 pub fn set_busspeed(&mut self, val: bool) {
20922 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
20923 }
20924 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
20925 pub const fn selclkrx(&self) -> u8 {
20926 let val = (self.0 >> 20usize) & 0x03;
20927 val as u8
20928 }
20929 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
20930 pub fn set_selclkrx(&mut self, val: u8) {
20931 self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize);
20932 }
20933 }
20934 impl Default for Clkcr {
20935 fn default() -> Clkcr {
20936 Clkcr(0)
20937 }
20938 }
20939 #[doc = "The SDMMC_DTIMER register contains the data timeout period, in card bus clock periods. A counter loads the value from the SDMMC_DTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_R or Busy state. If the timer reaches 0 while the DPSM is in either of these states, the timeout status flag is set."]
20940 #[repr(transparent)]
20941 #[derive(Copy, Clone, Eq, PartialEq)]
20942 pub struct Dtimer(pub u32);
20943 impl Dtimer {
20944 #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."]
20945 pub const fn datatime(&self) -> u32 {
23118 let val = (self.0 >> 0usize) & 0xffff_ffff; 20946 let val = (self.0 >> 0usize) & 0xffff_ffff;
23119 val as u32 20947 val as u32
23120 } 20948 }
23121 #[doc = "Data at slave underrun condition"] 20949 #[doc = "Data and R1b busy timeout period This bit can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0). Data and R1b busy timeout period expressed in card bus clock periods."]
23122 pub fn set_udrdr(&mut self, val: u32) { 20950 pub fn set_datatime(&mut self, val: u32) {
23123 self.0 = 20951 self.0 =
23124 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 20952 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
23125 } 20953 }
23126 } 20954 }
23127 impl Default for Udrdr { 20955 impl Default for Dtimer {
23128 fn default() -> Udrdr { 20956 fn default() -> Dtimer {
23129 Udrdr(0) 20957 Dtimer(0)
23130 } 20958 }
23131 } 20959 }
23132 #[doc = "Receive Data Register"] 20960 #[doc = "SDMMC power control register"]
23133 #[repr(transparent)] 20961 #[repr(transparent)]
23134 #[derive(Copy, Clone, Eq, PartialEq)] 20962 #[derive(Copy, Clone, Eq, PartialEq)]
23135 pub struct Rxdr(pub u32); 20963 pub struct Power(pub u32);
23136 impl Rxdr { 20964 impl Power {
23137 #[doc = "Receive data register"] 20965 #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."]
23138 pub const fn rxdr(&self) -> u32 { 20966 pub const fn pwrctrl(&self) -> u8 {
20967 let val = (self.0 >> 0usize) & 0x03;
20968 val as u8
20969 }
20970 #[doc = "SDMMC state control bits. These bits can only be written when the SDMMC is not in the power-on state (PWRCTRL?11). These bits are used to define the functional state of the SDMMC signals: Any further write will be ignored, PWRCTRL value will keep 11."]
20971 pub fn set_pwrctrl(&mut self, val: u8) {
20972 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
20973 }
20974 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
20975 pub const fn vswitch(&self) -> bool {
20976 let val = (self.0 >> 2usize) & 0x01;
20977 val != 0
20978 }
20979 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
20980 pub fn set_vswitch(&mut self, val: bool) {
20981 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
20982 }
20983 #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"]
20984 pub const fn vswitchen(&self) -> bool {
20985 let val = (self.0 >> 3usize) & 0x01;
20986 val != 0
20987 }
20988 #[doc = "Voltage switch procedure enable. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). This bit is used to stop the SDMMC_CK after the voltage switch command response:"]
20989 pub fn set_vswitchen(&mut self, val: bool) {
20990 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
20991 }
20992 #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."]
20993 pub const fn dirpol(&self) -> bool {
20994 let val = (self.0 >> 4usize) & 0x01;
20995 val != 0
20996 }
20997 #[doc = "Data and command direction signals polarity selection. This bit can only be written when the SDMMC is in the power-off state (PWRCTRL = 00)."]
20998 pub fn set_dirpol(&mut self, val: bool) {
20999 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
21000 }
21001 }
21002 impl Default for Power {
21003 fn default() -> Power {
21004 Power(0)
21005 }
21006 }
21007 #[doc = "SDMMC IP version register"]
21008 #[repr(transparent)]
21009 #[derive(Copy, Clone, Eq, PartialEq)]
21010 pub struct Ver(pub u32);
21011 impl Ver {
21012 #[doc = "IP minor revision number."]
21013 pub const fn minrev(&self) -> u8 {
21014 let val = (self.0 >> 0usize) & 0x0f;
21015 val as u8
21016 }
21017 #[doc = "IP minor revision number."]
21018 pub fn set_minrev(&mut self, val: u8) {
21019 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
21020 }
21021 #[doc = "IP major revision number."]
21022 pub const fn majrev(&self) -> u8 {
21023 let val = (self.0 >> 4usize) & 0x0f;
21024 val as u8
21025 }
21026 #[doc = "IP major revision number."]
21027 pub fn set_majrev(&mut self, val: u8) {
21028 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
21029 }
21030 }
21031 impl Default for Ver {
21032 fn default() -> Ver {
21033 Ver(0)
21034 }
21035 }
21036 #[doc = "The SDMMC_CMDR register contains the command index and command type bits. The command index is sent to a card as part of a command message. The command type bits control the command path state machine (CPSM)."]
21037 #[repr(transparent)]
21038 #[derive(Copy, Clone, Eq, PartialEq)]
21039 pub struct Cmdr(pub u32);
21040 impl Cmdr {
21041 #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."]
21042 pub const fn cmdindex(&self) -> u8 {
21043 let val = (self.0 >> 0usize) & 0x3f;
21044 val as u8
21045 }
21046 #[doc = "Command index. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). The command index is sent to the card as part of a command message."]
21047 pub fn set_cmdindex(&mut self, val: u8) {
21048 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
21049 }
21050 #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."]
21051 pub const fn cmdtrans(&self) -> bool {
21052 let val = (self.0 >> 6usize) & 0x01;
21053 val != 0
21054 }
21055 #[doc = "The CPSM treats the command as a data transfer command, stops the interrupt period, and signals DataEnable to the DPSM This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues an end of interrupt period and issues DataEnable signal to the DPSM when the command is sent."]
21056 pub fn set_cmdtrans(&mut self, val: bool) {
21057 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
21058 }
21059 #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."]
21060 pub const fn cmdstop(&self) -> bool {
21061 let val = (self.0 >> 7usize) & 0x01;
21062 val != 0
21063 }
21064 #[doc = "The CPSM treats the command as a Stop Transmission command and signals Abort to the DPSM. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). If this bit is set, the CPSM issues the Abort signal to the DPSM when the command is sent."]
21065 pub fn set_cmdstop(&mut self, val: bool) {
21066 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
21067 }
21068 #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."]
21069 pub const fn waitresp(&self) -> u8 {
21070 let val = (self.0 >> 8usize) & 0x03;
21071 val as u8
21072 }
21073 #[doc = "Wait for response bits. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). They are used to configure whether the CPSM is to wait for a response, and if yes, which kind of response."]
21074 pub fn set_waitresp(&mut self, val: u8) {
21075 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
21076 }
21077 #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."]
21078 pub const fn waitint(&self) -> bool {
21079 let val = (self.0 >> 10usize) & 0x01;
21080 val != 0
21081 }
21082 #[doc = "CPSM waits for interrupt request. If this bit is set, the CPSM disables command timeout and waits for an card interrupt request (Response). If this bit is cleared in the CPSM Wait state, will cause the abort of the interrupt mode."]
21083 pub fn set_waitint(&mut self, val: bool) {
21084 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
21085 }
21086 #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."]
21087 pub const fn waitpend(&self) -> bool {
21088 let val = (self.0 >> 11usize) & 0x01;
21089 val != 0
21090 }
21091 #[doc = "CPSM Waits for end of data transfer (CmdPend internal signal) from DPSM. This bit when set, the CPSM waits for the end of data transfer trigger before it starts sending a command. WAITPEND is only taken into account when DTMODE = MMC stream data transfer, WIDBUS = 1-bit wide bus mode, DPSMACT = 1 and DTDIR = from host to card."]
21092 pub fn set_waitpend(&mut self, val: bool) {
21093 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
21094 }
21095 #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."]
21096 pub const fn cpsmen(&self) -> bool {
21097 let val = (self.0 >> 12usize) & 0x01;
21098 val != 0
21099 }
21100 #[doc = "Command path state machine (CPSM) Enable bit This bit is written 1 by firmware, and cleared by hardware when the CPSM enters the Idle state. If this bit is set, the CPSM is enabled. When DTEN = 1, no command will be transfered nor boot procedure will be started. CPSMEN is cleared to 0."]
21101 pub fn set_cpsmen(&mut self, val: bool) {
21102 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
21103 }
21104 #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."]
21105 pub const fn dthold(&self) -> bool {
21106 let val = (self.0 >> 13usize) & 0x01;
21107 val != 0
21108 }
21109 #[doc = "Hold new data block transmission and reception in the DPSM. If this bit is set, the DPSM will not move from the Wait_S state to the Send state or from the Wait_R state to the Receive state."]
21110 pub fn set_dthold(&mut self, val: bool) {
21111 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
21112 }
21113 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
21114 pub const fn bootmode(&self) -> bool {
21115 let val = (self.0 >> 14usize) & 0x01;
21116 val != 0
21117 }
21118 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
21119 pub fn set_bootmode(&mut self, val: bool) {
21120 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
21121 }
21122 #[doc = "Enable boot mode procedure."]
21123 pub const fn booten(&self) -> bool {
21124 let val = (self.0 >> 15usize) & 0x01;
21125 val != 0
21126 }
21127 #[doc = "Enable boot mode procedure."]
21128 pub fn set_booten(&mut self, val: bool) {
21129 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
21130 }
21131 #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."]
21132 pub const fn cmdsuspend(&self) -> bool {
21133 let val = (self.0 >> 16usize) & 0x01;
21134 val != 0
21135 }
21136 #[doc = "The CPSM treats the command as a Suspend or Resume command and signals interrupt period start/end. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). CMDSUSPEND = 1 and CMDTRANS = 0 Suspend command, start interrupt period when response bit BS=0. CMDSUSPEND = 1 and CMDTRANS = 1 Resume command with data, end interrupt period when response bit DF=1."]
21137 pub fn set_cmdsuspend(&mut self, val: bool) {
21138 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
21139 }
21140 }
21141 impl Default for Cmdr {
21142 fn default() -> Cmdr {
21143 Cmdr(0)
21144 }
21145 }
21146 #[doc = "The SDMMC_ACKTIMER register contains the acknowledgment timeout period, in SDMMC_CK bus clock periods. A counter loads the value from the SDMMC_ACKTIMER register, and starts decrementing when the data path state machine (DPSM) enters the Wait_Ack state. If the timer reaches 0 while the DPSM is in this states, the acknowledgment timeout status flag is set."]
21147 #[repr(transparent)]
21148 #[derive(Copy, Clone, Eq, PartialEq)]
21149 pub struct Acktimer(pub u32);
21150 impl Acktimer {
21151 #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."]
21152 pub const fn acktime(&self) -> u32 {
21153 let val = (self.0 >> 0usize) & 0x01ff_ffff;
21154 val as u32
21155 }
21156 #[doc = "Boot acknowledgment timeout period This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0). Boot acknowledgment timeout period expressed in card bus clock periods."]
21157 pub fn set_acktime(&mut self, val: u32) {
21158 self.0 =
21159 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
21160 }
21161 }
21162 impl Default for Acktimer {
21163 fn default() -> Acktimer {
21164 Acktimer(0)
21165 }
21166 }
21167 #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."]
21168 #[repr(transparent)]
21169 #[derive(Copy, Clone, Eq, PartialEq)]
21170 pub struct Idmabase1r(pub u32);
21171 impl Idmabase1r {
21172 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0]
21173are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."]
21174 pub const fn idmabase1(&self) -> u32 {
23139 let val = (self.0 >> 0usize) & 0xffff_ffff; 21175 let val = (self.0 >> 0usize) & 0xffff_ffff;
23140 val as u32 21176 val as u32
23141 } 21177 }
23142 #[doc = "Receive data register"] 21178 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0]
23143 pub fn set_rxdr(&mut self, val: u32) { 21179are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 1 is inactive (IDMABACT = 0)."]
21180 pub fn set_idmabase1(&mut self, val: u32) {
23144 self.0 = 21181 self.0 =
23145 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 21182 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
23146 } 21183 }
23147 } 21184 }
23148 impl Default for Rxdr { 21185 impl Default for Idmabase1r {
23149 fn default() -> Rxdr { 21186 fn default() -> Idmabase1r {
23150 Rxdr(0) 21187 Idmabase1r(0)
23151 } 21188 }
23152 } 21189 }
23153 #[doc = "Interrupt/Status Flags Clear Register"] 21190 #[doc = "The SDMMC_DCNTR register loads the value from the data length register (see SDMMC_DLENR) when the DPSM moves from the Idle state to the Wait_R or Wait_S state. As data is transferred, the counter decrements the value until it reaches 0. The DPSM then moves to the Idle state and when there has been no error, the data status end flag (DATAEND) is set."]
23154 #[repr(transparent)] 21191 #[repr(transparent)]
23155 #[derive(Copy, Clone, Eq, PartialEq)] 21192 #[derive(Copy, Clone, Eq, PartialEq)]
23156 pub struct Ifcr(pub u32); 21193 pub struct Dcntr(pub u32);
23157 impl Ifcr { 21194 impl Dcntr {
23158 #[doc = "End Of Transfer flag clear"] 21195 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
23159 pub const fn eotc(&self) -> bool { 21196 pub const fn datacount(&self) -> u32 {
21197 let val = (self.0 >> 0usize) & 0x01ff_ffff;
21198 val as u32
21199 }
21200 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
21201 pub fn set_datacount(&mut self, val: u32) {
21202 self.0 =
21203 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
21204 }
21205 }
21206 impl Default for Dcntr {
21207 fn default() -> Dcntr {
21208 Dcntr(0)
21209 }
21210 }
21211 #[doc = "SDMMC IP identification register"]
21212 #[repr(transparent)]
21213 #[derive(Copy, Clone, Eq, PartialEq)]
21214 pub struct Id(pub u32);
21215 impl Id {
21216 #[doc = "SDMMC IP identification."]
21217 pub const fn ip_id(&self) -> u32 {
21218 let val = (self.0 >> 0usize) & 0xffff_ffff;
21219 val as u32
21220 }
21221 #[doc = "SDMMC IP identification."]
21222 pub fn set_ip_id(&mut self, val: u32) {
21223 self.0 =
21224 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21225 }
21226 }
21227 impl Default for Id {
21228 fn default() -> Id {
21229 Id(0)
21230 }
21231 }
21232 #[doc = "The receive and transmit FIFOs can be only read or written as word (32-bit) wide registers. The FIFOs contain 16 entries on sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO.When accessing SDMMC_FIFOR with half word or byte access an AHB bus fault is generated."]
21233 #[repr(transparent)]
21234 #[derive(Copy, Clone, Eq, PartialEq)]
21235 pub struct Fifor(pub u32);
21236 impl Fifor {
21237 #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."]
21238 pub const fn fifodata(&self) -> u32 {
21239 let val = (self.0 >> 0usize) & 0xffff_ffff;
21240 val as u32
21241 }
21242 #[doc = "Receive and transmit FIFO data This register can only be read or written by firmware when the DPSM is active (DPSMACT=1). The FIFO data occupies 16 entries of 32-bit words."]
21243 pub fn set_fifodata(&mut self, val: u32) {
21244 self.0 =
21245 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21246 }
21247 }
21248 impl Default for Fifor {
21249 fn default() -> Fifor {
21250 Fifor(0)
21251 }
21252 }
21253 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
21254 #[repr(transparent)]
21255 #[derive(Copy, Clone, Eq, PartialEq)]
21256 pub struct Resp2r(pub u32);
21257 impl Resp2r {
21258 #[doc = "see Table404."]
21259 pub const fn cardstatus2(&self) -> u32 {
21260 let val = (self.0 >> 0usize) & 0xffff_ffff;
21261 val as u32
21262 }
21263 #[doc = "see Table404."]
21264 pub fn set_cardstatus2(&mut self, val: u32) {
21265 self.0 =
21266 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21267 }
21268 }
21269 impl Default for Resp2r {
21270 fn default() -> Resp2r {
21271 Resp2r(0)
21272 }
21273 }
21274 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
21275 #[repr(transparent)]
21276 #[derive(Copy, Clone, Eq, PartialEq)]
21277 pub struct Resp3r(pub u32);
21278 impl Resp3r {
21279 #[doc = "see Table404."]
21280 pub const fn cardstatus3(&self) -> u32 {
21281 let val = (self.0 >> 0usize) & 0xffff_ffff;
21282 val as u32
21283 }
21284 #[doc = "see Table404."]
21285 pub fn set_cardstatus3(&mut self, val: u32) {
21286 self.0 =
21287 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21288 }
21289 }
21290 impl Default for Resp3r {
21291 fn default() -> Resp3r {
21292 Resp3r(0)
21293 }
21294 }
21295 #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."]
21296 #[repr(transparent)]
21297 #[derive(Copy, Clone, Eq, PartialEq)]
21298 pub struct Argr(pub u32);
21299 impl Argr {
21300 #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."]
21301 pub const fn cmdarg(&self) -> u32 {
21302 let val = (self.0 >> 0usize) & 0xffff_ffff;
21303 val as u32
21304 }
21305 #[doc = "Command argument. These bits can only be written by firmware when CPSM is disabled (CPSMEN = 0). Command argument sent to a card as part of a command message. If a command contains an argument, it must be loaded into this register before writing a command to the command register."]
21306 pub fn set_cmdarg(&mut self, val: u32) {
21307 self.0 =
21308 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21309 }
21310 }
21311 impl Default for Argr {
21312 fn default() -> Argr {
21313 Argr(0)
21314 }
21315 }
21316 #[doc = "The SDMMC_DLENR register contains the number of data bytes to be transferred. The value is loaded into the data counter when data transfer starts."]
21317 #[repr(transparent)]
21318 #[derive(Copy, Clone, Eq, PartialEq)]
21319 pub struct Dlenr(pub u32);
21320 impl Dlenr {
21321 #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."]
21322 pub const fn datalength(&self) -> u32 {
21323 let val = (self.0 >> 0usize) & 0x01ff_ffff;
21324 val as u32
21325 }
21326 #[doc = "Data length value This register can only be written by firmware when DPSM is inactive (DPSMACT = 0). Number of data bytes to be transferred. When DDR = 1 DATALENGTH is truncated to a multiple of 2. (The last odd byte is not transfered) When DATALENGTH = 0 no data will be transfered, when requested by a CPSMEN and CMDTRANS = 1 also no command will be transfered. DTEN and CPSMEN are cleared to 0."]
21327 pub fn set_datalength(&mut self, val: u32) {
21328 self.0 =
21329 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
21330 }
21331 }
21332 impl Default for Dlenr {
21333 fn default() -> Dlenr {
21334 Dlenr(0)
21335 }
21336 }
21337 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
21338 #[repr(transparent)]
21339 #[derive(Copy, Clone, Eq, PartialEq)]
21340 pub struct Resp4r(pub u32);
21341 impl Resp4r {
21342 #[doc = "see Table404."]
21343 pub const fn cardstatus4(&self) -> u32 {
21344 let val = (self.0 >> 0usize) & 0xffff_ffff;
21345 val as u32
21346 }
21347 #[doc = "see Table404."]
21348 pub fn set_cardstatus4(&mut self, val: u32) {
21349 self.0 =
21350 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21351 }
21352 }
21353 impl Default for Resp4r {
21354 fn default() -> Resp4r {
21355 Resp4r(0)
21356 }
21357 }
21358 #[doc = "The SDMMC_STAR register is a read-only register. It contains two types of flag:Static flags (bits [29,21,11:0]): these bits remain asserted until they are cleared by writing to the SDMMC interrupt Clear register (see SDMMC_ICR)Dynamic flags (bits [20:12]): these bits change state depending on the state of the underlying logic (for example, FIFO full and empty flags are asserted and de-asserted as data while written to the FIFO)"]
21359 #[repr(transparent)]
21360 #[derive(Copy, Clone, Eq, PartialEq)]
21361 pub struct Star(pub u32);
21362 impl Star {
21363 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21364 pub const fn ccrcfail(&self) -> bool {
21365 let val = (self.0 >> 0usize) & 0x01;
21366 val != 0
21367 }
21368 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21369 pub fn set_ccrcfail(&mut self, val: bool) {
21370 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
21371 }
21372 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21373 pub const fn dcrcfail(&self) -> bool {
21374 let val = (self.0 >> 1usize) & 0x01;
21375 val != 0
21376 }
21377 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21378 pub fn set_dcrcfail(&mut self, val: bool) {
21379 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
21380 }
21381 #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."]
21382 pub const fn ctimeout(&self) -> bool {
21383 let val = (self.0 >> 2usize) & 0x01;
21384 val != 0
21385 }
21386 #[doc = "Command response timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR. The Command Timeout period has a fixed value of 64 SDMMC_CK clock periods."]
21387 pub fn set_ctimeout(&mut self, val: bool) {
21388 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
21389 }
21390 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21391 pub const fn dtimeout(&self) -> bool {
23160 let val = (self.0 >> 3usize) & 0x01; 21392 let val = (self.0 >> 3usize) & 0x01;
23161 val != 0 21393 val != 0
23162 } 21394 }
23163 #[doc = "End Of Transfer flag clear"] 21395 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23164 pub fn set_eotc(&mut self, val: bool) { 21396 pub fn set_dtimeout(&mut self, val: bool) {
23165 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 21397 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
23166 } 21398 }
23167 #[doc = "Transmission Transfer Filled flag clear"] 21399 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23168 pub const fn txtfc(&self) -> bool { 21400 pub const fn txunderr(&self) -> bool {
23169 let val = (self.0 >> 4usize) & 0x01; 21401 let val = (self.0 >> 4usize) & 0x01;
23170 val != 0 21402 val != 0
23171 } 21403 }
23172 #[doc = "Transmission Transfer Filled flag clear"] 21404 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23173 pub fn set_txtfc(&mut self, val: bool) { 21405 pub fn set_txunderr(&mut self, val: bool) {
23174 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 21406 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
23175 } 21407 }
23176 #[doc = "Underrun flag clear"] 21408 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23177 pub const fn udrc(&self) -> bool { 21409 pub const fn rxoverr(&self) -> bool {
23178 let val = (self.0 >> 5usize) & 0x01; 21410 let val = (self.0 >> 5usize) & 0x01;
23179 val != 0 21411 val != 0
23180 } 21412 }
23181 #[doc = "Underrun flag clear"] 21413 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23182 pub fn set_udrc(&mut self, val: bool) { 21414 pub fn set_rxoverr(&mut self, val: bool) {
23183 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 21415 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
23184 } 21416 }
23185 #[doc = "Overrun flag clear"] 21417 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23186 pub const fn ovrc(&self) -> bool { 21418 pub const fn cmdrend(&self) -> bool {
23187 let val = (self.0 >> 6usize) & 0x01; 21419 let val = (self.0 >> 6usize) & 0x01;
23188 val != 0 21420 val != 0
23189 } 21421 }
23190 #[doc = "Overrun flag clear"] 21422 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23191 pub fn set_ovrc(&mut self, val: bool) { 21423 pub fn set_cmdrend(&mut self, val: bool) {
23192 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 21424 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
23193 } 21425 }
23194 #[doc = "CRC Error flag clear"] 21426 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23195 pub const fn crcec(&self) -> bool { 21427 pub const fn cmdsent(&self) -> bool {
23196 let val = (self.0 >> 7usize) & 0x01; 21428 let val = (self.0 >> 7usize) & 0x01;
23197 val != 0 21429 val != 0
23198 } 21430 }
23199 #[doc = "CRC Error flag clear"] 21431 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23200 pub fn set_crcec(&mut self, val: bool) { 21432 pub fn set_cmdsent(&mut self, val: bool) {
23201 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 21433 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
23202 } 21434 }
23203 #[doc = "TI frame format error flag clear"] 21435 #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23204 pub const fn tifrec(&self) -> bool { 21436 pub const fn dataend(&self) -> bool {
23205 let val = (self.0 >> 8usize) & 0x01; 21437 let val = (self.0 >> 8usize) & 0x01;
23206 val != 0 21438 val != 0
23207 } 21439 }
23208 #[doc = "TI frame format error flag clear"] 21440 #[doc = "Data transfer ended correctly. (data counter, DATACOUNT is zero and no errors occur). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23209 pub fn set_tifrec(&mut self, val: bool) { 21441 pub fn set_dataend(&mut self, val: bool) {
23210 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 21442 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
23211 } 21443 }
23212 #[doc = "Mode Fault flag clear"] 21444 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23213 pub const fn modfc(&self) -> bool { 21445 pub const fn dhold(&self) -> bool {
23214 let val = (self.0 >> 9usize) & 0x01; 21446 let val = (self.0 >> 9usize) & 0x01;
23215 val != 0 21447 val != 0
23216 } 21448 }
23217 #[doc = "Mode Fault flag clear"] 21449 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23218 pub fn set_modfc(&mut self, val: bool) { 21450 pub fn set_dhold(&mut self, val: bool) {
23219 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 21451 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
23220 } 21452 }
23221 #[doc = "TSERFC flag clear"] 21453 #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23222 pub const fn tserfc(&self) -> bool { 21454 pub const fn dbckend(&self) -> bool {
23223 let val = (self.0 >> 10usize) & 0x01; 21455 let val = (self.0 >> 10usize) & 0x01;
23224 val != 0 21456 val != 0
23225 } 21457 }
23226 #[doc = "TSERFC flag clear"] 21458 #[doc = "Data block sent/received. (CRC check passed) and DPSM moves to the READWAIT state. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23227 pub fn set_tserfc(&mut self, val: bool) { 21459 pub fn set_dbckend(&mut self, val: bool) {
23228 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 21460 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
23229 } 21461 }
23230 #[doc = "SUSPend flag clear"] 21462 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23231 pub const fn suspc(&self) -> bool { 21463 pub const fn dabort(&self) -> bool {
23232 let val = (self.0 >> 11usize) & 0x01; 21464 let val = (self.0 >> 11usize) & 0x01;
23233 val != 0 21465 val != 0
23234 } 21466 }
23235 #[doc = "SUSPend flag clear"] 21467 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
23236 pub fn set_suspc(&mut self, val: bool) { 21468 pub fn set_dabort(&mut self, val: bool) {
21469 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
21470 }
21471 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
21472 pub const fn dpsmact(&self) -> bool {
21473 let val = (self.0 >> 12usize) & 0x01;
21474 val != 0
21475 }
21476 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
21477 pub fn set_dpsmact(&mut self, val: bool) {
21478 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
21479 }
21480 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
21481 pub const fn cpsmact(&self) -> bool {
21482 let val = (self.0 >> 13usize) & 0x01;
21483 val != 0
21484 }
21485 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
21486 pub fn set_cpsmact(&mut self, val: bool) {
21487 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
21488 }
21489 #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."]
21490 pub const fn txfifohe(&self) -> bool {
21491 let val = (self.0 >> 14usize) & 0x01;
21492 val != 0
21493 }
21494 #[doc = "Transmit FIFO half empty At least half the number of words can be written into the FIFO. This bit is cleared when the FIFO becomes half+1 full."]
21495 pub fn set_txfifohe(&mut self, val: bool) {
21496 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
21497 }
21498 #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."]
21499 pub const fn rxfifohf(&self) -> bool {
21500 let val = (self.0 >> 15usize) & 0x01;
21501 val != 0
21502 }
21503 #[doc = "Receive FIFO half full There are at least half the number of words in the FIFO. This bit is cleared when the FIFO becomes half+1 empty."]
21504 pub fn set_rxfifohf(&mut self, val: bool) {
21505 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
21506 }
21507 #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."]
21508 pub const fn txfifof(&self) -> bool {
21509 let val = (self.0 >> 16usize) & 0x01;
21510 val != 0
21511 }
21512 #[doc = "Transmit FIFO full This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes empty."]
21513 pub fn set_txfifof(&mut self, val: bool) {
21514 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
21515 }
21516 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
21517 pub const fn rxfifof(&self) -> bool {
21518 let val = (self.0 >> 17usize) & 0x01;
21519 val != 0
21520 }
21521 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
21522 pub fn set_rxfifof(&mut self, val: bool) {
21523 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
21524 }
21525 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
21526 pub const fn txfifoe(&self) -> bool {
21527 let val = (self.0 >> 18usize) & 0x01;
21528 val != 0
21529 }
21530 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
21531 pub fn set_txfifoe(&mut self, val: bool) {
21532 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
21533 }
21534 #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."]
21535 pub const fn rxfifoe(&self) -> bool {
21536 let val = (self.0 >> 19usize) & 0x01;
21537 val != 0
21538 }
21539 #[doc = "Receive FIFO empty This is a hardware status flag only, does not generate an interrupt. This bit is cleared when one FIFO location becomes full."]
21540 pub fn set_rxfifoe(&mut self, val: bool) {
21541 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
21542 }
21543 #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."]
21544 pub const fn busyd0(&self) -> bool {
21545 let val = (self.0 >> 20usize) & 0x01;
21546 val != 0
21547 }
21548 #[doc = "Inverted value of SDMMC_D0 line (Busy), sampled at the end of a CMD response and a second time 2 SDMMC_CK cycles after the CMD response. This bit is reset to not busy when the SDMMCD0 line changes from busy to not busy. This bit does not signal busy due to data transfer. This is a hardware status flag only, it does not generate an interrupt."]
21549 pub fn set_busyd0(&mut self, val: bool) {
21550 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
21551 }
21552 #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21553 pub const fn busyd0end(&self) -> bool {
21554 let val = (self.0 >> 21usize) & 0x01;
21555 val != 0
21556 }
21557 #[doc = "end of SDMMC_D0 Busy following a CMD response detected. This indicates only end of busy following a CMD response. This bit does not signal busy due to data transfer. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21558 pub fn set_busyd0end(&mut self, val: bool) {
21559 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
21560 }
21561 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21562 pub const fn sdioit(&self) -> bool {
21563 let val = (self.0 >> 22usize) & 0x01;
21564 val != 0
21565 }
21566 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21567 pub fn set_sdioit(&mut self, val: bool) {
21568 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
21569 }
21570 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21571 pub const fn ackfail(&self) -> bool {
21572 let val = (self.0 >> 23usize) & 0x01;
21573 val != 0
21574 }
21575 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21576 pub fn set_ackfail(&mut self, val: bool) {
21577 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
21578 }
21579 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21580 pub const fn acktimeout(&self) -> bool {
21581 let val = (self.0 >> 24usize) & 0x01;
21582 val != 0
21583 }
21584 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21585 pub fn set_acktimeout(&mut self, val: bool) {
21586 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
21587 }
21588 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21589 pub const fn vswend(&self) -> bool {
21590 let val = (self.0 >> 25usize) & 0x01;
21591 val != 0
21592 }
21593 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21594 pub fn set_vswend(&mut self, val: bool) {
21595 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
21596 }
21597 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21598 pub const fn ckstop(&self) -> bool {
21599 let val = (self.0 >> 26usize) & 0x01;
21600 val != 0
21601 }
21602 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21603 pub fn set_ckstop(&mut self, val: bool) {
21604 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
21605 }
21606 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21607 pub const fn idmate(&self) -> bool {
21608 let val = (self.0 >> 27usize) & 0x01;
21609 val != 0
21610 }
21611 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21612 pub fn set_idmate(&mut self, val: bool) {
21613 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
21614 }
21615 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21616 pub const fn idmabtc(&self) -> bool {
21617 let val = (self.0 >> 28usize) & 0x01;
21618 val != 0
21619 }
21620 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
21621 pub fn set_idmabtc(&mut self, val: bool) {
21622 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
21623 }
21624 }
21625 impl Default for Star {
21626 fn default() -> Star {
21627 Star(0)
21628 }
21629 }
21630 #[doc = "The receive and transmit FIFOs can be read or written as 32-bit wide registers. The FIFOs contain 32 entries on 32 sequential addresses. This allows the CPU to use its load and store multiple operands to read from/write to the FIFO."]
21631 #[repr(transparent)]
21632 #[derive(Copy, Clone, Eq, PartialEq)]
21633 pub struct Idmactrlr(pub u32);
21634 impl Idmactrlr {
21635 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21636 pub const fn idmaen(&self) -> bool {
21637 let val = (self.0 >> 0usize) & 0x01;
21638 val != 0
21639 }
21640 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21641 pub fn set_idmaen(&mut self, val: bool) {
21642 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
21643 }
21644 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21645 pub const fn idmabmode(&self) -> bool {
21646 let val = (self.0 >> 1usize) & 0x01;
21647 val != 0
21648 }
21649 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21650 pub fn set_idmabmode(&mut self, val: bool) {
21651 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
21652 }
21653 #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."]
21654 pub const fn idmabact(&self) -> bool {
21655 let val = (self.0 >> 2usize) & 0x01;
21656 val != 0
21657 }
21658 #[doc = "Double buffer mode active buffer indication This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). When IDMA is enabled this bit is toggled by hardware."]
21659 pub fn set_idmabact(&mut self, val: bool) {
21660 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
21661 }
21662 }
21663 impl Default for Idmactrlr {
21664 fn default() -> Idmactrlr {
21665 Idmactrlr(0)
21666 }
21667 }
21668 #[doc = "The SDMMC_IDMABASE0R register contains the memory buffer base address in single buffer configuration and the buffer 0 base address in double buffer configuration."]
21669 #[repr(transparent)]
21670 #[derive(Copy, Clone, Eq, PartialEq)]
21671 pub struct Idmabase0r(pub u32);
21672 impl Idmabase0r {
21673 #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0]
21674are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."]
21675 pub const fn idmabase0(&self) -> u32 {
21676 let val = (self.0 >> 0usize) & 0xffff_ffff;
21677 val as u32
21678 }
21679 #[doc = "Buffer 0 memory base address bits [31:2], shall be word aligned (bit [1:0]
21680are always 0 and read only). This register can be written by firmware when DPSM is inactive (DPSMACT = 0), and can dynamically be written by firmware when DPSM active (DPSMACT = 1) and memory buffer 0 is inactive (IDMABACT = 1)."]
21681 pub fn set_idmabase0(&mut self, val: u32) {
21682 self.0 =
21683 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
21684 }
21685 }
21686 impl Default for Idmabase0r {
21687 fn default() -> Idmabase0r {
21688 Idmabase0r(0)
21689 }
21690 }
21691 #[doc = "SDMMC command response register"]
21692 #[repr(transparent)]
21693 #[derive(Copy, Clone, Eq, PartialEq)]
21694 pub struct Respcmdr(pub u32);
21695 impl Respcmdr {
21696 #[doc = "Response command index"]
21697 pub const fn respcmd(&self) -> u8 {
21698 let val = (self.0 >> 0usize) & 0x3f;
21699 val as u8
21700 }
21701 #[doc = "Response command index"]
21702 pub fn set_respcmd(&mut self, val: u8) {
21703 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
21704 }
21705 }
21706 impl Default for Respcmdr {
21707 fn default() -> Respcmdr {
21708 Respcmdr(0)
21709 }
21710 }
21711 #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."]
21712 #[repr(transparent)]
21713 #[derive(Copy, Clone, Eq, PartialEq)]
21714 pub struct Idmabsizer(pub u32);
21715 impl Idmabsizer {
21716 #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21717 pub const fn idmabndt(&self) -> u8 {
21718 let val = (self.0 >> 5usize) & 0xff;
21719 val as u8
21720 }
21721 #[doc = "Number of transfers per buffer. This 8-bit value shall be multiplied by 8 to get the size of the buffer in 32-bit words and by 32 to get the size of the buffer in bytes. Example: IDMABNDT = 0x01: buffer size = 8 words = 32 bytes. These bits can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21722 pub fn set_idmabndt(&mut self, val: u8) {
21723 self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize);
21724 }
21725 }
21726 impl Default for Idmabsizer {
21727 fn default() -> Idmabsizer {
21728 Idmabsizer(0)
21729 }
21730 }
21731 #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."]
21732 #[repr(transparent)]
21733 #[derive(Copy, Clone, Eq, PartialEq)]
21734 pub struct Dctrl(pub u32);
21735 impl Dctrl {
21736 #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."]
21737 pub const fn dten(&self) -> bool {
21738 let val = (self.0 >> 0usize) & 0x01;
21739 val != 0
21740 }
21741 #[doc = "Data transfer enable bit This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). This bit is cleared by Hardware when data transfer completes. This bit shall only be used to transfer data when no associated data transfer command is used, i.e. shall not be used with SD or eMMC cards."]
21742 pub fn set_dten(&mut self, val: bool) {
21743 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
21744 }
21745 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21746 pub const fn dtdir(&self) -> bool {
21747 let val = (self.0 >> 1usize) & 0x01;
21748 val != 0
21749 }
21750 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21751 pub fn set_dtdir(&mut self, val: bool) {
21752 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
21753 }
21754 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21755 pub const fn dtmode(&self) -> u8 {
21756 let val = (self.0 >> 2usize) & 0x03;
21757 val as u8
21758 }
21759 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21760 pub fn set_dtmode(&mut self, val: u8) {
21761 self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize);
21762 }
21763 #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"]
21764 pub const fn dblocksize(&self) -> u8 {
21765 let val = (self.0 >> 4usize) & 0x0f;
21766 val as u8
21767 }
21768 #[doc = "Data block size This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). Define the data block length when the block data transfer mode is selected: When DATALENGTH is not a multiple of DBLOCKSIZE, the transfered data is truncated at a multiple of DBLOCKSIZE. (Any remain data will not be transfered.) When DDR = 1, DBLOCKSIZE = 0000 shall not be used. (No data will be transfered)"]
21769 pub fn set_dblocksize(&mut self, val: u8) {
21770 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
21771 }
21772 #[doc = "Read wait start. If this bit is set, read wait operation starts."]
21773 pub const fn rwstart(&self) -> bool {
21774 let val = (self.0 >> 8usize) & 0x01;
21775 val != 0
21776 }
21777 #[doc = "Read wait start. If this bit is set, read wait operation starts."]
21778 pub fn set_rwstart(&mut self, val: bool) {
21779 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
21780 }
21781 #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."]
21782 pub const fn rwstop(&self) -> bool {
21783 let val = (self.0 >> 9usize) & 0x01;
21784 val != 0
21785 }
21786 #[doc = "Read wait stop This bit is written by firmware and auto cleared by hardware when the DPSM moves from the READ_WAIT state to the WAIT_R or IDLE state."]
21787 pub fn set_rwstop(&mut self, val: bool) {
21788 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
21789 }
21790 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21791 pub const fn rwmod(&self) -> bool {
21792 let val = (self.0 >> 10usize) & 0x01;
21793 val != 0
21794 }
21795 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21796 pub fn set_rwmod(&mut self, val: bool) {
21797 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
21798 }
21799 #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."]
21800 pub const fn sdioen(&self) -> bool {
21801 let val = (self.0 >> 11usize) & 0x01;
21802 val != 0
21803 }
21804 #[doc = "SD I/O interrupt enable functions This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0). If this bit is set, the DPSM enables the SD I/O card specific interrupt operation."]
21805 pub fn set_sdioen(&mut self, val: bool) {
23237 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 21806 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
23238 } 21807 }
21808 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21809 pub const fn bootacken(&self) -> bool {
21810 let val = (self.0 >> 12usize) & 0x01;
21811 val != 0
21812 }
21813 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
21814 pub fn set_bootacken(&mut self, val: bool) {
21815 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
21816 }
21817 #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."]
21818 pub const fn fiforst(&self) -> bool {
21819 let val = (self.0 >> 13usize) & 0x01;
21820 val != 0
21821 }
21822 #[doc = "FIFO reset, will flush any remaining data. This bit can only be written by firmware when IDMAEN= 0 and DPSM is active (DPSMACT = 1). This bit will only take effect when a transfer error or transfer hold occurs."]
21823 pub fn set_fiforst(&mut self, val: bool) {
21824 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
21825 }
23239 } 21826 }
23240 impl Default for Ifcr { 21827 impl Default for Dctrl {
23241 fn default() -> Ifcr { 21828 fn default() -> Dctrl {
23242 Ifcr(0) 21829 Dctrl(0)
23243 } 21830 }
23244 } 21831 }
23245 #[doc = "Status Register"] 21832 #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."]
23246 #[repr(transparent)] 21833 #[repr(transparent)]
23247 #[derive(Copy, Clone, Eq, PartialEq)] 21834 #[derive(Copy, Clone, Eq, PartialEq)]
23248 pub struct Sr(pub u32); 21835 pub struct Maskr(pub u32);
23249 impl Sr { 21836 impl Maskr {
23250 #[doc = "Rx-Packet available"] 21837 #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."]
23251 pub const fn rxp(&self) -> bool { 21838 pub const fn ccrcfailie(&self) -> bool {
23252 let val = (self.0 >> 0usize) & 0x01; 21839 let val = (self.0 >> 0usize) & 0x01;
23253 val != 0 21840 val != 0
23254 } 21841 }
23255 #[doc = "Rx-Packet available"] 21842 #[doc = "Command CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by command CRC failure."]
23256 pub fn set_rxp(&mut self, val: bool) { 21843 pub fn set_ccrcfailie(&mut self, val: bool) {
23257 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 21844 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23258 } 21845 }
23259 #[doc = "Tx-Packet space available"] 21846 #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."]
23260 pub const fn txp(&self) -> bool { 21847 pub const fn dcrcfailie(&self) -> bool {
23261 let val = (self.0 >> 1usize) & 0x01; 21848 let val = (self.0 >> 1usize) & 0x01;
23262 val != 0 21849 val != 0
23263 } 21850 }
23264 #[doc = "Tx-Packet space available"] 21851 #[doc = "Data CRC fail interrupt enable Set and cleared by software to enable/disable interrupt caused by data CRC failure."]
23265 pub fn set_txp(&mut self, val: bool) { 21852 pub fn set_dcrcfailie(&mut self, val: bool) {
23266 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 21853 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
23267 } 21854 }
23268 #[doc = "Duplex Packet"] 21855 #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."]
23269 pub const fn dxp(&self) -> bool { 21856 pub const fn ctimeoutie(&self) -> bool {
23270 let val = (self.0 >> 2usize) & 0x01; 21857 let val = (self.0 >> 2usize) & 0x01;
23271 val != 0 21858 val != 0
23272 } 21859 }
23273 #[doc = "Duplex Packet"] 21860 #[doc = "Command timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by command timeout."]
23274 pub fn set_dxp(&mut self, val: bool) { 21861 pub fn set_ctimeoutie(&mut self, val: bool) {
23275 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 21862 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
23276 } 21863 }
23277 #[doc = "End Of Transfer"] 21864 #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."]
23278 pub const fn eot(&self) -> bool { 21865 pub const fn dtimeoutie(&self) -> bool {
23279 let val = (self.0 >> 3usize) & 0x01; 21866 let val = (self.0 >> 3usize) & 0x01;
23280 val != 0 21867 val != 0
23281 } 21868 }
23282 #[doc = "End Of Transfer"] 21869 #[doc = "Data timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by data timeout."]
23283 pub fn set_eot(&mut self, val: bool) { 21870 pub fn set_dtimeoutie(&mut self, val: bool) {
23284 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 21871 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
23285 } 21872 }
23286 #[doc = "Transmission Transfer Filled"] 21873 #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."]
23287 pub const fn txtf(&self) -> bool { 21874 pub const fn txunderrie(&self) -> bool {
23288 let val = (self.0 >> 4usize) & 0x01; 21875 let val = (self.0 >> 4usize) & 0x01;
23289 val != 0 21876 val != 0
23290 } 21877 }
23291 #[doc = "Transmission Transfer Filled"] 21878 #[doc = "Tx FIFO underrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO underrun error."]
23292 pub fn set_txtf(&mut self, val: bool) { 21879 pub fn set_txunderrie(&mut self, val: bool) {
23293 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 21880 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
23294 } 21881 }
23295 #[doc = "Underrun at slave transmission mode"] 21882 #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."]
23296 pub const fn udr(&self) -> bool { 21883 pub const fn rxoverrie(&self) -> bool {
23297 let val = (self.0 >> 5usize) & 0x01; 21884 let val = (self.0 >> 5usize) & 0x01;
23298 val != 0 21885 val != 0
23299 } 21886 }
23300 #[doc = "Underrun at slave transmission mode"] 21887 #[doc = "Rx FIFO overrun error interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO overrun error."]
23301 pub fn set_udr(&mut self, val: bool) { 21888 pub fn set_rxoverrie(&mut self, val: bool) {
23302 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 21889 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
23303 } 21890 }
23304 #[doc = "Overrun"] 21891 #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."]
23305 pub const fn ovr(&self) -> bool { 21892 pub const fn cmdrendie(&self) -> bool {
23306 let val = (self.0 >> 6usize) & 0x01; 21893 let val = (self.0 >> 6usize) & 0x01;
23307 val != 0 21894 val != 0
23308 } 21895 }
23309 #[doc = "Overrun"] 21896 #[doc = "Command response received interrupt enable Set and cleared by software to enable/disable interrupt caused by receiving command response."]
23310 pub fn set_ovr(&mut self, val: bool) { 21897 pub fn set_cmdrendie(&mut self, val: bool) {
23311 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 21898 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
23312 } 21899 }
23313 #[doc = "CRC Error"] 21900 #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."]
23314 pub const fn crce(&self) -> bool { 21901 pub const fn cmdsentie(&self) -> bool {
23315 let val = (self.0 >> 7usize) & 0x01; 21902 let val = (self.0 >> 7usize) & 0x01;
23316 val != 0 21903 val != 0
23317 } 21904 }
23318 #[doc = "CRC Error"] 21905 #[doc = "Command sent interrupt enable Set and cleared by software to enable/disable interrupt caused by sending command."]
23319 pub fn set_crce(&mut self, val: bool) { 21906 pub fn set_cmdsentie(&mut self, val: bool) {
23320 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 21907 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
23321 } 21908 }
23322 #[doc = "TI frame format error"] 21909 #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."]
23323 pub const fn tifre(&self) -> bool { 21910 pub const fn dataendie(&self) -> bool {
23324 let val = (self.0 >> 8usize) & 0x01; 21911 let val = (self.0 >> 8usize) & 0x01;
23325 val != 0 21912 val != 0
23326 } 21913 }
23327 #[doc = "TI frame format error"] 21914 #[doc = "Data end interrupt enable Set and cleared by software to enable/disable interrupt caused by data end."]
23328 pub fn set_tifre(&mut self, val: bool) { 21915 pub fn set_dataendie(&mut self, val: bool) {
23329 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 21916 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
23330 } 21917 }
23331 #[doc = "Mode Fault"] 21918 #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."]
23332 pub const fn modf(&self) -> bool { 21919 pub const fn dholdie(&self) -> bool {
23333 let val = (self.0 >> 9usize) & 0x01; 21920 let val = (self.0 >> 9usize) & 0x01;
23334 val != 0 21921 val != 0
23335 } 21922 }
23336 #[doc = "Mode Fault"] 21923 #[doc = "Data hold interrupt enable Set and cleared by software to enable/disable the interrupt generated when sending new data is hold in the DPSM Wait_S state."]
23337 pub fn set_modf(&mut self, val: bool) { 21924 pub fn set_dholdie(&mut self, val: bool) {
23338 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 21925 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
23339 } 21926 }
23340 #[doc = "Additional number of SPI data to be transacted was reload"] 21927 #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."]
23341 pub const fn tserf(&self) -> bool { 21928 pub const fn dbckendie(&self) -> bool {
23342 let val = (self.0 >> 10usize) & 0x01; 21929 let val = (self.0 >> 10usize) & 0x01;
23343 val != 0 21930 val != 0
23344 } 21931 }
23345 #[doc = "Additional number of SPI data to be transacted was reload"] 21932 #[doc = "Data block end interrupt enable Set and cleared by software to enable/disable interrupt caused by data block end."]
23346 pub fn set_tserf(&mut self, val: bool) { 21933 pub fn set_dbckendie(&mut self, val: bool) {
23347 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 21934 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
23348 } 21935 }
23349 #[doc = "SUSPend"] 21936 #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."]
23350 pub const fn susp(&self) -> bool { 21937 pub const fn dabortie(&self) -> bool {
23351 let val = (self.0 >> 11usize) & 0x01; 21938 let val = (self.0 >> 11usize) & 0x01;
23352 val != 0 21939 val != 0
23353 } 21940 }
23354 #[doc = "SUSPend"] 21941 #[doc = "Data transfer aborted interrupt enable Set and cleared by software to enable/disable interrupt caused by a data transfer being aborted."]
23355 pub fn set_susp(&mut self, val: bool) { 21942 pub fn set_dabortie(&mut self, val: bool) {
23356 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 21943 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
23357 } 21944 }
23358 #[doc = "TxFIFO transmission complete"] 21945 #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."]
23359 pub const fn txc(&self) -> bool { 21946 pub const fn txfifoheie(&self) -> bool {
23360 let val = (self.0 >> 12usize) & 0x01; 21947 let val = (self.0 >> 14usize) & 0x01;
23361 val != 0 21948 val != 0
23362 } 21949 }
23363 #[doc = "TxFIFO transmission complete"] 21950 #[doc = "Tx FIFO half empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO half empty."]
23364 pub fn set_txc(&mut self, val: bool) { 21951 pub fn set_txfifoheie(&mut self, val: bool) {
23365 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 21952 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
23366 } 21953 }
23367 #[doc = "RxFIFO Packing LeVeL"] 21954 #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."]
23368 pub const fn rxplvl(&self) -> super::vals::Rxplvl { 21955 pub const fn rxfifohfie(&self) -> bool {
23369 let val = (self.0 >> 13usize) & 0x03; 21956 let val = (self.0 >> 15usize) & 0x01;
23370 super::vals::Rxplvl(val as u8) 21957 val != 0
23371 } 21958 }
23372 #[doc = "RxFIFO Packing LeVeL"] 21959 #[doc = "Rx FIFO half full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO half full."]
23373 pub fn set_rxplvl(&mut self, val: super::vals::Rxplvl) { 21960 pub fn set_rxfifohfie(&mut self, val: bool) {
23374 self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize); 21961 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
23375 } 21962 }
23376 #[doc = "RxFIFO Word Not Empty"] 21963 #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."]
23377 pub const fn rxwne(&self) -> super::vals::Rxwne { 21964 pub const fn rxfifofie(&self) -> bool {
23378 let val = (self.0 >> 15usize) & 0x01; 21965 let val = (self.0 >> 17usize) & 0x01;
23379 super::vals::Rxwne(val as u8) 21966 val != 0
23380 } 21967 }
23381 #[doc = "RxFIFO Word Not Empty"] 21968 #[doc = "Rx FIFO full interrupt enable Set and cleared by software to enable/disable interrupt caused by Rx FIFO full."]
23382 pub fn set_rxwne(&mut self, val: super::vals::Rxwne) { 21969 pub fn set_rxfifofie(&mut self, val: bool) {
23383 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 21970 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
23384 } 21971 }
23385 #[doc = "Number of data frames remaining in current TSIZE session"] 21972 #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."]
23386 pub const fn ctsize(&self) -> u16 { 21973 pub const fn txfifoeie(&self) -> bool {
23387 let val = (self.0 >> 16usize) & 0xffff; 21974 let val = (self.0 >> 18usize) & 0x01;
23388 val as u16 21975 val != 0
23389 } 21976 }
23390 #[doc = "Number of data frames remaining in current TSIZE session"] 21977 #[doc = "Tx FIFO empty interrupt enable Set and cleared by software to enable/disable interrupt caused by Tx FIFO empty."]
23391 pub fn set_ctsize(&mut self, val: u16) { 21978 pub fn set_txfifoeie(&mut self, val: bool) {
23392 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); 21979 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
23393 } 21980 }
23394 } 21981 #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."]
23395 impl Default for Sr { 21982 pub const fn busyd0endie(&self) -> bool {
23396 fn default() -> Sr { 21983 let val = (self.0 >> 21usize) & 0x01;
23397 Sr(0) 21984 val != 0
23398 } 21985 }
23399 } 21986 #[doc = "BUSYD0END interrupt enable Set and cleared by software to enable/disable the interrupt generated when SDMMC_D0 signal changes from busy to NOT busy following a CMD response."]
23400 #[doc = "Transmitter CRC Register"] 21987 pub fn set_busyd0endie(&mut self, val: bool) {
23401 #[repr(transparent)] 21988 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
23402 #[derive(Copy, Clone, Eq, PartialEq)]
23403 pub struct Txcrc(pub u32);
23404 impl Txcrc {
23405 #[doc = "CRC register for transmitter"]
23406 pub const fn txcrc(&self) -> u32 {
23407 let val = (self.0 >> 0usize) & 0xffff_ffff;
23408 val as u32
23409 } 21989 }
23410 #[doc = "CRC register for transmitter"] 21990 #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."]
23411 pub fn set_txcrc(&mut self, val: u32) { 21991 pub const fn sdioitie(&self) -> bool {
23412 self.0 = 21992 let val = (self.0 >> 22usize) & 0x01;
23413 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 21993 val != 0
21994 }
21995 #[doc = "SDIO mode interrupt received interrupt enable Set and cleared by software to enable/disable the interrupt generated when receiving the SDIO mode interrupt."]
21996 pub fn set_sdioitie(&mut self, val: bool) {
21997 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
21998 }
21999 #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."]
22000 pub const fn ackfailie(&self) -> bool {
22001 let val = (self.0 >> 23usize) & 0x01;
22002 val != 0
22003 }
22004 #[doc = "Acknowledgment Fail interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment Fail."]
22005 pub fn set_ackfailie(&mut self, val: bool) {
22006 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
22007 }
22008 #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."]
22009 pub const fn acktimeoutie(&self) -> bool {
22010 let val = (self.0 >> 24usize) & 0x01;
22011 val != 0
22012 }
22013 #[doc = "Acknowledgment timeout interrupt enable Set and cleared by software to enable/disable interrupt caused by acknowledgment timeout."]
22014 pub fn set_acktimeoutie(&mut self, val: bool) {
22015 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
22016 }
22017 #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."]
22018 pub const fn vswendie(&self) -> bool {
22019 let val = (self.0 >> 25usize) & 0x01;
22020 val != 0
22021 }
22022 #[doc = "Voltage switch critical timing section completion interrupt enable Set and cleared by software to enable/disable the interrupt generated when voltage switch critical timing section completion."]
22023 pub fn set_vswendie(&mut self, val: bool) {
22024 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
22025 }
22026 #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."]
22027 pub const fn ckstopie(&self) -> bool {
22028 let val = (self.0 >> 26usize) & 0x01;
22029 val != 0
22030 }
22031 #[doc = "Voltage Switch clock stopped interrupt enable Set and cleared by software to enable/disable interrupt caused by Voltage Switch clock stopped."]
22032 pub fn set_ckstopie(&mut self, val: bool) {
22033 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
22034 }
22035 #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."]
22036 pub const fn idmabtcie(&self) -> bool {
22037 let val = (self.0 >> 28usize) & 0x01;
22038 val != 0
22039 }
22040 #[doc = "IDMA buffer transfer complete interrupt enable Set and cleared by software to enable/disable the interrupt generated when the IDMA has transferred all data belonging to a memory buffer."]
22041 pub fn set_idmabtcie(&mut self, val: bool) {
22042 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
23414 } 22043 }
23415 } 22044 }
23416 impl Default for Txcrc { 22045 impl Default for Maskr {
23417 fn default() -> Txcrc { 22046 fn default() -> Maskr {
23418 Txcrc(0) 22047 Maskr(0)
23419 } 22048 }
23420 } 22049 }
23421 #[doc = "Polynomial Register"] 22050 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
23422 #[repr(transparent)] 22051 #[repr(transparent)]
23423 #[derive(Copy, Clone, Eq, PartialEq)] 22052 #[derive(Copy, Clone, Eq, PartialEq)]
23424 pub struct Crcpoly(pub u32); 22053 pub struct Resp1r(pub u32);
23425 impl Crcpoly { 22054 impl Resp1r {
23426 #[doc = "CRC polynomial register"] 22055 #[doc = "see Table 432"]
23427 pub const fn crcpoly(&self) -> u32 { 22056 pub const fn cardstatus1(&self) -> u32 {
23428 let val = (self.0 >> 0usize) & 0xffff_ffff; 22057 let val = (self.0 >> 0usize) & 0xffff_ffff;
23429 val as u32 22058 val as u32
23430 } 22059 }
23431 #[doc = "CRC polynomial register"] 22060 #[doc = "see Table 432"]
23432 pub fn set_crcpoly(&mut self, val: u32) { 22061 pub fn set_cardstatus1(&mut self, val: u32) {
23433 self.0 = 22062 self.0 =
23434 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 22063 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
23435 } 22064 }
23436 } 22065 }
23437 impl Default for Crcpoly { 22066 impl Default for Resp1r {
23438 fn default() -> Crcpoly { 22067 fn default() -> Resp1r {
23439 Crcpoly(0) 22068 Resp1r(0)
23440 } 22069 }
23441 } 22070 }
23442 #[doc = "control register 1"] 22071 #[doc = "The SDMMC_ICR register is a write-only register. Writing a bit with 1 clears the corresponding bit in the SDMMC_STAR status register."]
23443 #[repr(transparent)] 22072 #[repr(transparent)]
23444 #[derive(Copy, Clone, Eq, PartialEq)] 22073 #[derive(Copy, Clone, Eq, PartialEq)]
23445 pub struct Cr1(pub u32); 22074 pub struct Icr(pub u32);
23446 impl Cr1 { 22075 impl Icr {
23447 #[doc = "Serial Peripheral Enable"] 22076 #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."]
23448 pub const fn spe(&self) -> bool { 22077 pub const fn ccrcfailc(&self) -> bool {
23449 let val = (self.0 >> 0usize) & 0x01; 22078 let val = (self.0 >> 0usize) & 0x01;
23450 val != 0 22079 val != 0
23451 } 22080 }
23452 #[doc = "Serial Peripheral Enable"] 22081 #[doc = "CCRCFAIL flag clear bit Set by software to clear the CCRCFAIL flag."]
23453 pub fn set_spe(&mut self, val: bool) { 22082 pub fn set_ccrcfailc(&mut self, val: bool) {
23454 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 22083 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23455 } 22084 }
23456 #[doc = "Master automatic SUSP in Receive mode"] 22085 #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."]
23457 pub const fn masrx(&self) -> bool { 22086 pub const fn dcrcfailc(&self) -> bool {
22087 let val = (self.0 >> 1usize) & 0x01;
22088 val != 0
22089 }
22090 #[doc = "DCRCFAIL flag clear bit Set by software to clear the DCRCFAIL flag."]
22091 pub fn set_dcrcfailc(&mut self, val: bool) {
22092 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
22093 }
22094 #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."]
22095 pub const fn ctimeoutc(&self) -> bool {
22096 let val = (self.0 >> 2usize) & 0x01;
22097 val != 0
22098 }
22099 #[doc = "CTIMEOUT flag clear bit Set by software to clear the CTIMEOUT flag."]
22100 pub fn set_ctimeoutc(&mut self, val: bool) {
22101 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
22102 }
22103 #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."]
22104 pub const fn dtimeoutc(&self) -> bool {
22105 let val = (self.0 >> 3usize) & 0x01;
22106 val != 0
22107 }
22108 #[doc = "DTIMEOUT flag clear bit Set by software to clear the DTIMEOUT flag."]
22109 pub fn set_dtimeoutc(&mut self, val: bool) {
22110 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
22111 }
22112 #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."]
22113 pub const fn txunderrc(&self) -> bool {
22114 let val = (self.0 >> 4usize) & 0x01;
22115 val != 0
22116 }
22117 #[doc = "TXUNDERR flag clear bit Set by software to clear TXUNDERR flag."]
22118 pub fn set_txunderrc(&mut self, val: bool) {
22119 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
22120 }
22121 #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."]
22122 pub const fn rxoverrc(&self) -> bool {
22123 let val = (self.0 >> 5usize) & 0x01;
22124 val != 0
22125 }
22126 #[doc = "RXOVERR flag clear bit Set by software to clear the RXOVERR flag."]
22127 pub fn set_rxoverrc(&mut self, val: bool) {
22128 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
22129 }
22130 #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."]
22131 pub const fn cmdrendc(&self) -> bool {
22132 let val = (self.0 >> 6usize) & 0x01;
22133 val != 0
22134 }
22135 #[doc = "CMDREND flag clear bit Set by software to clear the CMDREND flag."]
22136 pub fn set_cmdrendc(&mut self, val: bool) {
22137 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
22138 }
22139 #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."]
22140 pub const fn cmdsentc(&self) -> bool {
22141 let val = (self.0 >> 7usize) & 0x01;
22142 val != 0
22143 }
22144 #[doc = "CMDSENT flag clear bit Set by software to clear the CMDSENT flag."]
22145 pub fn set_cmdsentc(&mut self, val: bool) {
22146 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
22147 }
22148 #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."]
22149 pub const fn dataendc(&self) -> bool {
23458 let val = (self.0 >> 8usize) & 0x01; 22150 let val = (self.0 >> 8usize) & 0x01;
23459 val != 0 22151 val != 0
23460 } 22152 }
23461 #[doc = "Master automatic SUSP in Receive mode"] 22153 #[doc = "DATAEND flag clear bit Set by software to clear the DATAEND flag."]
23462 pub fn set_masrx(&mut self, val: bool) { 22154 pub fn set_dataendc(&mut self, val: bool) {
23463 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 22155 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
23464 } 22156 }
23465 #[doc = "Master transfer start"] 22157 #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."]
23466 pub const fn cstart(&self) -> bool { 22158 pub const fn dholdc(&self) -> bool {
23467 let val = (self.0 >> 9usize) & 0x01; 22159 let val = (self.0 >> 9usize) & 0x01;
23468 val != 0 22160 val != 0
23469 } 22161 }
23470 #[doc = "Master transfer start"] 22162 #[doc = "DHOLD flag clear bit Set by software to clear the DHOLD flag."]
23471 pub fn set_cstart(&mut self, val: bool) { 22163 pub fn set_dholdc(&mut self, val: bool) {
23472 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 22164 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
23473 } 22165 }
23474 #[doc = "Master SUSPend request"] 22166 #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."]
23475 pub const fn csusp(&self) -> bool { 22167 pub const fn dbckendc(&self) -> bool {
23476 let val = (self.0 >> 10usize) & 0x01; 22168 let val = (self.0 >> 10usize) & 0x01;
23477 val != 0 22169 val != 0
23478 } 22170 }
23479 #[doc = "Master SUSPend request"] 22171 #[doc = "DBCKEND flag clear bit Set by software to clear the DBCKEND flag."]
23480 pub fn set_csusp(&mut self, val: bool) { 22172 pub fn set_dbckendc(&mut self, val: bool) {
23481 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 22173 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
23482 } 22174 }
23483 #[doc = "Rx/Tx direction at Half-duplex mode"] 22175 #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."]
23484 pub const fn hddir(&self) -> super::vals::Hddir { 22176 pub const fn dabortc(&self) -> bool {
23485 let val = (self.0 >> 11usize) & 0x01; 22177 let val = (self.0 >> 11usize) & 0x01;
23486 super::vals::Hddir(val as u8) 22178 val != 0
23487 } 22179 }
23488 #[doc = "Rx/Tx direction at Half-duplex mode"] 22180 #[doc = "DABORT flag clear bit Set by software to clear the DABORT flag."]
23489 pub fn set_hddir(&mut self, val: super::vals::Hddir) { 22181 pub fn set_dabortc(&mut self, val: bool) {
23490 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 22182 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
23491 } 22183 }
23492 #[doc = "Internal SS signal input level"] 22184 #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."]
23493 pub const fn ssi(&self) -> bool { 22185 pub const fn busyd0endc(&self) -> bool {
23494 let val = (self.0 >> 12usize) & 0x01; 22186 let val = (self.0 >> 21usize) & 0x01;
23495 val != 0 22187 val != 0
23496 } 22188 }
23497 #[doc = "Internal SS signal input level"] 22189 #[doc = "BUSYD0END flag clear bit Set by software to clear the BUSYD0END flag."]
23498 pub fn set_ssi(&mut self, val: bool) { 22190 pub fn set_busyd0endc(&mut self, val: bool) {
23499 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 22191 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
23500 } 22192 }
23501 #[doc = "32-bit CRC polynomial configuration"] 22193 #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."]
23502 pub const fn crc33_17(&self) -> super::vals::Crc { 22194 pub const fn sdioitc(&self) -> bool {
22195 let val = (self.0 >> 22usize) & 0x01;
22196 val != 0
22197 }
22198 #[doc = "SDIOIT flag clear bit Set by software to clear the SDIOIT flag."]
22199 pub fn set_sdioitc(&mut self, val: bool) {
22200 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
22201 }
22202 #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."]
22203 pub const fn ackfailc(&self) -> bool {
22204 let val = (self.0 >> 23usize) & 0x01;
22205 val != 0
22206 }
22207 #[doc = "ACKFAIL flag clear bit Set by software to clear the ACKFAIL flag."]
22208 pub fn set_ackfailc(&mut self, val: bool) {
22209 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
22210 }
22211 #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."]
22212 pub const fn acktimeoutc(&self) -> bool {
22213 let val = (self.0 >> 24usize) & 0x01;
22214 val != 0
22215 }
22216 #[doc = "ACKTIMEOUT flag clear bit Set by software to clear the ACKTIMEOUT flag."]
22217 pub fn set_acktimeoutc(&mut self, val: bool) {
22218 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
22219 }
22220 #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."]
22221 pub const fn vswendc(&self) -> bool {
22222 let val = (self.0 >> 25usize) & 0x01;
22223 val != 0
22224 }
22225 #[doc = "VSWEND flag clear bit Set by software to clear the VSWEND flag."]
22226 pub fn set_vswendc(&mut self, val: bool) {
22227 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
22228 }
22229 #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."]
22230 pub const fn ckstopc(&self) -> bool {
22231 let val = (self.0 >> 26usize) & 0x01;
22232 val != 0
22233 }
22234 #[doc = "CKSTOP flag clear bit Set by software to clear the CKSTOP flag."]
22235 pub fn set_ckstopc(&mut self, val: bool) {
22236 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
22237 }
22238 #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."]
22239 pub const fn idmatec(&self) -> bool {
22240 let val = (self.0 >> 27usize) & 0x01;
22241 val != 0
22242 }
22243 #[doc = "IDMA transfer error clear bit Set by software to clear the IDMATE flag."]
22244 pub fn set_idmatec(&mut self, val: bool) {
22245 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
22246 }
22247 #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."]
22248 pub const fn idmabtcc(&self) -> bool {
22249 let val = (self.0 >> 28usize) & 0x01;
22250 val != 0
22251 }
22252 #[doc = "IDMA buffer transfer complete clear bit Set by software to clear the IDMABTC flag."]
22253 pub fn set_idmabtcc(&mut self, val: bool) {
22254 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
22255 }
22256 }
22257 impl Default for Icr {
22258 fn default() -> Icr {
22259 Icr(0)
22260 }
22261 }
22262 }
22263}
22264pub mod rcc_l0 {
22265 use crate::generic::*;
22266 #[doc = "Reset and clock control"]
22267 #[derive(Copy, Clone)]
22268 pub struct Rcc(pub *mut u8);
22269 unsafe impl Send for Rcc {}
22270 unsafe impl Sync for Rcc {}
22271 impl Rcc {
22272 #[doc = "Clock control register"]
22273 pub fn cr(self) -> Reg<regs::Cr, RW> {
22274 unsafe { Reg::from_ptr(self.0.add(0usize)) }
22275 }
22276 #[doc = "Internal clock sources calibration register"]
22277 pub fn icscr(self) -> Reg<regs::Icscr, RW> {
22278 unsafe { Reg::from_ptr(self.0.add(4usize)) }
22279 }
22280 #[doc = "Clock recovery RC register"]
22281 pub fn crrcr(self) -> Reg<regs::Crrcr, RW> {
22282 unsafe { Reg::from_ptr(self.0.add(8usize)) }
22283 }
22284 #[doc = "Clock configuration register"]
22285 pub fn cfgr(self) -> Reg<regs::Cfgr, RW> {
22286 unsafe { Reg::from_ptr(self.0.add(12usize)) }
22287 }
22288 #[doc = "Clock interrupt enable register"]
22289 pub fn cier(self) -> Reg<regs::Cier, R> {
22290 unsafe { Reg::from_ptr(self.0.add(16usize)) }
22291 }
22292 #[doc = "Clock interrupt flag register"]
22293 pub fn cifr(self) -> Reg<regs::Cifr, R> {
22294 unsafe { Reg::from_ptr(self.0.add(20usize)) }
22295 }
22296 #[doc = "Clock interrupt clear register"]
22297 pub fn cicr(self) -> Reg<regs::Cicr, R> {
22298 unsafe { Reg::from_ptr(self.0.add(24usize)) }
22299 }
22300 #[doc = "GPIO reset register"]
22301 pub fn ioprstr(self) -> Reg<regs::Ioprstr, RW> {
22302 unsafe { Reg::from_ptr(self.0.add(28usize)) }
22303 }
22304 #[doc = "AHB peripheral reset register"]
22305 pub fn ahbrstr(self) -> Reg<regs::Ahbrstr, RW> {
22306 unsafe { Reg::from_ptr(self.0.add(32usize)) }
22307 }
22308 #[doc = "APB2 peripheral reset register"]
22309 pub fn apb2rstr(self) -> Reg<regs::Apb2rstr, RW> {
22310 unsafe { Reg::from_ptr(self.0.add(36usize)) }
22311 }
22312 #[doc = "APB1 peripheral reset register"]
22313 pub fn apb1rstr(self) -> Reg<regs::Apb1rstr, RW> {
22314 unsafe { Reg::from_ptr(self.0.add(40usize)) }
22315 }
22316 #[doc = "GPIO clock enable register"]
22317 pub fn iopenr(self) -> Reg<regs::Iopenr, RW> {
22318 unsafe { Reg::from_ptr(self.0.add(44usize)) }
22319 }
22320 #[doc = "AHB peripheral clock enable register"]
22321 pub fn ahbenr(self) -> Reg<regs::Ahbenr, RW> {
22322 unsafe { Reg::from_ptr(self.0.add(48usize)) }
22323 }
22324 #[doc = "APB2 peripheral clock enable register"]
22325 pub fn apb2enr(self) -> Reg<regs::Apb2enr, RW> {
22326 unsafe { Reg::from_ptr(self.0.add(52usize)) }
22327 }
22328 #[doc = "APB1 peripheral clock enable register"]
22329 pub fn apb1enr(self) -> Reg<regs::Apb1enr, RW> {
22330 unsafe { Reg::from_ptr(self.0.add(56usize)) }
22331 }
22332 #[doc = "GPIO clock enable in sleep mode register"]
22333 pub fn iopsmen(self) -> Reg<regs::Iopsmen, RW> {
22334 unsafe { Reg::from_ptr(self.0.add(60usize)) }
22335 }
22336 #[doc = "AHB peripheral clock enable in sleep mode register"]
22337 pub fn ahbsmenr(self) -> Reg<regs::Ahbsmenr, RW> {
22338 unsafe { Reg::from_ptr(self.0.add(64usize)) }
22339 }
22340 #[doc = "APB2 peripheral clock enable in sleep mode register"]
22341 pub fn apb2smenr(self) -> Reg<regs::Apb2smenr, RW> {
22342 unsafe { Reg::from_ptr(self.0.add(68usize)) }
22343 }
22344 #[doc = "APB1 peripheral clock enable in sleep mode register"]
22345 pub fn apb1smenr(self) -> Reg<regs::Apb1smenr, RW> {
22346 unsafe { Reg::from_ptr(self.0.add(72usize)) }
22347 }
22348 #[doc = "Clock configuration register"]
22349 pub fn ccipr(self) -> Reg<regs::Ccipr, RW> {
22350 unsafe { Reg::from_ptr(self.0.add(76usize)) }
22351 }
22352 #[doc = "Control and status register"]
22353 pub fn csr(self) -> Reg<regs::Csr, RW> {
22354 unsafe { Reg::from_ptr(self.0.add(80usize)) }
22355 }
22356 }
22357 pub mod regs {
22358 use crate::generic::*;
22359 #[doc = "Control and status register"]
22360 #[repr(transparent)]
22361 #[derive(Copy, Clone, Eq, PartialEq)]
22362 pub struct Csr(pub u32);
22363 impl Csr {
22364 #[doc = "Internal low-speed oscillator enable"]
22365 pub const fn lsion(&self) -> super::vals::Csslseon {
22366 let val = (self.0 >> 0usize) & 0x01;
22367 super::vals::Csslseon(val as u8)
22368 }
22369 #[doc = "Internal low-speed oscillator enable"]
22370 pub fn set_lsion(&mut self, val: super::vals::Csslseon) {
22371 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
22372 }
22373 #[doc = "Internal low-speed oscillator ready bit"]
22374 pub const fn lsirdy(&self) -> super::vals::Lserdy {
22375 let val = (self.0 >> 1usize) & 0x01;
22376 super::vals::Lserdy(val as u8)
22377 }
22378 #[doc = "Internal low-speed oscillator ready bit"]
22379 pub fn set_lsirdy(&mut self, val: super::vals::Lserdy) {
22380 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
22381 }
22382 #[doc = "External low-speed oscillator enable bit"]
22383 pub const fn lseon(&self) -> super::vals::Csslseon {
22384 let val = (self.0 >> 8usize) & 0x01;
22385 super::vals::Csslseon(val as u8)
22386 }
22387 #[doc = "External low-speed oscillator enable bit"]
22388 pub fn set_lseon(&mut self, val: super::vals::Csslseon) {
22389 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
22390 }
22391 #[doc = "External low-speed oscillator ready bit"]
22392 pub const fn lserdy(&self) -> super::vals::Lserdy {
22393 let val = (self.0 >> 9usize) & 0x01;
22394 super::vals::Lserdy(val as u8)
22395 }
22396 #[doc = "External low-speed oscillator ready bit"]
22397 pub fn set_lserdy(&mut self, val: super::vals::Lserdy) {
22398 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
22399 }
22400 #[doc = "External low-speed oscillator bypass bit"]
22401 pub const fn lsebyp(&self) -> super::vals::Lsebyp {
22402 let val = (self.0 >> 10usize) & 0x01;
22403 super::vals::Lsebyp(val as u8)
22404 }
22405 #[doc = "External low-speed oscillator bypass bit"]
22406 pub fn set_lsebyp(&mut self, val: super::vals::Lsebyp) {
22407 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
22408 }
22409 #[doc = "LSEDRV"]
22410 pub const fn lsedrv(&self) -> super::vals::Lsedrv {
22411 let val = (self.0 >> 11usize) & 0x03;
22412 super::vals::Lsedrv(val as u8)
22413 }
22414 #[doc = "LSEDRV"]
22415 pub fn set_lsedrv(&mut self, val: super::vals::Lsedrv) {
22416 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize);
22417 }
22418 #[doc = "CSSLSEON"]
22419 pub const fn csslseon(&self) -> super::vals::Csslseon {
23503 let val = (self.0 >> 13usize) & 0x01; 22420 let val = (self.0 >> 13usize) & 0x01;
23504 super::vals::Crc(val as u8) 22421 super::vals::Csslseon(val as u8)
23505 } 22422 }
23506 #[doc = "32-bit CRC polynomial configuration"] 22423 #[doc = "CSSLSEON"]
23507 pub fn set_crc33_17(&mut self, val: super::vals::Crc) { 22424 pub fn set_csslseon(&mut self, val: super::vals::Csslseon) {
23508 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize); 22425 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
23509 } 22426 }
23510 #[doc = "CRC calculation initialization pattern control for receiver"] 22427 #[doc = "CSS on LSE failure detection flag"]
23511 pub const fn rcrcini(&self) -> super::vals::Rcrcini { 22428 pub const fn csslsed(&self) -> super::vals::Csslsed {
23512 let val = (self.0 >> 14usize) & 0x01; 22429 let val = (self.0 >> 14usize) & 0x01;
23513 super::vals::Rcrcini(val as u8) 22430 super::vals::Csslsed(val as u8)
23514 } 22431 }
23515 #[doc = "CRC calculation initialization pattern control for receiver"] 22432 #[doc = "CSS on LSE failure detection flag"]
23516 pub fn set_rcrcini(&mut self, val: super::vals::Rcrcini) { 22433 pub fn set_csslsed(&mut self, val: super::vals::Csslsed) {
23517 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 22434 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
23518 } 22435 }
23519 #[doc = "CRC calculation initialization pattern control for transmitter"] 22436 #[doc = "RTC and LCD clock source selection bits"]
23520 pub const fn tcrcini(&self) -> super::vals::Tcrcini { 22437 pub const fn rtcsel(&self) -> super::vals::Rtcsel {
23521 let val = (self.0 >> 15usize) & 0x01; 22438 let val = (self.0 >> 16usize) & 0x03;
23522 super::vals::Tcrcini(val as u8) 22439 super::vals::Rtcsel(val as u8)
23523 } 22440 }
23524 #[doc = "CRC calculation initialization pattern control for transmitter"] 22441 #[doc = "RTC and LCD clock source selection bits"]
23525 pub fn set_tcrcini(&mut self, val: super::vals::Tcrcini) { 22442 pub fn set_rtcsel(&mut self, val: super::vals::Rtcsel) {
23526 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 22443 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
23527 } 22444 }
23528 #[doc = "Locking the AF configuration of associated IOs"] 22445 #[doc = "RTC clock enable bit"]
23529 pub const fn iolock(&self) -> bool { 22446 pub const fn rtcen(&self) -> super::vals::Rtcen {
23530 let val = (self.0 >> 16usize) & 0x01; 22447 let val = (self.0 >> 18usize) & 0x01;
22448 super::vals::Rtcen(val as u8)
22449 }
22450 #[doc = "RTC clock enable bit"]
22451 pub fn set_rtcen(&mut self, val: super::vals::Rtcen) {
22452 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
22453 }
22454 #[doc = "RTC software reset bit"]
22455 pub const fn rtcrst(&self) -> bool {
22456 let val = (self.0 >> 19usize) & 0x01;
23531 val != 0 22457 val != 0
23532 } 22458 }
23533 #[doc = "Locking the AF configuration of associated IOs"] 22459 #[doc = "RTC software reset bit"]
23534 pub fn set_iolock(&mut self, val: bool) { 22460 pub fn set_rtcrst(&mut self, val: bool) {
23535 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 22461 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
22462 }
22463 #[doc = "Remove reset flag"]
22464 pub const fn rmvf(&self) -> bool {
22465 let val = (self.0 >> 24usize) & 0x01;
22466 val != 0
22467 }
22468 #[doc = "Remove reset flag"]
22469 pub fn set_rmvf(&mut self, val: bool) {
22470 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
22471 }
22472 #[doc = "OBLRSTF"]
22473 pub const fn oblrstf(&self) -> bool {
22474 let val = (self.0 >> 25usize) & 0x01;
22475 val != 0
22476 }
22477 #[doc = "OBLRSTF"]
22478 pub fn set_oblrstf(&mut self, val: bool) {
22479 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
22480 }
22481 #[doc = "PIN reset flag"]
22482 pub const fn pinrstf(&self) -> bool {
22483 let val = (self.0 >> 26usize) & 0x01;
22484 val != 0
22485 }
22486 #[doc = "PIN reset flag"]
22487 pub fn set_pinrstf(&mut self, val: bool) {
22488 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
22489 }
22490 #[doc = "POR/PDR reset flag"]
22491 pub const fn porrstf(&self) -> bool {
22492 let val = (self.0 >> 27usize) & 0x01;
22493 val != 0
22494 }
22495 #[doc = "POR/PDR reset flag"]
22496 pub fn set_porrstf(&mut self, val: bool) {
22497 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
22498 }
22499 #[doc = "Software reset flag"]
22500 pub const fn sftrstf(&self) -> bool {
22501 let val = (self.0 >> 28usize) & 0x01;
22502 val != 0
22503 }
22504 #[doc = "Software reset flag"]
22505 pub fn set_sftrstf(&mut self, val: bool) {
22506 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
22507 }
22508 #[doc = "Independent watchdog reset flag"]
22509 pub const fn iwdgrstf(&self) -> bool {
22510 let val = (self.0 >> 29usize) & 0x01;
22511 val != 0
22512 }
22513 #[doc = "Independent watchdog reset flag"]
22514 pub fn set_iwdgrstf(&mut self, val: bool) {
22515 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
22516 }
22517 #[doc = "Window watchdog reset flag"]
22518 pub const fn wwdgrstf(&self) -> bool {
22519 let val = (self.0 >> 30usize) & 0x01;
22520 val != 0
22521 }
22522 #[doc = "Window watchdog reset flag"]
22523 pub fn set_wwdgrstf(&mut self, val: bool) {
22524 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
22525 }
22526 #[doc = "Low-power reset flag"]
22527 pub const fn lpwrrstf(&self) -> bool {
22528 let val = (self.0 >> 31usize) & 0x01;
22529 val != 0
22530 }
22531 #[doc = "Low-power reset flag"]
22532 pub fn set_lpwrrstf(&mut self, val: bool) {
22533 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
23536 } 22534 }
23537 } 22535 }
23538 impl Default for Cr1 { 22536 impl Default for Csr {
23539 fn default() -> Cr1 { 22537 fn default() -> Csr {
23540 Cr1(0) 22538 Csr(0)
23541 } 22539 }
23542 } 22540 }
23543 #[doc = "Receiver CRC Register"] 22541 #[doc = "Clock recovery RC register"]
23544 #[repr(transparent)] 22542 #[repr(transparent)]
23545 #[derive(Copy, Clone, Eq, PartialEq)] 22543 #[derive(Copy, Clone, Eq, PartialEq)]
23546 pub struct Rxcrc(pub u32); 22544 pub struct Crrcr(pub u32);
23547 impl Rxcrc { 22545 impl Crrcr {
23548 #[doc = "CRC register for receiver"] 22546 #[doc = "48MHz HSI clock enable bit"]
23549 pub const fn rxcrc(&self) -> u32 { 22547 pub const fn hsi48on(&self) -> bool {
23550 let val = (self.0 >> 0usize) & 0xffff_ffff; 22548 let val = (self.0 >> 0usize) & 0x01;
23551 val as u32 22549 val != 0
23552 } 22550 }
23553 #[doc = "CRC register for receiver"] 22551 #[doc = "48MHz HSI clock enable bit"]
23554 pub fn set_rxcrc(&mut self, val: u32) { 22552 pub fn set_hsi48on(&mut self, val: bool) {
23555 self.0 = 22553 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23556 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 22554 }
22555 #[doc = "48MHz HSI clock ready flag"]
22556 pub const fn hsi48rdy(&self) -> bool {
22557 let val = (self.0 >> 1usize) & 0x01;
22558 val != 0
22559 }
22560 #[doc = "48MHz HSI clock ready flag"]
22561 pub fn set_hsi48rdy(&mut self, val: bool) {
22562 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
22563 }
22564 #[doc = "48 MHz HSI clock divided by 6 output enable"]
22565 pub const fn hsi48div6en(&self) -> bool {
22566 let val = (self.0 >> 2usize) & 0x01;
22567 val != 0
22568 }
22569 #[doc = "48 MHz HSI clock divided by 6 output enable"]
22570 pub fn set_hsi48div6en(&mut self, val: bool) {
22571 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
22572 }
22573 #[doc = "48 MHz HSI clock calibration"]
22574 pub const fn hsi48cal(&self) -> u8 {
22575 let val = (self.0 >> 8usize) & 0xff;
22576 val as u8
22577 }
22578 #[doc = "48 MHz HSI clock calibration"]
22579 pub fn set_hsi48cal(&mut self, val: u8) {
22580 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
23557 } 22581 }
23558 } 22582 }
23559 impl Default for Rxcrc { 22583 impl Default for Crrcr {
23560 fn default() -> Rxcrc { 22584 fn default() -> Crrcr {
23561 Rxcrc(0) 22585 Crrcr(0)
23562 } 22586 }
23563 } 22587 }
23564 #[doc = "Transmit Data Register"] 22588 #[doc = "AHB peripheral clock enable register"]
23565 #[repr(transparent)] 22589 #[repr(transparent)]
23566 #[derive(Copy, Clone, Eq, PartialEq)] 22590 #[derive(Copy, Clone, Eq, PartialEq)]
23567 pub struct Txdr(pub u32); 22591 pub struct Ahbenr(pub u32);
23568 impl Txdr { 22592 impl Ahbenr {
23569 #[doc = "Transmit data register"] 22593 #[doc = "DMA clock enable bit"]
23570 pub const fn txdr(&self) -> u32 { 22594 pub const fn dmaen(&self) -> super::vals::Crypen {
23571 let val = (self.0 >> 0usize) & 0xffff_ffff; 22595 let val = (self.0 >> 0usize) & 0x01;
23572 val as u32 22596 super::vals::Crypen(val as u8)
23573 } 22597 }
23574 #[doc = "Transmit data register"] 22598 #[doc = "DMA clock enable bit"]
23575 pub fn set_txdr(&mut self, val: u32) { 22599 pub fn set_dmaen(&mut self, val: super::vals::Crypen) {
23576 self.0 = 22600 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23577 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 22601 }
22602 #[doc = "NVM interface clock enable bit"]
22603 pub const fn mifen(&self) -> super::vals::Crypen {
22604 let val = (self.0 >> 8usize) & 0x01;
22605 super::vals::Crypen(val as u8)
22606 }
22607 #[doc = "NVM interface clock enable bit"]
22608 pub fn set_mifen(&mut self, val: super::vals::Crypen) {
22609 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
22610 }
22611 #[doc = "CRC clock enable bit"]
22612 pub const fn crcen(&self) -> super::vals::Crypen {
22613 let val = (self.0 >> 12usize) & 0x01;
22614 super::vals::Crypen(val as u8)
22615 }
22616 #[doc = "CRC clock enable bit"]
22617 pub fn set_crcen(&mut self, val: super::vals::Crypen) {
22618 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
22619 }
22620 #[doc = "Touch Sensing clock enable bit"]
22621 pub const fn touchen(&self) -> super::vals::Crypen {
22622 let val = (self.0 >> 16usize) & 0x01;
22623 super::vals::Crypen(val as u8)
22624 }
22625 #[doc = "Touch Sensing clock enable bit"]
22626 pub fn set_touchen(&mut self, val: super::vals::Crypen) {
22627 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
22628 }
22629 #[doc = "Random Number Generator clock enable bit"]
22630 pub const fn rngen(&self) -> super::vals::Crypen {
22631 let val = (self.0 >> 20usize) & 0x01;
22632 super::vals::Crypen(val as u8)
22633 }
22634 #[doc = "Random Number Generator clock enable bit"]
22635 pub fn set_rngen(&mut self, val: super::vals::Crypen) {
22636 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
22637 }
22638 #[doc = "Crypto clock enable bit"]
22639 pub const fn crypen(&self) -> super::vals::Crypen {
22640 let val = (self.0 >> 24usize) & 0x01;
22641 super::vals::Crypen(val as u8)
22642 }
22643 #[doc = "Crypto clock enable bit"]
22644 pub fn set_crypen(&mut self, val: super::vals::Crypen) {
22645 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
23578 } 22646 }
23579 } 22647 }
23580 impl Default for Txdr { 22648 impl Default for Ahbenr {
23581 fn default() -> Txdr { 22649 fn default() -> Ahbenr {
23582 Txdr(0) 22650 Ahbenr(0)
23583 } 22651 }
23584 } 22652 }
23585 #[doc = "control register 2"] 22653 #[doc = "GPIO clock enable in sleep mode register"]
23586 #[repr(transparent)] 22654 #[repr(transparent)]
23587 #[derive(Copy, Clone, Eq, PartialEq)] 22655 #[derive(Copy, Clone, Eq, PartialEq)]
23588 pub struct Cr2(pub u32); 22656 pub struct Iopsmen(pub u32);
23589 impl Cr2 { 22657 impl Iopsmen {
23590 #[doc = "Number of data at current transfer"] 22658 #[doc = "IOPASMEN"]
23591 pub const fn tsize(&self) -> u16 { 22659 pub const fn iopasmen(&self) -> super::vals::Iophsmen {
23592 let val = (self.0 >> 0usize) & 0xffff; 22660 let val = (self.0 >> 0usize) & 0x01;
23593 val as u16 22661 super::vals::Iophsmen(val as u8)
23594 } 22662 }
23595 #[doc = "Number of data at current transfer"] 22663 #[doc = "IOPASMEN"]
23596 pub fn set_tsize(&mut self, val: u16) { 22664 pub fn set_iopasmen(&mut self, val: super::vals::Iophsmen) {
23597 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 22665 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23598 } 22666 }
23599 #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] 22667 #[doc = "IOPBSMEN"]
23600 pub const fn tser(&self) -> u16 { 22668 pub const fn iopbsmen(&self) -> super::vals::Iophsmen {
23601 let val = (self.0 >> 16usize) & 0xffff; 22669 let val = (self.0 >> 1usize) & 0x01;
23602 val as u16 22670 super::vals::Iophsmen(val as u8)
23603 } 22671 }
23604 #[doc = "Number of data transfer extension to be reload into TSIZE just when a previous"] 22672 #[doc = "IOPBSMEN"]
23605 pub fn set_tser(&mut self, val: u16) { 22673 pub fn set_iopbsmen(&mut self, val: super::vals::Iophsmen) {
23606 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize); 22674 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
22675 }
22676 #[doc = "IOPCSMEN"]
22677 pub const fn iopcsmen(&self) -> super::vals::Iophsmen {
22678 let val = (self.0 >> 2usize) & 0x01;
22679 super::vals::Iophsmen(val as u8)
22680 }
22681 #[doc = "IOPCSMEN"]
22682 pub fn set_iopcsmen(&mut self, val: super::vals::Iophsmen) {
22683 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
22684 }
22685 #[doc = "IOPDSMEN"]
22686 pub const fn iopdsmen(&self) -> super::vals::Iophsmen {
22687 let val = (self.0 >> 3usize) & 0x01;
22688 super::vals::Iophsmen(val as u8)
22689 }
22690 #[doc = "IOPDSMEN"]
22691 pub fn set_iopdsmen(&mut self, val: super::vals::Iophsmen) {
22692 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
22693 }
22694 #[doc = "Port E clock enable during Sleep mode bit"]
22695 pub const fn iopesmen(&self) -> super::vals::Iophsmen {
22696 let val = (self.0 >> 4usize) & 0x01;
22697 super::vals::Iophsmen(val as u8)
22698 }
22699 #[doc = "Port E clock enable during Sleep mode bit"]
22700 pub fn set_iopesmen(&mut self, val: super::vals::Iophsmen) {
22701 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
22702 }
22703 #[doc = "IOPHSMEN"]
22704 pub const fn iophsmen(&self) -> super::vals::Iophsmen {
22705 let val = (self.0 >> 7usize) & 0x01;
22706 super::vals::Iophsmen(val as u8)
22707 }
22708 #[doc = "IOPHSMEN"]
22709 pub fn set_iophsmen(&mut self, val: super::vals::Iophsmen) {
22710 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
23607 } 22711 }
23608 } 22712 }
23609 impl Default for Cr2 { 22713 impl Default for Iopsmen {
23610 fn default() -> Cr2 { 22714 fn default() -> Iopsmen {
23611 Cr2(0) 22715 Iopsmen(0)
23612 } 22716 }
23613 } 22717 }
23614 #[doc = "configuration register 1"] 22718 #[doc = "Clock configuration register"]
23615 #[repr(transparent)] 22719 #[repr(transparent)]
23616 #[derive(Copy, Clone, Eq, PartialEq)] 22720 #[derive(Copy, Clone, Eq, PartialEq)]
23617 pub struct Cfg1(pub u32); 22721 pub struct Ccipr(pub u32);
23618 impl Cfg1 { 22722 impl Ccipr {
23619 #[doc = "Number of bits in at single SPI data frame"] 22723 #[doc = "USART1 clock source selection bits"]
23620 pub const fn dsize(&self) -> u8 { 22724 pub const fn usart1sel(&self) -> super::vals::Lpuartsel {
23621 let val = (self.0 >> 0usize) & 0x1f; 22725 let val = (self.0 >> 0usize) & 0x03;
23622 val as u8 22726 super::vals::Lpuartsel(val as u8)
23623 } 22727 }
23624 #[doc = "Number of bits in at single SPI data frame"] 22728 #[doc = "USART1 clock source selection bits"]
23625 pub fn set_dsize(&mut self, val: u8) { 22729 pub fn set_usart1sel(&mut self, val: super::vals::Lpuartsel) {
23626 self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize); 22730 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
23627 } 22731 }
23628 #[doc = "threshold level"] 22732 #[doc = "USART2 clock source selection bits"]
23629 pub const fn fthlv(&self) -> super::vals::Fthlv { 22733 pub const fn usart2sel(&self) -> super::vals::Lpuartsel {
23630 let val = (self.0 >> 5usize) & 0x0f; 22734 let val = (self.0 >> 2usize) & 0x03;
23631 super::vals::Fthlv(val as u8) 22735 super::vals::Lpuartsel(val as u8)
23632 } 22736 }
23633 #[doc = "threshold level"] 22737 #[doc = "USART2 clock source selection bits"]
23634 pub fn set_fthlv(&mut self, val: super::vals::Fthlv) { 22738 pub fn set_usart2sel(&mut self, val: super::vals::Lpuartsel) {
23635 self.0 = (self.0 & !(0x0f << 5usize)) | (((val.0 as u32) & 0x0f) << 5usize); 22739 self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize);
23636 } 22740 }
23637 #[doc = "Behavior of slave transmitter at underrun condition"] 22741 #[doc = "LPUART1 clock source selection bits"]
23638 pub const fn udrcfg(&self) -> super::vals::Udrcfg { 22742 pub const fn lpuart1sel(&self) -> super::vals::Lpuartsel {
23639 let val = (self.0 >> 9usize) & 0x03; 22743 let val = (self.0 >> 10usize) & 0x03;
23640 super::vals::Udrcfg(val as u8) 22744 super::vals::Lpuartsel(val as u8)
23641 } 22745 }
23642 #[doc = "Behavior of slave transmitter at underrun condition"] 22746 #[doc = "LPUART1 clock source selection bits"]
23643 pub fn set_udrcfg(&mut self, val: super::vals::Udrcfg) { 22747 pub fn set_lpuart1sel(&mut self, val: super::vals::Lpuartsel) {
23644 self.0 = (self.0 & !(0x03 << 9usize)) | (((val.0 as u32) & 0x03) << 9usize); 22748 self.0 = (self.0 & !(0x03 << 10usize)) | (((val.0 as u32) & 0x03) << 10usize);
23645 } 22749 }
23646 #[doc = "Detection of underrun condition at slave transmitter"] 22750 #[doc = "I2C1 clock source selection bits"]
23647 pub const fn udrdet(&self) -> super::vals::Udrdet { 22751 pub const fn i2c1sel(&self) -> super::vals::Icsel {
23648 let val = (self.0 >> 11usize) & 0x03; 22752 let val = (self.0 >> 12usize) & 0x03;
23649 super::vals::Udrdet(val as u8) 22753 super::vals::Icsel(val as u8)
23650 } 22754 }
23651 #[doc = "Detection of underrun condition at slave transmitter"] 22755 #[doc = "I2C1 clock source selection bits"]
23652 pub fn set_udrdet(&mut self, val: super::vals::Udrdet) { 22756 pub fn set_i2c1sel(&mut self, val: super::vals::Icsel) {
23653 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize); 22757 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
23654 } 22758 }
23655 #[doc = "Rx DMA stream enable"] 22759 #[doc = "I2C3 clock source selection bits"]
23656 pub const fn rxdmaen(&self) -> bool { 22760 pub const fn i2c3sel(&self) -> super::vals::Icsel {
23657 let val = (self.0 >> 14usize) & 0x01; 22761 let val = (self.0 >> 16usize) & 0x03;
22762 super::vals::Icsel(val as u8)
22763 }
22764 #[doc = "I2C3 clock source selection bits"]
22765 pub fn set_i2c3sel(&mut self, val: super::vals::Icsel) {
22766 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
22767 }
22768 #[doc = "Low Power Timer clock source selection bits"]
22769 pub const fn lptim1sel(&self) -> super::vals::Lptimsel {
22770 let val = (self.0 >> 18usize) & 0x03;
22771 super::vals::Lptimsel(val as u8)
22772 }
22773 #[doc = "Low Power Timer clock source selection bits"]
22774 pub fn set_lptim1sel(&mut self, val: super::vals::Lptimsel) {
22775 self.0 = (self.0 & !(0x03 << 18usize)) | (((val.0 as u32) & 0x03) << 18usize);
22776 }
22777 #[doc = "48 MHz HSI48 clock source selection bit"]
22778 pub const fn hsi48msel(&self) -> bool {
22779 let val = (self.0 >> 26usize) & 0x01;
23658 val != 0 22780 val != 0
23659 } 22781 }
23660 #[doc = "Rx DMA stream enable"] 22782 #[doc = "48 MHz HSI48 clock source selection bit"]
23661 pub fn set_rxdmaen(&mut self, val: bool) { 22783 pub fn set_hsi48msel(&mut self, val: bool) {
23662 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 22784 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
23663 } 22785 }
23664 #[doc = "Tx DMA stream enable"] 22786 }
23665 pub const fn txdmaen(&self) -> bool { 22787 impl Default for Ccipr {
23666 let val = (self.0 >> 15usize) & 0x01; 22788 fn default() -> Ccipr {
22789 Ccipr(0)
22790 }
22791 }
22792 #[doc = "Clock control register"]
22793 #[repr(transparent)]
22794 #[derive(Copy, Clone, Eq, PartialEq)]
22795 pub struct Cr(pub u32);
22796 impl Cr {
22797 #[doc = "16 MHz high-speed internal clock enable"]
22798 pub const fn hsi16on(&self) -> super::vals::Pllon {
22799 let val = (self.0 >> 0usize) & 0x01;
22800 super::vals::Pllon(val as u8)
22801 }
22802 #[doc = "16 MHz high-speed internal clock enable"]
22803 pub fn set_hsi16on(&mut self, val: super::vals::Pllon) {
22804 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
22805 }
22806 #[doc = "High-speed internal clock enable bit for some IP kernels"]
22807 pub const fn hsi16keron(&self) -> super::vals::Pllon {
22808 let val = (self.0 >> 1usize) & 0x01;
22809 super::vals::Pllon(val as u8)
22810 }
22811 #[doc = "High-speed internal clock enable bit for some IP kernels"]
22812 pub fn set_hsi16keron(&mut self, val: super::vals::Pllon) {
22813 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
22814 }
22815 #[doc = "Internal high-speed clock ready flag"]
22816 pub const fn hsi16rdyf(&self) -> bool {
22817 let val = (self.0 >> 2usize) & 0x01;
23667 val != 0 22818 val != 0
23668 } 22819 }
23669 #[doc = "Tx DMA stream enable"] 22820 #[doc = "Internal high-speed clock ready flag"]
23670 pub fn set_txdmaen(&mut self, val: bool) { 22821 pub fn set_hsi16rdyf(&mut self, val: bool) {
23671 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); 22822 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
23672 } 22823 }
23673 #[doc = "Length of CRC frame to be transacted and compared"] 22824 #[doc = "HSI16DIVEN"]
23674 pub const fn crcsize(&self) -> u8 { 22825 pub const fn hsi16diven(&self) -> super::vals::Hsidiven {
23675 let val = (self.0 >> 16usize) & 0x1f; 22826 let val = (self.0 >> 3usize) & 0x01;
23676 val as u8 22827 super::vals::Hsidiven(val as u8)
23677 } 22828 }
23678 #[doc = "Length of CRC frame to be transacted and compared"] 22829 #[doc = "HSI16DIVEN"]
23679 pub fn set_crcsize(&mut self, val: u8) { 22830 pub fn set_hsi16diven(&mut self, val: super::vals::Hsidiven) {
23680 self.0 = (self.0 & !(0x1f << 16usize)) | (((val as u32) & 0x1f) << 16usize); 22831 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
23681 } 22832 }
23682 #[doc = "Hardware CRC computation enable"] 22833 #[doc = "HSI16DIVF"]
23683 pub const fn crcen(&self) -> bool { 22834 pub const fn hsi16divf(&self) -> bool {
22835 let val = (self.0 >> 4usize) & 0x01;
22836 val != 0
22837 }
22838 #[doc = "HSI16DIVF"]
22839 pub fn set_hsi16divf(&mut self, val: bool) {
22840 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
22841 }
22842 #[doc = "16 MHz high-speed internal clock output enable"]
22843 pub const fn hsi16outen(&self) -> super::vals::Hsiouten {
22844 let val = (self.0 >> 5usize) & 0x01;
22845 super::vals::Hsiouten(val as u8)
22846 }
22847 #[doc = "16 MHz high-speed internal clock output enable"]
22848 pub fn set_hsi16outen(&mut self, val: super::vals::Hsiouten) {
22849 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
22850 }
22851 #[doc = "MSI clock enable bit"]
22852 pub const fn msion(&self) -> super::vals::Pllon {
22853 let val = (self.0 >> 8usize) & 0x01;
22854 super::vals::Pllon(val as u8)
22855 }
22856 #[doc = "MSI clock enable bit"]
22857 pub fn set_msion(&mut self, val: super::vals::Pllon) {
22858 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
22859 }
22860 #[doc = "MSI clock ready flag"]
22861 pub const fn msirdy(&self) -> bool {
22862 let val = (self.0 >> 9usize) & 0x01;
22863 val != 0
22864 }
22865 #[doc = "MSI clock ready flag"]
22866 pub fn set_msirdy(&mut self, val: bool) {
22867 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
22868 }
22869 #[doc = "HSE clock enable bit"]
22870 pub const fn hseon(&self) -> super::vals::Pllon {
22871 let val = (self.0 >> 16usize) & 0x01;
22872 super::vals::Pllon(val as u8)
22873 }
22874 #[doc = "HSE clock enable bit"]
22875 pub fn set_hseon(&mut self, val: super::vals::Pllon) {
22876 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
22877 }
22878 #[doc = "HSE clock ready flag"]
22879 pub const fn hserdy(&self) -> bool {
22880 let val = (self.0 >> 17usize) & 0x01;
22881 val != 0
22882 }
22883 #[doc = "HSE clock ready flag"]
22884 pub fn set_hserdy(&mut self, val: bool) {
22885 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
22886 }
22887 #[doc = "HSE clock bypass bit"]
22888 pub const fn hsebyp(&self) -> super::vals::Hsebyp {
22889 let val = (self.0 >> 18usize) & 0x01;
22890 super::vals::Hsebyp(val as u8)
22891 }
22892 #[doc = "HSE clock bypass bit"]
22893 pub fn set_hsebyp(&mut self, val: super::vals::Hsebyp) {
22894 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
22895 }
22896 #[doc = "Clock security system on HSE enable bit"]
22897 pub const fn csshseon(&self) -> super::vals::Pllon {
22898 let val = (self.0 >> 19usize) & 0x01;
22899 super::vals::Pllon(val as u8)
22900 }
22901 #[doc = "Clock security system on HSE enable bit"]
22902 pub fn set_csshseon(&mut self, val: super::vals::Pllon) {
22903 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
22904 }
22905 #[doc = "TC/LCD prescaler"]
22906 pub const fn rtcpre(&self) -> super::vals::Rtcpre {
22907 let val = (self.0 >> 20usize) & 0x03;
22908 super::vals::Rtcpre(val as u8)
22909 }
22910 #[doc = "TC/LCD prescaler"]
22911 pub fn set_rtcpre(&mut self, val: super::vals::Rtcpre) {
22912 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
22913 }
22914 #[doc = "PLL enable bit"]
22915 pub const fn pllon(&self) -> super::vals::Pllon {
22916 let val = (self.0 >> 24usize) & 0x01;
22917 super::vals::Pllon(val as u8)
22918 }
22919 #[doc = "PLL enable bit"]
22920 pub fn set_pllon(&mut self, val: super::vals::Pllon) {
22921 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
22922 }
22923 #[doc = "PLL clock ready flag"]
22924 pub const fn pllrdy(&self) -> bool {
22925 let val = (self.0 >> 25usize) & 0x01;
22926 val != 0
22927 }
22928 #[doc = "PLL clock ready flag"]
22929 pub fn set_pllrdy(&mut self, val: bool) {
22930 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
22931 }
22932 }
22933 impl Default for Cr {
22934 fn default() -> Cr {
22935 Cr(0)
22936 }
22937 }
22938 #[doc = "APB2 peripheral clock enable register"]
22939 #[repr(transparent)]
22940 #[derive(Copy, Clone, Eq, PartialEq)]
22941 pub struct Apb2enr(pub u32);
22942 impl Apb2enr {
22943 #[doc = "System configuration controller clock enable bit"]
22944 pub const fn syscfgen(&self) -> super::vals::Dbgen {
22945 let val = (self.0 >> 0usize) & 0x01;
22946 super::vals::Dbgen(val as u8)
22947 }
22948 #[doc = "System configuration controller clock enable bit"]
22949 pub fn set_syscfgen(&mut self, val: super::vals::Dbgen) {
22950 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
22951 }
22952 #[doc = "TIM21 timer clock enable bit"]
22953 pub const fn tim21en(&self) -> super::vals::Dbgen {
22954 let val = (self.0 >> 2usize) & 0x01;
22955 super::vals::Dbgen(val as u8)
22956 }
22957 #[doc = "TIM21 timer clock enable bit"]
22958 pub fn set_tim21en(&mut self, val: super::vals::Dbgen) {
22959 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
22960 }
22961 #[doc = "TIM22 timer clock enable bit"]
22962 pub const fn tim22en(&self) -> super::vals::Dbgen {
22963 let val = (self.0 >> 5usize) & 0x01;
22964 super::vals::Dbgen(val as u8)
22965 }
22966 #[doc = "TIM22 timer clock enable bit"]
22967 pub fn set_tim22en(&mut self, val: super::vals::Dbgen) {
22968 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
22969 }
22970 #[doc = "MiFaRe Firewall clock enable bit"]
22971 pub const fn mifien(&self) -> super::vals::Dbgen {
22972 let val = (self.0 >> 7usize) & 0x01;
22973 super::vals::Dbgen(val as u8)
22974 }
22975 #[doc = "MiFaRe Firewall clock enable bit"]
22976 pub fn set_mifien(&mut self, val: super::vals::Dbgen) {
22977 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
22978 }
22979 #[doc = "ADC clock enable bit"]
22980 pub const fn adcen(&self) -> super::vals::Dbgen {
22981 let val = (self.0 >> 9usize) & 0x01;
22982 super::vals::Dbgen(val as u8)
22983 }
22984 #[doc = "ADC clock enable bit"]
22985 pub fn set_adcen(&mut self, val: super::vals::Dbgen) {
22986 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
22987 }
22988 #[doc = "SPI1 clock enable bit"]
22989 pub const fn spi1en(&self) -> super::vals::Dbgen {
22990 let val = (self.0 >> 12usize) & 0x01;
22991 super::vals::Dbgen(val as u8)
22992 }
22993 #[doc = "SPI1 clock enable bit"]
22994 pub fn set_spi1en(&mut self, val: super::vals::Dbgen) {
22995 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
22996 }
22997 #[doc = "USART1 clock enable bit"]
22998 pub const fn usart1en(&self) -> super::vals::Dbgen {
22999 let val = (self.0 >> 14usize) & 0x01;
23000 super::vals::Dbgen(val as u8)
23001 }
23002 #[doc = "USART1 clock enable bit"]
23003 pub fn set_usart1en(&mut self, val: super::vals::Dbgen) {
23004 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
23005 }
23006 #[doc = "DBG clock enable bit"]
23007 pub const fn dbgen(&self) -> super::vals::Dbgen {
23684 let val = (self.0 >> 22usize) & 0x01; 23008 let val = (self.0 >> 22usize) & 0x01;
23009 super::vals::Dbgen(val as u8)
23010 }
23011 #[doc = "DBG clock enable bit"]
23012 pub fn set_dbgen(&mut self, val: super::vals::Dbgen) {
23013 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
23014 }
23015 }
23016 impl Default for Apb2enr {
23017 fn default() -> Apb2enr {
23018 Apb2enr(0)
23019 }
23020 }
23021 #[doc = "GPIO reset register"]
23022 #[repr(transparent)]
23023 #[derive(Copy, Clone, Eq, PartialEq)]
23024 pub struct Ioprstr(pub u32);
23025 impl Ioprstr {
23026 #[doc = "I/O port A reset"]
23027 pub const fn ioparst(&self) -> super::vals::Iophrst {
23028 let val = (self.0 >> 0usize) & 0x01;
23029 super::vals::Iophrst(val as u8)
23030 }
23031 #[doc = "I/O port A reset"]
23032 pub fn set_ioparst(&mut self, val: super::vals::Iophrst) {
23033 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23034 }
23035 #[doc = "I/O port B reset"]
23036 pub const fn iopbrst(&self) -> super::vals::Iophrst {
23037 let val = (self.0 >> 1usize) & 0x01;
23038 super::vals::Iophrst(val as u8)
23039 }
23040 #[doc = "I/O port B reset"]
23041 pub fn set_iopbrst(&mut self, val: super::vals::Iophrst) {
23042 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
23043 }
23044 #[doc = "I/O port A reset"]
23045 pub const fn iopcrst(&self) -> super::vals::Iophrst {
23046 let val = (self.0 >> 2usize) & 0x01;
23047 super::vals::Iophrst(val as u8)
23048 }
23049 #[doc = "I/O port A reset"]
23050 pub fn set_iopcrst(&mut self, val: super::vals::Iophrst) {
23051 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
23052 }
23053 #[doc = "I/O port D reset"]
23054 pub const fn iopdrst(&self) -> super::vals::Iophrst {
23055 let val = (self.0 >> 3usize) & 0x01;
23056 super::vals::Iophrst(val as u8)
23057 }
23058 #[doc = "I/O port D reset"]
23059 pub fn set_iopdrst(&mut self, val: super::vals::Iophrst) {
23060 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
23061 }
23062 #[doc = "I/O port E reset"]
23063 pub const fn ioperst(&self) -> super::vals::Iophrst {
23064 let val = (self.0 >> 4usize) & 0x01;
23065 super::vals::Iophrst(val as u8)
23066 }
23067 #[doc = "I/O port E reset"]
23068 pub fn set_ioperst(&mut self, val: super::vals::Iophrst) {
23069 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
23070 }
23071 #[doc = "I/O port H reset"]
23072 pub const fn iophrst(&self) -> super::vals::Iophrst {
23073 let val = (self.0 >> 7usize) & 0x01;
23074 super::vals::Iophrst(val as u8)
23075 }
23076 #[doc = "I/O port H reset"]
23077 pub fn set_iophrst(&mut self, val: super::vals::Iophrst) {
23078 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
23079 }
23080 }
23081 impl Default for Ioprstr {
23082 fn default() -> Ioprstr {
23083 Ioprstr(0)
23084 }
23085 }
23086 #[doc = "Clock interrupt clear register"]
23087 #[repr(transparent)]
23088 #[derive(Copy, Clone, Eq, PartialEq)]
23089 pub struct Cicr(pub u32);
23090 impl Cicr {
23091 #[doc = "LSI ready Interrupt clear"]
23092 pub const fn lsirdyc(&self) -> bool {
23093 let val = (self.0 >> 0usize) & 0x01;
23685 val != 0 23094 val != 0
23686 } 23095 }
23687 #[doc = "Hardware CRC computation enable"] 23096 #[doc = "LSI ready Interrupt clear"]
23688 pub fn set_crcen(&mut self, val: bool) { 23097 pub fn set_lsirdyc(&mut self, val: bool) {
23689 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 23098 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23690 } 23099 }
23691 #[doc = "Master baud rate"] 23100 #[doc = "LSE ready Interrupt clear"]
23692 pub const fn mbr(&self) -> super::vals::Mbr { 23101 pub const fn lserdyc(&self) -> bool {
23693 let val = (self.0 >> 28usize) & 0x07; 23102 let val = (self.0 >> 1usize) & 0x01;
23694 super::vals::Mbr(val as u8) 23103 val != 0
23695 } 23104 }
23696 #[doc = "Master baud rate"] 23105 #[doc = "LSE ready Interrupt clear"]
23697 pub fn set_mbr(&mut self, val: super::vals::Mbr) { 23106 pub fn set_lserdyc(&mut self, val: bool) {
23698 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize); 23107 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
23108 }
23109 #[doc = "HSI16 ready Interrupt clear"]
23110 pub const fn hsi16rdyc(&self) -> bool {
23111 let val = (self.0 >> 2usize) & 0x01;
23112 val != 0
23113 }
23114 #[doc = "HSI16 ready Interrupt clear"]
23115 pub fn set_hsi16rdyc(&mut self, val: bool) {
23116 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
23117 }
23118 #[doc = "HSE ready Interrupt clear"]
23119 pub const fn hserdyc(&self) -> bool {
23120 let val = (self.0 >> 3usize) & 0x01;
23121 val != 0
23122 }
23123 #[doc = "HSE ready Interrupt clear"]
23124 pub fn set_hserdyc(&mut self, val: bool) {
23125 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
23126 }
23127 #[doc = "PLL ready Interrupt clear"]
23128 pub const fn pllrdyc(&self) -> bool {
23129 let val = (self.0 >> 4usize) & 0x01;
23130 val != 0
23131 }
23132 #[doc = "PLL ready Interrupt clear"]
23133 pub fn set_pllrdyc(&mut self, val: bool) {
23134 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
23135 }
23136 #[doc = "MSI ready Interrupt clear"]
23137 pub const fn msirdyc(&self) -> bool {
23138 let val = (self.0 >> 5usize) & 0x01;
23139 val != 0
23140 }
23141 #[doc = "MSI ready Interrupt clear"]
23142 pub fn set_msirdyc(&mut self, val: bool) {
23143 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
23144 }
23145 #[doc = "HSI48 ready Interrupt clear"]
23146 pub const fn hsi48rdyc(&self) -> bool {
23147 let val = (self.0 >> 6usize) & 0x01;
23148 val != 0
23149 }
23150 #[doc = "HSI48 ready Interrupt clear"]
23151 pub fn set_hsi48rdyc(&mut self, val: bool) {
23152 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
23153 }
23154 #[doc = "LSE Clock Security System Interrupt clear"]
23155 pub const fn csslsec(&self) -> bool {
23156 let val = (self.0 >> 7usize) & 0x01;
23157 val != 0
23158 }
23159 #[doc = "LSE Clock Security System Interrupt clear"]
23160 pub fn set_csslsec(&mut self, val: bool) {
23161 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
23162 }
23163 #[doc = "Clock Security System Interrupt clear"]
23164 pub const fn csshsec(&self) -> bool {
23165 let val = (self.0 >> 8usize) & 0x01;
23166 val != 0
23167 }
23168 #[doc = "Clock Security System Interrupt clear"]
23169 pub fn set_csshsec(&mut self, val: bool) {
23170 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
23699 } 23171 }
23700 } 23172 }
23701 impl Default for Cfg1 { 23173 impl Default for Cicr {
23702 fn default() -> Cfg1 { 23174 fn default() -> Cicr {
23703 Cfg1(0) 23175 Cicr(0)
23704 } 23176 }
23705 } 23177 }
23706 #[doc = "configuration register 2"] 23178 #[doc = "Internal clock sources calibration register"]
23707 #[repr(transparent)] 23179 #[repr(transparent)]
23708 #[derive(Copy, Clone, Eq, PartialEq)] 23180 #[derive(Copy, Clone, Eq, PartialEq)]
23709 pub struct Cfg2(pub u32); 23181 pub struct Icscr(pub u32);
23710 impl Cfg2 { 23182 impl Icscr {
23711 #[doc = "Master SS Idleness"] 23183 #[doc = "nternal high speed clock calibration"]
23712 pub const fn mssi(&self) -> u8 { 23184 pub const fn hsi16cal(&self) -> u8 {
23713 let val = (self.0 >> 0usize) & 0x0f; 23185 let val = (self.0 >> 0usize) & 0xff;
23714 val as u8 23186 val as u8
23715 } 23187 }
23716 #[doc = "Master SS Idleness"] 23188 #[doc = "nternal high speed clock calibration"]
23717 pub fn set_mssi(&mut self, val: u8) { 23189 pub fn set_hsi16cal(&mut self, val: u8) {
23718 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 23190 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
23719 } 23191 }
23720 #[doc = "Master Inter-Data Idleness"] 23192 #[doc = "High speed internal clock trimming"]
23721 pub const fn midi(&self) -> u8 { 23193 pub const fn hsi16trim(&self) -> u8 {
23722 let val = (self.0 >> 4usize) & 0x0f; 23194 let val = (self.0 >> 8usize) & 0x1f;
23723 val as u8 23195 val as u8
23724 } 23196 }
23725 #[doc = "Master Inter-Data Idleness"] 23197 #[doc = "High speed internal clock trimming"]
23726 pub fn set_midi(&mut self, val: u8) { 23198 pub fn set_hsi16trim(&mut self, val: u8) {
23727 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); 23199 self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize);
23728 } 23200 }
23729 #[doc = "Swap functionality of MISO and MOSI pins"] 23201 #[doc = "MSI clock ranges"]
23730 pub const fn ioswp(&self) -> bool { 23202 pub const fn msirange(&self) -> super::vals::Msirange {
23731 let val = (self.0 >> 15usize) & 0x01; 23203 let val = (self.0 >> 13usize) & 0x07;
23204 super::vals::Msirange(val as u8)
23205 }
23206 #[doc = "MSI clock ranges"]
23207 pub fn set_msirange(&mut self, val: super::vals::Msirange) {
23208 self.0 = (self.0 & !(0x07 << 13usize)) | (((val.0 as u32) & 0x07) << 13usize);
23209 }
23210 #[doc = "MSI clock calibration"]
23211 pub const fn msical(&self) -> u8 {
23212 let val = (self.0 >> 16usize) & 0xff;
23213 val as u8
23214 }
23215 #[doc = "MSI clock calibration"]
23216 pub fn set_msical(&mut self, val: u8) {
23217 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
23218 }
23219 #[doc = "MSI clock trimming"]
23220 pub const fn msitrim(&self) -> u8 {
23221 let val = (self.0 >> 24usize) & 0xff;
23222 val as u8
23223 }
23224 #[doc = "MSI clock trimming"]
23225 pub fn set_msitrim(&mut self, val: u8) {
23226 self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
23227 }
23228 }
23229 impl Default for Icscr {
23230 fn default() -> Icscr {
23231 Icscr(0)
23232 }
23233 }
23234 #[doc = "GPIO clock enable register"]
23235 #[repr(transparent)]
23236 #[derive(Copy, Clone, Eq, PartialEq)]
23237 pub struct Iopenr(pub u32);
23238 impl Iopenr {
23239 #[doc = "IO port A clock enable bit"]
23240 pub const fn iopaen(&self) -> super::vals::Iophen {
23241 let val = (self.0 >> 0usize) & 0x01;
23242 super::vals::Iophen(val as u8)
23243 }
23244 #[doc = "IO port A clock enable bit"]
23245 pub fn set_iopaen(&mut self, val: super::vals::Iophen) {
23246 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23247 }
23248 #[doc = "IO port B clock enable bit"]
23249 pub const fn iopben(&self) -> super::vals::Iophen {
23250 let val = (self.0 >> 1usize) & 0x01;
23251 super::vals::Iophen(val as u8)
23252 }
23253 #[doc = "IO port B clock enable bit"]
23254 pub fn set_iopben(&mut self, val: super::vals::Iophen) {
23255 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
23256 }
23257 #[doc = "IO port A clock enable bit"]
23258 pub const fn iopcen(&self) -> super::vals::Iophen {
23259 let val = (self.0 >> 2usize) & 0x01;
23260 super::vals::Iophen(val as u8)
23261 }
23262 #[doc = "IO port A clock enable bit"]
23263 pub fn set_iopcen(&mut self, val: super::vals::Iophen) {
23264 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
23265 }
23266 #[doc = "I/O port D clock enable bit"]
23267 pub const fn iopden(&self) -> super::vals::Iophen {
23268 let val = (self.0 >> 3usize) & 0x01;
23269 super::vals::Iophen(val as u8)
23270 }
23271 #[doc = "I/O port D clock enable bit"]
23272 pub fn set_iopden(&mut self, val: super::vals::Iophen) {
23273 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
23274 }
23275 #[doc = "I/O port E clock enable bit"]
23276 pub const fn iopeen(&self) -> super::vals::Iophen {
23277 let val = (self.0 >> 4usize) & 0x01;
23278 super::vals::Iophen(val as u8)
23279 }
23280 #[doc = "I/O port E clock enable bit"]
23281 pub fn set_iopeen(&mut self, val: super::vals::Iophen) {
23282 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
23283 }
23284 #[doc = "I/O port H clock enable bit"]
23285 pub const fn iophen(&self) -> super::vals::Iophen {
23286 let val = (self.0 >> 7usize) & 0x01;
23287 super::vals::Iophen(val as u8)
23288 }
23289 #[doc = "I/O port H clock enable bit"]
23290 pub fn set_iophen(&mut self, val: super::vals::Iophen) {
23291 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
23292 }
23293 }
23294 impl Default for Iopenr {
23295 fn default() -> Iopenr {
23296 Iopenr(0)
23297 }
23298 }
23299 #[doc = "APB2 peripheral clock enable in sleep mode register"]
23300 #[repr(transparent)]
23301 #[derive(Copy, Clone, Eq, PartialEq)]
23302 pub struct Apb2smenr(pub u32);
23303 impl Apb2smenr {
23304 #[doc = "System configuration controller clock enable during sleep mode bit"]
23305 pub const fn syscfgsmen(&self) -> super::vals::Dbgsmen {
23306 let val = (self.0 >> 0usize) & 0x01;
23307 super::vals::Dbgsmen(val as u8)
23308 }
23309 #[doc = "System configuration controller clock enable during sleep mode bit"]
23310 pub fn set_syscfgsmen(&mut self, val: super::vals::Dbgsmen) {
23311 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23312 }
23313 #[doc = "TIM21 timer clock enable during sleep mode bit"]
23314 pub const fn tim21smen(&self) -> super::vals::Dbgsmen {
23315 let val = (self.0 >> 2usize) & 0x01;
23316 super::vals::Dbgsmen(val as u8)
23317 }
23318 #[doc = "TIM21 timer clock enable during sleep mode bit"]
23319 pub fn set_tim21smen(&mut self, val: super::vals::Dbgsmen) {
23320 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
23321 }
23322 #[doc = "TIM22 timer clock enable during sleep mode bit"]
23323 pub const fn tim22smen(&self) -> super::vals::Dbgsmen {
23324 let val = (self.0 >> 5usize) & 0x01;
23325 super::vals::Dbgsmen(val as u8)
23326 }
23327 #[doc = "TIM22 timer clock enable during sleep mode bit"]
23328 pub fn set_tim22smen(&mut self, val: super::vals::Dbgsmen) {
23329 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
23330 }
23331 #[doc = "ADC clock enable during sleep mode bit"]
23332 pub const fn adcsmen(&self) -> super::vals::Dbgsmen {
23333 let val = (self.0 >> 9usize) & 0x01;
23334 super::vals::Dbgsmen(val as u8)
23335 }
23336 #[doc = "ADC clock enable during sleep mode bit"]
23337 pub fn set_adcsmen(&mut self, val: super::vals::Dbgsmen) {
23338 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
23339 }
23340 #[doc = "SPI1 clock enable during sleep mode bit"]
23341 pub const fn spi1smen(&self) -> super::vals::Dbgsmen {
23342 let val = (self.0 >> 12usize) & 0x01;
23343 super::vals::Dbgsmen(val as u8)
23344 }
23345 #[doc = "SPI1 clock enable during sleep mode bit"]
23346 pub fn set_spi1smen(&mut self, val: super::vals::Dbgsmen) {
23347 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
23348 }
23349 #[doc = "USART1 clock enable during sleep mode bit"]
23350 pub const fn usart1smen(&self) -> super::vals::Dbgsmen {
23351 let val = (self.0 >> 14usize) & 0x01;
23352 super::vals::Dbgsmen(val as u8)
23353 }
23354 #[doc = "USART1 clock enable during sleep mode bit"]
23355 pub fn set_usart1smen(&mut self, val: super::vals::Dbgsmen) {
23356 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
23357 }
23358 #[doc = "DBG clock enable during sleep mode bit"]
23359 pub const fn dbgsmen(&self) -> super::vals::Dbgsmen {
23360 let val = (self.0 >> 22usize) & 0x01;
23361 super::vals::Dbgsmen(val as u8)
23362 }
23363 #[doc = "DBG clock enable during sleep mode bit"]
23364 pub fn set_dbgsmen(&mut self, val: super::vals::Dbgsmen) {
23365 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
23366 }
23367 }
23368 impl Default for Apb2smenr {
23369 fn default() -> Apb2smenr {
23370 Apb2smenr(0)
23371 }
23372 }
23373 #[doc = "AHB peripheral reset register"]
23374 #[repr(transparent)]
23375 #[derive(Copy, Clone, Eq, PartialEq)]
23376 pub struct Ahbrstr(pub u32);
23377 impl Ahbrstr {
23378 #[doc = "DMA reset"]
23379 pub const fn dmarst(&self) -> bool {
23380 let val = (self.0 >> 0usize) & 0x01;
23732 val != 0 23381 val != 0
23733 } 23382 }
23734 #[doc = "Swap functionality of MISO and MOSI pins"] 23383 #[doc = "DMA reset"]
23735 pub fn set_ioswp(&mut self, val: bool) { 23384 pub fn set_dmarst(&mut self, val: bool) {
23736 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); 23385 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23737 } 23386 }
23738 #[doc = "SPI Communication Mode"] 23387 #[doc = "Memory interface reset"]
23739 pub const fn comm(&self) -> super::vals::Comm { 23388 pub const fn mifrst(&self) -> bool {
23740 let val = (self.0 >> 17usize) & 0x03; 23389 let val = (self.0 >> 8usize) & 0x01;
23741 super::vals::Comm(val as u8) 23390 val != 0
23742 } 23391 }
23743 #[doc = "SPI Communication Mode"] 23392 #[doc = "Memory interface reset"]
23744 pub fn set_comm(&mut self, val: super::vals::Comm) { 23393 pub fn set_mifrst(&mut self, val: bool) {
23745 self.0 = (self.0 & !(0x03 << 17usize)) | (((val.0 as u32) & 0x03) << 17usize); 23394 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
23746 } 23395 }
23747 #[doc = "Serial Protocol"] 23396 #[doc = "Test integration module reset"]
23748 pub const fn sp(&self) -> super::vals::Sp { 23397 pub const fn crcrst(&self) -> bool {
23749 let val = (self.0 >> 19usize) & 0x07; 23398 let val = (self.0 >> 12usize) & 0x01;
23750 super::vals::Sp(val as u8) 23399 val != 0
23751 } 23400 }
23752 #[doc = "Serial Protocol"] 23401 #[doc = "Test integration module reset"]
23753 pub fn set_sp(&mut self, val: super::vals::Sp) { 23402 pub fn set_crcrst(&mut self, val: bool) {
23754 self.0 = (self.0 & !(0x07 << 19usize)) | (((val.0 as u32) & 0x07) << 19usize); 23403 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
23755 } 23404 }
23756 #[doc = "SPI Master"] 23405 #[doc = "Touch Sensing reset"]
23757 pub const fn master(&self) -> super::vals::Master { 23406 pub const fn touchrst(&self) -> bool {
23407 let val = (self.0 >> 16usize) & 0x01;
23408 val != 0
23409 }
23410 #[doc = "Touch Sensing reset"]
23411 pub fn set_touchrst(&mut self, val: bool) {
23412 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
23413 }
23414 #[doc = "Random Number Generator module reset"]
23415 pub const fn rngrst(&self) -> bool {
23416 let val = (self.0 >> 20usize) & 0x01;
23417 val != 0
23418 }
23419 #[doc = "Random Number Generator module reset"]
23420 pub fn set_rngrst(&mut self, val: bool) {
23421 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
23422 }
23423 #[doc = "Crypto module reset"]
23424 pub const fn cryprst(&self) -> bool {
23425 let val = (self.0 >> 24usize) & 0x01;
23426 val != 0
23427 }
23428 #[doc = "Crypto module reset"]
23429 pub fn set_cryprst(&mut self, val: bool) {
23430 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
23431 }
23432 }
23433 impl Default for Ahbrstr {
23434 fn default() -> Ahbrstr {
23435 Ahbrstr(0)
23436 }
23437 }
23438 #[doc = "AHB peripheral clock enable in sleep mode register"]
23439 #[repr(transparent)]
23440 #[derive(Copy, Clone, Eq, PartialEq)]
23441 pub struct Ahbsmenr(pub u32);
23442 impl Ahbsmenr {
23443 #[doc = "DMA clock enable during sleep mode bit"]
23444 pub const fn dmasmen(&self) -> super::vals::Dmasmen {
23445 let val = (self.0 >> 0usize) & 0x01;
23446 super::vals::Dmasmen(val as u8)
23447 }
23448 #[doc = "DMA clock enable during sleep mode bit"]
23449 pub fn set_dmasmen(&mut self, val: super::vals::Dmasmen) {
23450 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23451 }
23452 #[doc = "NVM interface clock enable during sleep mode bit"]
23453 pub const fn mifsmen(&self) -> super::vals::Mifsmen {
23454 let val = (self.0 >> 8usize) & 0x01;
23455 super::vals::Mifsmen(val as u8)
23456 }
23457 #[doc = "NVM interface clock enable during sleep mode bit"]
23458 pub fn set_mifsmen(&mut self, val: super::vals::Mifsmen) {
23459 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
23460 }
23461 #[doc = "SRAM interface clock enable during sleep mode bit"]
23462 pub const fn sramsmen(&self) -> super::vals::Sramsmen {
23463 let val = (self.0 >> 9usize) & 0x01;
23464 super::vals::Sramsmen(val as u8)
23465 }
23466 #[doc = "SRAM interface clock enable during sleep mode bit"]
23467 pub fn set_sramsmen(&mut self, val: super::vals::Sramsmen) {
23468 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
23469 }
23470 #[doc = "CRC clock enable during sleep mode bit"]
23471 pub const fn crcsmen(&self) -> super::vals::Crcsmen {
23472 let val = (self.0 >> 12usize) & 0x01;
23473 super::vals::Crcsmen(val as u8)
23474 }
23475 #[doc = "CRC clock enable during sleep mode bit"]
23476 pub fn set_crcsmen(&mut self, val: super::vals::Crcsmen) {
23477 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
23478 }
23479 #[doc = "Touch Sensing clock enable during sleep mode bit"]
23480 pub const fn touchsmen(&self) -> bool {
23481 let val = (self.0 >> 16usize) & 0x01;
23482 val != 0
23483 }
23484 #[doc = "Touch Sensing clock enable during sleep mode bit"]
23485 pub fn set_touchsmen(&mut self, val: bool) {
23486 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
23487 }
23488 #[doc = "Random Number Generator clock enable during sleep mode bit"]
23489 pub const fn rngsmen(&self) -> bool {
23490 let val = (self.0 >> 20usize) & 0x01;
23491 val != 0
23492 }
23493 #[doc = "Random Number Generator clock enable during sleep mode bit"]
23494 pub fn set_rngsmen(&mut self, val: bool) {
23495 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
23496 }
23497 #[doc = "Crypto clock enable during sleep mode bit"]
23498 pub const fn crypsmen(&self) -> super::vals::Crypsmen {
23499 let val = (self.0 >> 24usize) & 0x01;
23500 super::vals::Crypsmen(val as u8)
23501 }
23502 #[doc = "Crypto clock enable during sleep mode bit"]
23503 pub fn set_crypsmen(&mut self, val: super::vals::Crypsmen) {
23504 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize);
23505 }
23506 }
23507 impl Default for Ahbsmenr {
23508 fn default() -> Ahbsmenr {
23509 Ahbsmenr(0)
23510 }
23511 }
23512 #[doc = "APB1 peripheral clock enable in sleep mode register"]
23513 #[repr(transparent)]
23514 #[derive(Copy, Clone, Eq, PartialEq)]
23515 pub struct Apb1smenr(pub u32);
23516 impl Apb1smenr {
23517 #[doc = "Timer2 clock enable during sleep mode bit"]
23518 pub const fn tim2smen(&self) -> super::vals::Lptimsmen {
23519 let val = (self.0 >> 0usize) & 0x01;
23520 super::vals::Lptimsmen(val as u8)
23521 }
23522 #[doc = "Timer2 clock enable during sleep mode bit"]
23523 pub fn set_tim2smen(&mut self, val: super::vals::Lptimsmen) {
23524 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23525 }
23526 #[doc = "Timer3 clock enable during Sleep mode bit"]
23527 pub const fn tim3smen(&self) -> super::vals::Lptimsmen {
23528 let val = (self.0 >> 1usize) & 0x01;
23529 super::vals::Lptimsmen(val as u8)
23530 }
23531 #[doc = "Timer3 clock enable during Sleep mode bit"]
23532 pub fn set_tim3smen(&mut self, val: super::vals::Lptimsmen) {
23533 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
23534 }
23535 #[doc = "Timer 6 clock enable during sleep mode bit"]
23536 pub const fn tim6smen(&self) -> super::vals::Lptimsmen {
23537 let val = (self.0 >> 4usize) & 0x01;
23538 super::vals::Lptimsmen(val as u8)
23539 }
23540 #[doc = "Timer 6 clock enable during sleep mode bit"]
23541 pub fn set_tim6smen(&mut self, val: super::vals::Lptimsmen) {
23542 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
23543 }
23544 #[doc = "Timer 7 clock enable during Sleep mode bit"]
23545 pub const fn tim7smen(&self) -> super::vals::Lptimsmen {
23546 let val = (self.0 >> 5usize) & 0x01;
23547 super::vals::Lptimsmen(val as u8)
23548 }
23549 #[doc = "Timer 7 clock enable during Sleep mode bit"]
23550 pub fn set_tim7smen(&mut self, val: super::vals::Lptimsmen) {
23551 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
23552 }
23553 #[doc = "Window watchdog clock enable during sleep mode bit"]
23554 pub const fn wwdgsmen(&self) -> super::vals::Lptimsmen {
23555 let val = (self.0 >> 11usize) & 0x01;
23556 super::vals::Lptimsmen(val as u8)
23557 }
23558 #[doc = "Window watchdog clock enable during sleep mode bit"]
23559 pub fn set_wwdgsmen(&mut self, val: super::vals::Lptimsmen) {
23560 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
23561 }
23562 #[doc = "SPI2 clock enable during sleep mode bit"]
23563 pub const fn spi2smen(&self) -> super::vals::Lptimsmen {
23564 let val = (self.0 >> 14usize) & 0x01;
23565 super::vals::Lptimsmen(val as u8)
23566 }
23567 #[doc = "SPI2 clock enable during sleep mode bit"]
23568 pub fn set_spi2smen(&mut self, val: super::vals::Lptimsmen) {
23569 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
23570 }
23571 #[doc = "UART2 clock enable during sleep mode bit"]
23572 pub const fn usart2smen(&self) -> super::vals::Lptimsmen {
23573 let val = (self.0 >> 17usize) & 0x01;
23574 super::vals::Lptimsmen(val as u8)
23575 }
23576 #[doc = "UART2 clock enable during sleep mode bit"]
23577 pub fn set_usart2smen(&mut self, val: super::vals::Lptimsmen) {
23578 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
23579 }
23580 #[doc = "LPUART1 clock enable during sleep mode bit"]
23581 pub const fn lpuart1smen(&self) -> super::vals::Lptimsmen {
23582 let val = (self.0 >> 18usize) & 0x01;
23583 super::vals::Lptimsmen(val as u8)
23584 }
23585 #[doc = "LPUART1 clock enable during sleep mode bit"]
23586 pub fn set_lpuart1smen(&mut self, val: super::vals::Lptimsmen) {
23587 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
23588 }
23589 #[doc = "USART4 clock enable during Sleep mode bit"]
23590 pub const fn usart4smen(&self) -> super::vals::Lptimsmen {
23591 let val = (self.0 >> 19usize) & 0x01;
23592 super::vals::Lptimsmen(val as u8)
23593 }
23594 #[doc = "USART4 clock enable during Sleep mode bit"]
23595 pub fn set_usart4smen(&mut self, val: super::vals::Lptimsmen) {
23596 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
23597 }
23598 #[doc = "USART5 clock enable during Sleep mode bit"]
23599 pub const fn usart5smen(&self) -> super::vals::Lptimsmen {
23600 let val = (self.0 >> 20usize) & 0x01;
23601 super::vals::Lptimsmen(val as u8)
23602 }
23603 #[doc = "USART5 clock enable during Sleep mode bit"]
23604 pub fn set_usart5smen(&mut self, val: super::vals::Lptimsmen) {
23605 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
23606 }
23607 #[doc = "I2C1 clock enable during sleep mode bit"]
23608 pub const fn i2c1smen(&self) -> super::vals::Lptimsmen {
23609 let val = (self.0 >> 21usize) & 0x01;
23610 super::vals::Lptimsmen(val as u8)
23611 }
23612 #[doc = "I2C1 clock enable during sleep mode bit"]
23613 pub fn set_i2c1smen(&mut self, val: super::vals::Lptimsmen) {
23614 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
23615 }
23616 #[doc = "I2C2 clock enable during sleep mode bit"]
23617 pub const fn i2c2smen(&self) -> super::vals::Lptimsmen {
23758 let val = (self.0 >> 22usize) & 0x01; 23618 let val = (self.0 >> 22usize) & 0x01;
23759 super::vals::Master(val as u8) 23619 super::vals::Lptimsmen(val as u8)
23760 } 23620 }
23761 #[doc = "SPI Master"] 23621 #[doc = "I2C2 clock enable during sleep mode bit"]
23762 pub fn set_master(&mut self, val: super::vals::Master) { 23622 pub fn set_i2c2smen(&mut self, val: super::vals::Lptimsmen) {
23763 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize); 23623 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
23764 } 23624 }
23765 #[doc = "Data frame format"] 23625 #[doc = "USB clock enable during sleep mode bit"]
23766 pub const fn lsbfrst(&self) -> super::vals::Lsbfrst { 23626 pub const fn usbsmen(&self) -> super::vals::Lptimsmen {
23767 let val = (self.0 >> 23usize) & 0x01; 23627 let val = (self.0 >> 23usize) & 0x01;
23768 super::vals::Lsbfrst(val as u8) 23628 super::vals::Lptimsmen(val as u8)
23769 } 23629 }
23770 #[doc = "Data frame format"] 23630 #[doc = "USB clock enable during sleep mode bit"]
23771 pub fn set_lsbfrst(&mut self, val: super::vals::Lsbfrst) { 23631 pub fn set_usbsmen(&mut self, val: super::vals::Lptimsmen) {
23772 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize); 23632 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
23773 } 23633 }
23774 #[doc = "Clock phase"] 23634 #[doc = "Clock recovery system clock enable during sleep mode bit"]
23775 pub const fn cpha(&self) -> super::vals::Cpha { 23635 pub const fn crssmen(&self) -> super::vals::Lptimsmen {
23776 let val = (self.0 >> 24usize) & 0x01; 23636 let val = (self.0 >> 27usize) & 0x01;
23777 super::vals::Cpha(val as u8) 23637 super::vals::Lptimsmen(val as u8)
23778 } 23638 }
23779 #[doc = "Clock phase"] 23639 #[doc = "Clock recovery system clock enable during sleep mode bit"]
23780 pub fn set_cpha(&mut self, val: super::vals::Cpha) { 23640 pub fn set_crssmen(&mut self, val: super::vals::Lptimsmen) {
23781 self.0 = (self.0 & !(0x01 << 24usize)) | (((val.0 as u32) & 0x01) << 24usize); 23641 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
23782 } 23642 }
23783 #[doc = "Clock polarity"] 23643 #[doc = "Power interface clock enable during sleep mode bit"]
23784 pub const fn cpol(&self) -> super::vals::Cpol { 23644 pub const fn pwrsmen(&self) -> super::vals::Lptimsmen {
23785 let val = (self.0 >> 25usize) & 0x01; 23645 let val = (self.0 >> 28usize) & 0x01;
23786 super::vals::Cpol(val as u8) 23646 super::vals::Lptimsmen(val as u8)
23787 } 23647 }
23788 #[doc = "Clock polarity"] 23648 #[doc = "Power interface clock enable during sleep mode bit"]
23789 pub fn set_cpol(&mut self, val: super::vals::Cpol) { 23649 pub fn set_pwrsmen(&mut self, val: super::vals::Lptimsmen) {
23790 self.0 = (self.0 & !(0x01 << 25usize)) | (((val.0 as u32) & 0x01) << 25usize); 23650 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
23791 } 23651 }
23792 #[doc = "Software management of SS signal input"] 23652 #[doc = "DAC interface clock enable during sleep mode bit"]
23793 pub const fn ssm(&self) -> bool { 23653 pub const fn dacsmen(&self) -> super::vals::Lptimsmen {
23794 let val = (self.0 >> 26usize) & 0x01; 23654 let val = (self.0 >> 29usize) & 0x01;
23655 super::vals::Lptimsmen(val as u8)
23656 }
23657 #[doc = "DAC interface clock enable during sleep mode bit"]
23658 pub fn set_dacsmen(&mut self, val: super::vals::Lptimsmen) {
23659 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
23660 }
23661 #[doc = "2C3 clock enable during Sleep mode bit"]
23662 pub const fn i2c3smen(&self) -> super::vals::Lptimsmen {
23663 let val = (self.0 >> 30usize) & 0x01;
23664 super::vals::Lptimsmen(val as u8)
23665 }
23666 #[doc = "2C3 clock enable during Sleep mode bit"]
23667 pub fn set_i2c3smen(&mut self, val: super::vals::Lptimsmen) {
23668 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
23669 }
23670 #[doc = "Low power timer clock enable during sleep mode bit"]
23671 pub const fn lptim1smen(&self) -> super::vals::Lptimsmen {
23672 let val = (self.0 >> 31usize) & 0x01;
23673 super::vals::Lptimsmen(val as u8)
23674 }
23675 #[doc = "Low power timer clock enable during sleep mode bit"]
23676 pub fn set_lptim1smen(&mut self, val: super::vals::Lptimsmen) {
23677 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
23678 }
23679 }
23680 impl Default for Apb1smenr {
23681 fn default() -> Apb1smenr {
23682 Apb1smenr(0)
23683 }
23684 }
23685 #[doc = "APB1 peripheral reset register"]
23686 #[repr(transparent)]
23687 #[derive(Copy, Clone, Eq, PartialEq)]
23688 pub struct Apb1rstr(pub u32);
23689 impl Apb1rstr {
23690 #[doc = "Timer2 reset"]
23691 pub const fn tim2rst(&self) -> bool {
23692 let val = (self.0 >> 0usize) & 0x01;
23795 val != 0 23693 val != 0
23796 } 23694 }
23797 #[doc = "Software management of SS signal input"] 23695 #[doc = "Timer2 reset"]
23798 pub fn set_ssm(&mut self, val: bool) { 23696 pub fn set_tim2rst(&mut self, val: bool) {
23799 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize); 23697 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23800 } 23698 }
23801 #[doc = "SS input/output polarity"] 23699 #[doc = "Timer3 reset"]
23802 pub const fn ssiop(&self) -> super::vals::Ssiop { 23700 pub const fn tim3rst(&self) -> bool {
23701 let val = (self.0 >> 1usize) & 0x01;
23702 val != 0
23703 }
23704 #[doc = "Timer3 reset"]
23705 pub fn set_tim3rst(&mut self, val: bool) {
23706 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
23707 }
23708 #[doc = "Timer 6 reset"]
23709 pub const fn tim6rst(&self) -> bool {
23710 let val = (self.0 >> 4usize) & 0x01;
23711 val != 0
23712 }
23713 #[doc = "Timer 6 reset"]
23714 pub fn set_tim6rst(&mut self, val: bool) {
23715 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
23716 }
23717 #[doc = "Timer 7 reset"]
23718 pub const fn tim7rst(&self) -> bool {
23719 let val = (self.0 >> 5usize) & 0x01;
23720 val != 0
23721 }
23722 #[doc = "Timer 7 reset"]
23723 pub fn set_tim7rst(&mut self, val: bool) {
23724 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
23725 }
23726 #[doc = "Window watchdog reset"]
23727 pub const fn wwdrst(&self) -> bool {
23728 let val = (self.0 >> 11usize) & 0x01;
23729 val != 0
23730 }
23731 #[doc = "Window watchdog reset"]
23732 pub fn set_wwdrst(&mut self, val: bool) {
23733 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
23734 }
23735 #[doc = "SPI2 reset"]
23736 pub const fn spi2rst(&self) -> bool {
23737 let val = (self.0 >> 14usize) & 0x01;
23738 val != 0
23739 }
23740 #[doc = "SPI2 reset"]
23741 pub fn set_spi2rst(&mut self, val: bool) {
23742 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
23743 }
23744 #[doc = "UART2 reset"]
23745 pub const fn lpuart12rst(&self) -> bool {
23746 let val = (self.0 >> 17usize) & 0x01;
23747 val != 0
23748 }
23749 #[doc = "UART2 reset"]
23750 pub fn set_lpuart12rst(&mut self, val: bool) {
23751 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
23752 }
23753 #[doc = "LPUART1 reset"]
23754 pub const fn lpuart1rst(&self) -> bool {
23755 let val = (self.0 >> 18usize) & 0x01;
23756 val != 0
23757 }
23758 #[doc = "LPUART1 reset"]
23759 pub fn set_lpuart1rst(&mut self, val: bool) {
23760 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
23761 }
23762 #[doc = "USART4 reset"]
23763 pub const fn usart4rst(&self) -> bool {
23764 let val = (self.0 >> 19usize) & 0x01;
23765 val != 0
23766 }
23767 #[doc = "USART4 reset"]
23768 pub fn set_usart4rst(&mut self, val: bool) {
23769 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
23770 }
23771 #[doc = "USART5 reset"]
23772 pub const fn usart5rst(&self) -> bool {
23773 let val = (self.0 >> 20usize) & 0x01;
23774 val != 0
23775 }
23776 #[doc = "USART5 reset"]
23777 pub fn set_usart5rst(&mut self, val: bool) {
23778 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
23779 }
23780 #[doc = "I2C1 reset"]
23781 pub const fn i2c1rst(&self) -> bool {
23782 let val = (self.0 >> 21usize) & 0x01;
23783 val != 0
23784 }
23785 #[doc = "I2C1 reset"]
23786 pub fn set_i2c1rst(&mut self, val: bool) {
23787 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
23788 }
23789 #[doc = "I2C2 reset"]
23790 pub const fn i2c2rst(&self) -> bool {
23791 let val = (self.0 >> 22usize) & 0x01;
23792 val != 0
23793 }
23794 #[doc = "I2C2 reset"]
23795 pub fn set_i2c2rst(&mut self, val: bool) {
23796 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
23797 }
23798 #[doc = "USB reset"]
23799 pub const fn usbrst(&self) -> bool {
23800 let val = (self.0 >> 23usize) & 0x01;
23801 val != 0
23802 }
23803 #[doc = "USB reset"]
23804 pub fn set_usbrst(&mut self, val: bool) {
23805 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
23806 }
23807 #[doc = "Clock recovery system reset"]
23808 pub const fn crsrst(&self) -> bool {
23809 let val = (self.0 >> 27usize) & 0x01;
23810 val != 0
23811 }
23812 #[doc = "Clock recovery system reset"]
23813 pub fn set_crsrst(&mut self, val: bool) {
23814 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
23815 }
23816 #[doc = "Power interface reset"]
23817 pub const fn pwrrst(&self) -> bool {
23803 let val = (self.0 >> 28usize) & 0x01; 23818 let val = (self.0 >> 28usize) & 0x01;
23804 super::vals::Ssiop(val as u8) 23819 val != 0
23805 } 23820 }
23806 #[doc = "SS input/output polarity"] 23821 #[doc = "Power interface reset"]
23807 pub fn set_ssiop(&mut self, val: super::vals::Ssiop) { 23822 pub fn set_pwrrst(&mut self, val: bool) {
23808 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize); 23823 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
23809 } 23824 }
23810 #[doc = "SS output enable"] 23825 #[doc = "DAC interface reset"]
23811 pub const fn ssoe(&self) -> bool { 23826 pub const fn dacrst(&self) -> bool {
23812 let val = (self.0 >> 29usize) & 0x01; 23827 let val = (self.0 >> 29usize) & 0x01;
23813 val != 0 23828 val != 0
23814 } 23829 }
23815 #[doc = "SS output enable"] 23830 #[doc = "DAC interface reset"]
23816 pub fn set_ssoe(&mut self, val: bool) { 23831 pub fn set_dacrst(&mut self, val: bool) {
23817 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize); 23832 self.0 = (self.0 & !(0x01 << 29usize)) | (((val as u32) & 0x01) << 29usize);
23818 } 23833 }
23819 #[doc = "SS output management in master mode"] 23834 #[doc = "I2C3 reset"]
23820 pub const fn ssom(&self) -> super::vals::Ssom { 23835 pub const fn i2c3rst(&self) -> bool {
23821 let val = (self.0 >> 30usize) & 0x01; 23836 let val = (self.0 >> 30usize) & 0x01;
23822 super::vals::Ssom(val as u8) 23837 val != 0
23823 } 23838 }
23824 #[doc = "SS output management in master mode"] 23839 #[doc = "I2C3 reset"]
23825 pub fn set_ssom(&mut self, val: super::vals::Ssom) { 23840 pub fn set_i2c3rst(&mut self, val: bool) {
23826 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize); 23841 self.0 = (self.0 & !(0x01 << 30usize)) | (((val as u32) & 0x01) << 30usize);
23827 } 23842 }
23828 #[doc = "Alternate function GPIOs control"] 23843 #[doc = "Low power timer reset"]
23829 pub const fn afcntr(&self) -> super::vals::Afcntr { 23844 pub const fn lptim1rst(&self) -> bool {
23830 let val = (self.0 >> 31usize) & 0x01; 23845 let val = (self.0 >> 31usize) & 0x01;
23831 super::vals::Afcntr(val as u8) 23846 val != 0
23832 } 23847 }
23833 #[doc = "Alternate function GPIOs control"] 23848 #[doc = "Low power timer reset"]
23834 pub fn set_afcntr(&mut self, val: super::vals::Afcntr) { 23849 pub fn set_lptim1rst(&mut self, val: bool) {
23835 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize); 23850 self.0 = (self.0 & !(0x01 << 31usize)) | (((val as u32) & 0x01) << 31usize);
23836 } 23851 }
23837 } 23852 }
23838 impl Default for Cfg2 { 23853 impl Default for Apb1rstr {
23839 fn default() -> Cfg2 { 23854 fn default() -> Apb1rstr {
23840 Cfg2(0) 23855 Apb1rstr(0)
23841 } 23856 }
23842 } 23857 }
23843 #[doc = "Interrupt Enable Register"] 23858 #[doc = "Clock interrupt enable register"]
23844 #[repr(transparent)] 23859 #[repr(transparent)]
23845 #[derive(Copy, Clone, Eq, PartialEq)] 23860 #[derive(Copy, Clone, Eq, PartialEq)]
23846 pub struct Ier(pub u32); 23861 pub struct Cier(pub u32);
23847 impl Ier { 23862 impl Cier {
23848 #[doc = "RXP Interrupt Enable"] 23863 #[doc = "LSI ready interrupt flag"]
23849 pub const fn rxpie(&self) -> bool { 23864 pub const fn lsirdyie(&self) -> super::vals::Hsirdyie {
23865 let val = (self.0 >> 0usize) & 0x01;
23866 super::vals::Hsirdyie(val as u8)
23867 }
23868 #[doc = "LSI ready interrupt flag"]
23869 pub fn set_lsirdyie(&mut self, val: super::vals::Hsirdyie) {
23870 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23871 }
23872 #[doc = "LSE ready interrupt flag"]
23873 pub const fn lserdyie(&self) -> super::vals::Hsirdyie {
23874 let val = (self.0 >> 1usize) & 0x01;
23875 super::vals::Hsirdyie(val as u8)
23876 }
23877 #[doc = "LSE ready interrupt flag"]
23878 pub fn set_lserdyie(&mut self, val: super::vals::Hsirdyie) {
23879 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
23880 }
23881 #[doc = "HSI16 ready interrupt flag"]
23882 pub const fn hsi16rdyie(&self) -> super::vals::Hsirdyie {
23883 let val = (self.0 >> 2usize) & 0x01;
23884 super::vals::Hsirdyie(val as u8)
23885 }
23886 #[doc = "HSI16 ready interrupt flag"]
23887 pub fn set_hsi16rdyie(&mut self, val: super::vals::Hsirdyie) {
23888 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
23889 }
23890 #[doc = "HSE ready interrupt flag"]
23891 pub const fn hserdyie(&self) -> super::vals::Hsirdyie {
23892 let val = (self.0 >> 3usize) & 0x01;
23893 super::vals::Hsirdyie(val as u8)
23894 }
23895 #[doc = "HSE ready interrupt flag"]
23896 pub fn set_hserdyie(&mut self, val: super::vals::Hsirdyie) {
23897 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
23898 }
23899 #[doc = "PLL ready interrupt flag"]
23900 pub const fn pllrdyie(&self) -> super::vals::Hsirdyie {
23901 let val = (self.0 >> 4usize) & 0x01;
23902 super::vals::Hsirdyie(val as u8)
23903 }
23904 #[doc = "PLL ready interrupt flag"]
23905 pub fn set_pllrdyie(&mut self, val: super::vals::Hsirdyie) {
23906 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
23907 }
23908 #[doc = "MSI ready interrupt flag"]
23909 pub const fn msirdyie(&self) -> super::vals::Hsirdyie {
23910 let val = (self.0 >> 5usize) & 0x01;
23911 super::vals::Hsirdyie(val as u8)
23912 }
23913 #[doc = "MSI ready interrupt flag"]
23914 pub fn set_msirdyie(&mut self, val: super::vals::Hsirdyie) {
23915 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
23916 }
23917 #[doc = "HSI48 ready interrupt flag"]
23918 pub const fn hsi48rdyie(&self) -> super::vals::Hsirdyie {
23919 let val = (self.0 >> 6usize) & 0x01;
23920 super::vals::Hsirdyie(val as u8)
23921 }
23922 #[doc = "HSI48 ready interrupt flag"]
23923 pub fn set_hsi48rdyie(&mut self, val: super::vals::Hsirdyie) {
23924 self.0 = (self.0 & !(0x01 << 6usize)) | (((val.0 as u32) & 0x01) << 6usize);
23925 }
23926 #[doc = "LSE CSS interrupt flag"]
23927 pub const fn csslse(&self) -> super::vals::Csslse {
23928 let val = (self.0 >> 7usize) & 0x01;
23929 super::vals::Csslse(val as u8)
23930 }
23931 #[doc = "LSE CSS interrupt flag"]
23932 pub fn set_csslse(&mut self, val: super::vals::Csslse) {
23933 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
23934 }
23935 }
23936 impl Default for Cier {
23937 fn default() -> Cier {
23938 Cier(0)
23939 }
23940 }
23941 #[doc = "APB2 peripheral reset register"]
23942 #[repr(transparent)]
23943 #[derive(Copy, Clone, Eq, PartialEq)]
23944 pub struct Apb2rstr(pub u32);
23945 impl Apb2rstr {
23946 #[doc = "System configuration controller reset"]
23947 pub const fn syscfgrst(&self) -> bool {
23850 let val = (self.0 >> 0usize) & 0x01; 23948 let val = (self.0 >> 0usize) & 0x01;
23851 val != 0 23949 val != 0
23852 } 23950 }
23853 #[doc = "RXP Interrupt Enable"] 23951 #[doc = "System configuration controller reset"]
23854 pub fn set_rxpie(&mut self, val: bool) { 23952 pub fn set_syscfgrst(&mut self, val: bool) {
23855 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 23953 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
23856 } 23954 }
23857 #[doc = "TXP interrupt enable"] 23955 #[doc = "TIM21 timer reset"]
23858 pub const fn txpie(&self) -> bool { 23956 pub const fn tim21rst(&self) -> bool {
23957 let val = (self.0 >> 2usize) & 0x01;
23958 val != 0
23959 }
23960 #[doc = "TIM21 timer reset"]
23961 pub fn set_tim21rst(&mut self, val: bool) {
23962 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
23963 }
23964 #[doc = "TIM22 timer reset"]
23965 pub const fn tim22rst(&self) -> bool {
23966 let val = (self.0 >> 5usize) & 0x01;
23967 val != 0
23968 }
23969 #[doc = "TIM22 timer reset"]
23970 pub fn set_tim22rst(&mut self, val: bool) {
23971 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
23972 }
23973 #[doc = "ADC interface reset"]
23974 pub const fn adcrst(&self) -> bool {
23975 let val = (self.0 >> 9usize) & 0x01;
23976 val != 0
23977 }
23978 #[doc = "ADC interface reset"]
23979 pub fn set_adcrst(&mut self, val: bool) {
23980 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
23981 }
23982 #[doc = "SPI 1 reset"]
23983 pub const fn spi1rst(&self) -> bool {
23984 let val = (self.0 >> 12usize) & 0x01;
23985 val != 0
23986 }
23987 #[doc = "SPI 1 reset"]
23988 pub fn set_spi1rst(&mut self, val: bool) {
23989 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
23990 }
23991 #[doc = "USART1 reset"]
23992 pub const fn usart1rst(&self) -> bool {
23993 let val = (self.0 >> 14usize) & 0x01;
23994 val != 0
23995 }
23996 #[doc = "USART1 reset"]
23997 pub fn set_usart1rst(&mut self, val: bool) {
23998 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
23999 }
24000 #[doc = "DBG reset"]
24001 pub const fn dbgrst(&self) -> bool {
24002 let val = (self.0 >> 22usize) & 0x01;
24003 val != 0
24004 }
24005 #[doc = "DBG reset"]
24006 pub fn set_dbgrst(&mut self, val: bool) {
24007 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
24008 }
24009 }
24010 impl Default for Apb2rstr {
24011 fn default() -> Apb2rstr {
24012 Apb2rstr(0)
24013 }
24014 }
24015 #[doc = "Clock configuration register"]
24016 #[repr(transparent)]
24017 #[derive(Copy, Clone, Eq, PartialEq)]
24018 pub struct Cfgr(pub u32);
24019 impl Cfgr {
24020 #[doc = "System clock switch"]
24021 pub const fn sw(&self) -> super::vals::Sw {
24022 let val = (self.0 >> 0usize) & 0x03;
24023 super::vals::Sw(val as u8)
24024 }
24025 #[doc = "System clock switch"]
24026 pub fn set_sw(&mut self, val: super::vals::Sw) {
24027 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
24028 }
24029 #[doc = "System clock switch status"]
24030 pub const fn sws(&self) -> super::vals::Sws {
24031 let val = (self.0 >> 2usize) & 0x03;
24032 super::vals::Sws(val as u8)
24033 }
24034 #[doc = "System clock switch status"]
24035 pub fn set_sws(&mut self, val: super::vals::Sws) {
24036 self.0 = (self.0 & !(0x03 << 2usize)) | (((val.0 as u32) & 0x03) << 2usize);
24037 }
24038 #[doc = "AHB prescaler"]
24039 pub const fn hpre(&self) -> super::vals::Hpre {
24040 let val = (self.0 >> 4usize) & 0x0f;
24041 super::vals::Hpre(val as u8)
24042 }
24043 #[doc = "AHB prescaler"]
24044 pub fn set_hpre(&mut self, val: super::vals::Hpre) {
24045 self.0 = (self.0 & !(0x0f << 4usize)) | (((val.0 as u32) & 0x0f) << 4usize);
24046 }
24047 #[doc = "APB low-speed prescaler (APB1)"]
24048 pub fn ppre(&self, n: usize) -> super::vals::Ppre {
24049 assert!(n < 2usize);
24050 let offs = 8usize + n * 3usize;
24051 let val = (self.0 >> offs) & 0x07;
24052 super::vals::Ppre(val as u8)
24053 }
24054 #[doc = "APB low-speed prescaler (APB1)"]
24055 pub fn set_ppre(&mut self, n: usize, val: super::vals::Ppre) {
24056 assert!(n < 2usize);
24057 let offs = 8usize + n * 3usize;
24058 self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs);
24059 }
24060 #[doc = "Wake-up from stop clock selection"]
24061 pub const fn stopwuck(&self) -> super::vals::Stopwuck {
24062 let val = (self.0 >> 15usize) & 0x01;
24063 super::vals::Stopwuck(val as u8)
24064 }
24065 #[doc = "Wake-up from stop clock selection"]
24066 pub fn set_stopwuck(&mut self, val: super::vals::Stopwuck) {
24067 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
24068 }
24069 #[doc = "PLL entry clock source"]
24070 pub const fn pllsrc(&self) -> super::vals::Pllsrc {
24071 let val = (self.0 >> 16usize) & 0x01;
24072 super::vals::Pllsrc(val as u8)
24073 }
24074 #[doc = "PLL entry clock source"]
24075 pub fn set_pllsrc(&mut self, val: super::vals::Pllsrc) {
24076 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
24077 }
24078 #[doc = "PLL multiplication factor"]
24079 pub const fn pllmul(&self) -> super::vals::Pllmul {
24080 let val = (self.0 >> 18usize) & 0x0f;
24081 super::vals::Pllmul(val as u8)
24082 }
24083 #[doc = "PLL multiplication factor"]
24084 pub fn set_pllmul(&mut self, val: super::vals::Pllmul) {
24085 self.0 = (self.0 & !(0x0f << 18usize)) | (((val.0 as u32) & 0x0f) << 18usize);
24086 }
24087 #[doc = "PLL output division"]
24088 pub const fn plldiv(&self) -> super::vals::Plldiv {
24089 let val = (self.0 >> 22usize) & 0x03;
24090 super::vals::Plldiv(val as u8)
24091 }
24092 #[doc = "PLL output division"]
24093 pub fn set_plldiv(&mut self, val: super::vals::Plldiv) {
24094 self.0 = (self.0 & !(0x03 << 22usize)) | (((val.0 as u32) & 0x03) << 22usize);
24095 }
24096 #[doc = "Microcontroller clock output selection"]
24097 pub const fn mcosel(&self) -> super::vals::Mcosel {
24098 let val = (self.0 >> 24usize) & 0x0f;
24099 super::vals::Mcosel(val as u8)
24100 }
24101 #[doc = "Microcontroller clock output selection"]
24102 pub fn set_mcosel(&mut self, val: super::vals::Mcosel) {
24103 self.0 = (self.0 & !(0x0f << 24usize)) | (((val.0 as u32) & 0x0f) << 24usize);
24104 }
24105 #[doc = "Microcontroller clock output prescaler"]
24106 pub const fn mcopre(&self) -> super::vals::Mcopre {
24107 let val = (self.0 >> 28usize) & 0x07;
24108 super::vals::Mcopre(val as u8)
24109 }
24110 #[doc = "Microcontroller clock output prescaler"]
24111 pub fn set_mcopre(&mut self, val: super::vals::Mcopre) {
24112 self.0 = (self.0 & !(0x07 << 28usize)) | (((val.0 as u32) & 0x07) << 28usize);
24113 }
24114 }
24115 impl Default for Cfgr {
24116 fn default() -> Cfgr {
24117 Cfgr(0)
24118 }
24119 }
24120 #[doc = "Clock interrupt flag register"]
24121 #[repr(transparent)]
24122 #[derive(Copy, Clone, Eq, PartialEq)]
24123 pub struct Cifr(pub u32);
24124 impl Cifr {
24125 #[doc = "LSI ready interrupt flag"]
24126 pub const fn lsirdyf(&self) -> bool {
24127 let val = (self.0 >> 0usize) & 0x01;
24128 val != 0
24129 }
24130 #[doc = "LSI ready interrupt flag"]
24131 pub fn set_lsirdyf(&mut self, val: bool) {
24132 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
24133 }
24134 #[doc = "LSE ready interrupt flag"]
24135 pub const fn lserdyf(&self) -> bool {
23859 let val = (self.0 >> 1usize) & 0x01; 24136 let val = (self.0 >> 1usize) & 0x01;
23860 val != 0 24137 val != 0
23861 } 24138 }
23862 #[doc = "TXP interrupt enable"] 24139 #[doc = "LSE ready interrupt flag"]
23863 pub fn set_txpie(&mut self, val: bool) { 24140 pub fn set_lserdyf(&mut self, val: bool) {
23864 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 24141 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
23865 } 24142 }
23866 #[doc = "DXP interrupt enabled"] 24143 #[doc = "HSI16 ready interrupt flag"]
23867 pub const fn dxpie(&self) -> bool { 24144 pub const fn hsi16rdyf(&self) -> bool {
23868 let val = (self.0 >> 2usize) & 0x01; 24145 let val = (self.0 >> 2usize) & 0x01;
23869 val != 0 24146 val != 0
23870 } 24147 }
23871 #[doc = "DXP interrupt enabled"] 24148 #[doc = "HSI16 ready interrupt flag"]
23872 pub fn set_dxpie(&mut self, val: bool) { 24149 pub fn set_hsi16rdyf(&mut self, val: bool) {
23873 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 24150 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
23874 } 24151 }
23875 #[doc = "EOT, SUSP and TXC interrupt enable"] 24152 #[doc = "HSE ready interrupt flag"]
23876 pub const fn eotie(&self) -> bool { 24153 pub const fn hserdyf(&self) -> bool {
23877 let val = (self.0 >> 3usize) & 0x01; 24154 let val = (self.0 >> 3usize) & 0x01;
23878 val != 0 24155 val != 0
23879 } 24156 }
23880 #[doc = "EOT, SUSP and TXC interrupt enable"] 24157 #[doc = "HSE ready interrupt flag"]
23881 pub fn set_eotie(&mut self, val: bool) { 24158 pub fn set_hserdyf(&mut self, val: bool) {
23882 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 24159 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
23883 } 24160 }
23884 #[doc = "TXTFIE interrupt enable"] 24161 #[doc = "PLL ready interrupt flag"]
23885 pub const fn txtfie(&self) -> bool { 24162 pub const fn pllrdyf(&self) -> bool {
23886 let val = (self.0 >> 4usize) & 0x01; 24163 let val = (self.0 >> 4usize) & 0x01;
23887 val != 0 24164 val != 0
23888 } 24165 }
23889 #[doc = "TXTFIE interrupt enable"] 24166 #[doc = "PLL ready interrupt flag"]
23890 pub fn set_txtfie(&mut self, val: bool) { 24167 pub fn set_pllrdyf(&mut self, val: bool) {
23891 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 24168 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
23892 } 24169 }
23893 #[doc = "UDR interrupt enable"] 24170 #[doc = "MSI ready interrupt flag"]
23894 pub const fn udrie(&self) -> bool { 24171 pub const fn msirdyf(&self) -> bool {
23895 let val = (self.0 >> 5usize) & 0x01; 24172 let val = (self.0 >> 5usize) & 0x01;
23896 val != 0 24173 val != 0
23897 } 24174 }
23898 #[doc = "UDR interrupt enable"] 24175 #[doc = "MSI ready interrupt flag"]
23899 pub fn set_udrie(&mut self, val: bool) { 24176 pub fn set_msirdyf(&mut self, val: bool) {
23900 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 24177 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
23901 } 24178 }
23902 #[doc = "OVR interrupt enable"] 24179 #[doc = "HSI48 ready interrupt flag"]
23903 pub const fn ovrie(&self) -> bool { 24180 pub const fn hsi48rdyf(&self) -> bool {
23904 let val = (self.0 >> 6usize) & 0x01; 24181 let val = (self.0 >> 6usize) & 0x01;
23905 val != 0 24182 val != 0
23906 } 24183 }
23907 #[doc = "OVR interrupt enable"] 24184 #[doc = "HSI48 ready interrupt flag"]
23908 pub fn set_ovrie(&mut self, val: bool) { 24185 pub fn set_hsi48rdyf(&mut self, val: bool) {
23909 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 24186 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
23910 } 24187 }
23911 #[doc = "CRC Interrupt enable"] 24188 #[doc = "LSE Clock Security System Interrupt flag"]
23912 pub const fn crceie(&self) -> bool { 24189 pub const fn csslsef(&self) -> super::vals::Csslsef {
23913 let val = (self.0 >> 7usize) & 0x01; 24190 let val = (self.0 >> 7usize) & 0x01;
23914 val != 0 24191 super::vals::Csslsef(val as u8)
23915 } 24192 }
23916 #[doc = "CRC Interrupt enable"] 24193 #[doc = "LSE Clock Security System Interrupt flag"]
23917 pub fn set_crceie(&mut self, val: bool) { 24194 pub fn set_csslsef(&mut self, val: super::vals::Csslsef) {
23918 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 24195 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
23919 } 24196 }
23920 #[doc = "TIFRE interrupt enable"] 24197 #[doc = "Clock Security System Interrupt flag"]
23921 pub const fn tifreie(&self) -> bool { 24198 pub const fn csshsef(&self) -> super::vals::Csshsef {
23922 let val = (self.0 >> 8usize) & 0x01; 24199 let val = (self.0 >> 8usize) & 0x01;
23923 val != 0 24200 super::vals::Csshsef(val as u8)
23924 } 24201 }
23925 #[doc = "TIFRE interrupt enable"] 24202 #[doc = "Clock Security System Interrupt flag"]
23926 pub fn set_tifreie(&mut self, val: bool) { 24203 pub fn set_csshsef(&mut self, val: super::vals::Csshsef) {
23927 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 24204 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
23928 } 24205 }
23929 #[doc = "Mode Fault interrupt enable"] 24206 }
23930 pub const fn modfie(&self) -> bool { 24207 impl Default for Cifr {
23931 let val = (self.0 >> 9usize) & 0x01; 24208 fn default() -> Cifr {
23932 val != 0 24209 Cifr(0)
23933 } 24210 }
23934 #[doc = "Mode Fault interrupt enable"] 24211 }
23935 pub fn set_modfie(&mut self, val: bool) { 24212 #[doc = "APB1 peripheral clock enable register"]
23936 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 24213 #[repr(transparent)]
24214 #[derive(Copy, Clone, Eq, PartialEq)]
24215 pub struct Apb1enr(pub u32);
24216 impl Apb1enr {
24217 #[doc = "Timer2 clock enable bit"]
24218 pub const fn tim2en(&self) -> super::vals::Lptimen {
24219 let val = (self.0 >> 0usize) & 0x01;
24220 super::vals::Lptimen(val as u8)
23937 } 24221 }
23938 #[doc = "Additional number of transactions reload interrupt enable"] 24222 #[doc = "Timer2 clock enable bit"]
23939 pub const fn tserfie(&self) -> bool { 24223 pub fn set_tim2en(&mut self, val: super::vals::Lptimen) {
23940 let val = (self.0 >> 10usize) & 0x01; 24224 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
23941 val != 0
23942 } 24225 }
23943 #[doc = "Additional number of transactions reload interrupt enable"] 24226 #[doc = "Timer3 clock enable bit"]
23944 pub fn set_tserfie(&mut self, val: bool) { 24227 pub const fn tim3en(&self) -> super::vals::Lptimen {
23945 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 24228 let val = (self.0 >> 1usize) & 0x01;
24229 super::vals::Lptimen(val as u8)
24230 }
24231 #[doc = "Timer3 clock enable bit"]
24232 pub fn set_tim3en(&mut self, val: super::vals::Lptimen) {
24233 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
24234 }
24235 #[doc = "Timer 6 clock enable bit"]
24236 pub const fn tim6en(&self) -> super::vals::Lptimen {
24237 let val = (self.0 >> 4usize) & 0x01;
24238 super::vals::Lptimen(val as u8)
24239 }
24240 #[doc = "Timer 6 clock enable bit"]
24241 pub fn set_tim6en(&mut self, val: super::vals::Lptimen) {
24242 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
24243 }
24244 #[doc = "Timer 7 clock enable bit"]
24245 pub const fn tim7en(&self) -> super::vals::Lptimen {
24246 let val = (self.0 >> 5usize) & 0x01;
24247 super::vals::Lptimen(val as u8)
24248 }
24249 #[doc = "Timer 7 clock enable bit"]
24250 pub fn set_tim7en(&mut self, val: super::vals::Lptimen) {
24251 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
24252 }
24253 #[doc = "Window watchdog clock enable bit"]
24254 pub const fn wwdgen(&self) -> super::vals::Lptimen {
24255 let val = (self.0 >> 11usize) & 0x01;
24256 super::vals::Lptimen(val as u8)
24257 }
24258 #[doc = "Window watchdog clock enable bit"]
24259 pub fn set_wwdgen(&mut self, val: super::vals::Lptimen) {
24260 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
24261 }
24262 #[doc = "SPI2 clock enable bit"]
24263 pub const fn spi2en(&self) -> super::vals::Lptimen {
24264 let val = (self.0 >> 14usize) & 0x01;
24265 super::vals::Lptimen(val as u8)
24266 }
24267 #[doc = "SPI2 clock enable bit"]
24268 pub fn set_spi2en(&mut self, val: super::vals::Lptimen) {
24269 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
24270 }
24271 #[doc = "UART2 clock enable bit"]
24272 pub const fn usart2en(&self) -> super::vals::Lptimen {
24273 let val = (self.0 >> 17usize) & 0x01;
24274 super::vals::Lptimen(val as u8)
24275 }
24276 #[doc = "UART2 clock enable bit"]
24277 pub fn set_usart2en(&mut self, val: super::vals::Lptimen) {
24278 self.0 = (self.0 & !(0x01 << 17usize)) | (((val.0 as u32) & 0x01) << 17usize);
24279 }
24280 #[doc = "LPUART1 clock enable bit"]
24281 pub const fn lpuart1en(&self) -> super::vals::Lptimen {
24282 let val = (self.0 >> 18usize) & 0x01;
24283 super::vals::Lptimen(val as u8)
24284 }
24285 #[doc = "LPUART1 clock enable bit"]
24286 pub fn set_lpuart1en(&mut self, val: super::vals::Lptimen) {
24287 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
24288 }
24289 #[doc = "USART4 clock enable bit"]
24290 pub const fn usart4en(&self) -> super::vals::Lptimen {
24291 let val = (self.0 >> 19usize) & 0x01;
24292 super::vals::Lptimen(val as u8)
24293 }
24294 #[doc = "USART4 clock enable bit"]
24295 pub fn set_usart4en(&mut self, val: super::vals::Lptimen) {
24296 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
24297 }
24298 #[doc = "USART5 clock enable bit"]
24299 pub const fn usart5en(&self) -> super::vals::Lptimen {
24300 let val = (self.0 >> 20usize) & 0x01;
24301 super::vals::Lptimen(val as u8)
24302 }
24303 #[doc = "USART5 clock enable bit"]
24304 pub fn set_usart5en(&mut self, val: super::vals::Lptimen) {
24305 self.0 = (self.0 & !(0x01 << 20usize)) | (((val.0 as u32) & 0x01) << 20usize);
24306 }
24307 #[doc = "I2C1 clock enable bit"]
24308 pub const fn i2c1en(&self) -> super::vals::Lptimen {
24309 let val = (self.0 >> 21usize) & 0x01;
24310 super::vals::Lptimen(val as u8)
24311 }
24312 #[doc = "I2C1 clock enable bit"]
24313 pub fn set_i2c1en(&mut self, val: super::vals::Lptimen) {
24314 self.0 = (self.0 & !(0x01 << 21usize)) | (((val.0 as u32) & 0x01) << 21usize);
24315 }
24316 #[doc = "I2C2 clock enable bit"]
24317 pub const fn i2c2en(&self) -> super::vals::Lptimen {
24318 let val = (self.0 >> 22usize) & 0x01;
24319 super::vals::Lptimen(val as u8)
24320 }
24321 #[doc = "I2C2 clock enable bit"]
24322 pub fn set_i2c2en(&mut self, val: super::vals::Lptimen) {
24323 self.0 = (self.0 & !(0x01 << 22usize)) | (((val.0 as u32) & 0x01) << 22usize);
24324 }
24325 #[doc = "USB clock enable bit"]
24326 pub const fn usben(&self) -> super::vals::Lptimen {
24327 let val = (self.0 >> 23usize) & 0x01;
24328 super::vals::Lptimen(val as u8)
24329 }
24330 #[doc = "USB clock enable bit"]
24331 pub fn set_usben(&mut self, val: super::vals::Lptimen) {
24332 self.0 = (self.0 & !(0x01 << 23usize)) | (((val.0 as u32) & 0x01) << 23usize);
24333 }
24334 #[doc = "Clock recovery system clock enable bit"]
24335 pub const fn crsen(&self) -> super::vals::Lptimen {
24336 let val = (self.0 >> 27usize) & 0x01;
24337 super::vals::Lptimen(val as u8)
24338 }
24339 #[doc = "Clock recovery system clock enable bit"]
24340 pub fn set_crsen(&mut self, val: super::vals::Lptimen) {
24341 self.0 = (self.0 & !(0x01 << 27usize)) | (((val.0 as u32) & 0x01) << 27usize);
24342 }
24343 #[doc = "Power interface clock enable bit"]
24344 pub const fn pwren(&self) -> super::vals::Lptimen {
24345 let val = (self.0 >> 28usize) & 0x01;
24346 super::vals::Lptimen(val as u8)
24347 }
24348 #[doc = "Power interface clock enable bit"]
24349 pub fn set_pwren(&mut self, val: super::vals::Lptimen) {
24350 self.0 = (self.0 & !(0x01 << 28usize)) | (((val.0 as u32) & 0x01) << 28usize);
24351 }
24352 #[doc = "DAC interface clock enable bit"]
24353 pub const fn dacen(&self) -> super::vals::Lptimen {
24354 let val = (self.0 >> 29usize) & 0x01;
24355 super::vals::Lptimen(val as u8)
24356 }
24357 #[doc = "DAC interface clock enable bit"]
24358 pub fn set_dacen(&mut self, val: super::vals::Lptimen) {
24359 self.0 = (self.0 & !(0x01 << 29usize)) | (((val.0 as u32) & 0x01) << 29usize);
24360 }
24361 #[doc = "I2C3 clock enable bit"]
24362 pub const fn i2c3en(&self) -> super::vals::Lptimen {
24363 let val = (self.0 >> 30usize) & 0x01;
24364 super::vals::Lptimen(val as u8)
24365 }
24366 #[doc = "I2C3 clock enable bit"]
24367 pub fn set_i2c3en(&mut self, val: super::vals::Lptimen) {
24368 self.0 = (self.0 & !(0x01 << 30usize)) | (((val.0 as u32) & 0x01) << 30usize);
24369 }
24370 #[doc = "Low power timer clock enable bit"]
24371 pub const fn lptim1en(&self) -> super::vals::Lptimen {
24372 let val = (self.0 >> 31usize) & 0x01;
24373 super::vals::Lptimen(val as u8)
24374 }
24375 #[doc = "Low power timer clock enable bit"]
24376 pub fn set_lptim1en(&mut self, val: super::vals::Lptimen) {
24377 self.0 = (self.0 & !(0x01 << 31usize)) | (((val.0 as u32) & 0x01) << 31usize);
23946 } 24378 }
23947 } 24379 }
23948 impl Default for Ier { 24380 impl Default for Apb1enr {
23949 fn default() -> Ier { 24381 fn default() -> Apb1enr {
23950 Ier(0) 24382 Apb1enr(0)
23951 } 24383 }
23952 } 24384 }
23953 } 24385 }
@@ -23955,246 +24387,581 @@ pub mod spi_v3 {
23955 use crate::generic::*; 24387 use crate::generic::*;
23956 #[repr(transparent)] 24388 #[repr(transparent)]
23957 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24389 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
23958 pub struct Hddir(pub u8); 24390 pub struct Rtcpre(pub u8);
23959 impl Hddir { 24391 impl Rtcpre {
23960 #[doc = "Receiver in half duplex mode"] 24392 #[doc = "HSE divided by 2"]
23961 pub const RECEIVER: Self = Self(0); 24393 pub const DIV2: Self = Self(0);
23962 #[doc = "Transmitter in half duplex mode"] 24394 #[doc = "HSE divided by 4"]
23963 pub const TRANSMITTER: Self = Self(0x01); 24395 pub const DIV4: Self = Self(0x01);
24396 #[doc = "HSE divided by 8"]
24397 pub const DIV8: Self = Self(0x02);
24398 #[doc = "HSE divided by 16"]
24399 pub const DIV16: Self = Self(0x03);
23964 } 24400 }
23965 #[repr(transparent)] 24401 #[repr(transparent)]
23966 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24402 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
23967 pub struct Ssiop(pub u8); 24403 pub struct Dbgrstw(pub u8);
23968 impl Ssiop { 24404 impl Dbgrstw {
23969 #[doc = "Low level is active for SS signal"] 24405 #[doc = "Reset the module"]
23970 pub const ACTIVELOW: Self = Self(0); 24406 pub const RESET: Self = Self(0x01);
23971 #[doc = "High level is active for SS signal"]
23972 pub const ACTIVEHIGH: Self = Self(0x01);
23973 } 24407 }
23974 #[repr(transparent)] 24408 #[repr(transparent)]
23975 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24409 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
23976 pub struct Rcrcini(pub u8); 24410 pub struct Stopwuck(pub u8);
23977 impl Rcrcini { 24411 impl Stopwuck {
23978 #[doc = "All zeros RX CRC initialization pattern"] 24412 #[doc = "Internal 64 KHz to 4 MHz (MSI) oscillator selected as wake-up from Stop clock"]
23979 pub const ALLZEROS: Self = Self(0); 24413 pub const MSI: Self = Self(0);
23980 #[doc = "All ones RX CRC initialization pattern"] 24414 #[doc = "Internal 16 MHz (HSI) oscillator selected as wake-up from Stop clock (or HSI16/4 if HSI16DIVEN=1)"]
23981 pub const ALLONES: Self = Self(0x01); 24415 pub const HSI16: Self = Self(0x01);
23982 } 24416 }
23983 #[repr(transparent)] 24417 #[repr(transparent)]
23984 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24418 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
23985 pub struct Mbr(pub u8); 24419 pub struct Hsirdyie(pub u8);
23986 impl Mbr { 24420 impl Hsirdyie {
23987 #[doc = "f_spi_ker_ck / 2"] 24421 #[doc = "Ready interrupt disabled"]
23988 pub const DIV2: Self = Self(0); 24422 pub const DISABLED: Self = Self(0);
23989 #[doc = "f_spi_ker_ck / 4"] 24423 #[doc = "Ready interrupt enabled"]
23990 pub const DIV4: Self = Self(0x01); 24424 pub const ENABLED: Self = Self(0x01);
23991 #[doc = "f_spi_ker_ck / 8"]
23992 pub const DIV8: Self = Self(0x02);
23993 #[doc = "f_spi_ker_ck / 16"]
23994 pub const DIV16: Self = Self(0x03);
23995 #[doc = "f_spi_ker_ck / 32"]
23996 pub const DIV32: Self = Self(0x04);
23997 #[doc = "f_spi_ker_ck / 64"]
23998 pub const DIV64: Self = Self(0x05);
23999 #[doc = "f_spi_ker_ck / 128"]
24000 pub const DIV128: Self = Self(0x06);
24001 #[doc = "f_spi_ker_ck / 256"]
24002 pub const DIV256: Self = Self(0x07);
24003 } 24425 }
24004 #[repr(transparent)] 24426 #[repr(transparent)]
24005 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24427 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24006 pub struct Udrdet(pub u8); 24428 pub struct Csslse(pub u8);
24007 impl Udrdet { 24429 impl Csslse {
24008 #[doc = "Underrun is detected at begin of data frame"] 24430 #[doc = "LSE CSS interrupt disabled"]
24009 pub const STARTOFFRAME: Self = Self(0); 24431 pub const DISABLED: Self = Self(0);
24010 #[doc = "Underrun is detected at end of last data frame"] 24432 #[doc = "LSE CSS interrupt enabled"]
24011 pub const ENDOFFRAME: Self = Self(0x01); 24433 pub const ENABLED: Self = Self(0x01);
24012 #[doc = "Underrun is detected at begin of active SS signal"]
24013 pub const STARTOFSLAVESELECT: Self = Self(0x02);
24014 } 24434 }
24015 #[repr(transparent)] 24435 #[repr(transparent)]
24016 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24436 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24017 pub struct Afcntr(pub u8); 24437 pub struct Lsedrv(pub u8);
24018 impl Afcntr { 24438 impl Lsedrv {
24019 #[doc = "Peripheral takes no control of GPIOs while disabled"] 24439 #[doc = "Lowest drive"]
24020 pub const NOTCONTROLLED: Self = Self(0); 24440 pub const LOW: Self = Self(0);
24021 #[doc = "Peripheral controls GPIOs while disabled"] 24441 #[doc = "Medium low drive"]
24022 pub const CONTROLLED: Self = Self(0x01); 24442 pub const MEDIUMLOW: Self = Self(0x01);
24443 #[doc = "Medium high drive"]
24444 pub const MEDIUMHIGH: Self = Self(0x02);
24445 #[doc = "Highest drive"]
24446 pub const HIGH: Self = Self(0x03);
24023 } 24447 }
24024 #[repr(transparent)] 24448 #[repr(transparent)]
24025 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24449 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24026 pub struct Rxwne(pub u8); 24450 pub struct Mifsmen(pub u8);
24027 impl Rxwne { 24451 impl Mifsmen {
24028 #[doc = "Less than 32-bit data frame received"] 24452 #[doc = "NVM interface clock disabled in Sleep mode"]
24029 pub const LESSTHAN32: Self = Self(0); 24453 pub const DISABLED: Self = Self(0);
24030 #[doc = "At least 32-bit data frame received"] 24454 #[doc = "NVM interface clock enabled in Sleep mode"]
24031 pub const ATLEAST32: Self = Self(0x01); 24455 pub const ENABLED: Self = Self(0x01);
24032 } 24456 }
24033 #[repr(transparent)] 24457 #[repr(transparent)]
24034 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24458 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24035 pub struct Cpol(pub u8); 24459 pub struct Iophen(pub u8);
24036 impl Cpol { 24460 impl Iophen {
24037 #[doc = "CK to 0 when idle"] 24461 #[doc = "Port clock disabled"]
24038 pub const IDLELOW: Self = Self(0); 24462 pub const DISABLED: Self = Self(0);
24039 #[doc = "CK to 1 when idle"] 24463 #[doc = "Port clock enabled"]
24040 pub const IDLEHIGH: Self = Self(0x01); 24464 pub const ENABLED: Self = Self(0x01);
24041 } 24465 }
24042 #[repr(transparent)] 24466 #[repr(transparent)]
24043 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24467 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24044 pub struct Udrcfg(pub u8); 24468 pub struct Hsi16rdyfr(pub u8);
24045 impl Udrcfg { 24469 impl Hsi16rdyfr {
24046 #[doc = "Slave sends a constant underrun pattern"] 24470 #[doc = "HSI 16 MHz oscillator not ready"]
24047 pub const CONSTANT: Self = Self(0); 24471 pub const NOTREADY: Self = Self(0);
24048 #[doc = "Slave repeats last received data frame from master"] 24472 #[doc = "HSI 16 MHz oscillator ready"]
24049 pub const REPEATRECEIVED: Self = Self(0x01); 24473 pub const READY: Self = Self(0x01);
24050 #[doc = "Slave repeats last transmitted data frame"]
24051 pub const REPEATTRANSMITTED: Self = Self(0x02);
24052 } 24474 }
24053 #[repr(transparent)] 24475 #[repr(transparent)]
24054 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24476 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24055 pub struct Tcrcini(pub u8); 24477 pub struct Csshsecw(pub u8);
24056 impl Tcrcini { 24478 impl Csshsecw {
24057 #[doc = "All zeros TX CRC initialization pattern"] 24479 #[doc = "Clear interrupt flag"]
24058 pub const ALLZEROS: Self = Self(0); 24480 pub const CLEAR: Self = Self(0x01);
24059 #[doc = "All ones TX CRC initialization pattern"]
24060 pub const ALLONES: Self = Self(0x01);
24061 } 24481 }
24062 #[repr(transparent)] 24482 #[repr(transparent)]
24063 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24483 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24064 pub struct Comm(pub u8); 24484 pub struct Pllrdyr(pub u8);
24065 impl Comm { 24485 impl Pllrdyr {
24066 #[doc = "Full duplex"] 24486 #[doc = "PLL unlocked"]
24067 pub const FULLDUPLEX: Self = Self(0); 24487 pub const UNLOCKED: Self = Self(0);
24068 #[doc = "Simplex transmitter only"] 24488 #[doc = "PLL locked"]
24069 pub const TRANSMITTER: Self = Self(0x01); 24489 pub const LOCKED: Self = Self(0x01);
24070 #[doc = "Simplex receiver only"]
24071 pub const RECEIVER: Self = Self(0x02);
24072 #[doc = "Half duplex"]
24073 pub const HALFDUPLEX: Self = Self(0x03);
24074 } 24490 }
24075 #[repr(transparent)] 24491 #[repr(transparent)]
24076 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24492 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24077 pub struct Cpha(pub u8); 24493 pub struct Hserdyr(pub u8);
24078 impl Cpha { 24494 impl Hserdyr {
24079 #[doc = "The first clock transition is the first data capture edge"] 24495 #[doc = "Oscillator is not stable"]
24080 pub const FIRSTEDGE: Self = Self(0); 24496 pub const NOTREADY: Self = Self(0);
24081 #[doc = "The second clock transition is the first data capture edge"] 24497 #[doc = "Oscillator is stable"]
24082 pub const SECONDEDGE: Self = Self(0x01); 24498 pub const READY: Self = Self(0x01);
24083 } 24499 }
24084 #[repr(transparent)] 24500 #[repr(transparent)]
24085 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24501 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24086 pub struct Rxplvl(pub u8); 24502 pub struct Lpuartsel(pub u8);
24087 impl Rxplvl { 24503 impl Lpuartsel {
24088 #[doc = "Zero frames beyond packing ratio available"] 24504 #[doc = "APB clock selected as peripheral clock"]
24089 pub const ZEROFRAMES: Self = Self(0); 24505 pub const APB: Self = Self(0);
24090 #[doc = "One frame beyond packing ratio available"] 24506 #[doc = "System clock selected as peripheral clock"]
24091 pub const ONEFRAME: Self = Self(0x01); 24507 pub const SYSTEM: Self = Self(0x01);
24092 #[doc = "Two frame beyond packing ratio available"] 24508 #[doc = "HSI16 clock selected as peripheral clock"]
24093 pub const TWOFRAMES: Self = Self(0x02); 24509 pub const HSI16: Self = Self(0x02);
24094 #[doc = "Three frame beyond packing ratio available"] 24510 #[doc = "LSE clock selected as peripheral clock"]
24095 pub const THREEFRAMES: Self = Self(0x03); 24511 pub const LSE: Self = Self(0x03);
24096 } 24512 }
24097 #[repr(transparent)] 24513 #[repr(transparent)]
24098 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24514 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24099 pub struct Sp(pub u8); 24515 pub struct Iophrst(pub u8);
24100 impl Sp { 24516 impl Iophrst {
24101 #[doc = "Motorola SPI protocol"] 24517 #[doc = "Reset I/O port"]
24102 pub const MOTOROLA: Self = Self(0); 24518 pub const RESET: Self = Self(0x01);
24103 #[doc = "TI SPI protocol"]
24104 pub const TI: Self = Self(0x01);
24105 } 24519 }
24106 #[repr(transparent)] 24520 #[repr(transparent)]
24107 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24521 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24108 pub struct Ssom(pub u8); 24522 pub struct Crypen(pub u8);
24109 impl Ssom { 24523 impl Crypen {
24110 #[doc = "SS is asserted until data transfer complete"] 24524 #[doc = "Clock disabled"]
24111 pub const ASSERTED: Self = Self(0); 24525 pub const DISABLED: Self = Self(0);
24112 #[doc = "Data frames interleaved with SS not asserted during MIDI"] 24526 #[doc = "Clock enabled"]
24113 pub const NOTASSERTED: Self = Self(0x01); 24527 pub const ENABLED: Self = Self(0x01);
24114 } 24528 }
24115 #[repr(transparent)] 24529 #[repr(transparent)]
24116 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24530 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24117 pub struct Datfmt(pub u8); 24531 pub struct Sramsmen(pub u8);
24118 impl Datfmt { 24532 impl Sramsmen {
24119 #[doc = "The data inside RXDR and TXDR are right aligned"] 24533 #[doc = "NVM interface clock disabled in Sleep mode"]
24120 pub const RIGHTALIGNED: Self = Self(0); 24534 pub const DISABLED: Self = Self(0);
24121 #[doc = "The data inside RXDR and TXDR are left aligned"] 24535 #[doc = "NVM interface clock enabled in Sleep mode"]
24122 pub const LEFTALIGNED: Self = Self(0x01); 24536 pub const ENABLED: Self = Self(0x01);
24123 } 24537 }
24124 #[repr(transparent)] 24538 #[repr(transparent)]
24125 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24539 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24126 pub struct Datlen(pub u8); 24540 pub struct Lptimrstw(pub u8);
24127 impl Datlen { 24541 impl Lptimrstw {
24128 #[doc = "16 bit data length"] 24542 #[doc = "Reset the module"]
24129 pub const BITS16: Self = Self(0); 24543 pub const RESET: Self = Self(0x01);
24130 #[doc = "24 bit data length"]
24131 pub const BITS24: Self = Self(0x01);
24132 #[doc = "32 bit data length"]
24133 pub const BITS32: Self = Self(0x02);
24134 } 24544 }
24135 #[repr(transparent)] 24545 #[repr(transparent)]
24136 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24546 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24137 pub struct Lsbfrst(pub u8); 24547 pub struct Mcopre(pub u8);
24138 impl Lsbfrst { 24548 impl Mcopre {
24139 #[doc = "Data is transmitted/received with the MSB first"] 24549 #[doc = "No division"]
24140 pub const MSBFIRST: Self = Self(0); 24550 pub const DIV1: Self = Self(0);
24141 #[doc = "Data is transmitted/received with the LSB first"] 24551 #[doc = "Division by 2"]
24142 pub const LSBFIRST: Self = Self(0x01); 24552 pub const DIV2: Self = Self(0x01);
24553 #[doc = "Division by 4"]
24554 pub const DIV4: Self = Self(0x02);
24555 #[doc = "Division by 8"]
24556 pub const DIV8: Self = Self(0x03);
24557 #[doc = "Division by 16"]
24558 pub const DIV16: Self = Self(0x04);
24143 } 24559 }
24144 #[repr(transparent)] 24560 #[repr(transparent)]
24145 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24561 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24146 pub struct Master(pub u8); 24562 pub struct Lsebyp(pub u8);
24147 impl Master { 24563 impl Lsebyp {
24148 #[doc = "Slave configuration"] 24564 #[doc = "LSE oscillator not bypassed"]
24149 pub const SLAVE: Self = Self(0); 24565 pub const NOTBYPASSED: Self = Self(0);
24150 #[doc = "Master configuration"] 24566 #[doc = "LSE oscillator bypassed"]
24151 pub const MASTER: Self = Self(0x01); 24567 pub const BYPASSED: Self = Self(0x01);
24152 } 24568 }
24153 #[repr(transparent)] 24569 #[repr(transparent)]
24154 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24570 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24155 pub struct Crc(pub u8); 24571 pub struct Lptimsmen(pub u8);
24156 impl Crc { 24572 impl Lptimsmen {
24157 #[doc = "Full size (33/17 bit) CRC polynomial is not used"] 24573 #[doc = "Clock disabled"]
24158 pub const DISABLED: Self = Self(0); 24574 pub const DISABLED: Self = Self(0);
24159 #[doc = "Full size (33/17 bit) CRC polynomial is used"] 24575 #[doc = "Clock enabled"]
24160 pub const ENABLED: Self = Self(0x01); 24576 pub const ENABLED: Self = Self(0x01);
24161 } 24577 }
24162 #[repr(transparent)] 24578 #[repr(transparent)]
24163 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 24579 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24164 pub struct Fthlv(pub u8); 24580 pub struct Hsi48rdyfr(pub u8);
24165 impl Fthlv { 24581 impl Hsi48rdyfr {
24166 #[doc = "1 frame"] 24582 #[doc = "No clock ready interrupt"]
24167 pub const ONEFRAME: Self = Self(0); 24583 pub const NOTINTERRUPTED: Self = Self(0);
24168 #[doc = "2 frames"] 24584 #[doc = "Clock ready interrupt"]
24169 pub const TWOFRAMES: Self = Self(0x01); 24585 pub const INTERRUPTED: Self = Self(0x01);
24170 #[doc = "3 frames"] 24586 }
24171 pub const THREEFRAMES: Self = Self(0x02); 24587 #[repr(transparent)]
24172 #[doc = "4 frames"] 24588 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24173 pub const FOURFRAMES: Self = Self(0x03); 24589 pub struct Dmasmen(pub u8);
24174 #[doc = "5 frames"] 24590 impl Dmasmen {
24175 pub const FIVEFRAMES: Self = Self(0x04); 24591 #[doc = "DMA clock disabled in Sleep mode"]
24176 #[doc = "6 frames"] 24592 pub const DISABLED: Self = Self(0);
24177 pub const SIXFRAMES: Self = Self(0x05); 24593 #[doc = "DMA clock enabled in Sleep mode"]
24178 #[doc = "7 frames"] 24594 pub const ENABLED: Self = Self(0x01);
24179 pub const SEVENFRAMES: Self = Self(0x06); 24595 }
24180 #[doc = "8 frames"] 24596 #[repr(transparent)]
24181 pub const EIGHTFRAMES: Self = Self(0x07); 24597 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24182 #[doc = "9 frames"] 24598 pub struct Lserdy(pub u8);
24183 pub const NINEFRAMES: Self = Self(0x08); 24599 impl Lserdy {
24184 #[doc = "10 frames"] 24600 #[doc = "Oscillator not ready"]
24185 pub const TENFRAMES: Self = Self(0x09); 24601 pub const NOTREADY: Self = Self(0);
24186 #[doc = "11 frames"] 24602 #[doc = "Oscillator ready"]
24187 pub const ELEVENFRAMES: Self = Self(0x0a); 24603 pub const READY: Self = Self(0x01);
24188 #[doc = "12 frames"] 24604 }
24189 pub const TWELVEFRAMES: Self = Self(0x0b); 24605 #[repr(transparent)]
24190 #[doc = "13 frames"] 24606 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24191 pub const THIRTEENFRAMES: Self = Self(0x0c); 24607 pub struct Msirange(pub u8);
24192 #[doc = "14 frames"] 24608 impl Msirange {
24193 pub const FOURTEENFRAMES: Self = Self(0x0d); 24609 #[doc = "range 0 around 65.536 kHz"]
24194 #[doc = "15 frames"] 24610 pub const RANGE0: Self = Self(0);
24195 pub const FIFTEENFRAMES: Self = Self(0x0e); 24611 #[doc = "range 1 around 131.072 kHz"]
24196 #[doc = "16 frames"] 24612 pub const RANGE1: Self = Self(0x01);
24197 pub const SIXTEENFRAMES: Self = Self(0x0f); 24613 #[doc = "range 2 around 262.144 kHz"]
24614 pub const RANGE2: Self = Self(0x02);
24615 #[doc = "range 3 around 524.288 kHz"]
24616 pub const RANGE3: Self = Self(0x03);
24617 #[doc = "range 4 around 1.048 MHz"]
24618 pub const RANGE4: Self = Self(0x04);
24619 #[doc = "range 5 around 2.097 MHz (reset value)"]
24620 pub const RANGE5: Self = Self(0x05);
24621 #[doc = "range 6 around 4.194 MHz"]
24622 pub const RANGE6: Self = Self(0x06);
24623 #[doc = "not allowed"]
24624 pub const RANGE7: Self = Self(0x07);
24625 }
24626 #[repr(transparent)]
24627 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24628 pub struct Lptimsel(pub u8);
24629 impl Lptimsel {
24630 #[doc = "APB clock selected as Timer clock"]
24631 pub const APB: Self = Self(0);
24632 #[doc = "LSI clock selected as Timer clock"]
24633 pub const LSI: Self = Self(0x01);
24634 #[doc = "HSI16 clock selected as Timer clock"]
24635 pub const HSI16: Self = Self(0x02);
24636 #[doc = "LSE clock selected as Timer clock"]
24637 pub const LSE: Self = Self(0x03);
24638 }
24639 #[repr(transparent)]
24640 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24641 pub struct Plldiv(pub u8);
24642 impl Plldiv {
24643 #[doc = "PLLVCO / 2"]
24644 pub const DIV2: Self = Self(0x01);
24645 #[doc = "PLLVCO / 3"]
24646 pub const DIV3: Self = Self(0x02);
24647 #[doc = "PLLVCO / 4"]
24648 pub const DIV4: Self = Self(0x03);
24649 }
24650 #[repr(transparent)]
24651 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24652 pub struct Rtcsel(pub u8);
24653 impl Rtcsel {
24654 #[doc = "No clock"]
24655 pub const NOCLOCK: Self = Self(0);
24656 #[doc = "LSE oscillator clock used as RTC clock"]
24657 pub const LSE: Self = Self(0x01);
24658 #[doc = "LSI oscillator clock used as RTC clock"]
24659 pub const LSI: Self = Self(0x02);
24660 #[doc = "HSE oscillator clock divided by a programmable prescaler (selection through the RTCPRE[1:0]
24661bits in the RCC clock control register (RCC_CR)) used as the RTC clock"]
24662 pub const HSE: Self = Self(0x03);
24663 }
24664 #[repr(transparent)]
24665 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24666 pub struct Csslsed(pub u8);
24667 impl Csslsed {
24668 #[doc = "No failure detected on LSE (32 kHz oscillator)"]
24669 pub const NOFAILURE: Self = Self(0);
24670 #[doc = "Failure detected on LSE (32 kHz oscillator)"]
24671 pub const FAILURE: Self = Self(0x01);
24672 }
24673 #[repr(transparent)]
24674 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24675 pub struct Icsel(pub u8);
24676 impl Icsel {
24677 #[doc = "APB clock selected as peripheral clock"]
24678 pub const APB: Self = Self(0);
24679 #[doc = "System clock selected as peripheral clock"]
24680 pub const SYSTEM: Self = Self(0x01);
24681 #[doc = "HSI16 clock selected as peripheral clock"]
24682 pub const HSI16: Self = Self(0x02);
24683 }
24684 #[repr(transparent)]
24685 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24686 pub struct Hsiouten(pub u8);
24687 impl Hsiouten {
24688 #[doc = "HSI output clock disabled"]
24689 pub const DISABLED: Self = Self(0);
24690 #[doc = "HSI output clock enabled"]
24691 pub const ENABLED: Self = Self(0x01);
24692 }
24693 #[repr(transparent)]
24694 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24695 pub struct Iophsmen(pub u8);
24696 impl Iophsmen {
24697 #[doc = "Port x clock is disabled in Sleep mode"]
24698 pub const DISABLED: Self = Self(0);
24699 #[doc = "Port x clock is enabled in Sleep mode (if enabled by IOPHEN)"]
24700 pub const ENABLED: Self = Self(0x01);
24701 }
24702 #[repr(transparent)]
24703 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24704 pub struct Dbgsmen(pub u8);
24705 impl Dbgsmen {
24706 #[doc = "Clock disabled"]
24707 pub const DISABLED: Self = Self(0);
24708 #[doc = "Clock enabled"]
24709 pub const ENABLED: Self = Self(0x01);
24710 }
24711 #[repr(transparent)]
24712 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24713 pub struct Pllmul(pub u8);
24714 impl Pllmul {
24715 #[doc = "PLL clock entry x 3"]
24716 pub const MUL3: Self = Self(0);
24717 #[doc = "PLL clock entry x 4"]
24718 pub const MUL4: Self = Self(0x01);
24719 #[doc = "PLL clock entry x 6"]
24720 pub const MUL6: Self = Self(0x02);
24721 #[doc = "PLL clock entry x 8"]
24722 pub const MUL8: Self = Self(0x03);
24723 #[doc = "PLL clock entry x 12"]
24724 pub const MUL12: Self = Self(0x04);
24725 #[doc = "PLL clock entry x 16"]
24726 pub const MUL16: Self = Self(0x05);
24727 #[doc = "PLL clock entry x 24"]
24728 pub const MUL24: Self = Self(0x06);
24729 #[doc = "PLL clock entry x 32"]
24730 pub const MUL32: Self = Self(0x07);
24731 #[doc = "PLL clock entry x 48"]
24732 pub const MUL48: Self = Self(0x08);
24733 }
24734 #[repr(transparent)]
24735 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24736 pub struct Crcsmen(pub u8);
24737 impl Crcsmen {
24738 #[doc = "Test integration module clock disabled in Sleep mode"]
24739 pub const DISABLED: Self = Self(0);
24740 #[doc = "Test integration module clock enabled in Sleep mode (if enabled by CRCEN)"]
24741 pub const ENABLED: Self = Self(0x01);
24742 }
24743 #[repr(transparent)]
24744 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24745 pub struct Cryprstw(pub u8);
24746 impl Cryprstw {
24747 #[doc = "Reset the module"]
24748 pub const RESET: Self = Self(0x01);
24749 }
24750 #[repr(transparent)]
24751 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24752 pub struct Pllsrc(pub u8);
24753 impl Pllsrc {
24754 #[doc = "HSI selected as PLL input clock"]
24755 pub const HSI16: Self = Self(0);
24756 #[doc = "HSE selected as PLL input clock"]
24757 pub const HSE: Self = Self(0x01);
24758 }
24759 #[repr(transparent)]
24760 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24761 pub struct Csshsef(pub u8);
24762 impl Csshsef {
24763 #[doc = "No clock security interrupt caused by HSE clock failure"]
24764 pub const NOCLOCK: Self = Self(0);
24765 #[doc = "Clock security interrupt caused by HSE clock failure"]
24766 pub const CLOCK: Self = Self(0x01);
24767 }
24768 #[repr(transparent)]
24769 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24770 pub struct Hsebyp(pub u8);
24771 impl Hsebyp {
24772 #[doc = "HSE oscillator not bypassed"]
24773 pub const NOTBYPASSED: Self = Self(0);
24774 #[doc = "HSE oscillator bypassed"]
24775 pub const BYPASSED: Self = Self(0x01);
24776 }
24777 #[repr(transparent)]
24778 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24779 pub struct Pllon(pub u8);
24780 impl Pllon {
24781 #[doc = "Clock disabled"]
24782 pub const DISABLED: Self = Self(0);
24783 #[doc = "Clock enabled"]
24784 pub const ENABLED: Self = Self(0x01);
24785 }
24786 #[repr(transparent)]
24787 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24788 pub struct Rtcen(pub u8);
24789 impl Rtcen {
24790 #[doc = "RTC clock disabled"]
24791 pub const DISABLED: Self = Self(0);
24792 #[doc = "RTC clock enabled"]
24793 pub const ENABLED: Self = Self(0x01);
24794 }
24795 #[repr(transparent)]
24796 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24797 pub struct Hsidivfr(pub u8);
24798 impl Hsidivfr {
24799 #[doc = "16 MHz HSI clock not divided"]
24800 pub const NOTDIVIDED: Self = Self(0);
24801 #[doc = "16 MHz HSI clock divided by 4"]
24802 pub const DIV4: Self = Self(0x01);
24803 }
24804 #[repr(transparent)]
24805 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24806 pub struct Lpwrrstfr(pub u8);
24807 impl Lpwrrstfr {
24808 #[doc = "No reset has occured"]
24809 pub const NORESET: Self = Self(0);
24810 #[doc = "A reset has occured"]
24811 pub const RESET: Self = Self(0x01);
24812 }
24813 #[repr(transparent)]
24814 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24815 pub struct Hsidiven(pub u8);
24816 impl Hsidiven {
24817 #[doc = "no 16 MHz HSI division requested"]
24818 pub const NOTDIVIDED: Self = Self(0);
24819 #[doc = "16 MHz HSI division by 4 requested"]
24820 pub const DIV4: Self = Self(0x01);
24821 }
24822 #[repr(transparent)]
24823 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24824 pub struct Rmvfw(pub u8);
24825 impl Rmvfw {
24826 #[doc = "Clears the reset flag"]
24827 pub const CLEAR: Self = Self(0x01);
24828 }
24829 #[repr(transparent)]
24830 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24831 pub struct Ppre(pub u8);
24832 impl Ppre {
24833 #[doc = "HCLK not divided"]
24834 pub const DIV1: Self = Self(0);
24835 #[doc = "HCLK divided by 2"]
24836 pub const DIV2: Self = Self(0x04);
24837 #[doc = "HCLK divided by 4"]
24838 pub const DIV4: Self = Self(0x05);
24839 #[doc = "HCLK divided by 8"]
24840 pub const DIV8: Self = Self(0x06);
24841 #[doc = "HCLK divided by 16"]
24842 pub const DIV16: Self = Self(0x07);
24843 }
24844 #[repr(transparent)]
24845 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24846 pub struct Sws(pub u8);
24847 impl Sws {
24848 #[doc = "MSI oscillator used as system clock"]
24849 pub const MSI: Self = Self(0);
24850 #[doc = "HSI oscillator used as system clock"]
24851 pub const HSI16: Self = Self(0x01);
24852 #[doc = "HSE oscillator used as system clock"]
24853 pub const HSE: Self = Self(0x02);
24854 #[doc = "PLL used as system clock"]
24855 pub const PLL: Self = Self(0x03);
24856 }
24857 #[repr(transparent)]
24858 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24859 pub struct Csslsef(pub u8);
24860 impl Csslsef {
24861 #[doc = "No failure detected on LSE clock failure"]
24862 pub const NOFAILURE: Self = Self(0);
24863 #[doc = "Failure detected on LSE clock failure"]
24864 pub const FAILURE: Self = Self(0x01);
24865 }
24866 #[repr(transparent)]
24867 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24868 pub struct Mcosel(pub u8);
24869 impl Mcosel {
24870 #[doc = "No clock"]
24871 pub const NOCLOCK: Self = Self(0);
24872 #[doc = "SYSCLK clock selected"]
24873 pub const SYSCLK: Self = Self(0x01);
24874 #[doc = "HSI oscillator clock selected"]
24875 pub const HSI16: Self = Self(0x02);
24876 #[doc = "MSI oscillator clock selected"]
24877 pub const MSI: Self = Self(0x03);
24878 #[doc = "HSE oscillator clock selected"]
24879 pub const HSE: Self = Self(0x04);
24880 #[doc = "PLL clock selected"]
24881 pub const PLL: Self = Self(0x05);
24882 #[doc = "LSI oscillator clock selected"]
24883 pub const LSI: Self = Self(0x06);
24884 #[doc = "LSE oscillator clock selected"]
24885 pub const LSE: Self = Self(0x07);
24886 }
24887 #[repr(transparent)]
24888 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24889 pub struct Hpre(pub u8);
24890 impl Hpre {
24891 #[doc = "system clock not divided"]
24892 pub const DIV1: Self = Self(0);
24893 #[doc = "system clock divided by 2"]
24894 pub const DIV2: Self = Self(0x08);
24895 #[doc = "system clock divided by 4"]
24896 pub const DIV4: Self = Self(0x09);
24897 #[doc = "system clock divided by 8"]
24898 pub const DIV8: Self = Self(0x0a);
24899 #[doc = "system clock divided by 16"]
24900 pub const DIV16: Self = Self(0x0b);
24901 #[doc = "system clock divided by 64"]
24902 pub const DIV64: Self = Self(0x0c);
24903 #[doc = "system clock divided by 128"]
24904 pub const DIV128: Self = Self(0x0d);
24905 #[doc = "system clock divided by 256"]
24906 pub const DIV256: Self = Self(0x0e);
24907 #[doc = "system clock divided by 512"]
24908 pub const DIV512: Self = Self(0x0f);
24909 }
24910 #[repr(transparent)]
24911 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24912 pub struct Crypsmen(pub u8);
24913 impl Crypsmen {
24914 #[doc = "Crypto clock disabled in Sleep mode"]
24915 pub const DISABLED: Self = Self(0);
24916 #[doc = "Crypto clock enabled in Sleep mode"]
24917 pub const ENABLED: Self = Self(0x01);
24918 }
24919 #[repr(transparent)]
24920 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24921 pub struct Lptimen(pub u8);
24922 impl Lptimen {
24923 #[doc = "Clock disabled"]
24924 pub const DISABLED: Self = Self(0);
24925 #[doc = "Clock enabled"]
24926 pub const ENABLED: Self = Self(0x01);
24927 }
24928 #[repr(transparent)]
24929 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24930 pub struct Rtcrstw(pub u8);
24931 impl Rtcrstw {
24932 #[doc = "Resets the RTC peripheral"]
24933 pub const RESET: Self = Self(0x01);
24934 }
24935 #[repr(transparent)]
24936 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24937 pub struct Sw(pub u8);
24938 impl Sw {
24939 #[doc = "MSI oscillator used as system clock"]
24940 pub const MSI: Self = Self(0);
24941 #[doc = "HSI oscillator used as system clock"]
24942 pub const HSI16: Self = Self(0x01);
24943 #[doc = "HSE oscillator used as system clock"]
24944 pub const HSE: Self = Self(0x02);
24945 #[doc = "PLL used as system clock"]
24946 pub const PLL: Self = Self(0x03);
24947 }
24948 #[repr(transparent)]
24949 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24950 pub struct Csslseon(pub u8);
24951 impl Csslseon {
24952 #[doc = "Oscillator OFF"]
24953 pub const OFF: Self = Self(0);
24954 #[doc = "Oscillator ON"]
24955 pub const ON: Self = Self(0x01);
24956 }
24957 #[repr(transparent)]
24958 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24959 pub struct Dbgen(pub u8);
24960 impl Dbgen {
24961 #[doc = "Clock disabled"]
24962 pub const DISABLED: Self = Self(0);
24963 #[doc = "Clock enabled"]
24964 pub const ENABLED: Self = Self(0x01);
24198 } 24965 }
24199 } 24966 }
24200} 24967}
@@ -24251,104 +25018,272 @@ pub mod usart_v2 {
24251 unsafe { Reg::from_ptr(self.0.add(40usize)) } 25018 unsafe { Reg::from_ptr(self.0.add(40usize)) }
24252 } 25019 }
24253 } 25020 }
24254 pub mod regs { 25021 pub mod vals {
24255 use crate::generic::*; 25022 use crate::generic::*;
24256 #[doc = "Request register"]
24257 #[repr(transparent)] 25023 #[repr(transparent)]
24258 #[derive(Copy, Clone, Eq, PartialEq)] 25024 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24259 pub struct Rqr(pub u32); 25025 pub struct Abrrq(pub u8);
24260 impl Rqr { 25026 impl Abrrq {
24261 #[doc = "Auto baud rate request"] 25027 #[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"]
24262 pub const fn abrrq(&self) -> super::vals::Abrrq { 25028 pub const REQUEST: Self = Self(0x01);
24263 let val = (self.0 >> 0usize) & 0x01;
24264 super::vals::Abrrq(val as u8)
24265 }
24266 #[doc = "Auto baud rate request"]
24267 pub fn set_abrrq(&mut self, val: super::vals::Abrrq) {
24268 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
24269 }
24270 #[doc = "Send break request"]
24271 pub const fn sbkrq(&self) -> super::vals::Sbkrq {
24272 let val = (self.0 >> 1usize) & 0x01;
24273 super::vals::Sbkrq(val as u8)
24274 }
24275 #[doc = "Send break request"]
24276 pub fn set_sbkrq(&mut self, val: super::vals::Sbkrq) {
24277 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
24278 }
24279 #[doc = "Mute mode request"]
24280 pub const fn mmrq(&self) -> super::vals::Mmrq {
24281 let val = (self.0 >> 2usize) & 0x01;
24282 super::vals::Mmrq(val as u8)
24283 }
24284 #[doc = "Mute mode request"]
24285 pub fn set_mmrq(&mut self, val: super::vals::Mmrq) {
24286 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
24287 }
24288 #[doc = "Receive data flush request"]
24289 pub const fn rxfrq(&self) -> super::vals::Rxfrq {
24290 let val = (self.0 >> 3usize) & 0x01;
24291 super::vals::Rxfrq(val as u8)
24292 }
24293 #[doc = "Receive data flush request"]
24294 pub fn set_rxfrq(&mut self, val: super::vals::Rxfrq) {
24295 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
24296 }
24297 #[doc = "Transmit data flush request"]
24298 pub const fn txfrq(&self) -> super::vals::Txfrq {
24299 let val = (self.0 >> 4usize) & 0x01;
24300 super::vals::Txfrq(val as u8)
24301 }
24302 #[doc = "Transmit data flush request"]
24303 pub fn set_txfrq(&mut self, val: super::vals::Txfrq) {
24304 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
24305 }
24306 } 25029 }
24307 impl Default for Rqr { 25030 #[repr(transparent)]
24308 fn default() -> Rqr { 25031 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24309 Rqr(0) 25032 pub struct Cpha(pub u8);
24310 } 25033 impl Cpha {
25034 #[doc = "The first clock transition is the first data capture edge"]
25035 pub const FIRST: Self = Self(0);
25036 #[doc = "The second clock transition is the first data capture edge"]
25037 pub const SECOND: Self = Self(0x01);
24311 } 25038 }
24312 #[doc = "Baud rate register"]
24313 #[repr(transparent)] 25039 #[repr(transparent)]
24314 #[derive(Copy, Clone, Eq, PartialEq)] 25040 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24315 pub struct Brr(pub u32); 25041 pub struct M1(pub u8);
24316 impl Brr { 25042 impl M1 {
24317 #[doc = "mantissa of USARTDIV"] 25043 #[doc = "Use M0 to set the data bits"]
24318 pub const fn brr(&self) -> u16 { 25044 pub const M0: Self = Self(0);
24319 let val = (self.0 >> 0usize) & 0xffff; 25045 #[doc = "1 start bit, 7 data bits, n stop bits"]
24320 val as u16 25046 pub const BIT7: Self = Self(0x01);
24321 }
24322 #[doc = "mantissa of USARTDIV"]
24323 pub fn set_brr(&mut self, val: u16) {
24324 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
24325 }
24326 } 25047 }
24327 impl Default for Brr { 25048 #[repr(transparent)]
24328 fn default() -> Brr { 25049 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24329 Brr(0) 25050 pub struct Swap(pub u8);
24330 } 25051 impl Swap {
25052 #[doc = "TX/RX pins are used as defined in standard pinout"]
25053 pub const STANDARD: Self = Self(0);
25054 #[doc = "The TX and RX pins functions are swapped"]
25055 pub const SWAPPED: Self = Self(0x01);
24331 } 25056 }
24332 #[doc = "Data register"]
24333 #[repr(transparent)] 25057 #[repr(transparent)]
24334 #[derive(Copy, Clone, Eq, PartialEq)] 25058 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24335 pub struct Dr(pub u32); 25059 pub struct Wus(pub u8);
24336 impl Dr { 25060 impl Wus {
24337 #[doc = "data value"] 25061 #[doc = "WUF active on address match"]
24338 pub const fn dr(&self) -> u16 { 25062 pub const ADDRESS: Self = Self(0);
24339 let val = (self.0 >> 0usize) & 0x01ff; 25063 #[doc = "WuF active on Start bit detection"]
24340 val as u16 25064 pub const START: Self = Self(0x02);
24341 } 25065 #[doc = "WUF active on RXNE"]
24342 #[doc = "data value"] 25066 pub const RXNE: Self = Self(0x03);
24343 pub fn set_dr(&mut self, val: u16) {
24344 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
24345 }
24346 } 25067 }
24347 impl Default for Dr { 25068 #[repr(transparent)]
24348 fn default() -> Dr { 25069 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
24349 Dr(0) 25070 pub struct Sbkrq(pub u8);
24350 } 25071 impl Sbkrq {
25072 #[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
25073 pub const BREAK: Self = Self(0x01);
25074 }
25075 #[repr(transparent)]
25076 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25077 pub struct Ovrdis(pub u8);
25078 impl Ovrdis {
25079 #[doc = "Overrun Error Flag, ORE, is set when received data is not read before receiving new data"]
25080 pub const ENABLED: Self = Self(0);
25081 #[doc = "Overrun functionality is disabled. If new data is received while the RXNE flag is still set the ORE flag is not set and the new received data overwrites the previous content of the RDR register"]
25082 pub const DISABLED: Self = Self(0x01);
25083 }
25084 #[repr(transparent)]
25085 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25086 pub struct Rxfrq(pub u8);
25087 impl Rxfrq {
25088 #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
25089 pub const DISCARD: Self = Self(0x01);
25090 }
25091 #[repr(transparent)]
25092 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25093 pub struct Irlp(pub u8);
25094 impl Irlp {
25095 #[doc = "Normal mode"]
25096 pub const NORMAL: Self = Self(0);
25097 #[doc = "Low-power mode"]
25098 pub const LOWPOWER: Self = Self(0x01);
25099 }
25100 #[repr(transparent)]
25101 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25102 pub struct M0(pub u8);
25103 impl M0 {
25104 #[doc = "1 start bit, 8 data bits, n stop bits"]
25105 pub const BIT8: Self = Self(0);
25106 #[doc = "1 start bit, 9 data bits, n stop bits"]
25107 pub const BIT9: Self = Self(0x01);
25108 }
25109 #[repr(transparent)]
25110 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25111 pub struct Abrmod(pub u8);
25112 impl Abrmod {
25113 #[doc = "Measurement of the start bit is used to detect the baud rate"]
25114 pub const START: Self = Self(0);
25115 #[doc = "Falling edge to falling edge measurement"]
25116 pub const EDGE: Self = Self(0x01);
25117 #[doc = "0x7F frame detection"]
25118 pub const FRAME7F: Self = Self(0x02);
25119 #[doc = "0x55 frame detection"]
25120 pub const FRAME55: Self = Self(0x03);
24351 } 25121 }
25122 #[repr(transparent)]
25123 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25124 pub struct Ddre(pub u8);
25125 impl Ddre {
25126 #[doc = "DMA is not disabled in case of reception error"]
25127 pub const NOTDISABLED: Self = Self(0);
25128 #[doc = "DMA is disabled following a reception error"]
25129 pub const DISABLED: Self = Self(0x01);
25130 }
25131 #[repr(transparent)]
25132 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25133 pub struct Msbfirst(pub u8);
25134 impl Msbfirst {
25135 #[doc = "data is transmitted/received with data bit 0 first, following the start bit"]
25136 pub const LSB: Self = Self(0);
25137 #[doc = "data is transmitted/received with MSB (bit 7/8/9) first, following the start bit"]
25138 pub const MSB: Self = Self(0x01);
25139 }
25140 #[repr(transparent)]
25141 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25142 pub struct Cpol(pub u8);
25143 impl Cpol {
25144 #[doc = "Steady low value on CK pin outside transmission window"]
25145 pub const LOW: Self = Self(0);
25146 #[doc = "Steady high value on CK pin outside transmission window"]
25147 pub const HIGH: Self = Self(0x01);
25148 }
25149 #[repr(transparent)]
25150 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25151 pub struct Hdsel(pub u8);
25152 impl Hdsel {
25153 #[doc = "Half duplex mode is not selected"]
25154 pub const NOTSELECTED: Self = Self(0);
25155 #[doc = "Half duplex mode is selected"]
25156 pub const SELECTED: Self = Self(0x01);
25157 }
25158 #[repr(transparent)]
25159 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25160 pub struct Dep(pub u8);
25161 impl Dep {
25162 #[doc = "DE signal is active high"]
25163 pub const HIGH: Self = Self(0);
25164 #[doc = "DE signal is active low"]
25165 pub const LOW: Self = Self(0x01);
25166 }
25167 #[repr(transparent)]
25168 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25169 pub struct Lbdl(pub u8);
25170 impl Lbdl {
25171 #[doc = "10-bit break detection"]
25172 pub const BIT10: Self = Self(0);
25173 #[doc = "11-bit break detection"]
25174 pub const BIT11: Self = Self(0x01);
25175 }
25176 #[repr(transparent)]
25177 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25178 pub struct Datainv(pub u8);
25179 impl Datainv {
25180 #[doc = "Logical data from the data register are send/received in positive/direct logic"]
25181 pub const POSITIVE: Self = Self(0);
25182 #[doc = "Logical data from the data register are send/received in negative/inverse logic"]
25183 pub const NEGATIVE: Self = Self(0x01);
25184 }
25185 #[repr(transparent)]
25186 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25187 pub struct Lbcl(pub u8);
25188 impl Lbcl {
25189 #[doc = "The clock pulse of the last data bit is not output to the CK pin"]
25190 pub const NOTOUTPUT: Self = Self(0);
25191 #[doc = "The clock pulse of the last data bit is output to the CK pin"]
25192 pub const OUTPUT: Self = Self(0x01);
25193 }
25194 #[repr(transparent)]
25195 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25196 pub struct Txinv(pub u8);
25197 impl Txinv {
25198 #[doc = "TX pin signal works using the standard logic levels"]
25199 pub const STANDARD: Self = Self(0);
25200 #[doc = "TX pin signal values are inverted"]
25201 pub const INVERTED: Self = Self(0x01);
25202 }
25203 #[repr(transparent)]
25204 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25205 pub struct Addm(pub u8);
25206 impl Addm {
25207 #[doc = "4-bit address detection"]
25208 pub const BIT4: Self = Self(0);
25209 #[doc = "7-bit address detection"]
25210 pub const BIT7: Self = Self(0x01);
25211 }
25212 #[repr(transparent)]
25213 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25214 pub struct Stop(pub u8);
25215 impl Stop {
25216 #[doc = "1 stop bit"]
25217 pub const STOP1: Self = Self(0);
25218 #[doc = "0.5 stop bit"]
25219 pub const STOP0P5: Self = Self(0x01);
25220 #[doc = "2 stop bit"]
25221 pub const STOP2: Self = Self(0x02);
25222 #[doc = "1.5 stop bit"]
25223 pub const STOP1P5: Self = Self(0x03);
25224 }
25225 #[repr(transparent)]
25226 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25227 pub struct Txfrq(pub u8);
25228 impl Txfrq {
25229 #[doc = "Set the TXE flags. This allows to discard the transmit data"]
25230 pub const DISCARD: Self = Self(0x01);
25231 }
25232 #[repr(transparent)]
25233 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25234 pub struct Wake(pub u8);
25235 impl Wake {
25236 #[doc = "Idle line"]
25237 pub const IDLE: Self = Self(0);
25238 #[doc = "Address mask"]
25239 pub const ADDRESS: Self = Self(0x01);
25240 }
25241 #[repr(transparent)]
25242 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25243 pub struct Ps(pub u8);
25244 impl Ps {
25245 #[doc = "Even parity"]
25246 pub const EVEN: Self = Self(0);
25247 #[doc = "Odd parity"]
25248 pub const ODD: Self = Self(0x01);
25249 }
25250 #[repr(transparent)]
25251 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25252 pub struct Over(pub u8);
25253 impl Over {
25254 #[doc = "Oversampling by 16"]
25255 pub const OVERSAMPLING16: Self = Self(0);
25256 #[doc = "Oversampling by 8"]
25257 pub const OVERSAMPLING8: Self = Self(0x01);
25258 }
25259 #[repr(transparent)]
25260 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25261 pub struct Mmrq(pub u8);
25262 impl Mmrq {
25263 #[doc = "Puts the USART in mute mode and sets the RWU flag"]
25264 pub const MUTE: Self = Self(0x01);
25265 }
25266 #[repr(transparent)]
25267 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25268 pub struct Rxinv(pub u8);
25269 impl Rxinv {
25270 #[doc = "RX pin signal works using the standard logic levels"]
25271 pub const STANDARD: Self = Self(0);
25272 #[doc = "RX pin signal values are inverted"]
25273 pub const INVERTED: Self = Self(0x01);
25274 }
25275 #[repr(transparent)]
25276 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25277 pub struct Onebit(pub u8);
25278 impl Onebit {
25279 #[doc = "Three sample bit method"]
25280 pub const SAMPLE3: Self = Self(0);
25281 #[doc = "One sample bit method"]
25282 pub const SAMPLE1: Self = Self(0x01);
25283 }
25284 }
25285 pub mod regs {
25286 use crate::generic::*;
24352 #[doc = "Guard time and prescaler register"] 25287 #[doc = "Guard time and prescaler register"]
24353 #[repr(transparent)] 25288 #[repr(transparent)]
24354 #[derive(Copy, Clone, Eq, PartialEq)] 25289 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -24378,186 +25313,34 @@ pub mod usart_v2 {
24378 Gtpr(0) 25313 Gtpr(0)
24379 } 25314 }
24380 } 25315 }
24381 #[doc = "Control register 3"] 25316 #[doc = "Receiver timeout register"]
24382 #[repr(transparent)] 25317 #[repr(transparent)]
24383 #[derive(Copy, Clone, Eq, PartialEq)] 25318 #[derive(Copy, Clone, Eq, PartialEq)]
24384 pub struct Cr3(pub u32); 25319 pub struct Rtor(pub u32);
24385 impl Cr3 { 25320 impl Rtor {
24386 #[doc = "Error interrupt enable"] 25321 #[doc = "Receiver timeout value"]
24387 pub const fn eie(&self) -> bool { 25322 pub const fn rto(&self) -> u32 {
24388 let val = (self.0 >> 0usize) & 0x01; 25323 let val = (self.0 >> 0usize) & 0x00ff_ffff;
24389 val != 0 25324 val as u32
24390 }
24391 #[doc = "Error interrupt enable"]
24392 pub fn set_eie(&mut self, val: bool) {
24393 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
24394 }
24395 #[doc = "IrDA mode enable"]
24396 pub const fn iren(&self) -> bool {
24397 let val = (self.0 >> 1usize) & 0x01;
24398 val != 0
24399 }
24400 #[doc = "IrDA mode enable"]
24401 pub fn set_iren(&mut self, val: bool) {
24402 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
24403 }
24404 #[doc = "IrDA low-power"]
24405 pub const fn irlp(&self) -> super::vals::Irlp {
24406 let val = (self.0 >> 2usize) & 0x01;
24407 super::vals::Irlp(val as u8)
24408 }
24409 #[doc = "IrDA low-power"]
24410 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
24411 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
24412 }
24413 #[doc = "Half-duplex selection"]
24414 pub const fn hdsel(&self) -> super::vals::Hdsel {
24415 let val = (self.0 >> 3usize) & 0x01;
24416 super::vals::Hdsel(val as u8)
24417 }
24418 #[doc = "Half-duplex selection"]
24419 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
24420 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
24421 }
24422 #[doc = "Smartcard NACK enable"]
24423 pub const fn nack(&self) -> bool {
24424 let val = (self.0 >> 4usize) & 0x01;
24425 val != 0
24426 }
24427 #[doc = "Smartcard NACK enable"]
24428 pub fn set_nack(&mut self, val: bool) {
24429 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
24430 }
24431 #[doc = "Smartcard mode enable"]
24432 pub const fn scen(&self) -> bool {
24433 let val = (self.0 >> 5usize) & 0x01;
24434 val != 0
24435 }
24436 #[doc = "Smartcard mode enable"]
24437 pub fn set_scen(&mut self, val: bool) {
24438 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
24439 }
24440 #[doc = "DMA enable receiver"]
24441 pub const fn dmar(&self) -> bool {
24442 let val = (self.0 >> 6usize) & 0x01;
24443 val != 0
24444 }
24445 #[doc = "DMA enable receiver"]
24446 pub fn set_dmar(&mut self, val: bool) {
24447 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
24448 }
24449 #[doc = "DMA enable transmitter"]
24450 pub const fn dmat(&self) -> bool {
24451 let val = (self.0 >> 7usize) & 0x01;
24452 val != 0
24453 }
24454 #[doc = "DMA enable transmitter"]
24455 pub fn set_dmat(&mut self, val: bool) {
24456 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
24457 }
24458 #[doc = "RTS enable"]
24459 pub const fn rtse(&self) -> bool {
24460 let val = (self.0 >> 8usize) & 0x01;
24461 val != 0
24462 }
24463 #[doc = "RTS enable"]
24464 pub fn set_rtse(&mut self, val: bool) {
24465 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
24466 }
24467 #[doc = "CTS enable"]
24468 pub const fn ctse(&self) -> bool {
24469 let val = (self.0 >> 9usize) & 0x01;
24470 val != 0
24471 }
24472 #[doc = "CTS enable"]
24473 pub fn set_ctse(&mut self, val: bool) {
24474 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
24475 }
24476 #[doc = "CTS interrupt enable"]
24477 pub const fn ctsie(&self) -> bool {
24478 let val = (self.0 >> 10usize) & 0x01;
24479 val != 0
24480 }
24481 #[doc = "CTS interrupt enable"]
24482 pub fn set_ctsie(&mut self, val: bool) {
24483 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
24484 }
24485 #[doc = "One sample bit method enable"]
24486 pub const fn onebit(&self) -> super::vals::Onebit {
24487 let val = (self.0 >> 11usize) & 0x01;
24488 super::vals::Onebit(val as u8)
24489 }
24490 #[doc = "One sample bit method enable"]
24491 pub fn set_onebit(&mut self, val: super::vals::Onebit) {
24492 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
24493 }
24494 #[doc = "Overrun Disable"]
24495 pub const fn ovrdis(&self) -> super::vals::Ovrdis {
24496 let val = (self.0 >> 12usize) & 0x01;
24497 super::vals::Ovrdis(val as u8)
24498 }
24499 #[doc = "Overrun Disable"]
24500 pub fn set_ovrdis(&mut self, val: super::vals::Ovrdis) {
24501 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
24502 }
24503 #[doc = "DMA Disable on Reception Error"]
24504 pub const fn ddre(&self) -> bool {
24505 let val = (self.0 >> 13usize) & 0x01;
24506 val != 0
24507 }
24508 #[doc = "DMA Disable on Reception Error"]
24509 pub fn set_ddre(&mut self, val: bool) {
24510 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
24511 }
24512 #[doc = "Driver enable mode"]
24513 pub const fn dem(&self) -> bool {
24514 let val = (self.0 >> 14usize) & 0x01;
24515 val != 0
24516 }
24517 #[doc = "Driver enable mode"]
24518 pub fn set_dem(&mut self, val: bool) {
24519 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
24520 }
24521 #[doc = "Driver enable polarity selection"]
24522 pub const fn dep(&self) -> super::vals::Dep {
24523 let val = (self.0 >> 15usize) & 0x01;
24524 super::vals::Dep(val as u8)
24525 } 25325 }
24526 #[doc = "Driver enable polarity selection"] 25326 #[doc = "Receiver timeout value"]
24527 pub fn set_dep(&mut self, val: super::vals::Dep) { 25327 pub fn set_rto(&mut self, val: u32) {
24528 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 25328 self.0 =
25329 (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
24529 } 25330 }
24530 #[doc = "Smartcard auto-retry count"] 25331 #[doc = "Block Length"]
24531 pub const fn scarcnt(&self) -> u8 { 25332 pub const fn blen(&self) -> u8 {
24532 let val = (self.0 >> 17usize) & 0x07; 25333 let val = (self.0 >> 24usize) & 0xff;
24533 val as u8 25334 val as u8
24534 } 25335 }
24535 #[doc = "Smartcard auto-retry count"] 25336 #[doc = "Block Length"]
24536 pub fn set_scarcnt(&mut self, val: u8) { 25337 pub fn set_blen(&mut self, val: u8) {
24537 self.0 = (self.0 & !(0x07 << 17usize)) | (((val as u32) & 0x07) << 17usize); 25338 self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize);
24538 }
24539 #[doc = "Wakeup from Stop mode interrupt flag selection"]
24540 pub const fn wus(&self) -> super::vals::Wus {
24541 let val = (self.0 >> 20usize) & 0x03;
24542 super::vals::Wus(val as u8)
24543 }
24544 #[doc = "Wakeup from Stop mode interrupt flag selection"]
24545 pub fn set_wus(&mut self, val: super::vals::Wus) {
24546 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
24547 }
24548 #[doc = "Wakeup from Stop mode interrupt enable"]
24549 pub const fn wufie(&self) -> bool {
24550 let val = (self.0 >> 22usize) & 0x01;
24551 val != 0
24552 }
24553 #[doc = "Wakeup from Stop mode interrupt enable"]
24554 pub fn set_wufie(&mut self, val: bool) {
24555 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
24556 } 25339 }
24557 } 25340 }
24558 impl Default for Cr3 { 25341 impl Default for Rtor {
24559 fn default() -> Cr3 { 25342 fn default() -> Rtor {
24560 Cr3(0) 25343 Rtor(0)
24561 } 25344 }
24562 } 25345 }
24563 #[doc = "Control register 1"] 25346 #[doc = "Control register 1"]
@@ -24764,6 +25547,188 @@ pub mod usart_v2 {
24764 Cr1(0) 25547 Cr1(0)
24765 } 25548 }
24766 } 25549 }
25550 #[doc = "Control register 3"]
25551 #[repr(transparent)]
25552 #[derive(Copy, Clone, Eq, PartialEq)]
25553 pub struct Cr3(pub u32);
25554 impl Cr3 {
25555 #[doc = "Error interrupt enable"]
25556 pub const fn eie(&self) -> bool {
25557 let val = (self.0 >> 0usize) & 0x01;
25558 val != 0
25559 }
25560 #[doc = "Error interrupt enable"]
25561 pub fn set_eie(&mut self, val: bool) {
25562 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
25563 }
25564 #[doc = "IrDA mode enable"]
25565 pub const fn iren(&self) -> bool {
25566 let val = (self.0 >> 1usize) & 0x01;
25567 val != 0
25568 }
25569 #[doc = "IrDA mode enable"]
25570 pub fn set_iren(&mut self, val: bool) {
25571 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
25572 }
25573 #[doc = "IrDA low-power"]
25574 pub const fn irlp(&self) -> super::vals::Irlp {
25575 let val = (self.0 >> 2usize) & 0x01;
25576 super::vals::Irlp(val as u8)
25577 }
25578 #[doc = "IrDA low-power"]
25579 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
25580 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
25581 }
25582 #[doc = "Half-duplex selection"]
25583 pub const fn hdsel(&self) -> super::vals::Hdsel {
25584 let val = (self.0 >> 3usize) & 0x01;
25585 super::vals::Hdsel(val as u8)
25586 }
25587 #[doc = "Half-duplex selection"]
25588 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
25589 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
25590 }
25591 #[doc = "Smartcard NACK enable"]
25592 pub const fn nack(&self) -> bool {
25593 let val = (self.0 >> 4usize) & 0x01;
25594 val != 0
25595 }
25596 #[doc = "Smartcard NACK enable"]
25597 pub fn set_nack(&mut self, val: bool) {
25598 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
25599 }
25600 #[doc = "Smartcard mode enable"]
25601 pub const fn scen(&self) -> bool {
25602 let val = (self.0 >> 5usize) & 0x01;
25603 val != 0
25604 }
25605 #[doc = "Smartcard mode enable"]
25606 pub fn set_scen(&mut self, val: bool) {
25607 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
25608 }
25609 #[doc = "DMA enable receiver"]
25610 pub const fn dmar(&self) -> bool {
25611 let val = (self.0 >> 6usize) & 0x01;
25612 val != 0
25613 }
25614 #[doc = "DMA enable receiver"]
25615 pub fn set_dmar(&mut self, val: bool) {
25616 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
25617 }
25618 #[doc = "DMA enable transmitter"]
25619 pub const fn dmat(&self) -> bool {
25620 let val = (self.0 >> 7usize) & 0x01;
25621 val != 0
25622 }
25623 #[doc = "DMA enable transmitter"]
25624 pub fn set_dmat(&mut self, val: bool) {
25625 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
25626 }
25627 #[doc = "RTS enable"]
25628 pub const fn rtse(&self) -> bool {
25629 let val = (self.0 >> 8usize) & 0x01;
25630 val != 0
25631 }
25632 #[doc = "RTS enable"]
25633 pub fn set_rtse(&mut self, val: bool) {
25634 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
25635 }
25636 #[doc = "CTS enable"]
25637 pub const fn ctse(&self) -> bool {
25638 let val = (self.0 >> 9usize) & 0x01;
25639 val != 0
25640 }
25641 #[doc = "CTS enable"]
25642 pub fn set_ctse(&mut self, val: bool) {
25643 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
25644 }
25645 #[doc = "CTS interrupt enable"]
25646 pub const fn ctsie(&self) -> bool {
25647 let val = (self.0 >> 10usize) & 0x01;
25648 val != 0
25649 }
25650 #[doc = "CTS interrupt enable"]
25651 pub fn set_ctsie(&mut self, val: bool) {
25652 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
25653 }
25654 #[doc = "One sample bit method enable"]
25655 pub const fn onebit(&self) -> super::vals::Onebit {
25656 let val = (self.0 >> 11usize) & 0x01;
25657 super::vals::Onebit(val as u8)
25658 }
25659 #[doc = "One sample bit method enable"]
25660 pub fn set_onebit(&mut self, val: super::vals::Onebit) {
25661 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
25662 }
25663 #[doc = "Overrun Disable"]
25664 pub const fn ovrdis(&self) -> super::vals::Ovrdis {
25665 let val = (self.0 >> 12usize) & 0x01;
25666 super::vals::Ovrdis(val as u8)
25667 }
25668 #[doc = "Overrun Disable"]
25669 pub fn set_ovrdis(&mut self, val: super::vals::Ovrdis) {
25670 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
25671 }
25672 #[doc = "DMA Disable on Reception Error"]
25673 pub const fn ddre(&self) -> bool {
25674 let val = (self.0 >> 13usize) & 0x01;
25675 val != 0
25676 }
25677 #[doc = "DMA Disable on Reception Error"]
25678 pub fn set_ddre(&mut self, val: bool) {
25679 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
25680 }
25681 #[doc = "Driver enable mode"]
25682 pub const fn dem(&self) -> bool {
25683 let val = (self.0 >> 14usize) & 0x01;
25684 val != 0
25685 }
25686 #[doc = "Driver enable mode"]
25687 pub fn set_dem(&mut self, val: bool) {
25688 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
25689 }
25690 #[doc = "Driver enable polarity selection"]
25691 pub const fn dep(&self) -> super::vals::Dep {
25692 let val = (self.0 >> 15usize) & 0x01;
25693 super::vals::Dep(val as u8)
25694 }
25695 #[doc = "Driver enable polarity selection"]
25696 pub fn set_dep(&mut self, val: super::vals::Dep) {
25697 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
25698 }
25699 #[doc = "Smartcard auto-retry count"]
25700 pub const fn scarcnt(&self) -> u8 {
25701 let val = (self.0 >> 17usize) & 0x07;
25702 val as u8
25703 }
25704 #[doc = "Smartcard auto-retry count"]
25705 pub fn set_scarcnt(&mut self, val: u8) {
25706 self.0 = (self.0 & !(0x07 << 17usize)) | (((val as u32) & 0x07) << 17usize);
25707 }
25708 #[doc = "Wakeup from Stop mode interrupt flag selection"]
25709 pub const fn wus(&self) -> super::vals::Wus {
25710 let val = (self.0 >> 20usize) & 0x03;
25711 super::vals::Wus(val as u8)
25712 }
25713 #[doc = "Wakeup from Stop mode interrupt flag selection"]
25714 pub fn set_wus(&mut self, val: super::vals::Wus) {
25715 self.0 = (self.0 & !(0x03 << 20usize)) | (((val.0 as u32) & 0x03) << 20usize);
25716 }
25717 #[doc = "Wakeup from Stop mode interrupt enable"]
25718 pub const fn wufie(&self) -> bool {
25719 let val = (self.0 >> 22usize) & 0x01;
25720 val != 0
25721 }
25722 #[doc = "Wakeup from Stop mode interrupt enable"]
25723 pub fn set_wufie(&mut self, val: bool) {
25724 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
25725 }
25726 }
25727 impl Default for Cr3 {
25728 fn default() -> Cr3 {
25729 Cr3(0)
25730 }
25731 }
24767 #[doc = "Interrupt & status register"] 25732 #[doc = "Interrupt & status register"]
24768 #[repr(transparent)] 25733 #[repr(transparent)]
24769 #[derive(Copy, Clone, Eq, PartialEq)] 25734 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -24973,34 +25938,80 @@ pub mod usart_v2 {
24973 Ixr(0) 25938 Ixr(0)
24974 } 25939 }
24975 } 25940 }
24976 #[doc = "Receiver timeout register"] 25941 #[doc = "Data register"]
24977 #[repr(transparent)] 25942 #[repr(transparent)]
24978 #[derive(Copy, Clone, Eq, PartialEq)] 25943 #[derive(Copy, Clone, Eq, PartialEq)]
24979 pub struct Rtor(pub u32); 25944 pub struct Dr(pub u32);
24980 impl Rtor { 25945 impl Dr {
24981 #[doc = "Receiver timeout value"] 25946 #[doc = "data value"]
24982 pub const fn rto(&self) -> u32 { 25947 pub const fn dr(&self) -> u16 {
24983 let val = (self.0 >> 0usize) & 0x00ff_ffff; 25948 let val = (self.0 >> 0usize) & 0x01ff;
24984 val as u32 25949 val as u16
24985 } 25950 }
24986 #[doc = "Receiver timeout value"] 25951 #[doc = "data value"]
24987 pub fn set_rto(&mut self, val: u32) { 25952 pub fn set_dr(&mut self, val: u16) {
24988 self.0 = 25953 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
24989 (self.0 & !(0x00ff_ffff << 0usize)) | (((val as u32) & 0x00ff_ffff) << 0usize);
24990 } 25954 }
24991 #[doc = "Block Length"] 25955 }
24992 pub const fn blen(&self) -> u8 { 25956 impl Default for Dr {
24993 let val = (self.0 >> 24usize) & 0xff; 25957 fn default() -> Dr {
24994 val as u8 25958 Dr(0)
24995 } 25959 }
24996 #[doc = "Block Length"] 25960 }
24997 pub fn set_blen(&mut self, val: u8) { 25961 #[doc = "Request register"]
24998 self.0 = (self.0 & !(0xff << 24usize)) | (((val as u32) & 0xff) << 24usize); 25962 #[repr(transparent)]
25963 #[derive(Copy, Clone, Eq, PartialEq)]
25964 pub struct Rqr(pub u32);
25965 impl Rqr {
25966 #[doc = "Auto baud rate request"]
25967 pub const fn abrrq(&self) -> super::vals::Abrrq {
25968 let val = (self.0 >> 0usize) & 0x01;
25969 super::vals::Abrrq(val as u8)
25970 }
25971 #[doc = "Auto baud rate request"]
25972 pub fn set_abrrq(&mut self, val: super::vals::Abrrq) {
25973 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
25974 }
25975 #[doc = "Send break request"]
25976 pub const fn sbkrq(&self) -> super::vals::Sbkrq {
25977 let val = (self.0 >> 1usize) & 0x01;
25978 super::vals::Sbkrq(val as u8)
25979 }
25980 #[doc = "Send break request"]
25981 pub fn set_sbkrq(&mut self, val: super::vals::Sbkrq) {
25982 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
25983 }
25984 #[doc = "Mute mode request"]
25985 pub const fn mmrq(&self) -> super::vals::Mmrq {
25986 let val = (self.0 >> 2usize) & 0x01;
25987 super::vals::Mmrq(val as u8)
25988 }
25989 #[doc = "Mute mode request"]
25990 pub fn set_mmrq(&mut self, val: super::vals::Mmrq) {
25991 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
25992 }
25993 #[doc = "Receive data flush request"]
25994 pub const fn rxfrq(&self) -> super::vals::Rxfrq {
25995 let val = (self.0 >> 3usize) & 0x01;
25996 super::vals::Rxfrq(val as u8)
25997 }
25998 #[doc = "Receive data flush request"]
25999 pub fn set_rxfrq(&mut self, val: super::vals::Rxfrq) {
26000 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
26001 }
26002 #[doc = "Transmit data flush request"]
26003 pub const fn txfrq(&self) -> super::vals::Txfrq {
26004 let val = (self.0 >> 4usize) & 0x01;
26005 super::vals::Txfrq(val as u8)
26006 }
26007 #[doc = "Transmit data flush request"]
26008 pub fn set_txfrq(&mut self, val: super::vals::Txfrq) {
26009 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
24999 } 26010 }
25000 } 26011 }
25001 impl Default for Rtor { 26012 impl Default for Rqr {
25002 fn default() -> Rtor { 26013 fn default() -> Rqr {
25003 Rtor(0) 26014 Rqr(0)
25004 } 26015 }
25005 } 26016 }
25006 #[doc = "Control register 2"] 26017 #[doc = "Control register 2"]
@@ -25180,1036 +26191,25 @@ pub mod usart_v2 {
25180 Cr2(0) 26191 Cr2(0)
25181 } 26192 }
25182 } 26193 }
25183 } 26194 #[doc = "Baud rate register"]
25184 pub mod vals {
25185 use crate::generic::*;
25186 #[repr(transparent)]
25187 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25188 pub struct Abrmod(pub u8);
25189 impl Abrmod {
25190 #[doc = "Measurement of the start bit is used to detect the baud rate"]
25191 pub const START: Self = Self(0);
25192 #[doc = "Falling edge to falling edge measurement"]
25193 pub const EDGE: Self = Self(0x01);
25194 #[doc = "0x7F frame detection"]
25195 pub const FRAME7F: Self = Self(0x02);
25196 #[doc = "0x55 frame detection"]
25197 pub const FRAME55: Self = Self(0x03);
25198 }
25199 #[repr(transparent)]
25200 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25201 pub struct Ddre(pub u8);
25202 impl Ddre {
25203 #[doc = "DMA is not disabled in case of reception error"]
25204 pub const NOTDISABLED: Self = Self(0);
25205 #[doc = "DMA is disabled following a reception error"]
25206 pub const DISABLED: Self = Self(0x01);
25207 }
25208 #[repr(transparent)]
25209 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25210 pub struct Msbfirst(pub u8);
25211 impl Msbfirst {
25212 #[doc = "data is transmitted/received with data bit 0 first, following the start bit"]
25213 pub const LSB: Self = Self(0);
25214 #[doc = "data is transmitted/received with MSB (bit 7/8/9) first, following the start bit"]
25215 pub const MSB: Self = Self(0x01);
25216 }
25217 #[repr(transparent)]
25218 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25219 pub struct Stop(pub u8);
25220 impl Stop {
25221 #[doc = "1 stop bit"]
25222 pub const STOP1: Self = Self(0);
25223 #[doc = "0.5 stop bit"]
25224 pub const STOP0P5: Self = Self(0x01);
25225 #[doc = "2 stop bit"]
25226 pub const STOP2: Self = Self(0x02);
25227 #[doc = "1.5 stop bit"]
25228 pub const STOP1P5: Self = Self(0x03);
25229 }
25230 #[repr(transparent)]
25231 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25232 pub struct Sbkrq(pub u8);
25233 impl Sbkrq {
25234 #[doc = "sets the SBKF flag and request to send a BREAK on the line, as soon as the transmit machine is available"]
25235 pub const BREAK: Self = Self(0x01);
25236 }
25237 #[repr(transparent)]
25238 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25239 pub struct Wake(pub u8);
25240 impl Wake {
25241 #[doc = "Idle line"]
25242 pub const IDLE: Self = Self(0);
25243 #[doc = "Address mask"]
25244 pub const ADDRESS: Self = Self(0x01);
25245 }
25246 #[repr(transparent)]
25247 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25248 pub struct Wus(pub u8);
25249 impl Wus {
25250 #[doc = "WUF active on address match"]
25251 pub const ADDRESS: Self = Self(0);
25252 #[doc = "WuF active on Start bit detection"]
25253 pub const START: Self = Self(0x02);
25254 #[doc = "WUF active on RXNE"]
25255 pub const RXNE: Self = Self(0x03);
25256 }
25257 #[repr(transparent)]
25258 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25259 pub struct Lbdl(pub u8);
25260 impl Lbdl {
25261 #[doc = "10-bit break detection"]
25262 pub const BIT10: Self = Self(0);
25263 #[doc = "11-bit break detection"]
25264 pub const BIT11: Self = Self(0x01);
25265 }
25266 #[repr(transparent)]
25267 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25268 pub struct M0(pub u8);
25269 impl M0 {
25270 #[doc = "1 start bit, 8 data bits, n stop bits"]
25271 pub const BIT8: Self = Self(0);
25272 #[doc = "1 start bit, 9 data bits, n stop bits"]
25273 pub const BIT9: Self = Self(0x01);
25274 }
25275 #[repr(transparent)]
25276 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25277 pub struct Hdsel(pub u8);
25278 impl Hdsel {
25279 #[doc = "Half duplex mode is not selected"]
25280 pub const NOTSELECTED: Self = Self(0);
25281 #[doc = "Half duplex mode is selected"]
25282 pub const SELECTED: Self = Self(0x01);
25283 }
25284 #[repr(transparent)]
25285 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25286 pub struct Over(pub u8);
25287 impl Over {
25288 #[doc = "Oversampling by 16"]
25289 pub const OVERSAMPLING16: Self = Self(0);
25290 #[doc = "Oversampling by 8"]
25291 pub const OVERSAMPLING8: Self = Self(0x01);
25292 }
25293 #[repr(transparent)]
25294 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25295 pub struct Ps(pub u8);
25296 impl Ps {
25297 #[doc = "Even parity"]
25298 pub const EVEN: Self = Self(0);
25299 #[doc = "Odd parity"]
25300 pub const ODD: Self = Self(0x01);
25301 }
25302 #[repr(transparent)]
25303 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25304 pub struct Rxinv(pub u8);
25305 impl Rxinv {
25306 #[doc = "RX pin signal works using the standard logic levels"]
25307 pub const STANDARD: Self = Self(0);
25308 #[doc = "RX pin signal values are inverted"]
25309 pub const INVERTED: Self = Self(0x01);
25310 }
25311 #[repr(transparent)]
25312 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25313 pub struct Addm(pub u8);
25314 impl Addm {
25315 #[doc = "4-bit address detection"]
25316 pub const BIT4: Self = Self(0);
25317 #[doc = "7-bit address detection"]
25318 pub const BIT7: Self = Self(0x01);
25319 }
25320 #[repr(transparent)]
25321 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25322 pub struct Mmrq(pub u8);
25323 impl Mmrq {
25324 #[doc = "Puts the USART in mute mode and sets the RWU flag"]
25325 pub const MUTE: Self = Self(0x01);
25326 }
25327 #[repr(transparent)]
25328 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25329 pub struct Datainv(pub u8);
25330 impl Datainv {
25331 #[doc = "Logical data from the data register are send/received in positive/direct logic"]
25332 pub const POSITIVE: Self = Self(0);
25333 #[doc = "Logical data from the data register are send/received in negative/inverse logic"]
25334 pub const NEGATIVE: Self = Self(0x01);
25335 }
25336 #[repr(transparent)]
25337 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25338 pub struct M1(pub u8);
25339 impl M1 {
25340 #[doc = "Use M0 to set the data bits"]
25341 pub const M0: Self = Self(0);
25342 #[doc = "1 start bit, 7 data bits, n stop bits"]
25343 pub const BIT7: Self = Self(0x01);
25344 }
25345 #[repr(transparent)]
25346 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25347 pub struct Onebit(pub u8);
25348 impl Onebit {
25349 #[doc = "Three sample bit method"]
25350 pub const SAMPLE3: Self = Self(0);
25351 #[doc = "One sample bit method"]
25352 pub const SAMPLE1: Self = Self(0x01);
25353 }
25354 #[repr(transparent)]
25355 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25356 pub struct Dep(pub u8);
25357 impl Dep {
25358 #[doc = "DE signal is active high"]
25359 pub const HIGH: Self = Self(0);
25360 #[doc = "DE signal is active low"]
25361 pub const LOW: Self = Self(0x01);
25362 }
25363 #[repr(transparent)]
25364 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25365 pub struct Cpha(pub u8);
25366 impl Cpha {
25367 #[doc = "The first clock transition is the first data capture edge"]
25368 pub const FIRST: Self = Self(0);
25369 #[doc = "The second clock transition is the first data capture edge"]
25370 pub const SECOND: Self = Self(0x01);
25371 }
25372 #[repr(transparent)]
25373 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25374 pub struct Rxfrq(pub u8);
25375 impl Rxfrq {
25376 #[doc = "clears the RXNE flag. This allows to discard the received data without reading it, and avoid an overrun condition"]
25377 pub const DISCARD: Self = Self(0x01);
25378 }
25379 #[repr(transparent)]
25380 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25381 pub struct Irlp(pub u8);
25382 impl Irlp {
25383 #[doc = "Normal mode"]
25384 pub const NORMAL: Self = Self(0);
25385 #[doc = "Low-power mode"]
25386 pub const LOWPOWER: Self = Self(0x01);
25387 }
25388 #[repr(transparent)]
25389 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25390 pub struct Ovrdis(pub u8);
25391 impl Ovrdis {
25392 #[doc = "Overrun Error Flag, ORE, is set when received data is not read before receiving new data"]
25393 pub const ENABLED: Self = Self(0);
25394 #[doc = "Overrun functionality is disabled. If new data is received while the RXNE flag is still set the ORE flag is not set and the new received data overwrites the previous content of the RDR register"]
25395 pub const DISABLED: Self = Self(0x01);
25396 }
25397 #[repr(transparent)]
25398 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25399 pub struct Txinv(pub u8);
25400 impl Txinv {
25401 #[doc = "TX pin signal works using the standard logic levels"]
25402 pub const STANDARD: Self = Self(0);
25403 #[doc = "TX pin signal values are inverted"]
25404 pub const INVERTED: Self = Self(0x01);
25405 }
25406 #[repr(transparent)]
25407 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25408 pub struct Cpol(pub u8);
25409 impl Cpol {
25410 #[doc = "Steady low value on CK pin outside transmission window"]
25411 pub const LOW: Self = Self(0);
25412 #[doc = "Steady high value on CK pin outside transmission window"]
25413 pub const HIGH: Self = Self(0x01);
25414 }
25415 #[repr(transparent)]
25416 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25417 pub struct Lbcl(pub u8);
25418 impl Lbcl {
25419 #[doc = "The clock pulse of the last data bit is not output to the CK pin"]
25420 pub const NOTOUTPUT: Self = Self(0);
25421 #[doc = "The clock pulse of the last data bit is output to the CK pin"]
25422 pub const OUTPUT: Self = Self(0x01);
25423 }
25424 #[repr(transparent)]
25425 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25426 pub struct Abrrq(pub u8);
25427 impl Abrrq {
25428 #[doc = "resets the ABRF flag in the USART_ISR and request an automatic baud rate measurement on the next received data frame"]
25429 pub const REQUEST: Self = Self(0x01);
25430 }
25431 #[repr(transparent)]
25432 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25433 pub struct Txfrq(pub u8);
25434 impl Txfrq {
25435 #[doc = "Set the TXE flags. This allows to discard the transmit data"]
25436 pub const DISCARD: Self = Self(0x01);
25437 }
25438 #[repr(transparent)]
25439 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25440 pub struct Swap(pub u8);
25441 impl Swap {
25442 #[doc = "TX/RX pins are used as defined in standard pinout"]
25443 pub const STANDARD: Self = Self(0);
25444 #[doc = "The TX and RX pins functions are swapped"]
25445 pub const SWAPPED: Self = Self(0x01);
25446 }
25447 }
25448}
25449pub mod spi_v1 {
25450 use crate::generic::*;
25451 #[doc = "Serial peripheral interface"]
25452 #[derive(Copy, Clone)]
25453 pub struct Spi(pub *mut u8);
25454 unsafe impl Send for Spi {}
25455 unsafe impl Sync for Spi {}
25456 impl Spi {
25457 #[doc = "control register 1"]
25458 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
25459 unsafe { Reg::from_ptr(self.0.add(0usize)) }
25460 }
25461 #[doc = "control register 2"]
25462 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
25463 unsafe { Reg::from_ptr(self.0.add(4usize)) }
25464 }
25465 #[doc = "status register"]
25466 pub fn sr(self) -> Reg<regs::Sr, RW> {
25467 unsafe { Reg::from_ptr(self.0.add(8usize)) }
25468 }
25469 #[doc = "data register"]
25470 pub fn dr(self) -> Reg<regs::Dr, RW> {
25471 unsafe { Reg::from_ptr(self.0.add(12usize)) }
25472 }
25473 #[doc = "CRC polynomial register"]
25474 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
25475 unsafe { Reg::from_ptr(self.0.add(16usize)) }
25476 }
25477 #[doc = "RX CRC register"]
25478 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
25479 unsafe { Reg::from_ptr(self.0.add(20usize)) }
25480 }
25481 #[doc = "TX CRC register"]
25482 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
25483 unsafe { Reg::from_ptr(self.0.add(24usize)) }
25484 }
25485 }
25486 pub mod regs {
25487 use crate::generic::*;
25488 #[doc = "TX CRC register"]
25489 #[repr(transparent)]
25490 #[derive(Copy, Clone, Eq, PartialEq)]
25491 pub struct Txcrcr(pub u32);
25492 impl Txcrcr {
25493 #[doc = "Tx CRC register"]
25494 pub const fn tx_crc(&self) -> u16 {
25495 let val = (self.0 >> 0usize) & 0xffff;
25496 val as u16
25497 }
25498 #[doc = "Tx CRC register"]
25499 pub fn set_tx_crc(&mut self, val: u16) {
25500 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
25501 }
25502 }
25503 impl Default for Txcrcr {
25504 fn default() -> Txcrcr {
25505 Txcrcr(0)
25506 }
25507 }
25508 #[doc = "CRC polynomial register"]
25509 #[repr(transparent)]
25510 #[derive(Copy, Clone, Eq, PartialEq)]
25511 pub struct Crcpr(pub u32);
25512 impl Crcpr {
25513 #[doc = "CRC polynomial register"]
25514 pub const fn crcpoly(&self) -> u16 {
25515 let val = (self.0 >> 0usize) & 0xffff;
25516 val as u16
25517 }
25518 #[doc = "CRC polynomial register"]
25519 pub fn set_crcpoly(&mut self, val: u16) {
25520 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
25521 }
25522 }
25523 impl Default for Crcpr {
25524 fn default() -> Crcpr {
25525 Crcpr(0)
25526 }
25527 }
25528 #[doc = "control register 2"]
25529 #[repr(transparent)]
25530 #[derive(Copy, Clone, Eq, PartialEq)]
25531 pub struct Cr2(pub u32);
25532 impl Cr2 {
25533 #[doc = "Rx buffer DMA enable"]
25534 pub const fn rxdmaen(&self) -> bool {
25535 let val = (self.0 >> 0usize) & 0x01;
25536 val != 0
25537 }
25538 #[doc = "Rx buffer DMA enable"]
25539 pub fn set_rxdmaen(&mut self, val: bool) {
25540 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
25541 }
25542 #[doc = "Tx buffer DMA enable"]
25543 pub const fn txdmaen(&self) -> bool {
25544 let val = (self.0 >> 1usize) & 0x01;
25545 val != 0
25546 }
25547 #[doc = "Tx buffer DMA enable"]
25548 pub fn set_txdmaen(&mut self, val: bool) {
25549 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
25550 }
25551 #[doc = "SS output enable"]
25552 pub const fn ssoe(&self) -> bool {
25553 let val = (self.0 >> 2usize) & 0x01;
25554 val != 0
25555 }
25556 #[doc = "SS output enable"]
25557 pub fn set_ssoe(&mut self, val: bool) {
25558 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
25559 }
25560 #[doc = "Frame format"]
25561 pub const fn frf(&self) -> super::vals::Frf {
25562 let val = (self.0 >> 4usize) & 0x01;
25563 super::vals::Frf(val as u8)
25564 }
25565 #[doc = "Frame format"]
25566 pub fn set_frf(&mut self, val: super::vals::Frf) {
25567 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
25568 }
25569 #[doc = "Error interrupt enable"]
25570 pub const fn errie(&self) -> bool {
25571 let val = (self.0 >> 5usize) & 0x01;
25572 val != 0
25573 }
25574 #[doc = "Error interrupt enable"]
25575 pub fn set_errie(&mut self, val: bool) {
25576 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
25577 }
25578 #[doc = "RX buffer not empty interrupt enable"]
25579 pub const fn rxneie(&self) -> bool {
25580 let val = (self.0 >> 6usize) & 0x01;
25581 val != 0
25582 }
25583 #[doc = "RX buffer not empty interrupt enable"]
25584 pub fn set_rxneie(&mut self, val: bool) {
25585 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
25586 }
25587 #[doc = "Tx buffer empty interrupt enable"]
25588 pub const fn txeie(&self) -> bool {
25589 let val = (self.0 >> 7usize) & 0x01;
25590 val != 0
25591 }
25592 #[doc = "Tx buffer empty interrupt enable"]
25593 pub fn set_txeie(&mut self, val: bool) {
25594 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
25595 }
25596 }
25597 impl Default for Cr2 {
25598 fn default() -> Cr2 {
25599 Cr2(0)
25600 }
25601 }
25602 #[doc = "status register"]
25603 #[repr(transparent)]
25604 #[derive(Copy, Clone, Eq, PartialEq)]
25605 pub struct Sr(pub u32);
25606 impl Sr {
25607 #[doc = "Receive buffer not empty"]
25608 pub const fn rxne(&self) -> bool {
25609 let val = (self.0 >> 0usize) & 0x01;
25610 val != 0
25611 }
25612 #[doc = "Receive buffer not empty"]
25613 pub fn set_rxne(&mut self, val: bool) {
25614 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
25615 }
25616 #[doc = "Transmit buffer empty"]
25617 pub const fn txe(&self) -> bool {
25618 let val = (self.0 >> 1usize) & 0x01;
25619 val != 0
25620 }
25621 #[doc = "Transmit buffer empty"]
25622 pub fn set_txe(&mut self, val: bool) {
25623 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
25624 }
25625 #[doc = "CRC error flag"]
25626 pub const fn crcerr(&self) -> bool {
25627 let val = (self.0 >> 4usize) & 0x01;
25628 val != 0
25629 }
25630 #[doc = "CRC error flag"]
25631 pub fn set_crcerr(&mut self, val: bool) {
25632 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
25633 }
25634 #[doc = "Mode fault"]
25635 pub const fn modf(&self) -> bool {
25636 let val = (self.0 >> 5usize) & 0x01;
25637 val != 0
25638 }
25639 #[doc = "Mode fault"]
25640 pub fn set_modf(&mut self, val: bool) {
25641 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
25642 }
25643 #[doc = "Overrun flag"]
25644 pub const fn ovr(&self) -> bool {
25645 let val = (self.0 >> 6usize) & 0x01;
25646 val != 0
25647 }
25648 #[doc = "Overrun flag"]
25649 pub fn set_ovr(&mut self, val: bool) {
25650 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
25651 }
25652 #[doc = "Busy flag"]
25653 pub const fn bsy(&self) -> bool {
25654 let val = (self.0 >> 7usize) & 0x01;
25655 val != 0
25656 }
25657 #[doc = "Busy flag"]
25658 pub fn set_bsy(&mut self, val: bool) {
25659 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
25660 }
25661 #[doc = "TI frame format error"]
25662 pub const fn fre(&self) -> bool {
25663 let val = (self.0 >> 8usize) & 0x01;
25664 val != 0
25665 }
25666 #[doc = "TI frame format error"]
25667 pub fn set_fre(&mut self, val: bool) {
25668 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
25669 }
25670 }
25671 impl Default for Sr {
25672 fn default() -> Sr {
25673 Sr(0)
25674 }
25675 }
25676 #[doc = "control register 1"]
25677 #[repr(transparent)]
25678 #[derive(Copy, Clone, Eq, PartialEq)]
25679 pub struct Cr1(pub u32);
25680 impl Cr1 {
25681 #[doc = "Clock phase"]
25682 pub const fn cpha(&self) -> super::vals::Cpha {
25683 let val = (self.0 >> 0usize) & 0x01;
25684 super::vals::Cpha(val as u8)
25685 }
25686 #[doc = "Clock phase"]
25687 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
25688 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
25689 }
25690 #[doc = "Clock polarity"]
25691 pub const fn cpol(&self) -> super::vals::Cpol {
25692 let val = (self.0 >> 1usize) & 0x01;
25693 super::vals::Cpol(val as u8)
25694 }
25695 #[doc = "Clock polarity"]
25696 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
25697 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
25698 }
25699 #[doc = "Master selection"]
25700 pub const fn mstr(&self) -> super::vals::Mstr {
25701 let val = (self.0 >> 2usize) & 0x01;
25702 super::vals::Mstr(val as u8)
25703 }
25704 #[doc = "Master selection"]
25705 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
25706 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
25707 }
25708 #[doc = "Baud rate control"]
25709 pub const fn br(&self) -> super::vals::Br {
25710 let val = (self.0 >> 3usize) & 0x07;
25711 super::vals::Br(val as u8)
25712 }
25713 #[doc = "Baud rate control"]
25714 pub fn set_br(&mut self, val: super::vals::Br) {
25715 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
25716 }
25717 #[doc = "SPI enable"]
25718 pub const fn spe(&self) -> bool {
25719 let val = (self.0 >> 6usize) & 0x01;
25720 val != 0
25721 }
25722 #[doc = "SPI enable"]
25723 pub fn set_spe(&mut self, val: bool) {
25724 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
25725 }
25726 #[doc = "Frame format"]
25727 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst {
25728 let val = (self.0 >> 7usize) & 0x01;
25729 super::vals::Lsbfirst(val as u8)
25730 }
25731 #[doc = "Frame format"]
25732 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) {
25733 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
25734 }
25735 #[doc = "Internal slave select"]
25736 pub const fn ssi(&self) -> bool {
25737 let val = (self.0 >> 8usize) & 0x01;
25738 val != 0
25739 }
25740 #[doc = "Internal slave select"]
25741 pub fn set_ssi(&mut self, val: bool) {
25742 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
25743 }
25744 #[doc = "Software slave management"]
25745 pub const fn ssm(&self) -> bool {
25746 let val = (self.0 >> 9usize) & 0x01;
25747 val != 0
25748 }
25749 #[doc = "Software slave management"]
25750 pub fn set_ssm(&mut self, val: bool) {
25751 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
25752 }
25753 #[doc = "Receive only"]
25754 pub const fn rxonly(&self) -> super::vals::Rxonly {
25755 let val = (self.0 >> 10usize) & 0x01;
25756 super::vals::Rxonly(val as u8)
25757 }
25758 #[doc = "Receive only"]
25759 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
25760 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
25761 }
25762 #[doc = "Data frame format"]
25763 pub const fn dff(&self) -> super::vals::Dff {
25764 let val = (self.0 >> 11usize) & 0x01;
25765 super::vals::Dff(val as u8)
25766 }
25767 #[doc = "Data frame format"]
25768 pub fn set_dff(&mut self, val: super::vals::Dff) {
25769 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
25770 }
25771 #[doc = "CRC transfer next"]
25772 pub const fn crcnext(&self) -> super::vals::Crcnext {
25773 let val = (self.0 >> 12usize) & 0x01;
25774 super::vals::Crcnext(val as u8)
25775 }
25776 #[doc = "CRC transfer next"]
25777 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
25778 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
25779 }
25780 #[doc = "Hardware CRC calculation enable"]
25781 pub const fn crcen(&self) -> bool {
25782 let val = (self.0 >> 13usize) & 0x01;
25783 val != 0
25784 }
25785 #[doc = "Hardware CRC calculation enable"]
25786 pub fn set_crcen(&mut self, val: bool) {
25787 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
25788 }
25789 #[doc = "Output enable in bidirectional mode"]
25790 pub const fn bidioe(&self) -> super::vals::Bidioe {
25791 let val = (self.0 >> 14usize) & 0x01;
25792 super::vals::Bidioe(val as u8)
25793 }
25794 #[doc = "Output enable in bidirectional mode"]
25795 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) {
25796 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
25797 }
25798 #[doc = "Bidirectional data mode enable"]
25799 pub const fn bidimode(&self) -> super::vals::Bidimode {
25800 let val = (self.0 >> 15usize) & 0x01;
25801 super::vals::Bidimode(val as u8)
25802 }
25803 #[doc = "Bidirectional data mode enable"]
25804 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) {
25805 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
25806 }
25807 }
25808 impl Default for Cr1 {
25809 fn default() -> Cr1 {
25810 Cr1(0)
25811 }
25812 }
25813 #[doc = "data register"]
25814 #[repr(transparent)]
25815 #[derive(Copy, Clone, Eq, PartialEq)]
25816 pub struct Dr(pub u32);
25817 impl Dr {
25818 #[doc = "Data register"]
25819 pub const fn dr(&self) -> u16 {
25820 let val = (self.0 >> 0usize) & 0xffff;
25821 val as u16
25822 }
25823 #[doc = "Data register"]
25824 pub fn set_dr(&mut self, val: u16) {
25825 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
25826 }
25827 }
25828 impl Default for Dr {
25829 fn default() -> Dr {
25830 Dr(0)
25831 }
25832 }
25833 #[doc = "RX CRC register"]
25834 #[repr(transparent)] 26195 #[repr(transparent)]
25835 #[derive(Copy, Clone, Eq, PartialEq)] 26196 #[derive(Copy, Clone, Eq, PartialEq)]
25836 pub struct Rxcrcr(pub u32); 26197 pub struct Brr(pub u32);
25837 impl Rxcrcr { 26198 impl Brr {
25838 #[doc = "Rx CRC register"] 26199 #[doc = "mantissa of USARTDIV"]
25839 pub const fn rx_crc(&self) -> u16 { 26200 pub const fn brr(&self) -> u16 {
25840 let val = (self.0 >> 0usize) & 0xffff; 26201 let val = (self.0 >> 0usize) & 0xffff;
25841 val as u16 26202 val as u16
25842 } 26203 }
25843 #[doc = "Rx CRC register"] 26204 #[doc = "mantissa of USARTDIV"]
25844 pub fn set_rx_crc(&mut self, val: u16) { 26205 pub fn set_brr(&mut self, val: u16) {
25845 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 26206 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
25846 } 26207 }
25847 } 26208 }
25848 impl Default for Rxcrcr { 26209 impl Default for Brr {
25849 fn default() -> Rxcrcr { 26210 fn default() -> Brr {
25850 Rxcrcr(0) 26211 Brr(0)
25851 }
25852 }
25853 }
25854 pub mod vals {
25855 use crate::generic::*;
25856 #[repr(transparent)]
25857 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25858 pub struct Bidioe(pub u8);
25859 impl Bidioe {
25860 #[doc = "Output disabled (receive-only mode)"]
25861 pub const OUTPUTDISABLED: Self = Self(0);
25862 #[doc = "Output enabled (transmit-only mode)"]
25863 pub const OUTPUTENABLED: Self = Self(0x01);
25864 }
25865 #[repr(transparent)]
25866 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25867 pub struct Frer(pub u8);
25868 impl Frer {
25869 #[doc = "No frame format error"]
25870 pub const NOERROR: Self = Self(0);
25871 #[doc = "A frame format error occurred"]
25872 pub const ERROR: Self = Self(0x01);
25873 }
25874 #[repr(transparent)]
25875 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25876 pub struct Iscfg(pub u8);
25877 impl Iscfg {
25878 #[doc = "Slave - transmit"]
25879 pub const SLAVETX: Self = Self(0);
25880 #[doc = "Slave - receive"]
25881 pub const SLAVERX: Self = Self(0x01);
25882 #[doc = "Master - transmit"]
25883 pub const MASTERTX: Self = Self(0x02);
25884 #[doc = "Master - receive"]
25885 pub const MASTERRX: Self = Self(0x03);
25886 }
25887 #[repr(transparent)]
25888 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25889 pub struct Dff(pub u8);
25890 impl Dff {
25891 #[doc = "8-bit data frame format is selected for transmission/reception"]
25892 pub const EIGHTBIT: Self = Self(0);
25893 #[doc = "16-bit data frame format is selected for transmission/reception"]
25894 pub const SIXTEENBIT: Self = Self(0x01);
25895 }
25896 #[repr(transparent)]
25897 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25898 pub struct Crcnext(pub u8);
25899 impl Crcnext {
25900 #[doc = "Next transmit value is from Tx buffer"]
25901 pub const TXBUFFER: Self = Self(0);
25902 #[doc = "Next transmit value is from Tx CRC register"]
25903 pub const CRC: Self = Self(0x01);
25904 }
25905 #[repr(transparent)]
25906 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25907 pub struct Br(pub u8);
25908 impl Br {
25909 #[doc = "f_PCLK / 2"]
25910 pub const DIV2: Self = Self(0);
25911 #[doc = "f_PCLK / 4"]
25912 pub const DIV4: Self = Self(0x01);
25913 #[doc = "f_PCLK / 8"]
25914 pub const DIV8: Self = Self(0x02);
25915 #[doc = "f_PCLK / 16"]
25916 pub const DIV16: Self = Self(0x03);
25917 #[doc = "f_PCLK / 32"]
25918 pub const DIV32: Self = Self(0x04);
25919 #[doc = "f_PCLK / 64"]
25920 pub const DIV64: Self = Self(0x05);
25921 #[doc = "f_PCLK / 128"]
25922 pub const DIV128: Self = Self(0x06);
25923 #[doc = "f_PCLK / 256"]
25924 pub const DIV256: Self = Self(0x07);
25925 }
25926 #[repr(transparent)]
25927 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25928 pub struct Rxonly(pub u8);
25929 impl Rxonly {
25930 #[doc = "Full duplex (Transmit and receive)"]
25931 pub const FULLDUPLEX: Self = Self(0);
25932 #[doc = "Output disabled (Receive-only mode)"]
25933 pub const OUTPUTDISABLED: Self = Self(0x01);
25934 }
25935 #[repr(transparent)]
25936 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25937 pub struct Cpha(pub u8);
25938 impl Cpha {
25939 #[doc = "The first clock transition is the first data capture edge"]
25940 pub const FIRSTEDGE: Self = Self(0);
25941 #[doc = "The second clock transition is the first data capture edge"]
25942 pub const SECONDEDGE: Self = Self(0x01);
25943 }
25944 #[repr(transparent)]
25945 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25946 pub struct Cpol(pub u8);
25947 impl Cpol {
25948 #[doc = "CK to 0 when idle"]
25949 pub const IDLELOW: Self = Self(0);
25950 #[doc = "CK to 1 when idle"]
25951 pub const IDLEHIGH: Self = Self(0x01);
25952 }
25953 #[repr(transparent)]
25954 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25955 pub struct Bidimode(pub u8);
25956 impl Bidimode {
25957 #[doc = "2-line unidirectional data mode selected"]
25958 pub const UNIDIRECTIONAL: Self = Self(0);
25959 #[doc = "1-line bidirectional data mode selected"]
25960 pub const BIDIRECTIONAL: Self = Self(0x01);
25961 }
25962 #[repr(transparent)]
25963 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25964 pub struct Mstr(pub u8);
25965 impl Mstr {
25966 #[doc = "Slave configuration"]
25967 pub const SLAVE: Self = Self(0);
25968 #[doc = "Master configuration"]
25969 pub const MASTER: Self = Self(0x01);
25970 }
25971 #[repr(transparent)]
25972 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25973 pub struct Frf(pub u8);
25974 impl Frf {
25975 #[doc = "SPI Motorola mode"]
25976 pub const MOTOROLA: Self = Self(0);
25977 #[doc = "SPI TI mode"]
25978 pub const TI: Self = Self(0x01);
25979 }
25980 #[repr(transparent)]
25981 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
25982 pub struct Lsbfirst(pub u8);
25983 impl Lsbfirst {
25984 #[doc = "Data is transmitted/received with the MSB first"]
25985 pub const MSBFIRST: Self = Self(0);
25986 #[doc = "Data is transmitted/received with the LSB first"]
25987 pub const LSBFIRST: Self = Self(0x01);
25988 }
25989 }
25990}
25991pub mod exti_v1 {
25992 use crate::generic::*;
25993 #[doc = "External interrupt/event controller"]
25994 #[derive(Copy, Clone)]
25995 pub struct Exti(pub *mut u8);
25996 unsafe impl Send for Exti {}
25997 unsafe impl Sync for Exti {}
25998 impl Exti {
25999 #[doc = "Interrupt mask register (EXTI_IMR)"]
26000 pub fn imr(self) -> Reg<regs::Imr, RW> {
26001 unsafe { Reg::from_ptr(self.0.add(0usize)) }
26002 }
26003 #[doc = "Event mask register (EXTI_EMR)"]
26004 pub fn emr(self) -> Reg<regs::Emr, RW> {
26005 unsafe { Reg::from_ptr(self.0.add(4usize)) }
26006 }
26007 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
26008 pub fn rtsr(self) -> Reg<regs::Rtsr, RW> {
26009 unsafe { Reg::from_ptr(self.0.add(8usize)) }
26010 }
26011 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
26012 pub fn ftsr(self) -> Reg<regs::Ftsr, RW> {
26013 unsafe { Reg::from_ptr(self.0.add(12usize)) }
26014 }
26015 #[doc = "Software interrupt event register (EXTI_SWIER)"]
26016 pub fn swier(self) -> Reg<regs::Swier, RW> {
26017 unsafe { Reg::from_ptr(self.0.add(16usize)) }
26018 }
26019 #[doc = "Pending register (EXTI_PR)"]
26020 pub fn pr(self) -> Reg<regs::Pr, RW> {
26021 unsafe { Reg::from_ptr(self.0.add(20usize)) }
26022 }
26023 }
26024 pub mod regs {
26025 use crate::generic::*;
26026 #[doc = "Event mask register (EXTI_EMR)"]
26027 #[repr(transparent)]
26028 #[derive(Copy, Clone, Eq, PartialEq)]
26029 pub struct Emr(pub u32);
26030 impl Emr {
26031 #[doc = "Event Mask on line 0"]
26032 pub fn mr(&self, n: usize) -> super::vals::Mr {
26033 assert!(n < 23usize);
26034 let offs = 0usize + n * 1usize;
26035 let val = (self.0 >> offs) & 0x01;
26036 super::vals::Mr(val as u8)
26037 }
26038 #[doc = "Event Mask on line 0"]
26039 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) {
26040 assert!(n < 23usize);
26041 let offs = 0usize + n * 1usize;
26042 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
26043 }
26044 }
26045 impl Default for Emr {
26046 fn default() -> Emr {
26047 Emr(0)
26048 }
26049 }
26050 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
26051 #[repr(transparent)]
26052 #[derive(Copy, Clone, Eq, PartialEq)]
26053 pub struct Rtsr(pub u32);
26054 impl Rtsr {
26055 #[doc = "Rising trigger event configuration of line 0"]
26056 pub fn tr(&self, n: usize) -> super::vals::Tr {
26057 assert!(n < 23usize);
26058 let offs = 0usize + n * 1usize;
26059 let val = (self.0 >> offs) & 0x01;
26060 super::vals::Tr(val as u8)
26061 }
26062 #[doc = "Rising trigger event configuration of line 0"]
26063 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) {
26064 assert!(n < 23usize);
26065 let offs = 0usize + n * 1usize;
26066 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
26067 }
26068 }
26069 impl Default for Rtsr {
26070 fn default() -> Rtsr {
26071 Rtsr(0)
26072 }
26073 }
26074 #[doc = "Software interrupt event register (EXTI_SWIER)"]
26075 #[repr(transparent)]
26076 #[derive(Copy, Clone, Eq, PartialEq)]
26077 pub struct Swier(pub u32);
26078 impl Swier {
26079 #[doc = "Software Interrupt on line 0"]
26080 pub fn swier(&self, n: usize) -> bool {
26081 assert!(n < 23usize);
26082 let offs = 0usize + n * 1usize;
26083 let val = (self.0 >> offs) & 0x01;
26084 val != 0
26085 }
26086 #[doc = "Software Interrupt on line 0"]
26087 pub fn set_swier(&mut self, n: usize, val: bool) {
26088 assert!(n < 23usize);
26089 let offs = 0usize + n * 1usize;
26090 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
26091 }
26092 }
26093 impl Default for Swier {
26094 fn default() -> Swier {
26095 Swier(0)
26096 }
26097 }
26098 #[doc = "Pending register (EXTI_PR)"]
26099 #[repr(transparent)]
26100 #[derive(Copy, Clone, Eq, PartialEq)]
26101 pub struct Pr(pub u32);
26102 impl Pr {
26103 #[doc = "Pending bit 0"]
26104 pub fn pr(&self, n: usize) -> bool {
26105 assert!(n < 23usize);
26106 let offs = 0usize + n * 1usize;
26107 let val = (self.0 >> offs) & 0x01;
26108 val != 0
26109 }
26110 #[doc = "Pending bit 0"]
26111 pub fn set_pr(&mut self, n: usize, val: bool) {
26112 assert!(n < 23usize);
26113 let offs = 0usize + n * 1usize;
26114 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
26115 }
26116 }
26117 impl Default for Pr {
26118 fn default() -> Pr {
26119 Pr(0)
26120 }
26121 }
26122 #[doc = "Interrupt mask register (EXTI_IMR)"]
26123 #[repr(transparent)]
26124 #[derive(Copy, Clone, Eq, PartialEq)]
26125 pub struct Imr(pub u32);
26126 impl Imr {
26127 #[doc = "Interrupt Mask on line 0"]
26128 pub fn mr(&self, n: usize) -> super::vals::Mr {
26129 assert!(n < 23usize);
26130 let offs = 0usize + n * 1usize;
26131 let val = (self.0 >> offs) & 0x01;
26132 super::vals::Mr(val as u8)
26133 }
26134 #[doc = "Interrupt Mask on line 0"]
26135 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) {
26136 assert!(n < 23usize);
26137 let offs = 0usize + n * 1usize;
26138 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
26139 }
26140 }
26141 impl Default for Imr {
26142 fn default() -> Imr {
26143 Imr(0)
26144 }
26145 }
26146 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
26147 #[repr(transparent)]
26148 #[derive(Copy, Clone, Eq, PartialEq)]
26149 pub struct Ftsr(pub u32);
26150 impl Ftsr {
26151 #[doc = "Falling trigger event configuration of line 0"]
26152 pub fn tr(&self, n: usize) -> super::vals::Tr {
26153 assert!(n < 23usize);
26154 let offs = 0usize + n * 1usize;
26155 let val = (self.0 >> offs) & 0x01;
26156 super::vals::Tr(val as u8)
26157 }
26158 #[doc = "Falling trigger event configuration of line 0"]
26159 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) {
26160 assert!(n < 23usize);
26161 let offs = 0usize + n * 1usize;
26162 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
26163 }
26164 }
26165 impl Default for Ftsr {
26166 fn default() -> Ftsr {
26167 Ftsr(0)
26168 } 26212 }
26169 } 26213 }
26170 } 26214 }
26171 pub mod vals {
26172 use crate::generic::*;
26173 #[repr(transparent)]
26174 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
26175 pub struct Mr(pub u8);
26176 impl Mr {
26177 #[doc = "Interrupt request line is masked"]
26178 pub const MASKED: Self = Self(0);
26179 #[doc = "Interrupt request line is unmasked"]
26180 pub const UNMASKED: Self = Self(0x01);
26181 }
26182 #[repr(transparent)]
26183 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
26184 pub struct Prw(pub u8);
26185 impl Prw {
26186 #[doc = "Clears pending bit"]
26187 pub const CLEAR: Self = Self(0x01);
26188 }
26189 #[repr(transparent)]
26190 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
26191 pub struct Tr(pub u8);
26192 impl Tr {
26193 #[doc = "Falling edge trigger is disabled"]
26194 pub const DISABLED: Self = Self(0);
26195 #[doc = "Falling edge trigger is enabled"]
26196 pub const ENABLED: Self = Self(0x01);
26197 }
26198 #[repr(transparent)]
26199 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
26200 pub struct Prr(pub u8);
26201 impl Prr {
26202 #[doc = "No trigger request occurred"]
26203 pub const NOTPENDING: Self = Self(0);
26204 #[doc = "Selected trigger request occurred"]
26205 pub const PENDING: Self = Self(0x01);
26206 }
26207 #[repr(transparent)]
26208 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
26209 pub struct Swierw(pub u8);
26210 impl Swierw {
26211 #[doc = "Generates an interrupt request"]
26212 pub const PEND: Self = Self(0x01);
26213 }
26214 }
26215} 26215}
diff --git a/embassy-stm32/src/pac/stm32h723ve.rs b/embassy-stm32/src/pac/stm32h723ve.rs
index 4ebf8f8f6..6a06b5448 100644
--- a/embassy-stm32/src/pac/stm32h723ve.rs
+++ b/embassy-stm32/src/pac/stm32h723ve.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h723vg.rs b/embassy-stm32/src/pac/stm32h723vg.rs
index 4ebf8f8f6..6a06b5448 100644
--- a/embassy-stm32/src/pac/stm32h723vg.rs
+++ b/embassy-stm32/src/pac/stm32h723vg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h723ze.rs b/embassy-stm32/src/pac/stm32h723ze.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h723ze.rs
+++ b/embassy-stm32/src/pac/stm32h723ze.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h723zg.rs b/embassy-stm32/src/pac/stm32h723zg.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h723zg.rs
+++ b/embassy-stm32/src/pac/stm32h723zg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725ae.rs b/embassy-stm32/src/pac/stm32h725ae.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h725ae.rs
+++ b/embassy-stm32/src/pac/stm32h725ae.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725ag.rs b/embassy-stm32/src/pac/stm32h725ag.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h725ag.rs
+++ b/embassy-stm32/src/pac/stm32h725ag.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725ie.rs b/embassy-stm32/src/pac/stm32h725ie.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h725ie.rs
+++ b/embassy-stm32/src/pac/stm32h725ie.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725ig.rs b/embassy-stm32/src/pac/stm32h725ig.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h725ig.rs
+++ b/embassy-stm32/src/pac/stm32h725ig.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725re.rs b/embassy-stm32/src/pac/stm32h725re.rs
index c607d96ef..a9fc62f6d 100644
--- a/embassy-stm32/src/pac/stm32h725re.rs
+++ b/embassy-stm32/src/pac/stm32h725re.rs
@@ -197,9 +197,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 231pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
204pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 232pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
205impl_rng!(RNG, RNG); 233impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725rg.rs b/embassy-stm32/src/pac/stm32h725rg.rs
index c607d96ef..a9fc62f6d 100644
--- a/embassy-stm32/src/pac/stm32h725rg.rs
+++ b/embassy-stm32/src/pac/stm32h725rg.rs
@@ -197,9 +197,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 231pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
204pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 232pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
205impl_rng!(RNG, RNG); 233impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725ve.rs b/embassy-stm32/src/pac/stm32h725ve.rs
index 4ebf8f8f6..6a06b5448 100644
--- a/embassy-stm32/src/pac/stm32h725ve.rs
+++ b/embassy-stm32/src/pac/stm32h725ve.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725vg.rs b/embassy-stm32/src/pac/stm32h725vg.rs
index 4ebf8f8f6..6a06b5448 100644
--- a/embassy-stm32/src/pac/stm32h725vg.rs
+++ b/embassy-stm32/src/pac/stm32h725vg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725ze.rs b/embassy-stm32/src/pac/stm32h725ze.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h725ze.rs
+++ b/embassy-stm32/src/pac/stm32h725ze.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h725zg.rs b/embassy-stm32/src/pac/stm32h725zg.rs
index a01e156d8..4035f788b 100644
--- a/embassy-stm32/src/pac/stm32h725zg.rs
+++ b/embassy-stm32/src/pac/stm32h725zg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, RNG); 241impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h730ab.rs b/embassy-stm32/src/pac/stm32h730ab.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h730ab.rs
+++ b/embassy-stm32/src/pac/stm32h730ab.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h730ib.rs b/embassy-stm32/src/pac/stm32h730ib.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h730ib.rs
+++ b/embassy-stm32/src/pac/stm32h730ib.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h730vb.rs b/embassy-stm32/src/pac/stm32h730vb.rs
index 02fdcf61d..0bf0bea17 100644
--- a/embassy-stm32/src/pac/stm32h730vb.rs
+++ b/embassy-stm32/src/pac/stm32h730vb.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h730zb.rs b/embassy-stm32/src/pac/stm32h730zb.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h730zb.rs
+++ b/embassy-stm32/src/pac/stm32h730zb.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h733vg.rs b/embassy-stm32/src/pac/stm32h733vg.rs
index 02fdcf61d..0bf0bea17 100644
--- a/embassy-stm32/src/pac/stm32h733vg.rs
+++ b/embassy-stm32/src/pac/stm32h733vg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h733zg.rs b/embassy-stm32/src/pac/stm32h733zg.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h733zg.rs
+++ b/embassy-stm32/src/pac/stm32h733zg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h735ag.rs b/embassy-stm32/src/pac/stm32h735ag.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h735ag.rs
+++ b/embassy-stm32/src/pac/stm32h735ag.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h735ig.rs b/embassy-stm32/src/pac/stm32h735ig.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h735ig.rs
+++ b/embassy-stm32/src/pac/stm32h735ig.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h735rg.rs b/embassy-stm32/src/pac/stm32h735rg.rs
index eef5d57f6..da11c7f5f 100644
--- a/embassy-stm32/src/pac/stm32h735rg.rs
+++ b/embassy-stm32/src/pac/stm32h735rg.rs
@@ -197,9 +197,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 231pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
204pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 232pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
205impl_rng!(RNG, HASH_RNG); 233impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h735vg.rs b/embassy-stm32/src/pac/stm32h735vg.rs
index 02fdcf61d..0bf0bea17 100644
--- a/embassy-stm32/src/pac/stm32h735vg.rs
+++ b/embassy-stm32/src/pac/stm32h735vg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h735zg.rs b/embassy-stm32/src/pac/stm32h735zg.rs
index b7f71bc83..9087f9234 100644
--- a/embassy-stm32/src/pac/stm32h735zg.rs
+++ b/embassy-stm32/src/pac/stm32h735zg.rs
@@ -197,10 +197,45 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
197impl_gpio_pin!(PK14, 10, 14, EXTI14); 197impl_gpio_pin!(PK14, 10, 14, EXTI14);
198impl_gpio_pin!(PK15, 10, 15, EXTI15); 198impl_gpio_pin!(PK15, 10, 15, EXTI15);
199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 199pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
200impl_i2c!(I2C1);
201impl_i2c_pin!(I2C1, SclPin, PB6, 4);
202impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
203impl_i2c_pin!(I2C1, SclPin, PB8, 4);
204impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
200pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 205pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
206impl_i2c!(I2C2);
207impl_i2c_pin!(I2C2, SclPin, PB10, 4);
208impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
209impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
210impl_i2c_pin!(I2C2, SclPin, PF1, 4);
211impl_i2c_pin!(I2C2, SclPin, PH4, 4);
212impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
201pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 213pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
214impl_i2c!(I2C3);
215impl_i2c_pin!(I2C3, SclPin, PA8, 4);
216impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
217impl_i2c_pin!(I2C3, SclPin, PH7, 4);
218impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
202pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
220impl_i2c!(I2C4);
221impl_i2c_pin!(I2C4, SclPin, PB6, 6);
222impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
223impl_i2c_pin!(I2C4, SclPin, PB8, 6);
224impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
225impl_i2c_pin!(I2C4, SclPin, PD12, 4);
226impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
227impl_i2c_pin!(I2C4, SclPin, PF14, 4);
228impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
229impl_i2c_pin!(I2C4, SclPin, PH11, 4);
230impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
203pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _); 231pub const I2C5: i2c::I2c = i2c::I2c(0x40006400 as _);
232impl_i2c!(I2C5);
233impl_i2c_pin!(I2C5, SclPin, PA8, 6);
234impl_i2c_pin!(I2C5, SdaPin, PC10, 4);
235impl_i2c_pin!(I2C5, SclPin, PC11, 4);
236impl_i2c_pin!(I2C5, SdaPin, PC9, 6);
237impl_i2c_pin!(I2C5, SdaPin, PF0, 6);
238impl_i2c_pin!(I2C5, SclPin, PF1, 6);
204pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 239pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
205pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 240pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
206impl_rng!(RNG, HASH_RNG); 241impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h742ag.rs b/embassy-stm32/src/pac/stm32h742ag.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742ag.rs
+++ b/embassy-stm32/src/pac/stm32h742ag.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742ai.rs b/embassy-stm32/src/pac/stm32h742ai.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742ai.rs
+++ b/embassy-stm32/src/pac/stm32h742ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742bg.rs b/embassy-stm32/src/pac/stm32h742bg.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742bg.rs
+++ b/embassy-stm32/src/pac/stm32h742bg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742bi.rs b/embassy-stm32/src/pac/stm32h742bi.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742bi.rs
+++ b/embassy-stm32/src/pac/stm32h742bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742ig.rs b/embassy-stm32/src/pac/stm32h742ig.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742ig.rs
+++ b/embassy-stm32/src/pac/stm32h742ig.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742ii.rs b/embassy-stm32/src/pac/stm32h742ii.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742ii.rs
+++ b/embassy-stm32/src/pac/stm32h742ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742vg.rs b/embassy-stm32/src/pac/stm32h742vg.rs
index 1f9c27d19..4ffa0ddd8 100644
--- a/embassy-stm32/src/pac/stm32h742vg.rs
+++ b/embassy-stm32/src/pac/stm32h742vg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742vi.rs b/embassy-stm32/src/pac/stm32h742vi.rs
index 1f9c27d19..4ffa0ddd8 100644
--- a/embassy-stm32/src/pac/stm32h742vi.rs
+++ b/embassy-stm32/src/pac/stm32h742vi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742xg.rs b/embassy-stm32/src/pac/stm32h742xg.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742xg.rs
+++ b/embassy-stm32/src/pac/stm32h742xg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742xi.rs b/embassy-stm32/src/pac/stm32h742xi.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742xi.rs
+++ b/embassy-stm32/src/pac/stm32h742xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742zg.rs b/embassy-stm32/src/pac/stm32h742zg.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742zg.rs
+++ b/embassy-stm32/src/pac/stm32h742zg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h742zi.rs b/embassy-stm32/src/pac/stm32h742zi.rs
index 49e24ad45..297ee70a4 100644
--- a/embassy-stm32/src/pac/stm32h742zi.rs
+++ b/embassy-stm32/src/pac/stm32h742zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743ag.rs b/embassy-stm32/src/pac/stm32h743ag.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743ag.rs
+++ b/embassy-stm32/src/pac/stm32h743ag.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743ai.rs b/embassy-stm32/src/pac/stm32h743ai.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743ai.rs
+++ b/embassy-stm32/src/pac/stm32h743ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743bg.rs b/embassy-stm32/src/pac/stm32h743bg.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743bg.rs
+++ b/embassy-stm32/src/pac/stm32h743bg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743bi.rs b/embassy-stm32/src/pac/stm32h743bi.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743bi.rs
+++ b/embassy-stm32/src/pac/stm32h743bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743ig.rs b/embassy-stm32/src/pac/stm32h743ig.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743ig.rs
+++ b/embassy-stm32/src/pac/stm32h743ig.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743ii.rs b/embassy-stm32/src/pac/stm32h743ii.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743ii.rs
+++ b/embassy-stm32/src/pac/stm32h743ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743vg.rs b/embassy-stm32/src/pac/stm32h743vg.rs
index 137639842..639acece7 100644
--- a/embassy-stm32/src/pac/stm32h743vg.rs
+++ b/embassy-stm32/src/pac/stm32h743vg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743vi.rs b/embassy-stm32/src/pac/stm32h743vi.rs
index 137639842..639acece7 100644
--- a/embassy-stm32/src/pac/stm32h743vi.rs
+++ b/embassy-stm32/src/pac/stm32h743vi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743xg.rs b/embassy-stm32/src/pac/stm32h743xg.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743xg.rs
+++ b/embassy-stm32/src/pac/stm32h743xg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743xi.rs b/embassy-stm32/src/pac/stm32h743xi.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743xi.rs
+++ b/embassy-stm32/src/pac/stm32h743xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743zg.rs b/embassy-stm32/src/pac/stm32h743zg.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743zg.rs
+++ b/embassy-stm32/src/pac/stm32h743zg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h743zi.rs b/embassy-stm32/src/pac/stm32h743zi.rs
index 1117c87d2..9f82a0471 100644
--- a/embassy-stm32/src/pac/stm32h743zi.rs
+++ b/embassy-stm32/src/pac/stm32h743zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745bg.rs b/embassy-stm32/src/pac/stm32h745bg.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745bg.rs
+++ b/embassy-stm32/src/pac/stm32h745bg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745bi.rs b/embassy-stm32/src/pac/stm32h745bi.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745bi.rs
+++ b/embassy-stm32/src/pac/stm32h745bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745ig.rs b/embassy-stm32/src/pac/stm32h745ig.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745ig.rs
+++ b/embassy-stm32/src/pac/stm32h745ig.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745ii.rs b/embassy-stm32/src/pac/stm32h745ii.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745ii.rs
+++ b/embassy-stm32/src/pac/stm32h745ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745xg.rs b/embassy-stm32/src/pac/stm32h745xg.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745xg.rs
+++ b/embassy-stm32/src/pac/stm32h745xg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745xi.rs b/embassy-stm32/src/pac/stm32h745xi.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745xi.rs
+++ b/embassy-stm32/src/pac/stm32h745xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745zg.rs b/embassy-stm32/src/pac/stm32h745zg.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745zg.rs
+++ b/embassy-stm32/src/pac/stm32h745zg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h745zi.rs b/embassy-stm32/src/pac/stm32h745zi.rs
index 8a8e01380..78781fc0f 100644
--- a/embassy-stm32/src/pac/stm32h745zi.rs
+++ b/embassy-stm32/src/pac/stm32h745zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747ag.rs b/embassy-stm32/src/pac/stm32h747ag.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747ag.rs
+++ b/embassy-stm32/src/pac/stm32h747ag.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747ai.rs b/embassy-stm32/src/pac/stm32h747ai.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747ai.rs
+++ b/embassy-stm32/src/pac/stm32h747ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747bg.rs b/embassy-stm32/src/pac/stm32h747bg.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747bg.rs
+++ b/embassy-stm32/src/pac/stm32h747bg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747bi.rs b/embassy-stm32/src/pac/stm32h747bi.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747bi.rs
+++ b/embassy-stm32/src/pac/stm32h747bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747ig.rs b/embassy-stm32/src/pac/stm32h747ig.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747ig.rs
+++ b/embassy-stm32/src/pac/stm32h747ig.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747ii.rs b/embassy-stm32/src/pac/stm32h747ii.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747ii.rs
+++ b/embassy-stm32/src/pac/stm32h747ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747xg.rs b/embassy-stm32/src/pac/stm32h747xg.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747xg.rs
+++ b/embassy-stm32/src/pac/stm32h747xg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747xi.rs b/embassy-stm32/src/pac/stm32h747xi.rs
index 9d415b9c3..867267c96 100644
--- a/embassy-stm32/src/pac/stm32h747xi.rs
+++ b/embassy-stm32/src/pac/stm32h747xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h747zi.rs b/embassy-stm32/src/pac/stm32h747zi.rs
index 881487f94..e0d9870cf 100644
--- a/embassy-stm32/src/pac/stm32h747zi.rs
+++ b/embassy-stm32/src/pac/stm32h747zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h750ib.rs b/embassy-stm32/src/pac/stm32h750ib.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h750ib.rs
+++ b/embassy-stm32/src/pac/stm32h750ib.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h750vb.rs b/embassy-stm32/src/pac/stm32h750vb.rs
index 30622a33d..a1bb27236 100644
--- a/embassy-stm32/src/pac/stm32h750vb.rs
+++ b/embassy-stm32/src/pac/stm32h750vb.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h750xb.rs b/embassy-stm32/src/pac/stm32h750xb.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h750xb.rs
+++ b/embassy-stm32/src/pac/stm32h750xb.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h750zb.rs b/embassy-stm32/src/pac/stm32h750zb.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h750zb.rs
+++ b/embassy-stm32/src/pac/stm32h750zb.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h753ai.rs b/embassy-stm32/src/pac/stm32h753ai.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h753ai.rs
+++ b/embassy-stm32/src/pac/stm32h753ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h753bi.rs b/embassy-stm32/src/pac/stm32h753bi.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h753bi.rs
+++ b/embassy-stm32/src/pac/stm32h753bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h753ii.rs b/embassy-stm32/src/pac/stm32h753ii.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h753ii.rs
+++ b/embassy-stm32/src/pac/stm32h753ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h753vi.rs b/embassy-stm32/src/pac/stm32h753vi.rs
index 30622a33d..a1bb27236 100644
--- a/embassy-stm32/src/pac/stm32h753vi.rs
+++ b/embassy-stm32/src/pac/stm32h753vi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h753xi.rs b/embassy-stm32/src/pac/stm32h753xi.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h753xi.rs
+++ b/embassy-stm32/src/pac/stm32h753xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h753zi.rs b/embassy-stm32/src/pac/stm32h753zi.rs
index d2d81bcc2..43054b9ca 100644
--- a/embassy-stm32/src/pac/stm32h753zi.rs
+++ b/embassy-stm32/src/pac/stm32h753zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h755bi.rs b/embassy-stm32/src/pac/stm32h755bi.rs
index 0925904c8..86684fea3 100644
--- a/embassy-stm32/src/pac/stm32h755bi.rs
+++ b/embassy-stm32/src/pac/stm32h755bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h755ii.rs b/embassy-stm32/src/pac/stm32h755ii.rs
index 0925904c8..86684fea3 100644
--- a/embassy-stm32/src/pac/stm32h755ii.rs
+++ b/embassy-stm32/src/pac/stm32h755ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h755xi.rs b/embassy-stm32/src/pac/stm32h755xi.rs
index 0925904c8..86684fea3 100644
--- a/embassy-stm32/src/pac/stm32h755xi.rs
+++ b/embassy-stm32/src/pac/stm32h755xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h755zi.rs b/embassy-stm32/src/pac/stm32h755zi.rs
index 0925904c8..86684fea3 100644
--- a/embassy-stm32/src/pac/stm32h755zi.rs
+++ b/embassy-stm32/src/pac/stm32h755zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h757ai.rs b/embassy-stm32/src/pac/stm32h757ai.rs
index 076acc856..4b98532bb 100644
--- a/embassy-stm32/src/pac/stm32h757ai.rs
+++ b/embassy-stm32/src/pac/stm32h757ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h757bi.rs b/embassy-stm32/src/pac/stm32h757bi.rs
index 076acc856..4b98532bb 100644
--- a/embassy-stm32/src/pac/stm32h757bi.rs
+++ b/embassy-stm32/src/pac/stm32h757bi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h757ii.rs b/embassy-stm32/src/pac/stm32h757ii.rs
index 076acc856..4b98532bb 100644
--- a/embassy-stm32/src/pac/stm32h757ii.rs
+++ b/embassy-stm32/src/pac/stm32h757ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h757xi.rs b/embassy-stm32/src/pac/stm32h757xi.rs
index 076acc856..4b98532bb 100644
--- a/embassy-stm32/src/pac/stm32h757xi.rs
+++ b/embassy-stm32/src/pac/stm32h757xi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h757zi.rs b/embassy-stm32/src/pac/stm32h757zi.rs
index 1591aae92..b587f110d 100644
--- a/embassy-stm32/src/pac/stm32h757zi.rs
+++ b/embassy-stm32/src/pac/stm32h757zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _); 249pub const RCC: rcc::Rcc = rcc::Rcc(0x58024400 as _);
222pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 250pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
diff --git a/embassy-stm32/src/pac/stm32h7a3ag.rs b/embassy-stm32/src/pac/stm32h7a3ag.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3ag.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ag.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3ai.rs b/embassy-stm32/src/pac/stm32h7a3ai.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3ai.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3ig.rs b/embassy-stm32/src/pac/stm32h7a3ig.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3ig.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ig.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3ii.rs b/embassy-stm32/src/pac/stm32h7a3ii.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3ii.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3lg.rs b/embassy-stm32/src/pac/stm32h7a3lg.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3lg.rs
+++ b/embassy-stm32/src/pac/stm32h7a3lg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3li.rs b/embassy-stm32/src/pac/stm32h7a3li.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3li.rs
+++ b/embassy-stm32/src/pac/stm32h7a3li.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3ng.rs b/embassy-stm32/src/pac/stm32h7a3ng.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3ng.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ng.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3ni.rs b/embassy-stm32/src/pac/stm32h7a3ni.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3ni.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ni.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3qi.rs b/embassy-stm32/src/pac/stm32h7a3qi.rs
index dd6a3b252..ddedfc164 100644
--- a/embassy-stm32/src/pac/stm32h7a3qi.rs
+++ b/embassy-stm32/src/pac/stm32h7a3qi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3rg.rs b/embassy-stm32/src/pac/stm32h7a3rg.rs
index 8af66d234..7fcdda23b 100644
--- a/embassy-stm32/src/pac/stm32h7a3rg.rs
+++ b/embassy-stm32/src/pac/stm32h7a3rg.rs
@@ -214,8 +214,29 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 222pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
223impl_i2c!(I2C3);
224impl_i2c_pin!(I2C3, SclPin, PA8, 4);
225impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
226impl_i2c_pin!(I2C3, SclPin, PH7, 4);
227impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
218pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 228pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
229impl_i2c!(I2C4);
230impl_i2c_pin!(I2C4, SclPin, PB6, 6);
231impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
232impl_i2c_pin!(I2C4, SclPin, PB8, 6);
233impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
234impl_i2c_pin!(I2C4, SclPin, PD12, 4);
235impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
236impl_i2c_pin!(I2C4, SclPin, PF14, 4);
237impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
238impl_i2c_pin!(I2C4, SclPin, PH11, 4);
239impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
219pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 240pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
220pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 241pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
221impl_rng!(RNG, RNG); 242impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3ri.rs b/embassy-stm32/src/pac/stm32h7a3ri.rs
index 8af66d234..7fcdda23b 100644
--- a/embassy-stm32/src/pac/stm32h7a3ri.rs
+++ b/embassy-stm32/src/pac/stm32h7a3ri.rs
@@ -214,8 +214,29 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 222pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
223impl_i2c!(I2C3);
224impl_i2c_pin!(I2C3, SclPin, PA8, 4);
225impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
226impl_i2c_pin!(I2C3, SclPin, PH7, 4);
227impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
218pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 228pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
229impl_i2c!(I2C4);
230impl_i2c_pin!(I2C4, SclPin, PB6, 6);
231impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
232impl_i2c_pin!(I2C4, SclPin, PB8, 6);
233impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
234impl_i2c_pin!(I2C4, SclPin, PD12, 4);
235impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
236impl_i2c_pin!(I2C4, SclPin, PF14, 4);
237impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
238impl_i2c_pin!(I2C4, SclPin, PH11, 4);
239impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
219pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 240pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
220pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 241pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
221impl_rng!(RNG, RNG); 242impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3vg.rs b/embassy-stm32/src/pac/stm32h7a3vg.rs
index dd6a3b252..ddedfc164 100644
--- a/embassy-stm32/src/pac/stm32h7a3vg.rs
+++ b/embassy-stm32/src/pac/stm32h7a3vg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3vi.rs b/embassy-stm32/src/pac/stm32h7a3vi.rs
index dd6a3b252..ddedfc164 100644
--- a/embassy-stm32/src/pac/stm32h7a3vi.rs
+++ b/embassy-stm32/src/pac/stm32h7a3vi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3zg.rs b/embassy-stm32/src/pac/stm32h7a3zg.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3zg.rs
+++ b/embassy-stm32/src/pac/stm32h7a3zg.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7a3zi.rs b/embassy-stm32/src/pac/stm32h7a3zi.rs
index 1aeed14ea..a8f57edaf 100644
--- a/embassy-stm32/src/pac/stm32h7a3zi.rs
+++ b/embassy-stm32/src/pac/stm32h7a3zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, RNG); 250impl_rng!(RNG, RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b0ab.rs b/embassy-stm32/src/pac/stm32h7b0ab.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b0ab.rs
+++ b/embassy-stm32/src/pac/stm32h7b0ab.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b0ib.rs b/embassy-stm32/src/pac/stm32h7b0ib.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b0ib.rs
+++ b/embassy-stm32/src/pac/stm32h7b0ib.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b0rb.rs b/embassy-stm32/src/pac/stm32h7b0rb.rs
index 2a547cc11..288222e05 100644
--- a/embassy-stm32/src/pac/stm32h7b0rb.rs
+++ b/embassy-stm32/src/pac/stm32h7b0rb.rs
@@ -214,8 +214,29 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 222pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
223impl_i2c!(I2C3);
224impl_i2c_pin!(I2C3, SclPin, PA8, 4);
225impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
226impl_i2c_pin!(I2C3, SclPin, PH7, 4);
227impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
218pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 228pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
229impl_i2c!(I2C4);
230impl_i2c_pin!(I2C4, SclPin, PB6, 6);
231impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
232impl_i2c_pin!(I2C4, SclPin, PB8, 6);
233impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
234impl_i2c_pin!(I2C4, SclPin, PD12, 4);
235impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
236impl_i2c_pin!(I2C4, SclPin, PF14, 4);
237impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
238impl_i2c_pin!(I2C4, SclPin, PH11, 4);
239impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
219pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 240pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
220pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 241pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
221impl_rng!(RNG, HASH_RNG); 242impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b0vb.rs b/embassy-stm32/src/pac/stm32h7b0vb.rs
index 61761aae0..2c7178bf9 100644
--- a/embassy-stm32/src/pac/stm32h7b0vb.rs
+++ b/embassy-stm32/src/pac/stm32h7b0vb.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b0zb.rs b/embassy-stm32/src/pac/stm32h7b0zb.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b0zb.rs
+++ b/embassy-stm32/src/pac/stm32h7b0zb.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3ai.rs b/embassy-stm32/src/pac/stm32h7b3ai.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b3ai.rs
+++ b/embassy-stm32/src/pac/stm32h7b3ai.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3ii.rs b/embassy-stm32/src/pac/stm32h7b3ii.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b3ii.rs
+++ b/embassy-stm32/src/pac/stm32h7b3ii.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3li.rs b/embassy-stm32/src/pac/stm32h7b3li.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b3li.rs
+++ b/embassy-stm32/src/pac/stm32h7b3li.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3ni.rs b/embassy-stm32/src/pac/stm32h7b3ni.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b3ni.rs
+++ b/embassy-stm32/src/pac/stm32h7b3ni.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3qi.rs b/embassy-stm32/src/pac/stm32h7b3qi.rs
index 61761aae0..2c7178bf9 100644
--- a/embassy-stm32/src/pac/stm32h7b3qi.rs
+++ b/embassy-stm32/src/pac/stm32h7b3qi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3ri.rs b/embassy-stm32/src/pac/stm32h7b3ri.rs
index 2a547cc11..288222e05 100644
--- a/embassy-stm32/src/pac/stm32h7b3ri.rs
+++ b/embassy-stm32/src/pac/stm32h7b3ri.rs
@@ -214,8 +214,29 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 222pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
223impl_i2c!(I2C3);
224impl_i2c_pin!(I2C3, SclPin, PA8, 4);
225impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
226impl_i2c_pin!(I2C3, SclPin, PH7, 4);
227impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
218pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 228pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
229impl_i2c!(I2C4);
230impl_i2c_pin!(I2C4, SclPin, PB6, 6);
231impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
232impl_i2c_pin!(I2C4, SclPin, PB8, 6);
233impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
234impl_i2c_pin!(I2C4, SclPin, PD12, 4);
235impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
236impl_i2c_pin!(I2C4, SclPin, PF14, 4);
237impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
238impl_i2c_pin!(I2C4, SclPin, PH11, 4);
239impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
219pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 240pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
220pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 241pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
221impl_rng!(RNG, HASH_RNG); 242impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3vi.rs b/embassy-stm32/src/pac/stm32h7b3vi.rs
index 61761aae0..2c7178bf9 100644
--- a/embassy-stm32/src/pac/stm32h7b3vi.rs
+++ b/embassy-stm32/src/pac/stm32h7b3vi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);
diff --git a/embassy-stm32/src/pac/stm32h7b3zi.rs b/embassy-stm32/src/pac/stm32h7b3zi.rs
index 9e4629b80..1e4e650a1 100644
--- a/embassy-stm32/src/pac/stm32h7b3zi.rs
+++ b/embassy-stm32/src/pac/stm32h7b3zi.rs
@@ -214,9 +214,37 @@ impl_gpio_pin!(PK13, 10, 13, EXTI13);
214impl_gpio_pin!(PK14, 10, 14, EXTI14); 214impl_gpio_pin!(PK14, 10, 14, EXTI14);
215impl_gpio_pin!(PK15, 10, 15, EXTI15); 215impl_gpio_pin!(PK15, 10, 15, EXTI15);
216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _); 216pub const I2C1: i2c::I2c = i2c::I2c(0x40005400 as _);
217impl_i2c!(I2C1);
218impl_i2c_pin!(I2C1, SclPin, PB6, 4);
219impl_i2c_pin!(I2C1, SdaPin, PB7, 4);
220impl_i2c_pin!(I2C1, SclPin, PB8, 4);
221impl_i2c_pin!(I2C1, SdaPin, PB9, 4);
217pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _); 222pub const I2C2: i2c::I2c = i2c::I2c(0x40005800 as _);
223impl_i2c!(I2C2);
224impl_i2c_pin!(I2C2, SclPin, PB10, 4);
225impl_i2c_pin!(I2C2, SdaPin, PB11, 4);
226impl_i2c_pin!(I2C2, SdaPin, PF0, 4);
227impl_i2c_pin!(I2C2, SclPin, PF1, 4);
228impl_i2c_pin!(I2C2, SclPin, PH4, 4);
229impl_i2c_pin!(I2C2, SdaPin, PH5, 4);
218pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _); 230pub const I2C3: i2c::I2c = i2c::I2c(0x40005c00 as _);
231impl_i2c!(I2C3);
232impl_i2c_pin!(I2C3, SclPin, PA8, 4);
233impl_i2c_pin!(I2C3, SdaPin, PC9, 4);
234impl_i2c_pin!(I2C3, SclPin, PH7, 4);
235impl_i2c_pin!(I2C3, SdaPin, PH8, 4);
219pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _); 236pub const I2C4: i2c::I2c = i2c::I2c(0x58001c00 as _);
237impl_i2c!(I2C4);
238impl_i2c_pin!(I2C4, SclPin, PB6, 6);
239impl_i2c_pin!(I2C4, SdaPin, PB7, 6);
240impl_i2c_pin!(I2C4, SclPin, PB8, 6);
241impl_i2c_pin!(I2C4, SdaPin, PB9, 6);
242impl_i2c_pin!(I2C4, SclPin, PD12, 4);
243impl_i2c_pin!(I2C4, SdaPin, PD13, 4);
244impl_i2c_pin!(I2C4, SclPin, PF14, 4);
245impl_i2c_pin!(I2C4, SdaPin, PF15, 4);
246impl_i2c_pin!(I2C4, SclPin, PH11, 4);
247impl_i2c_pin!(I2C4, SdaPin, PH12, 4);
220pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _); 248pub const PWR: pwr::Pwr = pwr::Pwr(0x58024800 as _);
221pub const RNG: rng::Rng = rng::Rng(0x48021800 as _); 249pub const RNG: rng::Rng = rng::Rng(0x48021800 as _);
222impl_rng!(RNG, HASH_RNG); 250impl_rng!(RNG, HASH_RNG);