aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob McWhirter <[email protected]>2021-05-11 11:25:01 -0400
committerBob McWhirter <[email protected]>2021-05-11 11:25:01 -0400
commit7d52e1b35048afca73fe3f0f4db2bca3edbe2e86 (patch)
tree4c3745a8640acc9289fc830085055f05a8ec5eb3
parent8a79e2cbbf3a2418690926e69c9d1ef3f3b36181 (diff)
Further work on SPI v2 blocking.
-rw-r--r--embassy-stm32/gen.py8
-rw-r--r--embassy-stm32/src/pac/regs.rs12282
-rw-r--r--embassy-stm32/src/pac/stm32f429zi.rs32
-rw-r--r--embassy-stm32/src/pac/stm32l431cb.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l431cc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l431kb.rs18
-rw-r--r--embassy-stm32/src/pac/stm32l431kc.rs18
-rw-r--r--embassy-stm32/src/pac/stm32l431rb.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l431rc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l431vc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l432kb.rs15
-rw-r--r--embassy-stm32/src/pac/stm32l432kc.rs15
-rw-r--r--embassy-stm32/src/pac/stm32l433cb.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l433cc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l433rb.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l433rc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l433vc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l442kc.rs15
-rw-r--r--embassy-stm32/src/pac/stm32l443cc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l443rc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l443vc.rs27
-rw-r--r--embassy-stm32/src/pac/stm32l496ae.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496ag.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496qe.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496qg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496re.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496rg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496ve.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496vg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496wg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496ze.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l496zg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l4a6ag.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l4a6qg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l4a6rg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l4a6vg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l4a6zg.rs39
-rw-r--r--embassy-stm32/src/pac/stm32l4p5ae.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5ag.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5ce.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5cg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5qe.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5qg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5re.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5rg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5ve.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5vg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5ze.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4p5zg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4q5ag.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4q5cg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4q5qg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4q5rg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4q5vg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4q5zg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5ag.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5ai.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5qg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5qi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5vg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5vi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5zg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r5zi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r7ai.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r7vi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r7zi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r9ag.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r9ai.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r9vg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r9vi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r9zg.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4r9zi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s5ai.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s5qi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s5vi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s5zi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s7ai.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s7vi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s7zi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s9ai.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s9vi.rs40
-rw-r--r--embassy-stm32/src/pac/stm32l4s9zi.rs40
-rw-r--r--embassy-stm32/src/spi.rs86
m---------embassy-stm32/stm32-data0
84 files changed, 9107 insertions, 6157 deletions
diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py
index c04de7d46..ec6b99b1d 100644
--- a/embassy-stm32/gen.py
+++ b/embassy-stm32/gen.py
@@ -117,6 +117,14 @@ for chip in chips.values():
117 117
118 if block_mod == 'spi': 118 if block_mod == 'spi':
119 f.write(f'impl_spi!({name});') 119 f.write(f'impl_spi!({name});')
120 for pin, funcs in af.items():
121 if pin in pins:
122 if func := funcs.get(f'{name}_SCK'):
123 f.write(f'impl_spi_pin!({name}, Sck, {pin}, {func});')
124 if func := funcs.get(f'{name}_MOSI'):
125 f.write(f'impl_spi_pin!({name}, Mosi, {pin}, {func});')
126 if func := funcs.get(f'{name}_MISO'):
127 f.write(f'impl_spi_pin!({name}, Miso, {pin}, {func});')
120 128
121 if block_mod == 'gpio': 129 if block_mod == 'gpio':
122 custom_singletons = True 130 custom_singletons = True
diff --git a/embassy-stm32/src/pac/regs.rs b/embassy-stm32/src/pac/regs.rs
index 38ce5981f..9e4efa70f 100644
--- a/embassy-stm32/src/pac/regs.rs
+++ b/embassy-stm32/src/pac/regs.rs
@@ -1,695 +1,336 @@
1#![no_std] 1#![no_std]
2#![doc = "Peripheral access API (generated using svd2rust v0.17.0 (22741fa 2021-04-20))"] 2#![doc = "Peripheral access API (generated using svd2rust v0.17.0 (22741fa 2021-04-20))"]
3pub mod gpio_v1 { 3pub mod syscfg_l4 {
4 use crate::generic::*; 4 use crate::generic::*;
5 #[doc = "General purpose I/O"] 5 #[doc = "System configuration controller"]
6 #[derive(Copy, Clone)] 6 #[derive(Copy, Clone)]
7 pub struct Gpio(pub *mut u8); 7 pub struct Syscfg(pub *mut u8);
8 unsafe impl Send for Gpio {} 8 unsafe impl Send for Syscfg {}
9 unsafe impl Sync for Gpio {} 9 unsafe impl Sync for Syscfg {}
10 impl Gpio { 10 impl Syscfg {
11 #[doc = "Port configuration register low (GPIOn_CRL)"] 11 #[doc = "memory remap register"]
12 pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> { 12 pub fn memrmp(self) -> Reg<regs::Memrmp, RW> {
13 assert!(n < 2usize); 13 unsafe { Reg::from_ptr(self.0.add(0usize)) }
14 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
15 } 14 }
16 #[doc = "Port input data register (GPIOn_IDR)"] 15 #[doc = "configuration register 1"]
17 pub fn idr(self) -> Reg<regs::Idr, R> { 16 pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> {
18 unsafe { Reg::from_ptr(self.0.add(8usize)) } 17 unsafe { Reg::from_ptr(self.0.add(4usize)) }
19 } 18 }
20 #[doc = "Port output data register (GPIOn_ODR)"] 19 #[doc = "external interrupt configuration register 1"]
21 pub fn odr(self) -> Reg<regs::Odr, RW> { 20 pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> {
22 unsafe { Reg::from_ptr(self.0.add(12usize)) } 21 assert!(n < 4usize);
22 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
23 } 23 }
24 #[doc = "Port bit set/reset register (GPIOn_BSRR)"] 24 #[doc = "SCSR"]
25 pub fn bsrr(self) -> Reg<regs::Bsrr, W> { 25 pub fn scsr(self) -> Reg<regs::Scsr, RW> {
26 unsafe { Reg::from_ptr(self.0.add(16usize)) } 26 unsafe { Reg::from_ptr(self.0.add(24usize)) }
27 } 27 }
28 #[doc = "Port bit reset register (GPIOn_BRR)"] 28 #[doc = "CFGR2"]
29 pub fn brr(self) -> Reg<regs::Brr, W> { 29 pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> {
30 unsafe { Reg::from_ptr(self.0.add(20usize)) } 30 unsafe { Reg::from_ptr(self.0.add(28usize)) }
31 } 31 }
32 #[doc = "Port configuration lock register"] 32 #[doc = "SWPR"]
33 pub fn lckr(self) -> Reg<regs::Lckr, RW> { 33 pub fn swpr(self) -> Reg<regs::Swpr, W> {
34 unsafe { Reg::from_ptr(self.0.add(24usize)) } 34 unsafe { Reg::from_ptr(self.0.add(32usize)) }
35 }
36 #[doc = "SKR"]
37 pub fn skr(self) -> Reg<regs::Skr, W> {
38 unsafe { Reg::from_ptr(self.0.add(36usize)) }
35 } 39 }
36 } 40 }
37 pub mod regs { 41 pub mod regs {
38 use crate::generic::*; 42 use crate::generic::*;
39 #[doc = "Port configuration register (GPIOn_CRx)"] 43 #[doc = "SKR"]
40 #[repr(transparent)]
41 #[derive(Copy, Clone, Eq, PartialEq)]
42 pub struct Cr(pub u32);
43 impl Cr {
44 #[doc = "Port n mode bits"]
45 pub fn mode(&self, n: usize) -> super::vals::Mode {
46 assert!(n < 8usize);
47 let offs = 0usize + n * 4usize;
48 let val = (self.0 >> offs) & 0x03;
49 super::vals::Mode(val as u8)
50 }
51 #[doc = "Port n mode bits"]
52 pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) {
53 assert!(n < 8usize);
54 let offs = 0usize + n * 4usize;
55 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
56 }
57 #[doc = "Port n configuration bits"]
58 pub fn cnf(&self, n: usize) -> super::vals::Cnf {
59 assert!(n < 8usize);
60 let offs = 2usize + n * 4usize;
61 let val = (self.0 >> offs) & 0x03;
62 super::vals::Cnf(val as u8)
63 }
64 #[doc = "Port n configuration bits"]
65 pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) {
66 assert!(n < 8usize);
67 let offs = 2usize + n * 4usize;
68 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
69 }
70 }
71 impl Default for Cr {
72 fn default() -> Cr {
73 Cr(0)
74 }
75 }
76 #[doc = "Port bit set/reset register (GPIOn_BSRR)"]
77 #[repr(transparent)] 44 #[repr(transparent)]
78 #[derive(Copy, Clone, Eq, PartialEq)] 45 #[derive(Copy, Clone, Eq, PartialEq)]
79 pub struct Bsrr(pub u32); 46 pub struct Skr(pub u32);
80 impl Bsrr { 47 impl Skr {
81 #[doc = "Set bit"] 48 #[doc = "SRAM2 write protection key for software erase"]
82 pub fn bs(&self, n: usize) -> bool { 49 pub const fn key(&self) -> u8 {
83 assert!(n < 16usize); 50 let val = (self.0 >> 0usize) & 0xff;
84 let offs = 0usize + n * 1usize; 51 val as u8
85 let val = (self.0 >> offs) & 0x01;
86 val != 0
87 }
88 #[doc = "Set bit"]
89 pub fn set_bs(&mut self, n: usize, val: bool) {
90 assert!(n < 16usize);
91 let offs = 0usize + n * 1usize;
92 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
93 }
94 #[doc = "Reset bit"]
95 pub fn br(&self, n: usize) -> bool {
96 assert!(n < 16usize);
97 let offs = 16usize + n * 1usize;
98 let val = (self.0 >> offs) & 0x01;
99 val != 0
100 } 52 }
101 #[doc = "Reset bit"] 53 #[doc = "SRAM2 write protection key for software erase"]
102 pub fn set_br(&mut self, n: usize, val: bool) { 54 pub fn set_key(&mut self, val: u8) {
103 assert!(n < 16usize); 55 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
104 let offs = 16usize + n * 1usize;
105 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
106 } 56 }
107 } 57 }
108 impl Default for Bsrr { 58 impl Default for Skr {
109 fn default() -> Bsrr { 59 fn default() -> Skr {
110 Bsrr(0) 60 Skr(0)
111 } 61 }
112 } 62 }
113 #[doc = "Port input data register (GPIOn_IDR)"] 63 #[doc = "external interrupt configuration register 4"]
114 #[repr(transparent)] 64 #[repr(transparent)]
115 #[derive(Copy, Clone, Eq, PartialEq)] 65 #[derive(Copy, Clone, Eq, PartialEq)]
116 pub struct Idr(pub u32); 66 pub struct Exticr(pub u32);
117 impl Idr { 67 impl Exticr {
118 #[doc = "Port input data"] 68 #[doc = "EXTI12 configuration bits"]
119 pub fn idr(&self, n: usize) -> super::vals::Idr { 69 pub fn exti(&self, n: usize) -> u8 {
120 assert!(n < 16usize); 70 assert!(n < 4usize);
121 let offs = 0usize + n * 1usize; 71 let offs = 0usize + n * 4usize;
122 let val = (self.0 >> offs) & 0x01; 72 let val = (self.0 >> offs) & 0x0f;
123 super::vals::Idr(val as u8) 73 val as u8
124 } 74 }
125 #[doc = "Port input data"] 75 #[doc = "EXTI12 configuration bits"]
126 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) { 76 pub fn set_exti(&mut self, n: usize, val: u8) {
127 assert!(n < 16usize); 77 assert!(n < 4usize);
128 let offs = 0usize + n * 1usize; 78 let offs = 0usize + n * 4usize;
129 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); 79 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
130 } 80 }
131 } 81 }
132 impl Default for Idr { 82 impl Default for Exticr {
133 fn default() -> Idr { 83 fn default() -> Exticr {
134 Idr(0) 84 Exticr(0)
135 } 85 }
136 } 86 }
137 #[doc = "Port bit reset register (GPIOn_BRR)"] 87 #[doc = "SCSR"]
138 #[repr(transparent)] 88 #[repr(transparent)]
139 #[derive(Copy, Clone, Eq, PartialEq)] 89 #[derive(Copy, Clone, Eq, PartialEq)]
140 pub struct Brr(pub u32); 90 pub struct Scsr(pub u32);
141 impl Brr { 91 impl Scsr {
142 #[doc = "Reset bit"] 92 #[doc = "SRAM2 Erase"]
143 pub fn br(&self, n: usize) -> bool { 93 pub const fn sram2er(&self) -> bool {
144 assert!(n < 16usize); 94 let val = (self.0 >> 0usize) & 0x01;
145 let offs = 0usize + n * 1usize;
146 let val = (self.0 >> offs) & 0x01;
147 val != 0 95 val != 0
148 } 96 }
149 #[doc = "Reset bit"] 97 #[doc = "SRAM2 Erase"]
150 pub fn set_br(&mut self, n: usize, val: bool) { 98 pub fn set_sram2er(&mut self, val: bool) {
151 assert!(n < 16usize); 99 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
152 let offs = 0usize + n * 1usize;
153 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
154 }
155 }
156 impl Default for Brr {
157 fn default() -> Brr {
158 Brr(0)
159 } 100 }
160 } 101 #[doc = "SRAM2 busy by erase operation"]
161 #[doc = "Port output data register (GPIOn_ODR)"] 102 pub const fn sram2bsy(&self) -> bool {
162 #[repr(transparent)] 103 let val = (self.0 >> 1usize) & 0x01;
163 #[derive(Copy, Clone, Eq, PartialEq)] 104 val != 0
164 pub struct Odr(pub u32);
165 impl Odr {
166 #[doc = "Port output data"]
167 pub fn odr(&self, n: usize) -> super::vals::Odr {
168 assert!(n < 16usize);
169 let offs = 0usize + n * 1usize;
170 let val = (self.0 >> offs) & 0x01;
171 super::vals::Odr(val as u8)
172 } 105 }
173 #[doc = "Port output data"] 106 #[doc = "SRAM2 busy by erase operation"]
174 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { 107 pub fn set_sram2bsy(&mut self, val: bool) {
175 assert!(n < 16usize); 108 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
176 let offs = 0usize + n * 1usize;
177 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
178 } 109 }
179 } 110 }
180 impl Default for Odr { 111 impl Default for Scsr {
181 fn default() -> Odr { 112 fn default() -> Scsr {
182 Odr(0) 113 Scsr(0)
183 } 114 }
184 } 115 }
185 #[doc = "Port configuration lock register"] 116 #[doc = "SWPR"]
186 #[repr(transparent)] 117 #[repr(transparent)]
187 #[derive(Copy, Clone, Eq, PartialEq)] 118 #[derive(Copy, Clone, Eq, PartialEq)]
188 pub struct Lckr(pub u32); 119 pub struct Swpr(pub u32);
189 impl Lckr { 120 impl Swpr {
190 #[doc = "Port A Lock bit"] 121 #[doc = "SRAWM2 write protection."]
191 pub fn lck(&self, n: usize) -> super::vals::Lck { 122 pub fn pwp(&self, n: usize) -> bool {
192 assert!(n < 16usize); 123 assert!(n < 32usize);
193 let offs = 0usize + n * 1usize; 124 let offs = 0usize + n * 1usize;
194 let val = (self.0 >> offs) & 0x01; 125 let val = (self.0 >> offs) & 0x01;
195 super::vals::Lck(val as u8)
196 }
197 #[doc = "Port A Lock bit"]
198 pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) {
199 assert!(n < 16usize);
200 let offs = 0usize + n * 1usize;
201 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
202 }
203 #[doc = "Lock key"]
204 pub const fn lckk(&self) -> super::vals::Lckk {
205 let val = (self.0 >> 16usize) & 0x01;
206 super::vals::Lckk(val as u8)
207 }
208 #[doc = "Lock key"]
209 pub fn set_lckk(&mut self, val: super::vals::Lckk) {
210 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
211 }
212 }
213 impl Default for Lckr {
214 fn default() -> Lckr {
215 Lckr(0)
216 }
217 }
218 }
219 pub mod vals {
220 use crate::generic::*;
221 #[repr(transparent)]
222 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
223 pub struct Bsw(pub u8);
224 impl Bsw {
225 #[doc = "No action on the corresponding ODx bit"]
226 pub const NOACTION: Self = Self(0);
227 #[doc = "Sets the corresponding ODRx bit"]
228 pub const SET: Self = Self(0x01);
229 }
230 #[repr(transparent)]
231 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
232 pub struct Lckk(pub u8);
233 impl Lckk {
234 #[doc = "Port configuration lock key not active"]
235 pub const NOTACTIVE: Self = Self(0);
236 #[doc = "Port configuration lock key active"]
237 pub const ACTIVE: Self = Self(0x01);
238 }
239 #[repr(transparent)]
240 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
241 pub struct Odr(pub u8);
242 impl Odr {
243 #[doc = "Set output to logic low"]
244 pub const LOW: Self = Self(0);
245 #[doc = "Set output to logic high"]
246 pub const HIGH: Self = Self(0x01);
247 }
248 #[repr(transparent)]
249 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
250 pub struct Idr(pub u8);
251 impl Idr {
252 #[doc = "Input is logic low"]
253 pub const LOW: Self = Self(0);
254 #[doc = "Input is logic high"]
255 pub const HIGH: Self = Self(0x01);
256 }
257 #[repr(transparent)]
258 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
259 pub struct Mode(pub u8);
260 impl Mode {
261 #[doc = "Input mode (reset state)"]
262 pub const INPUT: Self = Self(0);
263 #[doc = "Output mode 10 MHz"]
264 pub const OUTPUT: Self = Self(0x01);
265 #[doc = "Output mode 2 MHz"]
266 pub const OUTPUT2: Self = Self(0x02);
267 #[doc = "Output mode 50 MHz"]
268 pub const OUTPUT50: Self = Self(0x03);
269 }
270 #[repr(transparent)]
271 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
272 pub struct Lck(pub u8);
273 impl Lck {
274 #[doc = "Port configuration not locked"]
275 pub const UNLOCKED: Self = Self(0);
276 #[doc = "Port configuration locked"]
277 pub const LOCKED: Self = Self(0x01);
278 }
279 #[repr(transparent)]
280 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
281 pub struct Cnf(pub u8);
282 impl Cnf {
283 #[doc = "Analog mode / Push-Pull mode"]
284 pub const PUSHPULL: Self = Self(0);
285 #[doc = "Floating input (reset state) / Open Drain-Mode"]
286 pub const OPENDRAIN: Self = Self(0x01);
287 #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"]
288 pub const ALTPUSHPULL: Self = Self(0x02);
289 #[doc = "Alternate Function Open-Drain Mode"]
290 pub const ALTOPENDRAIN: Self = Self(0x03);
291 }
292 #[repr(transparent)]
293 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
294 pub struct Brw(pub u8);
295 impl Brw {
296 #[doc = "No action on the corresponding ODx bit"]
297 pub const NOACTION: Self = Self(0);
298 #[doc = "Reset the ODx bit"]
299 pub const RESET: Self = Self(0x01);
300 }
301 }
302}
303pub mod syscfg_f4 {
304 use crate::generic::*;
305 #[doc = "System configuration controller"]
306 #[derive(Copy, Clone)]
307 pub struct Syscfg(pub *mut u8);
308 unsafe impl Send for Syscfg {}
309 unsafe impl Sync for Syscfg {}
310 impl Syscfg {
311 #[doc = "memory remap register"]
312 pub fn memrm(self) -> Reg<regs::Memrm, RW> {
313 unsafe { Reg::from_ptr(self.0.add(0usize)) }
314 }
315 #[doc = "peripheral mode configuration register"]
316 pub fn pmc(self) -> Reg<regs::Pmc, RW> {
317 unsafe { Reg::from_ptr(self.0.add(4usize)) }
318 }
319 #[doc = "external interrupt configuration register"]
320 pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> {
321 assert!(n < 4usize);
322 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
323 }
324 #[doc = "Compensation cell control register"]
325 pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> {
326 unsafe { Reg::from_ptr(self.0.add(32usize)) }
327 }
328 }
329 pub mod regs {
330 use crate::generic::*;
331 #[doc = "memory remap register"]
332 #[repr(transparent)]
333 #[derive(Copy, Clone, Eq, PartialEq)]
334 pub struct Memrm(pub u32);
335 impl Memrm {
336 #[doc = "Memory mapping selection"]
337 pub const fn mem_mode(&self) -> u8 {
338 let val = (self.0 >> 0usize) & 0x07;
339 val as u8
340 }
341 #[doc = "Memory mapping selection"]
342 pub fn set_mem_mode(&mut self, val: u8) {
343 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
344 }
345 #[doc = "Flash bank mode selection"]
346 pub const fn fb_mode(&self) -> bool {
347 let val = (self.0 >> 8usize) & 0x01;
348 val != 0 126 val != 0
349 } 127 }
350 #[doc = "Flash bank mode selection"] 128 #[doc = "SRAWM2 write protection."]
351 pub fn set_fb_mode(&mut self, val: bool) { 129 pub fn set_pwp(&mut self, n: usize, val: bool) {
352 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 130 assert!(n < 32usize);
353 } 131 let offs = 0usize + n * 1usize;
354 #[doc = "FMC memory mapping swap"] 132 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
355 pub const fn swp_fmc(&self) -> u8 {
356 let val = (self.0 >> 10usize) & 0x03;
357 val as u8
358 }
359 #[doc = "FMC memory mapping swap"]
360 pub fn set_swp_fmc(&mut self, val: u8) {
361 self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize);
362 } 133 }
363 } 134 }
364 impl Default for Memrm { 135 impl Default for Swpr {
365 fn default() -> Memrm { 136 fn default() -> Swpr {
366 Memrm(0) 137 Swpr(0)
367 } 138 }
368 } 139 }
369 #[doc = "Compensation cell control register"] 140 #[doc = "configuration register 1"]
370 #[repr(transparent)] 141 #[repr(transparent)]
371 #[derive(Copy, Clone, Eq, PartialEq)] 142 #[derive(Copy, Clone, Eq, PartialEq)]
372 pub struct Cmpcr(pub u32); 143 pub struct Cfgr1(pub u32);
373 impl Cmpcr { 144 impl Cfgr1 {
374 #[doc = "Compensation cell power-down"] 145 #[doc = "Firewall disable"]
375 pub const fn cmp_pd(&self) -> bool { 146 pub const fn fwdis(&self) -> bool {
376 let val = (self.0 >> 0usize) & 0x01; 147 let val = (self.0 >> 0usize) & 0x01;
377 val != 0 148 val != 0
378 } 149 }
379 #[doc = "Compensation cell power-down"] 150 #[doc = "Firewall disable"]
380 pub fn set_cmp_pd(&mut self, val: bool) { 151 pub fn set_fwdis(&mut self, val: bool) {
381 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 152 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
382 } 153 }
383 #[doc = "READY"] 154 #[doc = "I/O analog switch voltage booster enable"]
384 pub const fn ready(&self) -> bool { 155 pub const fn boosten(&self) -> bool {
385 let val = (self.0 >> 8usize) & 0x01; 156 let val = (self.0 >> 8usize) & 0x01;
386 val != 0 157 val != 0
387 } 158 }
388 #[doc = "READY"] 159 #[doc = "I/O analog switch voltage booster enable"]
389 pub fn set_ready(&mut self, val: bool) { 160 pub fn set_boosten(&mut self, val: bool) {
390 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 161 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
391 } 162 }
392 } 163 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"]
393 impl Default for Cmpcr { 164 pub const fn i2c_pb6_fmp(&self) -> bool {
394 fn default() -> Cmpcr {
395 Cmpcr(0)
396 }
397 }
398 #[doc = "peripheral mode configuration register"]
399 #[repr(transparent)]
400 #[derive(Copy, Clone, Eq, PartialEq)]
401 pub struct Pmc(pub u32);
402 impl Pmc {
403 #[doc = "ADC1DC2"]
404 pub const fn adc1dc2(&self) -> bool {
405 let val = (self.0 >> 16usize) & 0x01; 165 let val = (self.0 >> 16usize) & 0x01;
406 val != 0 166 val != 0
407 } 167 }
408 #[doc = "ADC1DC2"] 168 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"]
409 pub fn set_adc1dc2(&mut self, val: bool) { 169 pub fn set_i2c_pb6_fmp(&mut self, val: bool) {
410 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 170 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
411 } 171 }
412 #[doc = "ADC2DC2"] 172 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"]
413 pub const fn adc2dc2(&self) -> bool { 173 pub const fn i2c_pb7_fmp(&self) -> bool {
414 let val = (self.0 >> 17usize) & 0x01; 174 let val = (self.0 >> 17usize) & 0x01;
415 val != 0 175 val != 0
416 } 176 }
417 #[doc = "ADC2DC2"] 177 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"]
418 pub fn set_adc2dc2(&mut self, val: bool) { 178 pub fn set_i2c_pb7_fmp(&mut self, val: bool) {
419 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 179 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
420 } 180 }
421 #[doc = "ADC3DC2"] 181 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"]
422 pub const fn adc3dc2(&self) -> bool { 182 pub const fn i2c_pb8_fmp(&self) -> bool {
423 let val = (self.0 >> 18usize) & 0x01; 183 let val = (self.0 >> 18usize) & 0x01;
424 val != 0 184 val != 0
425 } 185 }
426 #[doc = "ADC3DC2"] 186 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"]
427 pub fn set_adc3dc2(&mut self, val: bool) { 187 pub fn set_i2c_pb8_fmp(&mut self, val: bool) {
428 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 188 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
429 } 189 }
430 #[doc = "Ethernet PHY interface selection"] 190 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"]
431 pub const fn mii_rmii_sel(&self) -> bool { 191 pub const fn i2c_pb9_fmp(&self) -> bool {
432 let val = (self.0 >> 23usize) & 0x01; 192 let val = (self.0 >> 19usize) & 0x01;
433 val != 0 193 val != 0
434 } 194 }
435 #[doc = "Ethernet PHY interface selection"] 195 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"]
436 pub fn set_mii_rmii_sel(&mut self, val: bool) { 196 pub fn set_i2c_pb9_fmp(&mut self, val: bool) {
437 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize); 197 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
438 } 198 }
439 } 199 #[doc = "I2C1 Fast-mode Plus driving capability activation"]
440 impl Default for Pmc { 200 pub const fn i2c1_fmp(&self) -> bool {
441 fn default() -> Pmc { 201 let val = (self.0 >> 20usize) & 0x01;
442 Pmc(0) 202 val != 0
443 } 203 }
444 } 204 #[doc = "I2C1 Fast-mode Plus driving capability activation"]
445 #[doc = "external interrupt configuration register"] 205 pub fn set_i2c1_fmp(&mut self, val: bool) {
446 #[repr(transparent)] 206 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
447 #[derive(Copy, Clone, Eq, PartialEq)]
448 pub struct Exticr(pub u32);
449 impl Exticr {
450 #[doc = "EXTI x configuration"]
451 pub fn exti(&self, n: usize) -> u8 {
452 assert!(n < 4usize);
453 let offs = 0usize + n * 4usize;
454 let val = (self.0 >> offs) & 0x0f;
455 val as u8
456 } 207 }
457 #[doc = "EXTI x configuration"] 208 #[doc = "I2C2 Fast-mode Plus driving capability activation"]
458 pub fn set_exti(&mut self, n: usize, val: u8) { 209 pub const fn i2c2_fmp(&self) -> bool {
459 assert!(n < 4usize); 210 let val = (self.0 >> 21usize) & 0x01;
460 let offs = 0usize + n * 4usize; 211 val != 0
461 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
462 } 212 }
463 } 213 #[doc = "I2C2 Fast-mode Plus driving capability activation"]
464 impl Default for Exticr { 214 pub fn set_i2c2_fmp(&mut self, val: bool) {
465 fn default() -> Exticr { 215 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
466 Exticr(0)
467 } 216 }
468 } 217 #[doc = "I2C3 Fast-mode Plus driving capability activation"]
469 } 218 pub const fn i2c3_fmp(&self) -> bool {
470} 219 let val = (self.0 >> 22usize) & 0x01;
471pub mod exti_v1 { 220 val != 0
472 use crate::generic::*;
473 #[doc = "External interrupt/event controller"]
474 #[derive(Copy, Clone)]
475 pub struct Exti(pub *mut u8);
476 unsafe impl Send for Exti {}
477 unsafe impl Sync for Exti {}
478 impl Exti {
479 #[doc = "Interrupt mask register (EXTI_IMR)"]
480 pub fn imr(self) -> Reg<regs::Imr, RW> {
481 unsafe { Reg::from_ptr(self.0.add(0usize)) }
482 }
483 #[doc = "Event mask register (EXTI_EMR)"]
484 pub fn emr(self) -> Reg<regs::Emr, RW> {
485 unsafe { Reg::from_ptr(self.0.add(4usize)) }
486 }
487 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
488 pub fn rtsr(self) -> Reg<regs::Rtsr, RW> {
489 unsafe { Reg::from_ptr(self.0.add(8usize)) }
490 }
491 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
492 pub fn ftsr(self) -> Reg<regs::Ftsr, RW> {
493 unsafe { Reg::from_ptr(self.0.add(12usize)) }
494 }
495 #[doc = "Software interrupt event register (EXTI_SWIER)"]
496 pub fn swier(self) -> Reg<regs::Swier, RW> {
497 unsafe { Reg::from_ptr(self.0.add(16usize)) }
498 }
499 #[doc = "Pending register (EXTI_PR)"]
500 pub fn pr(self) -> Reg<regs::Pr, RW> {
501 unsafe { Reg::from_ptr(self.0.add(20usize)) }
502 }
503 }
504 pub mod regs {
505 use crate::generic::*;
506 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
507 #[repr(transparent)]
508 #[derive(Copy, Clone, Eq, PartialEq)]
509 pub struct Ftsr(pub u32);
510 impl Ftsr {
511 #[doc = "Falling trigger event configuration of line 0"]
512 pub fn tr(&self, n: usize) -> super::vals::Tr {
513 assert!(n < 23usize);
514 let offs = 0usize + n * 1usize;
515 let val = (self.0 >> offs) & 0x01;
516 super::vals::Tr(val as u8)
517 } 221 }
518 #[doc = "Falling trigger event configuration of line 0"] 222 #[doc = "I2C3 Fast-mode Plus driving capability activation"]
519 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { 223 pub fn set_i2c3_fmp(&mut self, val: bool) {
520 assert!(n < 23usize); 224 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
521 let offs = 0usize + n * 1usize; 225 }
522 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); 226 #[doc = "Floating Point Unit interrupts enable bits"]
227 pub const fn fpu_ie(&self) -> u8 {
228 let val = (self.0 >> 26usize) & 0x3f;
229 val as u8
230 }
231 #[doc = "Floating Point Unit interrupts enable bits"]
232 pub fn set_fpu_ie(&mut self, val: u8) {
233 self.0 = (self.0 & !(0x3f << 26usize)) | (((val as u32) & 0x3f) << 26usize);
523 } 234 }
524 } 235 }
525 impl Default for Ftsr { 236 impl Default for Cfgr1 {
526 fn default() -> Ftsr { 237 fn default() -> Cfgr1 {
527 Ftsr(0) 238 Cfgr1(0)
528 } 239 }
529 } 240 }
530 #[doc = "Event mask register (EXTI_EMR)"] 241 #[doc = "memory remap register"]
531 #[repr(transparent)] 242 #[repr(transparent)]
532 #[derive(Copy, Clone, Eq, PartialEq)] 243 #[derive(Copy, Clone, Eq, PartialEq)]
533 pub struct Emr(pub u32); 244 pub struct Memrmp(pub u32);
534 impl Emr { 245 impl Memrmp {
535 #[doc = "Event Mask on line 0"] 246 #[doc = "Memory mapping selection"]
536 pub fn mr(&self, n: usize) -> super::vals::Mr { 247 pub const fn mem_mode(&self) -> u8 {
537 assert!(n < 23usize); 248 let val = (self.0 >> 0usize) & 0x07;
538 let offs = 0usize + n * 1usize; 249 val as u8
539 let val = (self.0 >> offs) & 0x01;
540 super::vals::Mr(val as u8)
541 } 250 }
542 #[doc = "Event Mask on line 0"] 251 #[doc = "Memory mapping selection"]
543 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { 252 pub fn set_mem_mode(&mut self, val: u8) {
544 assert!(n < 23usize); 253 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
545 let offs = 0usize + n * 1usize;
546 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
547 } 254 }
548 } 255 #[doc = "QUADSPI memory mapping swap"]
549 impl Default for Emr { 256 pub const fn qfs(&self) -> bool {
550 fn default() -> Emr { 257 let val = (self.0 >> 3usize) & 0x01;
551 Emr(0) 258 val != 0
552 } 259 }
553 } 260 #[doc = "QUADSPI memory mapping swap"]
554 #[doc = "Software interrupt event register (EXTI_SWIER)"] 261 pub fn set_qfs(&mut self, val: bool) {
555 #[repr(transparent)] 262 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
556 #[derive(Copy, Clone, Eq, PartialEq)] 263 }
557 pub struct Swier(pub u32); 264 #[doc = "Flash Bank mode selection"]
558 impl Swier { 265 pub const fn fb_mode(&self) -> bool {
559 #[doc = "Software Interrupt on line 0"] 266 let val = (self.0 >> 8usize) & 0x01;
560 pub fn swier(&self, n: usize) -> bool {
561 assert!(n < 23usize);
562 let offs = 0usize + n * 1usize;
563 let val = (self.0 >> offs) & 0x01;
564 val != 0 267 val != 0
565 } 268 }
566 #[doc = "Software Interrupt on line 0"] 269 #[doc = "Flash Bank mode selection"]
567 pub fn set_swier(&mut self, n: usize, val: bool) { 270 pub fn set_fb_mode(&mut self, val: bool) {
568 assert!(n < 23usize); 271 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
569 let offs = 0usize + n * 1usize;
570 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
571 } 272 }
572 } 273 }
573 impl Default for Swier { 274 impl Default for Memrmp {
574 fn default() -> Swier { 275 fn default() -> Memrmp {
575 Swier(0) 276 Memrmp(0)
576 } 277 }
577 } 278 }
578 #[doc = "Rising Trigger selection register (EXTI_RTSR)"] 279 #[doc = "CFGR2"]
579 #[repr(transparent)] 280 #[repr(transparent)]
580 #[derive(Copy, Clone, Eq, PartialEq)] 281 #[derive(Copy, Clone, Eq, PartialEq)]
581 pub struct Rtsr(pub u32); 282 pub struct Cfgr2(pub u32);
582 impl Rtsr { 283 impl Cfgr2 {
583 #[doc = "Rising trigger event configuration of line 0"] 284 #[doc = "Cortex LOCKUP (Hardfault) output enable bit"]
584 pub fn tr(&self, n: usize) -> super::vals::Tr { 285 pub const fn cll(&self) -> bool {
585 assert!(n < 23usize); 286 let val = (self.0 >> 0usize) & 0x01;
586 let offs = 0usize + n * 1usize; 287 val != 0
587 let val = (self.0 >> offs) & 0x01;
588 super::vals::Tr(val as u8)
589 } 288 }
590 #[doc = "Rising trigger event configuration of line 0"] 289 #[doc = "Cortex LOCKUP (Hardfault) output enable bit"]
591 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) { 290 pub fn set_cll(&mut self, val: bool) {
592 assert!(n < 23usize); 291 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
593 let offs = 0usize + n * 1usize;
594 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
595 } 292 }
596 } 293 #[doc = "SRAM2 parity lock bit"]
597 impl Default for Rtsr { 294 pub const fn spl(&self) -> bool {
598 fn default() -> Rtsr { 295 let val = (self.0 >> 1usize) & 0x01;
599 Rtsr(0) 296 val != 0
600 } 297 }
601 } 298 #[doc = "SRAM2 parity lock bit"]
602 #[doc = "Interrupt mask register (EXTI_IMR)"] 299 pub fn set_spl(&mut self, val: bool) {
603 #[repr(transparent)] 300 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
604 #[derive(Copy, Clone, Eq, PartialEq)]
605 pub struct Imr(pub u32);
606 impl Imr {
607 #[doc = "Interrupt Mask on line 0"]
608 pub fn mr(&self, n: usize) -> super::vals::Mr {
609 assert!(n < 23usize);
610 let offs = 0usize + n * 1usize;
611 let val = (self.0 >> offs) & 0x01;
612 super::vals::Mr(val as u8)
613 } 301 }
614 #[doc = "Interrupt Mask on line 0"] 302 #[doc = "PVD lock enable bit"]
615 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) { 303 pub const fn pvdl(&self) -> bool {
616 assert!(n < 23usize); 304 let val = (self.0 >> 2usize) & 0x01;
617 let offs = 0usize + n * 1usize; 305 val != 0
618 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
619 } 306 }
620 } 307 #[doc = "PVD lock enable bit"]
621 impl Default for Imr { 308 pub fn set_pvdl(&mut self, val: bool) {
622 fn default() -> Imr { 309 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
623 Imr(0)
624 } 310 }
625 } 311 #[doc = "ECC Lock"]
626 #[doc = "Pending register (EXTI_PR)"] 312 pub const fn eccl(&self) -> bool {
627 #[repr(transparent)] 313 let val = (self.0 >> 3usize) & 0x01;
628 #[derive(Copy, Clone, Eq, PartialEq)]
629 pub struct Pr(pub u32);
630 impl Pr {
631 #[doc = "Pending bit 0"]
632 pub fn pr(&self, n: usize) -> bool {
633 assert!(n < 23usize);
634 let offs = 0usize + n * 1usize;
635 let val = (self.0 >> offs) & 0x01;
636 val != 0 314 val != 0
637 } 315 }
638 #[doc = "Pending bit 0"] 316 #[doc = "ECC Lock"]
639 pub fn set_pr(&mut self, n: usize, val: bool) { 317 pub fn set_eccl(&mut self, val: bool) {
640 assert!(n < 23usize); 318 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
641 let offs = 0usize + n * 1usize;
642 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
643 } 319 }
644 } 320 #[doc = "SRAM2 parity error flag"]
645 impl Default for Pr { 321 pub const fn spf(&self) -> bool {
646 fn default() -> Pr { 322 let val = (self.0 >> 8usize) & 0x01;
647 Pr(0) 323 val != 0
324 }
325 #[doc = "SRAM2 parity error flag"]
326 pub fn set_spf(&mut self, val: bool) {
327 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
648 } 328 }
649 } 329 }
650 } 330 impl Default for Cfgr2 {
651 pub mod vals { 331 fn default() -> Cfgr2 {
652 use crate::generic::*; 332 Cfgr2(0)
653 #[repr(transparent)] 333 }
654 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
655 pub struct Mr(pub u8);
656 impl Mr {
657 #[doc = "Interrupt request line is masked"]
658 pub const MASKED: Self = Self(0);
659 #[doc = "Interrupt request line is unmasked"]
660 pub const UNMASKED: Self = Self(0x01);
661 }
662 #[repr(transparent)]
663 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
664 pub struct Prw(pub u8);
665 impl Prw {
666 #[doc = "Clears pending bit"]
667 pub const CLEAR: Self = Self(0x01);
668 }
669 #[repr(transparent)]
670 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
671 pub struct Swierw(pub u8);
672 impl Swierw {
673 #[doc = "Generates an interrupt request"]
674 pub const PEND: Self = Self(0x01);
675 }
676 #[repr(transparent)]
677 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
678 pub struct Tr(pub u8);
679 impl Tr {
680 #[doc = "Falling edge trigger is disabled"]
681 pub const DISABLED: Self = Self(0);
682 #[doc = "Falling edge trigger is enabled"]
683 pub const ENABLED: Self = Self(0x01);
684 }
685 #[repr(transparent)]
686 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
687 pub struct Prr(pub u8);
688 impl Prr {
689 #[doc = "No trigger request occurred"]
690 pub const NOTPENDING: Self = Self(0);
691 #[doc = "Selected trigger request occurred"]
692 pub const PENDING: Self = Self(0x01);
693 } 334 }
694 } 335 }
695} 336}
@@ -738,69 +379,6 @@ pub mod dma_v1 {
738 unsafe { Reg::from_ptr(self.0.add(12usize)) } 379 unsafe { Reg::from_ptr(self.0.add(12usize)) }
739 } 380 }
740 } 381 }
741 pub mod vals {
742 use crate::generic::*;
743 #[repr(transparent)]
744 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
745 pub struct Pl(pub u8);
746 impl Pl {
747 #[doc = "Low priority"]
748 pub const LOW: Self = Self(0);
749 #[doc = "Medium priority"]
750 pub const MEDIUM: Self = Self(0x01);
751 #[doc = "High priority"]
752 pub const HIGH: Self = Self(0x02);
753 #[doc = "Very high priority"]
754 pub const VERYHIGH: Self = Self(0x03);
755 }
756 #[repr(transparent)]
757 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
758 pub struct Circ(pub u8);
759 impl Circ {
760 #[doc = "Circular buffer disabled"]
761 pub const DISABLED: Self = Self(0);
762 #[doc = "Circular buffer enabled"]
763 pub const ENABLED: Self = Self(0x01);
764 }
765 #[repr(transparent)]
766 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
767 pub struct Inc(pub u8);
768 impl Inc {
769 #[doc = "Increment mode disabled"]
770 pub const DISABLED: Self = Self(0);
771 #[doc = "Increment mode enabled"]
772 pub const ENABLED: Self = Self(0x01);
773 }
774 #[repr(transparent)]
775 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
776 pub struct Size(pub u8);
777 impl Size {
778 #[doc = "8-bit size"]
779 pub const BITS8: Self = Self(0);
780 #[doc = "16-bit size"]
781 pub const BITS16: Self = Self(0x01);
782 #[doc = "32-bit size"]
783 pub const BITS32: Self = Self(0x02);
784 }
785 #[repr(transparent)]
786 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
787 pub struct Memmem(pub u8);
788 impl Memmem {
789 #[doc = "Memory to memory mode disabled"]
790 pub const DISABLED: Self = Self(0);
791 #[doc = "Memory to memory mode enabled"]
792 pub const ENABLED: Self = Self(0x01);
793 }
794 #[repr(transparent)]
795 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
796 pub struct Dir(pub u8);
797 impl Dir {
798 #[doc = "Read from peripheral"]
799 pub const FROMPERIPHERAL: Self = Self(0);
800 #[doc = "Read from memory"]
801 pub const FROMMEMORY: Self = Self(0x01);
802 }
803 }
804 pub mod regs { 382 pub mod regs {
805 use crate::generic::*; 383 use crate::generic::*;
806 #[doc = "DMA interrupt status register (DMA_ISR)"] 384 #[doc = "DMA interrupt status register (DMA_ISR)"]
@@ -866,6 +444,26 @@ pub mod dma_v1 {
866 Isr(0) 444 Isr(0)
867 } 445 }
868 } 446 }
447 #[doc = "DMA channel 1 number of data register"]
448 #[repr(transparent)]
449 #[derive(Copy, Clone, Eq, PartialEq)]
450 pub struct Ndtr(pub u32);
451 impl Ndtr {
452 #[doc = "Number of data to transfer"]
453 pub const fn ndt(&self) -> u16 {
454 let val = (self.0 >> 0usize) & 0xffff;
455 val as u16
456 }
457 #[doc = "Number of data to transfer"]
458 pub fn set_ndt(&mut self, val: u16) {
459 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
460 }
461 }
462 impl Default for Ndtr {
463 fn default() -> Ndtr {
464 Ndtr(0)
465 }
466 }
869 #[doc = "DMA interrupt flag clear register (DMA_IFCR)"] 467 #[doc = "DMA interrupt flag clear register (DMA_IFCR)"]
870 #[repr(transparent)] 468 #[repr(transparent)]
871 #[derive(Copy, Clone, Eq, PartialEq)] 469 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -929,26 +527,6 @@ pub mod dma_v1 {
929 Ifcr(0) 527 Ifcr(0)
930 } 528 }
931 } 529 }
932 #[doc = "DMA channel 1 number of data register"]
933 #[repr(transparent)]
934 #[derive(Copy, Clone, Eq, PartialEq)]
935 pub struct Ndtr(pub u32);
936 impl Ndtr {
937 #[doc = "Number of data to transfer"]
938 pub const fn ndt(&self) -> u16 {
939 let val = (self.0 >> 0usize) & 0xffff;
940 val as u16
941 }
942 #[doc = "Number of data to transfer"]
943 pub fn set_ndt(&mut self, val: u16) {
944 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
945 }
946 }
947 impl Default for Ndtr {
948 fn default() -> Ndtr {
949 Ndtr(0)
950 }
951 }
952 #[doc = "DMA channel configuration register (DMA_CCR)"] 530 #[doc = "DMA channel configuration register (DMA_CCR)"]
953 #[repr(transparent)] 531 #[repr(transparent)]
954 #[derive(Copy, Clone, Eq, PartialEq)] 532 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -1069,6 +647,69 @@ pub mod dma_v1 {
1069 } 647 }
1070 } 648 }
1071 } 649 }
650 pub mod vals {
651 use crate::generic::*;
652 #[repr(transparent)]
653 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
654 pub struct Circ(pub u8);
655 impl Circ {
656 #[doc = "Circular buffer disabled"]
657 pub const DISABLED: Self = Self(0);
658 #[doc = "Circular buffer enabled"]
659 pub const ENABLED: Self = Self(0x01);
660 }
661 #[repr(transparent)]
662 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
663 pub struct Memmem(pub u8);
664 impl Memmem {
665 #[doc = "Memory to memory mode disabled"]
666 pub const DISABLED: Self = Self(0);
667 #[doc = "Memory to memory mode enabled"]
668 pub const ENABLED: Self = Self(0x01);
669 }
670 #[repr(transparent)]
671 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
672 pub struct Dir(pub u8);
673 impl Dir {
674 #[doc = "Read from peripheral"]
675 pub const FROMPERIPHERAL: Self = Self(0);
676 #[doc = "Read from memory"]
677 pub const FROMMEMORY: Self = Self(0x01);
678 }
679 #[repr(transparent)]
680 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
681 pub struct Size(pub u8);
682 impl Size {
683 #[doc = "8-bit size"]
684 pub const BITS8: Self = Self(0);
685 #[doc = "16-bit size"]
686 pub const BITS16: Self = Self(0x01);
687 #[doc = "32-bit size"]
688 pub const BITS32: Self = Self(0x02);
689 }
690 #[repr(transparent)]
691 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
692 pub struct Pl(pub u8);
693 impl Pl {
694 #[doc = "Low priority"]
695 pub const LOW: Self = Self(0);
696 #[doc = "Medium priority"]
697 pub const MEDIUM: Self = Self(0x01);
698 #[doc = "High priority"]
699 pub const HIGH: Self = Self(0x02);
700 #[doc = "Very high priority"]
701 pub const VERYHIGH: Self = Self(0x03);
702 }
703 #[repr(transparent)]
704 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
705 pub struct Inc(pub u8);
706 impl Inc {
707 #[doc = "Increment mode disabled"]
708 pub const DISABLED: Self = Self(0);
709 #[doc = "Increment mode enabled"]
710 pub const ENABLED: Self = Self(0x01);
711 }
712 }
1072} 713}
1073pub mod generic { 714pub mod generic {
1074 use core::marker::PhantomData; 715 use core::marker::PhantomData;
@@ -1140,336 +781,769 @@ pub mod generic {
1140 } 781 }
1141 } 782 }
1142} 783}
1143pub mod syscfg_l4 { 784pub mod spi_v1 {
1144 use crate::generic::*; 785 use crate::generic::*;
1145 #[doc = "System configuration controller"] 786 #[doc = "Serial peripheral interface"]
1146 #[derive(Copy, Clone)] 787 #[derive(Copy, Clone)]
1147 pub struct Syscfg(pub *mut u8); 788 pub struct Spi(pub *mut u8);
1148 unsafe impl Send for Syscfg {} 789 unsafe impl Send for Spi {}
1149 unsafe impl Sync for Syscfg {} 790 unsafe impl Sync for Spi {}
1150 impl Syscfg { 791 impl Spi {
1151 #[doc = "memory remap register"] 792 #[doc = "control register 1"]
1152 pub fn memrmp(self) -> Reg<regs::Memrmp, RW> { 793 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
1153 unsafe { Reg::from_ptr(self.0.add(0usize)) } 794 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1154 } 795 }
1155 #[doc = "configuration register 1"] 796 #[doc = "control register 2"]
1156 pub fn cfgr1(self) -> Reg<regs::Cfgr1, RW> { 797 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
1157 unsafe { Reg::from_ptr(self.0.add(4usize)) } 798 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1158 } 799 }
1159 #[doc = "external interrupt configuration register 1"] 800 #[doc = "status register"]
1160 pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> { 801 pub fn sr(self) -> Reg<regs::Sr, RW> {
1161 assert!(n < 4usize); 802 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1162 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
1163 } 803 }
1164 #[doc = "SCSR"] 804 #[doc = "data register"]
1165 pub fn scsr(self) -> Reg<regs::Scsr, RW> { 805 pub fn dr(self) -> Reg<regs::Dr, RW> {
806 unsafe { Reg::from_ptr(self.0.add(12usize)) }
807 }
808 #[doc = "CRC polynomial register"]
809 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
810 unsafe { Reg::from_ptr(self.0.add(16usize)) }
811 }
812 #[doc = "RX CRC register"]
813 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
814 unsafe { Reg::from_ptr(self.0.add(20usize)) }
815 }
816 #[doc = "TX CRC register"]
817 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
1166 unsafe { Reg::from_ptr(self.0.add(24usize)) } 818 unsafe { Reg::from_ptr(self.0.add(24usize)) }
1167 } 819 }
1168 #[doc = "CFGR2"] 820 }
1169 pub fn cfgr2(self) -> Reg<regs::Cfgr2, RW> { 821 pub mod vals {
1170 unsafe { Reg::from_ptr(self.0.add(28usize)) } 822 use crate::generic::*;
823 #[repr(transparent)]
824 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
825 pub struct Crcnext(pub u8);
826 impl Crcnext {
827 #[doc = "Next transmit value is from Tx buffer"]
828 pub const TXBUFFER: Self = Self(0);
829 #[doc = "Next transmit value is from Tx CRC register"]
830 pub const CRC: Self = Self(0x01);
1171 } 831 }
1172 #[doc = "SWPR"] 832 #[repr(transparent)]
1173 pub fn swpr(self) -> Reg<regs::Swpr, W> { 833 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1174 unsafe { Reg::from_ptr(self.0.add(32usize)) } 834 pub struct Br(pub u8);
835 impl Br {
836 #[doc = "f_PCLK / 2"]
837 pub const DIV2: Self = Self(0);
838 #[doc = "f_PCLK / 4"]
839 pub const DIV4: Self = Self(0x01);
840 #[doc = "f_PCLK / 8"]
841 pub const DIV8: Self = Self(0x02);
842 #[doc = "f_PCLK / 16"]
843 pub const DIV16: Self = Self(0x03);
844 #[doc = "f_PCLK / 32"]
845 pub const DIV32: Self = Self(0x04);
846 #[doc = "f_PCLK / 64"]
847 pub const DIV64: Self = Self(0x05);
848 #[doc = "f_PCLK / 128"]
849 pub const DIV128: Self = Self(0x06);
850 #[doc = "f_PCLK / 256"]
851 pub const DIV256: Self = Self(0x07);
1175 } 852 }
1176 #[doc = "SKR"] 853 #[repr(transparent)]
1177 pub fn skr(self) -> Reg<regs::Skr, W> { 854 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1178 unsafe { Reg::from_ptr(self.0.add(36usize)) } 855 pub struct Cpol(pub u8);
856 impl Cpol {
857 #[doc = "CK to 0 when idle"]
858 pub const IDLELOW: Self = Self(0);
859 #[doc = "CK to 1 when idle"]
860 pub const IDLEHIGH: Self = Self(0x01);
861 }
862 #[repr(transparent)]
863 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
864 pub struct Mstr(pub u8);
865 impl Mstr {
866 #[doc = "Slave configuration"]
867 pub const SLAVE: Self = Self(0);
868 #[doc = "Master configuration"]
869 pub const MASTER: Self = Self(0x01);
870 }
871 #[repr(transparent)]
872 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
873 pub struct Dff(pub u8);
874 impl Dff {
875 #[doc = "8-bit data frame format is selected for transmission/reception"]
876 pub const EIGHTBIT: Self = Self(0);
877 #[doc = "16-bit data frame format is selected for transmission/reception"]
878 pub const SIXTEENBIT: Self = Self(0x01);
879 }
880 #[repr(transparent)]
881 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
882 pub struct Cpha(pub u8);
883 impl Cpha {
884 #[doc = "The first clock transition is the first data capture edge"]
885 pub const FIRSTEDGE: Self = Self(0);
886 #[doc = "The second clock transition is the first data capture edge"]
887 pub const SECONDEDGE: Self = Self(0x01);
888 }
889 #[repr(transparent)]
890 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
891 pub struct Frer(pub u8);
892 impl Frer {
893 #[doc = "No frame format error"]
894 pub const NOERROR: Self = Self(0);
895 #[doc = "A frame format error occurred"]
896 pub const ERROR: Self = Self(0x01);
897 }
898 #[repr(transparent)]
899 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
900 pub struct Bidioe(pub u8);
901 impl Bidioe {
902 #[doc = "Output disabled (receive-only mode)"]
903 pub const OUTPUTDISABLED: Self = Self(0);
904 #[doc = "Output enabled (transmit-only mode)"]
905 pub const OUTPUTENABLED: Self = Self(0x01);
906 }
907 #[repr(transparent)]
908 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
909 pub struct Rxonly(pub u8);
910 impl Rxonly {
911 #[doc = "Full duplex (Transmit and receive)"]
912 pub const FULLDUPLEX: Self = Self(0);
913 #[doc = "Output disabled (Receive-only mode)"]
914 pub const OUTPUTDISABLED: Self = Self(0x01);
915 }
916 #[repr(transparent)]
917 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
918 pub struct Iscfg(pub u8);
919 impl Iscfg {
920 #[doc = "Slave - transmit"]
921 pub const SLAVETX: Self = Self(0);
922 #[doc = "Slave - receive"]
923 pub const SLAVERX: Self = Self(0x01);
924 #[doc = "Master - transmit"]
925 pub const MASTERTX: Self = Self(0x02);
926 #[doc = "Master - receive"]
927 pub const MASTERRX: Self = Self(0x03);
928 }
929 #[repr(transparent)]
930 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
931 pub struct Lsbfirst(pub u8);
932 impl Lsbfirst {
933 #[doc = "Data is transmitted/received with the MSB first"]
934 pub const MSBFIRST: Self = Self(0);
935 #[doc = "Data is transmitted/received with the LSB first"]
936 pub const LSBFIRST: Self = Self(0x01);
937 }
938 #[repr(transparent)]
939 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
940 pub struct Frf(pub u8);
941 impl Frf {
942 #[doc = "SPI Motorola mode"]
943 pub const MOTOROLA: Self = Self(0);
944 #[doc = "SPI TI mode"]
945 pub const TI: Self = Self(0x01);
946 }
947 #[repr(transparent)]
948 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
949 pub struct Bidimode(pub u8);
950 impl Bidimode {
951 #[doc = "2-line unidirectional data mode selected"]
952 pub const UNIDIRECTIONAL: Self = Self(0);
953 #[doc = "1-line bidirectional data mode selected"]
954 pub const BIDIRECTIONAL: Self = Self(0x01);
1179 } 955 }
1180 } 956 }
1181 pub mod regs { 957 pub mod regs {
1182 use crate::generic::*; 958 use crate::generic::*;
1183 #[doc = "external interrupt configuration register 4"] 959 #[doc = "status register"]
1184 #[repr(transparent)] 960 #[repr(transparent)]
1185 #[derive(Copy, Clone, Eq, PartialEq)] 961 #[derive(Copy, Clone, Eq, PartialEq)]
1186 pub struct Exticr(pub u32); 962 pub struct Sr(pub u32);
1187 impl Exticr { 963 impl Sr {
1188 #[doc = "EXTI12 configuration bits"] 964 #[doc = "Receive buffer not empty"]
1189 pub fn exti(&self, n: usize) -> u8 { 965 pub const fn rxne(&self) -> bool {
1190 assert!(n < 4usize); 966 let val = (self.0 >> 0usize) & 0x01;
1191 let offs = 0usize + n * 4usize; 967 val != 0
1192 let val = (self.0 >> offs) & 0x0f;
1193 val as u8
1194 } 968 }
1195 #[doc = "EXTI12 configuration bits"] 969 #[doc = "Receive buffer not empty"]
1196 pub fn set_exti(&mut self, n: usize, val: u8) { 970 pub fn set_rxne(&mut self, val: bool) {
1197 assert!(n < 4usize); 971 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1198 let offs = 0usize + n * 4usize; 972 }
1199 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs); 973 #[doc = "Transmit buffer empty"]
974 pub const fn txe(&self) -> bool {
975 let val = (self.0 >> 1usize) & 0x01;
976 val != 0
977 }
978 #[doc = "Transmit buffer empty"]
979 pub fn set_txe(&mut self, val: bool) {
980 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
981 }
982 #[doc = "CRC error flag"]
983 pub const fn crcerr(&self) -> bool {
984 let val = (self.0 >> 4usize) & 0x01;
985 val != 0
986 }
987 #[doc = "CRC error flag"]
988 pub fn set_crcerr(&mut self, val: bool) {
989 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
990 }
991 #[doc = "Mode fault"]
992 pub const fn modf(&self) -> bool {
993 let val = (self.0 >> 5usize) & 0x01;
994 val != 0
995 }
996 #[doc = "Mode fault"]
997 pub fn set_modf(&mut self, val: bool) {
998 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
999 }
1000 #[doc = "Overrun flag"]
1001 pub const fn ovr(&self) -> bool {
1002 let val = (self.0 >> 6usize) & 0x01;
1003 val != 0
1004 }
1005 #[doc = "Overrun flag"]
1006 pub fn set_ovr(&mut self, val: bool) {
1007 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1008 }
1009 #[doc = "Busy flag"]
1010 pub const fn bsy(&self) -> bool {
1011 let val = (self.0 >> 7usize) & 0x01;
1012 val != 0
1013 }
1014 #[doc = "Busy flag"]
1015 pub fn set_bsy(&mut self, val: bool) {
1016 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
1017 }
1018 #[doc = "TI frame format error"]
1019 pub const fn fre(&self) -> bool {
1020 let val = (self.0 >> 8usize) & 0x01;
1021 val != 0
1022 }
1023 #[doc = "TI frame format error"]
1024 pub fn set_fre(&mut self, val: bool) {
1025 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
1200 } 1026 }
1201 } 1027 }
1202 impl Default for Exticr { 1028 impl Default for Sr {
1203 fn default() -> Exticr { 1029 fn default() -> Sr {
1204 Exticr(0) 1030 Sr(0)
1205 } 1031 }
1206 } 1032 }
1207 #[doc = "SWPR"] 1033 #[doc = "TX CRC register"]
1208 #[repr(transparent)] 1034 #[repr(transparent)]
1209 #[derive(Copy, Clone, Eq, PartialEq)] 1035 #[derive(Copy, Clone, Eq, PartialEq)]
1210 pub struct Swpr(pub u32); 1036 pub struct Txcrcr(pub u32);
1211 impl Swpr { 1037 impl Txcrcr {
1212 #[doc = "SRAWM2 write protection."] 1038 #[doc = "Tx CRC register"]
1213 pub fn pwp(&self, n: usize) -> bool { 1039 pub const fn tx_crc(&self) -> u16 {
1214 assert!(n < 32usize); 1040 let val = (self.0 >> 0usize) & 0xffff;
1215 let offs = 0usize + n * 1usize; 1041 val as u16
1216 let val = (self.0 >> offs) & 0x01;
1217 val != 0
1218 } 1042 }
1219 #[doc = "SRAWM2 write protection."] 1043 #[doc = "Tx CRC register"]
1220 pub fn set_pwp(&mut self, n: usize, val: bool) { 1044 pub fn set_tx_crc(&mut self, val: u16) {
1221 assert!(n < 32usize); 1045 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1222 let offs = 0usize + n * 1usize;
1223 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1224 } 1046 }
1225 } 1047 }
1226 impl Default for Swpr { 1048 impl Default for Txcrcr {
1227 fn default() -> Swpr { 1049 fn default() -> Txcrcr {
1228 Swpr(0) 1050 Txcrcr(0)
1229 } 1051 }
1230 } 1052 }
1231 #[doc = "configuration register 1"] 1053 #[doc = "RX CRC register"]
1232 #[repr(transparent)] 1054 #[repr(transparent)]
1233 #[derive(Copy, Clone, Eq, PartialEq)] 1055 #[derive(Copy, Clone, Eq, PartialEq)]
1234 pub struct Cfgr1(pub u32); 1056 pub struct Rxcrcr(pub u32);
1235 impl Cfgr1 { 1057 impl Rxcrcr {
1236 #[doc = "Firewall disable"] 1058 #[doc = "Rx CRC register"]
1237 pub const fn fwdis(&self) -> bool { 1059 pub const fn rx_crc(&self) -> u16 {
1238 let val = (self.0 >> 0usize) & 0x01; 1060 let val = (self.0 >> 0usize) & 0xffff;
1239 val != 0 1061 val as u16
1240 } 1062 }
1241 #[doc = "Firewall disable"] 1063 #[doc = "Rx CRC register"]
1242 pub fn set_fwdis(&mut self, val: bool) { 1064 pub fn set_rx_crc(&mut self, val: u16) {
1243 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 1065 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1244 } 1066 }
1245 #[doc = "I/O analog switch voltage booster enable"] 1067 }
1246 pub const fn boosten(&self) -> bool { 1068 impl Default for Rxcrcr {
1247 let val = (self.0 >> 8usize) & 0x01; 1069 fn default() -> Rxcrcr {
1248 val != 0 1070 Rxcrcr(0)
1249 } 1071 }
1250 #[doc = "I/O analog switch voltage booster enable"] 1072 }
1251 pub fn set_boosten(&mut self, val: bool) { 1073 #[doc = "CRC polynomial register"]
1252 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 1074 #[repr(transparent)]
1075 #[derive(Copy, Clone, Eq, PartialEq)]
1076 pub struct Crcpr(pub u32);
1077 impl Crcpr {
1078 #[doc = "CRC polynomial register"]
1079 pub const fn crcpoly(&self) -> u16 {
1080 let val = (self.0 >> 0usize) & 0xffff;
1081 val as u16
1253 } 1082 }
1254 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] 1083 #[doc = "CRC polynomial register"]
1255 pub const fn i2c_pb6_fmp(&self) -> bool { 1084 pub fn set_crcpoly(&mut self, val: u16) {
1256 let val = (self.0 >> 16usize) & 0x01; 1085 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1257 val != 0
1258 } 1086 }
1259 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB6"] 1087 }
1260 pub fn set_i2c_pb6_fmp(&mut self, val: bool) { 1088 impl Default for Crcpr {
1261 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 1089 fn default() -> Crcpr {
1090 Crcpr(0)
1262 } 1091 }
1263 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] 1092 }
1264 pub const fn i2c_pb7_fmp(&self) -> bool { 1093 #[doc = "control register 2"]
1265 let val = (self.0 >> 17usize) & 0x01; 1094 #[repr(transparent)]
1095 #[derive(Copy, Clone, Eq, PartialEq)]
1096 pub struct Cr2(pub u32);
1097 impl Cr2 {
1098 #[doc = "Rx buffer DMA enable"]
1099 pub const fn rxdmaen(&self) -> bool {
1100 let val = (self.0 >> 0usize) & 0x01;
1266 val != 0 1101 val != 0
1267 } 1102 }
1268 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB7"] 1103 #[doc = "Rx buffer DMA enable"]
1269 pub fn set_i2c_pb7_fmp(&mut self, val: bool) { 1104 pub fn set_rxdmaen(&mut self, val: bool) {
1270 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 1105 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1271 } 1106 }
1272 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] 1107 #[doc = "Tx buffer DMA enable"]
1273 pub const fn i2c_pb8_fmp(&self) -> bool { 1108 pub const fn txdmaen(&self) -> bool {
1274 let val = (self.0 >> 18usize) & 0x01; 1109 let val = (self.0 >> 1usize) & 0x01;
1275 val != 0 1110 val != 0
1276 } 1111 }
1277 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB8"] 1112 #[doc = "Tx buffer DMA enable"]
1278 pub fn set_i2c_pb8_fmp(&mut self, val: bool) { 1113 pub fn set_txdmaen(&mut self, val: bool) {
1279 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 1114 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
1280 } 1115 }
1281 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] 1116 #[doc = "SS output enable"]
1282 pub const fn i2c_pb9_fmp(&self) -> bool { 1117 pub const fn ssoe(&self) -> bool {
1283 let val = (self.0 >> 19usize) & 0x01; 1118 let val = (self.0 >> 2usize) & 0x01;
1284 val != 0 1119 val != 0
1285 } 1120 }
1286 #[doc = "Fast-mode Plus (Fm+) driving capability activation on PB9"] 1121 #[doc = "SS output enable"]
1287 pub fn set_i2c_pb9_fmp(&mut self, val: bool) { 1122 pub fn set_ssoe(&mut self, val: bool) {
1288 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); 1123 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
1289 } 1124 }
1290 #[doc = "I2C1 Fast-mode Plus driving capability activation"] 1125 #[doc = "Frame format"]
1291 pub const fn i2c1_fmp(&self) -> bool { 1126 pub const fn frf(&self) -> super::vals::Frf {
1292 let val = (self.0 >> 20usize) & 0x01; 1127 let val = (self.0 >> 4usize) & 0x01;
1293 val != 0 1128 super::vals::Frf(val as u8)
1294 } 1129 }
1295 #[doc = "I2C1 Fast-mode Plus driving capability activation"] 1130 #[doc = "Frame format"]
1296 pub fn set_i2c1_fmp(&mut self, val: bool) { 1131 pub fn set_frf(&mut self, val: super::vals::Frf) {
1297 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize); 1132 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
1298 } 1133 }
1299 #[doc = "I2C2 Fast-mode Plus driving capability activation"] 1134 #[doc = "Error interrupt enable"]
1300 pub const fn i2c2_fmp(&self) -> bool { 1135 pub const fn errie(&self) -> bool {
1301 let val = (self.0 >> 21usize) & 0x01; 1136 let val = (self.0 >> 5usize) & 0x01;
1302 val != 0 1137 val != 0
1303 } 1138 }
1304 #[doc = "I2C2 Fast-mode Plus driving capability activation"] 1139 #[doc = "Error interrupt enable"]
1305 pub fn set_i2c2_fmp(&mut self, val: bool) { 1140 pub fn set_errie(&mut self, val: bool) {
1306 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize); 1141 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
1307 } 1142 }
1308 #[doc = "I2C3 Fast-mode Plus driving capability activation"] 1143 #[doc = "RX buffer not empty interrupt enable"]
1309 pub const fn i2c3_fmp(&self) -> bool { 1144 pub const fn rxneie(&self) -> bool {
1310 let val = (self.0 >> 22usize) & 0x01; 1145 let val = (self.0 >> 6usize) & 0x01;
1311 val != 0 1146 val != 0
1312 } 1147 }
1313 #[doc = "I2C3 Fast-mode Plus driving capability activation"] 1148 #[doc = "RX buffer not empty interrupt enable"]
1314 pub fn set_i2c3_fmp(&mut self, val: bool) { 1149 pub fn set_rxneie(&mut self, val: bool) {
1315 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize); 1150 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1316 } 1151 }
1317 #[doc = "Floating Point Unit interrupts enable bits"] 1152 #[doc = "Tx buffer empty interrupt enable"]
1318 pub const fn fpu_ie(&self) -> u8 { 1153 pub const fn txeie(&self) -> bool {
1319 let val = (self.0 >> 26usize) & 0x3f; 1154 let val = (self.0 >> 7usize) & 0x01;
1320 val as u8 1155 val != 0
1321 } 1156 }
1322 #[doc = "Floating Point Unit interrupts enable bits"] 1157 #[doc = "Tx buffer empty interrupt enable"]
1323 pub fn set_fpu_ie(&mut self, val: u8) { 1158 pub fn set_txeie(&mut self, val: bool) {
1324 self.0 = (self.0 & !(0x3f << 26usize)) | (((val as u32) & 0x3f) << 26usize); 1159 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
1325 } 1160 }
1326 } 1161 }
1327 impl Default for Cfgr1 { 1162 impl Default for Cr2 {
1328 fn default() -> Cfgr1 { 1163 fn default() -> Cr2 {
1329 Cfgr1(0) 1164 Cr2(0)
1330 } 1165 }
1331 } 1166 }
1332 #[doc = "memory remap register"] 1167 #[doc = "control register 1"]
1333 #[repr(transparent)] 1168 #[repr(transparent)]
1334 #[derive(Copy, Clone, Eq, PartialEq)] 1169 #[derive(Copy, Clone, Eq, PartialEq)]
1335 pub struct Memrmp(pub u32); 1170 pub struct Cr1(pub u32);
1336 impl Memrmp { 1171 impl Cr1 {
1337 #[doc = "Memory mapping selection"] 1172 #[doc = "Clock phase"]
1338 pub const fn mem_mode(&self) -> u8 { 1173 pub const fn cpha(&self) -> super::vals::Cpha {
1339 let val = (self.0 >> 0usize) & 0x07; 1174 let val = (self.0 >> 0usize) & 0x01;
1340 val as u8 1175 super::vals::Cpha(val as u8)
1341 } 1176 }
1342 #[doc = "Memory mapping selection"] 1177 #[doc = "Clock phase"]
1343 pub fn set_mem_mode(&mut self, val: u8) { 1178 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
1344 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize); 1179 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
1345 } 1180 }
1346 #[doc = "QUADSPI memory mapping swap"] 1181 #[doc = "Clock polarity"]
1347 pub const fn qfs(&self) -> bool { 1182 pub const fn cpol(&self) -> super::vals::Cpol {
1348 let val = (self.0 >> 3usize) & 0x01; 1183 let val = (self.0 >> 1usize) & 0x01;
1184 super::vals::Cpol(val as u8)
1185 }
1186 #[doc = "Clock polarity"]
1187 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
1188 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
1189 }
1190 #[doc = "Master selection"]
1191 pub const fn mstr(&self) -> super::vals::Mstr {
1192 let val = (self.0 >> 2usize) & 0x01;
1193 super::vals::Mstr(val as u8)
1194 }
1195 #[doc = "Master selection"]
1196 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
1197 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
1198 }
1199 #[doc = "Baud rate control"]
1200 pub const fn br(&self) -> super::vals::Br {
1201 let val = (self.0 >> 3usize) & 0x07;
1202 super::vals::Br(val as u8)
1203 }
1204 #[doc = "Baud rate control"]
1205 pub fn set_br(&mut self, val: super::vals::Br) {
1206 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
1207 }
1208 #[doc = "SPI enable"]
1209 pub const fn spe(&self) -> bool {
1210 let val = (self.0 >> 6usize) & 0x01;
1349 val != 0 1211 val != 0
1350 } 1212 }
1351 #[doc = "QUADSPI memory mapping swap"] 1213 #[doc = "SPI enable"]
1352 pub fn set_qfs(&mut self, val: bool) { 1214 pub fn set_spe(&mut self, val: bool) {
1353 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 1215 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
1354 } 1216 }
1355 #[doc = "Flash Bank mode selection"] 1217 #[doc = "Frame format"]
1356 pub const fn fb_mode(&self) -> bool { 1218 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst {
1219 let val = (self.0 >> 7usize) & 0x01;
1220 super::vals::Lsbfirst(val as u8)
1221 }
1222 #[doc = "Frame format"]
1223 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) {
1224 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
1225 }
1226 #[doc = "Internal slave select"]
1227 pub const fn ssi(&self) -> bool {
1357 let val = (self.0 >> 8usize) & 0x01; 1228 let val = (self.0 >> 8usize) & 0x01;
1358 val != 0 1229 val != 0
1359 } 1230 }
1360 #[doc = "Flash Bank mode selection"] 1231 #[doc = "Internal slave select"]
1361 pub fn set_fb_mode(&mut self, val: bool) { 1232 pub fn set_ssi(&mut self, val: bool) {
1362 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 1233 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
1363 } 1234 }
1235 #[doc = "Software slave management"]
1236 pub const fn ssm(&self) -> bool {
1237 let val = (self.0 >> 9usize) & 0x01;
1238 val != 0
1239 }
1240 #[doc = "Software slave management"]
1241 pub fn set_ssm(&mut self, val: bool) {
1242 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
1243 }
1244 #[doc = "Receive only"]
1245 pub const fn rxonly(&self) -> super::vals::Rxonly {
1246 let val = (self.0 >> 10usize) & 0x01;
1247 super::vals::Rxonly(val as u8)
1248 }
1249 #[doc = "Receive only"]
1250 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
1251 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
1252 }
1253 #[doc = "Data frame format"]
1254 pub const fn dff(&self) -> super::vals::Dff {
1255 let val = (self.0 >> 11usize) & 0x01;
1256 super::vals::Dff(val as u8)
1257 }
1258 #[doc = "Data frame format"]
1259 pub fn set_dff(&mut self, val: super::vals::Dff) {
1260 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
1261 }
1262 #[doc = "CRC transfer next"]
1263 pub const fn crcnext(&self) -> super::vals::Crcnext {
1264 let val = (self.0 >> 12usize) & 0x01;
1265 super::vals::Crcnext(val as u8)
1266 }
1267 #[doc = "CRC transfer next"]
1268 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
1269 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
1270 }
1271 #[doc = "Hardware CRC calculation enable"]
1272 pub const fn crcen(&self) -> bool {
1273 let val = (self.0 >> 13usize) & 0x01;
1274 val != 0
1275 }
1276 #[doc = "Hardware CRC calculation enable"]
1277 pub fn set_crcen(&mut self, val: bool) {
1278 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
1279 }
1280 #[doc = "Output enable in bidirectional mode"]
1281 pub const fn bidioe(&self) -> super::vals::Bidioe {
1282 let val = (self.0 >> 14usize) & 0x01;
1283 super::vals::Bidioe(val as u8)
1284 }
1285 #[doc = "Output enable in bidirectional mode"]
1286 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) {
1287 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
1288 }
1289 #[doc = "Bidirectional data mode enable"]
1290 pub const fn bidimode(&self) -> super::vals::Bidimode {
1291 let val = (self.0 >> 15usize) & 0x01;
1292 super::vals::Bidimode(val as u8)
1293 }
1294 #[doc = "Bidirectional data mode enable"]
1295 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) {
1296 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
1297 }
1364 } 1298 }
1365 impl Default for Memrmp { 1299 impl Default for Cr1 {
1366 fn default() -> Memrmp { 1300 fn default() -> Cr1 {
1367 Memrmp(0) 1301 Cr1(0)
1368 } 1302 }
1369 } 1303 }
1370 #[doc = "SCSR"] 1304 #[doc = "data register"]
1371 #[repr(transparent)] 1305 #[repr(transparent)]
1372 #[derive(Copy, Clone, Eq, PartialEq)] 1306 #[derive(Copy, Clone, Eq, PartialEq)]
1373 pub struct Scsr(pub u32); 1307 pub struct Dr(pub u32);
1374 impl Scsr { 1308 impl Dr {
1375 #[doc = "SRAM2 Erase"] 1309 #[doc = "Data register"]
1376 pub const fn sram2er(&self) -> bool { 1310 pub const fn dr(&self) -> u16 {
1377 let val = (self.0 >> 0usize) & 0x01; 1311 let val = (self.0 >> 0usize) & 0xffff;
1378 val != 0 1312 val as u16
1379 } 1313 }
1380 #[doc = "SRAM2 Erase"] 1314 #[doc = "Data register"]
1381 pub fn set_sram2er(&mut self, val: bool) { 1315 pub fn set_dr(&mut self, val: u16) {
1382 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 1316 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
1383 } 1317 }
1384 #[doc = "SRAM2 busy by erase operation"] 1318 }
1385 pub const fn sram2bsy(&self) -> bool { 1319 impl Default for Dr {
1386 let val = (self.0 >> 1usize) & 0x01; 1320 fn default() -> Dr {
1387 val != 0 1321 Dr(0)
1388 } 1322 }
1389 #[doc = "SRAM2 busy by erase operation"] 1323 }
1390 pub fn set_sram2bsy(&mut self, val: bool) { 1324 }
1391 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 1325}
1326pub mod exti_v1 {
1327 use crate::generic::*;
1328 #[doc = "External interrupt/event controller"]
1329 #[derive(Copy, Clone)]
1330 pub struct Exti(pub *mut u8);
1331 unsafe impl Send for Exti {}
1332 unsafe impl Sync for Exti {}
1333 impl Exti {
1334 #[doc = "Interrupt mask register (EXTI_IMR)"]
1335 pub fn imr(self) -> Reg<regs::Imr, RW> {
1336 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1337 }
1338 #[doc = "Event mask register (EXTI_EMR)"]
1339 pub fn emr(self) -> Reg<regs::Emr, RW> {
1340 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1341 }
1342 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
1343 pub fn rtsr(self) -> Reg<regs::Rtsr, RW> {
1344 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1345 }
1346 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
1347 pub fn ftsr(self) -> Reg<regs::Ftsr, RW> {
1348 unsafe { Reg::from_ptr(self.0.add(12usize)) }
1349 }
1350 #[doc = "Software interrupt event register (EXTI_SWIER)"]
1351 pub fn swier(self) -> Reg<regs::Swier, RW> {
1352 unsafe { Reg::from_ptr(self.0.add(16usize)) }
1353 }
1354 #[doc = "Pending register (EXTI_PR)"]
1355 pub fn pr(self) -> Reg<regs::Pr, RW> {
1356 unsafe { Reg::from_ptr(self.0.add(20usize)) }
1357 }
1358 }
1359 pub mod vals {
1360 use crate::generic::*;
1361 #[repr(transparent)]
1362 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1363 pub struct Prr(pub u8);
1364 impl Prr {
1365 #[doc = "No trigger request occurred"]
1366 pub const NOTPENDING: Self = Self(0);
1367 #[doc = "Selected trigger request occurred"]
1368 pub const PENDING: Self = Self(0x01);
1369 }
1370 #[repr(transparent)]
1371 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1372 pub struct Prw(pub u8);
1373 impl Prw {
1374 #[doc = "Clears pending bit"]
1375 pub const CLEAR: Self = Self(0x01);
1376 }
1377 #[repr(transparent)]
1378 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1379 pub struct Swierw(pub u8);
1380 impl Swierw {
1381 #[doc = "Generates an interrupt request"]
1382 pub const PEND: Self = Self(0x01);
1383 }
1384 #[repr(transparent)]
1385 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1386 pub struct Mr(pub u8);
1387 impl Mr {
1388 #[doc = "Interrupt request line is masked"]
1389 pub const MASKED: Self = Self(0);
1390 #[doc = "Interrupt request line is unmasked"]
1391 pub const UNMASKED: Self = Self(0x01);
1392 }
1393 #[repr(transparent)]
1394 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1395 pub struct Tr(pub u8);
1396 impl Tr {
1397 #[doc = "Falling edge trigger is disabled"]
1398 pub const DISABLED: Self = Self(0);
1399 #[doc = "Falling edge trigger is enabled"]
1400 pub const ENABLED: Self = Self(0x01);
1401 }
1402 }
1403 pub mod regs {
1404 use crate::generic::*;
1405 #[doc = "Rising Trigger selection register (EXTI_RTSR)"]
1406 #[repr(transparent)]
1407 #[derive(Copy, Clone, Eq, PartialEq)]
1408 pub struct Rtsr(pub u32);
1409 impl Rtsr {
1410 #[doc = "Rising trigger event configuration of line 0"]
1411 pub fn tr(&self, n: usize) -> super::vals::Tr {
1412 assert!(n < 23usize);
1413 let offs = 0usize + n * 1usize;
1414 let val = (self.0 >> offs) & 0x01;
1415 super::vals::Tr(val as u8)
1416 }
1417 #[doc = "Rising trigger event configuration of line 0"]
1418 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) {
1419 assert!(n < 23usize);
1420 let offs = 0usize + n * 1usize;
1421 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1392 } 1422 }
1393 } 1423 }
1394 impl Default for Scsr { 1424 impl Default for Rtsr {
1395 fn default() -> Scsr { 1425 fn default() -> Rtsr {
1396 Scsr(0) 1426 Rtsr(0)
1397 } 1427 }
1398 } 1428 }
1399 #[doc = "SKR"] 1429 #[doc = "Falling Trigger selection register (EXTI_FTSR)"]
1400 #[repr(transparent)] 1430 #[repr(transparent)]
1401 #[derive(Copy, Clone, Eq, PartialEq)] 1431 #[derive(Copy, Clone, Eq, PartialEq)]
1402 pub struct Skr(pub u32); 1432 pub struct Ftsr(pub u32);
1403 impl Skr { 1433 impl Ftsr {
1404 #[doc = "SRAM2 write protection key for software erase"] 1434 #[doc = "Falling trigger event configuration of line 0"]
1405 pub const fn key(&self) -> u8 { 1435 pub fn tr(&self, n: usize) -> super::vals::Tr {
1406 let val = (self.0 >> 0usize) & 0xff; 1436 assert!(n < 23usize);
1407 val as u8 1437 let offs = 0usize + n * 1usize;
1438 let val = (self.0 >> offs) & 0x01;
1439 super::vals::Tr(val as u8)
1408 } 1440 }
1409 #[doc = "SRAM2 write protection key for software erase"] 1441 #[doc = "Falling trigger event configuration of line 0"]
1410 pub fn set_key(&mut self, val: u8) { 1442 pub fn set_tr(&mut self, n: usize, val: super::vals::Tr) {
1411 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 1443 assert!(n < 23usize);
1444 let offs = 0usize + n * 1usize;
1445 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1412 } 1446 }
1413 } 1447 }
1414 impl Default for Skr { 1448 impl Default for Ftsr {
1415 fn default() -> Skr { 1449 fn default() -> Ftsr {
1416 Skr(0) 1450 Ftsr(0)
1417 } 1451 }
1418 } 1452 }
1419 #[doc = "CFGR2"] 1453 #[doc = "Interrupt mask register (EXTI_IMR)"]
1420 #[repr(transparent)] 1454 #[repr(transparent)]
1421 #[derive(Copy, Clone, Eq, PartialEq)] 1455 #[derive(Copy, Clone, Eq, PartialEq)]
1422 pub struct Cfgr2(pub u32); 1456 pub struct Imr(pub u32);
1423 impl Cfgr2 { 1457 impl Imr {
1424 #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] 1458 #[doc = "Interrupt Mask on line 0"]
1425 pub const fn cll(&self) -> bool { 1459 pub fn mr(&self, n: usize) -> super::vals::Mr {
1426 let val = (self.0 >> 0usize) & 0x01; 1460 assert!(n < 23usize);
1427 val != 0 1461 let offs = 0usize + n * 1usize;
1428 } 1462 let val = (self.0 >> offs) & 0x01;
1429 #[doc = "Cortex LOCKUP (Hardfault) output enable bit"] 1463 super::vals::Mr(val as u8)
1430 pub fn set_cll(&mut self, val: bool) {
1431 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
1432 } 1464 }
1433 #[doc = "SRAM2 parity lock bit"] 1465 #[doc = "Interrupt Mask on line 0"]
1434 pub const fn spl(&self) -> bool { 1466 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) {
1435 let val = (self.0 >> 1usize) & 0x01; 1467 assert!(n < 23usize);
1436 val != 0 1468 let offs = 0usize + n * 1usize;
1469 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1437 } 1470 }
1438 #[doc = "SRAM2 parity lock bit"] 1471 }
1439 pub fn set_spl(&mut self, val: bool) { 1472 impl Default for Imr {
1440 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 1473 fn default() -> Imr {
1474 Imr(0)
1441 } 1475 }
1442 #[doc = "PVD lock enable bit"] 1476 }
1443 pub const fn pvdl(&self) -> bool { 1477 #[doc = "Pending register (EXTI_PR)"]
1444 let val = (self.0 >> 2usize) & 0x01; 1478 #[repr(transparent)]
1479 #[derive(Copy, Clone, Eq, PartialEq)]
1480 pub struct Pr(pub u32);
1481 impl Pr {
1482 #[doc = "Pending bit 0"]
1483 pub fn pr(&self, n: usize) -> bool {
1484 assert!(n < 23usize);
1485 let offs = 0usize + n * 1usize;
1486 let val = (self.0 >> offs) & 0x01;
1445 val != 0 1487 val != 0
1446 } 1488 }
1447 #[doc = "PVD lock enable bit"] 1489 #[doc = "Pending bit 0"]
1448 pub fn set_pvdl(&mut self, val: bool) { 1490 pub fn set_pr(&mut self, n: usize, val: bool) {
1449 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 1491 assert!(n < 23usize);
1492 let offs = 0usize + n * 1usize;
1493 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1450 } 1494 }
1451 #[doc = "ECC Lock"] 1495 }
1452 pub const fn eccl(&self) -> bool { 1496 impl Default for Pr {
1453 let val = (self.0 >> 3usize) & 0x01; 1497 fn default() -> Pr {
1498 Pr(0)
1499 }
1500 }
1501 #[doc = "Software interrupt event register (EXTI_SWIER)"]
1502 #[repr(transparent)]
1503 #[derive(Copy, Clone, Eq, PartialEq)]
1504 pub struct Swier(pub u32);
1505 impl Swier {
1506 #[doc = "Software Interrupt on line 0"]
1507 pub fn swier(&self, n: usize) -> bool {
1508 assert!(n < 23usize);
1509 let offs = 0usize + n * 1usize;
1510 let val = (self.0 >> offs) & 0x01;
1454 val != 0 1511 val != 0
1455 } 1512 }
1456 #[doc = "ECC Lock"] 1513 #[doc = "Software Interrupt on line 0"]
1457 pub fn set_eccl(&mut self, val: bool) { 1514 pub fn set_swier(&mut self, n: usize, val: bool) {
1458 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 1515 assert!(n < 23usize);
1516 let offs = 0usize + n * 1usize;
1517 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
1459 } 1518 }
1460 #[doc = "SRAM2 parity error flag"] 1519 }
1461 pub const fn spf(&self) -> bool { 1520 impl Default for Swier {
1462 let val = (self.0 >> 8usize) & 0x01; 1521 fn default() -> Swier {
1463 val != 0 1522 Swier(0)
1464 } 1523 }
1465 #[doc = "SRAM2 parity error flag"] 1524 }
1466 pub fn set_spf(&mut self, val: bool) { 1525 #[doc = "Event mask register (EXTI_EMR)"]
1467 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 1526 #[repr(transparent)]
1527 #[derive(Copy, Clone, Eq, PartialEq)]
1528 pub struct Emr(pub u32);
1529 impl Emr {
1530 #[doc = "Event Mask on line 0"]
1531 pub fn mr(&self, n: usize) -> super::vals::Mr {
1532 assert!(n < 23usize);
1533 let offs = 0usize + n * 1usize;
1534 let val = (self.0 >> offs) & 0x01;
1535 super::vals::Mr(val as u8)
1536 }
1537 #[doc = "Event Mask on line 0"]
1538 pub fn set_mr(&mut self, n: usize, val: super::vals::Mr) {
1539 assert!(n < 23usize);
1540 let offs = 0usize + n * 1usize;
1541 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1468 } 1542 }
1469 } 1543 }
1470 impl Default for Cfgr2 { 1544 impl Default for Emr {
1471 fn default() -> Cfgr2 { 1545 fn default() -> Emr {
1472 Cfgr2(0) 1546 Emr(0)
1473 } 1547 }
1474 } 1548 }
1475 } 1549 }
@@ -1522,52 +1596,52 @@ pub mod gpio_v2 {
1522 } 1596 }
1523 pub mod regs { 1597 pub mod regs {
1524 use crate::generic::*; 1598 use crate::generic::*;
1525 #[doc = "GPIO port output data register"] 1599 #[doc = "GPIO port pull-up/pull-down register"]
1526 #[repr(transparent)] 1600 #[repr(transparent)]
1527 #[derive(Copy, Clone, Eq, PartialEq)] 1601 #[derive(Copy, Clone, Eq, PartialEq)]
1528 pub struct Odr(pub u32); 1602 pub struct Pupdr(pub u32);
1529 impl Odr { 1603 impl Pupdr {
1530 #[doc = "Port output data (y = 0..15)"] 1604 #[doc = "Port x configuration bits (y = 0..15)"]
1531 pub fn odr(&self, n: usize) -> super::vals::Odr { 1605 pub fn pupdr(&self, n: usize) -> super::vals::Pupdr {
1532 assert!(n < 16usize); 1606 assert!(n < 16usize);
1533 let offs = 0usize + n * 1usize; 1607 let offs = 0usize + n * 2usize;
1534 let val = (self.0 >> offs) & 0x01; 1608 let val = (self.0 >> offs) & 0x03;
1535 super::vals::Odr(val as u8) 1609 super::vals::Pupdr(val as u8)
1536 } 1610 }
1537 #[doc = "Port output data (y = 0..15)"] 1611 #[doc = "Port x configuration bits (y = 0..15)"]
1538 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) { 1612 pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) {
1539 assert!(n < 16usize); 1613 assert!(n < 16usize);
1540 let offs = 0usize + n * 1usize; 1614 let offs = 0usize + n * 2usize;
1541 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs); 1615 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
1542 } 1616 }
1543 } 1617 }
1544 impl Default for Odr { 1618 impl Default for Pupdr {
1545 fn default() -> Odr { 1619 fn default() -> Pupdr {
1546 Odr(0) 1620 Pupdr(0)
1547 } 1621 }
1548 } 1622 }
1549 #[doc = "GPIO alternate function register"] 1623 #[doc = "GPIO port input data register"]
1550 #[repr(transparent)] 1624 #[repr(transparent)]
1551 #[derive(Copy, Clone, Eq, PartialEq)] 1625 #[derive(Copy, Clone, Eq, PartialEq)]
1552 pub struct Afr(pub u32); 1626 pub struct Idr(pub u32);
1553 impl Afr { 1627 impl Idr {
1554 #[doc = "Alternate function selection for port x bit y (y = 0..15)"] 1628 #[doc = "Port input data (y = 0..15)"]
1555 pub fn afr(&self, n: usize) -> super::vals::Afr { 1629 pub fn idr(&self, n: usize) -> super::vals::Idr {
1556 assert!(n < 8usize); 1630 assert!(n < 16usize);
1557 let offs = 0usize + n * 4usize; 1631 let offs = 0usize + n * 1usize;
1558 let val = (self.0 >> offs) & 0x0f; 1632 let val = (self.0 >> offs) & 0x01;
1559 super::vals::Afr(val as u8) 1633 super::vals::Idr(val as u8)
1560 } 1634 }
1561 #[doc = "Alternate function selection for port x bit y (y = 0..15)"] 1635 #[doc = "Port input data (y = 0..15)"]
1562 pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) { 1636 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) {
1563 assert!(n < 8usize); 1637 assert!(n < 16usize);
1564 let offs = 0usize + n * 4usize; 1638 let offs = 0usize + n * 1usize;
1565 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs); 1639 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1566 } 1640 }
1567 } 1641 }
1568 impl Default for Afr { 1642 impl Default for Idr {
1569 fn default() -> Afr { 1643 fn default() -> Idr {
1570 Afr(0) 1644 Idr(0)
1571 } 1645 }
1572 } 1646 }
1573 #[doc = "GPIO port bit set/reset register"] 1647 #[doc = "GPIO port bit set/reset register"]
@@ -1607,6 +1681,30 @@ pub mod gpio_v2 {
1607 Bsrr(0) 1681 Bsrr(0)
1608 } 1682 }
1609 } 1683 }
1684 #[doc = "GPIO port output type register"]
1685 #[repr(transparent)]
1686 #[derive(Copy, Clone, Eq, PartialEq)]
1687 pub struct Otyper(pub u32);
1688 impl Otyper {
1689 #[doc = "Port x configuration bits (y = 0..15)"]
1690 pub fn ot(&self, n: usize) -> super::vals::Ot {
1691 assert!(n < 16usize);
1692 let offs = 0usize + n * 1usize;
1693 let val = (self.0 >> offs) & 0x01;
1694 super::vals::Ot(val as u8)
1695 }
1696 #[doc = "Port x configuration bits (y = 0..15)"]
1697 pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) {
1698 assert!(n < 16usize);
1699 let offs = 0usize + n * 1usize;
1700 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1701 }
1702 }
1703 impl Default for Otyper {
1704 fn default() -> Otyper {
1705 Otyper(0)
1706 }
1707 }
1610 #[doc = "GPIO port output speed register"] 1708 #[doc = "GPIO port output speed register"]
1611 #[repr(transparent)] 1709 #[repr(transparent)]
1612 #[derive(Copy, Clone, Eq, PartialEq)] 1710 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -1631,6 +1729,54 @@ pub mod gpio_v2 {
1631 Ospeedr(0) 1729 Ospeedr(0)
1632 } 1730 }
1633 } 1731 }
1732 #[doc = "GPIO port output data register"]
1733 #[repr(transparent)]
1734 #[derive(Copy, Clone, Eq, PartialEq)]
1735 pub struct Odr(pub u32);
1736 impl Odr {
1737 #[doc = "Port output data (y = 0..15)"]
1738 pub fn odr(&self, n: usize) -> super::vals::Odr {
1739 assert!(n < 16usize);
1740 let offs = 0usize + n * 1usize;
1741 let val = (self.0 >> offs) & 0x01;
1742 super::vals::Odr(val as u8)
1743 }
1744 #[doc = "Port output data (y = 0..15)"]
1745 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) {
1746 assert!(n < 16usize);
1747 let offs = 0usize + n * 1usize;
1748 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1749 }
1750 }
1751 impl Default for Odr {
1752 fn default() -> Odr {
1753 Odr(0)
1754 }
1755 }
1756 #[doc = "GPIO alternate function register"]
1757 #[repr(transparent)]
1758 #[derive(Copy, Clone, Eq, PartialEq)]
1759 pub struct Afr(pub u32);
1760 impl Afr {
1761 #[doc = "Alternate function selection for port x bit y (y = 0..15)"]
1762 pub fn afr(&self, n: usize) -> super::vals::Afr {
1763 assert!(n < 8usize);
1764 let offs = 0usize + n * 4usize;
1765 let val = (self.0 >> offs) & 0x0f;
1766 super::vals::Afr(val as u8)
1767 }
1768 #[doc = "Alternate function selection for port x bit y (y = 0..15)"]
1769 pub fn set_afr(&mut self, n: usize, val: super::vals::Afr) {
1770 assert!(n < 8usize);
1771 let offs = 0usize + n * 4usize;
1772 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
1773 }
1774 }
1775 impl Default for Afr {
1776 fn default() -> Afr {
1777 Afr(0)
1778 }
1779 }
1634 #[doc = "GPIO port configuration lock register"] 1780 #[doc = "GPIO port configuration lock register"]
1635 #[repr(transparent)] 1781 #[repr(transparent)]
1636 #[derive(Copy, Clone, Eq, PartialEq)] 1782 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -1664,30 +1810,6 @@ pub mod gpio_v2 {
1664 Lckr(0) 1810 Lckr(0)
1665 } 1811 }
1666 } 1812 }
1667 #[doc = "GPIO port input data register"]
1668 #[repr(transparent)]
1669 #[derive(Copy, Clone, Eq, PartialEq)]
1670 pub struct Idr(pub u32);
1671 impl Idr {
1672 #[doc = "Port input data (y = 0..15)"]
1673 pub fn idr(&self, n: usize) -> super::vals::Idr {
1674 assert!(n < 16usize);
1675 let offs = 0usize + n * 1usize;
1676 let val = (self.0 >> offs) & 0x01;
1677 super::vals::Idr(val as u8)
1678 }
1679 #[doc = "Port input data (y = 0..15)"]
1680 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) {
1681 assert!(n < 16usize);
1682 let offs = 0usize + n * 1usize;
1683 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1684 }
1685 }
1686 impl Default for Idr {
1687 fn default() -> Idr {
1688 Idr(0)
1689 }
1690 }
1691 #[doc = "GPIO port mode register"] 1813 #[doc = "GPIO port mode register"]
1692 #[repr(transparent)] 1814 #[repr(transparent)]
1693 #[derive(Copy, Clone, Eq, PartialEq)] 1815 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -1712,57 +1834,29 @@ pub mod gpio_v2 {
1712 Moder(0) 1834 Moder(0)
1713 } 1835 }
1714 } 1836 }
1715 #[doc = "GPIO port pull-up/pull-down register"] 1837 }
1838 pub mod vals {
1839 use crate::generic::*;
1716 #[repr(transparent)] 1840 #[repr(transparent)]
1717 #[derive(Copy, Clone, Eq, PartialEq)] 1841 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1718 pub struct Pupdr(pub u32); 1842 pub struct Brw(pub u8);
1719 impl Pupdr { 1843 impl Brw {
1720 #[doc = "Port x configuration bits (y = 0..15)"] 1844 #[doc = "Resets the corresponding ODRx bit"]
1721 pub fn pupdr(&self, n: usize) -> super::vals::Pupdr { 1845 pub const RESET: Self = Self(0x01);
1722 assert!(n < 16usize);
1723 let offs = 0usize + n * 2usize;
1724 let val = (self.0 >> offs) & 0x03;
1725 super::vals::Pupdr(val as u8)
1726 }
1727 #[doc = "Port x configuration bits (y = 0..15)"]
1728 pub fn set_pupdr(&mut self, n: usize, val: super::vals::Pupdr) {
1729 assert!(n < 16usize);
1730 let offs = 0usize + n * 2usize;
1731 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
1732 }
1733 }
1734 impl Default for Pupdr {
1735 fn default() -> Pupdr {
1736 Pupdr(0)
1737 }
1738 } 1846 }
1739 #[doc = "GPIO port output type register"]
1740 #[repr(transparent)] 1847 #[repr(transparent)]
1741 #[derive(Copy, Clone, Eq, PartialEq)] 1848 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1742 pub struct Otyper(pub u32); 1849 pub struct Moder(pub u8);
1743 impl Otyper { 1850 impl Moder {
1744 #[doc = "Port x configuration bits (y = 0..15)"] 1851 #[doc = "Input mode (reset state)"]
1745 pub fn ot(&self, n: usize) -> super::vals::Ot { 1852 pub const INPUT: Self = Self(0);
1746 assert!(n < 16usize); 1853 #[doc = "General purpose output mode"]
1747 let offs = 0usize + n * 1usize; 1854 pub const OUTPUT: Self = Self(0x01);
1748 let val = (self.0 >> offs) & 0x01; 1855 #[doc = "Alternate function mode"]
1749 super::vals::Ot(val as u8) 1856 pub const ALTERNATE: Self = Self(0x02);
1750 } 1857 #[doc = "Analog mode"]
1751 #[doc = "Port x configuration bits (y = 0..15)"] 1858 pub const ANALOG: Self = Self(0x03);
1752 pub fn set_ot(&mut self, n: usize, val: super::vals::Ot) {
1753 assert!(n < 16usize);
1754 let offs = 0usize + n * 1usize;
1755 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
1756 }
1757 }
1758 impl Default for Otyper {
1759 fn default() -> Otyper {
1760 Otyper(0)
1761 }
1762 } 1859 }
1763 }
1764 pub mod vals {
1765 use crate::generic::*;
1766 #[repr(transparent)] 1860 #[repr(transparent)]
1767 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1861 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1768 pub struct Pupdr(pub u8); 1862 pub struct Pupdr(pub u8);
@@ -1776,6 +1870,15 @@ pub mod gpio_v2 {
1776 } 1870 }
1777 #[repr(transparent)] 1871 #[repr(transparent)]
1778 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1872 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1873 pub struct Lckk(pub u8);
1874 impl Lckk {
1875 #[doc = "Port configuration lock key not active"]
1876 pub const NOTACTIVE: Self = Self(0);
1877 #[doc = "Port configuration lock key active"]
1878 pub const ACTIVE: Self = Self(0x01);
1879 }
1880 #[repr(transparent)]
1881 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1779 pub struct Ot(pub u8); 1882 pub struct Ot(pub u8);
1780 impl Ot { 1883 impl Ot {
1781 #[doc = "Output push-pull (reset state)"] 1884 #[doc = "Output push-pull (reset state)"]
@@ -1785,6 +1888,19 @@ pub mod gpio_v2 {
1785 } 1888 }
1786 #[repr(transparent)] 1889 #[repr(transparent)]
1787 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1890 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1891 pub struct Ospeedr(pub u8);
1892 impl Ospeedr {
1893 #[doc = "Low speed"]
1894 pub const LOWSPEED: Self = Self(0);
1895 #[doc = "Medium speed"]
1896 pub const MEDIUMSPEED: Self = Self(0x01);
1897 #[doc = "High speed"]
1898 pub const HIGHSPEED: Self = Self(0x02);
1899 #[doc = "Very high speed"]
1900 pub const VERYHIGHSPEED: Self = Self(0x03);
1901 }
1902 #[repr(transparent)]
1903 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1788 pub struct Afr(pub u8); 1904 pub struct Afr(pub u8);
1789 impl Afr { 1905 impl Afr {
1790 #[doc = "AF0"] 1906 #[doc = "AF0"]
@@ -1822,10 +1938,12 @@ pub mod gpio_v2 {
1822 } 1938 }
1823 #[repr(transparent)] 1939 #[repr(transparent)]
1824 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1940 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1825 pub struct Brw(pub u8); 1941 pub struct Idr(pub u8);
1826 impl Brw { 1942 impl Idr {
1827 #[doc = "Resets the corresponding ODRx bit"] 1943 #[doc = "Input is logic low"]
1828 pub const RESET: Self = Self(0x01); 1944 pub const LOW: Self = Self(0);
1945 #[doc = "Input is logic high"]
1946 pub const HIGH: Self = Self(0x01);
1829 } 1947 }
1830 #[repr(transparent)] 1948 #[repr(transparent)]
1831 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1949 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
@@ -1838,48 +1956,708 @@ pub mod gpio_v2 {
1838 } 1956 }
1839 #[repr(transparent)] 1957 #[repr(transparent)]
1840 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1958 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1841 pub struct Moder(pub u8); 1959 pub struct Odr(pub u8);
1842 impl Moder { 1960 impl Odr {
1843 #[doc = "Input mode (reset state)"] 1961 #[doc = "Set output to logic low"]
1844 pub const INPUT: Self = Self(0); 1962 pub const LOW: Self = Self(0);
1845 #[doc = "General purpose output mode"] 1963 #[doc = "Set output to logic high"]
1846 pub const OUTPUT: Self = Self(0x01); 1964 pub const HIGH: Self = Self(0x01);
1847 #[doc = "Alternate function mode"]
1848 pub const ALTERNATE: Self = Self(0x02);
1849 #[doc = "Analog mode"]
1850 pub const ANALOG: Self = Self(0x03);
1851 } 1965 }
1852 #[repr(transparent)] 1966 #[repr(transparent)]
1853 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 1967 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1854 pub struct Idr(pub u8); 1968 pub struct Bsw(pub u8);
1855 impl Idr { 1969 impl Bsw {
1856 #[doc = "Input is logic low"] 1970 #[doc = "Sets the corresponding ODRx bit"]
1971 pub const SET: Self = Self(0x01);
1972 }
1973 }
1974}
1975pub mod dma_v2 {
1976 use crate::generic::*;
1977 #[doc = "DMA controller"]
1978 #[derive(Copy, Clone)]
1979 pub struct Dma(pub *mut u8);
1980 unsafe impl Send for Dma {}
1981 unsafe impl Sync for Dma {}
1982 impl Dma {
1983 #[doc = "low interrupt status register"]
1984 pub fn isr(self, n: usize) -> Reg<regs::Isr, R> {
1985 assert!(n < 2usize);
1986 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
1987 }
1988 #[doc = "low interrupt flag clear register"]
1989 pub fn ifcr(self, n: usize) -> Reg<regs::Ifcr, W> {
1990 assert!(n < 2usize);
1991 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
1992 }
1993 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"]
1994 pub fn st(self, n: usize) -> St {
1995 assert!(n < 8usize);
1996 unsafe { St(self.0.add(16usize + n * 24usize)) }
1997 }
1998 }
1999 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"]
2000 #[derive(Copy, Clone)]
2001 pub struct St(pub *mut u8);
2002 unsafe impl Send for St {}
2003 unsafe impl Sync for St {}
2004 impl St {
2005 #[doc = "stream x configuration register"]
2006 pub fn cr(self) -> Reg<regs::Cr, RW> {
2007 unsafe { Reg::from_ptr(self.0.add(0usize)) }
2008 }
2009 #[doc = "stream x number of data register"]
2010 pub fn ndtr(self) -> Reg<regs::Ndtr, RW> {
2011 unsafe { Reg::from_ptr(self.0.add(4usize)) }
2012 }
2013 #[doc = "stream x peripheral address register"]
2014 pub fn par(self) -> Reg<u32, RW> {
2015 unsafe { Reg::from_ptr(self.0.add(8usize)) }
2016 }
2017 #[doc = "stream x memory 0 address register"]
2018 pub fn m0ar(self) -> Reg<u32, RW> {
2019 unsafe { Reg::from_ptr(self.0.add(12usize)) }
2020 }
2021 #[doc = "stream x memory 1 address register"]
2022 pub fn m1ar(self) -> Reg<u32, RW> {
2023 unsafe { Reg::from_ptr(self.0.add(16usize)) }
2024 }
2025 #[doc = "stream x FIFO control register"]
2026 pub fn fcr(self) -> Reg<regs::Fcr, RW> {
2027 unsafe { Reg::from_ptr(self.0.add(20usize)) }
2028 }
2029 }
2030 pub mod vals {
2031 use crate::generic::*;
2032 #[repr(transparent)]
2033 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2034 pub struct Fth(pub u8);
2035 impl Fth {
2036 #[doc = "1/4 full FIFO"]
2037 pub const QUARTER: Self = Self(0);
2038 #[doc = "1/2 full FIFO"]
2039 pub const HALF: Self = Self(0x01);
2040 #[doc = "3/4 full FIFO"]
2041 pub const THREEQUARTERS: Self = Self(0x02);
2042 #[doc = "Full FIFO"]
2043 pub const FULL: Self = Self(0x03);
2044 }
2045 #[repr(transparent)]
2046 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2047 pub struct Pincos(pub u8);
2048 impl Pincos {
2049 #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"]
2050 pub const PSIZE: Self = Self(0);
2051 #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"]
2052 pub const FIXED4: Self = Self(0x01);
2053 }
2054 #[repr(transparent)]
2055 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2056 pub struct Size(pub u8);
2057 impl Size {
2058 #[doc = "Byte (8-bit)"]
2059 pub const BITS8: Self = Self(0);
2060 #[doc = "Half-word (16-bit)"]
2061 pub const BITS16: Self = Self(0x01);
2062 #[doc = "Word (32-bit)"]
2063 pub const BITS32: Self = Self(0x02);
2064 }
2065 #[repr(transparent)]
2066 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2067 pub struct Dbm(pub u8);
2068 impl Dbm {
2069 #[doc = "No buffer switching at the end of transfer"]
2070 pub const DISABLED: Self = Self(0);
2071 #[doc = "Memory target switched at the end of the DMA transfer"]
2072 pub const ENABLED: Self = Self(0x01);
2073 }
2074 #[repr(transparent)]
2075 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2076 pub struct Pl(pub u8);
2077 impl Pl {
2078 #[doc = "Low"]
1857 pub const LOW: Self = Self(0); 2079 pub const LOW: Self = Self(0);
1858 #[doc = "Input is logic high"] 2080 #[doc = "Medium"]
1859 pub const HIGH: Self = Self(0x01); 2081 pub const MEDIUM: Self = Self(0x01);
2082 #[doc = "High"]
2083 pub const HIGH: Self = Self(0x02);
2084 #[doc = "Very high"]
2085 pub const VERYHIGH: Self = Self(0x03);
1860 } 2086 }
1861 #[repr(transparent)] 2087 #[repr(transparent)]
1862 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2088 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1863 pub struct Ospeedr(pub u8); 2089 pub struct Dmdis(pub u8);
1864 impl Ospeedr { 2090 impl Dmdis {
1865 #[doc = "Low speed"] 2091 #[doc = "Direct mode is enabled"]
1866 pub const LOWSPEED: Self = Self(0); 2092 pub const ENABLED: Self = Self(0);
1867 #[doc = "Medium speed"] 2093 #[doc = "Direct mode is disabled"]
1868 pub const MEDIUMSPEED: Self = Self(0x01); 2094 pub const DISABLED: Self = Self(0x01);
1869 #[doc = "High speed"] 2095 }
1870 pub const HIGHSPEED: Self = Self(0x02); 2096 #[repr(transparent)]
1871 #[doc = "Very high speed"] 2097 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1872 pub const VERYHIGHSPEED: Self = Self(0x03); 2098 pub struct Burst(pub u8);
2099 impl Burst {
2100 #[doc = "Single transfer"]
2101 pub const SINGLE: Self = Self(0);
2102 #[doc = "Incremental burst of 4 beats"]
2103 pub const INCR4: Self = Self(0x01);
2104 #[doc = "Incremental burst of 8 beats"]
2105 pub const INCR8: Self = Self(0x02);
2106 #[doc = "Incremental burst of 16 beats"]
2107 pub const INCR16: Self = Self(0x03);
2108 }
2109 #[repr(transparent)]
2110 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2111 pub struct Dir(pub u8);
2112 impl Dir {
2113 #[doc = "Peripheral-to-memory"]
2114 pub const PERIPHERALTOMEMORY: Self = Self(0);
2115 #[doc = "Memory-to-peripheral"]
2116 pub const MEMORYTOPERIPHERAL: Self = Self(0x01);
2117 #[doc = "Memory-to-memory"]
2118 pub const MEMORYTOMEMORY: Self = Self(0x02);
2119 }
2120 #[repr(transparent)]
2121 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2122 pub struct Circ(pub u8);
2123 impl Circ {
2124 #[doc = "Circular mode disabled"]
2125 pub const DISABLED: Self = Self(0);
2126 #[doc = "Circular mode enabled"]
2127 pub const ENABLED: Self = Self(0x01);
2128 }
2129 #[repr(transparent)]
2130 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2131 pub struct Ct(pub u8);
2132 impl Ct {
2133 #[doc = "The current target memory is Memory 0"]
2134 pub const MEMORY0: Self = Self(0);
2135 #[doc = "The current target memory is Memory 1"]
2136 pub const MEMORY1: Self = Self(0x01);
2137 }
2138 #[repr(transparent)]
2139 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2140 pub struct Inc(pub u8);
2141 impl Inc {
2142 #[doc = "Address pointer is fixed"]
2143 pub const FIXED: Self = Self(0);
2144 #[doc = "Address pointer is incremented after each data transfer"]
2145 pub const INCREMENTED: Self = Self(0x01);
2146 }
2147 #[repr(transparent)]
2148 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2149 pub struct Fs(pub u8);
2150 impl Fs {
2151 #[doc = "0 < fifo_level < 1/4"]
2152 pub const QUARTER1: Self = Self(0);
2153 #[doc = "1/4 <= fifo_level < 1/2"]
2154 pub const QUARTER2: Self = Self(0x01);
2155 #[doc = "1/2 <= fifo_level < 3/4"]
2156 pub const QUARTER3: Self = Self(0x02);
2157 #[doc = "3/4 <= fifo_level < full"]
2158 pub const QUARTER4: Self = Self(0x03);
2159 #[doc = "FIFO is empty"]
2160 pub const EMPTY: Self = Self(0x04);
2161 #[doc = "FIFO is full"]
2162 pub const FULL: Self = Self(0x05);
2163 }
2164 #[repr(transparent)]
2165 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2166 pub struct Pfctrl(pub u8);
2167 impl Pfctrl {
2168 #[doc = "The DMA is the flow controller"]
2169 pub const DMA: Self = Self(0);
2170 #[doc = "The peripheral is the flow controller"]
2171 pub const PERIPHERAL: Self = Self(0x01);
2172 }
2173 }
2174 pub mod regs {
2175 use crate::generic::*;
2176 #[doc = "stream x number of data register"]
2177 #[repr(transparent)]
2178 #[derive(Copy, Clone, Eq, PartialEq)]
2179 pub struct Ndtr(pub u32);
2180 impl Ndtr {
2181 #[doc = "Number of data items to transfer"]
2182 pub const fn ndt(&self) -> u16 {
2183 let val = (self.0 >> 0usize) & 0xffff;
2184 val as u16
2185 }
2186 #[doc = "Number of data items to transfer"]
2187 pub fn set_ndt(&mut self, val: u16) {
2188 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
2189 }
2190 }
2191 impl Default for Ndtr {
2192 fn default() -> Ndtr {
2193 Ndtr(0)
2194 }
2195 }
2196 #[doc = "low interrupt flag clear register"]
2197 #[repr(transparent)]
2198 #[derive(Copy, Clone, Eq, PartialEq)]
2199 pub struct Ifcr(pub u32);
2200 impl Ifcr {
2201 #[doc = "Stream x clear FIFO error interrupt flag (x = 3..0)"]
2202 pub fn cfeif(&self, n: usize) -> bool {
2203 assert!(n < 4usize);
2204 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2205 let val = (self.0 >> offs) & 0x01;
2206 val != 0
2207 }
2208 #[doc = "Stream x clear FIFO error interrupt flag (x = 3..0)"]
2209 pub fn set_cfeif(&mut self, n: usize, val: bool) {
2210 assert!(n < 4usize);
2211 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2212 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2213 }
2214 #[doc = "Stream x clear direct mode error interrupt flag (x = 3..0)"]
2215 pub fn cdmeif(&self, n: usize) -> bool {
2216 assert!(n < 4usize);
2217 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2218 let val = (self.0 >> offs) & 0x01;
2219 val != 0
2220 }
2221 #[doc = "Stream x clear direct mode error interrupt flag (x = 3..0)"]
2222 pub fn set_cdmeif(&mut self, n: usize, val: bool) {
2223 assert!(n < 4usize);
2224 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2225 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2226 }
2227 #[doc = "Stream x clear transfer error interrupt flag (x = 3..0)"]
2228 pub fn cteif(&self, n: usize) -> bool {
2229 assert!(n < 4usize);
2230 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2231 let val = (self.0 >> offs) & 0x01;
2232 val != 0
2233 }
2234 #[doc = "Stream x clear transfer error interrupt flag (x = 3..0)"]
2235 pub fn set_cteif(&mut self, n: usize, val: bool) {
2236 assert!(n < 4usize);
2237 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2238 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2239 }
2240 #[doc = "Stream x clear half transfer interrupt flag (x = 3..0)"]
2241 pub fn chtif(&self, n: usize) -> bool {
2242 assert!(n < 4usize);
2243 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2244 let val = (self.0 >> offs) & 0x01;
2245 val != 0
2246 }
2247 #[doc = "Stream x clear half transfer interrupt flag (x = 3..0)"]
2248 pub fn set_chtif(&mut self, n: usize, val: bool) {
2249 assert!(n < 4usize);
2250 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2251 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2252 }
2253 #[doc = "Stream x clear transfer complete interrupt flag (x = 3..0)"]
2254 pub fn ctcif(&self, n: usize) -> bool {
2255 assert!(n < 4usize);
2256 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2257 let val = (self.0 >> offs) & 0x01;
2258 val != 0
2259 }
2260 #[doc = "Stream x clear transfer complete interrupt flag (x = 3..0)"]
2261 pub fn set_ctcif(&mut self, n: usize, val: bool) {
2262 assert!(n < 4usize);
2263 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2264 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2265 }
2266 }
2267 impl Default for Ifcr {
2268 fn default() -> Ifcr {
2269 Ifcr(0)
2270 }
2271 }
2272 #[doc = "stream x FIFO control register"]
2273 #[repr(transparent)]
2274 #[derive(Copy, Clone, Eq, PartialEq)]
2275 pub struct Fcr(pub u32);
2276 impl Fcr {
2277 #[doc = "FIFO threshold selection"]
2278 pub const fn fth(&self) -> super::vals::Fth {
2279 let val = (self.0 >> 0usize) & 0x03;
2280 super::vals::Fth(val as u8)
2281 }
2282 #[doc = "FIFO threshold selection"]
2283 pub fn set_fth(&mut self, val: super::vals::Fth) {
2284 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
2285 }
2286 #[doc = "Direct mode disable"]
2287 pub const fn dmdis(&self) -> super::vals::Dmdis {
2288 let val = (self.0 >> 2usize) & 0x01;
2289 super::vals::Dmdis(val as u8)
2290 }
2291 #[doc = "Direct mode disable"]
2292 pub fn set_dmdis(&mut self, val: super::vals::Dmdis) {
2293 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
2294 }
2295 #[doc = "FIFO status"]
2296 pub const fn fs(&self) -> super::vals::Fs {
2297 let val = (self.0 >> 3usize) & 0x07;
2298 super::vals::Fs(val as u8)
2299 }
2300 #[doc = "FIFO status"]
2301 pub fn set_fs(&mut self, val: super::vals::Fs) {
2302 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
2303 }
2304 #[doc = "FIFO error interrupt enable"]
2305 pub const fn feie(&self) -> bool {
2306 let val = (self.0 >> 7usize) & 0x01;
2307 val != 0
2308 }
2309 #[doc = "FIFO error interrupt enable"]
2310 pub fn set_feie(&mut self, val: bool) {
2311 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
2312 }
2313 }
2314 impl Default for Fcr {
2315 fn default() -> Fcr {
2316 Fcr(0)
2317 }
2318 }
2319 #[doc = "low interrupt status register"]
2320 #[repr(transparent)]
2321 #[derive(Copy, Clone, Eq, PartialEq)]
2322 pub struct Isr(pub u32);
2323 impl Isr {
2324 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"]
2325 pub fn feif(&self, n: usize) -> bool {
2326 assert!(n < 4usize);
2327 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2328 let val = (self.0 >> offs) & 0x01;
2329 val != 0
2330 }
2331 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"]
2332 pub fn set_feif(&mut self, n: usize, val: bool) {
2333 assert!(n < 4usize);
2334 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2335 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2336 }
2337 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"]
2338 pub fn dmeif(&self, n: usize) -> bool {
2339 assert!(n < 4usize);
2340 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2341 let val = (self.0 >> offs) & 0x01;
2342 val != 0
2343 }
2344 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"]
2345 pub fn set_dmeif(&mut self, n: usize, val: bool) {
2346 assert!(n < 4usize);
2347 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2348 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2349 }
2350 #[doc = "Stream x transfer error interrupt flag (x=3..0)"]
2351 pub fn teif(&self, n: usize) -> bool {
2352 assert!(n < 4usize);
2353 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2354 let val = (self.0 >> offs) & 0x01;
2355 val != 0
2356 }
2357 #[doc = "Stream x transfer error interrupt flag (x=3..0)"]
2358 pub fn set_teif(&mut self, n: usize, val: bool) {
2359 assert!(n < 4usize);
2360 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2361 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2362 }
2363 #[doc = "Stream x half transfer interrupt flag (x=3..0)"]
2364 pub fn htif(&self, n: usize) -> bool {
2365 assert!(n < 4usize);
2366 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2367 let val = (self.0 >> offs) & 0x01;
2368 val != 0
2369 }
2370 #[doc = "Stream x half transfer interrupt flag (x=3..0)"]
2371 pub fn set_htif(&mut self, n: usize, val: bool) {
2372 assert!(n < 4usize);
2373 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2374 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2375 }
2376 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"]
2377 pub fn tcif(&self, n: usize) -> bool {
2378 assert!(n < 4usize);
2379 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2380 let val = (self.0 >> offs) & 0x01;
2381 val != 0
2382 }
2383 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"]
2384 pub fn set_tcif(&mut self, n: usize, val: bool) {
2385 assert!(n < 4usize);
2386 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
2387 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2388 }
2389 }
2390 impl Default for Isr {
2391 fn default() -> Isr {
2392 Isr(0)
2393 }
2394 }
2395 #[doc = "stream x configuration register"]
2396 #[repr(transparent)]
2397 #[derive(Copy, Clone, Eq, PartialEq)]
2398 pub struct Cr(pub u32);
2399 impl Cr {
2400 #[doc = "Stream enable / flag stream ready when read low"]
2401 pub const fn en(&self) -> bool {
2402 let val = (self.0 >> 0usize) & 0x01;
2403 val != 0
2404 }
2405 #[doc = "Stream enable / flag stream ready when read low"]
2406 pub fn set_en(&mut self, val: bool) {
2407 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2408 }
2409 #[doc = "Direct mode error interrupt enable"]
2410 pub const fn dmeie(&self) -> bool {
2411 let val = (self.0 >> 1usize) & 0x01;
2412 val != 0
2413 }
2414 #[doc = "Direct mode error interrupt enable"]
2415 pub fn set_dmeie(&mut self, val: bool) {
2416 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
2417 }
2418 #[doc = "Transfer error interrupt enable"]
2419 pub const fn teie(&self) -> bool {
2420 let val = (self.0 >> 2usize) & 0x01;
2421 val != 0
2422 }
2423 #[doc = "Transfer error interrupt enable"]
2424 pub fn set_teie(&mut self, val: bool) {
2425 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
2426 }
2427 #[doc = "Half transfer interrupt enable"]
2428 pub const fn htie(&self) -> bool {
2429 let val = (self.0 >> 3usize) & 0x01;
2430 val != 0
2431 }
2432 #[doc = "Half transfer interrupt enable"]
2433 pub fn set_htie(&mut self, val: bool) {
2434 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
2435 }
2436 #[doc = "Transfer complete interrupt enable"]
2437 pub const fn tcie(&self) -> bool {
2438 let val = (self.0 >> 4usize) & 0x01;
2439 val != 0
2440 }
2441 #[doc = "Transfer complete interrupt enable"]
2442 pub fn set_tcie(&mut self, val: bool) {
2443 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
2444 }
2445 #[doc = "Peripheral flow controller"]
2446 pub const fn pfctrl(&self) -> super::vals::Pfctrl {
2447 let val = (self.0 >> 5usize) & 0x01;
2448 super::vals::Pfctrl(val as u8)
2449 }
2450 #[doc = "Peripheral flow controller"]
2451 pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) {
2452 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
2453 }
2454 #[doc = "Data transfer direction"]
2455 pub const fn dir(&self) -> super::vals::Dir {
2456 let val = (self.0 >> 6usize) & 0x03;
2457 super::vals::Dir(val as u8)
2458 }
2459 #[doc = "Data transfer direction"]
2460 pub fn set_dir(&mut self, val: super::vals::Dir) {
2461 self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize);
2462 }
2463 #[doc = "Circular mode"]
2464 pub const fn circ(&self) -> super::vals::Circ {
2465 let val = (self.0 >> 8usize) & 0x01;
2466 super::vals::Circ(val as u8)
2467 }
2468 #[doc = "Circular mode"]
2469 pub fn set_circ(&mut self, val: super::vals::Circ) {
2470 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
2471 }
2472 #[doc = "Peripheral increment mode"]
2473 pub const fn pinc(&self) -> super::vals::Inc {
2474 let val = (self.0 >> 9usize) & 0x01;
2475 super::vals::Inc(val as u8)
2476 }
2477 #[doc = "Peripheral increment mode"]
2478 pub fn set_pinc(&mut self, val: super::vals::Inc) {
2479 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
2480 }
2481 #[doc = "Memory increment mode"]
2482 pub const fn minc(&self) -> super::vals::Inc {
2483 let val = (self.0 >> 10usize) & 0x01;
2484 super::vals::Inc(val as u8)
2485 }
2486 #[doc = "Memory increment mode"]
2487 pub fn set_minc(&mut self, val: super::vals::Inc) {
2488 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
2489 }
2490 #[doc = "Peripheral data size"]
2491 pub const fn psize(&self) -> super::vals::Size {
2492 let val = (self.0 >> 11usize) & 0x03;
2493 super::vals::Size(val as u8)
2494 }
2495 #[doc = "Peripheral data size"]
2496 pub fn set_psize(&mut self, val: super::vals::Size) {
2497 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize);
2498 }
2499 #[doc = "Memory data size"]
2500 pub const fn msize(&self) -> super::vals::Size {
2501 let val = (self.0 >> 13usize) & 0x03;
2502 super::vals::Size(val as u8)
2503 }
2504 #[doc = "Memory data size"]
2505 pub fn set_msize(&mut self, val: super::vals::Size) {
2506 self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize);
2507 }
2508 #[doc = "Peripheral increment offset size"]
2509 pub const fn pincos(&self) -> super::vals::Pincos {
2510 let val = (self.0 >> 15usize) & 0x01;
2511 super::vals::Pincos(val as u8)
2512 }
2513 #[doc = "Peripheral increment offset size"]
2514 pub fn set_pincos(&mut self, val: super::vals::Pincos) {
2515 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
2516 }
2517 #[doc = "Priority level"]
2518 pub const fn pl(&self) -> super::vals::Pl {
2519 let val = (self.0 >> 16usize) & 0x03;
2520 super::vals::Pl(val as u8)
2521 }
2522 #[doc = "Priority level"]
2523 pub fn set_pl(&mut self, val: super::vals::Pl) {
2524 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
2525 }
2526 #[doc = "Double buffer mode"]
2527 pub const fn dbm(&self) -> super::vals::Dbm {
2528 let val = (self.0 >> 18usize) & 0x01;
2529 super::vals::Dbm(val as u8)
2530 }
2531 #[doc = "Double buffer mode"]
2532 pub fn set_dbm(&mut self, val: super::vals::Dbm) {
2533 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
2534 }
2535 #[doc = "Current target (only in double buffer mode)"]
2536 pub const fn ct(&self) -> super::vals::Ct {
2537 let val = (self.0 >> 19usize) & 0x01;
2538 super::vals::Ct(val as u8)
2539 }
2540 #[doc = "Current target (only in double buffer mode)"]
2541 pub fn set_ct(&mut self, val: super::vals::Ct) {
2542 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
2543 }
2544 #[doc = "Peripheral burst transfer configuration"]
2545 pub const fn pburst(&self) -> super::vals::Burst {
2546 let val = (self.0 >> 21usize) & 0x03;
2547 super::vals::Burst(val as u8)
2548 }
2549 #[doc = "Peripheral burst transfer configuration"]
2550 pub fn set_pburst(&mut self, val: super::vals::Burst) {
2551 self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize);
2552 }
2553 #[doc = "Memory burst transfer configuration"]
2554 pub const fn mburst(&self) -> super::vals::Burst {
2555 let val = (self.0 >> 23usize) & 0x03;
2556 super::vals::Burst(val as u8)
2557 }
2558 #[doc = "Memory burst transfer configuration"]
2559 pub fn set_mburst(&mut self, val: super::vals::Burst) {
2560 self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize);
2561 }
2562 #[doc = "Channel selection"]
2563 pub const fn chsel(&self) -> u8 {
2564 let val = (self.0 >> 25usize) & 0x0f;
2565 val as u8
2566 }
2567 #[doc = "Channel selection"]
2568 pub fn set_chsel(&mut self, val: u8) {
2569 self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize);
2570 }
2571 }
2572 impl Default for Cr {
2573 fn default() -> Cr {
2574 Cr(0)
2575 }
2576 }
2577 }
2578}
2579pub mod gpio_v1 {
2580 use crate::generic::*;
2581 #[doc = "General purpose I/O"]
2582 #[derive(Copy, Clone)]
2583 pub struct Gpio(pub *mut u8);
2584 unsafe impl Send for Gpio {}
2585 unsafe impl Sync for Gpio {}
2586 impl Gpio {
2587 #[doc = "Port configuration register low (GPIOn_CRL)"]
2588 pub fn cr(self, n: usize) -> Reg<regs::Cr, RW> {
2589 assert!(n < 2usize);
2590 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
2591 }
2592 #[doc = "Port input data register (GPIOn_IDR)"]
2593 pub fn idr(self) -> Reg<regs::Idr, R> {
2594 unsafe { Reg::from_ptr(self.0.add(8usize)) }
2595 }
2596 #[doc = "Port output data register (GPIOn_ODR)"]
2597 pub fn odr(self) -> Reg<regs::Odr, RW> {
2598 unsafe { Reg::from_ptr(self.0.add(12usize)) }
2599 }
2600 #[doc = "Port bit set/reset register (GPIOn_BSRR)"]
2601 pub fn bsrr(self) -> Reg<regs::Bsrr, W> {
2602 unsafe { Reg::from_ptr(self.0.add(16usize)) }
2603 }
2604 #[doc = "Port bit reset register (GPIOn_BRR)"]
2605 pub fn brr(self) -> Reg<regs::Brr, W> {
2606 unsafe { Reg::from_ptr(self.0.add(20usize)) }
2607 }
2608 #[doc = "Port configuration lock register"]
2609 pub fn lckr(self) -> Reg<regs::Lckr, RW> {
2610 unsafe { Reg::from_ptr(self.0.add(24usize)) }
2611 }
2612 }
2613 pub mod vals {
2614 use crate::generic::*;
2615 #[repr(transparent)]
2616 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2617 pub struct Brw(pub u8);
2618 impl Brw {
2619 #[doc = "No action on the corresponding ODx bit"]
2620 pub const NOACTION: Self = Self(0);
2621 #[doc = "Reset the ODx bit"]
2622 pub const RESET: Self = Self(0x01);
1873 } 2623 }
1874 #[repr(transparent)] 2624 #[repr(transparent)]
1875 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2625 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1876 pub struct Bsw(pub u8); 2626 pub struct Bsw(pub u8);
1877 impl Bsw { 2627 impl Bsw {
2628 #[doc = "No action on the corresponding ODx bit"]
2629 pub const NOACTION: Self = Self(0);
1878 #[doc = "Sets the corresponding ODRx bit"] 2630 #[doc = "Sets the corresponding ODRx bit"]
1879 pub const SET: Self = Self(0x01); 2631 pub const SET: Self = Self(0x01);
1880 } 2632 }
1881 #[repr(transparent)] 2633 #[repr(transparent)]
1882 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 2634 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2635 pub struct Mode(pub u8);
2636 impl Mode {
2637 #[doc = "Input mode (reset state)"]
2638 pub const INPUT: Self = Self(0);
2639 #[doc = "Output mode 10 MHz"]
2640 pub const OUTPUT: Self = Self(0x01);
2641 #[doc = "Output mode 2 MHz"]
2642 pub const OUTPUT2: Self = Self(0x02);
2643 #[doc = "Output mode 50 MHz"]
2644 pub const OUTPUT50: Self = Self(0x03);
2645 }
2646 #[repr(transparent)]
2647 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2648 pub struct Cnf(pub u8);
2649 impl Cnf {
2650 #[doc = "Analog mode / Push-Pull mode"]
2651 pub const PUSHPULL: Self = Self(0);
2652 #[doc = "Floating input (reset state) / Open Drain-Mode"]
2653 pub const OPENDRAIN: Self = Self(0x01);
2654 #[doc = "Input with pull-up/pull-down / Alternate Function Push-Pull Mode"]
2655 pub const ALTPUSHPULL: Self = Self(0x02);
2656 #[doc = "Alternate Function Open-Drain Mode"]
2657 pub const ALTOPENDRAIN: Self = Self(0x03);
2658 }
2659 #[repr(transparent)]
2660 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1883 pub struct Lckk(pub u8); 2661 pub struct Lckk(pub u8);
1884 impl Lckk { 2662 impl Lckk {
1885 #[doc = "Port configuration lock key not active"] 2663 #[doc = "Port configuration lock key not active"]
@@ -1896,546 +2674,2198 @@ pub mod gpio_v2 {
1896 #[doc = "Set output to logic high"] 2674 #[doc = "Set output to logic high"]
1897 pub const HIGH: Self = Self(0x01); 2675 pub const HIGH: Self = Self(0x01);
1898 } 2676 }
2677 #[repr(transparent)]
2678 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2679 pub struct Idr(pub u8);
2680 impl Idr {
2681 #[doc = "Input is logic low"]
2682 pub const LOW: Self = Self(0);
2683 #[doc = "Input is logic high"]
2684 pub const HIGH: Self = Self(0x01);
2685 }
2686 #[repr(transparent)]
2687 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2688 pub struct Lck(pub u8);
2689 impl Lck {
2690 #[doc = "Port configuration not locked"]
2691 pub const UNLOCKED: Self = Self(0);
2692 #[doc = "Port configuration locked"]
2693 pub const LOCKED: Self = Self(0x01);
2694 }
2695 }
2696 pub mod regs {
2697 use crate::generic::*;
2698 #[doc = "Port input data register (GPIOn_IDR)"]
2699 #[repr(transparent)]
2700 #[derive(Copy, Clone, Eq, PartialEq)]
2701 pub struct Idr(pub u32);
2702 impl Idr {
2703 #[doc = "Port input data"]
2704 pub fn idr(&self, n: usize) -> super::vals::Idr {
2705 assert!(n < 16usize);
2706 let offs = 0usize + n * 1usize;
2707 let val = (self.0 >> offs) & 0x01;
2708 super::vals::Idr(val as u8)
2709 }
2710 #[doc = "Port input data"]
2711 pub fn set_idr(&mut self, n: usize, val: super::vals::Idr) {
2712 assert!(n < 16usize);
2713 let offs = 0usize + n * 1usize;
2714 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
2715 }
2716 }
2717 impl Default for Idr {
2718 fn default() -> Idr {
2719 Idr(0)
2720 }
2721 }
2722 #[doc = "Port bit reset register (GPIOn_BRR)"]
2723 #[repr(transparent)]
2724 #[derive(Copy, Clone, Eq, PartialEq)]
2725 pub struct Brr(pub u32);
2726 impl Brr {
2727 #[doc = "Reset bit"]
2728 pub fn br(&self, n: usize) -> bool {
2729 assert!(n < 16usize);
2730 let offs = 0usize + n * 1usize;
2731 let val = (self.0 >> offs) & 0x01;
2732 val != 0
2733 }
2734 #[doc = "Reset bit"]
2735 pub fn set_br(&mut self, n: usize, val: bool) {
2736 assert!(n < 16usize);
2737 let offs = 0usize + n * 1usize;
2738 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2739 }
2740 }
2741 impl Default for Brr {
2742 fn default() -> Brr {
2743 Brr(0)
2744 }
2745 }
2746 #[doc = "Port bit set/reset register (GPIOn_BSRR)"]
2747 #[repr(transparent)]
2748 #[derive(Copy, Clone, Eq, PartialEq)]
2749 pub struct Bsrr(pub u32);
2750 impl Bsrr {
2751 #[doc = "Set bit"]
2752 pub fn bs(&self, n: usize) -> bool {
2753 assert!(n < 16usize);
2754 let offs = 0usize + n * 1usize;
2755 let val = (self.0 >> offs) & 0x01;
2756 val != 0
2757 }
2758 #[doc = "Set bit"]
2759 pub fn set_bs(&mut self, n: usize, val: bool) {
2760 assert!(n < 16usize);
2761 let offs = 0usize + n * 1usize;
2762 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2763 }
2764 #[doc = "Reset bit"]
2765 pub fn br(&self, n: usize) -> bool {
2766 assert!(n < 16usize);
2767 let offs = 16usize + n * 1usize;
2768 let val = (self.0 >> offs) & 0x01;
2769 val != 0
2770 }
2771 #[doc = "Reset bit"]
2772 pub fn set_br(&mut self, n: usize, val: bool) {
2773 assert!(n < 16usize);
2774 let offs = 16usize + n * 1usize;
2775 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2776 }
2777 }
2778 impl Default for Bsrr {
2779 fn default() -> Bsrr {
2780 Bsrr(0)
2781 }
2782 }
2783 #[doc = "Port configuration register (GPIOn_CRx)"]
2784 #[repr(transparent)]
2785 #[derive(Copy, Clone, Eq, PartialEq)]
2786 pub struct Cr(pub u32);
2787 impl Cr {
2788 #[doc = "Port n mode bits"]
2789 pub fn mode(&self, n: usize) -> super::vals::Mode {
2790 assert!(n < 8usize);
2791 let offs = 0usize + n * 4usize;
2792 let val = (self.0 >> offs) & 0x03;
2793 super::vals::Mode(val as u8)
2794 }
2795 #[doc = "Port n mode bits"]
2796 pub fn set_mode(&mut self, n: usize, val: super::vals::Mode) {
2797 assert!(n < 8usize);
2798 let offs = 0usize + n * 4usize;
2799 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
2800 }
2801 #[doc = "Port n configuration bits"]
2802 pub fn cnf(&self, n: usize) -> super::vals::Cnf {
2803 assert!(n < 8usize);
2804 let offs = 2usize + n * 4usize;
2805 let val = (self.0 >> offs) & 0x03;
2806 super::vals::Cnf(val as u8)
2807 }
2808 #[doc = "Port n configuration bits"]
2809 pub fn set_cnf(&mut self, n: usize, val: super::vals::Cnf) {
2810 assert!(n < 8usize);
2811 let offs = 2usize + n * 4usize;
2812 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
2813 }
2814 }
2815 impl Default for Cr {
2816 fn default() -> Cr {
2817 Cr(0)
2818 }
2819 }
2820 #[doc = "Port configuration lock register"]
2821 #[repr(transparent)]
2822 #[derive(Copy, Clone, Eq, PartialEq)]
2823 pub struct Lckr(pub u32);
2824 impl Lckr {
2825 #[doc = "Port A Lock bit"]
2826 pub fn lck(&self, n: usize) -> super::vals::Lck {
2827 assert!(n < 16usize);
2828 let offs = 0usize + n * 1usize;
2829 let val = (self.0 >> offs) & 0x01;
2830 super::vals::Lck(val as u8)
2831 }
2832 #[doc = "Port A Lock bit"]
2833 pub fn set_lck(&mut self, n: usize, val: super::vals::Lck) {
2834 assert!(n < 16usize);
2835 let offs = 0usize + n * 1usize;
2836 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
2837 }
2838 #[doc = "Lock key"]
2839 pub const fn lckk(&self) -> super::vals::Lckk {
2840 let val = (self.0 >> 16usize) & 0x01;
2841 super::vals::Lckk(val as u8)
2842 }
2843 #[doc = "Lock key"]
2844 pub fn set_lckk(&mut self, val: super::vals::Lckk) {
2845 self.0 = (self.0 & !(0x01 << 16usize)) | (((val.0 as u32) & 0x01) << 16usize);
2846 }
2847 }
2848 impl Default for Lckr {
2849 fn default() -> Lckr {
2850 Lckr(0)
2851 }
2852 }
2853 #[doc = "Port output data register (GPIOn_ODR)"]
2854 #[repr(transparent)]
2855 #[derive(Copy, Clone, Eq, PartialEq)]
2856 pub struct Odr(pub u32);
2857 impl Odr {
2858 #[doc = "Port output data"]
2859 pub fn odr(&self, n: usize) -> super::vals::Odr {
2860 assert!(n < 16usize);
2861 let offs = 0usize + n * 1usize;
2862 let val = (self.0 >> offs) & 0x01;
2863 super::vals::Odr(val as u8)
2864 }
2865 #[doc = "Port output data"]
2866 pub fn set_odr(&mut self, n: usize, val: super::vals::Odr) {
2867 assert!(n < 16usize);
2868 let offs = 0usize + n * 1usize;
2869 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
2870 }
2871 }
2872 impl Default for Odr {
2873 fn default() -> Odr {
2874 Odr(0)
2875 }
2876 }
1899 } 2877 }
1900} 2878}
1901pub mod spi_v1 { 2879pub mod timer_v1 {
1902 use crate::generic::*; 2880 use crate::generic::*;
1903 #[doc = "Serial peripheral interface"] 2881 #[doc = "General purpose 16-bit timer"]
1904 #[derive(Copy, Clone)] 2882 #[derive(Copy, Clone)]
1905 pub struct Spi(pub *mut u8); 2883 pub struct TimGp16(pub *mut u8);
1906 unsafe impl Send for Spi {} 2884 unsafe impl Send for TimGp16 {}
1907 unsafe impl Sync for Spi {} 2885 unsafe impl Sync for TimGp16 {}
1908 impl Spi { 2886 impl TimGp16 {
1909 #[doc = "control register 1"] 2887 #[doc = "control register 1"]
1910 pub fn cr1(self) -> Reg<regs::Cr1, RW> { 2888 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
1911 unsafe { Reg::from_ptr(self.0.add(0usize)) } 2889 unsafe { Reg::from_ptr(self.0.add(0usize)) }
1912 } 2890 }
1913 #[doc = "control register 2"] 2891 #[doc = "control register 2"]
1914 pub fn cr2(self) -> Reg<regs::Cr2, RW> { 2892 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
1915 unsafe { Reg::from_ptr(self.0.add(4usize)) } 2893 unsafe { Reg::from_ptr(self.0.add(4usize)) }
1916 } 2894 }
2895 #[doc = "slave mode control register"]
2896 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
2897 unsafe { Reg::from_ptr(self.0.add(8usize)) }
2898 }
2899 #[doc = "DMA/Interrupt enable register"]
2900 pub fn dier(self) -> Reg<regs::DierGp, RW> {
2901 unsafe { Reg::from_ptr(self.0.add(12usize)) }
2902 }
1917 #[doc = "status register"] 2903 #[doc = "status register"]
1918 pub fn sr(self) -> Reg<regs::Sr, RW> { 2904 pub fn sr(self) -> Reg<regs::SrGp, RW> {
2905 unsafe { Reg::from_ptr(self.0.add(16usize)) }
2906 }
2907 #[doc = "event generation register"]
2908 pub fn egr(self) -> Reg<regs::EgrGp, W> {
2909 unsafe { Reg::from_ptr(self.0.add(20usize)) }
2910 }
2911 #[doc = "capture/compare mode register 1 (input mode)"]
2912 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
2913 assert!(n < 2usize);
2914 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
2915 }
2916 #[doc = "capture/compare mode register 1 (output mode)"]
2917 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
2918 assert!(n < 2usize);
2919 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
2920 }
2921 #[doc = "capture/compare enable register"]
2922 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
2923 unsafe { Reg::from_ptr(self.0.add(32usize)) }
2924 }
2925 #[doc = "counter"]
2926 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
2927 unsafe { Reg::from_ptr(self.0.add(36usize)) }
2928 }
2929 #[doc = "prescaler"]
2930 pub fn psc(self) -> Reg<regs::Psc, RW> {
2931 unsafe { Reg::from_ptr(self.0.add(40usize)) }
2932 }
2933 #[doc = "auto-reload register"]
2934 pub fn arr(self) -> Reg<regs::Arr16, RW> {
2935 unsafe { Reg::from_ptr(self.0.add(44usize)) }
2936 }
2937 #[doc = "capture/compare register"]
2938 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
2939 assert!(n < 4usize);
2940 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
2941 }
2942 #[doc = "DMA control register"]
2943 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
2944 unsafe { Reg::from_ptr(self.0.add(72usize)) }
2945 }
2946 #[doc = "DMA address for full transfer"]
2947 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
2948 unsafe { Reg::from_ptr(self.0.add(76usize)) }
2949 }
2950 }
2951 #[doc = "General purpose 32-bit timer"]
2952 #[derive(Copy, Clone)]
2953 pub struct TimGp32(pub *mut u8);
2954 unsafe impl Send for TimGp32 {}
2955 unsafe impl Sync for TimGp32 {}
2956 impl TimGp32 {
2957 #[doc = "control register 1"]
2958 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
2959 unsafe { Reg::from_ptr(self.0.add(0usize)) }
2960 }
2961 #[doc = "control register 2"]
2962 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
2963 unsafe { Reg::from_ptr(self.0.add(4usize)) }
2964 }
2965 #[doc = "slave mode control register"]
2966 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
1919 unsafe { Reg::from_ptr(self.0.add(8usize)) } 2967 unsafe { Reg::from_ptr(self.0.add(8usize)) }
1920 } 2968 }
1921 #[doc = "data register"] 2969 #[doc = "DMA/Interrupt enable register"]
1922 pub fn dr(self) -> Reg<regs::Dr, RW> { 2970 pub fn dier(self) -> Reg<regs::DierGp, RW> {
1923 unsafe { Reg::from_ptr(self.0.add(12usize)) } 2971 unsafe { Reg::from_ptr(self.0.add(12usize)) }
1924 } 2972 }
1925 #[doc = "CRC polynomial register"] 2973 #[doc = "status register"]
1926 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> { 2974 pub fn sr(self) -> Reg<regs::SrGp, RW> {
1927 unsafe { Reg::from_ptr(self.0.add(16usize)) } 2975 unsafe { Reg::from_ptr(self.0.add(16usize)) }
1928 } 2976 }
1929 #[doc = "RX CRC register"] 2977 #[doc = "event generation register"]
1930 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> { 2978 pub fn egr(self) -> Reg<regs::EgrGp, W> {
1931 unsafe { Reg::from_ptr(self.0.add(20usize)) } 2979 unsafe { Reg::from_ptr(self.0.add(20usize)) }
1932 } 2980 }
1933 #[doc = "TX CRC register"] 2981 #[doc = "capture/compare mode register 1 (input mode)"]
1934 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> { 2982 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
1935 unsafe { Reg::from_ptr(self.0.add(24usize)) } 2983 assert!(n < 2usize);
2984 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
2985 }
2986 #[doc = "capture/compare mode register 1 (output mode)"]
2987 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
2988 assert!(n < 2usize);
2989 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
2990 }
2991 #[doc = "capture/compare enable register"]
2992 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
2993 unsafe { Reg::from_ptr(self.0.add(32usize)) }
2994 }
2995 #[doc = "counter"]
2996 pub fn cnt(self) -> Reg<regs::Cnt32, RW> {
2997 unsafe { Reg::from_ptr(self.0.add(36usize)) }
2998 }
2999 #[doc = "prescaler"]
3000 pub fn psc(self) -> Reg<regs::Psc, RW> {
3001 unsafe { Reg::from_ptr(self.0.add(40usize)) }
3002 }
3003 #[doc = "auto-reload register"]
3004 pub fn arr(self) -> Reg<regs::Arr32, RW> {
3005 unsafe { Reg::from_ptr(self.0.add(44usize)) }
3006 }
3007 #[doc = "capture/compare register"]
3008 pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> {
3009 assert!(n < 4usize);
3010 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
3011 }
3012 #[doc = "DMA control register"]
3013 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
3014 unsafe { Reg::from_ptr(self.0.add(72usize)) }
3015 }
3016 #[doc = "DMA address for full transfer"]
3017 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
3018 unsafe { Reg::from_ptr(self.0.add(76usize)) }
3019 }
3020 }
3021 #[doc = "Advanced-timers"]
3022 #[derive(Copy, Clone)]
3023 pub struct TimAdv(pub *mut u8);
3024 unsafe impl Send for TimAdv {}
3025 unsafe impl Sync for TimAdv {}
3026 impl TimAdv {
3027 #[doc = "control register 1"]
3028 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
3029 unsafe { Reg::from_ptr(self.0.add(0usize)) }
3030 }
3031 #[doc = "control register 2"]
3032 pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> {
3033 unsafe { Reg::from_ptr(self.0.add(4usize)) }
3034 }
3035 #[doc = "slave mode control register"]
3036 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
3037 unsafe { Reg::from_ptr(self.0.add(8usize)) }
3038 }
3039 #[doc = "DMA/Interrupt enable register"]
3040 pub fn dier(self) -> Reg<regs::DierAdv, RW> {
3041 unsafe { Reg::from_ptr(self.0.add(12usize)) }
3042 }
3043 #[doc = "status register"]
3044 pub fn sr(self) -> Reg<regs::SrAdv, RW> {
3045 unsafe { Reg::from_ptr(self.0.add(16usize)) }
3046 }
3047 #[doc = "event generation register"]
3048 pub fn egr(self) -> Reg<regs::EgrAdv, W> {
3049 unsafe { Reg::from_ptr(self.0.add(20usize)) }
3050 }
3051 #[doc = "capture/compare mode register 1 (input mode)"]
3052 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
3053 assert!(n < 2usize);
3054 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
3055 }
3056 #[doc = "capture/compare mode register 1 (output mode)"]
3057 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
3058 assert!(n < 2usize);
3059 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
3060 }
3061 #[doc = "capture/compare enable register"]
3062 pub fn ccer(self) -> Reg<regs::CcerAdv, RW> {
3063 unsafe { Reg::from_ptr(self.0.add(32usize)) }
3064 }
3065 #[doc = "counter"]
3066 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
3067 unsafe { Reg::from_ptr(self.0.add(36usize)) }
3068 }
3069 #[doc = "prescaler"]
3070 pub fn psc(self) -> Reg<regs::Psc, RW> {
3071 unsafe { Reg::from_ptr(self.0.add(40usize)) }
3072 }
3073 #[doc = "auto-reload register"]
3074 pub fn arr(self) -> Reg<regs::Arr16, RW> {
3075 unsafe { Reg::from_ptr(self.0.add(44usize)) }
3076 }
3077 #[doc = "repetition counter register"]
3078 pub fn rcr(self) -> Reg<regs::Rcr, RW> {
3079 unsafe { Reg::from_ptr(self.0.add(48usize)) }
3080 }
3081 #[doc = "capture/compare register"]
3082 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
3083 assert!(n < 4usize);
3084 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
3085 }
3086 #[doc = "break and dead-time register"]
3087 pub fn bdtr(self) -> Reg<regs::Bdtr, RW> {
3088 unsafe { Reg::from_ptr(self.0.add(68usize)) }
3089 }
3090 #[doc = "DMA control register"]
3091 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
3092 unsafe { Reg::from_ptr(self.0.add(72usize)) }
3093 }
3094 #[doc = "DMA address for full transfer"]
3095 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
3096 unsafe { Reg::from_ptr(self.0.add(76usize)) }
3097 }
3098 }
3099 #[doc = "Basic timer"]
3100 #[derive(Copy, Clone)]
3101 pub struct TimBasic(pub *mut u8);
3102 unsafe impl Send for TimBasic {}
3103 unsafe impl Sync for TimBasic {}
3104 impl TimBasic {
3105 #[doc = "control register 1"]
3106 pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> {
3107 unsafe { Reg::from_ptr(self.0.add(0usize)) }
3108 }
3109 #[doc = "control register 2"]
3110 pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> {
3111 unsafe { Reg::from_ptr(self.0.add(4usize)) }
3112 }
3113 #[doc = "DMA/Interrupt enable register"]
3114 pub fn dier(self) -> Reg<regs::DierBasic, RW> {
3115 unsafe { Reg::from_ptr(self.0.add(12usize)) }
3116 }
3117 #[doc = "status register"]
3118 pub fn sr(self) -> Reg<regs::SrBasic, RW> {
3119 unsafe { Reg::from_ptr(self.0.add(16usize)) }
3120 }
3121 #[doc = "event generation register"]
3122 pub fn egr(self) -> Reg<regs::EgrBasic, W> {
3123 unsafe { Reg::from_ptr(self.0.add(20usize)) }
3124 }
3125 #[doc = "counter"]
3126 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
3127 unsafe { Reg::from_ptr(self.0.add(36usize)) }
3128 }
3129 #[doc = "prescaler"]
3130 pub fn psc(self) -> Reg<regs::Psc, RW> {
3131 unsafe { Reg::from_ptr(self.0.add(40usize)) }
3132 }
3133 #[doc = "auto-reload register"]
3134 pub fn arr(self) -> Reg<regs::Arr16, RW> {
3135 unsafe { Reg::from_ptr(self.0.add(44usize)) }
1936 } 3136 }
1937 } 3137 }
1938 pub mod vals { 3138 pub mod vals {
1939 use crate::generic::*; 3139 use crate::generic::*;
1940 #[repr(transparent)] 3140 #[repr(transparent)]
1941 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3141 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1942 pub struct Bidimode(pub u8); 3142 pub struct Ts(pub u8);
1943 impl Bidimode { 3143 impl Ts {
1944 #[doc = "2-line unidirectional data mode selected"] 3144 #[doc = "Internal Trigger 0 (ITR0)"]
1945 pub const UNIDIRECTIONAL: Self = Self(0); 3145 pub const ITR0: Self = Self(0);
1946 #[doc = "1-line bidirectional data mode selected"] 3146 #[doc = "Internal Trigger 1 (ITR1)"]
1947 pub const BIDIRECTIONAL: Self = Self(0x01); 3147 pub const ITR1: Self = Self(0x01);
3148 #[doc = "Internal Trigger 2 (ITR2)"]
3149 pub const ITR2: Self = Self(0x02);
3150 #[doc = "TI1 Edge Detector (TI1F_ED)"]
3151 pub const TI1F_ED: Self = Self(0x04);
3152 #[doc = "Filtered Timer Input 1 (TI1FP1)"]
3153 pub const TI1FP1: Self = Self(0x05);
3154 #[doc = "Filtered Timer Input 2 (TI2FP2)"]
3155 pub const TI2FP2: Self = Self(0x06);
3156 #[doc = "External Trigger input (ETRF)"]
3157 pub const ETRF: Self = Self(0x07);
1948 } 3158 }
1949 #[repr(transparent)] 3159 #[repr(transparent)]
1950 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3160 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1951 pub struct Iscfg(pub u8); 3161 pub struct Sms(pub u8);
1952 impl Iscfg { 3162 impl Sms {
1953 #[doc = "Slave - transmit"] 3163 #[doc = "Slave mode disabled - if CEN = ‘1 then the prescaler is clocked directly by the internal clock."]
1954 pub const SLAVETX: Self = Self(0); 3164 pub const DISABLED: Self = Self(0);
1955 #[doc = "Slave - receive"] 3165 #[doc = "Encoder mode 1 - Counter counts up/down on TI2FP1 edge depending on TI1FP2 level."]
1956 pub const SLAVERX: Self = Self(0x01); 3166 pub const ENCODER_MODE_1: Self = Self(0x01);
1957 #[doc = "Master - transmit"] 3167 #[doc = "Encoder mode 2 - Counter counts up/down on TI1FP2 edge depending on TI2FP1 level."]
1958 pub const MASTERTX: Self = Self(0x02); 3168 pub const ENCODER_MODE_2: Self = Self(0x02);
1959 #[doc = "Master - receive"] 3169 #[doc = "Encoder mode 3 - Counter counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input."]
1960 pub const MASTERRX: Self = Self(0x03); 3170 pub const ENCODER_MODE_3: Self = Self(0x03);
3171 #[doc = "Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers."]
3172 pub const RESET_MODE: Self = Self(0x04);
3173 #[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."]
3174 pub const GATED_MODE: Self = Self(0x05);
3175 #[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."]
3176 pub const TRIGGER_MODE: Self = Self(0x06);
3177 #[doc = "External Clock Mode 1 - Rising edges of the selected trigger (TRGI) clock the counter."]
3178 pub const EXT_CLOCK_MODE: Self = Self(0x07);
1961 } 3179 }
1962 #[repr(transparent)] 3180 #[repr(transparent)]
1963 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3181 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1964 pub struct Dff(pub u8); 3182 pub struct Icf(pub u8);
1965 impl Dff { 3183 impl Icf {
1966 #[doc = "8-bit data frame format is selected for transmission/reception"] 3184 #[doc = "No filter, sampling is done at fDTS"]
1967 pub const EIGHTBIT: Self = Self(0); 3185 pub const NOFILTER: Self = Self(0);
1968 #[doc = "16-bit data frame format is selected for transmission/reception"] 3186 #[doc = "fSAMPLING=fCK_INT, N=2"]
1969 pub const SIXTEENBIT: Self = Self(0x01); 3187 pub const FCK_INT_N2: Self = Self(0x01);
3188 #[doc = "fSAMPLING=fCK_INT, N=4"]
3189 pub const FCK_INT_N4: Self = Self(0x02);
3190 #[doc = "fSAMPLING=fCK_INT, N=8"]
3191 pub const FCK_INT_N8: Self = Self(0x03);
3192 #[doc = "fSAMPLING=fDTS/2, N=6"]
3193 pub const FDTS_DIV2_N6: Self = Self(0x04);
3194 #[doc = "fSAMPLING=fDTS/2, N=8"]
3195 pub const FDTS_DIV2_N8: Self = Self(0x05);
3196 #[doc = "fSAMPLING=fDTS/4, N=6"]
3197 pub const FDTS_DIV4_N6: Self = Self(0x06);
3198 #[doc = "fSAMPLING=fDTS/4, N=8"]
3199 pub const FDTS_DIV4_N8: Self = Self(0x07);
3200 #[doc = "fSAMPLING=fDTS/8, N=6"]
3201 pub const FDTS_DIV8_N6: Self = Self(0x08);
3202 #[doc = "fSAMPLING=fDTS/8, N=8"]
3203 pub const FDTS_DIV8_N8: Self = Self(0x09);
3204 #[doc = "fSAMPLING=fDTS/16, N=5"]
3205 pub const FDTS_DIV16_N5: Self = Self(0x0a);
3206 #[doc = "fSAMPLING=fDTS/16, N=6"]
3207 pub const FDTS_DIV16_N6: Self = Self(0x0b);
3208 #[doc = "fSAMPLING=fDTS/16, N=8"]
3209 pub const FDTS_DIV16_N8: Self = Self(0x0c);
3210 #[doc = "fSAMPLING=fDTS/32, N=5"]
3211 pub const FDTS_DIV32_N5: Self = Self(0x0d);
3212 #[doc = "fSAMPLING=fDTS/32, N=6"]
3213 pub const FDTS_DIV32_N6: Self = Self(0x0e);
3214 #[doc = "fSAMPLING=fDTS/32, N=8"]
3215 pub const FDTS_DIV32_N8: Self = Self(0x0f);
1970 } 3216 }
1971 #[repr(transparent)] 3217 #[repr(transparent)]
1972 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3218 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1973 pub struct Bidioe(pub u8); 3219 pub struct Opm(pub u8);
1974 impl Bidioe { 3220 impl Opm {
1975 #[doc = "Output disabled (receive-only mode)"] 3221 #[doc = "Counter is not stopped at update event"]
1976 pub const OUTPUTDISABLED: Self = Self(0); 3222 pub const DISABLED: Self = Self(0);
1977 #[doc = "Output enabled (transmit-only mode)"] 3223 #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"]
1978 pub const OUTPUTENABLED: Self = Self(0x01); 3224 pub const ENABLED: Self = Self(0x01);
1979 } 3225 }
1980 #[repr(transparent)] 3226 #[repr(transparent)]
1981 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3227 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1982 pub struct Rxonly(pub u8); 3228 pub struct Ocm(pub u8);
1983 impl Rxonly { 3229 impl Ocm {
1984 #[doc = "Full duplex (Transmit and receive)"] 3230 #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"]
1985 pub const FULLDUPLEX: Self = Self(0); 3231 pub const FROZEN: Self = Self(0);
1986 #[doc = "Output disabled (Receive-only mode)"] 3232 #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"]
1987 pub const OUTPUTDISABLED: Self = Self(0x01); 3233 pub const ACTIVEONMATCH: Self = Self(0x01);
3234 #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"]
3235 pub const INACTIVEONMATCH: Self = Self(0x02);
3236 #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"]
3237 pub const TOGGLE: Self = Self(0x03);
3238 #[doc = "OCyREF is forced low"]
3239 pub const FORCEINACTIVE: Self = Self(0x04);
3240 #[doc = "OCyREF is forced high"]
3241 pub const FORCEACTIVE: Self = Self(0x05);
3242 #[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"]
3243 pub const PWMMODE1: Self = Self(0x06);
3244 #[doc = "Inversely to PwmMode1"]
3245 pub const PWMMODE2: Self = Self(0x07);
1988 } 3246 }
1989 #[repr(transparent)] 3247 #[repr(transparent)]
1990 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3248 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
1991 pub struct Cpha(pub u8); 3249 pub struct Ossi(pub u8);
1992 impl Cpha { 3250 impl Ossi {
1993 #[doc = "The first clock transition is the first data capture edge"] 3251 #[doc = "When inactive, OC/OCN outputs are disabled"]
1994 pub const FIRSTEDGE: Self = Self(0); 3252 pub const DISABLED: Self = Self(0);
1995 #[doc = "The second clock transition is the first data capture edge"] 3253 #[doc = "When inactive, OC/OCN outputs are forced to idle level"]
1996 pub const SECONDEDGE: Self = Self(0x01); 3254 pub const IDLELEVEL: Self = Self(0x01);
1997 } 3255 }
1998 #[repr(transparent)] 3256 #[repr(transparent)]
1999 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3257 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2000 pub struct Frer(pub u8); 3258 pub struct Dir(pub u8);
2001 impl Frer { 3259 impl Dir {
2002 #[doc = "No frame format error"] 3260 #[doc = "Counter used as upcounter"]
2003 pub const NOERROR: Self = Self(0); 3261 pub const UP: Self = Self(0);
2004 #[doc = "A frame format error occurred"] 3262 #[doc = "Counter used as downcounter"]
2005 pub const ERROR: Self = Self(0x01); 3263 pub const DOWN: Self = Self(0x01);
2006 } 3264 }
2007 #[repr(transparent)] 3265 #[repr(transparent)]
2008 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3266 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2009 pub struct Crcnext(pub u8); 3267 pub struct Ossr(pub u8);
2010 impl Crcnext { 3268 impl Ossr {
2011 #[doc = "Next transmit value is from Tx buffer"] 3269 #[doc = "When inactive, OC/OCN outputs are disabled"]
2012 pub const TXBUFFER: Self = Self(0); 3270 pub const DISABLED: Self = Self(0);
2013 #[doc = "Next transmit value is from Tx CRC register"] 3271 #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"]
2014 pub const CRC: Self = Self(0x01); 3272 pub const IDLELEVEL: Self = Self(0x01);
2015 } 3273 }
2016 #[repr(transparent)] 3274 #[repr(transparent)]
2017 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3275 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2018 pub struct Frf(pub u8); 3276 pub struct Msm(pub u8);
2019 impl Frf { 3277 impl Msm {
2020 #[doc = "SPI Motorola mode"] 3278 #[doc = "No action"]
2021 pub const MOTOROLA: Self = Self(0); 3279 pub const NOSYNC: Self = Self(0);
2022 #[doc = "SPI TI mode"] 3280 #[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."]
2023 pub const TI: Self = Self(0x01); 3281 pub const SYNC: Self = Self(0x01);
2024 } 3282 }
2025 #[repr(transparent)] 3283 #[repr(transparent)]
2026 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3284 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2027 pub struct Lsbfirst(pub u8); 3285 pub struct Arpe(pub u8);
2028 impl Lsbfirst { 3286 impl Arpe {
2029 #[doc = "Data is transmitted/received with the MSB first"] 3287 #[doc = "TIMx_APRR register is not buffered"]
2030 pub const MSBFIRST: Self = Self(0); 3288 pub const DISABLED: Self = Self(0);
2031 #[doc = "Data is transmitted/received with the LSB first"] 3289 #[doc = "TIMx_APRR register is buffered"]
2032 pub const LSBFIRST: Self = Self(0x01); 3290 pub const ENABLED: Self = Self(0x01);
2033 } 3291 }
2034 #[repr(transparent)] 3292 #[repr(transparent)]
2035 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3293 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2036 pub struct Br(pub u8); 3294 pub struct CcmrOutputCcs(pub u8);
2037 impl Br { 3295 impl CcmrOutputCcs {
2038 #[doc = "f_PCLK / 2"] 3296 #[doc = "CCx channel is configured as output"]
2039 pub const DIV2: Self = Self(0); 3297 pub const OUTPUT: Self = Self(0);
2040 #[doc = "f_PCLK / 4"]
2041 pub const DIV4: Self = Self(0x01);
2042 #[doc = "f_PCLK / 8"]
2043 pub const DIV8: Self = Self(0x02);
2044 #[doc = "f_PCLK / 16"]
2045 pub const DIV16: Self = Self(0x03);
2046 #[doc = "f_PCLK / 32"]
2047 pub const DIV32: Self = Self(0x04);
2048 #[doc = "f_PCLK / 64"]
2049 pub const DIV64: Self = Self(0x05);
2050 #[doc = "f_PCLK / 128"]
2051 pub const DIV128: Self = Self(0x06);
2052 #[doc = "f_PCLK / 256"]
2053 pub const DIV256: Self = Self(0x07);
2054 } 3298 }
2055 #[repr(transparent)] 3299 #[repr(transparent)]
2056 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3300 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2057 pub struct Cpol(pub u8); 3301 pub struct Ccds(pub u8);
2058 impl Cpol { 3302 impl Ccds {
2059 #[doc = "CK to 0 when idle"] 3303 #[doc = "CCx DMA request sent when CCx event occurs"]
2060 pub const IDLELOW: Self = Self(0); 3304 pub const ONCOMPARE: Self = Self(0);
2061 #[doc = "CK to 1 when idle"] 3305 #[doc = "CCx DMA request sent when update event occurs"]
2062 pub const IDLEHIGH: Self = Self(0x01); 3306 pub const ONUPDATE: Self = Self(0x01);
2063 } 3307 }
2064 #[repr(transparent)] 3308 #[repr(transparent)]
2065 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] 3309 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
2066 pub struct Mstr(pub u8); 3310 pub struct Tis(pub u8);
2067 impl Mstr { 3311 impl Tis {
2068 #[doc = "Slave configuration"] 3312 #[doc = "The TIMx_CH1 pin is connected to TI1 input"]
2069 pub const SLAVE: Self = Self(0); 3313 pub const NORMAL: Self = Self(0);
2070 #[doc = "Master configuration"] 3314 #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"]
2071 pub const MASTER: Self = Self(0x01); 3315 pub const XOR: Self = Self(0x01);
3316 }
3317 #[repr(transparent)]
3318 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3319 pub struct CcmrInputCcs(pub u8);
3320 impl CcmrInputCcs {
3321 #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"]
3322 pub const TI4: Self = Self(0x01);
3323 #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"]
3324 pub const TI3: Self = Self(0x02);
3325 #[doc = "CCx channel is configured as input, ICx is mapped on TRC"]
3326 pub const TRC: Self = Self(0x03);
3327 }
3328 #[repr(transparent)]
3329 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3330 pub struct Etf(pub u8);
3331 impl Etf {
3332 #[doc = "No filter, sampling is done at fDTS"]
3333 pub const NOFILTER: Self = Self(0);
3334 #[doc = "fSAMPLING=fCK_INT, N=2"]
3335 pub const FCK_INT_N2: Self = Self(0x01);
3336 #[doc = "fSAMPLING=fCK_INT, N=4"]
3337 pub const FCK_INT_N4: Self = Self(0x02);
3338 #[doc = "fSAMPLING=fCK_INT, N=8"]
3339 pub const FCK_INT_N8: Self = Self(0x03);
3340 #[doc = "fSAMPLING=fDTS/2, N=6"]
3341 pub const FDTS_DIV2_N6: Self = Self(0x04);
3342 #[doc = "fSAMPLING=fDTS/2, N=8"]
3343 pub const FDTS_DIV2_N8: Self = Self(0x05);
3344 #[doc = "fSAMPLING=fDTS/4, N=6"]
3345 pub const FDTS_DIV4_N6: Self = Self(0x06);
3346 #[doc = "fSAMPLING=fDTS/4, N=8"]
3347 pub const FDTS_DIV4_N8: Self = Self(0x07);
3348 #[doc = "fSAMPLING=fDTS/8, N=6"]
3349 pub const FDTS_DIV8_N6: Self = Self(0x08);
3350 #[doc = "fSAMPLING=fDTS/8, N=8"]
3351 pub const FDTS_DIV8_N8: Self = Self(0x09);
3352 #[doc = "fSAMPLING=fDTS/16, N=5"]
3353 pub const FDTS_DIV16_N5: Self = Self(0x0a);
3354 #[doc = "fSAMPLING=fDTS/16, N=6"]
3355 pub const FDTS_DIV16_N6: Self = Self(0x0b);
3356 #[doc = "fSAMPLING=fDTS/16, N=8"]
3357 pub const FDTS_DIV16_N8: Self = Self(0x0c);
3358 #[doc = "fSAMPLING=fDTS/32, N=5"]
3359 pub const FDTS_DIV32_N5: Self = Self(0x0d);
3360 #[doc = "fSAMPLING=fDTS/32, N=6"]
3361 pub const FDTS_DIV32_N6: Self = Self(0x0e);
3362 #[doc = "fSAMPLING=fDTS/32, N=8"]
3363 pub const FDTS_DIV32_N8: Self = Self(0x0f);
3364 }
3365 #[repr(transparent)]
3366 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3367 pub struct Cms(pub u8);
3368 impl Cms {
3369 #[doc = "The counter counts up or down depending on the direction bit"]
3370 pub const EDGEALIGNED: Self = Self(0);
3371 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting down."]
3372 pub const CENTERALIGNED1: Self = Self(0x01);
3373 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting up."]
3374 pub const CENTERALIGNED2: Self = Self(0x02);
3375 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set both when the counter is counting up or down."]
3376 pub const CENTERALIGNED3: Self = Self(0x03);
3377 }
3378 #[repr(transparent)]
3379 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3380 pub struct Ckd(pub u8);
3381 impl Ckd {
3382 #[doc = "t_DTS = t_CK_INT"]
3383 pub const DIV1: Self = Self(0);
3384 #[doc = "t_DTS = 2 × t_CK_INT"]
3385 pub const DIV2: Self = Self(0x01);
3386 #[doc = "t_DTS = 4 × t_CK_INT"]
3387 pub const DIV4: Self = Self(0x02);
3388 }
3389 #[repr(transparent)]
3390 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3391 pub struct Etp(pub u8);
3392 impl Etp {
3393 #[doc = "ETR is noninverted, active at high level or rising edge"]
3394 pub const NOTINVERTED: Self = Self(0);
3395 #[doc = "ETR is inverted, active at low level or falling edge"]
3396 pub const INVERTED: Self = Self(0x01);
3397 }
3398 #[repr(transparent)]
3399 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3400 pub struct Etps(pub u8);
3401 impl Etps {
3402 #[doc = "Prescaler OFF"]
3403 pub const DIV1: Self = Self(0);
3404 #[doc = "ETRP frequency divided by 2"]
3405 pub const DIV2: Self = Self(0x01);
3406 #[doc = "ETRP frequency divided by 4"]
3407 pub const DIV4: Self = Self(0x02);
3408 #[doc = "ETRP frequency divided by 8"]
3409 pub const DIV8: Self = Self(0x03);
3410 }
3411 #[repr(transparent)]
3412 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3413 pub struct Urs(pub u8);
3414 impl Urs {
3415 #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"]
3416 pub const ANYEVENT: Self = Self(0);
3417 #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"]
3418 pub const COUNTERONLY: Self = Self(0x01);
3419 }
3420 #[repr(transparent)]
3421 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3422 pub struct Ocpe(pub u8);
3423 impl Ocpe {
3424 #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"]
3425 pub const DISABLED: Self = Self(0);
3426 #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"]
3427 pub const ENABLED: Self = Self(0x01);
3428 }
3429 #[repr(transparent)]
3430 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3431 pub struct Ece(pub u8);
3432 impl Ece {
3433 #[doc = "External clock mode 2 disabled"]
3434 pub const DISABLED: Self = Self(0);
3435 #[doc = "External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal."]
3436 pub const ENABLED: Self = Self(0x01);
3437 }
3438 #[repr(transparent)]
3439 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3440 pub struct Mms(pub u8);
3441 impl Mms {
3442 #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"]
3443 pub const RESET: Self = Self(0);
3444 #[doc = "The counter enable signal, CNT_EN, is used as trigger output"]
3445 pub const ENABLE: Self = Self(0x01);
3446 #[doc = "The update event is selected as trigger output"]
3447 pub const UPDATE: Self = Self(0x02);
3448 #[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"]
3449 pub const COMPAREPULSE: Self = Self(0x03);
3450 #[doc = "OC1REF signal is used as trigger output"]
3451 pub const COMPAREOC1: Self = Self(0x04);
3452 #[doc = "OC2REF signal is used as trigger output"]
3453 pub const COMPAREOC2: Self = Self(0x05);
3454 #[doc = "OC3REF signal is used as trigger output"]
3455 pub const COMPAREOC3: Self = Self(0x06);
3456 #[doc = "OC4REF signal is used as trigger output"]
3457 pub const COMPAREOC4: Self = Self(0x07);
2072 } 3458 }
2073 } 3459 }
2074 pub mod regs { 3460 pub mod regs {
2075 use crate::generic::*; 3461 use crate::generic::*;
2076 #[doc = "control register 1"] 3462 #[doc = "counter"]
2077 #[repr(transparent)] 3463 #[repr(transparent)]
2078 #[derive(Copy, Clone, Eq, PartialEq)] 3464 #[derive(Copy, Clone, Eq, PartialEq)]
2079 pub struct Cr1(pub u32); 3465 pub struct Cnt32(pub u32);
2080 impl Cr1 { 3466 impl Cnt32 {
2081 #[doc = "Clock phase"] 3467 #[doc = "counter value"]
2082 pub const fn cpha(&self) -> super::vals::Cpha { 3468 pub const fn cnt(&self) -> u32 {
3469 let val = (self.0 >> 0usize) & 0xffff_ffff;
3470 val as u32
3471 }
3472 #[doc = "counter value"]
3473 pub fn set_cnt(&mut self, val: u32) {
3474 self.0 =
3475 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
3476 }
3477 }
3478 impl Default for Cnt32 {
3479 fn default() -> Cnt32 {
3480 Cnt32(0)
3481 }
3482 }
3483 #[doc = "DMA address for full transfer"]
3484 #[repr(transparent)]
3485 #[derive(Copy, Clone, Eq, PartialEq)]
3486 pub struct Dmar(pub u32);
3487 impl Dmar {
3488 #[doc = "DMA register for burst accesses"]
3489 pub const fn dmab(&self) -> u16 {
3490 let val = (self.0 >> 0usize) & 0xffff;
3491 val as u16
3492 }
3493 #[doc = "DMA register for burst accesses"]
3494 pub fn set_dmab(&mut self, val: u16) {
3495 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
3496 }
3497 }
3498 impl Default for Dmar {
3499 fn default() -> Dmar {
3500 Dmar(0)
3501 }
3502 }
3503 #[doc = "status register"]
3504 #[repr(transparent)]
3505 #[derive(Copy, Clone, Eq, PartialEq)]
3506 pub struct SrGp(pub u32);
3507 impl SrGp {
3508 #[doc = "Update interrupt flag"]
3509 pub const fn uif(&self) -> bool {
2083 let val = (self.0 >> 0usize) & 0x01; 3510 let val = (self.0 >> 0usize) & 0x01;
2084 super::vals::Cpha(val as u8) 3511 val != 0
2085 } 3512 }
2086 #[doc = "Clock phase"] 3513 #[doc = "Update interrupt flag"]
2087 pub fn set_cpha(&mut self, val: super::vals::Cpha) { 3514 pub fn set_uif(&mut self, val: bool) {
2088 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 3515 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2089 } 3516 }
2090 #[doc = "Clock polarity"] 3517 #[doc = "Capture/compare 1 interrupt flag"]
2091 pub const fn cpol(&self) -> super::vals::Cpol { 3518 pub fn ccif(&self, n: usize) -> bool {
2092 let val = (self.0 >> 1usize) & 0x01; 3519 assert!(n < 4usize);
2093 super::vals::Cpol(val as u8) 3520 let offs = 1usize + n * 1usize;
3521 let val = (self.0 >> offs) & 0x01;
3522 val != 0
2094 } 3523 }
2095 #[doc = "Clock polarity"] 3524 #[doc = "Capture/compare 1 interrupt flag"]
2096 pub fn set_cpol(&mut self, val: super::vals::Cpol) { 3525 pub fn set_ccif(&mut self, n: usize, val: bool) {
2097 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 3526 assert!(n < 4usize);
3527 let offs = 1usize + n * 1usize;
3528 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2098 } 3529 }
2099 #[doc = "Master selection"] 3530 #[doc = "COM interrupt flag"]
2100 pub const fn mstr(&self) -> super::vals::Mstr { 3531 pub const fn comif(&self) -> bool {
2101 let val = (self.0 >> 2usize) & 0x01; 3532 let val = (self.0 >> 5usize) & 0x01;
2102 super::vals::Mstr(val as u8) 3533 val != 0
2103 } 3534 }
2104 #[doc = "Master selection"] 3535 #[doc = "COM interrupt flag"]
2105 pub fn set_mstr(&mut self, val: super::vals::Mstr) { 3536 pub fn set_comif(&mut self, val: bool) {
2106 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 3537 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
2107 } 3538 }
2108 #[doc = "Baud rate control"] 3539 #[doc = "Trigger interrupt flag"]
2109 pub const fn br(&self) -> super::vals::Br { 3540 pub const fn tif(&self) -> bool {
2110 let val = (self.0 >> 3usize) & 0x07; 3541 let val = (self.0 >> 6usize) & 0x01;
2111 super::vals::Br(val as u8) 3542 val != 0
2112 } 3543 }
2113 #[doc = "Baud rate control"] 3544 #[doc = "Trigger interrupt flag"]
2114 pub fn set_br(&mut self, val: super::vals::Br) { 3545 pub fn set_tif(&mut self, val: bool) {
2115 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); 3546 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
2116 } 3547 }
2117 #[doc = "SPI enable"] 3548 #[doc = "Break interrupt flag"]
2118 pub const fn spe(&self) -> bool { 3549 pub const fn bif(&self) -> bool {
3550 let val = (self.0 >> 7usize) & 0x01;
3551 val != 0
3552 }
3553 #[doc = "Break interrupt flag"]
3554 pub fn set_bif(&mut self, val: bool) {
3555 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
3556 }
3557 #[doc = "Capture/Compare 1 overcapture flag"]
3558 pub fn ccof(&self, n: usize) -> bool {
3559 assert!(n < 4usize);
3560 let offs = 9usize + n * 1usize;
3561 let val = (self.0 >> offs) & 0x01;
3562 val != 0
3563 }
3564 #[doc = "Capture/Compare 1 overcapture flag"]
3565 pub fn set_ccof(&mut self, n: usize, val: bool) {
3566 assert!(n < 4usize);
3567 let offs = 9usize + n * 1usize;
3568 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3569 }
3570 }
3571 impl Default for SrGp {
3572 fn default() -> SrGp {
3573 SrGp(0)
3574 }
3575 }
3576 #[doc = "prescaler"]
3577 #[repr(transparent)]
3578 #[derive(Copy, Clone, Eq, PartialEq)]
3579 pub struct Psc(pub u32);
3580 impl Psc {
3581 #[doc = "Prescaler value"]
3582 pub const fn psc(&self) -> u16 {
3583 let val = (self.0 >> 0usize) & 0xffff;
3584 val as u16
3585 }
3586 #[doc = "Prescaler value"]
3587 pub fn set_psc(&mut self, val: u16) {
3588 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
3589 }
3590 }
3591 impl Default for Psc {
3592 fn default() -> Psc {
3593 Psc(0)
3594 }
3595 }
3596 #[doc = "capture/compare register 1"]
3597 #[repr(transparent)]
3598 #[derive(Copy, Clone, Eq, PartialEq)]
3599 pub struct Ccr16(pub u32);
3600 impl Ccr16 {
3601 #[doc = "Capture/Compare 1 value"]
3602 pub const fn ccr(&self) -> u16 {
3603 let val = (self.0 >> 0usize) & 0xffff;
3604 val as u16
3605 }
3606 #[doc = "Capture/Compare 1 value"]
3607 pub fn set_ccr(&mut self, val: u16) {
3608 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
3609 }
3610 }
3611 impl Default for Ccr16 {
3612 fn default() -> Ccr16 {
3613 Ccr16(0)
3614 }
3615 }
3616 #[doc = "event generation register"]
3617 #[repr(transparent)]
3618 #[derive(Copy, Clone, Eq, PartialEq)]
3619 pub struct EgrGp(pub u32);
3620 impl EgrGp {
3621 #[doc = "Update generation"]
3622 pub const fn ug(&self) -> bool {
3623 let val = (self.0 >> 0usize) & 0x01;
3624 val != 0
3625 }
3626 #[doc = "Update generation"]
3627 pub fn set_ug(&mut self, val: bool) {
3628 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3629 }
3630 #[doc = "Capture/compare 1 generation"]
3631 pub fn ccg(&self, n: usize) -> bool {
3632 assert!(n < 4usize);
3633 let offs = 1usize + n * 1usize;
3634 let val = (self.0 >> offs) & 0x01;
3635 val != 0
3636 }
3637 #[doc = "Capture/compare 1 generation"]
3638 pub fn set_ccg(&mut self, n: usize, val: bool) {
3639 assert!(n < 4usize);
3640 let offs = 1usize + n * 1usize;
3641 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3642 }
3643 #[doc = "Capture/Compare control update generation"]
3644 pub const fn comg(&self) -> bool {
3645 let val = (self.0 >> 5usize) & 0x01;
3646 val != 0
3647 }
3648 #[doc = "Capture/Compare control update generation"]
3649 pub fn set_comg(&mut self, val: bool) {
3650 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
3651 }
3652 #[doc = "Trigger generation"]
3653 pub const fn tg(&self) -> bool {
2119 let val = (self.0 >> 6usize) & 0x01; 3654 let val = (self.0 >> 6usize) & 0x01;
2120 val != 0 3655 val != 0
2121 } 3656 }
2122 #[doc = "SPI enable"] 3657 #[doc = "Trigger generation"]
2123 pub fn set_spe(&mut self, val: bool) { 3658 pub fn set_tg(&mut self, val: bool) {
2124 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 3659 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
2125 } 3660 }
2126 #[doc = "Frame format"] 3661 #[doc = "Break generation"]
2127 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { 3662 pub const fn bg(&self) -> bool {
2128 let val = (self.0 >> 7usize) & 0x01; 3663 let val = (self.0 >> 7usize) & 0x01;
2129 super::vals::Lsbfirst(val as u8) 3664 val != 0
2130 } 3665 }
2131 #[doc = "Frame format"] 3666 #[doc = "Break generation"]
2132 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { 3667 pub fn set_bg(&mut self, val: bool) {
2133 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 3668 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
2134 } 3669 }
2135 #[doc = "Internal slave select"] 3670 }
2136 pub const fn ssi(&self) -> bool { 3671 impl Default for EgrGp {
2137 let val = (self.0 >> 8usize) & 0x01; 3672 fn default() -> EgrGp {
3673 EgrGp(0)
3674 }
3675 }
3676 #[doc = "DMA/Interrupt enable register"]
3677 #[repr(transparent)]
3678 #[derive(Copy, Clone, Eq, PartialEq)]
3679 pub struct DierAdv(pub u32);
3680 impl DierAdv {
3681 #[doc = "Update interrupt enable"]
3682 pub const fn uie(&self) -> bool {
3683 let val = (self.0 >> 0usize) & 0x01;
2138 val != 0 3684 val != 0
2139 } 3685 }
2140 #[doc = "Internal slave select"] 3686 #[doc = "Update interrupt enable"]
2141 pub fn set_ssi(&mut self, val: bool) { 3687 pub fn set_uie(&mut self, val: bool) {
2142 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 3688 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2143 } 3689 }
2144 #[doc = "Software slave management"] 3690 #[doc = "Capture/Compare 1 interrupt enable"]
2145 pub const fn ssm(&self) -> bool { 3691 pub fn ccie(&self, n: usize) -> bool {
2146 let val = (self.0 >> 9usize) & 0x01; 3692 assert!(n < 4usize);
3693 let offs = 1usize + n * 1usize;
3694 let val = (self.0 >> offs) & 0x01;
2147 val != 0 3695 val != 0
2148 } 3696 }
2149 #[doc = "Software slave management"] 3697 #[doc = "Capture/Compare 1 interrupt enable"]
2150 pub fn set_ssm(&mut self, val: bool) { 3698 pub fn set_ccie(&mut self, n: usize, val: bool) {
2151 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 3699 assert!(n < 4usize);
3700 let offs = 1usize + n * 1usize;
3701 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2152 } 3702 }
2153 #[doc = "Receive only"] 3703 #[doc = "COM interrupt enable"]
2154 pub const fn rxonly(&self) -> super::vals::Rxonly { 3704 pub const fn comie(&self) -> bool {
2155 let val = (self.0 >> 10usize) & 0x01; 3705 let val = (self.0 >> 5usize) & 0x01;
2156 super::vals::Rxonly(val as u8) 3706 val != 0
2157 } 3707 }
2158 #[doc = "Receive only"] 3708 #[doc = "COM interrupt enable"]
2159 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) { 3709 pub fn set_comie(&mut self, val: bool) {
2160 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 3710 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
2161 } 3711 }
2162 #[doc = "Data frame format"] 3712 #[doc = "Trigger interrupt enable"]
2163 pub const fn dff(&self) -> super::vals::Dff { 3713 pub const fn tie(&self) -> bool {
2164 let val = (self.0 >> 11usize) & 0x01; 3714 let val = (self.0 >> 6usize) & 0x01;
2165 super::vals::Dff(val as u8) 3715 val != 0
2166 } 3716 }
2167 #[doc = "Data frame format"] 3717 #[doc = "Trigger interrupt enable"]
2168 pub fn set_dff(&mut self, val: super::vals::Dff) { 3718 pub fn set_tie(&mut self, val: bool) {
2169 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 3719 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
2170 } 3720 }
2171 #[doc = "CRC transfer next"] 3721 #[doc = "Break interrupt enable"]
2172 pub const fn crcnext(&self) -> super::vals::Crcnext { 3722 pub const fn bie(&self) -> bool {
2173 let val = (self.0 >> 12usize) & 0x01; 3723 let val = (self.0 >> 7usize) & 0x01;
2174 super::vals::Crcnext(val as u8) 3724 val != 0
2175 } 3725 }
2176 #[doc = "CRC transfer next"] 3726 #[doc = "Break interrupt enable"]
2177 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) { 3727 pub fn set_bie(&mut self, val: bool) {
2178 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 3728 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
2179 } 3729 }
2180 #[doc = "Hardware CRC calculation enable"] 3730 #[doc = "Update DMA request enable"]
2181 pub const fn crcen(&self) -> bool { 3731 pub const fn ude(&self) -> bool {
3732 let val = (self.0 >> 8usize) & 0x01;
3733 val != 0
3734 }
3735 #[doc = "Update DMA request enable"]
3736 pub fn set_ude(&mut self, val: bool) {
3737 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
3738 }
3739 #[doc = "Capture/Compare 1 DMA request enable"]
3740 pub fn ccde(&self, n: usize) -> bool {
3741 assert!(n < 4usize);
3742 let offs = 9usize + n * 1usize;
3743 let val = (self.0 >> offs) & 0x01;
3744 val != 0
3745 }
3746 #[doc = "Capture/Compare 1 DMA request enable"]
3747 pub fn set_ccde(&mut self, n: usize, val: bool) {
3748 assert!(n < 4usize);
3749 let offs = 9usize + n * 1usize;
3750 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3751 }
3752 #[doc = "COM DMA request enable"]
3753 pub const fn comde(&self) -> bool {
2182 let val = (self.0 >> 13usize) & 0x01; 3754 let val = (self.0 >> 13usize) & 0x01;
2183 val != 0 3755 val != 0
2184 } 3756 }
2185 #[doc = "Hardware CRC calculation enable"] 3757 #[doc = "COM DMA request enable"]
2186 pub fn set_crcen(&mut self, val: bool) { 3758 pub fn set_comde(&mut self, val: bool) {
2187 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 3759 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
2188 } 3760 }
2189 #[doc = "Output enable in bidirectional mode"] 3761 #[doc = "Trigger DMA request enable"]
2190 pub const fn bidioe(&self) -> super::vals::Bidioe { 3762 pub const fn tde(&self) -> bool {
2191 let val = (self.0 >> 14usize) & 0x01; 3763 let val = (self.0 >> 14usize) & 0x01;
2192 super::vals::Bidioe(val as u8) 3764 val != 0
2193 } 3765 }
2194 #[doc = "Output enable in bidirectional mode"] 3766 #[doc = "Trigger DMA request enable"]
2195 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { 3767 pub fn set_tde(&mut self, val: bool) {
3768 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
3769 }
3770 }
3771 impl Default for DierAdv {
3772 fn default() -> DierAdv {
3773 DierAdv(0)
3774 }
3775 }
3776 #[doc = "repetition counter register"]
3777 #[repr(transparent)]
3778 #[derive(Copy, Clone, Eq, PartialEq)]
3779 pub struct Rcr(pub u32);
3780 impl Rcr {
3781 #[doc = "Repetition counter value"]
3782 pub const fn rep(&self) -> u8 {
3783 let val = (self.0 >> 0usize) & 0xff;
3784 val as u8
3785 }
3786 #[doc = "Repetition counter value"]
3787 pub fn set_rep(&mut self, val: u8) {
3788 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
3789 }
3790 }
3791 impl Default for Rcr {
3792 fn default() -> Rcr {
3793 Rcr(0)
3794 }
3795 }
3796 #[doc = "event generation register"]
3797 #[repr(transparent)]
3798 #[derive(Copy, Clone, Eq, PartialEq)]
3799 pub struct EgrAdv(pub u32);
3800 impl EgrAdv {
3801 #[doc = "Update generation"]
3802 pub const fn ug(&self) -> bool {
3803 let val = (self.0 >> 0usize) & 0x01;
3804 val != 0
3805 }
3806 #[doc = "Update generation"]
3807 pub fn set_ug(&mut self, val: bool) {
3808 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3809 }
3810 #[doc = "Capture/compare 1 generation"]
3811 pub fn ccg(&self, n: usize) -> bool {
3812 assert!(n < 4usize);
3813 let offs = 1usize + n * 1usize;
3814 let val = (self.0 >> offs) & 0x01;
3815 val != 0
3816 }
3817 #[doc = "Capture/compare 1 generation"]
3818 pub fn set_ccg(&mut self, n: usize, val: bool) {
3819 assert!(n < 4usize);
3820 let offs = 1usize + n * 1usize;
3821 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
3822 }
3823 #[doc = "Capture/Compare control update generation"]
3824 pub const fn comg(&self) -> bool {
3825 let val = (self.0 >> 5usize) & 0x01;
3826 val != 0
3827 }
3828 #[doc = "Capture/Compare control update generation"]
3829 pub fn set_comg(&mut self, val: bool) {
3830 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
3831 }
3832 #[doc = "Trigger generation"]
3833 pub const fn tg(&self) -> bool {
3834 let val = (self.0 >> 6usize) & 0x01;
3835 val != 0
3836 }
3837 #[doc = "Trigger generation"]
3838 pub fn set_tg(&mut self, val: bool) {
3839 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
3840 }
3841 #[doc = "Break generation"]
3842 pub const fn bg(&self) -> bool {
3843 let val = (self.0 >> 7usize) & 0x01;
3844 val != 0
3845 }
3846 #[doc = "Break generation"]
3847 pub fn set_bg(&mut self, val: bool) {
3848 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
3849 }
3850 }
3851 impl Default for EgrAdv {
3852 fn default() -> EgrAdv {
3853 EgrAdv(0)
3854 }
3855 }
3856 #[doc = "control register 1"]
3857 #[repr(transparent)]
3858 #[derive(Copy, Clone, Eq, PartialEq)]
3859 pub struct Cr1Gp(pub u32);
3860 impl Cr1Gp {
3861 #[doc = "Counter enable"]
3862 pub const fn cen(&self) -> bool {
3863 let val = (self.0 >> 0usize) & 0x01;
3864 val != 0
3865 }
3866 #[doc = "Counter enable"]
3867 pub fn set_cen(&mut self, val: bool) {
3868 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3869 }
3870 #[doc = "Update disable"]
3871 pub const fn udis(&self) -> bool {
3872 let val = (self.0 >> 1usize) & 0x01;
3873 val != 0
3874 }
3875 #[doc = "Update disable"]
3876 pub fn set_udis(&mut self, val: bool) {
3877 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
3878 }
3879 #[doc = "Update request source"]
3880 pub const fn urs(&self) -> super::vals::Urs {
3881 let val = (self.0 >> 2usize) & 0x01;
3882 super::vals::Urs(val as u8)
3883 }
3884 #[doc = "Update request source"]
3885 pub fn set_urs(&mut self, val: super::vals::Urs) {
3886 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
3887 }
3888 #[doc = "One-pulse mode"]
3889 pub const fn opm(&self) -> super::vals::Opm {
3890 let val = (self.0 >> 3usize) & 0x01;
3891 super::vals::Opm(val as u8)
3892 }
3893 #[doc = "One-pulse mode"]
3894 pub fn set_opm(&mut self, val: super::vals::Opm) {
3895 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
3896 }
3897 #[doc = "Direction"]
3898 pub const fn dir(&self) -> super::vals::Dir {
3899 let val = (self.0 >> 4usize) & 0x01;
3900 super::vals::Dir(val as u8)
3901 }
3902 #[doc = "Direction"]
3903 pub fn set_dir(&mut self, val: super::vals::Dir) {
3904 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
3905 }
3906 #[doc = "Center-aligned mode selection"]
3907 pub const fn cms(&self) -> super::vals::Cms {
3908 let val = (self.0 >> 5usize) & 0x03;
3909 super::vals::Cms(val as u8)
3910 }
3911 #[doc = "Center-aligned mode selection"]
3912 pub fn set_cms(&mut self, val: super::vals::Cms) {
3913 self.0 = (self.0 & !(0x03 << 5usize)) | (((val.0 as u32) & 0x03) << 5usize);
3914 }
3915 #[doc = "Auto-reload preload enable"]
3916 pub const fn arpe(&self) -> super::vals::Arpe {
3917 let val = (self.0 >> 7usize) & 0x01;
3918 super::vals::Arpe(val as u8)
3919 }
3920 #[doc = "Auto-reload preload enable"]
3921 pub fn set_arpe(&mut self, val: super::vals::Arpe) {
3922 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
3923 }
3924 #[doc = "Clock division"]
3925 pub const fn ckd(&self) -> super::vals::Ckd {
3926 let val = (self.0 >> 8usize) & 0x03;
3927 super::vals::Ckd(val as u8)
3928 }
3929 #[doc = "Clock division"]
3930 pub fn set_ckd(&mut self, val: super::vals::Ckd) {
3931 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize);
3932 }
3933 }
3934 impl Default for Cr1Gp {
3935 fn default() -> Cr1Gp {
3936 Cr1Gp(0)
3937 }
3938 }
3939 #[doc = "capture/compare register 1"]
3940 #[repr(transparent)]
3941 #[derive(Copy, Clone, Eq, PartialEq)]
3942 pub struct Ccr32(pub u32);
3943 impl Ccr32 {
3944 #[doc = "Capture/Compare 1 value"]
3945 pub const fn ccr(&self) -> u32 {
3946 let val = (self.0 >> 0usize) & 0xffff_ffff;
3947 val as u32
3948 }
3949 #[doc = "Capture/Compare 1 value"]
3950 pub fn set_ccr(&mut self, val: u32) {
3951 self.0 =
3952 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
3953 }
3954 }
3955 impl Default for Ccr32 {
3956 fn default() -> Ccr32 {
3957 Ccr32(0)
3958 }
3959 }
3960 #[doc = "capture/compare mode register 1 (input mode)"]
3961 #[repr(transparent)]
3962 #[derive(Copy, Clone, Eq, PartialEq)]
3963 pub struct CcmrInput(pub u32);
3964 impl CcmrInput {
3965 #[doc = "Capture/Compare 1 selection"]
3966 pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs {
3967 assert!(n < 2usize);
3968 let offs = 0usize + n * 8usize;
3969 let val = (self.0 >> offs) & 0x03;
3970 super::vals::CcmrInputCcs(val as u8)
3971 }
3972 #[doc = "Capture/Compare 1 selection"]
3973 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) {
3974 assert!(n < 2usize);
3975 let offs = 0usize + n * 8usize;
3976 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
3977 }
3978 #[doc = "Input capture 1 prescaler"]
3979 pub fn icpsc(&self, n: usize) -> u8 {
3980 assert!(n < 2usize);
3981 let offs = 2usize + n * 8usize;
3982 let val = (self.0 >> offs) & 0x03;
3983 val as u8
3984 }
3985 #[doc = "Input capture 1 prescaler"]
3986 pub fn set_icpsc(&mut self, n: usize, val: u8) {
3987 assert!(n < 2usize);
3988 let offs = 2usize + n * 8usize;
3989 self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs);
3990 }
3991 #[doc = "Input capture 1 filter"]
3992 pub fn icf(&self, n: usize) -> super::vals::Icf {
3993 assert!(n < 2usize);
3994 let offs = 4usize + n * 8usize;
3995 let val = (self.0 >> offs) & 0x0f;
3996 super::vals::Icf(val as u8)
3997 }
3998 #[doc = "Input capture 1 filter"]
3999 pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) {
4000 assert!(n < 2usize);
4001 let offs = 4usize + n * 8usize;
4002 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
4003 }
4004 }
4005 impl Default for CcmrInput {
4006 fn default() -> CcmrInput {
4007 CcmrInput(0)
4008 }
4009 }
4010 #[doc = "auto-reload register"]
4011 #[repr(transparent)]
4012 #[derive(Copy, Clone, Eq, PartialEq)]
4013 pub struct Arr32(pub u32);
4014 impl Arr32 {
4015 #[doc = "Auto-reload value"]
4016 pub const fn arr(&self) -> u32 {
4017 let val = (self.0 >> 0usize) & 0xffff_ffff;
4018 val as u32
4019 }
4020 #[doc = "Auto-reload value"]
4021 pub fn set_arr(&mut self, val: u32) {
4022 self.0 =
4023 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
4024 }
4025 }
4026 impl Default for Arr32 {
4027 fn default() -> Arr32 {
4028 Arr32(0)
4029 }
4030 }
4031 #[doc = "slave mode control register"]
4032 #[repr(transparent)]
4033 #[derive(Copy, Clone, Eq, PartialEq)]
4034 pub struct Smcr(pub u32);
4035 impl Smcr {
4036 #[doc = "Slave mode selection"]
4037 pub const fn sms(&self) -> super::vals::Sms {
4038 let val = (self.0 >> 0usize) & 0x07;
4039 super::vals::Sms(val as u8)
4040 }
4041 #[doc = "Slave mode selection"]
4042 pub fn set_sms(&mut self, val: super::vals::Sms) {
4043 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
4044 }
4045 #[doc = "Trigger selection"]
4046 pub const fn ts(&self) -> super::vals::Ts {
4047 let val = (self.0 >> 4usize) & 0x07;
4048 super::vals::Ts(val as u8)
4049 }
4050 #[doc = "Trigger selection"]
4051 pub fn set_ts(&mut self, val: super::vals::Ts) {
4052 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
4053 }
4054 #[doc = "Master/Slave mode"]
4055 pub const fn msm(&self) -> super::vals::Msm {
4056 let val = (self.0 >> 7usize) & 0x01;
4057 super::vals::Msm(val as u8)
4058 }
4059 #[doc = "Master/Slave mode"]
4060 pub fn set_msm(&mut self, val: super::vals::Msm) {
4061 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4062 }
4063 #[doc = "External trigger filter"]
4064 pub const fn etf(&self) -> super::vals::Etf {
4065 let val = (self.0 >> 8usize) & 0x0f;
4066 super::vals::Etf(val as u8)
4067 }
4068 #[doc = "External trigger filter"]
4069 pub fn set_etf(&mut self, val: super::vals::Etf) {
4070 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
4071 }
4072 #[doc = "External trigger prescaler"]
4073 pub const fn etps(&self) -> super::vals::Etps {
4074 let val = (self.0 >> 12usize) & 0x03;
4075 super::vals::Etps(val as u8)
4076 }
4077 #[doc = "External trigger prescaler"]
4078 pub fn set_etps(&mut self, val: super::vals::Etps) {
4079 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
4080 }
4081 #[doc = "External clock enable"]
4082 pub const fn ece(&self) -> super::vals::Ece {
4083 let val = (self.0 >> 14usize) & 0x01;
4084 super::vals::Ece(val as u8)
4085 }
4086 #[doc = "External clock enable"]
4087 pub fn set_ece(&mut self, val: super::vals::Ece) {
2196 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 4088 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
2197 } 4089 }
2198 #[doc = "Bidirectional data mode enable"] 4090 #[doc = "External trigger polarity"]
2199 pub const fn bidimode(&self) -> super::vals::Bidimode { 4091 pub const fn etp(&self) -> super::vals::Etp {
2200 let val = (self.0 >> 15usize) & 0x01; 4092 let val = (self.0 >> 15usize) & 0x01;
2201 super::vals::Bidimode(val as u8) 4093 super::vals::Etp(val as u8)
2202 } 4094 }
2203 #[doc = "Bidirectional data mode enable"] 4095 #[doc = "External trigger polarity"]
2204 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { 4096 pub fn set_etp(&mut self, val: super::vals::Etp) {
2205 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 4097 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
2206 } 4098 }
2207 } 4099 }
2208 impl Default for Cr1 { 4100 impl Default for Smcr {
2209 fn default() -> Cr1 { 4101 fn default() -> Smcr {
2210 Cr1(0) 4102 Smcr(0)
2211 } 4103 }
2212 } 4104 }
2213 #[doc = "data register"] 4105 #[doc = "control register 2"]
2214 #[repr(transparent)] 4106 #[repr(transparent)]
2215 #[derive(Copy, Clone, Eq, PartialEq)] 4107 #[derive(Copy, Clone, Eq, PartialEq)]
2216 pub struct Dr(pub u32); 4108 pub struct Cr2Basic(pub u32);
2217 impl Dr { 4109 impl Cr2Basic {
2218 #[doc = "Data register"] 4110 #[doc = "Master mode selection"]
2219 pub const fn dr(&self) -> u16 { 4111 pub const fn mms(&self) -> super::vals::Mms {
2220 let val = (self.0 >> 0usize) & 0xffff; 4112 let val = (self.0 >> 4usize) & 0x07;
2221 val as u16 4113 super::vals::Mms(val as u8)
2222 } 4114 }
2223 #[doc = "Data register"] 4115 #[doc = "Master mode selection"]
2224 pub fn set_dr(&mut self, val: u16) { 4116 pub fn set_mms(&mut self, val: super::vals::Mms) {
2225 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 4117 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
2226 } 4118 }
2227 } 4119 }
2228 impl Default for Dr { 4120 impl Default for Cr2Basic {
2229 fn default() -> Dr { 4121 fn default() -> Cr2Basic {
2230 Dr(0) 4122 Cr2Basic(0)
2231 } 4123 }
2232 } 4124 }
2233 #[doc = "CRC polynomial register"] 4125 #[doc = "capture/compare enable register"]
2234 #[repr(transparent)] 4126 #[repr(transparent)]
2235 #[derive(Copy, Clone, Eq, PartialEq)] 4127 #[derive(Copy, Clone, Eq, PartialEq)]
2236 pub struct Crcpr(pub u32); 4128 pub struct CcerAdv(pub u32);
2237 impl Crcpr { 4129 impl CcerAdv {
2238 #[doc = "CRC polynomial register"] 4130 #[doc = "Capture/Compare 1 output enable"]
2239 pub const fn crcpoly(&self) -> u16 { 4131 pub fn cce(&self, n: usize) -> bool {
2240 let val = (self.0 >> 0usize) & 0xffff; 4132 assert!(n < 4usize);
2241 val as u16 4133 let offs = 0usize + n * 4usize;
4134 let val = (self.0 >> offs) & 0x01;
4135 val != 0
2242 } 4136 }
2243 #[doc = "CRC polynomial register"] 4137 #[doc = "Capture/Compare 1 output enable"]
2244 pub fn set_crcpoly(&mut self, val: u16) { 4138 pub fn set_cce(&mut self, n: usize, val: bool) {
2245 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 4139 assert!(n < 4usize);
4140 let offs = 0usize + n * 4usize;
4141 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4142 }
4143 #[doc = "Capture/Compare 1 output Polarity"]
4144 pub fn ccp(&self, n: usize) -> bool {
4145 assert!(n < 4usize);
4146 let offs = 1usize + n * 4usize;
4147 let val = (self.0 >> offs) & 0x01;
4148 val != 0
4149 }
4150 #[doc = "Capture/Compare 1 output Polarity"]
4151 pub fn set_ccp(&mut self, n: usize, val: bool) {
4152 assert!(n < 4usize);
4153 let offs = 1usize + n * 4usize;
4154 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4155 }
4156 #[doc = "Capture/Compare 1 complementary output enable"]
4157 pub fn ccne(&self, n: usize) -> bool {
4158 assert!(n < 4usize);
4159 let offs = 2usize + n * 4usize;
4160 let val = (self.0 >> offs) & 0x01;
4161 val != 0
4162 }
4163 #[doc = "Capture/Compare 1 complementary output enable"]
4164 pub fn set_ccne(&mut self, n: usize, val: bool) {
4165 assert!(n < 4usize);
4166 let offs = 2usize + n * 4usize;
4167 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4168 }
4169 #[doc = "Capture/Compare 1 output Polarity"]
4170 pub fn ccnp(&self, n: usize) -> bool {
4171 assert!(n < 4usize);
4172 let offs = 3usize + n * 4usize;
4173 let val = (self.0 >> offs) & 0x01;
4174 val != 0
4175 }
4176 #[doc = "Capture/Compare 1 output Polarity"]
4177 pub fn set_ccnp(&mut self, n: usize, val: bool) {
4178 assert!(n < 4usize);
4179 let offs = 3usize + n * 4usize;
4180 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2246 } 4181 }
2247 } 4182 }
2248 impl Default for Crcpr { 4183 impl Default for CcerAdv {
2249 fn default() -> Crcpr { 4184 fn default() -> CcerAdv {
2250 Crcpr(0) 4185 CcerAdv(0)
2251 } 4186 }
2252 } 4187 }
2253 #[doc = "RX CRC register"] 4188 #[doc = "DMA/Interrupt enable register"]
2254 #[repr(transparent)] 4189 #[repr(transparent)]
2255 #[derive(Copy, Clone, Eq, PartialEq)] 4190 #[derive(Copy, Clone, Eq, PartialEq)]
2256 pub struct Rxcrcr(pub u32); 4191 pub struct DierGp(pub u32);
2257 impl Rxcrcr { 4192 impl DierGp {
2258 #[doc = "Rx CRC register"] 4193 #[doc = "Update interrupt enable"]
2259 pub const fn rx_crc(&self) -> u16 { 4194 pub const fn uie(&self) -> bool {
2260 let val = (self.0 >> 0usize) & 0xffff; 4195 let val = (self.0 >> 0usize) & 0x01;
2261 val as u16 4196 val != 0
2262 } 4197 }
2263 #[doc = "Rx CRC register"] 4198 #[doc = "Update interrupt enable"]
2264 pub fn set_rx_crc(&mut self, val: u16) { 4199 pub fn set_uie(&mut self, val: bool) {
2265 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 4200 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4201 }
4202 #[doc = "Capture/Compare 1 interrupt enable"]
4203 pub fn ccie(&self, n: usize) -> bool {
4204 assert!(n < 4usize);
4205 let offs = 1usize + n * 1usize;
4206 let val = (self.0 >> offs) & 0x01;
4207 val != 0
4208 }
4209 #[doc = "Capture/Compare 1 interrupt enable"]
4210 pub fn set_ccie(&mut self, n: usize, val: bool) {
4211 assert!(n < 4usize);
4212 let offs = 1usize + n * 1usize;
4213 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4214 }
4215 #[doc = "Trigger interrupt enable"]
4216 pub const fn tie(&self) -> bool {
4217 let val = (self.0 >> 6usize) & 0x01;
4218 val != 0
4219 }
4220 #[doc = "Trigger interrupt enable"]
4221 pub fn set_tie(&mut self, val: bool) {
4222 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4223 }
4224 #[doc = "Update DMA request enable"]
4225 pub const fn ude(&self) -> bool {
4226 let val = (self.0 >> 8usize) & 0x01;
4227 val != 0
4228 }
4229 #[doc = "Update DMA request enable"]
4230 pub fn set_ude(&mut self, val: bool) {
4231 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
4232 }
4233 #[doc = "Capture/Compare 1 DMA request enable"]
4234 pub fn ccde(&self, n: usize) -> bool {
4235 assert!(n < 4usize);
4236 let offs = 9usize + n * 1usize;
4237 let val = (self.0 >> offs) & 0x01;
4238 val != 0
4239 }
4240 #[doc = "Capture/Compare 1 DMA request enable"]
4241 pub fn set_ccde(&mut self, n: usize, val: bool) {
4242 assert!(n < 4usize);
4243 let offs = 9usize + n * 1usize;
4244 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4245 }
4246 #[doc = "Trigger DMA request enable"]
4247 pub const fn tde(&self) -> bool {
4248 let val = (self.0 >> 14usize) & 0x01;
4249 val != 0
4250 }
4251 #[doc = "Trigger DMA request enable"]
4252 pub fn set_tde(&mut self, val: bool) {
4253 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
2266 } 4254 }
2267 } 4255 }
2268 impl Default for Rxcrcr { 4256 impl Default for DierGp {
2269 fn default() -> Rxcrcr { 4257 fn default() -> DierGp {
2270 Rxcrcr(0) 4258 DierGp(0)
2271 } 4259 }
2272 } 4260 }
2273 #[doc = "TX CRC register"] 4261 #[doc = "auto-reload register"]
2274 #[repr(transparent)] 4262 #[repr(transparent)]
2275 #[derive(Copy, Clone, Eq, PartialEq)] 4263 #[derive(Copy, Clone, Eq, PartialEq)]
2276 pub struct Txcrcr(pub u32); 4264 pub struct Arr16(pub u32);
2277 impl Txcrcr { 4265 impl Arr16 {
2278 #[doc = "Tx CRC register"] 4266 #[doc = "Auto-reload value"]
2279 pub const fn tx_crc(&self) -> u16 { 4267 pub const fn arr(&self) -> u16 {
2280 let val = (self.0 >> 0usize) & 0xffff; 4268 let val = (self.0 >> 0usize) & 0xffff;
2281 val as u16 4269 val as u16
2282 } 4270 }
2283 #[doc = "Tx CRC register"] 4271 #[doc = "Auto-reload value"]
2284 pub fn set_tx_crc(&mut self, val: u16) { 4272 pub fn set_arr(&mut self, val: u16) {
2285 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 4273 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
2286 } 4274 }
2287 } 4275 }
2288 impl Default for Txcrcr { 4276 impl Default for Arr16 {
2289 fn default() -> Txcrcr { 4277 fn default() -> Arr16 {
2290 Txcrcr(0) 4278 Arr16(0)
2291 } 4279 }
2292 } 4280 }
2293 #[doc = "status register"] 4281 #[doc = "status register"]
2294 #[repr(transparent)] 4282 #[repr(transparent)]
2295 #[derive(Copy, Clone, Eq, PartialEq)] 4283 #[derive(Copy, Clone, Eq, PartialEq)]
2296 pub struct Sr(pub u32); 4284 pub struct SrBasic(pub u32);
2297 impl Sr { 4285 impl SrBasic {
2298 #[doc = "Receive buffer not empty"] 4286 #[doc = "Update interrupt flag"]
2299 pub const fn rxne(&self) -> bool { 4287 pub const fn uif(&self) -> bool {
2300 let val = (self.0 >> 0usize) & 0x01; 4288 let val = (self.0 >> 0usize) & 0x01;
2301 val != 0 4289 val != 0
2302 } 4290 }
2303 #[doc = "Receive buffer not empty"] 4291 #[doc = "Update interrupt flag"]
2304 pub fn set_rxne(&mut self, val: bool) { 4292 pub fn set_uif(&mut self, val: bool) {
2305 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 4293 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2306 } 4294 }
2307 #[doc = "Transmit buffer empty"] 4295 }
2308 pub const fn txe(&self) -> bool { 4296 impl Default for SrBasic {
2309 let val = (self.0 >> 1usize) & 0x01; 4297 fn default() -> SrBasic {
4298 SrBasic(0)
4299 }
4300 }
4301 #[doc = "DMA control register"]
4302 #[repr(transparent)]
4303 #[derive(Copy, Clone, Eq, PartialEq)]
4304 pub struct Dcr(pub u32);
4305 impl Dcr {
4306 #[doc = "DMA base address"]
4307 pub const fn dba(&self) -> u8 {
4308 let val = (self.0 >> 0usize) & 0x1f;
4309 val as u8
4310 }
4311 #[doc = "DMA base address"]
4312 pub fn set_dba(&mut self, val: u8) {
4313 self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
4314 }
4315 #[doc = "DMA burst length"]
4316 pub const fn dbl(&self) -> u8 {
4317 let val = (self.0 >> 8usize) & 0x1f;
4318 val as u8
4319 }
4320 #[doc = "DMA burst length"]
4321 pub fn set_dbl(&mut self, val: u8) {
4322 self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize);
4323 }
4324 }
4325 impl Default for Dcr {
4326 fn default() -> Dcr {
4327 Dcr(0)
4328 }
4329 }
4330 #[doc = "control register 2"]
4331 #[repr(transparent)]
4332 #[derive(Copy, Clone, Eq, PartialEq)]
4333 pub struct Cr2Adv(pub u32);
4334 impl Cr2Adv {
4335 #[doc = "Capture/compare preloaded control"]
4336 pub const fn ccpc(&self) -> bool {
4337 let val = (self.0 >> 0usize) & 0x01;
2310 val != 0 4338 val != 0
2311 } 4339 }
2312 #[doc = "Transmit buffer empty"] 4340 #[doc = "Capture/compare preloaded control"]
2313 pub fn set_txe(&mut self, val: bool) { 4341 pub fn set_ccpc(&mut self, val: bool) {
2314 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 4342 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2315 } 4343 }
2316 #[doc = "CRC error flag"] 4344 #[doc = "Capture/compare control update selection"]
2317 pub const fn crcerr(&self) -> bool { 4345 pub const fn ccus(&self) -> bool {
2318 let val = (self.0 >> 4usize) & 0x01; 4346 let val = (self.0 >> 2usize) & 0x01;
2319 val != 0 4347 val != 0
2320 } 4348 }
2321 #[doc = "CRC error flag"] 4349 #[doc = "Capture/compare control update selection"]
2322 pub fn set_crcerr(&mut self, val: bool) { 4350 pub fn set_ccus(&mut self, val: bool) {
2323 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 4351 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
2324 } 4352 }
2325 #[doc = "Mode fault"] 4353 #[doc = "Capture/compare DMA selection"]
2326 pub const fn modf(&self) -> bool { 4354 pub const fn ccds(&self) -> super::vals::Ccds {
2327 let val = (self.0 >> 5usize) & 0x01; 4355 let val = (self.0 >> 3usize) & 0x01;
4356 super::vals::Ccds(val as u8)
4357 }
4358 #[doc = "Capture/compare DMA selection"]
4359 pub fn set_ccds(&mut self, val: super::vals::Ccds) {
4360 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
4361 }
4362 #[doc = "Master mode selection"]
4363 pub const fn mms(&self) -> super::vals::Mms {
4364 let val = (self.0 >> 4usize) & 0x07;
4365 super::vals::Mms(val as u8)
4366 }
4367 #[doc = "Master mode selection"]
4368 pub fn set_mms(&mut self, val: super::vals::Mms) {
4369 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
4370 }
4371 #[doc = "TI1 selection"]
4372 pub const fn ti1s(&self) -> super::vals::Tis {
4373 let val = (self.0 >> 7usize) & 0x01;
4374 super::vals::Tis(val as u8)
4375 }
4376 #[doc = "TI1 selection"]
4377 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
4378 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4379 }
4380 #[doc = "Output Idle state 1"]
4381 pub fn ois(&self, n: usize) -> bool {
4382 assert!(n < 4usize);
4383 let offs = 8usize + n * 2usize;
4384 let val = (self.0 >> offs) & 0x01;
2328 val != 0 4385 val != 0
2329 } 4386 }
2330 #[doc = "Mode fault"] 4387 #[doc = "Output Idle state 1"]
2331 pub fn set_modf(&mut self, val: bool) { 4388 pub fn set_ois(&mut self, n: usize, val: bool) {
2332 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 4389 assert!(n < 4usize);
4390 let offs = 8usize + n * 2usize;
4391 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2333 } 4392 }
2334 #[doc = "Overrun flag"] 4393 #[doc = "Output Idle state 1"]
2335 pub const fn ovr(&self) -> bool { 4394 pub const fn ois1n(&self) -> bool {
2336 let val = (self.0 >> 6usize) & 0x01; 4395 let val = (self.0 >> 9usize) & 0x01;
2337 val != 0 4396 val != 0
2338 } 4397 }
2339 #[doc = "Overrun flag"] 4398 #[doc = "Output Idle state 1"]
2340 pub fn set_ovr(&mut self, val: bool) { 4399 pub fn set_ois1n(&mut self, val: bool) {
2341 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 4400 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
2342 } 4401 }
2343 #[doc = "Busy flag"] 4402 #[doc = "Output Idle state 2"]
2344 pub const fn bsy(&self) -> bool { 4403 pub const fn ois2n(&self) -> bool {
2345 let val = (self.0 >> 7usize) & 0x01; 4404 let val = (self.0 >> 11usize) & 0x01;
2346 val != 0 4405 val != 0
2347 } 4406 }
2348 #[doc = "Busy flag"] 4407 #[doc = "Output Idle state 2"]
2349 pub fn set_bsy(&mut self, val: bool) { 4408 pub fn set_ois2n(&mut self, val: bool) {
2350 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 4409 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
2351 } 4410 }
2352 #[doc = "TI frame format error"] 4411 #[doc = "Output Idle state 3"]
2353 pub const fn fre(&self) -> bool { 4412 pub const fn ois3n(&self) -> bool {
2354 let val = (self.0 >> 8usize) & 0x01; 4413 let val = (self.0 >> 13usize) & 0x01;
2355 val != 0 4414 val != 0
2356 } 4415 }
2357 #[doc = "TI frame format error"] 4416 #[doc = "Output Idle state 3"]
2358 pub fn set_fre(&mut self, val: bool) { 4417 pub fn set_ois3n(&mut self, val: bool) {
2359 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 4418 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
2360 } 4419 }
2361 } 4420 }
2362 impl Default for Sr { 4421 impl Default for Cr2Adv {
2363 fn default() -> Sr { 4422 fn default() -> Cr2Adv {
2364 Sr(0) 4423 Cr2Adv(0)
2365 } 4424 }
2366 } 4425 }
2367 #[doc = "control register 2"] 4426 #[doc = "event generation register"]
2368 #[repr(transparent)] 4427 #[repr(transparent)]
2369 #[derive(Copy, Clone, Eq, PartialEq)] 4428 #[derive(Copy, Clone, Eq, PartialEq)]
2370 pub struct Cr2(pub u32); 4429 pub struct EgrBasic(pub u32);
2371 impl Cr2 { 4430 impl EgrBasic {
2372 #[doc = "Rx buffer DMA enable"] 4431 #[doc = "Update generation"]
2373 pub const fn rxdmaen(&self) -> bool { 4432 pub const fn ug(&self) -> bool {
2374 let val = (self.0 >> 0usize) & 0x01; 4433 let val = (self.0 >> 0usize) & 0x01;
2375 val != 0 4434 val != 0
2376 } 4435 }
2377 #[doc = "Rx buffer DMA enable"] 4436 #[doc = "Update generation"]
2378 pub fn set_rxdmaen(&mut self, val: bool) { 4437 pub fn set_ug(&mut self, val: bool) {
2379 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 4438 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2380 } 4439 }
2381 #[doc = "Tx buffer DMA enable"] 4440 }
2382 pub const fn txdmaen(&self) -> bool { 4441 impl Default for EgrBasic {
4442 fn default() -> EgrBasic {
4443 EgrBasic(0)
4444 }
4445 }
4446 #[doc = "control register 1"]
4447 #[repr(transparent)]
4448 #[derive(Copy, Clone, Eq, PartialEq)]
4449 pub struct Cr1Basic(pub u32);
4450 impl Cr1Basic {
4451 #[doc = "Counter enable"]
4452 pub const fn cen(&self) -> bool {
4453 let val = (self.0 >> 0usize) & 0x01;
4454 val != 0
4455 }
4456 #[doc = "Counter enable"]
4457 pub fn set_cen(&mut self, val: bool) {
4458 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4459 }
4460 #[doc = "Update disable"]
4461 pub const fn udis(&self) -> bool {
2383 let val = (self.0 >> 1usize) & 0x01; 4462 let val = (self.0 >> 1usize) & 0x01;
2384 val != 0 4463 val != 0
2385 } 4464 }
2386 #[doc = "Tx buffer DMA enable"] 4465 #[doc = "Update disable"]
2387 pub fn set_txdmaen(&mut self, val: bool) { 4466 pub fn set_udis(&mut self, val: bool) {
2388 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 4467 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
2389 } 4468 }
2390 #[doc = "SS output enable"] 4469 #[doc = "Update request source"]
2391 pub const fn ssoe(&self) -> bool { 4470 pub const fn urs(&self) -> super::vals::Urs {
2392 let val = (self.0 >> 2usize) & 0x01; 4471 let val = (self.0 >> 2usize) & 0x01;
4472 super::vals::Urs(val as u8)
4473 }
4474 #[doc = "Update request source"]
4475 pub fn set_urs(&mut self, val: super::vals::Urs) {
4476 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
4477 }
4478 #[doc = "One-pulse mode"]
4479 pub const fn opm(&self) -> super::vals::Opm {
4480 let val = (self.0 >> 3usize) & 0x01;
4481 super::vals::Opm(val as u8)
4482 }
4483 #[doc = "One-pulse mode"]
4484 pub fn set_opm(&mut self, val: super::vals::Opm) {
4485 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
4486 }
4487 #[doc = "Auto-reload preload enable"]
4488 pub const fn arpe(&self) -> super::vals::Arpe {
4489 let val = (self.0 >> 7usize) & 0x01;
4490 super::vals::Arpe(val as u8)
4491 }
4492 #[doc = "Auto-reload preload enable"]
4493 pub fn set_arpe(&mut self, val: super::vals::Arpe) {
4494 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4495 }
4496 }
4497 impl Default for Cr1Basic {
4498 fn default() -> Cr1Basic {
4499 Cr1Basic(0)
4500 }
4501 }
4502 #[doc = "capture/compare enable register"]
4503 #[repr(transparent)]
4504 #[derive(Copy, Clone, Eq, PartialEq)]
4505 pub struct CcerGp(pub u32);
4506 impl CcerGp {
4507 #[doc = "Capture/Compare 1 output enable"]
4508 pub fn cce(&self, n: usize) -> bool {
4509 assert!(n < 4usize);
4510 let offs = 0usize + n * 4usize;
4511 let val = (self.0 >> offs) & 0x01;
2393 val != 0 4512 val != 0
2394 } 4513 }
2395 #[doc = "SS output enable"] 4514 #[doc = "Capture/Compare 1 output enable"]
2396 pub fn set_ssoe(&mut self, val: bool) { 4515 pub fn set_cce(&mut self, n: usize, val: bool) {
2397 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 4516 assert!(n < 4usize);
4517 let offs = 0usize + n * 4usize;
4518 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2398 } 4519 }
2399 #[doc = "Frame format"] 4520 #[doc = "Capture/Compare 1 output Polarity"]
2400 pub const fn frf(&self) -> super::vals::Frf { 4521 pub fn ccp(&self, n: usize) -> bool {
2401 let val = (self.0 >> 4usize) & 0x01; 4522 assert!(n < 4usize);
2402 super::vals::Frf(val as u8) 4523 let offs = 1usize + n * 4usize;
4524 let val = (self.0 >> offs) & 0x01;
4525 val != 0
2403 } 4526 }
2404 #[doc = "Frame format"] 4527 #[doc = "Capture/Compare 1 output Polarity"]
2405 pub fn set_frf(&mut self, val: super::vals::Frf) { 4528 pub fn set_ccp(&mut self, n: usize, val: bool) {
2406 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 4529 assert!(n < 4usize);
4530 let offs = 1usize + n * 4usize;
4531 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
2407 } 4532 }
2408 #[doc = "Error interrupt enable"] 4533 #[doc = "Capture/Compare 1 output Polarity"]
2409 pub const fn errie(&self) -> bool { 4534 pub fn ccnp(&self, n: usize) -> bool {
4535 assert!(n < 4usize);
4536 let offs = 3usize + n * 4usize;
4537 let val = (self.0 >> offs) & 0x01;
4538 val != 0
4539 }
4540 #[doc = "Capture/Compare 1 output Polarity"]
4541 pub fn set_ccnp(&mut self, n: usize, val: bool) {
4542 assert!(n < 4usize);
4543 let offs = 3usize + n * 4usize;
4544 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4545 }
4546 }
4547 impl Default for CcerGp {
4548 fn default() -> CcerGp {
4549 CcerGp(0)
4550 }
4551 }
4552 #[doc = "capture/compare mode register 2 (output mode)"]
4553 #[repr(transparent)]
4554 #[derive(Copy, Clone, Eq, PartialEq)]
4555 pub struct CcmrOutput(pub u32);
4556 impl CcmrOutput {
4557 #[doc = "Capture/Compare 3 selection"]
4558 pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs {
4559 assert!(n < 2usize);
4560 let offs = 0usize + n * 8usize;
4561 let val = (self.0 >> offs) & 0x03;
4562 super::vals::CcmrOutputCcs(val as u8)
4563 }
4564 #[doc = "Capture/Compare 3 selection"]
4565 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) {
4566 assert!(n < 2usize);
4567 let offs = 0usize + n * 8usize;
4568 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
4569 }
4570 #[doc = "Output compare 3 fast enable"]
4571 pub fn ocfe(&self, n: usize) -> bool {
4572 assert!(n < 2usize);
4573 let offs = 2usize + n * 8usize;
4574 let val = (self.0 >> offs) & 0x01;
4575 val != 0
4576 }
4577 #[doc = "Output compare 3 fast enable"]
4578 pub fn set_ocfe(&mut self, n: usize, val: bool) {
4579 assert!(n < 2usize);
4580 let offs = 2usize + n * 8usize;
4581 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4582 }
4583 #[doc = "Output compare 3 preload enable"]
4584 pub fn ocpe(&self, n: usize) -> super::vals::Ocpe {
4585 assert!(n < 2usize);
4586 let offs = 3usize + n * 8usize;
4587 let val = (self.0 >> offs) & 0x01;
4588 super::vals::Ocpe(val as u8)
4589 }
4590 #[doc = "Output compare 3 preload enable"]
4591 pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) {
4592 assert!(n < 2usize);
4593 let offs = 3usize + n * 8usize;
4594 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
4595 }
4596 #[doc = "Output compare 3 mode"]
4597 pub fn ocm(&self, n: usize) -> super::vals::Ocm {
4598 assert!(n < 2usize);
4599 let offs = 4usize + n * 8usize;
4600 let val = (self.0 >> offs) & 0x07;
4601 super::vals::Ocm(val as u8)
4602 }
4603 #[doc = "Output compare 3 mode"]
4604 pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) {
4605 assert!(n < 2usize);
4606 let offs = 4usize + n * 8usize;
4607 self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs);
4608 }
4609 #[doc = "Output compare 3 clear enable"]
4610 pub fn occe(&self, n: usize) -> bool {
4611 assert!(n < 2usize);
4612 let offs = 7usize + n * 8usize;
4613 let val = (self.0 >> offs) & 0x01;
4614 val != 0
4615 }
4616 #[doc = "Output compare 3 clear enable"]
4617 pub fn set_occe(&mut self, n: usize, val: bool) {
4618 assert!(n < 2usize);
4619 let offs = 7usize + n * 8usize;
4620 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4621 }
4622 }
4623 impl Default for CcmrOutput {
4624 fn default() -> CcmrOutput {
4625 CcmrOutput(0)
4626 }
4627 }
4628 #[doc = "counter"]
4629 #[repr(transparent)]
4630 #[derive(Copy, Clone, Eq, PartialEq)]
4631 pub struct Cnt16(pub u32);
4632 impl Cnt16 {
4633 #[doc = "counter value"]
4634 pub const fn cnt(&self) -> u16 {
4635 let val = (self.0 >> 0usize) & 0xffff;
4636 val as u16
4637 }
4638 #[doc = "counter value"]
4639 pub fn set_cnt(&mut self, val: u16) {
4640 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
4641 }
4642 }
4643 impl Default for Cnt16 {
4644 fn default() -> Cnt16 {
4645 Cnt16(0)
4646 }
4647 }
4648 #[doc = "DMA/Interrupt enable register"]
4649 #[repr(transparent)]
4650 #[derive(Copy, Clone, Eq, PartialEq)]
4651 pub struct DierBasic(pub u32);
4652 impl DierBasic {
4653 #[doc = "Update interrupt enable"]
4654 pub const fn uie(&self) -> bool {
4655 let val = (self.0 >> 0usize) & 0x01;
4656 val != 0
4657 }
4658 #[doc = "Update interrupt enable"]
4659 pub fn set_uie(&mut self, val: bool) {
4660 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4661 }
4662 #[doc = "Update DMA request enable"]
4663 pub const fn ude(&self) -> bool {
4664 let val = (self.0 >> 8usize) & 0x01;
4665 val != 0
4666 }
4667 #[doc = "Update DMA request enable"]
4668 pub fn set_ude(&mut self, val: bool) {
4669 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
4670 }
4671 }
4672 impl Default for DierBasic {
4673 fn default() -> DierBasic {
4674 DierBasic(0)
4675 }
4676 }
4677 #[doc = "status register"]
4678 #[repr(transparent)]
4679 #[derive(Copy, Clone, Eq, PartialEq)]
4680 pub struct SrAdv(pub u32);
4681 impl SrAdv {
4682 #[doc = "Update interrupt flag"]
4683 pub const fn uif(&self) -> bool {
4684 let val = (self.0 >> 0usize) & 0x01;
4685 val != 0
4686 }
4687 #[doc = "Update interrupt flag"]
4688 pub fn set_uif(&mut self, val: bool) {
4689 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4690 }
4691 #[doc = "Capture/compare 1 interrupt flag"]
4692 pub fn ccif(&self, n: usize) -> bool {
4693 assert!(n < 4usize);
4694 let offs = 1usize + n * 1usize;
4695 let val = (self.0 >> offs) & 0x01;
4696 val != 0
4697 }
4698 #[doc = "Capture/compare 1 interrupt flag"]
4699 pub fn set_ccif(&mut self, n: usize, val: bool) {
4700 assert!(n < 4usize);
4701 let offs = 1usize + n * 1usize;
4702 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4703 }
4704 #[doc = "COM interrupt flag"]
4705 pub const fn comif(&self) -> bool {
2410 let val = (self.0 >> 5usize) & 0x01; 4706 let val = (self.0 >> 5usize) & 0x01;
2411 val != 0 4707 val != 0
2412 } 4708 }
2413 #[doc = "Error interrupt enable"] 4709 #[doc = "COM interrupt flag"]
2414 pub fn set_errie(&mut self, val: bool) { 4710 pub fn set_comif(&mut self, val: bool) {
2415 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 4711 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
2416 } 4712 }
2417 #[doc = "RX buffer not empty interrupt enable"] 4713 #[doc = "Trigger interrupt flag"]
2418 pub const fn rxneie(&self) -> bool { 4714 pub const fn tif(&self) -> bool {
2419 let val = (self.0 >> 6usize) & 0x01; 4715 let val = (self.0 >> 6usize) & 0x01;
2420 val != 0 4716 val != 0
2421 } 4717 }
2422 #[doc = "RX buffer not empty interrupt enable"] 4718 #[doc = "Trigger interrupt flag"]
2423 pub fn set_rxneie(&mut self, val: bool) { 4719 pub fn set_tif(&mut self, val: bool) {
2424 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 4720 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
2425 } 4721 }
2426 #[doc = "Tx buffer empty interrupt enable"] 4722 #[doc = "Break interrupt flag"]
2427 pub const fn txeie(&self) -> bool { 4723 pub const fn bif(&self) -> bool {
2428 let val = (self.0 >> 7usize) & 0x01; 4724 let val = (self.0 >> 7usize) & 0x01;
2429 val != 0 4725 val != 0
2430 } 4726 }
2431 #[doc = "Tx buffer empty interrupt enable"] 4727 #[doc = "Break interrupt flag"]
2432 pub fn set_txeie(&mut self, val: bool) { 4728 pub fn set_bif(&mut self, val: bool) {
2433 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 4729 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
2434 } 4730 }
4731 #[doc = "Capture/Compare 1 overcapture flag"]
4732 pub fn ccof(&self, n: usize) -> bool {
4733 assert!(n < 4usize);
4734 let offs = 9usize + n * 1usize;
4735 let val = (self.0 >> offs) & 0x01;
4736 val != 0
4737 }
4738 #[doc = "Capture/Compare 1 overcapture flag"]
4739 pub fn set_ccof(&mut self, n: usize, val: bool) {
4740 assert!(n < 4usize);
4741 let offs = 9usize + n * 1usize;
4742 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
4743 }
2435 } 4744 }
2436 impl Default for Cr2 { 4745 impl Default for SrAdv {
2437 fn default() -> Cr2 { 4746 fn default() -> SrAdv {
2438 Cr2(0) 4747 SrAdv(0)
4748 }
4749 }
4750 #[doc = "control register 2"]
4751 #[repr(transparent)]
4752 #[derive(Copy, Clone, Eq, PartialEq)]
4753 pub struct Cr2Gp(pub u32);
4754 impl Cr2Gp {
4755 #[doc = "Capture/compare DMA selection"]
4756 pub const fn ccds(&self) -> super::vals::Ccds {
4757 let val = (self.0 >> 3usize) & 0x01;
4758 super::vals::Ccds(val as u8)
4759 }
4760 #[doc = "Capture/compare DMA selection"]
4761 pub fn set_ccds(&mut self, val: super::vals::Ccds) {
4762 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
4763 }
4764 #[doc = "Master mode selection"]
4765 pub const fn mms(&self) -> super::vals::Mms {
4766 let val = (self.0 >> 4usize) & 0x07;
4767 super::vals::Mms(val as u8)
4768 }
4769 #[doc = "Master mode selection"]
4770 pub fn set_mms(&mut self, val: super::vals::Mms) {
4771 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
4772 }
4773 #[doc = "TI1 selection"]
4774 pub const fn ti1s(&self) -> super::vals::Tis {
4775 let val = (self.0 >> 7usize) & 0x01;
4776 super::vals::Tis(val as u8)
4777 }
4778 #[doc = "TI1 selection"]
4779 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
4780 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
4781 }
4782 }
4783 impl Default for Cr2Gp {
4784 fn default() -> Cr2Gp {
4785 Cr2Gp(0)
4786 }
4787 }
4788 #[doc = "break and dead-time register"]
4789 #[repr(transparent)]
4790 #[derive(Copy, Clone, Eq, PartialEq)]
4791 pub struct Bdtr(pub u32);
4792 impl Bdtr {
4793 #[doc = "Dead-time generator setup"]
4794 pub const fn dtg(&self) -> u8 {
4795 let val = (self.0 >> 0usize) & 0xff;
4796 val as u8
4797 }
4798 #[doc = "Dead-time generator setup"]
4799 pub fn set_dtg(&mut self, val: u8) {
4800 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
4801 }
4802 #[doc = "Lock configuration"]
4803 pub const fn lock(&self) -> u8 {
4804 let val = (self.0 >> 8usize) & 0x03;
4805 val as u8
4806 }
4807 #[doc = "Lock configuration"]
4808 pub fn set_lock(&mut self, val: u8) {
4809 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
4810 }
4811 #[doc = "Off-state selection for Idle mode"]
4812 pub const fn ossi(&self) -> super::vals::Ossi {
4813 let val = (self.0 >> 10usize) & 0x01;
4814 super::vals::Ossi(val as u8)
4815 }
4816 #[doc = "Off-state selection for Idle mode"]
4817 pub fn set_ossi(&mut self, val: super::vals::Ossi) {
4818 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
4819 }
4820 #[doc = "Off-state selection for Run mode"]
4821 pub const fn ossr(&self) -> super::vals::Ossr {
4822 let val = (self.0 >> 11usize) & 0x01;
4823 super::vals::Ossr(val as u8)
4824 }
4825 #[doc = "Off-state selection for Run mode"]
4826 pub fn set_ossr(&mut self, val: super::vals::Ossr) {
4827 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
4828 }
4829 #[doc = "Break enable"]
4830 pub const fn bke(&self) -> bool {
4831 let val = (self.0 >> 12usize) & 0x01;
4832 val != 0
4833 }
4834 #[doc = "Break enable"]
4835 pub fn set_bke(&mut self, val: bool) {
4836 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
4837 }
4838 #[doc = "Break polarity"]
4839 pub const fn bkp(&self) -> bool {
4840 let val = (self.0 >> 13usize) & 0x01;
4841 val != 0
4842 }
4843 #[doc = "Break polarity"]
4844 pub fn set_bkp(&mut self, val: bool) {
4845 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
4846 }
4847 #[doc = "Automatic output enable"]
4848 pub const fn aoe(&self) -> bool {
4849 let val = (self.0 >> 14usize) & 0x01;
4850 val != 0
4851 }
4852 #[doc = "Automatic output enable"]
4853 pub fn set_aoe(&mut self, val: bool) {
4854 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
4855 }
4856 #[doc = "Main output enable"]
4857 pub const fn moe(&self) -> bool {
4858 let val = (self.0 >> 15usize) & 0x01;
4859 val != 0
4860 }
4861 #[doc = "Main output enable"]
4862 pub fn set_moe(&mut self, val: bool) {
4863 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
4864 }
4865 }
4866 impl Default for Bdtr {
4867 fn default() -> Bdtr {
4868 Bdtr(0)
2439 } 4869 }
2440 } 4870 }
2441 } 4871 }
@@ -2548,162 +4978,6 @@ pub mod syscfg_h7 {
2548 } 4978 }
2549 pub mod regs { 4979 pub mod regs {
2550 use crate::generic::*; 4980 use crate::generic::*;
2551 #[doc = "SYSCFG user register 2"]
2552 #[repr(transparent)]
2553 #[derive(Copy, Clone, Eq, PartialEq)]
2554 pub struct Ur2(pub u32);
2555 impl Ur2 {
2556 #[doc = "BOR_LVL Brownout Reset Threshold Level"]
2557 pub const fn borh(&self) -> u8 {
2558 let val = (self.0 >> 0usize) & 0x03;
2559 val as u8
2560 }
2561 #[doc = "BOR_LVL Brownout Reset Threshold Level"]
2562 pub fn set_borh(&mut self, val: u8) {
2563 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
2564 }
2565 #[doc = "Boot Address 0"]
2566 pub const fn boot_add0(&self) -> u16 {
2567 let val = (self.0 >> 16usize) & 0xffff;
2568 val as u16
2569 }
2570 #[doc = "Boot Address 0"]
2571 pub fn set_boot_add0(&mut self, val: u16) {
2572 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
2573 }
2574 }
2575 impl Default for Ur2 {
2576 fn default() -> Ur2 {
2577 Ur2(0)
2578 }
2579 }
2580 #[doc = "SYSCFG user register 8"]
2581 #[repr(transparent)]
2582 #[derive(Copy, Clone, Eq, PartialEq)]
2583 pub struct Ur8(pub u32);
2584 impl Ur8 {
2585 #[doc = "Mass erase protected area disabled for bank 2"]
2586 pub const fn mepad_2(&self) -> bool {
2587 let val = (self.0 >> 0usize) & 0x01;
2588 val != 0
2589 }
2590 #[doc = "Mass erase protected area disabled for bank 2"]
2591 pub fn set_mepad_2(&mut self, val: bool) {
2592 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2593 }
2594 #[doc = "Mass erase secured area disabled for bank 2"]
2595 pub const fn mesad_2(&self) -> bool {
2596 let val = (self.0 >> 16usize) & 0x01;
2597 val != 0
2598 }
2599 #[doc = "Mass erase secured area disabled for bank 2"]
2600 pub fn set_mesad_2(&mut self, val: bool) {
2601 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
2602 }
2603 }
2604 impl Default for Ur8 {
2605 fn default() -> Ur8 {
2606 Ur8(0)
2607 }
2608 }
2609 #[doc = "SYSCFG user register 9"]
2610 #[repr(transparent)]
2611 #[derive(Copy, Clone, Eq, PartialEq)]
2612 pub struct Ur9(pub u32);
2613 impl Ur9 {
2614 #[doc = "Write protection for flash bank 2"]
2615 pub const fn wrpn_2(&self) -> u8 {
2616 let val = (self.0 >> 0usize) & 0xff;
2617 val as u8
2618 }
2619 #[doc = "Write protection for flash bank 2"]
2620 pub fn set_wrpn_2(&mut self, val: u8) {
2621 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
2622 }
2623 #[doc = "Protected area start address for bank 2"]
2624 pub const fn pa_beg_2(&self) -> u16 {
2625 let val = (self.0 >> 16usize) & 0x0fff;
2626 val as u16
2627 }
2628 #[doc = "Protected area start address for bank 2"]
2629 pub fn set_pa_beg_2(&mut self, val: u16) {
2630 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
2631 }
2632 }
2633 impl Default for Ur9 {
2634 fn default() -> Ur9 {
2635 Ur9(0)
2636 }
2637 }
2638 #[doc = "SYSCFG compensation cell code register"]
2639 #[repr(transparent)]
2640 #[derive(Copy, Clone, Eq, PartialEq)]
2641 pub struct Cccr(pub u32);
2642 impl Cccr {
2643 #[doc = "NMOS compensation code"]
2644 pub const fn ncc(&self) -> u8 {
2645 let val = (self.0 >> 0usize) & 0x0f;
2646 val as u8
2647 }
2648 #[doc = "NMOS compensation code"]
2649 pub fn set_ncc(&mut self, val: u8) {
2650 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
2651 }
2652 #[doc = "PMOS compensation code"]
2653 pub const fn pcc(&self) -> u8 {
2654 let val = (self.0 >> 4usize) & 0x0f;
2655 val as u8
2656 }
2657 #[doc = "PMOS compensation code"]
2658 pub fn set_pcc(&mut self, val: u8) {
2659 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
2660 }
2661 }
2662 impl Default for Cccr {
2663 fn default() -> Cccr {
2664 Cccr(0)
2665 }
2666 }
2667 #[doc = "SYSCFG user register 17"]
2668 #[repr(transparent)]
2669 #[derive(Copy, Clone, Eq, PartialEq)]
2670 pub struct Ur17(pub u32);
2671 impl Ur17 {
2672 #[doc = "I/O high speed / low voltage"]
2673 pub const fn io_hslv(&self) -> bool {
2674 let val = (self.0 >> 0usize) & 0x01;
2675 val != 0
2676 }
2677 #[doc = "I/O high speed / low voltage"]
2678 pub fn set_io_hslv(&mut self, val: bool) {
2679 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2680 }
2681 }
2682 impl Default for Ur17 {
2683 fn default() -> Ur17 {
2684 Ur17(0)
2685 }
2686 }
2687 #[doc = "SYSCFG user register 14"]
2688 #[repr(transparent)]
2689 #[derive(Copy, Clone, Eq, PartialEq)]
2690 pub struct Ur14(pub u32);
2691 impl Ur14 {
2692 #[doc = "D1 Stop Reset"]
2693 pub const fn d1stprst(&self) -> bool {
2694 let val = (self.0 >> 0usize) & 0x01;
2695 val != 0
2696 }
2697 #[doc = "D1 Stop Reset"]
2698 pub fn set_d1stprst(&mut self, val: bool) {
2699 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2700 }
2701 }
2702 impl Default for Ur14 {
2703 fn default() -> Ur14 {
2704 Ur14(0)
2705 }
2706 }
2707 #[doc = "SYSCFG user register 7"] 4981 #[doc = "SYSCFG user register 7"]
2708 #[repr(transparent)] 4982 #[repr(transparent)]
2709 #[derive(Copy, Clone, Eq, PartialEq)] 4983 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -2733,216 +5007,44 @@ pub mod syscfg_h7 {
2733 Ur7(0) 5007 Ur7(0)
2734 } 5008 }
2735 } 5009 }
2736 #[doc = "SYSCFG user register 12"] 5010 #[doc = "SYSCFG package register"]
2737 #[repr(transparent)]
2738 #[derive(Copy, Clone, Eq, PartialEq)]
2739 pub struct Ur12(pub u32);
2740 impl Ur12 {
2741 #[doc = "Secure mode"]
2742 pub const fn secure(&self) -> bool {
2743 let val = (self.0 >> 16usize) & 0x01;
2744 val != 0
2745 }
2746 #[doc = "Secure mode"]
2747 pub fn set_secure(&mut self, val: bool) {
2748 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
2749 }
2750 }
2751 impl Default for Ur12 {
2752 fn default() -> Ur12 {
2753 Ur12(0)
2754 }
2755 }
2756 #[doc = "SYSCFG user register 0"]
2757 #[repr(transparent)]
2758 #[derive(Copy, Clone, Eq, PartialEq)]
2759 pub struct Ur0(pub u32);
2760 impl Ur0 {
2761 #[doc = "Bank Swap"]
2762 pub const fn bks(&self) -> bool {
2763 let val = (self.0 >> 0usize) & 0x01;
2764 val != 0
2765 }
2766 #[doc = "Bank Swap"]
2767 pub fn set_bks(&mut self, val: bool) {
2768 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2769 }
2770 #[doc = "Readout protection"]
2771 pub const fn rdp(&self) -> u8 {
2772 let val = (self.0 >> 16usize) & 0xff;
2773 val as u8
2774 }
2775 #[doc = "Readout protection"]
2776 pub fn set_rdp(&mut self, val: u8) {
2777 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
2778 }
2779 }
2780 impl Default for Ur0 {
2781 fn default() -> Ur0 {
2782 Ur0(0)
2783 }
2784 }
2785 #[doc = "SYSCFG user register 11"]
2786 #[repr(transparent)]
2787 #[derive(Copy, Clone, Eq, PartialEq)]
2788 pub struct Ur11(pub u32);
2789 impl Ur11 {
2790 #[doc = "Secured area end address for bank 2"]
2791 pub const fn sa_end_2(&self) -> u16 {
2792 let val = (self.0 >> 0usize) & 0x0fff;
2793 val as u16
2794 }
2795 #[doc = "Secured area end address for bank 2"]
2796 pub fn set_sa_end_2(&mut self, val: u16) {
2797 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
2798 }
2799 #[doc = "Independent Watchdog 1 mode"]
2800 pub const fn iwdg1m(&self) -> bool {
2801 let val = (self.0 >> 16usize) & 0x01;
2802 val != 0
2803 }
2804 #[doc = "Independent Watchdog 1 mode"]
2805 pub fn set_iwdg1m(&mut self, val: bool) {
2806 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
2807 }
2808 }
2809 impl Default for Ur11 {
2810 fn default() -> Ur11 {
2811 Ur11(0)
2812 }
2813 }
2814 #[doc = "SYSCFG user register 16"]
2815 #[repr(transparent)]
2816 #[derive(Copy, Clone, Eq, PartialEq)]
2817 pub struct Ur16(pub u32);
2818 impl Ur16 {
2819 #[doc = "Freeze independent watchdog in Stop mode"]
2820 pub const fn fziwdgstp(&self) -> bool {
2821 let val = (self.0 >> 0usize) & 0x01;
2822 val != 0
2823 }
2824 #[doc = "Freeze independent watchdog in Stop mode"]
2825 pub fn set_fziwdgstp(&mut self, val: bool) {
2826 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2827 }
2828 #[doc = "Private key programmed"]
2829 pub const fn pkp(&self) -> bool {
2830 let val = (self.0 >> 16usize) & 0x01;
2831 val != 0
2832 }
2833 #[doc = "Private key programmed"]
2834 pub fn set_pkp(&mut self, val: bool) {
2835 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
2836 }
2837 }
2838 impl Default for Ur16 {
2839 fn default() -> Ur16 {
2840 Ur16(0)
2841 }
2842 }
2843 #[doc = "SYSCFG user register 13"]
2844 #[repr(transparent)]
2845 #[derive(Copy, Clone, Eq, PartialEq)]
2846 pub struct Ur13(pub u32);
2847 impl Ur13 {
2848 #[doc = "Secured DTCM RAM Size"]
2849 pub const fn sdrs(&self) -> u8 {
2850 let val = (self.0 >> 0usize) & 0x03;
2851 val as u8
2852 }
2853 #[doc = "Secured DTCM RAM Size"]
2854 pub fn set_sdrs(&mut self, val: u8) {
2855 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
2856 }
2857 #[doc = "D1 Standby reset"]
2858 pub const fn d1sbrst(&self) -> bool {
2859 let val = (self.0 >> 16usize) & 0x01;
2860 val != 0
2861 }
2862 #[doc = "D1 Standby reset"]
2863 pub fn set_d1sbrst(&mut self, val: bool) {
2864 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
2865 }
2866 }
2867 impl Default for Ur13 {
2868 fn default() -> Ur13 {
2869 Ur13(0)
2870 }
2871 }
2872 #[doc = "SYSCFG user register 5"]
2873 #[repr(transparent)] 5011 #[repr(transparent)]
2874 #[derive(Copy, Clone, Eq, PartialEq)] 5012 #[derive(Copy, Clone, Eq, PartialEq)]
2875 pub struct Ur5(pub u32); 5013 pub struct Pkgr(pub u32);
2876 impl Ur5 { 5014 impl Pkgr {
2877 #[doc = "Mass erase secured area disabled for bank 1"] 5015 #[doc = "Package"]
2878 pub const fn mesad_1(&self) -> bool { 5016 pub const fn pkg(&self) -> u8 {
2879 let val = (self.0 >> 0usize) & 0x01; 5017 let val = (self.0 >> 0usize) & 0x0f;
2880 val != 0
2881 }
2882 #[doc = "Mass erase secured area disabled for bank 1"]
2883 pub fn set_mesad_1(&mut self, val: bool) {
2884 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2885 }
2886 #[doc = "Write protection for flash bank 1"]
2887 pub const fn wrpn_1(&self) -> u8 {
2888 let val = (self.0 >> 16usize) & 0xff;
2889 val as u8 5018 val as u8
2890 } 5019 }
2891 #[doc = "Write protection for flash bank 1"] 5020 #[doc = "Package"]
2892 pub fn set_wrpn_1(&mut self, val: u8) { 5021 pub fn set_pkg(&mut self, val: u8) {
2893 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize); 5022 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
2894 } 5023 }
2895 } 5024 }
2896 impl Default for Ur5 { 5025 impl Default for Pkgr {
2897 fn default() -> Ur5 { 5026 fn default() -> Pkgr {
2898 Ur5(0) 5027 Pkgr(0)
2899 } 5028 }
2900 } 5029 }
2901 #[doc = "compensation cell control/status register"] 5030 #[doc = "SYSCFG user register 15"]
2902 #[repr(transparent)] 5031 #[repr(transparent)]
2903 #[derive(Copy, Clone, Eq, PartialEq)] 5032 #[derive(Copy, Clone, Eq, PartialEq)]
2904 pub struct Cccsr(pub u32); 5033 pub struct Ur15(pub u32);
2905 impl Cccsr { 5034 impl Ur15 {
2906 #[doc = "enable"] 5035 #[doc = "Freeze independent watchdog in Standby mode"]
2907 pub const fn en(&self) -> bool { 5036 pub const fn fziwdgstb(&self) -> bool {
2908 let val = (self.0 >> 0usize) & 0x01;
2909 val != 0
2910 }
2911 #[doc = "enable"]
2912 pub fn set_en(&mut self, val: bool) {
2913 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
2914 }
2915 #[doc = "Code selection"]
2916 pub const fn cs(&self) -> bool {
2917 let val = (self.0 >> 1usize) & 0x01;
2918 val != 0
2919 }
2920 #[doc = "Code selection"]
2921 pub fn set_cs(&mut self, val: bool) {
2922 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
2923 }
2924 #[doc = "Compensation cell ready flag"]
2925 pub const fn ready(&self) -> bool {
2926 let val = (self.0 >> 8usize) & 0x01;
2927 val != 0
2928 }
2929 #[doc = "Compensation cell ready flag"]
2930 pub fn set_ready(&mut self, val: bool) {
2931 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
2932 }
2933 #[doc = "High-speed at low-voltage"]
2934 pub const fn hslv(&self) -> bool {
2935 let val = (self.0 >> 16usize) & 0x01; 5037 let val = (self.0 >> 16usize) & 0x01;
2936 val != 0 5038 val != 0
2937 } 5039 }
2938 #[doc = "High-speed at low-voltage"] 5040 #[doc = "Freeze independent watchdog in Standby mode"]
2939 pub fn set_hslv(&mut self, val: bool) { 5041 pub fn set_fziwdgstb(&mut self, val: bool) {
2940 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 5042 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
2941 } 5043 }
2942 } 5044 }
2943 impl Default for Cccsr { 5045 impl Default for Ur15 {
2944 fn default() -> Cccsr { 5046 fn default() -> Ur15 {
2945 Cccsr(0) 5047 Ur15(0)
2946 } 5048 }
2947 } 5049 }
2948 #[doc = "SYSCFG user register 4"] 5050 #[doc = "SYSCFG user register 4"]
@@ -2965,55 +5067,6 @@ pub mod syscfg_h7 {
2965 Ur4(0) 5067 Ur4(0)
2966 } 5068 }
2967 } 5069 }
2968 #[doc = "SYSCFG user register 10"]
2969 #[repr(transparent)]
2970 #[derive(Copy, Clone, Eq, PartialEq)]
2971 pub struct Ur10(pub u32);
2972 impl Ur10 {
2973 #[doc = "Protected area end address for bank 2"]
2974 pub const fn pa_end_2(&self) -> u16 {
2975 let val = (self.0 >> 0usize) & 0x0fff;
2976 val as u16
2977 }
2978 #[doc = "Protected area end address for bank 2"]
2979 pub fn set_pa_end_2(&mut self, val: u16) {
2980 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
2981 }
2982 #[doc = "Secured area start address for bank 2"]
2983 pub const fn sa_beg_2(&self) -> u16 {
2984 let val = (self.0 >> 16usize) & 0x0fff;
2985 val as u16
2986 }
2987 #[doc = "Secured area start address for bank 2"]
2988 pub fn set_sa_beg_2(&mut self, val: u16) {
2989 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
2990 }
2991 }
2992 impl Default for Ur10 {
2993 fn default() -> Ur10 {
2994 Ur10(0)
2995 }
2996 }
2997 #[doc = "SYSCFG user register 15"]
2998 #[repr(transparent)]
2999 #[derive(Copy, Clone, Eq, PartialEq)]
3000 pub struct Ur15(pub u32);
3001 impl Ur15 {
3002 #[doc = "Freeze independent watchdog in Standby mode"]
3003 pub const fn fziwdgstb(&self) -> bool {
3004 let val = (self.0 >> 16usize) & 0x01;
3005 val != 0
3006 }
3007 #[doc = "Freeze independent watchdog in Standby mode"]
3008 pub fn set_fziwdgstb(&mut self, val: bool) {
3009 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
3010 }
3011 }
3012 impl Default for Ur15 {
3013 fn default() -> Ur15 {
3014 Ur15(0)
3015 }
3016 }
3017 #[doc = "SYSCFG user register 3"] 5070 #[doc = "SYSCFG user register 3"]
3018 #[repr(transparent)] 5071 #[repr(transparent)]
3019 #[derive(Copy, Clone, Eq, PartialEq)] 5072 #[derive(Copy, Clone, Eq, PartialEq)]
@@ -3034,106 +5087,33 @@ pub mod syscfg_h7 {
3034 Ur3(0) 5087 Ur3(0)
3035 } 5088 }
3036 } 5089 }
3037 #[doc = "SYSCFG package register"] 5090 #[doc = "SYSCFG user register 13"]
3038 #[repr(transparent)]
3039 #[derive(Copy, Clone, Eq, PartialEq)]
3040 pub struct Pkgr(pub u32);
3041 impl Pkgr {
3042 #[doc = "Package"]
3043 pub const fn pkg(&self) -> u8 {
3044 let val = (self.0 >> 0usize) & 0x0f;
3045 val as u8
3046 }
3047 #[doc = "Package"]
3048 pub fn set_pkg(&mut self, val: u8) {
3049 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
3050 }
3051 }
3052 impl Default for Pkgr {
3053 fn default() -> Pkgr {
3054 Pkgr(0)
3055 }
3056 }
3057 #[doc = "SYSCFG user register 6"]
3058 #[repr(transparent)]
3059 #[derive(Copy, Clone, Eq, PartialEq)]
3060 pub struct Ur6(pub u32);
3061 impl Ur6 {
3062 #[doc = "Protected area start address for bank 1"]
3063 pub const fn pa_beg_1(&self) -> u16 {
3064 let val = (self.0 >> 0usize) & 0x0fff;
3065 val as u16
3066 }
3067 #[doc = "Protected area start address for bank 1"]
3068 pub fn set_pa_beg_1(&mut self, val: u16) {
3069 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
3070 }
3071 #[doc = "Protected area end address for bank 1"]
3072 pub const fn pa_end_1(&self) -> u16 {
3073 let val = (self.0 >> 16usize) & 0x0fff;
3074 val as u16
3075 }
3076 #[doc = "Protected area end address for bank 1"]
3077 pub fn set_pa_end_1(&mut self, val: u16) {
3078 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
3079 }
3080 }
3081 impl Default for Ur6 {
3082 fn default() -> Ur6 {
3083 Ur6(0)
3084 }
3085 }
3086 #[doc = "external interrupt configuration register 2"]
3087 #[repr(transparent)]
3088 #[derive(Copy, Clone, Eq, PartialEq)]
3089 pub struct Exticr(pub u32);
3090 impl Exticr {
3091 #[doc = "EXTI x configuration (x = 4 to 7)"]
3092 pub fn exti(&self, n: usize) -> u8 {
3093 assert!(n < 4usize);
3094 let offs = 0usize + n * 4usize;
3095 let val = (self.0 >> offs) & 0x0f;
3096 val as u8
3097 }
3098 #[doc = "EXTI x configuration (x = 4 to 7)"]
3099 pub fn set_exti(&mut self, n: usize, val: u8) {
3100 assert!(n < 4usize);
3101 let offs = 0usize + n * 4usize;
3102 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
3103 }
3104 }
3105 impl Default for Exticr {
3106 fn default() -> Exticr {
3107 Exticr(0)
3108 }
3109 }
3110 #[doc = "SYSCFG compensation cell value register"]
3111 #[repr(transparent)] 5091 #[repr(transparent)]
3112 #[derive(Copy, Clone, Eq, PartialEq)] 5092 #[derive(Copy, Clone, Eq, PartialEq)]
3113 pub struct Ccvr(pub u32); 5093 pub struct Ur13(pub u32);
3114 impl Ccvr { 5094 impl Ur13 {
3115 #[doc = "NMOS compensation value"] 5095 #[doc = "Secured DTCM RAM Size"]
3116 pub const fn ncv(&self) -> u8 { 5096 pub const fn sdrs(&self) -> u8 {
3117 let val = (self.0 >> 0usize) & 0x0f; 5097 let val = (self.0 >> 0usize) & 0x03;
3118 val as u8 5098 val as u8
3119 } 5099 }
3120 #[doc = "NMOS compensation value"] 5100 #[doc = "Secured DTCM RAM Size"]
3121 pub fn set_ncv(&mut self, val: u8) { 5101 pub fn set_sdrs(&mut self, val: u8) {
3122 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 5102 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
3123 } 5103 }
3124 #[doc = "PMOS compensation value"] 5104 #[doc = "D1 Standby reset"]
3125 pub const fn pcv(&self) -> u8 { 5105 pub const fn d1sbrst(&self) -> bool {
3126 let val = (self.0 >> 4usize) & 0x0f; 5106 let val = (self.0 >> 16usize) & 0x01;
3127 val as u8 5107 val != 0
3128 } 5108 }
3129 #[doc = "PMOS compensation value"] 5109 #[doc = "D1 Standby reset"]
3130 pub fn set_pcv(&mut self, val: u8) { 5110 pub fn set_d1sbrst(&mut self, val: bool) {
3131 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); 5111 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
3132 } 5112 }
3133 } 5113 }
3134 impl Default for Ccvr { 5114 impl Default for Ur13 {
3135 fn default() -> Ccvr { 5115 fn default() -> Ur13 {
3136 Ccvr(0) 5116 Ur13(0)
3137 } 5117 }
3138 } 5118 }
3139 #[doc = "peripheral mode configuration register"] 5119 #[doc = "peripheral mode configuration register"]
@@ -3282,1043 +5262,752 @@ pub mod syscfg_h7 {
3282 Pmcr(0) 5262 Pmcr(0)
3283 } 5263 }
3284 } 5264 }
3285 #[doc = "SYSCFG power control register"] 5265 #[doc = "SYSCFG user register 8"]
3286 #[repr(transparent)]
3287 #[derive(Copy, Clone, Eq, PartialEq)]
3288 pub struct Pwrcr(pub u32);
3289 impl Pwrcr {
3290 #[doc = "Overdrive enable"]
3291 pub const fn oden(&self) -> u8 {
3292 let val = (self.0 >> 0usize) & 0x0f;
3293 val as u8
3294 }
3295 #[doc = "Overdrive enable"]
3296 pub fn set_oden(&mut self, val: u8) {
3297 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
3298 }
3299 }
3300 impl Default for Pwrcr {
3301 fn default() -> Pwrcr {
3302 Pwrcr(0)
3303 }
3304 }
3305 }
3306}
3307pub mod rng_v1 {
3308 use crate::generic::*;
3309 #[doc = "Random number generator"]
3310 #[derive(Copy, Clone)]
3311 pub struct Rng(pub *mut u8);
3312 unsafe impl Send for Rng {}
3313 unsafe impl Sync for Rng {}
3314 impl Rng {
3315 #[doc = "control register"]
3316 pub fn cr(self) -> Reg<regs::Cr, RW> {
3317 unsafe { Reg::from_ptr(self.0.add(0usize)) }
3318 }
3319 #[doc = "status register"]
3320 pub fn sr(self) -> Reg<regs::Sr, RW> {
3321 unsafe { Reg::from_ptr(self.0.add(4usize)) }
3322 }
3323 #[doc = "data register"]
3324 pub fn dr(self) -> Reg<u32, R> {
3325 unsafe { Reg::from_ptr(self.0.add(8usize)) }
3326 }
3327 }
3328 pub mod regs {
3329 use crate::generic::*;
3330 #[doc = "status register"]
3331 #[repr(transparent)] 5266 #[repr(transparent)]
3332 #[derive(Copy, Clone, Eq, PartialEq)] 5267 #[derive(Copy, Clone, Eq, PartialEq)]
3333 pub struct Sr(pub u32); 5268 pub struct Ur8(pub u32);
3334 impl Sr { 5269 impl Ur8 {
3335 #[doc = "Data ready"] 5270 #[doc = "Mass erase protected area disabled for bank 2"]
3336 pub const fn drdy(&self) -> bool { 5271 pub const fn mepad_2(&self) -> bool {
3337 let val = (self.0 >> 0usize) & 0x01; 5272 let val = (self.0 >> 0usize) & 0x01;
3338 val != 0 5273 val != 0
3339 } 5274 }
3340 #[doc = "Data ready"] 5275 #[doc = "Mass erase protected area disabled for bank 2"]
3341 pub fn set_drdy(&mut self, val: bool) { 5276 pub fn set_mepad_2(&mut self, val: bool) {
3342 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5277 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3343 } 5278 }
3344 #[doc = "Clock error current status"] 5279 #[doc = "Mass erase secured area disabled for bank 2"]
3345 pub const fn cecs(&self) -> bool { 5280 pub const fn mesad_2(&self) -> bool {
3346 let val = (self.0 >> 1usize) & 0x01; 5281 let val = (self.0 >> 16usize) & 0x01;
3347 val != 0 5282 val != 0
3348 } 5283 }
3349 #[doc = "Clock error current status"] 5284 #[doc = "Mass erase secured area disabled for bank 2"]
3350 pub fn set_cecs(&mut self, val: bool) { 5285 pub fn set_mesad_2(&mut self, val: bool) {
3351 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5286 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
3352 }
3353 #[doc = "Seed error current status"]
3354 pub const fn secs(&self) -> bool {
3355 let val = (self.0 >> 2usize) & 0x01;
3356 val != 0
3357 } 5287 }
3358 #[doc = "Seed error current status"] 5288 }
3359 pub fn set_secs(&mut self, val: bool) { 5289 impl Default for Ur8 {
3360 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5290 fn default() -> Ur8 {
5291 Ur8(0)
3361 } 5292 }
3362 #[doc = "Clock error interrupt status"] 5293 }
3363 pub const fn ceis(&self) -> bool { 5294 #[doc = "SYSCFG compensation cell code register"]
3364 let val = (self.0 >> 5usize) & 0x01; 5295 #[repr(transparent)]
3365 val != 0 5296 #[derive(Copy, Clone, Eq, PartialEq)]
5297 pub struct Cccr(pub u32);
5298 impl Cccr {
5299 #[doc = "NMOS compensation code"]
5300 pub const fn ncc(&self) -> u8 {
5301 let val = (self.0 >> 0usize) & 0x0f;
5302 val as u8
3366 } 5303 }
3367 #[doc = "Clock error interrupt status"] 5304 #[doc = "NMOS compensation code"]
3368 pub fn set_ceis(&mut self, val: bool) { 5305 pub fn set_ncc(&mut self, val: u8) {
3369 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5306 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
3370 } 5307 }
3371 #[doc = "Seed error interrupt status"] 5308 #[doc = "PMOS compensation code"]
3372 pub const fn seis(&self) -> bool { 5309 pub const fn pcc(&self) -> u8 {
3373 let val = (self.0 >> 6usize) & 0x01; 5310 let val = (self.0 >> 4usize) & 0x0f;
3374 val != 0 5311 val as u8
3375 } 5312 }
3376 #[doc = "Seed error interrupt status"] 5313 #[doc = "PMOS compensation code"]
3377 pub fn set_seis(&mut self, val: bool) { 5314 pub fn set_pcc(&mut self, val: u8) {
3378 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5315 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
3379 } 5316 }
3380 } 5317 }
3381 impl Default for Sr { 5318 impl Default for Cccr {
3382 fn default() -> Sr { 5319 fn default() -> Cccr {
3383 Sr(0) 5320 Cccr(0)
3384 } 5321 }
3385 } 5322 }
3386 #[doc = "control register"] 5323 #[doc = "SYSCFG user register 12"]
3387 #[repr(transparent)] 5324 #[repr(transparent)]
3388 #[derive(Copy, Clone, Eq, PartialEq)] 5325 #[derive(Copy, Clone, Eq, PartialEq)]
3389 pub struct Cr(pub u32); 5326 pub struct Ur12(pub u32);
3390 impl Cr { 5327 impl Ur12 {
3391 #[doc = "Random number generator enable"] 5328 #[doc = "Secure mode"]
3392 pub const fn rngen(&self) -> bool { 5329 pub const fn secure(&self) -> bool {
3393 let val = (self.0 >> 2usize) & 0x01; 5330 let val = (self.0 >> 16usize) & 0x01;
3394 val != 0
3395 }
3396 #[doc = "Random number generator enable"]
3397 pub fn set_rngen(&mut self, val: bool) {
3398 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
3399 }
3400 #[doc = "Interrupt enable"]
3401 pub const fn ie(&self) -> bool {
3402 let val = (self.0 >> 3usize) & 0x01;
3403 val != 0 5331 val != 0
3404 } 5332 }
3405 #[doc = "Interrupt enable"] 5333 #[doc = "Secure mode"]
3406 pub fn set_ie(&mut self, val: bool) { 5334 pub fn set_secure(&mut self, val: bool) {
3407 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 5335 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
3408 } 5336 }
3409 } 5337 }
3410 impl Default for Cr { 5338 impl Default for Ur12 {
3411 fn default() -> Cr { 5339 fn default() -> Ur12 {
3412 Cr(0) 5340 Ur12(0)
3413 } 5341 }
3414 } 5342 }
3415 } 5343 #[doc = "SYSCFG user register 17"]
3416}
3417pub mod usart_v1 {
3418 use crate::generic::*;
3419 #[doc = "Universal synchronous asynchronous receiver transmitter"]
3420 #[derive(Copy, Clone)]
3421 pub struct Usart(pub *mut u8);
3422 unsafe impl Send for Usart {}
3423 unsafe impl Sync for Usart {}
3424 impl Usart {
3425 #[doc = "Status register"]
3426 pub fn sr(self) -> Reg<regs::Sr, RW> {
3427 unsafe { Reg::from_ptr(self.0.add(0usize)) }
3428 }
3429 #[doc = "Data register"]
3430 pub fn dr(self) -> Reg<regs::Dr, RW> {
3431 unsafe { Reg::from_ptr(self.0.add(4usize)) }
3432 }
3433 #[doc = "Baud rate register"]
3434 pub fn brr(self) -> Reg<regs::Brr, RW> {
3435 unsafe { Reg::from_ptr(self.0.add(8usize)) }
3436 }
3437 #[doc = "Control register 1"]
3438 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
3439 unsafe { Reg::from_ptr(self.0.add(12usize)) }
3440 }
3441 #[doc = "Control register 2"]
3442 pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> {
3443 unsafe { Reg::from_ptr(self.0.add(16usize)) }
3444 }
3445 #[doc = "Control register 3"]
3446 pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> {
3447 unsafe { Reg::from_ptr(self.0.add(20usize)) }
3448 }
3449 #[doc = "Guard time and prescaler register"]
3450 pub fn gtpr(self) -> Reg<regs::Gtpr, RW> {
3451 unsafe { Reg::from_ptr(self.0.add(24usize)) }
3452 }
3453 }
3454 #[doc = "Universal asynchronous receiver transmitter"]
3455 #[derive(Copy, Clone)]
3456 pub struct Uart(pub *mut u8);
3457 unsafe impl Send for Uart {}
3458 unsafe impl Sync for Uart {}
3459 impl Uart {
3460 #[doc = "Status register"]
3461 pub fn sr(self) -> Reg<regs::Sr, RW> {
3462 unsafe { Reg::from_ptr(self.0.add(0usize)) }
3463 }
3464 #[doc = "Data register"]
3465 pub fn dr(self) -> Reg<regs::Dr, RW> {
3466 unsafe { Reg::from_ptr(self.0.add(4usize)) }
3467 }
3468 #[doc = "Baud rate register"]
3469 pub fn brr(self) -> Reg<regs::Brr, RW> {
3470 unsafe { Reg::from_ptr(self.0.add(8usize)) }
3471 }
3472 #[doc = "Control register 1"]
3473 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
3474 unsafe { Reg::from_ptr(self.0.add(12usize)) }
3475 }
3476 #[doc = "Control register 2"]
3477 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
3478 unsafe { Reg::from_ptr(self.0.add(16usize)) }
3479 }
3480 #[doc = "Control register 3"]
3481 pub fn cr3(self) -> Reg<regs::Cr3, RW> {
3482 unsafe { Reg::from_ptr(self.0.add(20usize)) }
3483 }
3484 }
3485 pub mod vals {
3486 use crate::generic::*;
3487 #[repr(transparent)]
3488 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3489 pub struct M(pub u8);
3490 impl M {
3491 #[doc = "8 data bits"]
3492 pub const M8: Self = Self(0);
3493 #[doc = "9 data bits"]
3494 pub const M9: Self = Self(0x01);
3495 }
3496 #[repr(transparent)]
3497 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3498 pub struct Cpha(pub u8);
3499 impl Cpha {
3500 #[doc = "The first clock transition is the first data capture edge"]
3501 pub const FIRST: Self = Self(0);
3502 #[doc = "The second clock transition is the first data capture edge"]
3503 pub const SECOND: Self = Self(0x01);
3504 }
3505 #[repr(transparent)]
3506 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3507 pub struct Irlp(pub u8);
3508 impl Irlp {
3509 #[doc = "Normal mode"]
3510 pub const NORMAL: Self = Self(0);
3511 #[doc = "Low-power mode"]
3512 pub const LOWPOWER: Self = Self(0x01);
3513 }
3514 #[repr(transparent)]
3515 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3516 pub struct Lbdl(pub u8);
3517 impl Lbdl {
3518 #[doc = "10-bit break detection"]
3519 pub const LBDL10: Self = Self(0);
3520 #[doc = "11-bit break detection"]
3521 pub const LBDL11: Self = Self(0x01);
3522 }
3523 #[repr(transparent)]
3524 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3525 pub struct Sbk(pub u8);
3526 impl Sbk {
3527 #[doc = "No break character is transmitted"]
3528 pub const NOBREAK: Self = Self(0);
3529 #[doc = "Break character transmitted"]
3530 pub const BREAK: Self = Self(0x01);
3531 }
3532 #[repr(transparent)]
3533 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3534 pub struct Hdsel(pub u8);
3535 impl Hdsel {
3536 #[doc = "Half duplex mode is not selected"]
3537 pub const FULLDUPLEX: Self = Self(0);
3538 #[doc = "Half duplex mode is selected"]
3539 pub const HALFDUPLEX: Self = Self(0x01);
3540 }
3541 #[repr(transparent)]
3542 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3543 pub struct Rwu(pub u8);
3544 impl Rwu {
3545 #[doc = "Receiver in active mode"]
3546 pub const ACTIVE: Self = Self(0);
3547 #[doc = "Receiver in mute mode"]
3548 pub const MUTE: Self = Self(0x01);
3549 }
3550 #[repr(transparent)]
3551 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3552 pub struct Wake(pub u8);
3553 impl Wake {
3554 #[doc = "USART wakeup on idle line"]
3555 pub const IDLELINE: Self = Self(0);
3556 #[doc = "USART wakeup on address mark"]
3557 pub const ADDRESSMARK: Self = Self(0x01);
3558 }
3559 #[repr(transparent)]
3560 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3561 pub struct Stop(pub u8);
3562 impl Stop {
3563 #[doc = "1 stop bit"]
3564 pub const STOP1: Self = Self(0);
3565 #[doc = "0.5 stop bits"]
3566 pub const STOP0P5: Self = Self(0x01);
3567 #[doc = "2 stop bits"]
3568 pub const STOP2: Self = Self(0x02);
3569 #[doc = "1.5 stop bits"]
3570 pub const STOP1P5: Self = Self(0x03);
3571 }
3572 #[repr(transparent)]
3573 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3574 pub struct Ps(pub u8);
3575 impl Ps {
3576 #[doc = "Even parity"]
3577 pub const EVEN: Self = Self(0);
3578 #[doc = "Odd parity"]
3579 pub const ODD: Self = Self(0x01);
3580 }
3581 #[repr(transparent)]
3582 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
3583 pub struct Cpol(pub u8);
3584 impl Cpol {
3585 #[doc = "Steady low value on CK pin outside transmission window"]
3586 pub const LOW: Self = Self(0);
3587 #[doc = "Steady high value on CK pin outside transmission window"]
3588 pub const HIGH: Self = Self(0x01);
3589 }
3590 }
3591 pub mod regs {
3592 use crate::generic::*;
3593 #[doc = "Control register 3"]
3594 #[repr(transparent)] 5344 #[repr(transparent)]
3595 #[derive(Copy, Clone, Eq, PartialEq)] 5345 #[derive(Copy, Clone, Eq, PartialEq)]
3596 pub struct Cr3Usart(pub u32); 5346 pub struct Ur17(pub u32);
3597 impl Cr3Usart { 5347 impl Ur17 {
3598 #[doc = "Error interrupt enable"] 5348 #[doc = "I/O high speed / low voltage"]
3599 pub const fn eie(&self) -> bool { 5349 pub const fn io_hslv(&self) -> bool {
3600 let val = (self.0 >> 0usize) & 0x01; 5350 let val = (self.0 >> 0usize) & 0x01;
3601 val != 0 5351 val != 0
3602 } 5352 }
3603 #[doc = "Error interrupt enable"] 5353 #[doc = "I/O high speed / low voltage"]
3604 pub fn set_eie(&mut self, val: bool) { 5354 pub fn set_io_hslv(&mut self, val: bool) {
3605 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5355 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3606 } 5356 }
3607 #[doc = "IrDA mode enable"] 5357 }
3608 pub const fn iren(&self) -> bool { 5358 impl Default for Ur17 {
3609 let val = (self.0 >> 1usize) & 0x01; 5359 fn default() -> Ur17 {
3610 val != 0 5360 Ur17(0)
3611 }
3612 #[doc = "IrDA mode enable"]
3613 pub fn set_iren(&mut self, val: bool) {
3614 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
3615 }
3616 #[doc = "IrDA low-power"]
3617 pub const fn irlp(&self) -> super::vals::Irlp {
3618 let val = (self.0 >> 2usize) & 0x01;
3619 super::vals::Irlp(val as u8)
3620 }
3621 #[doc = "IrDA low-power"]
3622 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
3623 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
3624 }
3625 #[doc = "Half-duplex selection"]
3626 pub const fn hdsel(&self) -> super::vals::Hdsel {
3627 let val = (self.0 >> 3usize) & 0x01;
3628 super::vals::Hdsel(val as u8)
3629 }
3630 #[doc = "Half-duplex selection"]
3631 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
3632 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
3633 }
3634 #[doc = "Smartcard NACK enable"]
3635 pub const fn nack(&self) -> bool {
3636 let val = (self.0 >> 4usize) & 0x01;
3637 val != 0
3638 }
3639 #[doc = "Smartcard NACK enable"]
3640 pub fn set_nack(&mut self, val: bool) {
3641 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
3642 }
3643 #[doc = "Smartcard mode enable"]
3644 pub const fn scen(&self) -> bool {
3645 let val = (self.0 >> 5usize) & 0x01;
3646 val != 0
3647 }
3648 #[doc = "Smartcard mode enable"]
3649 pub fn set_scen(&mut self, val: bool) {
3650 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
3651 }
3652 #[doc = "DMA enable receiver"]
3653 pub const fn dmar(&self) -> bool {
3654 let val = (self.0 >> 6usize) & 0x01;
3655 val != 0
3656 }
3657 #[doc = "DMA enable receiver"]
3658 pub fn set_dmar(&mut self, val: bool) {
3659 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
3660 }
3661 #[doc = "DMA enable transmitter"]
3662 pub const fn dmat(&self) -> bool {
3663 let val = (self.0 >> 7usize) & 0x01;
3664 val != 0
3665 }
3666 #[doc = "DMA enable transmitter"]
3667 pub fn set_dmat(&mut self, val: bool) {
3668 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
3669 }
3670 #[doc = "RTS enable"]
3671 pub const fn rtse(&self) -> bool {
3672 let val = (self.0 >> 8usize) & 0x01;
3673 val != 0
3674 }
3675 #[doc = "RTS enable"]
3676 pub fn set_rtse(&mut self, val: bool) {
3677 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
3678 }
3679 #[doc = "CTS enable"]
3680 pub const fn ctse(&self) -> bool {
3681 let val = (self.0 >> 9usize) & 0x01;
3682 val != 0
3683 }
3684 #[doc = "CTS enable"]
3685 pub fn set_ctse(&mut self, val: bool) {
3686 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
3687 } 5361 }
3688 #[doc = "CTS interrupt enable"] 5362 }
3689 pub const fn ctsie(&self) -> bool { 5363 #[doc = "SYSCFG user register 14"]
3690 let val = (self.0 >> 10usize) & 0x01; 5364 #[repr(transparent)]
5365 #[derive(Copy, Clone, Eq, PartialEq)]
5366 pub struct Ur14(pub u32);
5367 impl Ur14 {
5368 #[doc = "D1 Stop Reset"]
5369 pub const fn d1stprst(&self) -> bool {
5370 let val = (self.0 >> 0usize) & 0x01;
3691 val != 0 5371 val != 0
3692 } 5372 }
3693 #[doc = "CTS interrupt enable"] 5373 #[doc = "D1 Stop Reset"]
3694 pub fn set_ctsie(&mut self, val: bool) { 5374 pub fn set_d1stprst(&mut self, val: bool) {
3695 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 5375 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3696 } 5376 }
3697 } 5377 }
3698 impl Default for Cr3Usart { 5378 impl Default for Ur14 {
3699 fn default() -> Cr3Usart { 5379 fn default() -> Ur14 {
3700 Cr3Usart(0) 5380 Ur14(0)
3701 } 5381 }
3702 } 5382 }
3703 #[doc = "Control register 3"] 5383 #[doc = "SYSCFG user register 5"]
3704 #[repr(transparent)] 5384 #[repr(transparent)]
3705 #[derive(Copy, Clone, Eq, PartialEq)] 5385 #[derive(Copy, Clone, Eq, PartialEq)]
3706 pub struct Cr3(pub u32); 5386 pub struct Ur5(pub u32);
3707 impl Cr3 { 5387 impl Ur5 {
3708 #[doc = "Error interrupt enable"] 5388 #[doc = "Mass erase secured area disabled for bank 1"]
3709 pub const fn eie(&self) -> bool { 5389 pub const fn mesad_1(&self) -> bool {
3710 let val = (self.0 >> 0usize) & 0x01; 5390 let val = (self.0 >> 0usize) & 0x01;
3711 val != 0 5391 val != 0
3712 } 5392 }
3713 #[doc = "Error interrupt enable"] 5393 #[doc = "Mass erase secured area disabled for bank 1"]
3714 pub fn set_eie(&mut self, val: bool) { 5394 pub fn set_mesad_1(&mut self, val: bool) {
3715 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5395 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3716 } 5396 }
3717 #[doc = "IrDA mode enable"] 5397 #[doc = "Write protection for flash bank 1"]
3718 pub const fn iren(&self) -> bool { 5398 pub const fn wrpn_1(&self) -> u8 {
3719 let val = (self.0 >> 1usize) & 0x01; 5399 let val = (self.0 >> 16usize) & 0xff;
3720 val != 0 5400 val as u8
3721 } 5401 }
3722 #[doc = "IrDA mode enable"] 5402 #[doc = "Write protection for flash bank 1"]
3723 pub fn set_iren(&mut self, val: bool) { 5403 pub fn set_wrpn_1(&mut self, val: u8) {
3724 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5404 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
3725 } 5405 }
3726 #[doc = "IrDA low-power"] 5406 }
3727 pub const fn irlp(&self) -> super::vals::Irlp { 5407 impl Default for Ur5 {
3728 let val = (self.0 >> 2usize) & 0x01; 5408 fn default() -> Ur5 {
3729 super::vals::Irlp(val as u8) 5409 Ur5(0)
3730 } 5410 }
3731 #[doc = "IrDA low-power"] 5411 }
3732 pub fn set_irlp(&mut self, val: super::vals::Irlp) { 5412 #[doc = "external interrupt configuration register 2"]
3733 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 5413 #[repr(transparent)]
5414 #[derive(Copy, Clone, Eq, PartialEq)]
5415 pub struct Exticr(pub u32);
5416 impl Exticr {
5417 #[doc = "EXTI x configuration (x = 4 to 7)"]
5418 pub fn exti(&self, n: usize) -> u8 {
5419 assert!(n < 4usize);
5420 let offs = 0usize + n * 4usize;
5421 let val = (self.0 >> offs) & 0x0f;
5422 val as u8
3734 } 5423 }
3735 #[doc = "Half-duplex selection"] 5424 #[doc = "EXTI x configuration (x = 4 to 7)"]
3736 pub const fn hdsel(&self) -> super::vals::Hdsel { 5425 pub fn set_exti(&mut self, n: usize, val: u8) {
3737 let val = (self.0 >> 3usize) & 0x01; 5426 assert!(n < 4usize);
3738 super::vals::Hdsel(val as u8) 5427 let offs = 0usize + n * 4usize;
5428 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
3739 } 5429 }
3740 #[doc = "Half-duplex selection"] 5430 }
3741 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) { 5431 impl Default for Exticr {
3742 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 5432 fn default() -> Exticr {
5433 Exticr(0)
3743 } 5434 }
3744 #[doc = "DMA enable receiver"] 5435 }
3745 pub const fn dmar(&self) -> bool { 5436 #[doc = "SYSCFG user register 10"]
3746 let val = (self.0 >> 6usize) & 0x01; 5437 #[repr(transparent)]
3747 val != 0 5438 #[derive(Copy, Clone, Eq, PartialEq)]
5439 pub struct Ur10(pub u32);
5440 impl Ur10 {
5441 #[doc = "Protected area end address for bank 2"]
5442 pub const fn pa_end_2(&self) -> u16 {
5443 let val = (self.0 >> 0usize) & 0x0fff;
5444 val as u16
3748 } 5445 }
3749 #[doc = "DMA enable receiver"] 5446 #[doc = "Protected area end address for bank 2"]
3750 pub fn set_dmar(&mut self, val: bool) { 5447 pub fn set_pa_end_2(&mut self, val: u16) {
3751 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5448 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
3752 } 5449 }
3753 #[doc = "DMA enable transmitter"] 5450 #[doc = "Secured area start address for bank 2"]
3754 pub const fn dmat(&self) -> bool { 5451 pub const fn sa_beg_2(&self) -> u16 {
3755 let val = (self.0 >> 7usize) & 0x01; 5452 let val = (self.0 >> 16usize) & 0x0fff;
3756 val != 0 5453 val as u16
3757 } 5454 }
3758 #[doc = "DMA enable transmitter"] 5455 #[doc = "Secured area start address for bank 2"]
3759 pub fn set_dmat(&mut self, val: bool) { 5456 pub fn set_sa_beg_2(&mut self, val: u16) {
3760 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 5457 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
3761 } 5458 }
3762 } 5459 }
3763 impl Default for Cr3 { 5460 impl Default for Ur10 {
3764 fn default() -> Cr3 { 5461 fn default() -> Ur10 {
3765 Cr3(0) 5462 Ur10(0)
3766 } 5463 }
3767 } 5464 }
3768 #[doc = "Baud rate register"] 5465 #[doc = "SYSCFG power control register"]
3769 #[repr(transparent)] 5466 #[repr(transparent)]
3770 #[derive(Copy, Clone, Eq, PartialEq)] 5467 #[derive(Copy, Clone, Eq, PartialEq)]
3771 pub struct Brr(pub u32); 5468 pub struct Pwrcr(pub u32);
3772 impl Brr { 5469 impl Pwrcr {
3773 #[doc = "fraction of USARTDIV"] 5470 #[doc = "Overdrive enable"]
3774 pub const fn div_fraction(&self) -> u8 { 5471 pub const fn oden(&self) -> u8 {
3775 let val = (self.0 >> 0usize) & 0x0f; 5472 let val = (self.0 >> 0usize) & 0x0f;
3776 val as u8 5473 val as u8
3777 } 5474 }
3778 #[doc = "fraction of USARTDIV"] 5475 #[doc = "Overdrive enable"]
3779 pub fn set_div_fraction(&mut self, val: u8) { 5476 pub fn set_oden(&mut self, val: u8) {
3780 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 5477 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
3781 } 5478 }
3782 #[doc = "mantissa of USARTDIV"]
3783 pub const fn div_mantissa(&self) -> u16 {
3784 let val = (self.0 >> 4usize) & 0x0fff;
3785 val as u16
3786 }
3787 #[doc = "mantissa of USARTDIV"]
3788 pub fn set_div_mantissa(&mut self, val: u16) {
3789 self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize);
3790 }
3791 } 5479 }
3792 impl Default for Brr { 5480 impl Default for Pwrcr {
3793 fn default() -> Brr { 5481 fn default() -> Pwrcr {
3794 Brr(0) 5482 Pwrcr(0)
3795 } 5483 }
3796 } 5484 }
3797 #[doc = "Control register 1"] 5485 #[doc = "compensation cell control/status register"]
3798 #[repr(transparent)] 5486 #[repr(transparent)]
3799 #[derive(Copy, Clone, Eq, PartialEq)] 5487 #[derive(Copy, Clone, Eq, PartialEq)]
3800 pub struct Cr1(pub u32); 5488 pub struct Cccsr(pub u32);
3801 impl Cr1 { 5489 impl Cccsr {
3802 #[doc = "Send break"] 5490 #[doc = "enable"]
3803 pub const fn sbk(&self) -> super::vals::Sbk { 5491 pub const fn en(&self) -> bool {
3804 let val = (self.0 >> 0usize) & 0x01; 5492 let val = (self.0 >> 0usize) & 0x01;
3805 super::vals::Sbk(val as u8) 5493 val != 0
3806 } 5494 }
3807 #[doc = "Send break"] 5495 #[doc = "enable"]
3808 pub fn set_sbk(&mut self, val: super::vals::Sbk) { 5496 pub fn set_en(&mut self, val: bool) {
3809 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize); 5497 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3810 } 5498 }
3811 #[doc = "Receiver wakeup"] 5499 #[doc = "Code selection"]
3812 pub const fn rwu(&self) -> super::vals::Rwu { 5500 pub const fn cs(&self) -> bool {
3813 let val = (self.0 >> 1usize) & 0x01; 5501 let val = (self.0 >> 1usize) & 0x01;
3814 super::vals::Rwu(val as u8) 5502 val != 0
3815 } 5503 }
3816 #[doc = "Receiver wakeup"] 5504 #[doc = "Code selection"]
3817 pub fn set_rwu(&mut self, val: super::vals::Rwu) { 5505 pub fn set_cs(&mut self, val: bool) {
3818 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize); 5506 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
3819 } 5507 }
3820 #[doc = "Receiver enable"] 5508 #[doc = "Compensation cell ready flag"]
3821 pub const fn re(&self) -> bool { 5509 pub const fn ready(&self) -> bool {
3822 let val = (self.0 >> 2usize) & 0x01; 5510 let val = (self.0 >> 8usize) & 0x01;
3823 val != 0 5511 val != 0
3824 } 5512 }
3825 #[doc = "Receiver enable"] 5513 #[doc = "Compensation cell ready flag"]
3826 pub fn set_re(&mut self, val: bool) { 5514 pub fn set_ready(&mut self, val: bool) {
3827 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5515 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
3828 } 5516 }
3829 #[doc = "Transmitter enable"] 5517 #[doc = "High-speed at low-voltage"]
3830 pub const fn te(&self) -> bool { 5518 pub const fn hslv(&self) -> bool {
3831 let val = (self.0 >> 3usize) & 0x01; 5519 let val = (self.0 >> 16usize) & 0x01;
3832 val != 0 5520 val != 0
3833 } 5521 }
3834 #[doc = "Transmitter enable"] 5522 #[doc = "High-speed at low-voltage"]
3835 pub fn set_te(&mut self, val: bool) { 5523 pub fn set_hslv(&mut self, val: bool) {
3836 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 5524 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
3837 } 5525 }
3838 #[doc = "IDLE interrupt enable"] 5526 }
3839 pub const fn idleie(&self) -> bool { 5527 impl Default for Cccsr {
3840 let val = (self.0 >> 4usize) & 0x01; 5528 fn default() -> Cccsr {
3841 val != 0 5529 Cccsr(0)
3842 } 5530 }
3843 #[doc = "IDLE interrupt enable"] 5531 }
3844 pub fn set_idleie(&mut self, val: bool) { 5532 #[doc = "SYSCFG user register 6"]
3845 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize); 5533 #[repr(transparent)]
5534 #[derive(Copy, Clone, Eq, PartialEq)]
5535 pub struct Ur6(pub u32);
5536 impl Ur6 {
5537 #[doc = "Protected area start address for bank 1"]
5538 pub const fn pa_beg_1(&self) -> u16 {
5539 let val = (self.0 >> 0usize) & 0x0fff;
5540 val as u16
3846 } 5541 }
3847 #[doc = "RXNE interrupt enable"] 5542 #[doc = "Protected area start address for bank 1"]
3848 pub const fn rxneie(&self) -> bool { 5543 pub fn set_pa_beg_1(&mut self, val: u16) {
3849 let val = (self.0 >> 5usize) & 0x01; 5544 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
3850 val != 0
3851 } 5545 }
3852 #[doc = "RXNE interrupt enable"] 5546 #[doc = "Protected area end address for bank 1"]
3853 pub fn set_rxneie(&mut self, val: bool) { 5547 pub const fn pa_end_1(&self) -> u16 {
3854 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5548 let val = (self.0 >> 16usize) & 0x0fff;
5549 val as u16
3855 } 5550 }
3856 #[doc = "Transmission complete interrupt enable"] 5551 #[doc = "Protected area end address for bank 1"]
3857 pub const fn tcie(&self) -> bool { 5552 pub fn set_pa_end_1(&mut self, val: u16) {
3858 let val = (self.0 >> 6usize) & 0x01; 5553 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
3859 val != 0
3860 } 5554 }
3861 #[doc = "Transmission complete interrupt enable"] 5555 }
3862 pub fn set_tcie(&mut self, val: bool) { 5556 impl Default for Ur6 {
3863 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5557 fn default() -> Ur6 {
5558 Ur6(0)
3864 } 5559 }
3865 #[doc = "TXE interrupt enable"] 5560 }
3866 pub const fn txeie(&self) -> bool { 5561 #[doc = "SYSCFG user register 2"]
3867 let val = (self.0 >> 7usize) & 0x01; 5562 #[repr(transparent)]
3868 val != 0 5563 #[derive(Copy, Clone, Eq, PartialEq)]
5564 pub struct Ur2(pub u32);
5565 impl Ur2 {
5566 #[doc = "BOR_LVL Brownout Reset Threshold Level"]
5567 pub const fn borh(&self) -> u8 {
5568 let val = (self.0 >> 0usize) & 0x03;
5569 val as u8
3869 } 5570 }
3870 #[doc = "TXE interrupt enable"] 5571 #[doc = "BOR_LVL Brownout Reset Threshold Level"]
3871 pub fn set_txeie(&mut self, val: bool) { 5572 pub fn set_borh(&mut self, val: u8) {
3872 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 5573 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
3873 } 5574 }
3874 #[doc = "PE interrupt enable"] 5575 #[doc = "Boot Address 0"]
3875 pub const fn peie(&self) -> bool { 5576 pub const fn boot_add0(&self) -> u16 {
3876 let val = (self.0 >> 8usize) & 0x01; 5577 let val = (self.0 >> 16usize) & 0xffff;
3877 val != 0 5578 val as u16
3878 } 5579 }
3879 #[doc = "PE interrupt enable"] 5580 #[doc = "Boot Address 0"]
3880 pub fn set_peie(&mut self, val: bool) { 5581 pub fn set_boot_add0(&mut self, val: u16) {
3881 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 5582 self.0 = (self.0 & !(0xffff << 16usize)) | (((val as u32) & 0xffff) << 16usize);
3882 } 5583 }
3883 #[doc = "Parity selection"] 5584 }
3884 pub const fn ps(&self) -> super::vals::Ps { 5585 impl Default for Ur2 {
3885 let val = (self.0 >> 9usize) & 0x01; 5586 fn default() -> Ur2 {
3886 super::vals::Ps(val as u8) 5587 Ur2(0)
3887 } 5588 }
3888 #[doc = "Parity selection"] 5589 }
3889 pub fn set_ps(&mut self, val: super::vals::Ps) { 5590 #[doc = "SYSCFG user register 9"]
3890 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 5591 #[repr(transparent)]
5592 #[derive(Copy, Clone, Eq, PartialEq)]
5593 pub struct Ur9(pub u32);
5594 impl Ur9 {
5595 #[doc = "Write protection for flash bank 2"]
5596 pub const fn wrpn_2(&self) -> u8 {
5597 let val = (self.0 >> 0usize) & 0xff;
5598 val as u8
3891 } 5599 }
3892 #[doc = "Parity control enable"] 5600 #[doc = "Write protection for flash bank 2"]
3893 pub const fn pce(&self) -> bool { 5601 pub fn set_wrpn_2(&mut self, val: u8) {
3894 let val = (self.0 >> 10usize) & 0x01; 5602 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
3895 val != 0
3896 } 5603 }
3897 #[doc = "Parity control enable"] 5604 #[doc = "Protected area start address for bank 2"]
3898 pub fn set_pce(&mut self, val: bool) { 5605 pub const fn pa_beg_2(&self) -> u16 {
3899 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 5606 let val = (self.0 >> 16usize) & 0x0fff;
5607 val as u16
3900 } 5608 }
3901 #[doc = "Wakeup method"] 5609 #[doc = "Protected area start address for bank 2"]
3902 pub const fn wake(&self) -> super::vals::Wake { 5610 pub fn set_pa_beg_2(&mut self, val: u16) {
3903 let val = (self.0 >> 11usize) & 0x01; 5611 self.0 = (self.0 & !(0x0fff << 16usize)) | (((val as u32) & 0x0fff) << 16usize);
3904 super::vals::Wake(val as u8)
3905 } 5612 }
3906 #[doc = "Wakeup method"] 5613 }
3907 pub fn set_wake(&mut self, val: super::vals::Wake) { 5614 impl Default for Ur9 {
3908 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 5615 fn default() -> Ur9 {
5616 Ur9(0)
3909 } 5617 }
3910 #[doc = "Word length"] 5618 }
3911 pub const fn m(&self) -> super::vals::M { 5619 #[doc = "SYSCFG user register 11"]
3912 let val = (self.0 >> 12usize) & 0x01; 5620 #[repr(transparent)]
3913 super::vals::M(val as u8) 5621 #[derive(Copy, Clone, Eq, PartialEq)]
5622 pub struct Ur11(pub u32);
5623 impl Ur11 {
5624 #[doc = "Secured area end address for bank 2"]
5625 pub const fn sa_end_2(&self) -> u16 {
5626 let val = (self.0 >> 0usize) & 0x0fff;
5627 val as u16
3914 } 5628 }
3915 #[doc = "Word length"] 5629 #[doc = "Secured area end address for bank 2"]
3916 pub fn set_m(&mut self, val: super::vals::M) { 5630 pub fn set_sa_end_2(&mut self, val: u16) {
3917 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize); 5631 self.0 = (self.0 & !(0x0fff << 0usize)) | (((val as u32) & 0x0fff) << 0usize);
3918 } 5632 }
3919 #[doc = "USART enable"] 5633 #[doc = "Independent Watchdog 1 mode"]
3920 pub const fn ue(&self) -> bool { 5634 pub const fn iwdg1m(&self) -> bool {
3921 let val = (self.0 >> 13usize) & 0x01; 5635 let val = (self.0 >> 16usize) & 0x01;
3922 val != 0 5636 val != 0
3923 } 5637 }
3924 #[doc = "USART enable"] 5638 #[doc = "Independent Watchdog 1 mode"]
3925 pub fn set_ue(&mut self, val: bool) { 5639 pub fn set_iwdg1m(&mut self, val: bool) {
3926 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 5640 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
3927 } 5641 }
3928 } 5642 }
3929 impl Default for Cr1 { 5643 impl Default for Ur11 {
3930 fn default() -> Cr1 { 5644 fn default() -> Ur11 {
3931 Cr1(0) 5645 Ur11(0)
3932 } 5646 }
3933 } 5647 }
3934 #[doc = "Guard time and prescaler register"] 5648 #[doc = "SYSCFG compensation cell value register"]
3935 #[repr(transparent)] 5649 #[repr(transparent)]
3936 #[derive(Copy, Clone, Eq, PartialEq)] 5650 #[derive(Copy, Clone, Eq, PartialEq)]
3937 pub struct Gtpr(pub u32); 5651 pub struct Ccvr(pub u32);
3938 impl Gtpr { 5652 impl Ccvr {
3939 #[doc = "Prescaler value"] 5653 #[doc = "NMOS compensation value"]
3940 pub const fn psc(&self) -> u8 { 5654 pub const fn ncv(&self) -> u8 {
3941 let val = (self.0 >> 0usize) & 0xff; 5655 let val = (self.0 >> 0usize) & 0x0f;
3942 val as u8 5656 val as u8
3943 } 5657 }
3944 #[doc = "Prescaler value"] 5658 #[doc = "NMOS compensation value"]
3945 pub fn set_psc(&mut self, val: u8) { 5659 pub fn set_ncv(&mut self, val: u8) {
3946 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 5660 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
3947 } 5661 }
3948 #[doc = "Guard time value"] 5662 #[doc = "PMOS compensation value"]
3949 pub const fn gt(&self) -> u8 { 5663 pub const fn pcv(&self) -> u8 {
3950 let val = (self.0 >> 8usize) & 0xff; 5664 let val = (self.0 >> 4usize) & 0x0f;
3951 val as u8 5665 val as u8
3952 } 5666 }
3953 #[doc = "Guard time value"] 5667 #[doc = "PMOS compensation value"]
3954 pub fn set_gt(&mut self, val: u8) { 5668 pub fn set_pcv(&mut self, val: u8) {
3955 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize); 5669 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
3956 } 5670 }
3957 } 5671 }
3958 impl Default for Gtpr { 5672 impl Default for Ccvr {
3959 fn default() -> Gtpr { 5673 fn default() -> Ccvr {
3960 Gtpr(0) 5674 Ccvr(0)
3961 } 5675 }
3962 } 5676 }
3963 #[doc = "Data register"] 5677 #[doc = "SYSCFG user register 0"]
3964 #[repr(transparent)] 5678 #[repr(transparent)]
3965 #[derive(Copy, Clone, Eq, PartialEq)] 5679 #[derive(Copy, Clone, Eq, PartialEq)]
3966 pub struct Dr(pub u32); 5680 pub struct Ur0(pub u32);
3967 impl Dr { 5681 impl Ur0 {
3968 #[doc = "Data value"] 5682 #[doc = "Bank Swap"]
3969 pub const fn dr(&self) -> u16 { 5683 pub const fn bks(&self) -> bool {
3970 let val = (self.0 >> 0usize) & 0x01ff; 5684 let val = (self.0 >> 0usize) & 0x01;
3971 val as u16 5685 val != 0
3972 } 5686 }
3973 #[doc = "Data value"] 5687 #[doc = "Bank Swap"]
3974 pub fn set_dr(&mut self, val: u16) { 5688 pub fn set_bks(&mut self, val: bool) {
3975 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize); 5689 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
5690 }
5691 #[doc = "Readout protection"]
5692 pub const fn rdp(&self) -> u8 {
5693 let val = (self.0 >> 16usize) & 0xff;
5694 val as u8
5695 }
5696 #[doc = "Readout protection"]
5697 pub fn set_rdp(&mut self, val: u8) {
5698 self.0 = (self.0 & !(0xff << 16usize)) | (((val as u32) & 0xff) << 16usize);
3976 } 5699 }
3977 } 5700 }
3978 impl Default for Dr { 5701 impl Default for Ur0 {
3979 fn default() -> Dr { 5702 fn default() -> Ur0 {
3980 Dr(0) 5703 Ur0(0)
3981 } 5704 }
3982 } 5705 }
3983 #[doc = "Status register"] 5706 #[doc = "SYSCFG user register 16"]
3984 #[repr(transparent)] 5707 #[repr(transparent)]
3985 #[derive(Copy, Clone, Eq, PartialEq)] 5708 #[derive(Copy, Clone, Eq, PartialEq)]
3986 pub struct Sr(pub u32); 5709 pub struct Ur16(pub u32);
3987 impl Sr { 5710 impl Ur16 {
3988 #[doc = "Parity error"] 5711 #[doc = "Freeze independent watchdog in Stop mode"]
3989 pub const fn pe(&self) -> bool { 5712 pub const fn fziwdgstp(&self) -> bool {
3990 let val = (self.0 >> 0usize) & 0x01; 5713 let val = (self.0 >> 0usize) & 0x01;
3991 val != 0 5714 val != 0
3992 } 5715 }
3993 #[doc = "Parity error"] 5716 #[doc = "Freeze independent watchdog in Stop mode"]
3994 pub fn set_pe(&mut self, val: bool) { 5717 pub fn set_fziwdgstp(&mut self, val: bool) {
3995 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5718 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
3996 } 5719 }
3997 #[doc = "Framing error"] 5720 #[doc = "Private key programmed"]
3998 pub const fn fe(&self) -> bool { 5721 pub const fn pkp(&self) -> bool {
3999 let val = (self.0 >> 1usize) & 0x01; 5722 let val = (self.0 >> 16usize) & 0x01;
4000 val != 0 5723 val != 0
4001 } 5724 }
4002 #[doc = "Framing error"] 5725 #[doc = "Private key programmed"]
4003 pub fn set_fe(&mut self, val: bool) { 5726 pub fn set_pkp(&mut self, val: bool) {
4004 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5727 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
4005 } 5728 }
4006 #[doc = "Noise error flag"] 5729 }
4007 pub const fn ne(&self) -> bool { 5730 impl Default for Ur16 {
5731 fn default() -> Ur16 {
5732 Ur16(0)
5733 }
5734 }
5735 }
5736}
5737pub mod rng_v1 {
5738 use crate::generic::*;
5739 #[doc = "Random number generator"]
5740 #[derive(Copy, Clone)]
5741 pub struct Rng(pub *mut u8);
5742 unsafe impl Send for Rng {}
5743 unsafe impl Sync for Rng {}
5744 impl Rng {
5745 #[doc = "control register"]
5746 pub fn cr(self) -> Reg<regs::Cr, RW> {
5747 unsafe { Reg::from_ptr(self.0.add(0usize)) }
5748 }
5749 #[doc = "status register"]
5750 pub fn sr(self) -> Reg<regs::Sr, RW> {
5751 unsafe { Reg::from_ptr(self.0.add(4usize)) }
5752 }
5753 #[doc = "data register"]
5754 pub fn dr(self) -> Reg<u32, R> {
5755 unsafe { Reg::from_ptr(self.0.add(8usize)) }
5756 }
5757 }
5758 pub mod regs {
5759 use crate::generic::*;
5760 #[doc = "control register"]
5761 #[repr(transparent)]
5762 #[derive(Copy, Clone, Eq, PartialEq)]
5763 pub struct Cr(pub u32);
5764 impl Cr {
5765 #[doc = "Random number generator enable"]
5766 pub const fn rngen(&self) -> bool {
4008 let val = (self.0 >> 2usize) & 0x01; 5767 let val = (self.0 >> 2usize) & 0x01;
4009 val != 0 5768 val != 0
4010 } 5769 }
4011 #[doc = "Noise error flag"] 5770 #[doc = "Random number generator enable"]
4012 pub fn set_ne(&mut self, val: bool) { 5771 pub fn set_rngen(&mut self, val: bool) {
4013 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5772 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
4014 } 5773 }
4015 #[doc = "Overrun error"] 5774 #[doc = "Interrupt enable"]
4016 pub const fn ore(&self) -> bool { 5775 pub const fn ie(&self) -> bool {
4017 let val = (self.0 >> 3usize) & 0x01; 5776 let val = (self.0 >> 3usize) & 0x01;
4018 val != 0 5777 val != 0
4019 } 5778 }
4020 #[doc = "Overrun error"] 5779 #[doc = "Interrupt enable"]
4021 pub fn set_ore(&mut self, val: bool) { 5780 pub fn set_ie(&mut self, val: bool) {
4022 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 5781 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
4023 } 5782 }
4024 #[doc = "IDLE line detected"]
4025 pub const fn idle(&self) -> bool {
4026 let val = (self.0 >> 4usize) & 0x01;
4027 val != 0
4028 }
4029 #[doc = "IDLE line detected"]
4030 pub fn set_idle(&mut self, val: bool) {
4031 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
4032 }
4033 #[doc = "Read data register not empty"]
4034 pub const fn rxne(&self) -> bool {
4035 let val = (self.0 >> 5usize) & 0x01;
4036 val != 0
4037 }
4038 #[doc = "Read data register not empty"]
4039 pub fn set_rxne(&mut self, val: bool) {
4040 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
4041 }
4042 #[doc = "Transmission complete"]
4043 pub const fn tc(&self) -> bool {
4044 let val = (self.0 >> 6usize) & 0x01;
4045 val != 0
4046 }
4047 #[doc = "Transmission complete"]
4048 pub fn set_tc(&mut self, val: bool) {
4049 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4050 }
4051 #[doc = "Transmit data register empty"]
4052 pub const fn txe(&self) -> bool {
4053 let val = (self.0 >> 7usize) & 0x01;
4054 val != 0
4055 }
4056 #[doc = "Transmit data register empty"]
4057 pub fn set_txe(&mut self, val: bool) {
4058 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
4059 }
4060 #[doc = "LIN break detection flag"]
4061 pub const fn lbd(&self) -> bool {
4062 let val = (self.0 >> 8usize) & 0x01;
4063 val != 0
4064 }
4065 #[doc = "LIN break detection flag"]
4066 pub fn set_lbd(&mut self, val: bool) {
4067 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
4068 }
4069 } 5783 }
4070 impl Default for Sr { 5784 impl Default for Cr {
4071 fn default() -> Sr { 5785 fn default() -> Cr {
4072 Sr(0) 5786 Cr(0)
4073 } 5787 }
4074 } 5788 }
4075 #[doc = "Status register"] 5789 #[doc = "status register"]
4076 #[repr(transparent)] 5790 #[repr(transparent)]
4077 #[derive(Copy, Clone, Eq, PartialEq)] 5791 #[derive(Copy, Clone, Eq, PartialEq)]
4078 pub struct SrUsart(pub u32); 5792 pub struct Sr(pub u32);
4079 impl SrUsart { 5793 impl Sr {
4080 #[doc = "Parity error"] 5794 #[doc = "Data ready"]
4081 pub const fn pe(&self) -> bool { 5795 pub const fn drdy(&self) -> bool {
4082 let val = (self.0 >> 0usize) & 0x01; 5796 let val = (self.0 >> 0usize) & 0x01;
4083 val != 0 5797 val != 0
4084 } 5798 }
4085 #[doc = "Parity error"] 5799 #[doc = "Data ready"]
4086 pub fn set_pe(&mut self, val: bool) { 5800 pub fn set_drdy(&mut self, val: bool) {
4087 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 5801 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4088 } 5802 }
4089 #[doc = "Framing error"] 5803 #[doc = "Clock error current status"]
4090 pub const fn fe(&self) -> bool { 5804 pub const fn cecs(&self) -> bool {
4091 let val = (self.0 >> 1usize) & 0x01; 5805 let val = (self.0 >> 1usize) & 0x01;
4092 val != 0 5806 val != 0
4093 } 5807 }
4094 #[doc = "Framing error"] 5808 #[doc = "Clock error current status"]
4095 pub fn set_fe(&mut self, val: bool) { 5809 pub fn set_cecs(&mut self, val: bool) {
4096 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 5810 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
4097 } 5811 }
4098 #[doc = "Noise error flag"] 5812 #[doc = "Seed error current status"]
4099 pub const fn ne(&self) -> bool { 5813 pub const fn secs(&self) -> bool {
4100 let val = (self.0 >> 2usize) & 0x01; 5814 let val = (self.0 >> 2usize) & 0x01;
4101 val != 0 5815 val != 0
4102 } 5816 }
4103 #[doc = "Noise error flag"] 5817 #[doc = "Seed error current status"]
4104 pub fn set_ne(&mut self, val: bool) { 5818 pub fn set_secs(&mut self, val: bool) {
4105 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 5819 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
4106 } 5820 }
4107 #[doc = "Overrun error"] 5821 #[doc = "Clock error interrupt status"]
4108 pub const fn ore(&self) -> bool { 5822 pub const fn ceis(&self) -> bool {
4109 let val = (self.0 >> 3usize) & 0x01;
4110 val != 0
4111 }
4112 #[doc = "Overrun error"]
4113 pub fn set_ore(&mut self, val: bool) {
4114 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
4115 }
4116 #[doc = "IDLE line detected"]
4117 pub const fn idle(&self) -> bool {
4118 let val = (self.0 >> 4usize) & 0x01;
4119 val != 0
4120 }
4121 #[doc = "IDLE line detected"]
4122 pub fn set_idle(&mut self, val: bool) {
4123 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
4124 }
4125 #[doc = "Read data register not empty"]
4126 pub const fn rxne(&self) -> bool {
4127 let val = (self.0 >> 5usize) & 0x01; 5823 let val = (self.0 >> 5usize) & 0x01;
4128 val != 0 5824 val != 0
4129 } 5825 }
4130 #[doc = "Read data register not empty"] 5826 #[doc = "Clock error interrupt status"]
4131 pub fn set_rxne(&mut self, val: bool) { 5827 pub fn set_ceis(&mut self, val: bool) {
4132 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 5828 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
4133 } 5829 }
4134 #[doc = "Transmission complete"] 5830 #[doc = "Seed error interrupt status"]
4135 pub const fn tc(&self) -> bool { 5831 pub const fn seis(&self) -> bool {
4136 let val = (self.0 >> 6usize) & 0x01; 5832 let val = (self.0 >> 6usize) & 0x01;
4137 val != 0 5833 val != 0
4138 } 5834 }
4139 #[doc = "Transmission complete"] 5835 #[doc = "Seed error interrupt status"]
4140 pub fn set_tc(&mut self, val: bool) { 5836 pub fn set_seis(&mut self, val: bool) {
4141 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 5837 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4142 } 5838 }
4143 #[doc = "Transmit data register empty"] 5839 }
4144 pub const fn txe(&self) -> bool { 5840 impl Default for Sr {
4145 let val = (self.0 >> 7usize) & 0x01; 5841 fn default() -> Sr {
5842 Sr(0)
5843 }
5844 }
5845 }
5846}
5847pub mod syscfg_f4 {
5848 use crate::generic::*;
5849 #[doc = "System configuration controller"]
5850 #[derive(Copy, Clone)]
5851 pub struct Syscfg(pub *mut u8);
5852 unsafe impl Send for Syscfg {}
5853 unsafe impl Sync for Syscfg {}
5854 impl Syscfg {
5855 #[doc = "memory remap register"]
5856 pub fn memrm(self) -> Reg<regs::Memrm, RW> {
5857 unsafe { Reg::from_ptr(self.0.add(0usize)) }
5858 }
5859 #[doc = "peripheral mode configuration register"]
5860 pub fn pmc(self) -> Reg<regs::Pmc, RW> {
5861 unsafe { Reg::from_ptr(self.0.add(4usize)) }
5862 }
5863 #[doc = "external interrupt configuration register"]
5864 pub fn exticr(self, n: usize) -> Reg<regs::Exticr, RW> {
5865 assert!(n < 4usize);
5866 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
5867 }
5868 #[doc = "Compensation cell control register"]
5869 pub fn cmpcr(self) -> Reg<regs::Cmpcr, R> {
5870 unsafe { Reg::from_ptr(self.0.add(32usize)) }
5871 }
5872 }
5873 pub mod regs {
5874 use crate::generic::*;
5875 #[doc = "Compensation cell control register"]
5876 #[repr(transparent)]
5877 #[derive(Copy, Clone, Eq, PartialEq)]
5878 pub struct Cmpcr(pub u32);
5879 impl Cmpcr {
5880 #[doc = "Compensation cell power-down"]
5881 pub const fn cmp_pd(&self) -> bool {
5882 let val = (self.0 >> 0usize) & 0x01;
4146 val != 0 5883 val != 0
4147 } 5884 }
4148 #[doc = "Transmit data register empty"] 5885 #[doc = "Compensation cell power-down"]
4149 pub fn set_txe(&mut self, val: bool) { 5886 pub fn set_cmp_pd(&mut self, val: bool) {
4150 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 5887 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4151 } 5888 }
4152 #[doc = "LIN break detection flag"] 5889 #[doc = "READY"]
4153 pub const fn lbd(&self) -> bool { 5890 pub const fn ready(&self) -> bool {
4154 let val = (self.0 >> 8usize) & 0x01; 5891 let val = (self.0 >> 8usize) & 0x01;
4155 val != 0 5892 val != 0
4156 } 5893 }
4157 #[doc = "LIN break detection flag"] 5894 #[doc = "READY"]
4158 pub fn set_lbd(&mut self, val: bool) { 5895 pub fn set_ready(&mut self, val: bool) {
4159 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 5896 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
4160 } 5897 }
4161 #[doc = "CTS flag"]
4162 pub const fn cts(&self) -> bool {
4163 let val = (self.0 >> 9usize) & 0x01;
4164 val != 0
4165 }
4166 #[doc = "CTS flag"]
4167 pub fn set_cts(&mut self, val: bool) {
4168 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
4169 }
4170 } 5898 }
4171 impl Default for SrUsart { 5899 impl Default for Cmpcr {
4172 fn default() -> SrUsart { 5900 fn default() -> Cmpcr {
4173 SrUsart(0) 5901 Cmpcr(0)
4174 } 5902 }
4175 } 5903 }
4176 #[doc = "Control register 2"] 5904 #[doc = "external interrupt configuration register"]
4177 #[repr(transparent)] 5905 #[repr(transparent)]
4178 #[derive(Copy, Clone, Eq, PartialEq)] 5906 #[derive(Copy, Clone, Eq, PartialEq)]
4179 pub struct Cr2(pub u32); 5907 pub struct Exticr(pub u32);
4180 impl Cr2 { 5908 impl Exticr {
4181 #[doc = "Address of the USART node"] 5909 #[doc = "EXTI x configuration"]
4182 pub const fn add(&self) -> u8 { 5910 pub fn exti(&self, n: usize) -> u8 {
4183 let val = (self.0 >> 0usize) & 0x0f; 5911 assert!(n < 4usize);
5912 let offs = 0usize + n * 4usize;
5913 let val = (self.0 >> offs) & 0x0f;
4184 val as u8 5914 val as u8
4185 } 5915 }
4186 #[doc = "Address of the USART node"] 5916 #[doc = "EXTI x configuration"]
4187 pub fn set_add(&mut self, val: u8) { 5917 pub fn set_exti(&mut self, n: usize, val: u8) {
4188 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 5918 assert!(n < 4usize);
4189 } 5919 let offs = 0usize + n * 4usize;
4190 #[doc = "lin break detection length"] 5920 self.0 = (self.0 & !(0x0f << offs)) | (((val as u32) & 0x0f) << offs);
4191 pub const fn lbdl(&self) -> super::vals::Lbdl {
4192 let val = (self.0 >> 5usize) & 0x01;
4193 super::vals::Lbdl(val as u8)
4194 }
4195 #[doc = "lin break detection length"]
4196 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
4197 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
4198 }
4199 #[doc = "LIN break detection interrupt enable"]
4200 pub const fn lbdie(&self) -> bool {
4201 let val = (self.0 >> 6usize) & 0x01;
4202 val != 0
4203 }
4204 #[doc = "LIN break detection interrupt enable"]
4205 pub fn set_lbdie(&mut self, val: bool) {
4206 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4207 }
4208 #[doc = "STOP bits"]
4209 pub const fn stop(&self) -> super::vals::Stop {
4210 let val = (self.0 >> 12usize) & 0x03;
4211 super::vals::Stop(val as u8)
4212 }
4213 #[doc = "STOP bits"]
4214 pub fn set_stop(&mut self, val: super::vals::Stop) {
4215 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
4216 }
4217 #[doc = "LIN mode enable"]
4218 pub const fn linen(&self) -> bool {
4219 let val = (self.0 >> 14usize) & 0x01;
4220 val != 0
4221 }
4222 #[doc = "LIN mode enable"]
4223 pub fn set_linen(&mut self, val: bool) {
4224 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
4225 } 5921 }
4226 } 5922 }
4227 impl Default for Cr2 { 5923 impl Default for Exticr {
4228 fn default() -> Cr2 { 5924 fn default() -> Exticr {
4229 Cr2(0) 5925 Exticr(0)
4230 } 5926 }
4231 } 5927 }
4232 #[doc = "Control register 2"] 5928 #[doc = "memory remap register"]
4233 #[repr(transparent)] 5929 #[repr(transparent)]
4234 #[derive(Copy, Clone, Eq, PartialEq)] 5930 #[derive(Copy, Clone, Eq, PartialEq)]
4235 pub struct Cr2Usart(pub u32); 5931 pub struct Memrm(pub u32);
4236 impl Cr2Usart { 5932 impl Memrm {
4237 #[doc = "Address of the USART node"] 5933 #[doc = "Memory mapping selection"]
4238 pub const fn add(&self) -> u8 { 5934 pub const fn mem_mode(&self) -> u8 {
4239 let val = (self.0 >> 0usize) & 0x0f; 5935 let val = (self.0 >> 0usize) & 0x07;
4240 val as u8 5936 val as u8
4241 } 5937 }
4242 #[doc = "Address of the USART node"] 5938 #[doc = "Memory mapping selection"]
4243 pub fn set_add(&mut self, val: u8) { 5939 pub fn set_mem_mode(&mut self, val: u8) {
4244 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize); 5940 self.0 = (self.0 & !(0x07 << 0usize)) | (((val as u32) & 0x07) << 0usize);
4245 }
4246 #[doc = "lin break detection length"]
4247 pub const fn lbdl(&self) -> super::vals::Lbdl {
4248 let val = (self.0 >> 5usize) & 0x01;
4249 super::vals::Lbdl(val as u8)
4250 }
4251 #[doc = "lin break detection length"]
4252 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
4253 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
4254 }
4255 #[doc = "LIN break detection interrupt enable"]
4256 pub const fn lbdie(&self) -> bool {
4257 let val = (self.0 >> 6usize) & 0x01;
4258 val != 0
4259 }
4260 #[doc = "LIN break detection interrupt enable"]
4261 pub fn set_lbdie(&mut self, val: bool) {
4262 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4263 } 5941 }
4264 #[doc = "Last bit clock pulse"] 5942 #[doc = "Flash bank mode selection"]
4265 pub const fn lbcl(&self) -> bool { 5943 pub const fn fb_mode(&self) -> bool {
4266 let val = (self.0 >> 8usize) & 0x01; 5944 let val = (self.0 >> 8usize) & 0x01;
4267 val != 0 5945 val != 0
4268 } 5946 }
4269 #[doc = "Last bit clock pulse"] 5947 #[doc = "Flash bank mode selection"]
4270 pub fn set_lbcl(&mut self, val: bool) { 5948 pub fn set_fb_mode(&mut self, val: bool) {
4271 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 5949 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
4272 } 5950 }
4273 #[doc = "Clock phase"] 5951 #[doc = "FMC memory mapping swap"]
4274 pub const fn cpha(&self) -> super::vals::Cpha { 5952 pub const fn swp_fmc(&self) -> u8 {
4275 let val = (self.0 >> 9usize) & 0x01; 5953 let val = (self.0 >> 10usize) & 0x03;
4276 super::vals::Cpha(val as u8) 5954 val as u8
4277 } 5955 }
4278 #[doc = "Clock phase"] 5956 #[doc = "FMC memory mapping swap"]
4279 pub fn set_cpha(&mut self, val: super::vals::Cpha) { 5957 pub fn set_swp_fmc(&mut self, val: u8) {
4280 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize); 5958 self.0 = (self.0 & !(0x03 << 10usize)) | (((val as u32) & 0x03) << 10usize);
4281 } 5959 }
4282 #[doc = "Clock polarity"] 5960 }
4283 pub const fn cpol(&self) -> super::vals::Cpol { 5961 impl Default for Memrm {
4284 let val = (self.0 >> 10usize) & 0x01; 5962 fn default() -> Memrm {
4285 super::vals::Cpol(val as u8) 5963 Memrm(0)
4286 } 5964 }
4287 #[doc = "Clock polarity"] 5965 }
4288 pub fn set_cpol(&mut self, val: super::vals::Cpol) { 5966 #[doc = "peripheral mode configuration register"]
4289 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 5967 #[repr(transparent)]
5968 #[derive(Copy, Clone, Eq, PartialEq)]
5969 pub struct Pmc(pub u32);
5970 impl Pmc {
5971 #[doc = "ADC1DC2"]
5972 pub const fn adc1dc2(&self) -> bool {
5973 let val = (self.0 >> 16usize) & 0x01;
5974 val != 0
4290 } 5975 }
4291 #[doc = "Clock enable"] 5976 #[doc = "ADC1DC2"]
4292 pub const fn clken(&self) -> bool { 5977 pub fn set_adc1dc2(&mut self, val: bool) {
4293 let val = (self.0 >> 11usize) & 0x01; 5978 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
5979 }
5980 #[doc = "ADC2DC2"]
5981 pub const fn adc2dc2(&self) -> bool {
5982 let val = (self.0 >> 17usize) & 0x01;
4294 val != 0 5983 val != 0
4295 } 5984 }
4296 #[doc = "Clock enable"] 5985 #[doc = "ADC2DC2"]
4297 pub fn set_clken(&mut self, val: bool) { 5986 pub fn set_adc2dc2(&mut self, val: bool) {
4298 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 5987 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
4299 } 5988 }
4300 #[doc = "STOP bits"] 5989 #[doc = "ADC3DC2"]
4301 pub const fn stop(&self) -> super::vals::Stop { 5990 pub const fn adc3dc2(&self) -> bool {
4302 let val = (self.0 >> 12usize) & 0x03; 5991 let val = (self.0 >> 18usize) & 0x01;
4303 super::vals::Stop(val as u8) 5992 val != 0
4304 } 5993 }
4305 #[doc = "STOP bits"] 5994 #[doc = "ADC3DC2"]
4306 pub fn set_stop(&mut self, val: super::vals::Stop) { 5995 pub fn set_adc3dc2(&mut self, val: bool) {
4307 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize); 5996 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
4308 } 5997 }
4309 #[doc = "LIN mode enable"] 5998 #[doc = "Ethernet PHY interface selection"]
4310 pub const fn linen(&self) -> bool { 5999 pub const fn mii_rmii_sel(&self) -> bool {
4311 let val = (self.0 >> 14usize) & 0x01; 6000 let val = (self.0 >> 23usize) & 0x01;
4312 val != 0 6001 val != 0
4313 } 6002 }
4314 #[doc = "LIN mode enable"] 6003 #[doc = "Ethernet PHY interface selection"]
4315 pub fn set_linen(&mut self, val: bool) { 6004 pub fn set_mii_rmii_sel(&mut self, val: bool) {
4316 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 6005 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
4317 } 6006 }
4318 } 6007 }
4319 impl Default for Cr2Usart { 6008 impl Default for Pmc {
4320 fn default() -> Cr2Usart { 6009 fn default() -> Pmc {
4321 Cr2Usart(0) 6010 Pmc(0)
4322 } 6011 }
4323 } 6012 }
4324 } 6013 }
@@ -4419,407 +6108,45 @@ pub mod sdmmc_v2 {
4419 } 6108 }
4420 pub mod regs { 6109 pub mod regs {
4421 use crate::generic::*; 6110 use crate::generic::*;
4422 #[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)."] 6111 #[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."]
4423 #[repr(transparent)]
4424 #[derive(Copy, Clone, Eq, PartialEq)]
4425 pub struct Cmdr(pub u32);
4426 impl Cmdr {
4427 #[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."]
4428 pub const fn cmdindex(&self) -> u8 {
4429 let val = (self.0 >> 0usize) & 0x3f;
4430 val as u8
4431 }
4432 #[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."]
4433 pub fn set_cmdindex(&mut self, val: u8) {
4434 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
4435 }
4436 #[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."]
4437 pub const fn cmdtrans(&self) -> bool {
4438 let val = (self.0 >> 6usize) & 0x01;
4439 val != 0
4440 }
4441 #[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."]
4442 pub fn set_cmdtrans(&mut self, val: bool) {
4443 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4444 }
4445 #[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."]
4446 pub const fn cmdstop(&self) -> bool {
4447 let val = (self.0 >> 7usize) & 0x01;
4448 val != 0
4449 }
4450 #[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."]
4451 pub fn set_cmdstop(&mut self, val: bool) {
4452 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
4453 }
4454 #[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."]
4455 pub const fn waitresp(&self) -> u8 {
4456 let val = (self.0 >> 8usize) & 0x03;
4457 val as u8
4458 }
4459 #[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."]
4460 pub fn set_waitresp(&mut self, val: u8) {
4461 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
4462 }
4463 #[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."]
4464 pub const fn waitint(&self) -> bool {
4465 let val = (self.0 >> 10usize) & 0x01;
4466 val != 0
4467 }
4468 #[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."]
4469 pub fn set_waitint(&mut self, val: bool) {
4470 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
4471 }
4472 #[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."]
4473 pub const fn waitpend(&self) -> bool {
4474 let val = (self.0 >> 11usize) & 0x01;
4475 val != 0
4476 }
4477 #[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."]
4478 pub fn set_waitpend(&mut self, val: bool) {
4479 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
4480 }
4481 #[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."]
4482 pub const fn cpsmen(&self) -> bool {
4483 let val = (self.0 >> 12usize) & 0x01;
4484 val != 0
4485 }
4486 #[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."]
4487 pub fn set_cpsmen(&mut self, val: bool) {
4488 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
4489 }
4490 #[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."]
4491 pub const fn dthold(&self) -> bool {
4492 let val = (self.0 >> 13usize) & 0x01;
4493 val != 0
4494 }
4495 #[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."]
4496 pub fn set_dthold(&mut self, val: bool) {
4497 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
4498 }
4499 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
4500 pub const fn bootmode(&self) -> bool {
4501 let val = (self.0 >> 14usize) & 0x01;
4502 val != 0
4503 }
4504 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
4505 pub fn set_bootmode(&mut self, val: bool) {
4506 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
4507 }
4508 #[doc = "Enable boot mode procedure."]
4509 pub const fn booten(&self) -> bool {
4510 let val = (self.0 >> 15usize) & 0x01;
4511 val != 0
4512 }
4513 #[doc = "Enable boot mode procedure."]
4514 pub fn set_booten(&mut self, val: bool) {
4515 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
4516 }
4517 #[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."]
4518 pub const fn cmdsuspend(&self) -> bool {
4519 let val = (self.0 >> 16usize) & 0x01;
4520 val != 0
4521 }
4522 #[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."]
4523 pub fn set_cmdsuspend(&mut self, val: bool) {
4524 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
4525 }
4526 }
4527 impl Default for Cmdr {
4528 fn default() -> Cmdr {
4529 Cmdr(0)
4530 }
4531 }
4532 #[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."]
4533 #[repr(transparent)] 6112 #[repr(transparent)]
4534 #[derive(Copy, Clone, Eq, PartialEq)] 6113 #[derive(Copy, Clone, Eq, PartialEq)]
4535 pub struct Acktimer(pub u32); 6114 pub struct Dcntr(pub u32);
4536 impl Acktimer { 6115 impl Dcntr {
4537 #[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."] 6116 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
4538 pub const fn acktime(&self) -> u32 { 6117 pub const fn datacount(&self) -> u32 {
4539 let val = (self.0 >> 0usize) & 0x01ff_ffff; 6118 let val = (self.0 >> 0usize) & 0x01ff_ffff;
4540 val as u32 6119 val as u32
4541 } 6120 }
4542 #[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."] 6121 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
4543 pub fn set_acktime(&mut self, val: u32) { 6122 pub fn set_datacount(&mut self, val: u32) {
4544 self.0 = 6123 self.0 =
4545 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); 6124 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
4546 } 6125 }
4547 } 6126 }
4548 impl Default for Acktimer { 6127 impl Default for Dcntr {
4549 fn default() -> Acktimer { 6128 fn default() -> Dcntr {
4550 Acktimer(0) 6129 Dcntr(0)
4551 } 6130 }
4552 } 6131 }
4553 #[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)"] 6132 #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."]
4554 #[repr(transparent)] 6133 #[repr(transparent)]
4555 #[derive(Copy, Clone, Eq, PartialEq)] 6134 #[derive(Copy, Clone, Eq, PartialEq)]
4556 pub struct Star(pub u32); 6135 pub struct Idmabsizer(pub u32);
4557 impl Star { 6136 impl Idmabsizer {
4558 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 6137 #[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)."]
4559 pub const fn ccrcfail(&self) -> bool { 6138 pub const fn idmabndt(&self) -> u8 {
4560 let val = (self.0 >> 0usize) & 0x01; 6139 let val = (self.0 >> 5usize) & 0xff;
4561 val != 0 6140 val as u8
4562 }
4563 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4564 pub fn set_ccrcfail(&mut self, val: bool) {
4565 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
4566 }
4567 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4568 pub const fn dcrcfail(&self) -> bool {
4569 let val = (self.0 >> 1usize) & 0x01;
4570 val != 0
4571 }
4572 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4573 pub fn set_dcrcfail(&mut self, val: bool) {
4574 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
4575 }
4576 #[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."]
4577 pub const fn ctimeout(&self) -> bool {
4578 let val = (self.0 >> 2usize) & 0x01;
4579 val != 0
4580 }
4581 #[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."]
4582 pub fn set_ctimeout(&mut self, val: bool) {
4583 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
4584 }
4585 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4586 pub const fn dtimeout(&self) -> bool {
4587 let val = (self.0 >> 3usize) & 0x01;
4588 val != 0
4589 }
4590 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4591 pub fn set_dtimeout(&mut self, val: bool) {
4592 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
4593 }
4594 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4595 pub const fn txunderr(&self) -> bool {
4596 let val = (self.0 >> 4usize) & 0x01;
4597 val != 0
4598 }
4599 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4600 pub fn set_txunderr(&mut self, val: bool) {
4601 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
4602 }
4603 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4604 pub const fn rxoverr(&self) -> bool {
4605 let val = (self.0 >> 5usize) & 0x01;
4606 val != 0
4607 }
4608 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4609 pub fn set_rxoverr(&mut self, val: bool) {
4610 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
4611 }
4612 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4613 pub const fn cmdrend(&self) -> bool {
4614 let val = (self.0 >> 6usize) & 0x01;
4615 val != 0
4616 }
4617 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4618 pub fn set_cmdrend(&mut self, val: bool) {
4619 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
4620 }
4621 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4622 pub const fn cmdsent(&self) -> bool {
4623 let val = (self.0 >> 7usize) & 0x01;
4624 val != 0
4625 }
4626 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4627 pub fn set_cmdsent(&mut self, val: bool) {
4628 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
4629 }
4630 #[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."]
4631 pub const fn dataend(&self) -> bool {
4632 let val = (self.0 >> 8usize) & 0x01;
4633 val != 0
4634 }
4635 #[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."]
4636 pub fn set_dataend(&mut self, val: bool) {
4637 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
4638 }
4639 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4640 pub const fn dhold(&self) -> bool {
4641 let val = (self.0 >> 9usize) & 0x01;
4642 val != 0
4643 }
4644 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4645 pub fn set_dhold(&mut self, val: bool) {
4646 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
4647 }
4648 #[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."]
4649 pub const fn dbckend(&self) -> bool {
4650 let val = (self.0 >> 10usize) & 0x01;
4651 val != 0
4652 }
4653 #[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."]
4654 pub fn set_dbckend(&mut self, val: bool) {
4655 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
4656 }
4657 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4658 pub const fn dabort(&self) -> bool {
4659 let val = (self.0 >> 11usize) & 0x01;
4660 val != 0
4661 }
4662 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4663 pub fn set_dabort(&mut self, val: bool) {
4664 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
4665 }
4666 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
4667 pub const fn dpsmact(&self) -> bool {
4668 let val = (self.0 >> 12usize) & 0x01;
4669 val != 0
4670 }
4671 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
4672 pub fn set_dpsmact(&mut self, val: bool) {
4673 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
4674 }
4675 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
4676 pub const fn cpsmact(&self) -> bool {
4677 let val = (self.0 >> 13usize) & 0x01;
4678 val != 0
4679 }
4680 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
4681 pub fn set_cpsmact(&mut self, val: bool) {
4682 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
4683 }
4684 #[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."]
4685 pub const fn txfifohe(&self) -> bool {
4686 let val = (self.0 >> 14usize) & 0x01;
4687 val != 0
4688 }
4689 #[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."]
4690 pub fn set_txfifohe(&mut self, val: bool) {
4691 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
4692 }
4693 #[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."]
4694 pub const fn rxfifohf(&self) -> bool {
4695 let val = (self.0 >> 15usize) & 0x01;
4696 val != 0
4697 }
4698 #[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."]
4699 pub fn set_rxfifohf(&mut self, val: bool) {
4700 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
4701 }
4702 #[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."]
4703 pub const fn txfifof(&self) -> bool {
4704 let val = (self.0 >> 16usize) & 0x01;
4705 val != 0
4706 }
4707 #[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."]
4708 pub fn set_txfifof(&mut self, val: bool) {
4709 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
4710 }
4711 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
4712 pub const fn rxfifof(&self) -> bool {
4713 let val = (self.0 >> 17usize) & 0x01;
4714 val != 0
4715 }
4716 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
4717 pub fn set_rxfifof(&mut self, val: bool) {
4718 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
4719 }
4720 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
4721 pub const fn txfifoe(&self) -> bool {
4722 let val = (self.0 >> 18usize) & 0x01;
4723 val != 0
4724 }
4725 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
4726 pub fn set_txfifoe(&mut self, val: bool) {
4727 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
4728 }
4729 #[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."]
4730 pub const fn rxfifoe(&self) -> bool {
4731 let val = (self.0 >> 19usize) & 0x01;
4732 val != 0
4733 }
4734 #[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."]
4735 pub fn set_rxfifoe(&mut self, val: bool) {
4736 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
4737 }
4738 #[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."]
4739 pub const fn busyd0(&self) -> bool {
4740 let val = (self.0 >> 20usize) & 0x01;
4741 val != 0
4742 }
4743 #[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."]
4744 pub fn set_busyd0(&mut self, val: bool) {
4745 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
4746 }
4747 #[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."]
4748 pub const fn busyd0end(&self) -> bool {
4749 let val = (self.0 >> 21usize) & 0x01;
4750 val != 0
4751 }
4752 #[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."]
4753 pub fn set_busyd0end(&mut self, val: bool) {
4754 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
4755 }
4756 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4757 pub const fn sdioit(&self) -> bool {
4758 let val = (self.0 >> 22usize) & 0x01;
4759 val != 0
4760 }
4761 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4762 pub fn set_sdioit(&mut self, val: bool) {
4763 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
4764 }
4765 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4766 pub const fn ackfail(&self) -> bool {
4767 let val = (self.0 >> 23usize) & 0x01;
4768 val != 0
4769 }
4770 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4771 pub fn set_ackfail(&mut self, val: bool) {
4772 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
4773 }
4774 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4775 pub const fn acktimeout(&self) -> bool {
4776 let val = (self.0 >> 24usize) & 0x01;
4777 val != 0
4778 }
4779 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4780 pub fn set_acktimeout(&mut self, val: bool) {
4781 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
4782 }
4783 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4784 pub const fn vswend(&self) -> bool {
4785 let val = (self.0 >> 25usize) & 0x01;
4786 val != 0
4787 }
4788 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4789 pub fn set_vswend(&mut self, val: bool) {
4790 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
4791 }
4792 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4793 pub const fn ckstop(&self) -> bool {
4794 let val = (self.0 >> 26usize) & 0x01;
4795 val != 0
4796 }
4797 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4798 pub fn set_ckstop(&mut self, val: bool) {
4799 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
4800 }
4801 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4802 pub const fn idmate(&self) -> bool {
4803 let val = (self.0 >> 27usize) & 0x01;
4804 val != 0
4805 }
4806 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4807 pub fn set_idmate(&mut self, val: bool) {
4808 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
4809 }
4810 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
4811 pub const fn idmabtc(&self) -> bool {
4812 let val = (self.0 >> 28usize) & 0x01;
4813 val != 0
4814 } 6141 }
4815 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."] 6142 #[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)."]
4816 pub fn set_idmabtc(&mut self, val: bool) { 6143 pub fn set_idmabndt(&mut self, val: u8) {
4817 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize); 6144 self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize);
4818 } 6145 }
4819 } 6146 }
4820 impl Default for Star { 6147 impl Default for Idmabsizer {
4821 fn default() -> Star { 6148 fn default() -> Idmabsizer {
4822 Star(0) 6149 Idmabsizer(0)
4823 } 6150 }
4824 } 6151 }
4825 #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."] 6152 #[doc = "The interrupt mask register determines which status flags generate an interrupt request by setting the corresponding bit to 1."]
@@ -5040,72 +6367,27 @@ pub mod sdmmc_v2 {
5040 Maskr(0) 6367 Maskr(0)
5041 } 6368 }
5042 } 6369 }
5043 #[doc = "SDMMC power control register"] 6370 #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."]
5044 #[repr(transparent)]
5045 #[derive(Copy, Clone, Eq, PartialEq)]
5046 pub struct Power(pub u32);
5047 impl Power {
5048 #[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."]
5049 pub const fn pwrctrl(&self) -> u8 {
5050 let val = (self.0 >> 0usize) & 0x03;
5051 val as u8
5052 }
5053 #[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."]
5054 pub fn set_pwrctrl(&mut self, val: u8) {
5055 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
5056 }
5057 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
5058 pub const fn vswitch(&self) -> bool {
5059 let val = (self.0 >> 2usize) & 0x01;
5060 val != 0
5061 }
5062 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
5063 pub fn set_vswitch(&mut self, val: bool) {
5064 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
5065 }
5066 #[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:"]
5067 pub const fn vswitchen(&self) -> bool {
5068 let val = (self.0 >> 3usize) & 0x01;
5069 val != 0
5070 }
5071 #[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:"]
5072 pub fn set_vswitchen(&mut self, val: bool) {
5073 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
5074 }
5075 #[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)."]
5076 pub const fn dirpol(&self) -> bool {
5077 let val = (self.0 >> 4usize) & 0x01;
5078 val != 0
5079 }
5080 #[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)."]
5081 pub fn set_dirpol(&mut self, val: bool) {
5082 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
5083 }
5084 }
5085 impl Default for Power {
5086 fn default() -> Power {
5087 Power(0)
5088 }
5089 }
5090 #[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."]
5091 #[repr(transparent)] 6371 #[repr(transparent)]
5092 #[derive(Copy, Clone, Eq, PartialEq)] 6372 #[derive(Copy, Clone, Eq, PartialEq)]
5093 pub struct Dlenr(pub u32); 6373 pub struct Idmabase1r(pub u32);
5094 impl Dlenr { 6374 impl Idmabase1r {
5095 #[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."] 6375 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0]
5096 pub const fn datalength(&self) -> u32 { 6376are 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)."]
5097 let val = (self.0 >> 0usize) & 0x01ff_ffff; 6377 pub const fn idmabase1(&self) -> u32 {
6378 let val = (self.0 >> 0usize) & 0xffff_ffff;
5098 val as u32 6379 val as u32
5099 } 6380 }
5100 #[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."] 6381 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0]
5101 pub fn set_datalength(&mut self, val: u32) { 6382are 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)."]
6383 pub fn set_idmabase1(&mut self, val: u32) {
5102 self.0 = 6384 self.0 =
5103 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize); 6385 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5104 } 6386 }
5105 } 6387 }
5106 impl Default for Dlenr { 6388 impl Default for Idmabase1r {
5107 fn default() -> Dlenr { 6389 fn default() -> Idmabase1r {
5108 Dlenr(0) 6390 Idmabase1r(0)
5109 } 6391 }
5110 } 6392 }
5111 #[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."] 6393 #[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."]
@@ -5299,352 +6581,339 @@ pub mod sdmmc_v2 {
5299 Icr(0) 6581 Icr(0)
5300 } 6582 }
5301 } 6583 }
5302 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] 6584 #[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)"]
5303 #[repr(transparent)]
5304 #[derive(Copy, Clone, Eq, PartialEq)]
5305 pub struct Resp1r(pub u32);
5306 impl Resp1r {
5307 #[doc = "see Table 432"]
5308 pub const fn cardstatus1(&self) -> u32 {
5309 let val = (self.0 >> 0usize) & 0xffff_ffff;
5310 val as u32
5311 }
5312 #[doc = "see Table 432"]
5313 pub fn set_cardstatus1(&mut self, val: u32) {
5314 self.0 =
5315 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5316 }
5317 }
5318 impl Default for Resp1r {
5319 fn default() -> Resp1r {
5320 Resp1r(0)
5321 }
5322 }
5323 #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."]
5324 #[repr(transparent)] 6585 #[repr(transparent)]
5325 #[derive(Copy, Clone, Eq, PartialEq)] 6586 #[derive(Copy, Clone, Eq, PartialEq)]
5326 pub struct Dctrl(pub u32); 6587 pub struct Star(pub u32);
5327 impl Dctrl { 6588 impl Star {
5328 #[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."] 6589 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5329 pub const fn dten(&self) -> bool { 6590 pub const fn ccrcfail(&self) -> bool {
5330 let val = (self.0 >> 0usize) & 0x01; 6591 let val = (self.0 >> 0usize) & 0x01;
5331 val != 0 6592 val != 0
5332 } 6593 }
5333 #[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."] 6594 #[doc = "Command response received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5334 pub fn set_dten(&mut self, val: bool) { 6595 pub fn set_ccrcfail(&mut self, val: bool) {
5335 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6596 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
5336 } 6597 }
5337 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6598 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5338 pub const fn dtdir(&self) -> bool { 6599 pub const fn dcrcfail(&self) -> bool {
5339 let val = (self.0 >> 1usize) & 0x01; 6600 let val = (self.0 >> 1usize) & 0x01;
5340 val != 0 6601 val != 0
5341 } 6602 }
5342 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6603 #[doc = "Data block sent/received (CRC check failed). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5343 pub fn set_dtdir(&mut self, val: bool) { 6604 pub fn set_dcrcfail(&mut self, val: bool) {
5344 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 6605 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
5345 } 6606 }
5346 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6607 #[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."]
5347 pub const fn dtmode(&self) -> u8 { 6608 pub const fn ctimeout(&self) -> bool {
5348 let val = (self.0 >> 2usize) & 0x03; 6609 let val = (self.0 >> 2usize) & 0x01;
5349 val as u8 6610 val != 0
5350 } 6611 }
5351 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6612 #[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."]
5352 pub fn set_dtmode(&mut self, val: u8) { 6613 pub fn set_ctimeout(&mut self, val: bool) {
5353 self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize); 6614 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
5354 } 6615 }
5355 #[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)"] 6616 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5356 pub const fn dblocksize(&self) -> u8 { 6617 pub const fn dtimeout(&self) -> bool {
5357 let val = (self.0 >> 4usize) & 0x0f; 6618 let val = (self.0 >> 3usize) & 0x01;
5358 val as u8 6619 val != 0
5359 } 6620 }
5360 #[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)"] 6621 #[doc = "Data timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5361 pub fn set_dblocksize(&mut self, val: u8) { 6622 pub fn set_dtimeout(&mut self, val: bool) {
5362 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize); 6623 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
5363 } 6624 }
5364 #[doc = "Read wait start. If this bit is set, read wait operation starts."] 6625 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5365 pub const fn rwstart(&self) -> bool { 6626 pub const fn txunderr(&self) -> bool {
6627 let val = (self.0 >> 4usize) & 0x01;
6628 val != 0
6629 }
6630 #[doc = "Transmit FIFO underrun error or IDMA read transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6631 pub fn set_txunderr(&mut self, val: bool) {
6632 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
6633 }
6634 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6635 pub const fn rxoverr(&self) -> bool {
6636 let val = (self.0 >> 5usize) & 0x01;
6637 val != 0
6638 }
6639 #[doc = "Received FIFO overrun error or IDMA write transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6640 pub fn set_rxoverr(&mut self, val: bool) {
6641 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
6642 }
6643 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6644 pub const fn cmdrend(&self) -> bool {
6645 let val = (self.0 >> 6usize) & 0x01;
6646 val != 0
6647 }
6648 #[doc = "Command response received (CRC check passed, or no CRC). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6649 pub fn set_cmdrend(&mut self, val: bool) {
6650 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
6651 }
6652 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6653 pub const fn cmdsent(&self) -> bool {
6654 let val = (self.0 >> 7usize) & 0x01;
6655 val != 0
6656 }
6657 #[doc = "Command sent (no response required). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6658 pub fn set_cmdsent(&mut self, val: bool) {
6659 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
6660 }
6661 #[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."]
6662 pub const fn dataend(&self) -> bool {
5366 let val = (self.0 >> 8usize) & 0x01; 6663 let val = (self.0 >> 8usize) & 0x01;
5367 val != 0 6664 val != 0
5368 } 6665 }
5369 #[doc = "Read wait start. If this bit is set, read wait operation starts."] 6666 #[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."]
5370 pub fn set_rwstart(&mut self, val: bool) { 6667 pub fn set_dataend(&mut self, val: bool) {
5371 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 6668 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
5372 } 6669 }
5373 #[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."] 6670 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5374 pub const fn rwstop(&self) -> bool { 6671 pub const fn dhold(&self) -> bool {
5375 let val = (self.0 >> 9usize) & 0x01; 6672 let val = (self.0 >> 9usize) & 0x01;
5376 val != 0 6673 val != 0
5377 } 6674 }
5378 #[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."] 6675 #[doc = "Data transfer Hold. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5379 pub fn set_rwstop(&mut self, val: bool) { 6676 pub fn set_dhold(&mut self, val: bool) {
5380 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 6677 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
5381 } 6678 }
5382 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6679 #[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."]
5383 pub const fn rwmod(&self) -> bool { 6680 pub const fn dbckend(&self) -> bool {
5384 let val = (self.0 >> 10usize) & 0x01; 6681 let val = (self.0 >> 10usize) & 0x01;
5385 val != 0 6682 val != 0
5386 } 6683 }
5387 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6684 #[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."]
5388 pub fn set_rwmod(&mut self, val: bool) { 6685 pub fn set_dbckend(&mut self, val: bool) {
5389 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize); 6686 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
5390 } 6687 }
5391 #[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."] 6688 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5392 pub const fn sdioen(&self) -> bool { 6689 pub const fn dabort(&self) -> bool {
5393 let val = (self.0 >> 11usize) & 0x01; 6690 let val = (self.0 >> 11usize) & 0x01;
5394 val != 0 6691 val != 0
5395 } 6692 }
5396 #[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."] 6693 #[doc = "Data transfer aborted by CMD12. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5397 pub fn set_sdioen(&mut self, val: bool) { 6694 pub fn set_dabort(&mut self, val: bool) {
5398 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 6695 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
5399 } 6696 }
5400 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6697 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
5401 pub const fn bootacken(&self) -> bool { 6698 pub const fn dpsmact(&self) -> bool {
5402 let val = (self.0 >> 12usize) & 0x01; 6699 let val = (self.0 >> 12usize) & 0x01;
5403 val != 0 6700 val != 0
5404 } 6701 }
5405 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6702 #[doc = "Data path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
5406 pub fn set_bootacken(&mut self, val: bool) { 6703 pub fn set_dpsmact(&mut self, val: bool) {
5407 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 6704 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
5408 } 6705 }
5409 #[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."] 6706 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
5410 pub const fn fiforst(&self) -> bool { 6707 pub const fn cpsmact(&self) -> bool {
5411 let val = (self.0 >> 13usize) & 0x01; 6708 let val = (self.0 >> 13usize) & 0x01;
5412 val != 0 6709 val != 0
5413 } 6710 }
5414 #[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."] 6711 #[doc = "Command path state machine active, i.e. not in Idle state. This is a hardware status flag only, does not generate an interrupt."]
5415 pub fn set_fiforst(&mut self, val: bool) { 6712 pub fn set_cpsmact(&mut self, val: bool) {
5416 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 6713 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
5417 } 6714 }
5418 } 6715 #[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."]
5419 impl Default for Dctrl { 6716 pub const fn txfifohe(&self) -> bool {
5420 fn default() -> Dctrl { 6717 let val = (self.0 >> 14usize) & 0x01;
5421 Dctrl(0)
5422 }
5423 }
5424 #[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."]
5425 #[repr(transparent)]
5426 #[derive(Copy, Clone, Eq, PartialEq)]
5427 pub struct Dcntr(pub u32);
5428 impl Dcntr {
5429 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
5430 pub const fn datacount(&self) -> u32 {
5431 let val = (self.0 >> 0usize) & 0x01ff_ffff;
5432 val as u32
5433 }
5434 #[doc = "Data count value When read, the number of remaining data bytes to be transferred is returned. Write has no effect."]
5435 pub fn set_datacount(&mut self, val: u32) {
5436 self.0 =
5437 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
5438 }
5439 }
5440 impl Default for Dcntr {
5441 fn default() -> Dcntr {
5442 Dcntr(0)
5443 }
5444 }
5445 #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."]
5446 #[repr(transparent)]
5447 #[derive(Copy, Clone, Eq, PartialEq)]
5448 pub struct Clkcr(pub u32);
5449 impl Clkcr {
5450 #[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.."]
5451 pub const fn clkdiv(&self) -> u16 {
5452 let val = (self.0 >> 0usize) & 0x03ff;
5453 val as u16
5454 }
5455 #[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.."]
5456 pub fn set_clkdiv(&mut self, val: u16) {
5457 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
5458 }
5459 #[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:"]
5460 pub const fn pwrsav(&self) -> bool {
5461 let val = (self.0 >> 12usize) & 0x01;
5462 val != 0 6718 val != 0
5463 } 6719 }
5464 #[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:"] 6720 #[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."]
5465 pub fn set_pwrsav(&mut self, val: bool) { 6721 pub fn set_txfifohe(&mut self, val: bool) {
5466 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 6722 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
5467 } 6723 }
5468 #[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)"] 6724 #[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."]
5469 pub const fn widbus(&self) -> u8 { 6725 pub const fn rxfifohf(&self) -> bool {
5470 let val = (self.0 >> 14usize) & 0x03; 6726 let val = (self.0 >> 15usize) & 0x01;
5471 val as u8 6727 val != 0
5472 } 6728 }
5473 #[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)"] 6729 #[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."]
5474 pub fn set_widbus(&mut self, val: u8) { 6730 pub fn set_rxfifohf(&mut self, val: bool) {
5475 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize); 6731 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
5476 } 6732 }
5477 #[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."] 6733 #[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."]
5478 pub const fn negedge(&self) -> bool { 6734 pub const fn txfifof(&self) -> bool {
5479 let val = (self.0 >> 16usize) & 0x01; 6735 let val = (self.0 >> 16usize) & 0x01;
5480 val != 0 6736 val != 0
5481 } 6737 }
5482 #[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."] 6738 #[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."]
5483 pub fn set_negedge(&mut self, val: bool) { 6739 pub fn set_txfifof(&mut self, val: bool) {
5484 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize); 6740 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
5485 } 6741 }
5486 #[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."] 6742 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
5487 pub const fn hwfc_en(&self) -> bool { 6743 pub const fn rxfifof(&self) -> bool {
5488 let val = (self.0 >> 17usize) & 0x01; 6744 let val = (self.0 >> 17usize) & 0x01;
5489 val != 0 6745 val != 0
5490 } 6746 }
5491 #[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."] 6747 #[doc = "Receive FIFO full This bit is cleared when one FIFO location becomes empty."]
5492 pub fn set_hwfc_en(&mut self, val: bool) { 6748 pub fn set_rxfifof(&mut self, val: bool) {
5493 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize); 6749 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
5494 } 6750 }
5495 #[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)"] 6751 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
5496 pub const fn ddr(&self) -> bool { 6752 pub const fn txfifoe(&self) -> bool {
5497 let val = (self.0 >> 18usize) & 0x01; 6753 let val = (self.0 >> 18usize) & 0x01;
5498 val != 0 6754 val != 0
5499 } 6755 }
5500 #[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)"] 6756 #[doc = "Transmit FIFO empty This bit is cleared when one FIFO location becomes full."]
5501 pub fn set_ddr(&mut self, val: bool) { 6757 pub fn set_txfifoe(&mut self, val: bool) {
5502 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize); 6758 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
5503 } 6759 }
5504 #[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)"] 6760 #[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."]
5505 pub const fn busspeed(&self) -> bool { 6761 pub const fn rxfifoe(&self) -> bool {
5506 let val = (self.0 >> 19usize) & 0x01; 6762 let val = (self.0 >> 19usize) & 0x01;
5507 val != 0 6763 val != 0
5508 } 6764 }
5509 #[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)"] 6765 #[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."]
5510 pub fn set_busspeed(&mut self, val: bool) { 6766 pub fn set_rxfifoe(&mut self, val: bool) {
5511 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize); 6767 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
5512 } 6768 }
5513 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] 6769 #[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."]
5514 pub const fn selclkrx(&self) -> u8 { 6770 pub const fn busyd0(&self) -> bool {
5515 let val = (self.0 >> 20usize) & 0x03; 6771 let val = (self.0 >> 20usize) & 0x01;
5516 val as u8 6772 val != 0
5517 } 6773 }
5518 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"] 6774 #[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."]
5519 pub fn set_selclkrx(&mut self, val: u8) { 6775 pub fn set_busyd0(&mut self, val: bool) {
5520 self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize); 6776 self.0 = (self.0 & !(0x01 << 20usize)) | (((val as u32) & 0x01) << 20usize);
5521 } 6777 }
5522 } 6778 #[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."]
5523 impl Default for Clkcr { 6779 pub const fn busyd0end(&self) -> bool {
5524 fn default() -> Clkcr { 6780 let val = (self.0 >> 21usize) & 0x01;
5525 Clkcr(0) 6781 val != 0
5526 } 6782 }
5527 } 6783 #[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."]
5528 #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."] 6784 pub fn set_busyd0end(&mut self, val: bool) {
5529 #[repr(transparent)] 6785 self.0 = (self.0 & !(0x01 << 21usize)) | (((val as u32) & 0x01) << 21usize);
5530 #[derive(Copy, Clone, Eq, PartialEq)]
5531 pub struct Argr(pub u32);
5532 impl Argr {
5533 #[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."]
5534 pub const fn cmdarg(&self) -> u32 {
5535 let val = (self.0 >> 0usize) & 0xffff_ffff;
5536 val as u32
5537 } 6786 }
5538 #[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."] 6787 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5539 pub fn set_cmdarg(&mut self, val: u32) { 6788 pub const fn sdioit(&self) -> bool {
5540 self.0 = 6789 let val = (self.0 >> 22usize) & 0x01;
5541 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 6790 val != 0
5542 } 6791 }
5543 } 6792 #[doc = "SDIO interrupt received. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5544 impl Default for Argr { 6793 pub fn set_sdioit(&mut self, val: bool) {
5545 fn default() -> Argr { 6794 self.0 = (self.0 & !(0x01 << 22usize)) | (((val as u32) & 0x01) << 22usize);
5546 Argr(0)
5547 } 6795 }
5548 } 6796 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5549 #[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."] 6797 pub const fn ackfail(&self) -> bool {
5550 #[repr(transparent)] 6798 let val = (self.0 >> 23usize) & 0x01;
5551 #[derive(Copy, Clone, Eq, PartialEq)]
5552 pub struct Idmactrlr(pub u32);
5553 impl Idmactrlr {
5554 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
5555 pub const fn idmaen(&self) -> bool {
5556 let val = (self.0 >> 0usize) & 0x01;
5557 val != 0 6799 val != 0
5558 } 6800 }
5559 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6801 #[doc = "Boot acknowledgment received (boot acknowledgment check fail). Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5560 pub fn set_idmaen(&mut self, val: bool) { 6802 pub fn set_ackfail(&mut self, val: bool) {
5561 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 6803 self.0 = (self.0 & !(0x01 << 23usize)) | (((val as u32) & 0x01) << 23usize);
5562 } 6804 }
5563 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6805 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5564 pub const fn idmabmode(&self) -> bool { 6806 pub const fn acktimeout(&self) -> bool {
5565 let val = (self.0 >> 1usize) & 0x01; 6807 let val = (self.0 >> 24usize) & 0x01;
5566 val != 0 6808 val != 0
5567 } 6809 }
5568 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."] 6810 #[doc = "Boot acknowledgment timeout. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5569 pub fn set_idmabmode(&mut self, val: bool) { 6811 pub fn set_acktimeout(&mut self, val: bool) {
5570 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 6812 self.0 = (self.0 & !(0x01 << 24usize)) | (((val as u32) & 0x01) << 24usize);
5571 } 6813 }
5572 #[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."] 6814 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5573 pub const fn idmabact(&self) -> bool { 6815 pub const fn vswend(&self) -> bool {
5574 let val = (self.0 >> 2usize) & 0x01; 6816 let val = (self.0 >> 25usize) & 0x01;
5575 val != 0 6817 val != 0
5576 } 6818 }
5577 #[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."] 6819 #[doc = "Voltage switch critical timing section completion. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
5578 pub fn set_idmabact(&mut self, val: bool) { 6820 pub fn set_vswend(&mut self, val: bool) {
5579 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 6821 self.0 = (self.0 & !(0x01 << 25usize)) | (((val as u32) & 0x01) << 25usize);
6822 }
6823 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6824 pub const fn ckstop(&self) -> bool {
6825 let val = (self.0 >> 26usize) & 0x01;
6826 val != 0
6827 }
6828 #[doc = "SDMMC_CK stopped in Voltage switch procedure. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6829 pub fn set_ckstop(&mut self, val: bool) {
6830 self.0 = (self.0 & !(0x01 << 26usize)) | (((val as u32) & 0x01) << 26usize);
6831 }
6832 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6833 pub const fn idmate(&self) -> bool {
6834 let val = (self.0 >> 27usize) & 0x01;
6835 val != 0
6836 }
6837 #[doc = "IDMA transfer error. Interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6838 pub fn set_idmate(&mut self, val: bool) {
6839 self.0 = (self.0 & !(0x01 << 27usize)) | (((val as u32) & 0x01) << 27usize);
6840 }
6841 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6842 pub const fn idmabtc(&self) -> bool {
6843 let val = (self.0 >> 28usize) & 0x01;
6844 val != 0
6845 }
6846 #[doc = "IDMA buffer transfer complete. interrupt flag is cleared by writing corresponding interrupt clear bit in SDMMC_ICR."]
6847 pub fn set_idmabtc(&mut self, val: bool) {
6848 self.0 = (self.0 & !(0x01 << 28usize)) | (((val as u32) & 0x01) << 28usize);
5580 } 6849 }
5581 } 6850 }
5582 impl Default for Idmactrlr { 6851 impl Default for Star {
5583 fn default() -> Idmactrlr { 6852 fn default() -> Star {
5584 Idmactrlr(0) 6853 Star(0)
5585 } 6854 }
5586 } 6855 }
5587 #[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."] 6856 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
5588 #[repr(transparent)] 6857 #[repr(transparent)]
5589 #[derive(Copy, Clone, Eq, PartialEq)] 6858 #[derive(Copy, Clone, Eq, PartialEq)]
5590 pub struct Fifor(pub u32); 6859 pub struct Resp1r(pub u32);
5591 impl Fifor { 6860 impl Resp1r {
5592 #[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."] 6861 #[doc = "see Table 432"]
5593 pub const fn fifodata(&self) -> u32 { 6862 pub const fn cardstatus1(&self) -> u32 {
5594 let val = (self.0 >> 0usize) & 0xffff_ffff; 6863 let val = (self.0 >> 0usize) & 0xffff_ffff;
5595 val as u32 6864 val as u32
5596 } 6865 }
5597 #[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."] 6866 #[doc = "see Table 432"]
5598 pub fn set_fifodata(&mut self, val: u32) { 6867 pub fn set_cardstatus1(&mut self, val: u32) {
5599 self.0 = 6868 self.0 =
5600 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 6869 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5601 } 6870 }
5602 } 6871 }
5603 impl Default for Fifor { 6872 impl Default for Resp1r {
5604 fn default() -> Fifor { 6873 fn default() -> Resp1r {
5605 Fifor(0) 6874 Resp1r(0)
5606 } 6875 }
5607 } 6876 }
5608 #[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."] 6877 #[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."]
5609 #[repr(transparent)] 6878 #[repr(transparent)]
5610 #[derive(Copy, Clone, Eq, PartialEq)] 6879 #[derive(Copy, Clone, Eq, PartialEq)]
5611 pub struct Dtimer(pub u32); 6880 pub struct Dlenr(pub u32);
5612 impl Dtimer { 6881 impl Dlenr {
5613 #[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."] 6882 #[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."]
5614 pub const fn datatime(&self) -> u32 { 6883 pub const fn datalength(&self) -> u32 {
5615 let val = (self.0 >> 0usize) & 0xffff_ffff; 6884 let val = (self.0 >> 0usize) & 0x01ff_ffff;
5616 val as u32 6885 val as u32
5617 } 6886 }
5618 #[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."] 6887 #[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."]
5619 pub fn set_datatime(&mut self, val: u32) { 6888 pub fn set_datalength(&mut self, val: u32) {
5620 self.0 = 6889 self.0 =
5621 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 6890 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
5622 } 6891 }
5623 } 6892 }
5624 impl Default for Dtimer { 6893 impl Default for Dlenr {
5625 fn default() -> Dtimer { 6894 fn default() -> Dlenr {
5626 Dtimer(0) 6895 Dlenr(0)
5627 } 6896 }
5628 } 6897 }
5629 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] 6898 #[doc = "The SDMMC_ARGR register contains a 32-bit command argument, which is sent to a card as part of a command message."]
5630 #[repr(transparent)] 6899 #[repr(transparent)]
5631 #[derive(Copy, Clone, Eq, PartialEq)] 6900 #[derive(Copy, Clone, Eq, PartialEq)]
5632 pub struct Resp2r(pub u32); 6901 pub struct Argr(pub u32);
5633 impl Resp2r { 6902 impl Argr {
5634 #[doc = "see Table404."] 6903 #[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."]
5635 pub const fn cardstatus2(&self) -> u32 { 6904 pub const fn cmdarg(&self) -> u32 {
5636 let val = (self.0 >> 0usize) & 0xffff_ffff; 6905 let val = (self.0 >> 0usize) & 0xffff_ffff;
5637 val as u32 6906 val as u32
5638 } 6907 }
5639 #[doc = "see Table404."] 6908 #[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."]
5640 pub fn set_cardstatus2(&mut self, val: u32) { 6909 pub fn set_cmdarg(&mut self, val: u32) {
5641 self.0 = 6910 self.0 =
5642 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 6911 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5643 } 6912 }
5644 } 6913 }
5645 impl Default for Resp2r { 6914 impl Default for Argr {
5646 fn default() -> Resp2r { 6915 fn default() -> Argr {
5647 Resp2r(0) 6916 Argr(0)
5648 } 6917 }
5649 } 6918 }
5650 #[doc = "SDMMC IP version register"] 6919 #[doc = "SDMMC IP version register"]
@@ -5697,68 +6966,93 @@ pub mod sdmmc_v2 {
5697 Resp3r(0) 6966 Resp3r(0)
5698 } 6967 }
5699 } 6968 }
5700 #[doc = "The SDMMC_IDMABASE1R register contains the double buffer configuration second buffer memory base address."] 6969 #[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."]
5701 #[repr(transparent)] 6970 #[repr(transparent)]
5702 #[derive(Copy, Clone, Eq, PartialEq)] 6971 #[derive(Copy, Clone, Eq, PartialEq)]
5703 pub struct Idmabase1r(pub u32); 6972 pub struct Fifor(pub u32);
5704 impl Idmabase1r { 6973 impl Fifor {
5705 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] 6974 #[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."]
5706are 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)."] 6975 pub const fn fifodata(&self) -> u32 {
5707 pub const fn idmabase1(&self) -> u32 {
5708 let val = (self.0 >> 0usize) & 0xffff_ffff; 6976 let val = (self.0 >> 0usize) & 0xffff_ffff;
5709 val as u32 6977 val as u32
5710 } 6978 }
5711 #[doc = "Buffer 1 memory base address, shall be word aligned (bit [1:0] 6979 #[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."]
5712are 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)."] 6980 pub fn set_fifodata(&mut self, val: u32) {
5713 pub fn set_idmabase1(&mut self, val: u32) {
5714 self.0 = 6981 self.0 =
5715 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 6982 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5716 } 6983 }
5717 } 6984 }
5718 impl Default for Idmabase1r { 6985 impl Default for Fifor {
5719 fn default() -> Idmabase1r { 6986 fn default() -> Fifor {
5720 Idmabase1r(0) 6987 Fifor(0)
5721 } 6988 }
5722 } 6989 }
5723 #[doc = "SDMMC command response register"] 6990 #[doc = "SDMMC power control register"]
5724 #[repr(transparent)] 6991 #[repr(transparent)]
5725 #[derive(Copy, Clone, Eq, PartialEq)] 6992 #[derive(Copy, Clone, Eq, PartialEq)]
5726 pub struct Respcmdr(pub u32); 6993 pub struct Power(pub u32);
5727 impl Respcmdr { 6994 impl Power {
5728 #[doc = "Response command index"] 6995 #[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."]
5729 pub const fn respcmd(&self) -> u8 { 6996 pub const fn pwrctrl(&self) -> u8 {
5730 let val = (self.0 >> 0usize) & 0x3f; 6997 let val = (self.0 >> 0usize) & 0x03;
5731 val as u8 6998 val as u8
5732 } 6999 }
5733 #[doc = "Response command index"] 7000 #[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."]
5734 pub fn set_respcmd(&mut self, val: u8) { 7001 pub fn set_pwrctrl(&mut self, val: u8) {
5735 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize); 7002 self.0 = (self.0 & !(0x03 << 0usize)) | (((val as u32) & 0x03) << 0usize);
7003 }
7004 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
7005 pub const fn vswitch(&self) -> bool {
7006 let val = (self.0 >> 2usize) & 0x01;
7007 val != 0
7008 }
7009 #[doc = "Voltage switch sequence start. This bit is used to start the timing critical section of the voltage switch sequence:"]
7010 pub fn set_vswitch(&mut self, val: bool) {
7011 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
7012 }
7013 #[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:"]
7014 pub const fn vswitchen(&self) -> bool {
7015 let val = (self.0 >> 3usize) & 0x01;
7016 val != 0
7017 }
7018 #[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:"]
7019 pub fn set_vswitchen(&mut self, val: bool) {
7020 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
7021 }
7022 #[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)."]
7023 pub const fn dirpol(&self) -> bool {
7024 let val = (self.0 >> 4usize) & 0x01;
7025 val != 0
7026 }
7027 #[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)."]
7028 pub fn set_dirpol(&mut self, val: bool) {
7029 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
5736 } 7030 }
5737 } 7031 }
5738 impl Default for Respcmdr { 7032 impl Default for Power {
5739 fn default() -> Respcmdr { 7033 fn default() -> Power {
5740 Respcmdr(0) 7034 Power(0)
5741 } 7035 }
5742 } 7036 }
5743 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."] 7037 #[doc = "SDMMC IP identification register"]
5744 #[repr(transparent)] 7038 #[repr(transparent)]
5745 #[derive(Copy, Clone, Eq, PartialEq)] 7039 #[derive(Copy, Clone, Eq, PartialEq)]
5746 pub struct Resp4r(pub u32); 7040 pub struct Id(pub u32);
5747 impl Resp4r { 7041 impl Id {
5748 #[doc = "see Table404."] 7042 #[doc = "SDMMC IP identification."]
5749 pub const fn cardstatus4(&self) -> u32 { 7043 pub const fn ip_id(&self) -> u32 {
5750 let val = (self.0 >> 0usize) & 0xffff_ffff; 7044 let val = (self.0 >> 0usize) & 0xffff_ffff;
5751 val as u32 7045 val as u32
5752 } 7046 }
5753 #[doc = "see Table404."] 7047 #[doc = "SDMMC IP identification."]
5754 pub fn set_cardstatus4(&mut self, val: u32) { 7048 pub fn set_ip_id(&mut self, val: u32) {
5755 self.0 = 7049 self.0 =
5756 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 7050 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
5757 } 7051 }
5758 } 7052 }
5759 impl Default for Resp4r { 7053 impl Default for Id {
5760 fn default() -> Resp4r { 7054 fn default() -> Id {
5761 Resp4r(0) 7055 Id(0)
5762 } 7056 }
5763 } 7057 }
5764 #[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."] 7058 #[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."]
@@ -5784,3320 +7078,2026 @@ are always 0 and read only). This register can be written by firmware when DPSM
5784 Idmabase0r(0) 7078 Idmabase0r(0)
5785 } 7079 }
5786 } 7080 }
5787 #[doc = "The SDMMC_IDMABSIZER register contains the buffers size when in double buffer configuration."] 7081 #[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."]
5788 #[repr(transparent)]
5789 #[derive(Copy, Clone, Eq, PartialEq)]
5790 pub struct Idmabsizer(pub u32);
5791 impl Idmabsizer {
5792 #[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)."]
5793 pub const fn idmabndt(&self) -> u8 {
5794 let val = (self.0 >> 5usize) & 0xff;
5795 val as u8
5796 }
5797 #[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)."]
5798 pub fn set_idmabndt(&mut self, val: u8) {
5799 self.0 = (self.0 & !(0xff << 5usize)) | (((val as u32) & 0xff) << 5usize);
5800 }
5801 }
5802 impl Default for Idmabsizer {
5803 fn default() -> Idmabsizer {
5804 Idmabsizer(0)
5805 }
5806 }
5807 #[doc = "SDMMC IP identification register"]
5808 #[repr(transparent)] 7082 #[repr(transparent)]
5809 #[derive(Copy, Clone, Eq, PartialEq)] 7083 #[derive(Copy, Clone, Eq, PartialEq)]
5810 pub struct Id(pub u32); 7084 pub struct Acktimer(pub u32);
5811 impl Id { 7085 impl Acktimer {
5812 #[doc = "SDMMC IP identification."] 7086 #[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."]
5813 pub const fn ip_id(&self) -> u32 { 7087 pub const fn acktime(&self) -> u32 {
5814 let val = (self.0 >> 0usize) & 0xffff_ffff; 7088 let val = (self.0 >> 0usize) & 0x01ff_ffff;
5815 val as u32 7089 val as u32
5816 } 7090 }
5817 #[doc = "SDMMC IP identification."] 7091 #[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."]
5818 pub fn set_ip_id(&mut self, val: u32) { 7092 pub fn set_acktime(&mut self, val: u32) {
5819 self.0 = 7093 self.0 =
5820 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize); 7094 (self.0 & !(0x01ff_ffff << 0usize)) | (((val as u32) & 0x01ff_ffff) << 0usize);
5821 } 7095 }
5822 } 7096 }
5823 impl Default for Id { 7097 impl Default for Acktimer {
5824 fn default() -> Id { 7098 fn default() -> Acktimer {
5825 Id(0) 7099 Acktimer(0)
5826 } 7100 }
5827 } 7101 }
5828 } 7102 #[doc = "The SDMMC_CLKCR register controls the SDMMC_CK output clock, the SDMMC_RX_CLK receive clock, and the bus width."]
5829}
5830pub mod spi_v2 {
5831 use crate::generic::*;
5832 #[doc = "Serial peripheral interface"]
5833 #[derive(Copy, Clone)]
5834 pub struct Spi(pub *mut u8);
5835 unsafe impl Send for Spi {}
5836 unsafe impl Sync for Spi {}
5837 impl Spi {
5838 #[doc = "control register 1"]
5839 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
5840 unsafe { Reg::from_ptr(self.0.add(0usize)) }
5841 }
5842 #[doc = "control register 2"]
5843 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
5844 unsafe { Reg::from_ptr(self.0.add(4usize)) }
5845 }
5846 #[doc = "status register"]
5847 pub fn sr(self) -> Reg<regs::Sr, RW> {
5848 unsafe { Reg::from_ptr(self.0.add(8usize)) }
5849 }
5850 #[doc = "data register"]
5851 pub fn dr(self) -> Reg<regs::Dr, RW> {
5852 unsafe { Reg::from_ptr(self.0.add(12usize)) }
5853 }
5854 #[doc = "CRC polynomial register"]
5855 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
5856 unsafe { Reg::from_ptr(self.0.add(16usize)) }
5857 }
5858 #[doc = "RX CRC register"]
5859 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
5860 unsafe { Reg::from_ptr(self.0.add(20usize)) }
5861 }
5862 #[doc = "TX CRC register"]
5863 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
5864 unsafe { Reg::from_ptr(self.0.add(24usize)) }
5865 }
5866 }
5867 pub mod vals {
5868 use crate::generic::*;
5869 #[repr(transparent)]
5870 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5871 pub struct Br(pub u8);
5872 impl Br {
5873 #[doc = "f_PCLK / 2"]
5874 pub const DIV2: Self = Self(0);
5875 #[doc = "f_PCLK / 4"]
5876 pub const DIV4: Self = Self(0x01);
5877 #[doc = "f_PCLK / 8"]
5878 pub const DIV8: Self = Self(0x02);
5879 #[doc = "f_PCLK / 16"]
5880 pub const DIV16: Self = Self(0x03);
5881 #[doc = "f_PCLK / 32"]
5882 pub const DIV32: Self = Self(0x04);
5883 #[doc = "f_PCLK / 64"]
5884 pub const DIV64: Self = Self(0x05);
5885 #[doc = "f_PCLK / 128"]
5886 pub const DIV128: Self = Self(0x06);
5887 #[doc = "f_PCLK / 256"]
5888 pub const DIV256: Self = Self(0x07);
5889 }
5890 #[repr(transparent)]
5891 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5892 pub struct Lsbfirst(pub u8);
5893 impl Lsbfirst {
5894 #[doc = "Data is transmitted/received with the MSB first"]
5895 pub const MSBFIRST: Self = Self(0);
5896 #[doc = "Data is transmitted/received with the LSB first"]
5897 pub const LSBFIRST: Self = Self(0x01);
5898 }
5899 #[repr(transparent)]
5900 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5901 pub struct LdmaTx(pub u8);
5902 impl LdmaTx {
5903 #[doc = "Number of data to transfer for transmit is even"]
5904 pub const EVEN: Self = Self(0);
5905 #[doc = "Number of data to transfer for transmit is odd"]
5906 pub const ODD: Self = Self(0x01);
5907 }
5908 #[repr(transparent)]
5909 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5910 pub struct Frf(pub u8);
5911 impl Frf {
5912 #[doc = "SPI Motorola mode"]
5913 pub const MOTOROLA: Self = Self(0);
5914 #[doc = "SPI TI mode"]
5915 pub const TI: Self = Self(0x01);
5916 }
5917 #[repr(transparent)]
5918 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5919 pub struct Bidioe(pub u8);
5920 impl Bidioe {
5921 #[doc = "Output disabled (receive-only mode)"]
5922 pub const OUTPUTDISABLED: Self = Self(0);
5923 #[doc = "Output enabled (transmit-only mode)"]
5924 pub const OUTPUTENABLED: Self = Self(0x01);
5925 }
5926 #[repr(transparent)]
5927 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5928 pub struct Frer(pub u8);
5929 impl Frer {
5930 #[doc = "No frame format error"]
5931 pub const NOERROR: Self = Self(0);
5932 #[doc = "A frame format error occurred"]
5933 pub const ERROR: Self = Self(0x01);
5934 }
5935 #[repr(transparent)]
5936 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5937 pub struct Crcnext(pub u8);
5938 impl Crcnext {
5939 #[doc = "Next transmit value is from Tx buffer"]
5940 pub const TXBUFFER: Self = Self(0);
5941 #[doc = "Next transmit value is from Tx CRC register"]
5942 pub const CRC: Self = Self(0x01);
5943 }
5944 #[repr(transparent)]
5945 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5946 pub struct Ds(pub u8);
5947 impl Ds {
5948 #[doc = "4-bit"]
5949 pub const FOURBIT: Self = Self(0x03);
5950 #[doc = "5-bit"]
5951 pub const FIVEBIT: Self = Self(0x04);
5952 #[doc = "6-bit"]
5953 pub const SIXBIT: Self = Self(0x05);
5954 #[doc = "7-bit"]
5955 pub const SEVENBIT: Self = Self(0x06);
5956 #[doc = "8-bit"]
5957 pub const EIGHTBIT: Self = Self(0x07);
5958 #[doc = "9-bit"]
5959 pub const NINEBIT: Self = Self(0x08);
5960 #[doc = "10-bit"]
5961 pub const TENBIT: Self = Self(0x09);
5962 #[doc = "11-bit"]
5963 pub const ELEVENBIT: Self = Self(0x0a);
5964 #[doc = "12-bit"]
5965 pub const TWELVEBIT: Self = Self(0x0b);
5966 #[doc = "13-bit"]
5967 pub const THIRTEENBIT: Self = Self(0x0c);
5968 #[doc = "14-bit"]
5969 pub const FOURTEENBIT: Self = Self(0x0d);
5970 #[doc = "15-bit"]
5971 pub const FIFTEENBIT: Self = Self(0x0e);
5972 #[doc = "16-bit"]
5973 pub const SIXTEENBIT: Self = Self(0x0f);
5974 }
5975 #[repr(transparent)]
5976 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5977 pub struct Cpha(pub u8);
5978 impl Cpha {
5979 #[doc = "The first clock transition is the first data capture edge"]
5980 pub const FIRSTEDGE: Self = Self(0);
5981 #[doc = "The second clock transition is the first data capture edge"]
5982 pub const SECONDEDGE: Self = Self(0x01);
5983 }
5984 #[repr(transparent)]
5985 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5986 pub struct Frlvlr(pub u8);
5987 impl Frlvlr {
5988 #[doc = "Rx FIFO Empty"]
5989 pub const EMPTY: Self = Self(0);
5990 #[doc = "Rx 1/4 FIFO"]
5991 pub const QUARTER: Self = Self(0x01);
5992 #[doc = "Rx 1/2 FIFO"]
5993 pub const HALF: Self = Self(0x02);
5994 #[doc = "Rx FIFO full"]
5995 pub const FULL: Self = Self(0x03);
5996 }
5997 #[repr(transparent)]
5998 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
5999 pub struct Bidimode(pub u8);
6000 impl Bidimode {
6001 #[doc = "2-line unidirectional data mode selected"]
6002 pub const UNIDIRECTIONAL: Self = Self(0);
6003 #[doc = "1-line bidirectional data mode selected"]
6004 pub const BIDIRECTIONAL: Self = Self(0x01);
6005 }
6006 #[repr(transparent)]
6007 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6008 pub struct Mstr(pub u8);
6009 impl Mstr {
6010 #[doc = "Slave configuration"]
6011 pub const SLAVE: Self = Self(0);
6012 #[doc = "Master configuration"]
6013 pub const MASTER: Self = Self(0x01);
6014 }
6015 #[repr(transparent)]
6016 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6017 pub struct Crcl(pub u8);
6018 impl Crcl {
6019 #[doc = "8-bit CRC length"]
6020 pub const EIGHTBIT: Self = Self(0);
6021 #[doc = "16-bit CRC length"]
6022 pub const SIXTEENBIT: Self = Self(0x01);
6023 }
6024 #[repr(transparent)]
6025 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6026 pub struct Rxonly(pub u8);
6027 impl Rxonly {
6028 #[doc = "Full duplex (Transmit and receive)"]
6029 pub const FULLDUPLEX: Self = Self(0);
6030 #[doc = "Output disabled (Receive-only mode)"]
6031 pub const OUTPUTDISABLED: Self = Self(0x01);
6032 }
6033 #[repr(transparent)]
6034 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6035 pub struct Ftlvlr(pub u8);
6036 impl Ftlvlr {
6037 #[doc = "Tx FIFO Empty"]
6038 pub const EMPTY: Self = Self(0);
6039 #[doc = "Tx 1/4 FIFO"]
6040 pub const QUARTER: Self = Self(0x01);
6041 #[doc = "Tx 1/2 FIFO"]
6042 pub const HALF: Self = Self(0x02);
6043 #[doc = "Tx FIFO full"]
6044 pub const FULL: Self = Self(0x03);
6045 }
6046 #[repr(transparent)]
6047 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6048 pub struct Frxth(pub u8);
6049 impl Frxth {
6050 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"]
6051 pub const HALF: Self = Self(0);
6052 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"]
6053 pub const QUARTER: Self = Self(0x01);
6054 }
6055 #[repr(transparent)]
6056 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6057 pub struct LdmaRx(pub u8);
6058 impl LdmaRx {
6059 #[doc = "Number of data to transfer for receive is even"]
6060 pub const EVEN: Self = Self(0);
6061 #[doc = "Number of data to transfer for receive is odd"]
6062 pub const ODD: Self = Self(0x01);
6063 }
6064 #[repr(transparent)]
6065 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6066 pub struct Cpol(pub u8);
6067 impl Cpol {
6068 #[doc = "CK to 0 when idle"]
6069 pub const IDLELOW: Self = Self(0);
6070 #[doc = "CK to 1 when idle"]
6071 pub const IDLEHIGH: Self = Self(0x01);
6072 }
6073 }
6074 pub mod regs {
6075 use crate::generic::*;
6076 #[doc = "control register 1"]
6077 #[repr(transparent)] 7103 #[repr(transparent)]
6078 #[derive(Copy, Clone, Eq, PartialEq)] 7104 #[derive(Copy, Clone, Eq, PartialEq)]
6079 pub struct Cr1(pub u32); 7105 pub struct Clkcr(pub u32);
6080 impl Cr1 { 7106 impl Clkcr {
6081 #[doc = "Clock phase"] 7107 #[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.."]
6082 pub const fn cpha(&self) -> super::vals::Cpha { 7108 pub const fn clkdiv(&self) -> u16 {
6083 let val = (self.0 >> 0usize) & 0x01; 7109 let val = (self.0 >> 0usize) & 0x03ff;
6084 super::vals::Cpha(val as u8) 7110 val as u16
6085 }
6086 #[doc = "Clock phase"]
6087 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
6088 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
6089 }
6090 #[doc = "Clock polarity"]
6091 pub const fn cpol(&self) -> super::vals::Cpol {
6092 let val = (self.0 >> 1usize) & 0x01;
6093 super::vals::Cpol(val as u8)
6094 }
6095 #[doc = "Clock polarity"]
6096 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
6097 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
6098 }
6099 #[doc = "Master selection"]
6100 pub const fn mstr(&self) -> super::vals::Mstr {
6101 let val = (self.0 >> 2usize) & 0x01;
6102 super::vals::Mstr(val as u8)
6103 }
6104 #[doc = "Master selection"]
6105 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
6106 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
6107 }
6108 #[doc = "Baud rate control"]
6109 pub const fn br(&self) -> super::vals::Br {
6110 let val = (self.0 >> 3usize) & 0x07;
6111 super::vals::Br(val as u8)
6112 } 7111 }
6113 #[doc = "Baud rate control"] 7112 #[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.."]
6114 pub fn set_br(&mut self, val: super::vals::Br) { 7113 pub fn set_clkdiv(&mut self, val: u16) {
6115 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize); 7114 self.0 = (self.0 & !(0x03ff << 0usize)) | (((val as u32) & 0x03ff) << 0usize);
6116 } 7115 }
6117 #[doc = "SPI enable"] 7116 #[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:"]
6118 pub const fn spe(&self) -> bool { 7117 pub const fn pwrsav(&self) -> bool {
6119 let val = (self.0 >> 6usize) & 0x01; 7118 let val = (self.0 >> 12usize) & 0x01;
6120 val != 0 7119 val != 0
6121 } 7120 }
6122 #[doc = "SPI enable"] 7121 #[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:"]
6123 pub fn set_spe(&mut self, val: bool) { 7122 pub fn set_pwrsav(&mut self, val: bool) {
6124 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 7123 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
6125 } 7124 }
6126 #[doc = "Frame format"] 7125 #[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)"]
6127 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst { 7126 pub const fn widbus(&self) -> u8 {
6128 let val = (self.0 >> 7usize) & 0x01; 7127 let val = (self.0 >> 14usize) & 0x03;
6129 super::vals::Lsbfirst(val as u8) 7128 val as u8
6130 } 7129 }
6131 #[doc = "Frame format"] 7130 #[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)"]
6132 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) { 7131 pub fn set_widbus(&mut self, val: u8) {
6133 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 7132 self.0 = (self.0 & !(0x03 << 14usize)) | (((val as u32) & 0x03) << 14usize);
6134 } 7133 }
6135 #[doc = "Internal slave select"] 7134 #[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."]
6136 pub const fn ssi(&self) -> bool { 7135 pub const fn negedge(&self) -> bool {
6137 let val = (self.0 >> 8usize) & 0x01; 7136 let val = (self.0 >> 16usize) & 0x01;
6138 val != 0 7137 val != 0
6139 } 7138 }
6140 #[doc = "Internal slave select"] 7139 #[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."]
6141 pub fn set_ssi(&mut self, val: bool) { 7140 pub fn set_negedge(&mut self, val: bool) {
6142 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 7141 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
6143 } 7142 }
6144 #[doc = "Software slave management"] 7143 #[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."]
6145 pub const fn ssm(&self) -> bool { 7144 pub const fn hwfc_en(&self) -> bool {
6146 let val = (self.0 >> 9usize) & 0x01; 7145 let val = (self.0 >> 17usize) & 0x01;
6147 val != 0 7146 val != 0
6148 } 7147 }
6149 #[doc = "Software slave management"] 7148 #[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."]
6150 pub fn set_ssm(&mut self, val: bool) { 7149 pub fn set_hwfc_en(&mut self, val: bool) {
6151 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 7150 self.0 = (self.0 & !(0x01 << 17usize)) | (((val as u32) & 0x01) << 17usize);
6152 }
6153 #[doc = "Receive only"]
6154 pub const fn rxonly(&self) -> super::vals::Rxonly {
6155 let val = (self.0 >> 10usize) & 0x01;
6156 super::vals::Rxonly(val as u8)
6157 }
6158 #[doc = "Receive only"]
6159 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
6160 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
6161 }
6162 #[doc = "CRC length"]
6163 pub const fn crcl(&self) -> super::vals::Crcl {
6164 let val = (self.0 >> 11usize) & 0x01;
6165 super::vals::Crcl(val as u8)
6166 }
6167 #[doc = "CRC length"]
6168 pub fn set_crcl(&mut self, val: super::vals::Crcl) {
6169 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
6170 }
6171 #[doc = "CRC transfer next"]
6172 pub const fn crcnext(&self) -> super::vals::Crcnext {
6173 let val = (self.0 >> 12usize) & 0x01;
6174 super::vals::Crcnext(val as u8)
6175 }
6176 #[doc = "CRC transfer next"]
6177 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
6178 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
6179 } 7151 }
6180 #[doc = "Hardware CRC calculation enable"] 7152 #[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)"]
6181 pub const fn crcen(&self) -> bool { 7153 pub const fn ddr(&self) -> bool {
6182 let val = (self.0 >> 13usize) & 0x01; 7154 let val = (self.0 >> 18usize) & 0x01;
6183 val != 0 7155 val != 0
6184 } 7156 }
6185 #[doc = "Hardware CRC calculation enable"] 7157 #[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)"]
6186 pub fn set_crcen(&mut self, val: bool) { 7158 pub fn set_ddr(&mut self, val: bool) {
6187 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 7159 self.0 = (self.0 & !(0x01 << 18usize)) | (((val as u32) & 0x01) << 18usize);
6188 } 7160 }
6189 #[doc = "Output enable in bidirectional mode"] 7161 #[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)"]
6190 pub const fn bidioe(&self) -> super::vals::Bidioe { 7162 pub const fn busspeed(&self) -> bool {
6191 let val = (self.0 >> 14usize) & 0x01; 7163 let val = (self.0 >> 19usize) & 0x01;
6192 super::vals::Bidioe(val as u8) 7164 val != 0
6193 } 7165 }
6194 #[doc = "Output enable in bidirectional mode"] 7166 #[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)"]
6195 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) { 7167 pub fn set_busspeed(&mut self, val: bool) {
6196 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 7168 self.0 = (self.0 & !(0x01 << 19usize)) | (((val as u32) & 0x01) << 19usize);
6197 } 7169 }
6198 #[doc = "Bidirectional data mode enable"] 7170 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
6199 pub const fn bidimode(&self) -> super::vals::Bidimode { 7171 pub const fn selclkrx(&self) -> u8 {
6200 let val = (self.0 >> 15usize) & 0x01; 7172 let val = (self.0 >> 20usize) & 0x03;
6201 super::vals::Bidimode(val as u8) 7173 val as u8
6202 } 7174 }
6203 #[doc = "Bidirectional data mode enable"] 7175 #[doc = "Receive clock selection. These bits can only be written when the CPSM and DPSM are not active (CPSMACT = 0 and DPSMACT = 0)"]
6204 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) { 7176 pub fn set_selclkrx(&mut self, val: u8) {
6205 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 7177 self.0 = (self.0 & !(0x03 << 20usize)) | (((val as u32) & 0x03) << 20usize);
6206 } 7178 }
6207 } 7179 }
6208 impl Default for Cr1 { 7180 impl Default for Clkcr {
6209 fn default() -> Cr1 { 7181 fn default() -> Clkcr {
6210 Cr1(0) 7182 Clkcr(0)
6211 } 7183 }
6212 } 7184 }
6213 #[doc = "status register"] 7185 #[doc = "The SDMMC_DCTRL register control the data path state machine (DPSM)."]
6214 #[repr(transparent)] 7186 #[repr(transparent)]
6215 #[derive(Copy, Clone, Eq, PartialEq)] 7187 #[derive(Copy, Clone, Eq, PartialEq)]
6216 pub struct Sr(pub u32); 7188 pub struct Dctrl(pub u32);
6217 impl Sr { 7189 impl Dctrl {
6218 #[doc = "Receive buffer not empty"] 7190 #[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."]
6219 pub const fn rxne(&self) -> bool { 7191 pub const fn dten(&self) -> bool {
6220 let val = (self.0 >> 0usize) & 0x01; 7192 let val = (self.0 >> 0usize) & 0x01;
6221 val != 0 7193 val != 0
6222 } 7194 }
6223 #[doc = "Receive buffer not empty"] 7195 #[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."]
6224 pub fn set_rxne(&mut self, val: bool) { 7196 pub fn set_dten(&mut self, val: bool) {
6225 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7197 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6226 } 7198 }
6227 #[doc = "Transmit buffer empty"] 7199 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6228 pub const fn txe(&self) -> bool { 7200 pub const fn dtdir(&self) -> bool {
6229 let val = (self.0 >> 1usize) & 0x01; 7201 let val = (self.0 >> 1usize) & 0x01;
6230 val != 0 7202 val != 0
6231 } 7203 }
6232 #[doc = "Transmit buffer empty"] 7204 #[doc = "Data transfer direction selection This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6233 pub fn set_txe(&mut self, val: bool) { 7205 pub fn set_dtdir(&mut self, val: bool) {
6234 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 7206 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
6235 } 7207 }
6236 #[doc = "CRC error flag"] 7208 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6237 pub const fn crcerr(&self) -> bool { 7209 pub const fn dtmode(&self) -> u8 {
6238 let val = (self.0 >> 4usize) & 0x01; 7210 let val = (self.0 >> 2usize) & 0x03;
6239 val != 0 7211 val as u8
6240 }
6241 #[doc = "CRC error flag"]
6242 pub fn set_crcerr(&mut self, val: bool) {
6243 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
6244 }
6245 #[doc = "Mode fault"]
6246 pub const fn modf(&self) -> bool {
6247 let val = (self.0 >> 5usize) & 0x01;
6248 val != 0
6249 }
6250 #[doc = "Mode fault"]
6251 pub fn set_modf(&mut self, val: bool) {
6252 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
6253 }
6254 #[doc = "Overrun flag"]
6255 pub const fn ovr(&self) -> bool {
6256 let val = (self.0 >> 6usize) & 0x01;
6257 val != 0
6258 } 7212 }
6259 #[doc = "Overrun flag"] 7213 #[doc = "Data transfer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6260 pub fn set_ovr(&mut self, val: bool) { 7214 pub fn set_dtmode(&mut self, val: u8) {
6261 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 7215 self.0 = (self.0 & !(0x03 << 2usize)) | (((val as u32) & 0x03) << 2usize);
6262 } 7216 }
6263 #[doc = "Busy flag"] 7217 #[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)"]
6264 pub const fn bsy(&self) -> bool { 7218 pub const fn dblocksize(&self) -> u8 {
6265 let val = (self.0 >> 7usize) & 0x01; 7219 let val = (self.0 >> 4usize) & 0x0f;
6266 val != 0 7220 val as u8
6267 } 7221 }
6268 #[doc = "Busy flag"] 7222 #[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)"]
6269 pub fn set_bsy(&mut self, val: bool) { 7223 pub fn set_dblocksize(&mut self, val: u8) {
6270 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 7224 self.0 = (self.0 & !(0x0f << 4usize)) | (((val as u32) & 0x0f) << 4usize);
6271 } 7225 }
6272 #[doc = "Frame format error"] 7226 #[doc = "Read wait start. If this bit is set, read wait operation starts."]
6273 pub const fn fre(&self) -> bool { 7227 pub const fn rwstart(&self) -> bool {
6274 let val = (self.0 >> 8usize) & 0x01; 7228 let val = (self.0 >> 8usize) & 0x01;
6275 val != 0 7229 val != 0
6276 } 7230 }
6277 #[doc = "Frame format error"] 7231 #[doc = "Read wait start. If this bit is set, read wait operation starts."]
6278 pub fn set_fre(&mut self, val: bool) { 7232 pub fn set_rwstart(&mut self, val: bool) {
6279 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 7233 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
6280 } 7234 }
6281 #[doc = "FIFO reception level"] 7235 #[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."]
6282 pub const fn frlvl(&self) -> u8 { 7236 pub const fn rwstop(&self) -> bool {
6283 let val = (self.0 >> 9usize) & 0x03; 7237 let val = (self.0 >> 9usize) & 0x01;
6284 val as u8 7238 val != 0
6285 }
6286 #[doc = "FIFO reception level"]
6287 pub fn set_frlvl(&mut self, val: u8) {
6288 self.0 = (self.0 & !(0x03 << 9usize)) | (((val as u32) & 0x03) << 9usize);
6289 }
6290 #[doc = "FIFO Transmission Level"]
6291 pub const fn ftlvl(&self) -> u8 {
6292 let val = (self.0 >> 11usize) & 0x03;
6293 val as u8
6294 }
6295 #[doc = "FIFO Transmission Level"]
6296 pub fn set_ftlvl(&mut self, val: u8) {
6297 self.0 = (self.0 & !(0x03 << 11usize)) | (((val as u32) & 0x03) << 11usize);
6298 } 7239 }
6299 } 7240 #[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."]
6300 impl Default for Sr { 7241 pub fn set_rwstop(&mut self, val: bool) {
6301 fn default() -> Sr { 7242 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
6302 Sr(0)
6303 } 7243 }
6304 } 7244 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6305 #[doc = "control register 2"] 7245 pub const fn rwmod(&self) -> bool {
6306 #[repr(transparent)] 7246 let val = (self.0 >> 10usize) & 0x01;
6307 #[derive(Copy, Clone, Eq, PartialEq)]
6308 pub struct Cr2(pub u32);
6309 impl Cr2 {
6310 #[doc = "Rx buffer DMA enable"]
6311 pub const fn rxdmaen(&self) -> bool {
6312 let val = (self.0 >> 0usize) & 0x01;
6313 val != 0 7247 val != 0
6314 } 7248 }
6315 #[doc = "Rx buffer DMA enable"] 7249 #[doc = "Read wait mode. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6316 pub fn set_rxdmaen(&mut self, val: bool) { 7250 pub fn set_rwmod(&mut self, val: bool) {
6317 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7251 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
6318 } 7252 }
6319 #[doc = "Tx buffer DMA enable"] 7253 #[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."]
6320 pub const fn txdmaen(&self) -> bool { 7254 pub const fn sdioen(&self) -> bool {
6321 let val = (self.0 >> 1usize) & 0x01; 7255 let val = (self.0 >> 11usize) & 0x01;
6322 val != 0 7256 val != 0
6323 } 7257 }
6324 #[doc = "Tx buffer DMA enable"] 7258 #[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."]
6325 pub fn set_txdmaen(&mut self, val: bool) { 7259 pub fn set_sdioen(&mut self, val: bool) {
6326 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 7260 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
6327 } 7261 }
6328 #[doc = "SS output enable"] 7262 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6329 pub const fn ssoe(&self) -> bool { 7263 pub const fn bootacken(&self) -> bool {
6330 let val = (self.0 >> 2usize) & 0x01; 7264 let val = (self.0 >> 12usize) & 0x01;
6331 val != 0 7265 val != 0
6332 } 7266 }
6333 #[doc = "SS output enable"] 7267 #[doc = "Enable the reception of the boot acknowledgment. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6334 pub fn set_ssoe(&mut self, val: bool) { 7268 pub fn set_bootacken(&mut self, val: bool) {
6335 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 7269 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
6336 } 7270 }
6337 #[doc = "NSS pulse management"] 7271 #[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."]
6338 pub const fn nssp(&self) -> bool { 7272 pub const fn fiforst(&self) -> bool {
6339 let val = (self.0 >> 3usize) & 0x01; 7273 let val = (self.0 >> 13usize) & 0x01;
6340 val != 0 7274 val != 0
6341 } 7275 }
6342 #[doc = "NSS pulse management"] 7276 #[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."]
6343 pub fn set_nssp(&mut self, val: bool) { 7277 pub fn set_fiforst(&mut self, val: bool) {
6344 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize); 7278 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
6345 }
6346 #[doc = "Frame format"]
6347 pub const fn frf(&self) -> super::vals::Frf {
6348 let val = (self.0 >> 4usize) & 0x01;
6349 super::vals::Frf(val as u8)
6350 } 7279 }
6351 #[doc = "Frame format"] 7280 }
6352 pub fn set_frf(&mut self, val: super::vals::Frf) { 7281 impl Default for Dctrl {
6353 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 7282 fn default() -> Dctrl {
7283 Dctrl(0)
6354 } 7284 }
6355 #[doc = "Error interrupt enable"] 7285 }
6356 pub const fn errie(&self) -> bool { 7286 #[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)."]
6357 let val = (self.0 >> 5usize) & 0x01; 7287 #[repr(transparent)]
6358 val != 0 7288 #[derive(Copy, Clone, Eq, PartialEq)]
7289 pub struct Cmdr(pub u32);
7290 impl Cmdr {
7291 #[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."]
7292 pub const fn cmdindex(&self) -> u8 {
7293 let val = (self.0 >> 0usize) & 0x3f;
7294 val as u8
6359 } 7295 }
6360 #[doc = "Error interrupt enable"] 7296 #[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."]
6361 pub fn set_errie(&mut self, val: bool) { 7297 pub fn set_cmdindex(&mut self, val: u8) {
6362 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 7298 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
6363 } 7299 }
6364 #[doc = "RX buffer not empty interrupt enable"] 7300 #[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."]
6365 pub const fn rxneie(&self) -> bool { 7301 pub const fn cmdtrans(&self) -> bool {
6366 let val = (self.0 >> 6usize) & 0x01; 7302 let val = (self.0 >> 6usize) & 0x01;
6367 val != 0 7303 val != 0
6368 } 7304 }
6369 #[doc = "RX buffer not empty interrupt enable"] 7305 #[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."]
6370 pub fn set_rxneie(&mut self, val: bool) { 7306 pub fn set_cmdtrans(&mut self, val: bool) {
6371 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 7307 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
6372 } 7308 }
6373 #[doc = "Tx buffer empty interrupt enable"] 7309 #[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."]
6374 pub const fn txeie(&self) -> bool { 7310 pub const fn cmdstop(&self) -> bool {
6375 let val = (self.0 >> 7usize) & 0x01; 7311 let val = (self.0 >> 7usize) & 0x01;
6376 val != 0 7312 val != 0
6377 } 7313 }
6378 #[doc = "Tx buffer empty interrupt enable"] 7314 #[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."]
6379 pub fn set_txeie(&mut self, val: bool) { 7315 pub fn set_cmdstop(&mut self, val: bool) {
6380 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 7316 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
6381 } 7317 }
6382 #[doc = "Data size"] 7318 #[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."]
6383 pub const fn ds(&self) -> super::vals::Ds { 7319 pub const fn waitresp(&self) -> u8 {
6384 let val = (self.0 >> 8usize) & 0x0f; 7320 let val = (self.0 >> 8usize) & 0x03;
6385 super::vals::Ds(val as u8) 7321 val as u8
6386 }
6387 #[doc = "Data size"]
6388 pub fn set_ds(&mut self, val: super::vals::Ds) {
6389 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
6390 }
6391 #[doc = "FIFO reception threshold"]
6392 pub const fn frxth(&self) -> super::vals::Frxth {
6393 let val = (self.0 >> 12usize) & 0x01;
6394 super::vals::Frxth(val as u8)
6395 }
6396 #[doc = "FIFO reception threshold"]
6397 pub fn set_frxth(&mut self, val: super::vals::Frxth) {
6398 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
6399 }
6400 #[doc = "Last DMA transfer for reception"]
6401 pub const fn ldma_rx(&self) -> super::vals::LdmaRx {
6402 let val = (self.0 >> 13usize) & 0x01;
6403 super::vals::LdmaRx(val as u8)
6404 }
6405 #[doc = "Last DMA transfer for reception"]
6406 pub fn set_ldma_rx(&mut self, val: super::vals::LdmaRx) {
6407 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
6408 }
6409 #[doc = "Last DMA transfer for transmission"]
6410 pub const fn ldma_tx(&self) -> super::vals::LdmaTx {
6411 let val = (self.0 >> 14usize) & 0x01;
6412 super::vals::LdmaTx(val as u8)
6413 }
6414 #[doc = "Last DMA transfer for transmission"]
6415 pub fn set_ldma_tx(&mut self, val: super::vals::LdmaTx) {
6416 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
6417 }
6418 }
6419 impl Default for Cr2 {
6420 fn default() -> Cr2 {
6421 Cr2(0)
6422 }
6423 }
6424 #[doc = "data register"]
6425 #[repr(transparent)]
6426 #[derive(Copy, Clone, Eq, PartialEq)]
6427 pub struct Dr(pub u32);
6428 impl Dr {
6429 #[doc = "Data register"]
6430 pub const fn dr(&self) -> u16 {
6431 let val = (self.0 >> 0usize) & 0xffff;
6432 val as u16
6433 }
6434 #[doc = "Data register"]
6435 pub fn set_dr(&mut self, val: u16) {
6436 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
6437 }
6438 }
6439 impl Default for Dr {
6440 fn default() -> Dr {
6441 Dr(0)
6442 }
6443 }
6444 #[doc = "CRC polynomial register"]
6445 #[repr(transparent)]
6446 #[derive(Copy, Clone, Eq, PartialEq)]
6447 pub struct Crcpr(pub u32);
6448 impl Crcpr {
6449 #[doc = "CRC polynomial register"]
6450 pub const fn crcpoly(&self) -> u16 {
6451 let val = (self.0 >> 0usize) & 0xffff;
6452 val as u16
6453 }
6454 #[doc = "CRC polynomial register"]
6455 pub fn set_crcpoly(&mut self, val: u16) {
6456 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
6457 }
6458 }
6459 impl Default for Crcpr {
6460 fn default() -> Crcpr {
6461 Crcpr(0)
6462 }
6463 }
6464 #[doc = "RX CRC register"]
6465 #[repr(transparent)]
6466 #[derive(Copy, Clone, Eq, PartialEq)]
6467 pub struct Rxcrcr(pub u32);
6468 impl Rxcrcr {
6469 #[doc = "Rx CRC register"]
6470 pub const fn rx_crc(&self) -> u16 {
6471 let val = (self.0 >> 0usize) & 0xffff;
6472 val as u16
6473 } 7322 }
6474 #[doc = "Rx CRC register"] 7323 #[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."]
6475 pub fn set_rx_crc(&mut self, val: u16) { 7324 pub fn set_waitresp(&mut self, val: u8) {
6476 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 7325 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize);
6477 } 7326 }
6478 } 7327 #[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."]
6479 impl Default for Rxcrcr { 7328 pub const fn waitint(&self) -> bool {
6480 fn default() -> Rxcrcr { 7329 let val = (self.0 >> 10usize) & 0x01;
6481 Rxcrcr(0) 7330 val != 0
6482 } 7331 }
6483 } 7332 #[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."]
6484 #[doc = "TX CRC register"] 7333 pub fn set_waitint(&mut self, val: bool) {
6485 #[repr(transparent)] 7334 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
6486 #[derive(Copy, Clone, Eq, PartialEq)]
6487 pub struct Txcrcr(pub u32);
6488 impl Txcrcr {
6489 #[doc = "Tx CRC register"]
6490 pub const fn tx_crc(&self) -> u16 {
6491 let val = (self.0 >> 0usize) & 0xffff;
6492 val as u16
6493 } 7335 }
6494 #[doc = "Tx CRC register"] 7336 #[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."]
6495 pub fn set_tx_crc(&mut self, val: u16) { 7337 pub const fn waitpend(&self) -> bool {
6496 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 7338 let val = (self.0 >> 11usize) & 0x01;
7339 val != 0
6497 } 7340 }
6498 } 7341 #[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."]
6499 impl Default for Txcrcr { 7342 pub fn set_waitpend(&mut self, val: bool) {
6500 fn default() -> Txcrcr { 7343 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
6501 Txcrcr(0)
6502 } 7344 }
6503 } 7345 #[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."]
6504 } 7346 pub const fn cpsmen(&self) -> bool {
6505} 7347 let val = (self.0 >> 12usize) & 0x01;
6506pub mod dma_v2 {
6507 use crate::generic::*;
6508 #[doc = "DMA controller"]
6509 #[derive(Copy, Clone)]
6510 pub struct Dma(pub *mut u8);
6511 unsafe impl Send for Dma {}
6512 unsafe impl Sync for Dma {}
6513 impl Dma {
6514 #[doc = "low interrupt status register"]
6515 pub fn isr(self, n: usize) -> Reg<regs::Isr, R> {
6516 assert!(n < 2usize);
6517 unsafe { Reg::from_ptr(self.0.add(0usize + n * 4usize)) }
6518 }
6519 #[doc = "low interrupt flag clear register"]
6520 pub fn ifcr(self, n: usize) -> Reg<regs::Ifcr, W> {
6521 assert!(n < 2usize);
6522 unsafe { Reg::from_ptr(self.0.add(8usize + n * 4usize)) }
6523 }
6524 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"]
6525 pub fn st(self, n: usize) -> St {
6526 assert!(n < 8usize);
6527 unsafe { St(self.0.add(16usize + n * 24usize)) }
6528 }
6529 }
6530 #[doc = "Stream cluster: S?CR, S?NDTR, S?M0AR, S?M1AR and S?FCR registers"]
6531 #[derive(Copy, Clone)]
6532 pub struct St(pub *mut u8);
6533 unsafe impl Send for St {}
6534 unsafe impl Sync for St {}
6535 impl St {
6536 #[doc = "stream x configuration register"]
6537 pub fn cr(self) -> Reg<regs::Cr, RW> {
6538 unsafe { Reg::from_ptr(self.0.add(0usize)) }
6539 }
6540 #[doc = "stream x number of data register"]
6541 pub fn ndtr(self) -> Reg<regs::Ndtr, RW> {
6542 unsafe { Reg::from_ptr(self.0.add(4usize)) }
6543 }
6544 #[doc = "stream x peripheral address register"]
6545 pub fn par(self) -> Reg<u32, RW> {
6546 unsafe { Reg::from_ptr(self.0.add(8usize)) }
6547 }
6548 #[doc = "stream x memory 0 address register"]
6549 pub fn m0ar(self) -> Reg<u32, RW> {
6550 unsafe { Reg::from_ptr(self.0.add(12usize)) }
6551 }
6552 #[doc = "stream x memory 1 address register"]
6553 pub fn m1ar(self) -> Reg<u32, RW> {
6554 unsafe { Reg::from_ptr(self.0.add(16usize)) }
6555 }
6556 #[doc = "stream x FIFO control register"]
6557 pub fn fcr(self) -> Reg<regs::Fcr, RW> {
6558 unsafe { Reg::from_ptr(self.0.add(20usize)) }
6559 }
6560 }
6561 pub mod vals {
6562 use crate::generic::*;
6563 #[repr(transparent)]
6564 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6565 pub struct Pincos(pub u8);
6566 impl Pincos {
6567 #[doc = "The offset size for the peripheral address calculation is linked to the PSIZE"]
6568 pub const PSIZE: Self = Self(0);
6569 #[doc = "The offset size for the peripheral address calculation is fixed to 4 (32-bit alignment)"]
6570 pub const FIXED4: Self = Self(0x01);
6571 }
6572 #[repr(transparent)]
6573 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6574 pub struct Fs(pub u8);
6575 impl Fs {
6576 #[doc = "0 < fifo_level < 1/4"]
6577 pub const QUARTER1: Self = Self(0);
6578 #[doc = "1/4 <= fifo_level < 1/2"]
6579 pub const QUARTER2: Self = Self(0x01);
6580 #[doc = "1/2 <= fifo_level < 3/4"]
6581 pub const QUARTER3: Self = Self(0x02);
6582 #[doc = "3/4 <= fifo_level < full"]
6583 pub const QUARTER4: Self = Self(0x03);
6584 #[doc = "FIFO is empty"]
6585 pub const EMPTY: Self = Self(0x04);
6586 #[doc = "FIFO is full"]
6587 pub const FULL: Self = Self(0x05);
6588 }
6589 #[repr(transparent)]
6590 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6591 pub struct Burst(pub u8);
6592 impl Burst {
6593 #[doc = "Single transfer"]
6594 pub const SINGLE: Self = Self(0);
6595 #[doc = "Incremental burst of 4 beats"]
6596 pub const INCR4: Self = Self(0x01);
6597 #[doc = "Incremental burst of 8 beats"]
6598 pub const INCR8: Self = Self(0x02);
6599 #[doc = "Incremental burst of 16 beats"]
6600 pub const INCR16: Self = Self(0x03);
6601 }
6602 #[repr(transparent)]
6603 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6604 pub struct Dbm(pub u8);
6605 impl Dbm {
6606 #[doc = "No buffer switching at the end of transfer"]
6607 pub const DISABLED: Self = Self(0);
6608 #[doc = "Memory target switched at the end of the DMA transfer"]
6609 pub const ENABLED: Self = Self(0x01);
6610 }
6611 #[repr(transparent)]
6612 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6613 pub struct Inc(pub u8);
6614 impl Inc {
6615 #[doc = "Address pointer is fixed"]
6616 pub const FIXED: Self = Self(0);
6617 #[doc = "Address pointer is incremented after each data transfer"]
6618 pub const INCREMENTED: Self = Self(0x01);
6619 }
6620 #[repr(transparent)]
6621 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6622 pub struct Dir(pub u8);
6623 impl Dir {
6624 #[doc = "Peripheral-to-memory"]
6625 pub const PERIPHERALTOMEMORY: Self = Self(0);
6626 #[doc = "Memory-to-peripheral"]
6627 pub const MEMORYTOPERIPHERAL: Self = Self(0x01);
6628 #[doc = "Memory-to-memory"]
6629 pub const MEMORYTOMEMORY: Self = Self(0x02);
6630 }
6631 #[repr(transparent)]
6632 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6633 pub struct Pfctrl(pub u8);
6634 impl Pfctrl {
6635 #[doc = "The DMA is the flow controller"]
6636 pub const DMA: Self = Self(0);
6637 #[doc = "The peripheral is the flow controller"]
6638 pub const PERIPHERAL: Self = Self(0x01);
6639 }
6640 #[repr(transparent)]
6641 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6642 pub struct Pl(pub u8);
6643 impl Pl {
6644 #[doc = "Low"]
6645 pub const LOW: Self = Self(0);
6646 #[doc = "Medium"]
6647 pub const MEDIUM: Self = Self(0x01);
6648 #[doc = "High"]
6649 pub const HIGH: Self = Self(0x02);
6650 #[doc = "Very high"]
6651 pub const VERYHIGH: Self = Self(0x03);
6652 }
6653 #[repr(transparent)]
6654 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6655 pub struct Circ(pub u8);
6656 impl Circ {
6657 #[doc = "Circular mode disabled"]
6658 pub const DISABLED: Self = Self(0);
6659 #[doc = "Circular mode enabled"]
6660 pub const ENABLED: Self = Self(0x01);
6661 }
6662 #[repr(transparent)]
6663 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6664 pub struct Fth(pub u8);
6665 impl Fth {
6666 #[doc = "1/4 full FIFO"]
6667 pub const QUARTER: Self = Self(0);
6668 #[doc = "1/2 full FIFO"]
6669 pub const HALF: Self = Self(0x01);
6670 #[doc = "3/4 full FIFO"]
6671 pub const THREEQUARTERS: Self = Self(0x02);
6672 #[doc = "Full FIFO"]
6673 pub const FULL: Self = Self(0x03);
6674 }
6675 #[repr(transparent)]
6676 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6677 pub struct Ct(pub u8);
6678 impl Ct {
6679 #[doc = "The current target memory is Memory 0"]
6680 pub const MEMORY0: Self = Self(0);
6681 #[doc = "The current target memory is Memory 1"]
6682 pub const MEMORY1: Self = Self(0x01);
6683 }
6684 #[repr(transparent)]
6685 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6686 pub struct Dmdis(pub u8);
6687 impl Dmdis {
6688 #[doc = "Direct mode is enabled"]
6689 pub const ENABLED: Self = Self(0);
6690 #[doc = "Direct mode is disabled"]
6691 pub const DISABLED: Self = Self(0x01);
6692 }
6693 #[repr(transparent)]
6694 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
6695 pub struct Size(pub u8);
6696 impl Size {
6697 #[doc = "Byte (8-bit)"]
6698 pub const BITS8: Self = Self(0);
6699 #[doc = "Half-word (16-bit)"]
6700 pub const BITS16: Self = Self(0x01);
6701 #[doc = "Word (32-bit)"]
6702 pub const BITS32: Self = Self(0x02);
6703 }
6704 }
6705 pub mod regs {
6706 use crate::generic::*;
6707 #[doc = "low interrupt flag clear register"]
6708 #[repr(transparent)]
6709 #[derive(Copy, Clone, Eq, PartialEq)]
6710 pub struct Ifcr(pub u32);
6711 impl Ifcr {
6712 #[doc = "Stream x clear FIFO error interrupt flag (x = 3..0)"]
6713 pub fn cfeif(&self, n: usize) -> bool {
6714 assert!(n < 4usize);
6715 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6716 let val = (self.0 >> offs) & 0x01;
6717 val != 0 7348 val != 0
6718 } 7349 }
6719 #[doc = "Stream x clear FIFO error interrupt flag (x = 3..0)"] 7350 #[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."]
6720 pub fn set_cfeif(&mut self, n: usize, val: bool) { 7351 pub fn set_cpsmen(&mut self, val: bool) {
6721 assert!(n < 4usize); 7352 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize);
6722 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6723 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6724 } 7353 }
6725 #[doc = "Stream x clear direct mode error interrupt flag (x = 3..0)"] 7354 #[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."]
6726 pub fn cdmeif(&self, n: usize) -> bool { 7355 pub const fn dthold(&self) -> bool {
6727 assert!(n < 4usize); 7356 let val = (self.0 >> 13usize) & 0x01;
6728 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6729 let val = (self.0 >> offs) & 0x01;
6730 val != 0 7357 val != 0
6731 } 7358 }
6732 #[doc = "Stream x clear direct mode error interrupt flag (x = 3..0)"] 7359 #[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."]
6733 pub fn set_cdmeif(&mut self, n: usize, val: bool) { 7360 pub fn set_dthold(&mut self, val: bool) {
6734 assert!(n < 4usize); 7361 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
6735 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6736 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6737 } 7362 }
6738 #[doc = "Stream x clear transfer error interrupt flag (x = 3..0)"] 7363 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
6739 pub fn cteif(&self, n: usize) -> bool { 7364 pub const fn bootmode(&self) -> bool {
6740 assert!(n < 4usize); 7365 let val = (self.0 >> 14usize) & 0x01;
6741 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6742 let val = (self.0 >> offs) & 0x01;
6743 val != 0 7366 val != 0
6744 } 7367 }
6745 #[doc = "Stream x clear transfer error interrupt flag (x = 3..0)"] 7368 #[doc = "Select the boot mode procedure to be used. This bit can only be written by firmware when CPSM is disabled (CPSMEN = 0)"]
6746 pub fn set_cteif(&mut self, n: usize, val: bool) { 7369 pub fn set_bootmode(&mut self, val: bool) {
6747 assert!(n < 4usize); 7370 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
6748 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6749 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6750 } 7371 }
6751 #[doc = "Stream x clear half transfer interrupt flag (x = 3..0)"] 7372 #[doc = "Enable boot mode procedure."]
6752 pub fn chtif(&self, n: usize) -> bool { 7373 pub const fn booten(&self) -> bool {
6753 assert!(n < 4usize); 7374 let val = (self.0 >> 15usize) & 0x01;
6754 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6755 let val = (self.0 >> offs) & 0x01;
6756 val != 0 7375 val != 0
6757 } 7376 }
6758 #[doc = "Stream x clear half transfer interrupt flag (x = 3..0)"] 7377 #[doc = "Enable boot mode procedure."]
6759 pub fn set_chtif(&mut self, n: usize, val: bool) { 7378 pub fn set_booten(&mut self, val: bool) {
6760 assert!(n < 4usize); 7379 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize);
6761 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6762 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6763 } 7380 }
6764 #[doc = "Stream x clear transfer complete interrupt flag (x = 3..0)"] 7381 #[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."]
6765 pub fn ctcif(&self, n: usize) -> bool { 7382 pub const fn cmdsuspend(&self) -> bool {
6766 assert!(n < 4usize); 7383 let val = (self.0 >> 16usize) & 0x01;
6767 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6768 let val = (self.0 >> offs) & 0x01;
6769 val != 0 7384 val != 0
6770 } 7385 }
6771 #[doc = "Stream x clear transfer complete interrupt flag (x = 3..0)"] 7386 #[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."]
6772 pub fn set_ctcif(&mut self, n: usize, val: bool) { 7387 pub fn set_cmdsuspend(&mut self, val: bool) {
6773 assert!(n < 4usize); 7388 self.0 = (self.0 & !(0x01 << 16usize)) | (((val as u32) & 0x01) << 16usize);
6774 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6775 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6776 } 7389 }
6777 } 7390 }
6778 impl Default for Ifcr { 7391 impl Default for Cmdr {
6779 fn default() -> Ifcr { 7392 fn default() -> Cmdr {
6780 Ifcr(0) 7393 Cmdr(0)
6781 } 7394 }
6782 } 7395 }
6783 #[doc = "stream x FIFO control register"] 7396 #[doc = "SDMMC command response register"]
6784 #[repr(transparent)] 7397 #[repr(transparent)]
6785 #[derive(Copy, Clone, Eq, PartialEq)] 7398 #[derive(Copy, Clone, Eq, PartialEq)]
6786 pub struct Fcr(pub u32); 7399 pub struct Respcmdr(pub u32);
6787 impl Fcr { 7400 impl Respcmdr {
6788 #[doc = "FIFO threshold selection"] 7401 #[doc = "Response command index"]
6789 pub const fn fth(&self) -> super::vals::Fth { 7402 pub const fn respcmd(&self) -> u8 {
6790 let val = (self.0 >> 0usize) & 0x03; 7403 let val = (self.0 >> 0usize) & 0x3f;
6791 super::vals::Fth(val as u8) 7404 val as u8
6792 }
6793 #[doc = "FIFO threshold selection"]
6794 pub fn set_fth(&mut self, val: super::vals::Fth) {
6795 self.0 = (self.0 & !(0x03 << 0usize)) | (((val.0 as u32) & 0x03) << 0usize);
6796 }
6797 #[doc = "Direct mode disable"]
6798 pub const fn dmdis(&self) -> super::vals::Dmdis {
6799 let val = (self.0 >> 2usize) & 0x01;
6800 super::vals::Dmdis(val as u8)
6801 }
6802 #[doc = "Direct mode disable"]
6803 pub fn set_dmdis(&mut self, val: super::vals::Dmdis) {
6804 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
6805 }
6806 #[doc = "FIFO status"]
6807 pub const fn fs(&self) -> super::vals::Fs {
6808 let val = (self.0 >> 3usize) & 0x07;
6809 super::vals::Fs(val as u8)
6810 }
6811 #[doc = "FIFO status"]
6812 pub fn set_fs(&mut self, val: super::vals::Fs) {
6813 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
6814 }
6815 #[doc = "FIFO error interrupt enable"]
6816 pub const fn feie(&self) -> bool {
6817 let val = (self.0 >> 7usize) & 0x01;
6818 val != 0
6819 } 7405 }
6820 #[doc = "FIFO error interrupt enable"] 7406 #[doc = "Response command index"]
6821 pub fn set_feie(&mut self, val: bool) { 7407 pub fn set_respcmd(&mut self, val: u8) {
6822 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 7408 self.0 = (self.0 & !(0x3f << 0usize)) | (((val as u32) & 0x3f) << 0usize);
6823 } 7409 }
6824 } 7410 }
6825 impl Default for Fcr { 7411 impl Default for Respcmdr {
6826 fn default() -> Fcr { 7412 fn default() -> Respcmdr {
6827 Fcr(0) 7413 Respcmdr(0)
6828 } 7414 }
6829 } 7415 }
6830 #[doc = "stream x number of data register"] 7416 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
6831 #[repr(transparent)] 7417 #[repr(transparent)]
6832 #[derive(Copy, Clone, Eq, PartialEq)] 7418 #[derive(Copy, Clone, Eq, PartialEq)]
6833 pub struct Ndtr(pub u32); 7419 pub struct Resp4r(pub u32);
6834 impl Ndtr { 7420 impl Resp4r {
6835 #[doc = "Number of data items to transfer"] 7421 #[doc = "see Table404."]
6836 pub const fn ndt(&self) -> u16 { 7422 pub const fn cardstatus4(&self) -> u32 {
6837 let val = (self.0 >> 0usize) & 0xffff; 7423 let val = (self.0 >> 0usize) & 0xffff_ffff;
6838 val as u16 7424 val as u32
6839 } 7425 }
6840 #[doc = "Number of data items to transfer"] 7426 #[doc = "see Table404."]
6841 pub fn set_ndt(&mut self, val: u16) { 7427 pub fn set_cardstatus4(&mut self, val: u32) {
6842 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 7428 self.0 =
7429 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
6843 } 7430 }
6844 } 7431 }
6845 impl Default for Ndtr { 7432 impl Default for Resp4r {
6846 fn default() -> Ndtr { 7433 fn default() -> Resp4r {
6847 Ndtr(0) 7434 Resp4r(0)
6848 } 7435 }
6849 } 7436 }
6850 #[doc = "low interrupt status register"] 7437 #[doc = "The SDMMC_RESP1/2/3/4R registers contain the status of a card, which is part of the received response."]
6851 #[repr(transparent)] 7438 #[repr(transparent)]
6852 #[derive(Copy, Clone, Eq, PartialEq)] 7439 #[derive(Copy, Clone, Eq, PartialEq)]
6853 pub struct Isr(pub u32); 7440 pub struct Resp2r(pub u32);
6854 impl Isr { 7441 impl Resp2r {
6855 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"] 7442 #[doc = "see Table404."]
6856 pub fn feif(&self, n: usize) -> bool { 7443 pub const fn cardstatus2(&self) -> u32 {
6857 assert!(n < 4usize); 7444 let val = (self.0 >> 0usize) & 0xffff_ffff;
6858 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); 7445 val as u32
6859 let val = (self.0 >> offs) & 0x01;
6860 val != 0
6861 }
6862 #[doc = "Stream x FIFO error interrupt flag (x=3..0)"]
6863 pub fn set_feif(&mut self, n: usize, val: bool) {
6864 assert!(n < 4usize);
6865 let offs = 0usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6866 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6867 }
6868 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"]
6869 pub fn dmeif(&self, n: usize) -> bool {
6870 assert!(n < 4usize);
6871 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6872 let val = (self.0 >> offs) & 0x01;
6873 val != 0
6874 }
6875 #[doc = "Stream x direct mode error interrupt flag (x=3..0)"]
6876 pub fn set_dmeif(&mut self, n: usize, val: bool) {
6877 assert!(n < 4usize);
6878 let offs = 2usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6879 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6880 }
6881 #[doc = "Stream x transfer error interrupt flag (x=3..0)"]
6882 pub fn teif(&self, n: usize) -> bool {
6883 assert!(n < 4usize);
6884 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6885 let val = (self.0 >> offs) & 0x01;
6886 val != 0
6887 }
6888 #[doc = "Stream x transfer error interrupt flag (x=3..0)"]
6889 pub fn set_teif(&mut self, n: usize, val: bool) {
6890 assert!(n < 4usize);
6891 let offs = 3usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6892 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6893 }
6894 #[doc = "Stream x half transfer interrupt flag (x=3..0)"]
6895 pub fn htif(&self, n: usize) -> bool {
6896 assert!(n < 4usize);
6897 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6898 let val = (self.0 >> offs) & 0x01;
6899 val != 0
6900 }
6901 #[doc = "Stream x half transfer interrupt flag (x=3..0)"]
6902 pub fn set_htif(&mut self, n: usize, val: bool) {
6903 assert!(n < 4usize);
6904 let offs = 4usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6905 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6906 }
6907 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"]
6908 pub fn tcif(&self, n: usize) -> bool {
6909 assert!(n < 4usize);
6910 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize);
6911 let val = (self.0 >> offs) & 0x01;
6912 val != 0
6913 } 7446 }
6914 #[doc = "Stream x transfer complete interrupt flag (x = 3..0)"] 7447 #[doc = "see Table404."]
6915 pub fn set_tcif(&mut self, n: usize, val: bool) { 7448 pub fn set_cardstatus2(&mut self, val: u32) {
6916 assert!(n < 4usize); 7449 self.0 =
6917 let offs = 5usize + ([0usize, 6usize, 16usize, 22usize][n] as usize); 7450 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
6918 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
6919 } 7451 }
6920 } 7452 }
6921 impl Default for Isr { 7453 impl Default for Resp2r {
6922 fn default() -> Isr { 7454 fn default() -> Resp2r {
6923 Isr(0) 7455 Resp2r(0)
6924 } 7456 }
6925 } 7457 }
6926 #[doc = "stream x configuration register"] 7458 #[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."]
6927 #[repr(transparent)] 7459 #[repr(transparent)]
6928 #[derive(Copy, Clone, Eq, PartialEq)] 7460 #[derive(Copy, Clone, Eq, PartialEq)]
6929 pub struct Cr(pub u32); 7461 pub struct Idmactrlr(pub u32);
6930 impl Cr { 7462 impl Idmactrlr {
6931 #[doc = "Stream enable / flag stream ready when read low"] 7463 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6932 pub const fn en(&self) -> bool { 7464 pub const fn idmaen(&self) -> bool {
6933 let val = (self.0 >> 0usize) & 0x01; 7465 let val = (self.0 >> 0usize) & 0x01;
6934 val != 0 7466 val != 0
6935 } 7467 }
6936 #[doc = "Stream enable / flag stream ready when read low"] 7468 #[doc = "IDMA enable This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6937 pub fn set_en(&mut self, val: bool) { 7469 pub fn set_idmaen(&mut self, val: bool) {
6938 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7470 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
6939 } 7471 }
6940 #[doc = "Direct mode error interrupt enable"] 7472 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6941 pub const fn dmeie(&self) -> bool { 7473 pub const fn idmabmode(&self) -> bool {
6942 let val = (self.0 >> 1usize) & 0x01; 7474 let val = (self.0 >> 1usize) & 0x01;
6943 val != 0 7475 val != 0
6944 } 7476 }
6945 #[doc = "Direct mode error interrupt enable"] 7477 #[doc = "Buffer mode selection. This bit can only be written by firmware when DPSM is inactive (DPSMACT = 0)."]
6946 pub fn set_dmeie(&mut self, val: bool) { 7478 pub fn set_idmabmode(&mut self, val: bool) {
6947 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 7479 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
6948 } 7480 }
6949 #[doc = "Transfer error interrupt enable"] 7481 #[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."]
6950 pub const fn teie(&self) -> bool { 7482 pub const fn idmabact(&self) -> bool {
6951 let val = (self.0 >> 2usize) & 0x01; 7483 let val = (self.0 >> 2usize) & 0x01;
6952 val != 0 7484 val != 0
6953 } 7485 }
6954 #[doc = "Transfer error interrupt enable"] 7486 #[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."]
6955 pub fn set_teie(&mut self, val: bool) { 7487 pub fn set_idmabact(&mut self, val: bool) {
6956 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 7488 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
6957 } 7489 }
6958 #[doc = "Half transfer interrupt enable"] 7490 }
6959 pub const fn htie(&self) -> bool { 7491 impl Default for Idmactrlr {
6960 let val = (self.0 >> 3usize) & 0x01; 7492 fn default() -> Idmactrlr {
6961 val != 0 7493 Idmactrlr(0)
6962 }
6963 #[doc = "Half transfer interrupt enable"]
6964 pub fn set_htie(&mut self, val: bool) {
6965 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
6966 }
6967 #[doc = "Transfer complete interrupt enable"]
6968 pub const fn tcie(&self) -> bool {
6969 let val = (self.0 >> 4usize) & 0x01;
6970 val != 0
6971 }
6972 #[doc = "Transfer complete interrupt enable"]
6973 pub fn set_tcie(&mut self, val: bool) {
6974 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
6975 }
6976 #[doc = "Peripheral flow controller"]
6977 pub const fn pfctrl(&self) -> super::vals::Pfctrl {
6978 let val = (self.0 >> 5usize) & 0x01;
6979 super::vals::Pfctrl(val as u8)
6980 }
6981 #[doc = "Peripheral flow controller"]
6982 pub fn set_pfctrl(&mut self, val: super::vals::Pfctrl) {
6983 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
6984 }
6985 #[doc = "Data transfer direction"]
6986 pub const fn dir(&self) -> super::vals::Dir {
6987 let val = (self.0 >> 6usize) & 0x03;
6988 super::vals::Dir(val as u8)
6989 }
6990 #[doc = "Data transfer direction"]
6991 pub fn set_dir(&mut self, val: super::vals::Dir) {
6992 self.0 = (self.0 & !(0x03 << 6usize)) | (((val.0 as u32) & 0x03) << 6usize);
6993 }
6994 #[doc = "Circular mode"]
6995 pub const fn circ(&self) -> super::vals::Circ {
6996 let val = (self.0 >> 8usize) & 0x01;
6997 super::vals::Circ(val as u8)
6998 }
6999 #[doc = "Circular mode"]
7000 pub fn set_circ(&mut self, val: super::vals::Circ) {
7001 self.0 = (self.0 & !(0x01 << 8usize)) | (((val.0 as u32) & 0x01) << 8usize);
7002 }
7003 #[doc = "Peripheral increment mode"]
7004 pub const fn pinc(&self) -> super::vals::Inc {
7005 let val = (self.0 >> 9usize) & 0x01;
7006 super::vals::Inc(val as u8)
7007 }
7008 #[doc = "Peripheral increment mode"]
7009 pub fn set_pinc(&mut self, val: super::vals::Inc) {
7010 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
7011 }
7012 #[doc = "Memory increment mode"]
7013 pub const fn minc(&self) -> super::vals::Inc {
7014 let val = (self.0 >> 10usize) & 0x01;
7015 super::vals::Inc(val as u8)
7016 }
7017 #[doc = "Memory increment mode"]
7018 pub fn set_minc(&mut self, val: super::vals::Inc) {
7019 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
7020 }
7021 #[doc = "Peripheral data size"]
7022 pub const fn psize(&self) -> super::vals::Size {
7023 let val = (self.0 >> 11usize) & 0x03;
7024 super::vals::Size(val as u8)
7025 }
7026 #[doc = "Peripheral data size"]
7027 pub fn set_psize(&mut self, val: super::vals::Size) {
7028 self.0 = (self.0 & !(0x03 << 11usize)) | (((val.0 as u32) & 0x03) << 11usize);
7029 }
7030 #[doc = "Memory data size"]
7031 pub const fn msize(&self) -> super::vals::Size {
7032 let val = (self.0 >> 13usize) & 0x03;
7033 super::vals::Size(val as u8)
7034 }
7035 #[doc = "Memory data size"]
7036 pub fn set_msize(&mut self, val: super::vals::Size) {
7037 self.0 = (self.0 & !(0x03 << 13usize)) | (((val.0 as u32) & 0x03) << 13usize);
7038 }
7039 #[doc = "Peripheral increment offset size"]
7040 pub const fn pincos(&self) -> super::vals::Pincos {
7041 let val = (self.0 >> 15usize) & 0x01;
7042 super::vals::Pincos(val as u8)
7043 }
7044 #[doc = "Peripheral increment offset size"]
7045 pub fn set_pincos(&mut self, val: super::vals::Pincos) {
7046 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
7047 }
7048 #[doc = "Priority level"]
7049 pub const fn pl(&self) -> super::vals::Pl {
7050 let val = (self.0 >> 16usize) & 0x03;
7051 super::vals::Pl(val as u8)
7052 }
7053 #[doc = "Priority level"]
7054 pub fn set_pl(&mut self, val: super::vals::Pl) {
7055 self.0 = (self.0 & !(0x03 << 16usize)) | (((val.0 as u32) & 0x03) << 16usize);
7056 }
7057 #[doc = "Double buffer mode"]
7058 pub const fn dbm(&self) -> super::vals::Dbm {
7059 let val = (self.0 >> 18usize) & 0x01;
7060 super::vals::Dbm(val as u8)
7061 }
7062 #[doc = "Double buffer mode"]
7063 pub fn set_dbm(&mut self, val: super::vals::Dbm) {
7064 self.0 = (self.0 & !(0x01 << 18usize)) | (((val.0 as u32) & 0x01) << 18usize);
7065 }
7066 #[doc = "Current target (only in double buffer mode)"]
7067 pub const fn ct(&self) -> super::vals::Ct {
7068 let val = (self.0 >> 19usize) & 0x01;
7069 super::vals::Ct(val as u8)
7070 }
7071 #[doc = "Current target (only in double buffer mode)"]
7072 pub fn set_ct(&mut self, val: super::vals::Ct) {
7073 self.0 = (self.0 & !(0x01 << 19usize)) | (((val.0 as u32) & 0x01) << 19usize);
7074 }
7075 #[doc = "Peripheral burst transfer configuration"]
7076 pub const fn pburst(&self) -> super::vals::Burst {
7077 let val = (self.0 >> 21usize) & 0x03;
7078 super::vals::Burst(val as u8)
7079 }
7080 #[doc = "Peripheral burst transfer configuration"]
7081 pub fn set_pburst(&mut self, val: super::vals::Burst) {
7082 self.0 = (self.0 & !(0x03 << 21usize)) | (((val.0 as u32) & 0x03) << 21usize);
7083 }
7084 #[doc = "Memory burst transfer configuration"]
7085 pub const fn mburst(&self) -> super::vals::Burst {
7086 let val = (self.0 >> 23usize) & 0x03;
7087 super::vals::Burst(val as u8)
7088 }
7089 #[doc = "Memory burst transfer configuration"]
7090 pub fn set_mburst(&mut self, val: super::vals::Burst) {
7091 self.0 = (self.0 & !(0x03 << 23usize)) | (((val.0 as u32) & 0x03) << 23usize);
7092 } 7494 }
7093 #[doc = "Channel selection"] 7495 }
7094 pub const fn chsel(&self) -> u8 { 7496 #[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."]
7095 let val = (self.0 >> 25usize) & 0x0f; 7497 #[repr(transparent)]
7096 val as u8 7498 #[derive(Copy, Clone, Eq, PartialEq)]
7499 pub struct Dtimer(pub u32);
7500 impl Dtimer {
7501 #[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."]
7502 pub const fn datatime(&self) -> u32 {
7503 let val = (self.0 >> 0usize) & 0xffff_ffff;
7504 val as u32
7097 } 7505 }
7098 #[doc = "Channel selection"] 7506 #[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."]
7099 pub fn set_chsel(&mut self, val: u8) { 7507 pub fn set_datatime(&mut self, val: u32) {
7100 self.0 = (self.0 & !(0x0f << 25usize)) | (((val as u32) & 0x0f) << 25usize); 7508 self.0 =
7509 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
7101 } 7510 }
7102 } 7511 }
7103 impl Default for Cr { 7512 impl Default for Dtimer {
7104 fn default() -> Cr { 7513 fn default() -> Dtimer {
7105 Cr(0) 7514 Dtimer(0)
7106 } 7515 }
7107 } 7516 }
7108 } 7517 }
7109} 7518}
7110pub mod timer_v1 { 7519pub mod usart_v1 {
7111 use crate::generic::*; 7520 use crate::generic::*;
7112 #[doc = "General purpose 32-bit timer"] 7521 #[doc = "Universal asynchronous receiver transmitter"]
7113 #[derive(Copy, Clone)]
7114 pub struct TimGp32(pub *mut u8);
7115 unsafe impl Send for TimGp32 {}
7116 unsafe impl Sync for TimGp32 {}
7117 impl TimGp32 {
7118 #[doc = "control register 1"]
7119 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> {
7120 unsafe { Reg::from_ptr(self.0.add(0usize)) }
7121 }
7122 #[doc = "control register 2"]
7123 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> {
7124 unsafe { Reg::from_ptr(self.0.add(4usize)) }
7125 }
7126 #[doc = "slave mode control register"]
7127 pub fn smcr(self) -> Reg<regs::Smcr, RW> {
7128 unsafe { Reg::from_ptr(self.0.add(8usize)) }
7129 }
7130 #[doc = "DMA/Interrupt enable register"]
7131 pub fn dier(self) -> Reg<regs::DierGp, RW> {
7132 unsafe { Reg::from_ptr(self.0.add(12usize)) }
7133 }
7134 #[doc = "status register"]
7135 pub fn sr(self) -> Reg<regs::SrGp, RW> {
7136 unsafe { Reg::from_ptr(self.0.add(16usize)) }
7137 }
7138 #[doc = "event generation register"]
7139 pub fn egr(self) -> Reg<regs::EgrGp, W> {
7140 unsafe { Reg::from_ptr(self.0.add(20usize)) }
7141 }
7142 #[doc = "capture/compare mode register 1 (input mode)"]
7143 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
7144 assert!(n < 2usize);
7145 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
7146 }
7147 #[doc = "capture/compare mode register 1 (output mode)"]
7148 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
7149 assert!(n < 2usize);
7150 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
7151 }
7152 #[doc = "capture/compare enable register"]
7153 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
7154 unsafe { Reg::from_ptr(self.0.add(32usize)) }
7155 }
7156 #[doc = "counter"]
7157 pub fn cnt(self) -> Reg<regs::Cnt32, RW> {
7158 unsafe { Reg::from_ptr(self.0.add(36usize)) }
7159 }
7160 #[doc = "prescaler"]
7161 pub fn psc(self) -> Reg<regs::Psc, RW> {
7162 unsafe { Reg::from_ptr(self.0.add(40usize)) }
7163 }
7164 #[doc = "auto-reload register"]
7165 pub fn arr(self) -> Reg<regs::Arr32, RW> {
7166 unsafe { Reg::from_ptr(self.0.add(44usize)) }
7167 }
7168 #[doc = "capture/compare register"]
7169 pub fn ccr(self, n: usize) -> Reg<regs::Ccr32, RW> {
7170 assert!(n < 4usize);
7171 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
7172 }
7173 #[doc = "DMA control register"]
7174 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
7175 unsafe { Reg::from_ptr(self.0.add(72usize)) }
7176 }
7177 #[doc = "DMA address for full transfer"]
7178 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
7179 unsafe { Reg::from_ptr(self.0.add(76usize)) }
7180 }
7181 }
7182 #[doc = "Advanced-timers"]
7183 #[derive(Copy, Clone)] 7522 #[derive(Copy, Clone)]
7184 pub struct TimAdv(pub *mut u8); 7523 pub struct Uart(pub *mut u8);
7185 unsafe impl Send for TimAdv {} 7524 unsafe impl Send for Uart {}
7186 unsafe impl Sync for TimAdv {} 7525 unsafe impl Sync for Uart {}
7187 impl TimAdv { 7526 impl Uart {
7188 #[doc = "control register 1"] 7527 #[doc = "Status register"]
7189 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { 7528 pub fn sr(self) -> Reg<regs::Sr, RW> {
7190 unsafe { Reg::from_ptr(self.0.add(0usize)) } 7529 unsafe { Reg::from_ptr(self.0.add(0usize)) }
7191 } 7530 }
7192 #[doc = "control register 2"] 7531 #[doc = "Data register"]
7193 pub fn cr2(self) -> Reg<regs::Cr2Adv, RW> { 7532 pub fn dr(self) -> Reg<regs::Dr, RW> {
7194 unsafe { Reg::from_ptr(self.0.add(4usize)) } 7533 unsafe { Reg::from_ptr(self.0.add(4usize)) }
7195 } 7534 }
7196 #[doc = "slave mode control register"] 7535 #[doc = "Baud rate register"]
7197 pub fn smcr(self) -> Reg<regs::Smcr, RW> { 7536 pub fn brr(self) -> Reg<regs::Brr, RW> {
7198 unsafe { Reg::from_ptr(self.0.add(8usize)) } 7537 unsafe { Reg::from_ptr(self.0.add(8usize)) }
7199 } 7538 }
7200 #[doc = "DMA/Interrupt enable register"] 7539 #[doc = "Control register 1"]
7201 pub fn dier(self) -> Reg<regs::DierAdv, RW> { 7540 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
7202 unsafe { Reg::from_ptr(self.0.add(12usize)) } 7541 unsafe { Reg::from_ptr(self.0.add(12usize)) }
7203 } 7542 }
7204 #[doc = "status register"] 7543 #[doc = "Control register 2"]
7205 pub fn sr(self) -> Reg<regs::SrAdv, RW> { 7544 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
7206 unsafe { Reg::from_ptr(self.0.add(16usize)) } 7545 unsafe { Reg::from_ptr(self.0.add(16usize)) }
7207 } 7546 }
7208 #[doc = "event generation register"] 7547 #[doc = "Control register 3"]
7209 pub fn egr(self) -> Reg<regs::EgrAdv, W> { 7548 pub fn cr3(self) -> Reg<regs::Cr3, RW> {
7210 unsafe { Reg::from_ptr(self.0.add(20usize)) } 7549 unsafe { Reg::from_ptr(self.0.add(20usize)) }
7211 } 7550 }
7212 #[doc = "capture/compare mode register 1 (input mode)"]
7213 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
7214 assert!(n < 2usize);
7215 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
7216 }
7217 #[doc = "capture/compare mode register 1 (output mode)"]
7218 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
7219 assert!(n < 2usize);
7220 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
7221 }
7222 #[doc = "capture/compare enable register"]
7223 pub fn ccer(self) -> Reg<regs::CcerAdv, RW> {
7224 unsafe { Reg::from_ptr(self.0.add(32usize)) }
7225 }
7226 #[doc = "counter"]
7227 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
7228 unsafe { Reg::from_ptr(self.0.add(36usize)) }
7229 }
7230 #[doc = "prescaler"]
7231 pub fn psc(self) -> Reg<regs::Psc, RW> {
7232 unsafe { Reg::from_ptr(self.0.add(40usize)) }
7233 }
7234 #[doc = "auto-reload register"]
7235 pub fn arr(self) -> Reg<regs::Arr16, RW> {
7236 unsafe { Reg::from_ptr(self.0.add(44usize)) }
7237 }
7238 #[doc = "repetition counter register"]
7239 pub fn rcr(self) -> Reg<regs::Rcr, RW> {
7240 unsafe { Reg::from_ptr(self.0.add(48usize)) }
7241 }
7242 #[doc = "capture/compare register"]
7243 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
7244 assert!(n < 4usize);
7245 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
7246 }
7247 #[doc = "break and dead-time register"]
7248 pub fn bdtr(self) -> Reg<regs::Bdtr, RW> {
7249 unsafe { Reg::from_ptr(self.0.add(68usize)) }
7250 }
7251 #[doc = "DMA control register"]
7252 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
7253 unsafe { Reg::from_ptr(self.0.add(72usize)) }
7254 }
7255 #[doc = "DMA address for full transfer"]
7256 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
7257 unsafe { Reg::from_ptr(self.0.add(76usize)) }
7258 }
7259 } 7551 }
7260 #[doc = "General purpose 16-bit timer"] 7552 #[doc = "Universal synchronous asynchronous receiver transmitter"]
7261 #[derive(Copy, Clone)] 7553 #[derive(Copy, Clone)]
7262 pub struct TimGp16(pub *mut u8); 7554 pub struct Usart(pub *mut u8);
7263 unsafe impl Send for TimGp16 {} 7555 unsafe impl Send for Usart {}
7264 unsafe impl Sync for TimGp16 {} 7556 unsafe impl Sync for Usart {}
7265 impl TimGp16 { 7557 impl Usart {
7266 #[doc = "control register 1"] 7558 #[doc = "Status register"]
7267 pub fn cr1(self) -> Reg<regs::Cr1Gp, RW> { 7559 pub fn sr(self) -> Reg<regs::Sr, RW> {
7268 unsafe { Reg::from_ptr(self.0.add(0usize)) } 7560 unsafe { Reg::from_ptr(self.0.add(0usize)) }
7269 } 7561 }
7270 #[doc = "control register 2"] 7562 #[doc = "Data register"]
7271 pub fn cr2(self) -> Reg<regs::Cr2Gp, RW> { 7563 pub fn dr(self) -> Reg<regs::Dr, RW> {
7272 unsafe { Reg::from_ptr(self.0.add(4usize)) } 7564 unsafe { Reg::from_ptr(self.0.add(4usize)) }
7273 } 7565 }
7274 #[doc = "slave mode control register"] 7566 #[doc = "Baud rate register"]
7275 pub fn smcr(self) -> Reg<regs::Smcr, RW> { 7567 pub fn brr(self) -> Reg<regs::Brr, RW> {
7276 unsafe { Reg::from_ptr(self.0.add(8usize)) } 7568 unsafe { Reg::from_ptr(self.0.add(8usize)) }
7277 } 7569 }
7278 #[doc = "DMA/Interrupt enable register"] 7570 #[doc = "Control register 1"]
7279 pub fn dier(self) -> Reg<regs::DierGp, RW> { 7571 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
7280 unsafe { Reg::from_ptr(self.0.add(12usize)) }
7281 }
7282 #[doc = "status register"]
7283 pub fn sr(self) -> Reg<regs::SrGp, RW> {
7284 unsafe { Reg::from_ptr(self.0.add(16usize)) }
7285 }
7286 #[doc = "event generation register"]
7287 pub fn egr(self) -> Reg<regs::EgrGp, W> {
7288 unsafe { Reg::from_ptr(self.0.add(20usize)) }
7289 }
7290 #[doc = "capture/compare mode register 1 (input mode)"]
7291 pub fn ccmr_input(self, n: usize) -> Reg<regs::CcmrInput, RW> {
7292 assert!(n < 2usize);
7293 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
7294 }
7295 #[doc = "capture/compare mode register 1 (output mode)"]
7296 pub fn ccmr_output(self, n: usize) -> Reg<regs::CcmrOutput, RW> {
7297 assert!(n < 2usize);
7298 unsafe { Reg::from_ptr(self.0.add(24usize + n * 4usize)) }
7299 }
7300 #[doc = "capture/compare enable register"]
7301 pub fn ccer(self) -> Reg<regs::CcerGp, RW> {
7302 unsafe { Reg::from_ptr(self.0.add(32usize)) }
7303 }
7304 #[doc = "counter"]
7305 pub fn cnt(self) -> Reg<regs::Cnt16, RW> {
7306 unsafe { Reg::from_ptr(self.0.add(36usize)) }
7307 }
7308 #[doc = "prescaler"]
7309 pub fn psc(self) -> Reg<regs::Psc, RW> {
7310 unsafe { Reg::from_ptr(self.0.add(40usize)) }
7311 }
7312 #[doc = "auto-reload register"]
7313 pub fn arr(self) -> Reg<regs::Arr16, RW> {
7314 unsafe { Reg::from_ptr(self.0.add(44usize)) }
7315 }
7316 #[doc = "capture/compare register"]
7317 pub fn ccr(self, n: usize) -> Reg<regs::Ccr16, RW> {
7318 assert!(n < 4usize);
7319 unsafe { Reg::from_ptr(self.0.add(52usize + n * 4usize)) }
7320 }
7321 #[doc = "DMA control register"]
7322 pub fn dcr(self) -> Reg<regs::Dcr, RW> {
7323 unsafe { Reg::from_ptr(self.0.add(72usize)) }
7324 }
7325 #[doc = "DMA address for full transfer"]
7326 pub fn dmar(self) -> Reg<regs::Dmar, RW> {
7327 unsafe { Reg::from_ptr(self.0.add(76usize)) }
7328 }
7329 }
7330 #[doc = "Basic timer"]
7331 #[derive(Copy, Clone)]
7332 pub struct TimBasic(pub *mut u8);
7333 unsafe impl Send for TimBasic {}
7334 unsafe impl Sync for TimBasic {}
7335 impl TimBasic {
7336 #[doc = "control register 1"]
7337 pub fn cr1(self) -> Reg<regs::Cr1Basic, RW> {
7338 unsafe { Reg::from_ptr(self.0.add(0usize)) }
7339 }
7340 #[doc = "control register 2"]
7341 pub fn cr2(self) -> Reg<regs::Cr2Basic, RW> {
7342 unsafe { Reg::from_ptr(self.0.add(4usize)) }
7343 }
7344 #[doc = "DMA/Interrupt enable register"]
7345 pub fn dier(self) -> Reg<regs::DierBasic, RW> {
7346 unsafe { Reg::from_ptr(self.0.add(12usize)) } 7572 unsafe { Reg::from_ptr(self.0.add(12usize)) }
7347 } 7573 }
7348 #[doc = "status register"] 7574 #[doc = "Control register 2"]
7349 pub fn sr(self) -> Reg<regs::SrBasic, RW> { 7575 pub fn cr2(self) -> Reg<regs::Cr2Usart, RW> {
7350 unsafe { Reg::from_ptr(self.0.add(16usize)) } 7576 unsafe { Reg::from_ptr(self.0.add(16usize)) }
7351 } 7577 }
7352 #[doc = "event generation register"] 7578 #[doc = "Control register 3"]
7353 pub fn egr(self) -> Reg<regs::EgrBasic, W> { 7579 pub fn cr3(self) -> Reg<regs::Cr3Usart, RW> {
7354 unsafe { Reg::from_ptr(self.0.add(20usize)) } 7580 unsafe { Reg::from_ptr(self.0.add(20usize)) }
7355 } 7581 }
7356 #[doc = "counter"] 7582 #[doc = "Guard time and prescaler register"]
7357 pub fn cnt(self) -> Reg<regs::Cnt16, RW> { 7583 pub fn gtpr(self) -> Reg<regs::Gtpr, RW> {
7358 unsafe { Reg::from_ptr(self.0.add(36usize)) } 7584 unsafe { Reg::from_ptr(self.0.add(24usize)) }
7359 }
7360 #[doc = "prescaler"]
7361 pub fn psc(self) -> Reg<regs::Psc, RW> {
7362 unsafe { Reg::from_ptr(self.0.add(40usize)) }
7363 }
7364 #[doc = "auto-reload register"]
7365 pub fn arr(self) -> Reg<regs::Arr16, RW> {
7366 unsafe { Reg::from_ptr(self.0.add(44usize)) }
7367 } 7585 }
7368 } 7586 }
7369 pub mod regs { 7587 pub mod regs {
7370 use crate::generic::*; 7588 use crate::generic::*;
7371 #[doc = "capture/compare mode register 1 (input mode)"] 7589 #[doc = "Status register"]
7372 #[repr(transparent)]
7373 #[derive(Copy, Clone, Eq, PartialEq)]
7374 pub struct CcmrInput(pub u32);
7375 impl CcmrInput {
7376 #[doc = "Capture/Compare 1 selection"]
7377 pub fn ccs(&self, n: usize) -> super::vals::CcmrInputCcs {
7378 assert!(n < 2usize);
7379 let offs = 0usize + n * 8usize;
7380 let val = (self.0 >> offs) & 0x03;
7381 super::vals::CcmrInputCcs(val as u8)
7382 }
7383 #[doc = "Capture/Compare 1 selection"]
7384 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrInputCcs) {
7385 assert!(n < 2usize);
7386 let offs = 0usize + n * 8usize;
7387 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
7388 }
7389 #[doc = "Input capture 1 prescaler"]
7390 pub fn icpsc(&self, n: usize) -> u8 {
7391 assert!(n < 2usize);
7392 let offs = 2usize + n * 8usize;
7393 let val = (self.0 >> offs) & 0x03;
7394 val as u8
7395 }
7396 #[doc = "Input capture 1 prescaler"]
7397 pub fn set_icpsc(&mut self, n: usize, val: u8) {
7398 assert!(n < 2usize);
7399 let offs = 2usize + n * 8usize;
7400 self.0 = (self.0 & !(0x03 << offs)) | (((val as u32) & 0x03) << offs);
7401 }
7402 #[doc = "Input capture 1 filter"]
7403 pub fn icf(&self, n: usize) -> super::vals::Icf {
7404 assert!(n < 2usize);
7405 let offs = 4usize + n * 8usize;
7406 let val = (self.0 >> offs) & 0x0f;
7407 super::vals::Icf(val as u8)
7408 }
7409 #[doc = "Input capture 1 filter"]
7410 pub fn set_icf(&mut self, n: usize, val: super::vals::Icf) {
7411 assert!(n < 2usize);
7412 let offs = 4usize + n * 8usize;
7413 self.0 = (self.0 & !(0x0f << offs)) | (((val.0 as u32) & 0x0f) << offs);
7414 }
7415 }
7416 impl Default for CcmrInput {
7417 fn default() -> CcmrInput {
7418 CcmrInput(0)
7419 }
7420 }
7421 #[doc = "capture/compare mode register 2 (output mode)"]
7422 #[repr(transparent)] 7590 #[repr(transparent)]
7423 #[derive(Copy, Clone, Eq, PartialEq)] 7591 #[derive(Copy, Clone, Eq, PartialEq)]
7424 pub struct CcmrOutput(pub u32); 7592 pub struct Sr(pub u32);
7425 impl CcmrOutput { 7593 impl Sr {
7426 #[doc = "Capture/Compare 3 selection"] 7594 #[doc = "Parity error"]
7427 pub fn ccs(&self, n: usize) -> super::vals::CcmrOutputCcs { 7595 pub const fn pe(&self) -> bool {
7428 assert!(n < 2usize); 7596 let val = (self.0 >> 0usize) & 0x01;
7429 let offs = 0usize + n * 8usize;
7430 let val = (self.0 >> offs) & 0x03;
7431 super::vals::CcmrOutputCcs(val as u8)
7432 }
7433 #[doc = "Capture/Compare 3 selection"]
7434 pub fn set_ccs(&mut self, n: usize, val: super::vals::CcmrOutputCcs) {
7435 assert!(n < 2usize);
7436 let offs = 0usize + n * 8usize;
7437 self.0 = (self.0 & !(0x03 << offs)) | (((val.0 as u32) & 0x03) << offs);
7438 }
7439 #[doc = "Output compare 3 fast enable"]
7440 pub fn ocfe(&self, n: usize) -> bool {
7441 assert!(n < 2usize);
7442 let offs = 2usize + n * 8usize;
7443 let val = (self.0 >> offs) & 0x01;
7444 val != 0 7597 val != 0
7445 } 7598 }
7446 #[doc = "Output compare 3 fast enable"] 7599 #[doc = "Parity error"]
7447 pub fn set_ocfe(&mut self, n: usize, val: bool) { 7600 pub fn set_pe(&mut self, val: bool) {
7448 assert!(n < 2usize); 7601 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7449 let offs = 2usize + n * 8usize;
7450 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7451 }
7452 #[doc = "Output compare 3 preload enable"]
7453 pub fn ocpe(&self, n: usize) -> super::vals::Ocpe {
7454 assert!(n < 2usize);
7455 let offs = 3usize + n * 8usize;
7456 let val = (self.0 >> offs) & 0x01;
7457 super::vals::Ocpe(val as u8)
7458 }
7459 #[doc = "Output compare 3 preload enable"]
7460 pub fn set_ocpe(&mut self, n: usize, val: super::vals::Ocpe) {
7461 assert!(n < 2usize);
7462 let offs = 3usize + n * 8usize;
7463 self.0 = (self.0 & !(0x01 << offs)) | (((val.0 as u32) & 0x01) << offs);
7464 } 7602 }
7465 #[doc = "Output compare 3 mode"] 7603 #[doc = "Framing error"]
7466 pub fn ocm(&self, n: usize) -> super::vals::Ocm { 7604 pub const fn fe(&self) -> bool {
7467 assert!(n < 2usize); 7605 let val = (self.0 >> 1usize) & 0x01;
7468 let offs = 4usize + n * 8usize; 7606 val != 0
7469 let val = (self.0 >> offs) & 0x07;
7470 super::vals::Ocm(val as u8)
7471 } 7607 }
7472 #[doc = "Output compare 3 mode"] 7608 #[doc = "Framing error"]
7473 pub fn set_ocm(&mut self, n: usize, val: super::vals::Ocm) { 7609 pub fn set_fe(&mut self, val: bool) {
7474 assert!(n < 2usize); 7610 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
7475 let offs = 4usize + n * 8usize;
7476 self.0 = (self.0 & !(0x07 << offs)) | (((val.0 as u32) & 0x07) << offs);
7477 } 7611 }
7478 #[doc = "Output compare 3 clear enable"] 7612 #[doc = "Noise error flag"]
7479 pub fn occe(&self, n: usize) -> bool { 7613 pub const fn ne(&self) -> bool {
7480 assert!(n < 2usize); 7614 let val = (self.0 >> 2usize) & 0x01;
7481 let offs = 7usize + n * 8usize;
7482 let val = (self.0 >> offs) & 0x01;
7483 val != 0 7615 val != 0
7484 } 7616 }
7485 #[doc = "Output compare 3 clear enable"] 7617 #[doc = "Noise error flag"]
7486 pub fn set_occe(&mut self, n: usize, val: bool) { 7618 pub fn set_ne(&mut self, val: bool) {
7487 assert!(n < 2usize); 7619 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
7488 let offs = 7usize + n * 8usize;
7489 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7490 }
7491 }
7492 impl Default for CcmrOutput {
7493 fn default() -> CcmrOutput {
7494 CcmrOutput(0)
7495 } 7620 }
7496 } 7621 #[doc = "Overrun error"]
7497 #[doc = "event generation register"] 7622 pub const fn ore(&self) -> bool {
7498 #[repr(transparent)] 7623 let val = (self.0 >> 3usize) & 0x01;
7499 #[derive(Copy, Clone, Eq, PartialEq)]
7500 pub struct EgrGp(pub u32);
7501 impl EgrGp {
7502 #[doc = "Update generation"]
7503 pub const fn ug(&self) -> bool {
7504 let val = (self.0 >> 0usize) & 0x01;
7505 val != 0 7624 val != 0
7506 } 7625 }
7507 #[doc = "Update generation"] 7626 #[doc = "Overrun error"]
7508 pub fn set_ug(&mut self, val: bool) { 7627 pub fn set_ore(&mut self, val: bool) {
7509 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7628 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
7510 } 7629 }
7511 #[doc = "Capture/compare 1 generation"] 7630 #[doc = "IDLE line detected"]
7512 pub fn ccg(&self, n: usize) -> bool { 7631 pub const fn idle(&self) -> bool {
7513 assert!(n < 4usize); 7632 let val = (self.0 >> 4usize) & 0x01;
7514 let offs = 1usize + n * 1usize;
7515 let val = (self.0 >> offs) & 0x01;
7516 val != 0 7633 val != 0
7517 } 7634 }
7518 #[doc = "Capture/compare 1 generation"] 7635 #[doc = "IDLE line detected"]
7519 pub fn set_ccg(&mut self, n: usize, val: bool) { 7636 pub fn set_idle(&mut self, val: bool) {
7520 assert!(n < 4usize); 7637 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
7521 let offs = 1usize + n * 1usize;
7522 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7523 } 7638 }
7524 #[doc = "Capture/Compare control update generation"] 7639 #[doc = "Read data register not empty"]
7525 pub const fn comg(&self) -> bool { 7640 pub const fn rxne(&self) -> bool {
7526 let val = (self.0 >> 5usize) & 0x01; 7641 let val = (self.0 >> 5usize) & 0x01;
7527 val != 0 7642 val != 0
7528 } 7643 }
7529 #[doc = "Capture/Compare control update generation"] 7644 #[doc = "Read data register not empty"]
7530 pub fn set_comg(&mut self, val: bool) { 7645 pub fn set_rxne(&mut self, val: bool) {
7531 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 7646 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
7532 } 7647 }
7533 #[doc = "Trigger generation"] 7648 #[doc = "Transmission complete"]
7534 pub const fn tg(&self) -> bool { 7649 pub const fn tc(&self) -> bool {
7535 let val = (self.0 >> 6usize) & 0x01; 7650 let val = (self.0 >> 6usize) & 0x01;
7536 val != 0 7651 val != 0
7537 } 7652 }
7538 #[doc = "Trigger generation"] 7653 #[doc = "Transmission complete"]
7539 pub fn set_tg(&mut self, val: bool) { 7654 pub fn set_tc(&mut self, val: bool) {
7540 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 7655 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7541 } 7656 }
7542 #[doc = "Break generation"] 7657 #[doc = "Transmit data register empty"]
7543 pub const fn bg(&self) -> bool { 7658 pub const fn txe(&self) -> bool {
7544 let val = (self.0 >> 7usize) & 0x01; 7659 let val = (self.0 >> 7usize) & 0x01;
7545 val != 0 7660 val != 0
7546 } 7661 }
7547 #[doc = "Break generation"] 7662 #[doc = "Transmit data register empty"]
7548 pub fn set_bg(&mut self, val: bool) { 7663 pub fn set_txe(&mut self, val: bool) {
7549 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 7664 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
7550 } 7665 }
7551 } 7666 #[doc = "LIN break detection flag"]
7552 impl Default for EgrGp { 7667 pub const fn lbd(&self) -> bool {
7553 fn default() -> EgrGp { 7668 let val = (self.0 >> 8usize) & 0x01;
7554 EgrGp(0) 7669 val != 0
7555 }
7556 }
7557 #[doc = "counter"]
7558 #[repr(transparent)]
7559 #[derive(Copy, Clone, Eq, PartialEq)]
7560 pub struct Cnt16(pub u32);
7561 impl Cnt16 {
7562 #[doc = "counter value"]
7563 pub const fn cnt(&self) -> u16 {
7564 let val = (self.0 >> 0usize) & 0xffff;
7565 val as u16
7566 } 7670 }
7567 #[doc = "counter value"] 7671 #[doc = "LIN break detection flag"]
7568 pub fn set_cnt(&mut self, val: u16) { 7672 pub fn set_lbd(&mut self, val: bool) {
7569 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 7673 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
7570 } 7674 }
7571 } 7675 }
7572 impl Default for Cnt16 { 7676 impl Default for Sr {
7573 fn default() -> Cnt16 { 7677 fn default() -> Sr {
7574 Cnt16(0) 7678 Sr(0)
7575 } 7679 }
7576 } 7680 }
7577 #[doc = "control register 2"] 7681 #[doc = "Control register 3"]
7578 #[repr(transparent)] 7682 #[repr(transparent)]
7579 #[derive(Copy, Clone, Eq, PartialEq)] 7683 #[derive(Copy, Clone, Eq, PartialEq)]
7580 pub struct Cr2Adv(pub u32); 7684 pub struct Cr3Usart(pub u32);
7581 impl Cr2Adv { 7685 impl Cr3Usart {
7582 #[doc = "Capture/compare preloaded control"] 7686 #[doc = "Error interrupt enable"]
7583 pub const fn ccpc(&self) -> bool { 7687 pub const fn eie(&self) -> bool {
7584 let val = (self.0 >> 0usize) & 0x01; 7688 let val = (self.0 >> 0usize) & 0x01;
7585 val != 0 7689 val != 0
7586 } 7690 }
7587 #[doc = "Capture/compare preloaded control"] 7691 #[doc = "Error interrupt enable"]
7588 pub fn set_ccpc(&mut self, val: bool) { 7692 pub fn set_eie(&mut self, val: bool) {
7589 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7693 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7590 } 7694 }
7591 #[doc = "Capture/compare control update selection"] 7695 #[doc = "IrDA mode enable"]
7592 pub const fn ccus(&self) -> bool { 7696 pub const fn iren(&self) -> bool {
7593 let val = (self.0 >> 2usize) & 0x01; 7697 let val = (self.0 >> 1usize) & 0x01;
7594 val != 0 7698 val != 0
7595 } 7699 }
7596 #[doc = "Capture/compare control update selection"] 7700 #[doc = "IrDA mode enable"]
7597 pub fn set_ccus(&mut self, val: bool) { 7701 pub fn set_iren(&mut self, val: bool) {
7598 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize); 7702 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
7599 } 7703 }
7600 #[doc = "Capture/compare DMA selection"] 7704 #[doc = "IrDA low-power"]
7601 pub const fn ccds(&self) -> super::vals::Ccds { 7705 pub const fn irlp(&self) -> super::vals::Irlp {
7706 let val = (self.0 >> 2usize) & 0x01;
7707 super::vals::Irlp(val as u8)
7708 }
7709 #[doc = "IrDA low-power"]
7710 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
7711 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
7712 }
7713 #[doc = "Half-duplex selection"]
7714 pub const fn hdsel(&self) -> super::vals::Hdsel {
7602 let val = (self.0 >> 3usize) & 0x01; 7715 let val = (self.0 >> 3usize) & 0x01;
7603 super::vals::Ccds(val as u8) 7716 super::vals::Hdsel(val as u8)
7604 } 7717 }
7605 #[doc = "Capture/compare DMA selection"] 7718 #[doc = "Half-duplex selection"]
7606 pub fn set_ccds(&mut self, val: super::vals::Ccds) { 7719 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
7607 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 7720 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
7608 } 7721 }
7609 #[doc = "Master mode selection"] 7722 #[doc = "Smartcard NACK enable"]
7610 pub const fn mms(&self) -> super::vals::Mms { 7723 pub const fn nack(&self) -> bool {
7611 let val = (self.0 >> 4usize) & 0x07; 7724 let val = (self.0 >> 4usize) & 0x01;
7612 super::vals::Mms(val as u8) 7725 val != 0
7613 } 7726 }
7614 #[doc = "Master mode selection"] 7727 #[doc = "Smartcard NACK enable"]
7615 pub fn set_mms(&mut self, val: super::vals::Mms) { 7728 pub fn set_nack(&mut self, val: bool) {
7616 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 7729 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
7617 } 7730 }
7618 #[doc = "TI1 selection"] 7731 #[doc = "Smartcard mode enable"]
7619 pub const fn ti1s(&self) -> super::vals::Tis { 7732 pub const fn scen(&self) -> bool {
7620 let val = (self.0 >> 7usize) & 0x01; 7733 let val = (self.0 >> 5usize) & 0x01;
7621 super::vals::Tis(val as u8) 7734 val != 0
7622 } 7735 }
7623 #[doc = "TI1 selection"] 7736 #[doc = "Smartcard mode enable"]
7624 pub fn set_ti1s(&mut self, val: super::vals::Tis) { 7737 pub fn set_scen(&mut self, val: bool) {
7625 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 7738 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
7626 } 7739 }
7627 #[doc = "Output Idle state 1"] 7740 #[doc = "DMA enable receiver"]
7628 pub fn ois(&self, n: usize) -> bool { 7741 pub const fn dmar(&self) -> bool {
7629 assert!(n < 4usize); 7742 let val = (self.0 >> 6usize) & 0x01;
7630 let offs = 8usize + n * 2usize;
7631 let val = (self.0 >> offs) & 0x01;
7632 val != 0 7743 val != 0
7633 } 7744 }
7634 #[doc = "Output Idle state 1"] 7745 #[doc = "DMA enable receiver"]
7635 pub fn set_ois(&mut self, n: usize, val: bool) { 7746 pub fn set_dmar(&mut self, val: bool) {
7636 assert!(n < 4usize); 7747 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7637 let offs = 8usize + n * 2usize;
7638 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7639 } 7748 }
7640 #[doc = "Output Idle state 1"] 7749 #[doc = "DMA enable transmitter"]
7641 pub const fn ois1n(&self) -> bool { 7750 pub const fn dmat(&self) -> bool {
7642 let val = (self.0 >> 9usize) & 0x01; 7751 let val = (self.0 >> 7usize) & 0x01;
7643 val != 0 7752 val != 0
7644 } 7753 }
7645 #[doc = "Output Idle state 1"] 7754 #[doc = "DMA enable transmitter"]
7646 pub fn set_ois1n(&mut self, val: bool) { 7755 pub fn set_dmat(&mut self, val: bool) {
7647 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize); 7756 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
7648 } 7757 }
7649 #[doc = "Output Idle state 2"] 7758 #[doc = "RTS enable"]
7650 pub const fn ois2n(&self) -> bool { 7759 pub const fn rtse(&self) -> bool {
7651 let val = (self.0 >> 11usize) & 0x01; 7760 let val = (self.0 >> 8usize) & 0x01;
7652 val != 0 7761 val != 0
7653 } 7762 }
7654 #[doc = "Output Idle state 2"] 7763 #[doc = "RTS enable"]
7655 pub fn set_ois2n(&mut self, val: bool) { 7764 pub fn set_rtse(&mut self, val: bool) {
7656 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize); 7765 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
7657 } 7766 }
7658 #[doc = "Output Idle state 3"] 7767 #[doc = "CTS enable"]
7659 pub const fn ois3n(&self) -> bool { 7768 pub const fn ctse(&self) -> bool {
7660 let val = (self.0 >> 13usize) & 0x01; 7769 let val = (self.0 >> 9usize) & 0x01;
7661 val != 0 7770 val != 0
7662 } 7771 }
7663 #[doc = "Output Idle state 3"] 7772 #[doc = "CTS enable"]
7664 pub fn set_ois3n(&mut self, val: bool) { 7773 pub fn set_ctse(&mut self, val: bool) {
7665 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 7774 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
7666 }
7667 }
7668 impl Default for Cr2Adv {
7669 fn default() -> Cr2Adv {
7670 Cr2Adv(0)
7671 } 7775 }
7672 } 7776 #[doc = "CTS interrupt enable"]
7673 #[doc = "auto-reload register"] 7777 pub const fn ctsie(&self) -> bool {
7674 #[repr(transparent)] 7778 let val = (self.0 >> 10usize) & 0x01;
7675 #[derive(Copy, Clone, Eq, PartialEq)] 7779 val != 0
7676 pub struct Arr32(pub u32);
7677 impl Arr32 {
7678 #[doc = "Auto-reload value"]
7679 pub const fn arr(&self) -> u32 {
7680 let val = (self.0 >> 0usize) & 0xffff_ffff;
7681 val as u32
7682 } 7780 }
7683 #[doc = "Auto-reload value"] 7781 #[doc = "CTS interrupt enable"]
7684 pub fn set_arr(&mut self, val: u32) { 7782 pub fn set_ctsie(&mut self, val: bool) {
7685 self.0 = 7783 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
7686 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
7687 } 7784 }
7688 } 7785 }
7689 impl Default for Arr32 { 7786 impl Default for Cr3Usart {
7690 fn default() -> Arr32 { 7787 fn default() -> Cr3Usart {
7691 Arr32(0) 7788 Cr3Usart(0)
7692 } 7789 }
7693 } 7790 }
7694 #[doc = "DMA/Interrupt enable register"] 7791 #[doc = "Control register 1"]
7695 #[repr(transparent)] 7792 #[repr(transparent)]
7696 #[derive(Copy, Clone, Eq, PartialEq)] 7793 #[derive(Copy, Clone, Eq, PartialEq)]
7697 pub struct DierGp(pub u32); 7794 pub struct Cr1(pub u32);
7698 impl DierGp { 7795 impl Cr1 {
7699 #[doc = "Update interrupt enable"] 7796 #[doc = "Send break"]
7700 pub const fn uie(&self) -> bool { 7797 pub const fn sbk(&self) -> super::vals::Sbk {
7701 let val = (self.0 >> 0usize) & 0x01; 7798 let val = (self.0 >> 0usize) & 0x01;
7702 val != 0 7799 super::vals::Sbk(val as u8)
7703 } 7800 }
7704 #[doc = "Update interrupt enable"] 7801 #[doc = "Send break"]
7705 pub fn set_uie(&mut self, val: bool) { 7802 pub fn set_sbk(&mut self, val: super::vals::Sbk) {
7706 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7803 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
7707 } 7804 }
7708 #[doc = "Capture/Compare 1 interrupt enable"] 7805 #[doc = "Receiver wakeup"]
7709 pub fn ccie(&self, n: usize) -> bool { 7806 pub const fn rwu(&self) -> super::vals::Rwu {
7710 assert!(n < 4usize); 7807 let val = (self.0 >> 1usize) & 0x01;
7711 let offs = 1usize + n * 1usize; 7808 super::vals::Rwu(val as u8)
7712 let val = (self.0 >> offs) & 0x01;
7713 val != 0
7714 } 7809 }
7715 #[doc = "Capture/Compare 1 interrupt enable"] 7810 #[doc = "Receiver wakeup"]
7716 pub fn set_ccie(&mut self, n: usize, val: bool) { 7811 pub fn set_rwu(&mut self, val: super::vals::Rwu) {
7717 assert!(n < 4usize); 7812 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
7718 let offs = 1usize + n * 1usize;
7719 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7720 } 7813 }
7721 #[doc = "Trigger interrupt enable"] 7814 #[doc = "Receiver enable"]
7722 pub const fn tie(&self) -> bool { 7815 pub const fn re(&self) -> bool {
7723 let val = (self.0 >> 6usize) & 0x01; 7816 let val = (self.0 >> 2usize) & 0x01;
7724 val != 0 7817 val != 0
7725 } 7818 }
7726 #[doc = "Trigger interrupt enable"] 7819 #[doc = "Receiver enable"]
7727 pub fn set_tie(&mut self, val: bool) { 7820 pub fn set_re(&mut self, val: bool) {
7728 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 7821 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
7729 } 7822 }
7730 #[doc = "Update DMA request enable"] 7823 #[doc = "Transmitter enable"]
7731 pub const fn ude(&self) -> bool { 7824 pub const fn te(&self) -> bool {
7732 let val = (self.0 >> 8usize) & 0x01; 7825 let val = (self.0 >> 3usize) & 0x01;
7733 val != 0 7826 val != 0
7734 } 7827 }
7735 #[doc = "Update DMA request enable"] 7828 #[doc = "Transmitter enable"]
7736 pub fn set_ude(&mut self, val: bool) { 7829 pub fn set_te(&mut self, val: bool) {
7737 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 7830 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
7738 } 7831 }
7739 #[doc = "Capture/Compare 1 DMA request enable"] 7832 #[doc = "IDLE interrupt enable"]
7740 pub fn ccde(&self, n: usize) -> bool { 7833 pub const fn idleie(&self) -> bool {
7741 assert!(n < 4usize); 7834 let val = (self.0 >> 4usize) & 0x01;
7742 let offs = 9usize + n * 1usize;
7743 let val = (self.0 >> offs) & 0x01;
7744 val != 0 7835 val != 0
7745 } 7836 }
7746 #[doc = "Capture/Compare 1 DMA request enable"] 7837 #[doc = "IDLE interrupt enable"]
7747 pub fn set_ccde(&mut self, n: usize, val: bool) { 7838 pub fn set_idleie(&mut self, val: bool) {
7748 assert!(n < 4usize); 7839 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
7749 let offs = 9usize + n * 1usize;
7750 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7751 } 7840 }
7752 #[doc = "Trigger DMA request enable"] 7841 #[doc = "RXNE interrupt enable"]
7753 pub const fn tde(&self) -> bool { 7842 pub const fn rxneie(&self) -> bool {
7754 let val = (self.0 >> 14usize) & 0x01; 7843 let val = (self.0 >> 5usize) & 0x01;
7755 val != 0 7844 val != 0
7756 } 7845 }
7757 #[doc = "Trigger DMA request enable"] 7846 #[doc = "RXNE interrupt enable"]
7758 pub fn set_tde(&mut self, val: bool) { 7847 pub fn set_rxneie(&mut self, val: bool) {
7759 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 7848 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
7760 }
7761 }
7762 impl Default for DierGp {
7763 fn default() -> DierGp {
7764 DierGp(0)
7765 }
7766 }
7767 #[doc = "control register 2"]
7768 #[repr(transparent)]
7769 #[derive(Copy, Clone, Eq, PartialEq)]
7770 pub struct Cr2Gp(pub u32);
7771 impl Cr2Gp {
7772 #[doc = "Capture/compare DMA selection"]
7773 pub const fn ccds(&self) -> super::vals::Ccds {
7774 let val = (self.0 >> 3usize) & 0x01;
7775 super::vals::Ccds(val as u8)
7776 }
7777 #[doc = "Capture/compare DMA selection"]
7778 pub fn set_ccds(&mut self, val: super::vals::Ccds) {
7779 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
7780 } 7849 }
7781 #[doc = "Master mode selection"] 7850 #[doc = "Transmission complete interrupt enable"]
7782 pub const fn mms(&self) -> super::vals::Mms { 7851 pub const fn tcie(&self) -> bool {
7783 let val = (self.0 >> 4usize) & 0x07; 7852 let val = (self.0 >> 6usize) & 0x01;
7784 super::vals::Mms(val as u8) 7853 val != 0
7785 } 7854 }
7786 #[doc = "Master mode selection"] 7855 #[doc = "Transmission complete interrupt enable"]
7787 pub fn set_mms(&mut self, val: super::vals::Mms) { 7856 pub fn set_tcie(&mut self, val: bool) {
7788 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 7857 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7789 } 7858 }
7790 #[doc = "TI1 selection"] 7859 #[doc = "TXE interrupt enable"]
7791 pub const fn ti1s(&self) -> super::vals::Tis { 7860 pub const fn txeie(&self) -> bool {
7792 let val = (self.0 >> 7usize) & 0x01; 7861 let val = (self.0 >> 7usize) & 0x01;
7793 super::vals::Tis(val as u8)
7794 }
7795 #[doc = "TI1 selection"]
7796 pub fn set_ti1s(&mut self, val: super::vals::Tis) {
7797 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
7798 }
7799 }
7800 impl Default for Cr2Gp {
7801 fn default() -> Cr2Gp {
7802 Cr2Gp(0)
7803 }
7804 }
7805 #[doc = "capture/compare register 1"]
7806 #[repr(transparent)]
7807 #[derive(Copy, Clone, Eq, PartialEq)]
7808 pub struct Ccr16(pub u32);
7809 impl Ccr16 {
7810 #[doc = "Capture/Compare 1 value"]
7811 pub const fn ccr(&self) -> u16 {
7812 let val = (self.0 >> 0usize) & 0xffff;
7813 val as u16
7814 }
7815 #[doc = "Capture/Compare 1 value"]
7816 pub fn set_ccr(&mut self, val: u16) {
7817 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
7818 }
7819 }
7820 impl Default for Ccr16 {
7821 fn default() -> Ccr16 {
7822 Ccr16(0)
7823 }
7824 }
7825 #[doc = "capture/compare enable register"]
7826 #[repr(transparent)]
7827 #[derive(Copy, Clone, Eq, PartialEq)]
7828 pub struct CcerAdv(pub u32);
7829 impl CcerAdv {
7830 #[doc = "Capture/Compare 1 output enable"]
7831 pub fn cce(&self, n: usize) -> bool {
7832 assert!(n < 4usize);
7833 let offs = 0usize + n * 4usize;
7834 let val = (self.0 >> offs) & 0x01;
7835 val != 0 7862 val != 0
7836 } 7863 }
7837 #[doc = "Capture/Compare 1 output enable"] 7864 #[doc = "TXE interrupt enable"]
7838 pub fn set_cce(&mut self, n: usize, val: bool) { 7865 pub fn set_txeie(&mut self, val: bool) {
7839 assert!(n < 4usize); 7866 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
7840 let offs = 0usize + n * 4usize;
7841 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7842 } 7867 }
7843 #[doc = "Capture/Compare 1 output Polarity"] 7868 #[doc = "PE interrupt enable"]
7844 pub fn ccp(&self, n: usize) -> bool { 7869 pub const fn peie(&self) -> bool {
7845 assert!(n < 4usize); 7870 let val = (self.0 >> 8usize) & 0x01;
7846 let offs = 1usize + n * 4usize;
7847 let val = (self.0 >> offs) & 0x01;
7848 val != 0 7871 val != 0
7849 } 7872 }
7850 #[doc = "Capture/Compare 1 output Polarity"] 7873 #[doc = "PE interrupt enable"]
7851 pub fn set_ccp(&mut self, n: usize, val: bool) { 7874 pub fn set_peie(&mut self, val: bool) {
7852 assert!(n < 4usize); 7875 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
7853 let offs = 1usize + n * 4usize;
7854 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7855 } 7876 }
7856 #[doc = "Capture/Compare 1 complementary output enable"] 7877 #[doc = "Parity selection"]
7857 pub fn ccne(&self, n: usize) -> bool { 7878 pub const fn ps(&self) -> super::vals::Ps {
7858 assert!(n < 4usize); 7879 let val = (self.0 >> 9usize) & 0x01;
7859 let offs = 2usize + n * 4usize; 7880 super::vals::Ps(val as u8)
7860 let val = (self.0 >> offs) & 0x01;
7861 val != 0
7862 } 7881 }
7863 #[doc = "Capture/Compare 1 complementary output enable"] 7882 #[doc = "Parity selection"]
7864 pub fn set_ccne(&mut self, n: usize, val: bool) { 7883 pub fn set_ps(&mut self, val: super::vals::Ps) {
7865 assert!(n < 4usize); 7884 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
7866 let offs = 2usize + n * 4usize;
7867 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7868 } 7885 }
7869 #[doc = "Capture/Compare 1 output Polarity"] 7886 #[doc = "Parity control enable"]
7870 pub fn ccnp(&self, n: usize) -> bool { 7887 pub const fn pce(&self) -> bool {
7871 assert!(n < 4usize); 7888 let val = (self.0 >> 10usize) & 0x01;
7872 let offs = 3usize + n * 4usize;
7873 let val = (self.0 >> offs) & 0x01;
7874 val != 0 7889 val != 0
7875 } 7890 }
7876 #[doc = "Capture/Compare 1 output Polarity"] 7891 #[doc = "Parity control enable"]
7877 pub fn set_ccnp(&mut self, n: usize, val: bool) { 7892 pub fn set_pce(&mut self, val: bool) {
7878 assert!(n < 4usize); 7893 self.0 = (self.0 & !(0x01 << 10usize)) | (((val as u32) & 0x01) << 10usize);
7879 let offs = 3usize + n * 4usize;
7880 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7881 } 7894 }
7882 } 7895 #[doc = "Wakeup method"]
7883 impl Default for CcerAdv { 7896 pub const fn wake(&self) -> super::vals::Wake {
7884 fn default() -> CcerAdv { 7897 let val = (self.0 >> 11usize) & 0x01;
7885 CcerAdv(0) 7898 super::vals::Wake(val as u8)
7886 } 7899 }
7887 } 7900 #[doc = "Wakeup method"]
7888 #[doc = "DMA/Interrupt enable register"] 7901 pub fn set_wake(&mut self, val: super::vals::Wake) {
7889 #[repr(transparent)] 7902 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
7890 #[derive(Copy, Clone, Eq, PartialEq)]
7891 pub struct DierBasic(pub u32);
7892 impl DierBasic {
7893 #[doc = "Update interrupt enable"]
7894 pub const fn uie(&self) -> bool {
7895 let val = (self.0 >> 0usize) & 0x01;
7896 val != 0
7897 } 7903 }
7898 #[doc = "Update interrupt enable"] 7904 #[doc = "Word length"]
7899 pub fn set_uie(&mut self, val: bool) { 7905 pub const fn m(&self) -> super::vals::M {
7900 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 7906 let val = (self.0 >> 12usize) & 0x01;
7907 super::vals::M(val as u8)
7901 } 7908 }
7902 #[doc = "Update DMA request enable"] 7909 #[doc = "Word length"]
7903 pub const fn ude(&self) -> bool { 7910 pub fn set_m(&mut self, val: super::vals::M) {
7904 let val = (self.0 >> 8usize) & 0x01; 7911 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
7912 }
7913 #[doc = "USART enable"]
7914 pub const fn ue(&self) -> bool {
7915 let val = (self.0 >> 13usize) & 0x01;
7905 val != 0 7916 val != 0
7906 } 7917 }
7907 #[doc = "Update DMA request enable"] 7918 #[doc = "USART enable"]
7908 pub fn set_ude(&mut self, val: bool) { 7919 pub fn set_ue(&mut self, val: bool) {
7909 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 7920 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
7910 } 7921 }
7911 } 7922 }
7912 impl Default for DierBasic { 7923 impl Default for Cr1 {
7913 fn default() -> DierBasic { 7924 fn default() -> Cr1 {
7914 DierBasic(0) 7925 Cr1(0)
7915 } 7926 }
7916 } 7927 }
7917 #[doc = "event generation register"] 7928 #[doc = "Control register 2"]
7918 #[repr(transparent)] 7929 #[repr(transparent)]
7919 #[derive(Copy, Clone, Eq, PartialEq)] 7930 #[derive(Copy, Clone, Eq, PartialEq)]
7920 pub struct EgrAdv(pub u32); 7931 pub struct Cr2(pub u32);
7921 impl EgrAdv { 7932 impl Cr2 {
7922 #[doc = "Update generation"] 7933 #[doc = "Address of the USART node"]
7923 pub const fn ug(&self) -> bool { 7934 pub const fn add(&self) -> u8 {
7924 let val = (self.0 >> 0usize) & 0x01; 7935 let val = (self.0 >> 0usize) & 0x0f;
7925 val != 0 7936 val as u8
7926 }
7927 #[doc = "Update generation"]
7928 pub fn set_ug(&mut self, val: bool) {
7929 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
7930 }
7931 #[doc = "Capture/compare 1 generation"]
7932 pub fn ccg(&self, n: usize) -> bool {
7933 assert!(n < 4usize);
7934 let offs = 1usize + n * 1usize;
7935 let val = (self.0 >> offs) & 0x01;
7936 val != 0
7937 } 7937 }
7938 #[doc = "Capture/compare 1 generation"] 7938 #[doc = "Address of the USART node"]
7939 pub fn set_ccg(&mut self, n: usize, val: bool) { 7939 pub fn set_add(&mut self, val: u8) {
7940 assert!(n < 4usize); 7940 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
7941 let offs = 1usize + n * 1usize;
7942 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
7943 } 7941 }
7944 #[doc = "Capture/Compare control update generation"] 7942 #[doc = "lin break detection length"]
7945 pub const fn comg(&self) -> bool { 7943 pub const fn lbdl(&self) -> super::vals::Lbdl {
7946 let val = (self.0 >> 5usize) & 0x01; 7944 let val = (self.0 >> 5usize) & 0x01;
7947 val != 0 7945 super::vals::Lbdl(val as u8)
7948 } 7946 }
7949 #[doc = "Capture/Compare control update generation"] 7947 #[doc = "lin break detection length"]
7950 pub fn set_comg(&mut self, val: bool) { 7948 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
7951 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 7949 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
7952 } 7950 }
7953 #[doc = "Trigger generation"] 7951 #[doc = "LIN break detection interrupt enable"]
7954 pub const fn tg(&self) -> bool { 7952 pub const fn lbdie(&self) -> bool {
7955 let val = (self.0 >> 6usize) & 0x01; 7953 let val = (self.0 >> 6usize) & 0x01;
7956 val != 0 7954 val != 0
7957 } 7955 }
7958 #[doc = "Trigger generation"] 7956 #[doc = "LIN break detection interrupt enable"]
7959 pub fn set_tg(&mut self, val: bool) { 7957 pub fn set_lbdie(&mut self, val: bool) {
7960 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 7958 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
7961 } 7959 }
7962 #[doc = "Break generation"] 7960 #[doc = "STOP bits"]
7963 pub const fn bg(&self) -> bool { 7961 pub const fn stop(&self) -> super::vals::Stop {
7964 let val = (self.0 >> 7usize) & 0x01; 7962 let val = (self.0 >> 12usize) & 0x03;
7965 val != 0 7963 super::vals::Stop(val as u8)
7966 }
7967 #[doc = "Break generation"]
7968 pub fn set_bg(&mut self, val: bool) {
7969 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
7970 } 7964 }
7971 } 7965 #[doc = "STOP bits"]
7972 impl Default for EgrAdv { 7966 pub fn set_stop(&mut self, val: super::vals::Stop) {
7973 fn default() -> EgrAdv { 7967 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
7974 EgrAdv(0)
7975 } 7968 }
7976 } 7969 #[doc = "LIN mode enable"]
7977 #[doc = "control register 2"] 7970 pub const fn linen(&self) -> bool {
7978 #[repr(transparent)] 7971 let val = (self.0 >> 14usize) & 0x01;
7979 #[derive(Copy, Clone, Eq, PartialEq)] 7972 val != 0
7980 pub struct Cr2Basic(pub u32);
7981 impl Cr2Basic {
7982 #[doc = "Master mode selection"]
7983 pub const fn mms(&self) -> super::vals::Mms {
7984 let val = (self.0 >> 4usize) & 0x07;
7985 super::vals::Mms(val as u8)
7986 } 7973 }
7987 #[doc = "Master mode selection"] 7974 #[doc = "LIN mode enable"]
7988 pub fn set_mms(&mut self, val: super::vals::Mms) { 7975 pub fn set_linen(&mut self, val: bool) {
7989 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize); 7976 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
7990 } 7977 }
7991 } 7978 }
7992 impl Default for Cr2Basic { 7979 impl Default for Cr2 {
7993 fn default() -> Cr2Basic { 7980 fn default() -> Cr2 {
7994 Cr2Basic(0) 7981 Cr2(0)
7995 } 7982 }
7996 } 7983 }
7997 #[doc = "status register"] 7984 #[doc = "Control register 2"]
7998 #[repr(transparent)] 7985 #[repr(transparent)]
7999 #[derive(Copy, Clone, Eq, PartialEq)] 7986 #[derive(Copy, Clone, Eq, PartialEq)]
8000 pub struct SrGp(pub u32); 7987 pub struct Cr2Usart(pub u32);
8001 impl SrGp { 7988 impl Cr2Usart {
8002 #[doc = "Update interrupt flag"] 7989 #[doc = "Address of the USART node"]
8003 pub const fn uif(&self) -> bool { 7990 pub const fn add(&self) -> u8 {
8004 let val = (self.0 >> 0usize) & 0x01; 7991 let val = (self.0 >> 0usize) & 0x0f;
8005 val != 0 7992 val as u8
8006 }
8007 #[doc = "Update interrupt flag"]
8008 pub fn set_uif(&mut self, val: bool) {
8009 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8010 }
8011 #[doc = "Capture/compare 1 interrupt flag"]
8012 pub fn ccif(&self, n: usize) -> bool {
8013 assert!(n < 4usize);
8014 let offs = 1usize + n * 1usize;
8015 let val = (self.0 >> offs) & 0x01;
8016 val != 0
8017 } 7993 }
8018 #[doc = "Capture/compare 1 interrupt flag"] 7994 #[doc = "Address of the USART node"]
8019 pub fn set_ccif(&mut self, n: usize, val: bool) { 7995 pub fn set_add(&mut self, val: u8) {
8020 assert!(n < 4usize); 7996 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
8021 let offs = 1usize + n * 1usize;
8022 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8023 } 7997 }
8024 #[doc = "COM interrupt flag"] 7998 #[doc = "lin break detection length"]
8025 pub const fn comif(&self) -> bool { 7999 pub const fn lbdl(&self) -> super::vals::Lbdl {
8026 let val = (self.0 >> 5usize) & 0x01; 8000 let val = (self.0 >> 5usize) & 0x01;
8027 val != 0 8001 super::vals::Lbdl(val as u8)
8028 } 8002 }
8029 #[doc = "COM interrupt flag"] 8003 #[doc = "lin break detection length"]
8030 pub fn set_comif(&mut self, val: bool) { 8004 pub fn set_lbdl(&mut self, val: super::vals::Lbdl) {
8031 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 8005 self.0 = (self.0 & !(0x01 << 5usize)) | (((val.0 as u32) & 0x01) << 5usize);
8032 } 8006 }
8033 #[doc = "Trigger interrupt flag"] 8007 #[doc = "LIN break detection interrupt enable"]
8034 pub const fn tif(&self) -> bool { 8008 pub const fn lbdie(&self) -> bool {
8035 let val = (self.0 >> 6usize) & 0x01; 8009 let val = (self.0 >> 6usize) & 0x01;
8036 val != 0 8010 val != 0
8037 } 8011 }
8038 #[doc = "Trigger interrupt flag"] 8012 #[doc = "LIN break detection interrupt enable"]
8039 pub fn set_tif(&mut self, val: bool) { 8013 pub fn set_lbdie(&mut self, val: bool) {
8040 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 8014 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8041 } 8015 }
8042 #[doc = "Break interrupt flag"] 8016 #[doc = "Last bit clock pulse"]
8043 pub const fn bif(&self) -> bool { 8017 pub const fn lbcl(&self) -> bool {
8044 let val = (self.0 >> 7usize) & 0x01; 8018 let val = (self.0 >> 8usize) & 0x01;
8045 val != 0 8019 val != 0
8046 } 8020 }
8047 #[doc = "Break interrupt flag"] 8021 #[doc = "Last bit clock pulse"]
8048 pub fn set_bif(&mut self, val: bool) { 8022 pub fn set_lbcl(&mut self, val: bool) {
8049 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 8023 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
8050 } 8024 }
8051 #[doc = "Capture/Compare 1 overcapture flag"] 8025 #[doc = "Clock phase"]
8052 pub fn ccof(&self, n: usize) -> bool { 8026 pub const fn cpha(&self) -> super::vals::Cpha {
8053 assert!(n < 4usize); 8027 let val = (self.0 >> 9usize) & 0x01;
8054 let offs = 9usize + n * 1usize; 8028 super::vals::Cpha(val as u8)
8055 let val = (self.0 >> offs) & 0x01; 8029 }
8030 #[doc = "Clock phase"]
8031 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
8032 self.0 = (self.0 & !(0x01 << 9usize)) | (((val.0 as u32) & 0x01) << 9usize);
8033 }
8034 #[doc = "Clock polarity"]
8035 pub const fn cpol(&self) -> super::vals::Cpol {
8036 let val = (self.0 >> 10usize) & 0x01;
8037 super::vals::Cpol(val as u8)
8038 }
8039 #[doc = "Clock polarity"]
8040 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
8041 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
8042 }
8043 #[doc = "Clock enable"]
8044 pub const fn clken(&self) -> bool {
8045 let val = (self.0 >> 11usize) & 0x01;
8056 val != 0 8046 val != 0
8057 } 8047 }
8058 #[doc = "Capture/Compare 1 overcapture flag"] 8048 #[doc = "Clock enable"]
8059 pub fn set_ccof(&mut self, n: usize, val: bool) { 8049 pub fn set_clken(&mut self, val: bool) {
8060 assert!(n < 4usize); 8050 self.0 = (self.0 & !(0x01 << 11usize)) | (((val as u32) & 0x01) << 11usize);
8061 let offs = 9usize + n * 1usize;
8062 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8063 } 8051 }
8064 } 8052 #[doc = "STOP bits"]
8065 impl Default for SrGp { 8053 pub const fn stop(&self) -> super::vals::Stop {
8066 fn default() -> SrGp { 8054 let val = (self.0 >> 12usize) & 0x03;
8067 SrGp(0) 8055 super::vals::Stop(val as u8)
8068 } 8056 }
8069 } 8057 #[doc = "STOP bits"]
8070 #[doc = "event generation register"] 8058 pub fn set_stop(&mut self, val: super::vals::Stop) {
8071 #[repr(transparent)] 8059 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
8072 #[derive(Copy, Clone, Eq, PartialEq)] 8060 }
8073 pub struct EgrBasic(pub u32); 8061 #[doc = "LIN mode enable"]
8074 impl EgrBasic { 8062 pub const fn linen(&self) -> bool {
8075 #[doc = "Update generation"] 8063 let val = (self.0 >> 14usize) & 0x01;
8076 pub const fn ug(&self) -> bool {
8077 let val = (self.0 >> 0usize) & 0x01;
8078 val != 0 8064 val != 0
8079 } 8065 }
8080 #[doc = "Update generation"] 8066 #[doc = "LIN mode enable"]
8081 pub fn set_ug(&mut self, val: bool) { 8067 pub fn set_linen(&mut self, val: bool) {
8082 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 8068 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize);
8083 } 8069 }
8084 } 8070 }
8085 impl Default for EgrBasic { 8071 impl Default for Cr2Usart {
8086 fn default() -> EgrBasic { 8072 fn default() -> Cr2Usart {
8087 EgrBasic(0) 8073 Cr2Usart(0)
8088 } 8074 }
8089 } 8075 }
8090 #[doc = "control register 1"] 8076 #[doc = "Control register 3"]
8091 #[repr(transparent)] 8077 #[repr(transparent)]
8092 #[derive(Copy, Clone, Eq, PartialEq)] 8078 #[derive(Copy, Clone, Eq, PartialEq)]
8093 pub struct Cr1Gp(pub u32); 8079 pub struct Cr3(pub u32);
8094 impl Cr1Gp { 8080 impl Cr3 {
8095 #[doc = "Counter enable"] 8081 #[doc = "Error interrupt enable"]
8096 pub const fn cen(&self) -> bool { 8082 pub const fn eie(&self) -> bool {
8097 let val = (self.0 >> 0usize) & 0x01; 8083 let val = (self.0 >> 0usize) & 0x01;
8098 val != 0 8084 val != 0
8099 } 8085 }
8100 #[doc = "Counter enable"] 8086 #[doc = "Error interrupt enable"]
8101 pub fn set_cen(&mut self, val: bool) { 8087 pub fn set_eie(&mut self, val: bool) {
8102 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 8088 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8103 } 8089 }
8104 #[doc = "Update disable"] 8090 #[doc = "IrDA mode enable"]
8105 pub const fn udis(&self) -> bool { 8091 pub const fn iren(&self) -> bool {
8106 let val = (self.0 >> 1usize) & 0x01; 8092 let val = (self.0 >> 1usize) & 0x01;
8107 val != 0 8093 val != 0
8108 } 8094 }
8109 #[doc = "Update disable"] 8095 #[doc = "IrDA mode enable"]
8110 pub fn set_udis(&mut self, val: bool) { 8096 pub fn set_iren(&mut self, val: bool) {
8111 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 8097 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8112 } 8098 }
8113 #[doc = "Update request source"] 8099 #[doc = "IrDA low-power"]
8114 pub const fn urs(&self) -> super::vals::Urs { 8100 pub const fn irlp(&self) -> super::vals::Irlp {
8115 let val = (self.0 >> 2usize) & 0x01; 8101 let val = (self.0 >> 2usize) & 0x01;
8116 super::vals::Urs(val as u8) 8102 super::vals::Irlp(val as u8)
8117 } 8103 }
8118 #[doc = "Update request source"] 8104 #[doc = "IrDA low-power"]
8119 pub fn set_urs(&mut self, val: super::vals::Urs) { 8105 pub fn set_irlp(&mut self, val: super::vals::Irlp) {
8120 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 8106 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
8121 } 8107 }
8122 #[doc = "One-pulse mode"] 8108 #[doc = "Half-duplex selection"]
8123 pub const fn opm(&self) -> super::vals::Opm { 8109 pub const fn hdsel(&self) -> super::vals::Hdsel {
8124 let val = (self.0 >> 3usize) & 0x01; 8110 let val = (self.0 >> 3usize) & 0x01;
8125 super::vals::Opm(val as u8) 8111 super::vals::Hdsel(val as u8)
8126 } 8112 }
8127 #[doc = "One-pulse mode"] 8113 #[doc = "Half-duplex selection"]
8128 pub fn set_opm(&mut self, val: super::vals::Opm) { 8114 pub fn set_hdsel(&mut self, val: super::vals::Hdsel) {
8129 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 8115 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize);
8130 } 8116 }
8131 #[doc = "Direction"] 8117 #[doc = "DMA enable receiver"]
8132 pub const fn dir(&self) -> super::vals::Dir { 8118 pub const fn dmar(&self) -> bool {
8133 let val = (self.0 >> 4usize) & 0x01; 8119 let val = (self.0 >> 6usize) & 0x01;
8134 super::vals::Dir(val as u8) 8120 val != 0
8135 } 8121 }
8136 #[doc = "Direction"] 8122 #[doc = "DMA enable receiver"]
8137 pub fn set_dir(&mut self, val: super::vals::Dir) { 8123 pub fn set_dmar(&mut self, val: bool) {
8138 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize); 8124 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8139 } 8125 }
8140 #[doc = "Center-aligned mode selection"] 8126 #[doc = "DMA enable transmitter"]
8141 pub const fn cms(&self) -> super::vals::Cms { 8127 pub const fn dmat(&self) -> bool {
8142 let val = (self.0 >> 5usize) & 0x03; 8128 let val = (self.0 >> 7usize) & 0x01;
8143 super::vals::Cms(val as u8) 8129 val != 0
8144 } 8130 }
8145 #[doc = "Center-aligned mode selection"] 8131 #[doc = "DMA enable transmitter"]
8146 pub fn set_cms(&mut self, val: super::vals::Cms) { 8132 pub fn set_dmat(&mut self, val: bool) {
8147 self.0 = (self.0 & !(0x03 << 5usize)) | (((val.0 as u32) & 0x03) << 5usize); 8133 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
8148 } 8134 }
8149 #[doc = "Auto-reload preload enable"] 8135 }
8150 pub const fn arpe(&self) -> super::vals::Arpe { 8136 impl Default for Cr3 {
8151 let val = (self.0 >> 7usize) & 0x01; 8137 fn default() -> Cr3 {
8152 super::vals::Arpe(val as u8) 8138 Cr3(0)
8153 } 8139 }
8154 #[doc = "Auto-reload preload enable"] 8140 }
8155 pub fn set_arpe(&mut self, val: super::vals::Arpe) { 8141 #[doc = "Baud rate register"]
8156 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 8142 #[repr(transparent)]
8143 #[derive(Copy, Clone, Eq, PartialEq)]
8144 pub struct Brr(pub u32);
8145 impl Brr {
8146 #[doc = "fraction of USARTDIV"]
8147 pub const fn div_fraction(&self) -> u8 {
8148 let val = (self.0 >> 0usize) & 0x0f;
8149 val as u8
8157 } 8150 }
8158 #[doc = "Clock division"] 8151 #[doc = "fraction of USARTDIV"]
8159 pub const fn ckd(&self) -> super::vals::Ckd { 8152 pub fn set_div_fraction(&mut self, val: u8) {
8160 let val = (self.0 >> 8usize) & 0x03; 8153 self.0 = (self.0 & !(0x0f << 0usize)) | (((val as u32) & 0x0f) << 0usize);
8161 super::vals::Ckd(val as u8)
8162 } 8154 }
8163 #[doc = "Clock division"] 8155 #[doc = "mantissa of USARTDIV"]
8164 pub fn set_ckd(&mut self, val: super::vals::Ckd) { 8156 pub const fn div_mantissa(&self) -> u16 {
8165 self.0 = (self.0 & !(0x03 << 8usize)) | (((val.0 as u32) & 0x03) << 8usize); 8157 let val = (self.0 >> 4usize) & 0x0fff;
8158 val as u16
8159 }
8160 #[doc = "mantissa of USARTDIV"]
8161 pub fn set_div_mantissa(&mut self, val: u16) {
8162 self.0 = (self.0 & !(0x0fff << 4usize)) | (((val as u32) & 0x0fff) << 4usize);
8166 } 8163 }
8167 } 8164 }
8168 impl Default for Cr1Gp { 8165 impl Default for Brr {
8169 fn default() -> Cr1Gp { 8166 fn default() -> Brr {
8170 Cr1Gp(0) 8167 Brr(0)
8171 } 8168 }
8172 } 8169 }
8173 #[doc = "prescaler"] 8170 #[doc = "Data register"]
8174 #[repr(transparent)] 8171 #[repr(transparent)]
8175 #[derive(Copy, Clone, Eq, PartialEq)] 8172 #[derive(Copy, Clone, Eq, PartialEq)]
8176 pub struct Psc(pub u32); 8173 pub struct Dr(pub u32);
8177 impl Psc { 8174 impl Dr {
8178 #[doc = "Prescaler value"] 8175 #[doc = "Data value"]
8179 pub const fn psc(&self) -> u16 { 8176 pub const fn dr(&self) -> u16 {
8180 let val = (self.0 >> 0usize) & 0xffff; 8177 let val = (self.0 >> 0usize) & 0x01ff;
8181 val as u16 8178 val as u16
8182 } 8179 }
8183 #[doc = "Prescaler value"] 8180 #[doc = "Data value"]
8184 pub fn set_psc(&mut self, val: u16) { 8181 pub fn set_dr(&mut self, val: u16) {
8185 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 8182 self.0 = (self.0 & !(0x01ff << 0usize)) | (((val as u32) & 0x01ff) << 0usize);
8186 } 8183 }
8187 } 8184 }
8188 impl Default for Psc { 8185 impl Default for Dr {
8189 fn default() -> Psc { 8186 fn default() -> Dr {
8190 Psc(0) 8187 Dr(0)
8191 } 8188 }
8192 } 8189 }
8193 #[doc = "capture/compare enable register"] 8190 #[doc = "Status register"]
8194 #[repr(transparent)] 8191 #[repr(transparent)]
8195 #[derive(Copy, Clone, Eq, PartialEq)] 8192 #[derive(Copy, Clone, Eq, PartialEq)]
8196 pub struct CcerGp(pub u32); 8193 pub struct SrUsart(pub u32);
8197 impl CcerGp { 8194 impl SrUsart {
8198 #[doc = "Capture/Compare 1 output enable"] 8195 #[doc = "Parity error"]
8199 pub fn cce(&self, n: usize) -> bool { 8196 pub const fn pe(&self) -> bool {
8200 assert!(n < 4usize); 8197 let val = (self.0 >> 0usize) & 0x01;
8201 let offs = 0usize + n * 4usize;
8202 let val = (self.0 >> offs) & 0x01;
8203 val != 0 8198 val != 0
8204 } 8199 }
8205 #[doc = "Capture/Compare 1 output enable"] 8200 #[doc = "Parity error"]
8206 pub fn set_cce(&mut self, n: usize, val: bool) { 8201 pub fn set_pe(&mut self, val: bool) {
8207 assert!(n < 4usize); 8202 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8208 let offs = 0usize + n * 4usize;
8209 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8210 } 8203 }
8211 #[doc = "Capture/Compare 1 output Polarity"] 8204 #[doc = "Framing error"]
8212 pub fn ccp(&self, n: usize) -> bool { 8205 pub const fn fe(&self) -> bool {
8213 assert!(n < 4usize); 8206 let val = (self.0 >> 1usize) & 0x01;
8214 let offs = 1usize + n * 4usize;
8215 let val = (self.0 >> offs) & 0x01;
8216 val != 0 8207 val != 0
8217 } 8208 }
8218 #[doc = "Capture/Compare 1 output Polarity"] 8209 #[doc = "Framing error"]
8219 pub fn set_ccp(&mut self, n: usize, val: bool) { 8210 pub fn set_fe(&mut self, val: bool) {
8220 assert!(n < 4usize); 8211 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8221 let offs = 1usize + n * 4usize;
8222 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8223 } 8212 }
8224 #[doc = "Capture/Compare 1 output Polarity"] 8213 #[doc = "Noise error flag"]
8225 pub fn ccnp(&self, n: usize) -> bool { 8214 pub const fn ne(&self) -> bool {
8226 assert!(n < 4usize); 8215 let val = (self.0 >> 2usize) & 0x01;
8227 let offs = 3usize + n * 4usize;
8228 let val = (self.0 >> offs) & 0x01;
8229 val != 0 8216 val != 0
8230 } 8217 }
8231 #[doc = "Capture/Compare 1 output Polarity"] 8218 #[doc = "Noise error flag"]
8232 pub fn set_ccnp(&mut self, n: usize, val: bool) { 8219 pub fn set_ne(&mut self, val: bool) {
8233 assert!(n < 4usize); 8220 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8234 let offs = 3usize + n * 4usize;
8235 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8236 }
8237 }
8238 impl Default for CcerGp {
8239 fn default() -> CcerGp {
8240 CcerGp(0)
8241 } 8221 }
8242 } 8222 #[doc = "Overrun error"]
8243 #[doc = "DMA/Interrupt enable register"] 8223 pub const fn ore(&self) -> bool {
8244 #[repr(transparent)] 8224 let val = (self.0 >> 3usize) & 0x01;
8245 #[derive(Copy, Clone, Eq, PartialEq)]
8246 pub struct DierAdv(pub u32);
8247 impl DierAdv {
8248 #[doc = "Update interrupt enable"]
8249 pub const fn uie(&self) -> bool {
8250 let val = (self.0 >> 0usize) & 0x01;
8251 val != 0 8225 val != 0
8252 } 8226 }
8253 #[doc = "Update interrupt enable"] 8227 #[doc = "Overrun error"]
8254 pub fn set_uie(&mut self, val: bool) { 8228 pub fn set_ore(&mut self, val: bool) {
8255 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 8229 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
8256 } 8230 }
8257 #[doc = "Capture/Compare 1 interrupt enable"] 8231 #[doc = "IDLE line detected"]
8258 pub fn ccie(&self, n: usize) -> bool { 8232 pub const fn idle(&self) -> bool {
8259 assert!(n < 4usize); 8233 let val = (self.0 >> 4usize) & 0x01;
8260 let offs = 1usize + n * 1usize;
8261 let val = (self.0 >> offs) & 0x01;
8262 val != 0 8234 val != 0
8263 } 8235 }
8264 #[doc = "Capture/Compare 1 interrupt enable"] 8236 #[doc = "IDLE line detected"]
8265 pub fn set_ccie(&mut self, n: usize, val: bool) { 8237 pub fn set_idle(&mut self, val: bool) {
8266 assert!(n < 4usize); 8238 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
8267 let offs = 1usize + n * 1usize;
8268 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8269 } 8239 }
8270 #[doc = "COM interrupt enable"] 8240 #[doc = "Read data register not empty"]
8271 pub const fn comie(&self) -> bool { 8241 pub const fn rxne(&self) -> bool {
8272 let val = (self.0 >> 5usize) & 0x01; 8242 let val = (self.0 >> 5usize) & 0x01;
8273 val != 0 8243 val != 0
8274 } 8244 }
8275 #[doc = "COM interrupt enable"] 8245 #[doc = "Read data register not empty"]
8276 pub fn set_comie(&mut self, val: bool) { 8246 pub fn set_rxne(&mut self, val: bool) {
8277 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 8247 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8278 } 8248 }
8279 #[doc = "Trigger interrupt enable"] 8249 #[doc = "Transmission complete"]
8280 pub const fn tie(&self) -> bool { 8250 pub const fn tc(&self) -> bool {
8281 let val = (self.0 >> 6usize) & 0x01; 8251 let val = (self.0 >> 6usize) & 0x01;
8282 val != 0 8252 val != 0
8283 } 8253 }
8284 #[doc = "Trigger interrupt enable"] 8254 #[doc = "Transmission complete"]
8285 pub fn set_tie(&mut self, val: bool) { 8255 pub fn set_tc(&mut self, val: bool) {
8286 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 8256 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8287 } 8257 }
8288 #[doc = "Break interrupt enable"] 8258 #[doc = "Transmit data register empty"]
8289 pub const fn bie(&self) -> bool { 8259 pub const fn txe(&self) -> bool {
8290 let val = (self.0 >> 7usize) & 0x01; 8260 let val = (self.0 >> 7usize) & 0x01;
8291 val != 0 8261 val != 0
8292 } 8262 }
8293 #[doc = "Break interrupt enable"] 8263 #[doc = "Transmit data register empty"]
8294 pub fn set_bie(&mut self, val: bool) { 8264 pub fn set_txe(&mut self, val: bool) {
8295 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 8265 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
8296 } 8266 }
8297 #[doc = "Update DMA request enable"] 8267 #[doc = "LIN break detection flag"]
8298 pub const fn ude(&self) -> bool { 8268 pub const fn lbd(&self) -> bool {
8299 let val = (self.0 >> 8usize) & 0x01; 8269 let val = (self.0 >> 8usize) & 0x01;
8300 val != 0 8270 val != 0
8301 } 8271 }
8302 #[doc = "Update DMA request enable"] 8272 #[doc = "LIN break detection flag"]
8303 pub fn set_ude(&mut self, val: bool) { 8273 pub fn set_lbd(&mut self, val: bool) {
8304 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize); 8274 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
8305 } 8275 }
8306 #[doc = "Capture/Compare 1 DMA request enable"] 8276 #[doc = "CTS flag"]
8307 pub fn ccde(&self, n: usize) -> bool { 8277 pub const fn cts(&self) -> bool {
8308 assert!(n < 4usize); 8278 let val = (self.0 >> 9usize) & 0x01;
8309 let offs = 9usize + n * 1usize;
8310 let val = (self.0 >> offs) & 0x01;
8311 val != 0
8312 }
8313 #[doc = "Capture/Compare 1 DMA request enable"]
8314 pub fn set_ccde(&mut self, n: usize, val: bool) {
8315 assert!(n < 4usize);
8316 let offs = 9usize + n * 1usize;
8317 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8318 }
8319 #[doc = "COM DMA request enable"]
8320 pub const fn comde(&self) -> bool {
8321 let val = (self.0 >> 13usize) & 0x01;
8322 val != 0
8323 }
8324 #[doc = "COM DMA request enable"]
8325 pub fn set_comde(&mut self, val: bool) {
8326 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
8327 }
8328 #[doc = "Trigger DMA request enable"]
8329 pub const fn tde(&self) -> bool {
8330 let val = (self.0 >> 14usize) & 0x01;
8331 val != 0 8279 val != 0
8332 } 8280 }
8333 #[doc = "Trigger DMA request enable"] 8281 #[doc = "CTS flag"]
8334 pub fn set_tde(&mut self, val: bool) { 8282 pub fn set_cts(&mut self, val: bool) {
8335 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 8283 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
8336 } 8284 }
8337 } 8285 }
8338 impl Default for DierAdv { 8286 impl Default for SrUsart {
8339 fn default() -> DierAdv { 8287 fn default() -> SrUsart {
8340 DierAdv(0) 8288 SrUsart(0)
8341 } 8289 }
8342 } 8290 }
8343 #[doc = "slave mode control register"] 8291 #[doc = "Guard time and prescaler register"]
8344 #[repr(transparent)] 8292 #[repr(transparent)]
8345 #[derive(Copy, Clone, Eq, PartialEq)] 8293 #[derive(Copy, Clone, Eq, PartialEq)]
8346 pub struct Smcr(pub u32); 8294 pub struct Gtpr(pub u32);
8347 impl Smcr { 8295 impl Gtpr {
8348 #[doc = "Slave mode selection"] 8296 #[doc = "Prescaler value"]
8349 pub const fn sms(&self) -> super::vals::Sms { 8297 pub const fn psc(&self) -> u8 {
8350 let val = (self.0 >> 0usize) & 0x07; 8298 let val = (self.0 >> 0usize) & 0xff;
8351 super::vals::Sms(val as u8) 8299 val as u8
8352 }
8353 #[doc = "Slave mode selection"]
8354 pub fn set_sms(&mut self, val: super::vals::Sms) {
8355 self.0 = (self.0 & !(0x07 << 0usize)) | (((val.0 as u32) & 0x07) << 0usize);
8356 }
8357 #[doc = "Trigger selection"]
8358 pub const fn ts(&self) -> super::vals::Ts {
8359 let val = (self.0 >> 4usize) & 0x07;
8360 super::vals::Ts(val as u8)
8361 }
8362 #[doc = "Trigger selection"]
8363 pub fn set_ts(&mut self, val: super::vals::Ts) {
8364 self.0 = (self.0 & !(0x07 << 4usize)) | (((val.0 as u32) & 0x07) << 4usize);
8365 }
8366 #[doc = "Master/Slave mode"]
8367 pub const fn msm(&self) -> super::vals::Msm {
8368 let val = (self.0 >> 7usize) & 0x01;
8369 super::vals::Msm(val as u8)
8370 }
8371 #[doc = "Master/Slave mode"]
8372 pub fn set_msm(&mut self, val: super::vals::Msm) {
8373 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
8374 }
8375 #[doc = "External trigger filter"]
8376 pub const fn etf(&self) -> super::vals::Etf {
8377 let val = (self.0 >> 8usize) & 0x0f;
8378 super::vals::Etf(val as u8)
8379 }
8380 #[doc = "External trigger filter"]
8381 pub fn set_etf(&mut self, val: super::vals::Etf) {
8382 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
8383 }
8384 #[doc = "External trigger prescaler"]
8385 pub const fn etps(&self) -> super::vals::Etps {
8386 let val = (self.0 >> 12usize) & 0x03;
8387 super::vals::Etps(val as u8)
8388 }
8389 #[doc = "External trigger prescaler"]
8390 pub fn set_etps(&mut self, val: super::vals::Etps) {
8391 self.0 = (self.0 & !(0x03 << 12usize)) | (((val.0 as u32) & 0x03) << 12usize);
8392 }
8393 #[doc = "External clock enable"]
8394 pub const fn ece(&self) -> super::vals::Ece {
8395 let val = (self.0 >> 14usize) & 0x01;
8396 super::vals::Ece(val as u8)
8397 } 8300 }
8398 #[doc = "External clock enable"] 8301 #[doc = "Prescaler value"]
8399 pub fn set_ece(&mut self, val: super::vals::Ece) { 8302 pub fn set_psc(&mut self, val: u8) {
8400 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize); 8303 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize);
8401 } 8304 }
8402 #[doc = "External trigger polarity"] 8305 #[doc = "Guard time value"]
8403 pub const fn etp(&self) -> super::vals::Etp { 8306 pub const fn gt(&self) -> u8 {
8404 let val = (self.0 >> 15usize) & 0x01; 8307 let val = (self.0 >> 8usize) & 0xff;
8405 super::vals::Etp(val as u8) 8308 val as u8
8406 } 8309 }
8407 #[doc = "External trigger polarity"] 8310 #[doc = "Guard time value"]
8408 pub fn set_etp(&mut self, val: super::vals::Etp) { 8311 pub fn set_gt(&mut self, val: u8) {
8409 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize); 8312 self.0 = (self.0 & !(0xff << 8usize)) | (((val as u32) & 0xff) << 8usize);
8410 } 8313 }
8411 } 8314 }
8412 impl Default for Smcr { 8315 impl Default for Gtpr {
8413 fn default() -> Smcr { 8316 fn default() -> Gtpr {
8414 Smcr(0) 8317 Gtpr(0)
8415 } 8318 }
8416 } 8319 }
8417 #[doc = "DMA control register"] 8320 }
8321 pub mod vals {
8322 use crate::generic::*;
8418 #[repr(transparent)] 8323 #[repr(transparent)]
8419 #[derive(Copy, Clone, Eq, PartialEq)] 8324 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8420 pub struct Dcr(pub u32); 8325 pub struct Cpol(pub u8);
8421 impl Dcr { 8326 impl Cpol {
8422 #[doc = "DMA base address"] 8327 #[doc = "Steady low value on CK pin outside transmission window"]
8423 pub const fn dba(&self) -> u8 { 8328 pub const LOW: Self = Self(0);
8424 let val = (self.0 >> 0usize) & 0x1f; 8329 #[doc = "Steady high value on CK pin outside transmission window"]
8425 val as u8 8330 pub const HIGH: Self = Self(0x01);
8426 }
8427 #[doc = "DMA base address"]
8428 pub fn set_dba(&mut self, val: u8) {
8429 self.0 = (self.0 & !(0x1f << 0usize)) | (((val as u32) & 0x1f) << 0usize);
8430 }
8431 #[doc = "DMA burst length"]
8432 pub const fn dbl(&self) -> u8 {
8433 let val = (self.0 >> 8usize) & 0x1f;
8434 val as u8
8435 }
8436 #[doc = "DMA burst length"]
8437 pub fn set_dbl(&mut self, val: u8) {
8438 self.0 = (self.0 & !(0x1f << 8usize)) | (((val as u32) & 0x1f) << 8usize);
8439 }
8440 } 8331 }
8441 impl Default for Dcr { 8332 #[repr(transparent)]
8442 fn default() -> Dcr { 8333 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8443 Dcr(0) 8334 pub struct Lbdl(pub u8);
8444 } 8335 impl Lbdl {
8336 #[doc = "10-bit break detection"]
8337 pub const LBDL10: Self = Self(0);
8338 #[doc = "11-bit break detection"]
8339 pub const LBDL11: Self = Self(0x01);
8445 } 8340 }
8446 #[doc = "capture/compare register 1"] 8341 #[repr(transparent)]
8342 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8343 pub struct Wake(pub u8);
8344 impl Wake {
8345 #[doc = "USART wakeup on idle line"]
8346 pub const IDLELINE: Self = Self(0);
8347 #[doc = "USART wakeup on address mark"]
8348 pub const ADDRESSMARK: Self = Self(0x01);
8349 }
8350 #[repr(transparent)]
8351 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8352 pub struct Cpha(pub u8);
8353 impl Cpha {
8354 #[doc = "The first clock transition is the first data capture edge"]
8355 pub const FIRST: Self = Self(0);
8356 #[doc = "The second clock transition is the first data capture edge"]
8357 pub const SECOND: Self = Self(0x01);
8358 }
8359 #[repr(transparent)]
8360 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8361 pub struct Sbk(pub u8);
8362 impl Sbk {
8363 #[doc = "No break character is transmitted"]
8364 pub const NOBREAK: Self = Self(0);
8365 #[doc = "Break character transmitted"]
8366 pub const BREAK: Self = Self(0x01);
8367 }
8368 #[repr(transparent)]
8369 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8370 pub struct Rwu(pub u8);
8371 impl Rwu {
8372 #[doc = "Receiver in active mode"]
8373 pub const ACTIVE: Self = Self(0);
8374 #[doc = "Receiver in mute mode"]
8375 pub const MUTE: Self = Self(0x01);
8376 }
8377 #[repr(transparent)]
8378 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8379 pub struct Ps(pub u8);
8380 impl Ps {
8381 #[doc = "Even parity"]
8382 pub const EVEN: Self = Self(0);
8383 #[doc = "Odd parity"]
8384 pub const ODD: Self = Self(0x01);
8385 }
8386 #[repr(transparent)]
8387 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8388 pub struct Irlp(pub u8);
8389 impl Irlp {
8390 #[doc = "Normal mode"]
8391 pub const NORMAL: Self = Self(0);
8392 #[doc = "Low-power mode"]
8393 pub const LOWPOWER: Self = Self(0x01);
8394 }
8395 #[repr(transparent)]
8396 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8397 pub struct Hdsel(pub u8);
8398 impl Hdsel {
8399 #[doc = "Half duplex mode is not selected"]
8400 pub const FULLDUPLEX: Self = Self(0);
8401 #[doc = "Half duplex mode is selected"]
8402 pub const HALFDUPLEX: Self = Self(0x01);
8403 }
8404 #[repr(transparent)]
8405 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8406 pub struct Stop(pub u8);
8407 impl Stop {
8408 #[doc = "1 stop bit"]
8409 pub const STOP1: Self = Self(0);
8410 #[doc = "0.5 stop bits"]
8411 pub const STOP0P5: Self = Self(0x01);
8412 #[doc = "2 stop bits"]
8413 pub const STOP2: Self = Self(0x02);
8414 #[doc = "1.5 stop bits"]
8415 pub const STOP1P5: Self = Self(0x03);
8416 }
8417 #[repr(transparent)]
8418 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8419 pub struct M(pub u8);
8420 impl M {
8421 #[doc = "8 data bits"]
8422 pub const M8: Self = Self(0);
8423 #[doc = "9 data bits"]
8424 pub const M9: Self = Self(0x01);
8425 }
8426 }
8427}
8428pub mod spi_v2 {
8429 use crate::generic::*;
8430 #[doc = "Serial peripheral interface"]
8431 #[derive(Copy, Clone)]
8432 pub struct Spi(pub *mut u8);
8433 unsafe impl Send for Spi {}
8434 unsafe impl Sync for Spi {}
8435 impl Spi {
8436 #[doc = "control register 1"]
8437 pub fn cr1(self) -> Reg<regs::Cr1, RW> {
8438 unsafe { Reg::from_ptr(self.0.add(0usize)) }
8439 }
8440 #[doc = "control register 2"]
8441 pub fn cr2(self) -> Reg<regs::Cr2, RW> {
8442 unsafe { Reg::from_ptr(self.0.add(4usize)) }
8443 }
8444 #[doc = "status register"]
8445 pub fn sr(self) -> Reg<regs::Sr, RW> {
8446 unsafe { Reg::from_ptr(self.0.add(8usize)) }
8447 }
8448 #[doc = "data register"]
8449 pub fn dr(self) -> Reg<regs::Dr, RW> {
8450 unsafe { Reg::from_ptr(self.0.add(12usize)) }
8451 }
8452 #[doc = "CRC polynomial register"]
8453 pub fn crcpr(self) -> Reg<regs::Crcpr, RW> {
8454 unsafe { Reg::from_ptr(self.0.add(16usize)) }
8455 }
8456 #[doc = "RX CRC register"]
8457 pub fn rxcrcr(self) -> Reg<regs::Rxcrcr, R> {
8458 unsafe { Reg::from_ptr(self.0.add(20usize)) }
8459 }
8460 #[doc = "TX CRC register"]
8461 pub fn txcrcr(self) -> Reg<regs::Txcrcr, R> {
8462 unsafe { Reg::from_ptr(self.0.add(24usize)) }
8463 }
8464 }
8465 pub mod vals {
8466 use crate::generic::*;
8467 #[repr(transparent)]
8468 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8469 pub struct Mstr(pub u8);
8470 impl Mstr {
8471 #[doc = "Slave configuration"]
8472 pub const SLAVE: Self = Self(0);
8473 #[doc = "Master configuration"]
8474 pub const MASTER: Self = Self(0x01);
8475 }
8476 #[repr(transparent)]
8477 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8478 pub struct Bidimode(pub u8);
8479 impl Bidimode {
8480 #[doc = "2-line unidirectional data mode selected"]
8481 pub const UNIDIRECTIONAL: Self = Self(0);
8482 #[doc = "1-line bidirectional data mode selected"]
8483 pub const BIDIRECTIONAL: Self = Self(0x01);
8484 }
8485 #[repr(transparent)]
8486 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8487 pub struct Crcnext(pub u8);
8488 impl Crcnext {
8489 #[doc = "Next transmit value is from Tx buffer"]
8490 pub const TXBUFFER: Self = Self(0);
8491 #[doc = "Next transmit value is from Tx CRC register"]
8492 pub const CRC: Self = Self(0x01);
8493 }
8494 #[repr(transparent)]
8495 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8496 pub struct LdmaRx(pub u8);
8497 impl LdmaRx {
8498 #[doc = "Number of data to transfer for receive is even"]
8499 pub const EVEN: Self = Self(0);
8500 #[doc = "Number of data to transfer for receive is odd"]
8501 pub const ODD: Self = Self(0x01);
8502 }
8503 #[repr(transparent)]
8504 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8505 pub struct Lsbfirst(pub u8);
8506 impl Lsbfirst {
8507 #[doc = "Data is transmitted/received with the MSB first"]
8508 pub const MSBFIRST: Self = Self(0);
8509 #[doc = "Data is transmitted/received with the LSB first"]
8510 pub const LSBFIRST: Self = Self(0x01);
8511 }
8512 #[repr(transparent)]
8513 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8514 pub struct Frlvlr(pub u8);
8515 impl Frlvlr {
8516 #[doc = "Rx FIFO Empty"]
8517 pub const EMPTY: Self = Self(0);
8518 #[doc = "Rx 1/4 FIFO"]
8519 pub const QUARTER: Self = Self(0x01);
8520 #[doc = "Rx 1/2 FIFO"]
8521 pub const HALF: Self = Self(0x02);
8522 #[doc = "Rx FIFO full"]
8523 pub const FULL: Self = Self(0x03);
8524 }
8525 #[repr(transparent)]
8526 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8527 pub struct Ftlvlr(pub u8);
8528 impl Ftlvlr {
8529 #[doc = "Tx FIFO Empty"]
8530 pub const EMPTY: Self = Self(0);
8531 #[doc = "Tx 1/4 FIFO"]
8532 pub const QUARTER: Self = Self(0x01);
8533 #[doc = "Tx 1/2 FIFO"]
8534 pub const HALF: Self = Self(0x02);
8535 #[doc = "Tx FIFO full"]
8536 pub const FULL: Self = Self(0x03);
8537 }
8538 #[repr(transparent)]
8539 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8540 pub struct Cpol(pub u8);
8541 impl Cpol {
8542 #[doc = "CK to 0 when idle"]
8543 pub const IDLELOW: Self = Self(0);
8544 #[doc = "CK to 1 when idle"]
8545 pub const IDLEHIGH: Self = Self(0x01);
8546 }
8547 #[repr(transparent)]
8548 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8549 pub struct Bidioe(pub u8);
8550 impl Bidioe {
8551 #[doc = "Output disabled (receive-only mode)"]
8552 pub const OUTPUTDISABLED: Self = Self(0);
8553 #[doc = "Output enabled (transmit-only mode)"]
8554 pub const OUTPUTENABLED: Self = Self(0x01);
8555 }
8556 #[repr(transparent)]
8557 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8558 pub struct Frxth(pub u8);
8559 impl Frxth {
8560 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/2 (16-bit)"]
8561 pub const HALF: Self = Self(0);
8562 #[doc = "RXNE event is generated if the FIFO level is greater than or equal to 1/4 (8-bit)"]
8563 pub const QUARTER: Self = Self(0x01);
8564 }
8565 #[repr(transparent)]
8566 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8567 pub struct Br(pub u8);
8568 impl Br {
8569 #[doc = "f_PCLK / 2"]
8570 pub const DIV2: Self = Self(0);
8571 #[doc = "f_PCLK / 4"]
8572 pub const DIV4: Self = Self(0x01);
8573 #[doc = "f_PCLK / 8"]
8574 pub const DIV8: Self = Self(0x02);
8575 #[doc = "f_PCLK / 16"]
8576 pub const DIV16: Self = Self(0x03);
8577 #[doc = "f_PCLK / 32"]
8578 pub const DIV32: Self = Self(0x04);
8579 #[doc = "f_PCLK / 64"]
8580 pub const DIV64: Self = Self(0x05);
8581 #[doc = "f_PCLK / 128"]
8582 pub const DIV128: Self = Self(0x06);
8583 #[doc = "f_PCLK / 256"]
8584 pub const DIV256: Self = Self(0x07);
8585 }
8586 #[repr(transparent)]
8587 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8588 pub struct Ds(pub u8);
8589 impl Ds {
8590 #[doc = "4-bit"]
8591 pub const FOURBIT: Self = Self(0x03);
8592 #[doc = "5-bit"]
8593 pub const FIVEBIT: Self = Self(0x04);
8594 #[doc = "6-bit"]
8595 pub const SIXBIT: Self = Self(0x05);
8596 #[doc = "7-bit"]
8597 pub const SEVENBIT: Self = Self(0x06);
8598 #[doc = "8-bit"]
8599 pub const EIGHTBIT: Self = Self(0x07);
8600 #[doc = "9-bit"]
8601 pub const NINEBIT: Self = Self(0x08);
8602 #[doc = "10-bit"]
8603 pub const TENBIT: Self = Self(0x09);
8604 #[doc = "11-bit"]
8605 pub const ELEVENBIT: Self = Self(0x0a);
8606 #[doc = "12-bit"]
8607 pub const TWELVEBIT: Self = Self(0x0b);
8608 #[doc = "13-bit"]
8609 pub const THIRTEENBIT: Self = Self(0x0c);
8610 #[doc = "14-bit"]
8611 pub const FOURTEENBIT: Self = Self(0x0d);
8612 #[doc = "15-bit"]
8613 pub const FIFTEENBIT: Self = Self(0x0e);
8614 #[doc = "16-bit"]
8615 pub const SIXTEENBIT: Self = Self(0x0f);
8616 }
8617 #[repr(transparent)]
8618 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8619 pub struct Rxonly(pub u8);
8620 impl Rxonly {
8621 #[doc = "Full duplex (Transmit and receive)"]
8622 pub const FULLDUPLEX: Self = Self(0);
8623 #[doc = "Output disabled (Receive-only mode)"]
8624 pub const OUTPUTDISABLED: Self = Self(0x01);
8625 }
8626 #[repr(transparent)]
8627 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8628 pub struct Crcl(pub u8);
8629 impl Crcl {
8630 #[doc = "8-bit CRC length"]
8631 pub const EIGHTBIT: Self = Self(0);
8632 #[doc = "16-bit CRC length"]
8633 pub const SIXTEENBIT: Self = Self(0x01);
8634 }
8635 #[repr(transparent)]
8636 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8637 pub struct Cpha(pub u8);
8638 impl Cpha {
8639 #[doc = "The first clock transition is the first data capture edge"]
8640 pub const FIRSTEDGE: Self = Self(0);
8641 #[doc = "The second clock transition is the first data capture edge"]
8642 pub const SECONDEDGE: Self = Self(0x01);
8643 }
8644 #[repr(transparent)]
8645 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8646 pub struct LdmaTx(pub u8);
8647 impl LdmaTx {
8648 #[doc = "Number of data to transfer for transmit is even"]
8649 pub const EVEN: Self = Self(0);
8650 #[doc = "Number of data to transfer for transmit is odd"]
8651 pub const ODD: Self = Self(0x01);
8652 }
8653 #[repr(transparent)]
8654 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8655 pub struct Frf(pub u8);
8656 impl Frf {
8657 #[doc = "SPI Motorola mode"]
8658 pub const MOTOROLA: Self = Self(0);
8659 #[doc = "SPI TI mode"]
8660 pub const TI: Self = Self(0x01);
8661 }
8662 #[repr(transparent)]
8663 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8664 pub struct Frer(pub u8);
8665 impl Frer {
8666 #[doc = "No frame format error"]
8667 pub const NOERROR: Self = Self(0);
8668 #[doc = "A frame format error occurred"]
8669 pub const ERROR: Self = Self(0x01);
8670 }
8671 }
8672 pub mod regs {
8673 use crate::generic::*;
8674 #[doc = "data register"]
8447 #[repr(transparent)] 8675 #[repr(transparent)]
8448 #[derive(Copy, Clone, Eq, PartialEq)] 8676 #[derive(Copy, Clone, Eq, PartialEq)]
8449 pub struct Ccr32(pub u32); 8677 pub struct Dr(pub u32);
8450 impl Ccr32 { 8678 impl Dr {
8451 #[doc = "Capture/Compare 1 value"] 8679 #[doc = "Data register"]
8452 pub const fn ccr(&self) -> u32 { 8680 pub const fn dr(&self) -> u16 {
8453 let val = (self.0 >> 0usize) & 0xffff_ffff; 8681 let val = (self.0 >> 0usize) & 0xffff;
8454 val as u32 8682 val as u16
8455 } 8683 }
8456 #[doc = "Capture/Compare 1 value"] 8684 #[doc = "Data register"]
8457 pub fn set_ccr(&mut self, val: u32) { 8685 pub fn set_dr(&mut self, val: u16) {
8458 self.0 = 8686 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
8459 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
8460 } 8687 }
8461 } 8688 }
8462 impl Default for Ccr32 { 8689 impl Default for Dr {
8463 fn default() -> Ccr32 { 8690 fn default() -> Dr {
8464 Ccr32(0) 8691 Dr(0)
8465 } 8692 }
8466 } 8693 }
8467 #[doc = "auto-reload register"] 8694 #[doc = "CRC polynomial register"]
8468 #[repr(transparent)] 8695 #[repr(transparent)]
8469 #[derive(Copy, Clone, Eq, PartialEq)] 8696 #[derive(Copy, Clone, Eq, PartialEq)]
8470 pub struct Arr16(pub u32); 8697 pub struct Crcpr(pub u32);
8471 impl Arr16 { 8698 impl Crcpr {
8472 #[doc = "Auto-reload value"] 8699 #[doc = "CRC polynomial register"]
8473 pub const fn arr(&self) -> u16 { 8700 pub const fn crcpoly(&self) -> u16 {
8474 let val = (self.0 >> 0usize) & 0xffff; 8701 let val = (self.0 >> 0usize) & 0xffff;
8475 val as u16 8702 val as u16
8476 } 8703 }
8477 #[doc = "Auto-reload value"] 8704 #[doc = "CRC polynomial register"]
8478 pub fn set_arr(&mut self, val: u16) { 8705 pub fn set_crcpoly(&mut self, val: u16) {
8479 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 8706 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
8480 } 8707 }
8481 } 8708 }
8482 impl Default for Arr16 { 8709 impl Default for Crcpr {
8483 fn default() -> Arr16 { 8710 fn default() -> Crcpr {
8484 Arr16(0) 8711 Crcpr(0)
8485 } 8712 }
8486 } 8713 }
8487 #[doc = "DMA address for full transfer"] 8714 #[doc = "RX CRC register"]
8488 #[repr(transparent)] 8715 #[repr(transparent)]
8489 #[derive(Copy, Clone, Eq, PartialEq)] 8716 #[derive(Copy, Clone, Eq, PartialEq)]
8490 pub struct Dmar(pub u32); 8717 pub struct Rxcrcr(pub u32);
8491 impl Dmar { 8718 impl Rxcrcr {
8492 #[doc = "DMA register for burst accesses"] 8719 #[doc = "Rx CRC register"]
8493 pub const fn dmab(&self) -> u16 { 8720 pub const fn rx_crc(&self) -> u16 {
8494 let val = (self.0 >> 0usize) & 0xffff; 8721 let val = (self.0 >> 0usize) & 0xffff;
8495 val as u16 8722 val as u16
8496 } 8723 }
8497 #[doc = "DMA register for burst accesses"] 8724 #[doc = "Rx CRC register"]
8498 pub fn set_dmab(&mut self, val: u16) { 8725 pub fn set_rx_crc(&mut self, val: u16) {
8499 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize); 8726 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
8500 } 8727 }
8501 } 8728 }
8502 impl Default for Dmar { 8729 impl Default for Rxcrcr {
8503 fn default() -> Dmar { 8730 fn default() -> Rxcrcr {
8504 Dmar(0) 8731 Rxcrcr(0)
8505 } 8732 }
8506 } 8733 }
8507 #[doc = "counter"] 8734 #[doc = "TX CRC register"]
8508 #[repr(transparent)] 8735 #[repr(transparent)]
8509 #[derive(Copy, Clone, Eq, PartialEq)] 8736 #[derive(Copy, Clone, Eq, PartialEq)]
8510 pub struct Cnt32(pub u32); 8737 pub struct Txcrcr(pub u32);
8511 impl Cnt32 { 8738 impl Txcrcr {
8512 #[doc = "counter value"] 8739 #[doc = "Tx CRC register"]
8513 pub const fn cnt(&self) -> u32 { 8740 pub const fn tx_crc(&self) -> u16 {
8514 let val = (self.0 >> 0usize) & 0xffff_ffff; 8741 let val = (self.0 >> 0usize) & 0xffff;
8515 val as u32 8742 val as u16
8516 } 8743 }
8517 #[doc = "counter value"] 8744 #[doc = "Tx CRC register"]
8518 pub fn set_cnt(&mut self, val: u32) { 8745 pub fn set_tx_crc(&mut self, val: u16) {
8519 self.0 = 8746 self.0 = (self.0 & !(0xffff << 0usize)) | (((val as u32) & 0xffff) << 0usize);
8520 (self.0 & !(0xffff_ffff << 0usize)) | (((val as u32) & 0xffff_ffff) << 0usize);
8521 } 8747 }
8522 } 8748 }
8523 impl Default for Cnt32 { 8749 impl Default for Txcrcr {
8524 fn default() -> Cnt32 { 8750 fn default() -> Txcrcr {
8525 Cnt32(0) 8751 Txcrcr(0)
8526 } 8752 }
8527 } 8753 }
8528 #[doc = "break and dead-time register"] 8754 #[doc = "status register"]
8529 #[repr(transparent)] 8755 #[repr(transparent)]
8530 #[derive(Copy, Clone, Eq, PartialEq)] 8756 #[derive(Copy, Clone, Eq, PartialEq)]
8531 pub struct Bdtr(pub u32); 8757 pub struct Sr(pub u32);
8532 impl Bdtr { 8758 impl Sr {
8533 #[doc = "Dead-time generator setup"] 8759 #[doc = "Receive buffer not empty"]
8534 pub const fn dtg(&self) -> u8 { 8760 pub const fn rxne(&self) -> bool {
8535 let val = (self.0 >> 0usize) & 0xff; 8761 let val = (self.0 >> 0usize) & 0x01;
8536 val as u8 8762 val != 0
8537 } 8763 }
8538 #[doc = "Dead-time generator setup"] 8764 #[doc = "Receive buffer not empty"]
8539 pub fn set_dtg(&mut self, val: u8) { 8765 pub fn set_rxne(&mut self, val: bool) {
8540 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 8766 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8541 } 8767 }
8542 #[doc = "Lock configuration"] 8768 #[doc = "Transmit buffer empty"]
8543 pub const fn lock(&self) -> u8 { 8769 pub const fn txe(&self) -> bool {
8544 let val = (self.0 >> 8usize) & 0x03; 8770 let val = (self.0 >> 1usize) & 0x01;
8545 val as u8 8771 val != 0
8546 } 8772 }
8547 #[doc = "Lock configuration"] 8773 #[doc = "Transmit buffer empty"]
8548 pub fn set_lock(&mut self, val: u8) { 8774 pub fn set_txe(&mut self, val: bool) {
8549 self.0 = (self.0 & !(0x03 << 8usize)) | (((val as u32) & 0x03) << 8usize); 8775 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8550 } 8776 }
8551 #[doc = "Off-state selection for Idle mode"] 8777 #[doc = "CRC error flag"]
8552 pub const fn ossi(&self) -> super::vals::Ossi { 8778 pub const fn crcerr(&self) -> bool {
8553 let val = (self.0 >> 10usize) & 0x01; 8779 let val = (self.0 >> 4usize) & 0x01;
8554 super::vals::Ossi(val as u8) 8780 val != 0
8555 } 8781 }
8556 #[doc = "Off-state selection for Idle mode"] 8782 #[doc = "CRC error flag"]
8557 pub fn set_ossi(&mut self, val: super::vals::Ossi) { 8783 pub fn set_crcerr(&mut self, val: bool) {
8558 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize); 8784 self.0 = (self.0 & !(0x01 << 4usize)) | (((val as u32) & 0x01) << 4usize);
8559 } 8785 }
8560 #[doc = "Off-state selection for Run mode"] 8786 #[doc = "Mode fault"]
8561 pub const fn ossr(&self) -> super::vals::Ossr { 8787 pub const fn modf(&self) -> bool {
8562 let val = (self.0 >> 11usize) & 0x01; 8788 let val = (self.0 >> 5usize) & 0x01;
8563 super::vals::Ossr(val as u8) 8789 val != 0
8564 } 8790 }
8565 #[doc = "Off-state selection for Run mode"] 8791 #[doc = "Mode fault"]
8566 pub fn set_ossr(&mut self, val: super::vals::Ossr) { 8792 pub fn set_modf(&mut self, val: bool) {
8567 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize); 8793 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8568 } 8794 }
8569 #[doc = "Break enable"] 8795 #[doc = "Overrun flag"]
8570 pub const fn bke(&self) -> bool { 8796 pub const fn ovr(&self) -> bool {
8571 let val = (self.0 >> 12usize) & 0x01; 8797 let val = (self.0 >> 6usize) & 0x01;
8572 val != 0 8798 val != 0
8573 } 8799 }
8574 #[doc = "Break enable"] 8800 #[doc = "Overrun flag"]
8575 pub fn set_bke(&mut self, val: bool) { 8801 pub fn set_ovr(&mut self, val: bool) {
8576 self.0 = (self.0 & !(0x01 << 12usize)) | (((val as u32) & 0x01) << 12usize); 8802 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8577 } 8803 }
8578 #[doc = "Break polarity"] 8804 #[doc = "Busy flag"]
8579 pub const fn bkp(&self) -> bool { 8805 pub const fn bsy(&self) -> bool {
8580 let val = (self.0 >> 13usize) & 0x01; 8806 let val = (self.0 >> 7usize) & 0x01;
8581 val != 0 8807 val != 0
8582 } 8808 }
8583 #[doc = "Break polarity"] 8809 #[doc = "Busy flag"]
8584 pub fn set_bkp(&mut self, val: bool) { 8810 pub fn set_bsy(&mut self, val: bool) {
8585 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize); 8811 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
8586 } 8812 }
8587 #[doc = "Automatic output enable"] 8813 #[doc = "Frame format error"]
8588 pub const fn aoe(&self) -> bool { 8814 pub const fn fre(&self) -> bool {
8589 let val = (self.0 >> 14usize) & 0x01; 8815 let val = (self.0 >> 8usize) & 0x01;
8590 val != 0 8816 val != 0
8591 } 8817 }
8592 #[doc = "Automatic output enable"] 8818 #[doc = "Frame format error"]
8593 pub fn set_aoe(&mut self, val: bool) { 8819 pub fn set_fre(&mut self, val: bool) {
8594 self.0 = (self.0 & !(0x01 << 14usize)) | (((val as u32) & 0x01) << 14usize); 8820 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
8595 } 8821 }
8596 #[doc = "Main output enable"] 8822 #[doc = "FIFO reception level"]
8597 pub const fn moe(&self) -> bool { 8823 pub const fn frlvl(&self) -> u8 {
8598 let val = (self.0 >> 15usize) & 0x01; 8824 let val = (self.0 >> 9usize) & 0x03;
8599 val != 0 8825 val as u8
8600 } 8826 }
8601 #[doc = "Main output enable"] 8827 #[doc = "FIFO reception level"]
8602 pub fn set_moe(&mut self, val: bool) { 8828 pub fn set_frlvl(&mut self, val: u8) {
8603 self.0 = (self.0 & !(0x01 << 15usize)) | (((val as u32) & 0x01) << 15usize); 8829 self.0 = (self.0 & !(0x03 << 9usize)) | (((val as u32) & 0x03) << 9usize);
8830 }
8831 #[doc = "FIFO Transmission Level"]
8832 pub const fn ftlvl(&self) -> u8 {
8833 let val = (self.0 >> 11usize) & 0x03;
8834 val as u8
8835 }
8836 #[doc = "FIFO Transmission Level"]
8837 pub fn set_ftlvl(&mut self, val: u8) {
8838 self.0 = (self.0 & !(0x03 << 11usize)) | (((val as u32) & 0x03) << 11usize);
8604 } 8839 }
8605 } 8840 }
8606 impl Default for Bdtr { 8841 impl Default for Sr {
8607 fn default() -> Bdtr { 8842 fn default() -> Sr {
8608 Bdtr(0) 8843 Sr(0)
8609 } 8844 }
8610 } 8845 }
8611 #[doc = "status register"] 8846 #[doc = "control register 1"]
8612 #[repr(transparent)] 8847 #[repr(transparent)]
8613 #[derive(Copy, Clone, Eq, PartialEq)] 8848 #[derive(Copy, Clone, Eq, PartialEq)]
8614 pub struct SrAdv(pub u32); 8849 pub struct Cr1(pub u32);
8615 impl SrAdv { 8850 impl Cr1 {
8616 #[doc = "Update interrupt flag"] 8851 #[doc = "Clock phase"]
8617 pub const fn uif(&self) -> bool { 8852 pub const fn cpha(&self) -> super::vals::Cpha {
8618 let val = (self.0 >> 0usize) & 0x01; 8853 let val = (self.0 >> 0usize) & 0x01;
8619 val != 0 8854 super::vals::Cpha(val as u8)
8620 } 8855 }
8621 #[doc = "Update interrupt flag"] 8856 #[doc = "Clock phase"]
8622 pub fn set_uif(&mut self, val: bool) { 8857 pub fn set_cpha(&mut self, val: super::vals::Cpha) {
8623 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 8858 self.0 = (self.0 & !(0x01 << 0usize)) | (((val.0 as u32) & 0x01) << 0usize);
8624 } 8859 }
8625 #[doc = "Capture/compare 1 interrupt flag"] 8860 #[doc = "Clock polarity"]
8626 pub fn ccif(&self, n: usize) -> bool { 8861 pub const fn cpol(&self) -> super::vals::Cpol {
8627 assert!(n < 4usize); 8862 let val = (self.0 >> 1usize) & 0x01;
8628 let offs = 1usize + n * 1usize; 8863 super::vals::Cpol(val as u8)
8629 let val = (self.0 >> offs) & 0x01;
8630 val != 0
8631 } 8864 }
8632 #[doc = "Capture/compare 1 interrupt flag"] 8865 #[doc = "Clock polarity"]
8633 pub fn set_ccif(&mut self, n: usize, val: bool) { 8866 pub fn set_cpol(&mut self, val: super::vals::Cpol) {
8634 assert!(n < 4usize); 8867 self.0 = (self.0 & !(0x01 << 1usize)) | (((val.0 as u32) & 0x01) << 1usize);
8635 let offs = 1usize + n * 1usize;
8636 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8637 } 8868 }
8638 #[doc = "COM interrupt flag"] 8869 #[doc = "Master selection"]
8639 pub const fn comif(&self) -> bool { 8870 pub const fn mstr(&self) -> super::vals::Mstr {
8640 let val = (self.0 >> 5usize) & 0x01; 8871 let val = (self.0 >> 2usize) & 0x01;
8641 val != 0 8872 super::vals::Mstr(val as u8)
8642 } 8873 }
8643 #[doc = "COM interrupt flag"] 8874 #[doc = "Master selection"]
8644 pub fn set_comif(&mut self, val: bool) { 8875 pub fn set_mstr(&mut self, val: super::vals::Mstr) {
8645 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize); 8876 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize);
8646 } 8877 }
8647 #[doc = "Trigger interrupt flag"] 8878 #[doc = "Baud rate control"]
8648 pub const fn tif(&self) -> bool { 8879 pub const fn br(&self) -> super::vals::Br {
8880 let val = (self.0 >> 3usize) & 0x07;
8881 super::vals::Br(val as u8)
8882 }
8883 #[doc = "Baud rate control"]
8884 pub fn set_br(&mut self, val: super::vals::Br) {
8885 self.0 = (self.0 & !(0x07 << 3usize)) | (((val.0 as u32) & 0x07) << 3usize);
8886 }
8887 #[doc = "SPI enable"]
8888 pub const fn spe(&self) -> bool {
8649 let val = (self.0 >> 6usize) & 0x01; 8889 let val = (self.0 >> 6usize) & 0x01;
8650 val != 0 8890 val != 0
8651 } 8891 }
8652 #[doc = "Trigger interrupt flag"] 8892 #[doc = "SPI enable"]
8653 pub fn set_tif(&mut self, val: bool) { 8893 pub fn set_spe(&mut self, val: bool) {
8654 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize); 8894 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8655 } 8895 }
8656 #[doc = "Break interrupt flag"] 8896 #[doc = "Frame format"]
8657 pub const fn bif(&self) -> bool { 8897 pub const fn lsbfirst(&self) -> super::vals::Lsbfirst {
8658 let val = (self.0 >> 7usize) & 0x01; 8898 let val = (self.0 >> 7usize) & 0x01;
8899 super::vals::Lsbfirst(val as u8)
8900 }
8901 #[doc = "Frame format"]
8902 pub fn set_lsbfirst(&mut self, val: super::vals::Lsbfirst) {
8903 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize);
8904 }
8905 #[doc = "Internal slave select"]
8906 pub const fn ssi(&self) -> bool {
8907 let val = (self.0 >> 8usize) & 0x01;
8659 val != 0 8908 val != 0
8660 } 8909 }
8661 #[doc = "Break interrupt flag"] 8910 #[doc = "Internal slave select"]
8662 pub fn set_bif(&mut self, val: bool) { 8911 pub fn set_ssi(&mut self, val: bool) {
8663 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize); 8912 self.0 = (self.0 & !(0x01 << 8usize)) | (((val as u32) & 0x01) << 8usize);
8664 } 8913 }
8665 #[doc = "Capture/Compare 1 overcapture flag"] 8914 #[doc = "Software slave management"]
8666 pub fn ccof(&self, n: usize) -> bool { 8915 pub const fn ssm(&self) -> bool {
8667 assert!(n < 4usize); 8916 let val = (self.0 >> 9usize) & 0x01;
8668 let offs = 9usize + n * 1usize;
8669 let val = (self.0 >> offs) & 0x01;
8670 val != 0 8917 val != 0
8671 } 8918 }
8672 #[doc = "Capture/Compare 1 overcapture flag"] 8919 #[doc = "Software slave management"]
8673 pub fn set_ccof(&mut self, n: usize, val: bool) { 8920 pub fn set_ssm(&mut self, val: bool) {
8674 assert!(n < 4usize); 8921 self.0 = (self.0 & !(0x01 << 9usize)) | (((val as u32) & 0x01) << 9usize);
8675 let offs = 9usize + n * 1usize;
8676 self.0 = (self.0 & !(0x01 << offs)) | (((val as u32) & 0x01) << offs);
8677 } 8922 }
8678 } 8923 #[doc = "Receive only"]
8679 impl Default for SrAdv { 8924 pub const fn rxonly(&self) -> super::vals::Rxonly {
8680 fn default() -> SrAdv { 8925 let val = (self.0 >> 10usize) & 0x01;
8681 SrAdv(0) 8926 super::vals::Rxonly(val as u8)
8682 } 8927 }
8683 } 8928 #[doc = "Receive only"]
8684 #[doc = "repetition counter register"] 8929 pub fn set_rxonly(&mut self, val: super::vals::Rxonly) {
8685 #[repr(transparent)] 8930 self.0 = (self.0 & !(0x01 << 10usize)) | (((val.0 as u32) & 0x01) << 10usize);
8686 #[derive(Copy, Clone, Eq, PartialEq)]
8687 pub struct Rcr(pub u32);
8688 impl Rcr {
8689 #[doc = "Repetition counter value"]
8690 pub const fn rep(&self) -> u8 {
8691 let val = (self.0 >> 0usize) & 0xff;
8692 val as u8
8693 } 8931 }
8694 #[doc = "Repetition counter value"] 8932 #[doc = "CRC length"]
8695 pub fn set_rep(&mut self, val: u8) { 8933 pub const fn crcl(&self) -> super::vals::Crcl {
8696 self.0 = (self.0 & !(0xff << 0usize)) | (((val as u32) & 0xff) << 0usize); 8934 let val = (self.0 >> 11usize) & 0x01;
8935 super::vals::Crcl(val as u8)
8936 }
8937 #[doc = "CRC length"]
8938 pub fn set_crcl(&mut self, val: super::vals::Crcl) {
8939 self.0 = (self.0 & !(0x01 << 11usize)) | (((val.0 as u32) & 0x01) << 11usize);
8940 }
8941 #[doc = "CRC transfer next"]
8942 pub const fn crcnext(&self) -> super::vals::Crcnext {
8943 let val = (self.0 >> 12usize) & 0x01;
8944 super::vals::Crcnext(val as u8)
8945 }
8946 #[doc = "CRC transfer next"]
8947 pub fn set_crcnext(&mut self, val: super::vals::Crcnext) {
8948 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
8949 }
8950 #[doc = "Hardware CRC calculation enable"]
8951 pub const fn crcen(&self) -> bool {
8952 let val = (self.0 >> 13usize) & 0x01;
8953 val != 0
8954 }
8955 #[doc = "Hardware CRC calculation enable"]
8956 pub fn set_crcen(&mut self, val: bool) {
8957 self.0 = (self.0 & !(0x01 << 13usize)) | (((val as u32) & 0x01) << 13usize);
8958 }
8959 #[doc = "Output enable in bidirectional mode"]
8960 pub const fn bidioe(&self) -> super::vals::Bidioe {
8961 let val = (self.0 >> 14usize) & 0x01;
8962 super::vals::Bidioe(val as u8)
8963 }
8964 #[doc = "Output enable in bidirectional mode"]
8965 pub fn set_bidioe(&mut self, val: super::vals::Bidioe) {
8966 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
8967 }
8968 #[doc = "Bidirectional data mode enable"]
8969 pub const fn bidimode(&self) -> super::vals::Bidimode {
8970 let val = (self.0 >> 15usize) & 0x01;
8971 super::vals::Bidimode(val as u8)
8972 }
8973 #[doc = "Bidirectional data mode enable"]
8974 pub fn set_bidimode(&mut self, val: super::vals::Bidimode) {
8975 self.0 = (self.0 & !(0x01 << 15usize)) | (((val.0 as u32) & 0x01) << 15usize);
8697 } 8976 }
8698 } 8977 }
8699 impl Default for Rcr { 8978 impl Default for Cr1 {
8700 fn default() -> Rcr { 8979 fn default() -> Cr1 {
8701 Rcr(0) 8980 Cr1(0)
8702 } 8981 }
8703 } 8982 }
8704 #[doc = "control register 1"] 8983 #[doc = "control register 2"]
8705 #[repr(transparent)] 8984 #[repr(transparent)]
8706 #[derive(Copy, Clone, Eq, PartialEq)] 8985 #[derive(Copy, Clone, Eq, PartialEq)]
8707 pub struct Cr1Basic(pub u32); 8986 pub struct Cr2(pub u32);
8708 impl Cr1Basic { 8987 impl Cr2 {
8709 #[doc = "Counter enable"] 8988 #[doc = "Rx buffer DMA enable"]
8710 pub const fn cen(&self) -> bool { 8989 pub const fn rxdmaen(&self) -> bool {
8711 let val = (self.0 >> 0usize) & 0x01; 8990 let val = (self.0 >> 0usize) & 0x01;
8712 val != 0 8991 val != 0
8713 } 8992 }
8714 #[doc = "Counter enable"] 8993 #[doc = "Rx buffer DMA enable"]
8715 pub fn set_cen(&mut self, val: bool) { 8994 pub fn set_rxdmaen(&mut self, val: bool) {
8716 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 8995 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize);
8717 } 8996 }
8718 #[doc = "Update disable"] 8997 #[doc = "Tx buffer DMA enable"]
8719 pub const fn udis(&self) -> bool { 8998 pub const fn txdmaen(&self) -> bool {
8720 let val = (self.0 >> 1usize) & 0x01; 8999 let val = (self.0 >> 1usize) & 0x01;
8721 val != 0 9000 val != 0
8722 } 9001 }
8723 #[doc = "Update disable"] 9002 #[doc = "Tx buffer DMA enable"]
8724 pub fn set_udis(&mut self, val: bool) { 9003 pub fn set_txdmaen(&mut self, val: bool) {
8725 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize); 9004 self.0 = (self.0 & !(0x01 << 1usize)) | (((val as u32) & 0x01) << 1usize);
8726 } 9005 }
8727 #[doc = "Update request source"] 9006 #[doc = "SS output enable"]
8728 pub const fn urs(&self) -> super::vals::Urs { 9007 pub const fn ssoe(&self) -> bool {
8729 let val = (self.0 >> 2usize) & 0x01; 9008 let val = (self.0 >> 2usize) & 0x01;
8730 super::vals::Urs(val as u8) 9009 val != 0
8731 } 9010 }
8732 #[doc = "Update request source"] 9011 #[doc = "SS output enable"]
8733 pub fn set_urs(&mut self, val: super::vals::Urs) { 9012 pub fn set_ssoe(&mut self, val: bool) {
8734 self.0 = (self.0 & !(0x01 << 2usize)) | (((val.0 as u32) & 0x01) << 2usize); 9013 self.0 = (self.0 & !(0x01 << 2usize)) | (((val as u32) & 0x01) << 2usize);
8735 } 9014 }
8736 #[doc = "One-pulse mode"] 9015 #[doc = "NSS pulse management"]
8737 pub const fn opm(&self) -> super::vals::Opm { 9016 pub const fn nssp(&self) -> bool {
8738 let val = (self.0 >> 3usize) & 0x01; 9017 let val = (self.0 >> 3usize) & 0x01;
8739 super::vals::Opm(val as u8) 9018 val != 0
8740 } 9019 }
8741 #[doc = "One-pulse mode"] 9020 #[doc = "NSS pulse management"]
8742 pub fn set_opm(&mut self, val: super::vals::Opm) { 9021 pub fn set_nssp(&mut self, val: bool) {
8743 self.0 = (self.0 & !(0x01 << 3usize)) | (((val.0 as u32) & 0x01) << 3usize); 9022 self.0 = (self.0 & !(0x01 << 3usize)) | (((val as u32) & 0x01) << 3usize);
8744 } 9023 }
8745 #[doc = "Auto-reload preload enable"] 9024 #[doc = "Frame format"]
8746 pub const fn arpe(&self) -> super::vals::Arpe { 9025 pub const fn frf(&self) -> super::vals::Frf {
8747 let val = (self.0 >> 7usize) & 0x01; 9026 let val = (self.0 >> 4usize) & 0x01;
8748 super::vals::Arpe(val as u8) 9027 super::vals::Frf(val as u8)
8749 } 9028 }
8750 #[doc = "Auto-reload preload enable"] 9029 #[doc = "Frame format"]
8751 pub fn set_arpe(&mut self, val: super::vals::Arpe) { 9030 pub fn set_frf(&mut self, val: super::vals::Frf) {
8752 self.0 = (self.0 & !(0x01 << 7usize)) | (((val.0 as u32) & 0x01) << 7usize); 9031 self.0 = (self.0 & !(0x01 << 4usize)) | (((val.0 as u32) & 0x01) << 4usize);
8753 } 9032 }
8754 } 9033 #[doc = "Error interrupt enable"]
8755 impl Default for Cr1Basic { 9034 pub const fn errie(&self) -> bool {
8756 fn default() -> Cr1Basic { 9035 let val = (self.0 >> 5usize) & 0x01;
8757 Cr1Basic(0) 9036 val != 0
8758 } 9037 }
8759 } 9038 #[doc = "Error interrupt enable"]
8760 #[doc = "status register"] 9039 pub fn set_errie(&mut self, val: bool) {
8761 #[repr(transparent)] 9040 self.0 = (self.0 & !(0x01 << 5usize)) | (((val as u32) & 0x01) << 5usize);
8762 #[derive(Copy, Clone, Eq, PartialEq)] 9041 }
8763 pub struct SrBasic(pub u32); 9042 #[doc = "RX buffer not empty interrupt enable"]
8764 impl SrBasic { 9043 pub const fn rxneie(&self) -> bool {
8765 #[doc = "Update interrupt flag"] 9044 let val = (self.0 >> 6usize) & 0x01;
8766 pub const fn uif(&self) -> bool {
8767 let val = (self.0 >> 0usize) & 0x01;
8768 val != 0 9045 val != 0
8769 } 9046 }
8770 #[doc = "Update interrupt flag"] 9047 #[doc = "RX buffer not empty interrupt enable"]
8771 pub fn set_uif(&mut self, val: bool) { 9048 pub fn set_rxneie(&mut self, val: bool) {
8772 self.0 = (self.0 & !(0x01 << 0usize)) | (((val as u32) & 0x01) << 0usize); 9049 self.0 = (self.0 & !(0x01 << 6usize)) | (((val as u32) & 0x01) << 6usize);
8773 } 9050 }
8774 } 9051 #[doc = "Tx buffer empty interrupt enable"]
8775 impl Default for SrBasic { 9052 pub const fn txeie(&self) -> bool {
8776 fn default() -> SrBasic { 9053 let val = (self.0 >> 7usize) & 0x01;
8777 SrBasic(0) 9054 val != 0
9055 }
9056 #[doc = "Tx buffer empty interrupt enable"]
9057 pub fn set_txeie(&mut self, val: bool) {
9058 self.0 = (self.0 & !(0x01 << 7usize)) | (((val as u32) & 0x01) << 7usize);
9059 }
9060 #[doc = "Data size"]
9061 pub const fn ds(&self) -> super::vals::Ds {
9062 let val = (self.0 >> 8usize) & 0x0f;
9063 super::vals::Ds(val as u8)
9064 }
9065 #[doc = "Data size"]
9066 pub fn set_ds(&mut self, val: super::vals::Ds) {
9067 self.0 = (self.0 & !(0x0f << 8usize)) | (((val.0 as u32) & 0x0f) << 8usize);
9068 }
9069 #[doc = "FIFO reception threshold"]
9070 pub const fn frxth(&self) -> super::vals::Frxth {
9071 let val = (self.0 >> 12usize) & 0x01;
9072 super::vals::Frxth(val as u8)
9073 }
9074 #[doc = "FIFO reception threshold"]
9075 pub fn set_frxth(&mut self, val: super::vals::Frxth) {
9076 self.0 = (self.0 & !(0x01 << 12usize)) | (((val.0 as u32) & 0x01) << 12usize);
9077 }
9078 #[doc = "Last DMA transfer for reception"]
9079 pub const fn ldma_rx(&self) -> super::vals::LdmaRx {
9080 let val = (self.0 >> 13usize) & 0x01;
9081 super::vals::LdmaRx(val as u8)
9082 }
9083 #[doc = "Last DMA transfer for reception"]
9084 pub fn set_ldma_rx(&mut self, val: super::vals::LdmaRx) {
9085 self.0 = (self.0 & !(0x01 << 13usize)) | (((val.0 as u32) & 0x01) << 13usize);
9086 }
9087 #[doc = "Last DMA transfer for transmission"]
9088 pub const fn ldma_tx(&self) -> super::vals::LdmaTx {
9089 let val = (self.0 >> 14usize) & 0x01;
9090 super::vals::LdmaTx(val as u8)
9091 }
9092 #[doc = "Last DMA transfer for transmission"]
9093 pub fn set_ldma_tx(&mut self, val: super::vals::LdmaTx) {
9094 self.0 = (self.0 & !(0x01 << 14usize)) | (((val.0 as u32) & 0x01) << 14usize);
8778 } 9095 }
8779 } 9096 }
8780 } 9097 impl Default for Cr2 {
8781 pub mod vals { 9098 fn default() -> Cr2 {
8782 use crate::generic::*; 9099 Cr2(0)
8783 #[repr(transparent)] 9100 }
8784 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8785 pub struct Cms(pub u8);
8786 impl Cms {
8787 #[doc = "The counter counts up or down depending on the direction bit"]
8788 pub const EDGEALIGNED: Self = Self(0);
8789 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting down."]
8790 pub const CENTERALIGNED1: Self = Self(0x01);
8791 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set only when the counter is counting up."]
8792 pub const CENTERALIGNED2: Self = Self(0x02);
8793 #[doc = "The counter counts up and down alternatively. Output compare interrupt flags are set both when the counter is counting up or down."]
8794 pub const CENTERALIGNED3: Self = Self(0x03);
8795 }
8796 #[repr(transparent)]
8797 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8798 pub struct Tis(pub u8);
8799 impl Tis {
8800 #[doc = "The TIMx_CH1 pin is connected to TI1 input"]
8801 pub const NORMAL: Self = Self(0);
8802 #[doc = "The TIMx_CH1, CH2, CH3 pins are connected to TI1 input"]
8803 pub const XOR: Self = Self(0x01);
8804 }
8805 #[repr(transparent)]
8806 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8807 pub struct Msm(pub u8);
8808 impl Msm {
8809 #[doc = "No action"]
8810 pub const NOSYNC: Self = Self(0);
8811 #[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."]
8812 pub const SYNC: Self = Self(0x01);
8813 }
8814 #[repr(transparent)]
8815 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8816 pub struct Mms(pub u8);
8817 impl Mms {
8818 #[doc = "The UG bit from the TIMx_EGR register is used as trigger output"]
8819 pub const RESET: Self = Self(0);
8820 #[doc = "The counter enable signal, CNT_EN, is used as trigger output"]
8821 pub const ENABLE: Self = Self(0x01);
8822 #[doc = "The update event is selected as trigger output"]
8823 pub const UPDATE: Self = Self(0x02);
8824 #[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"]
8825 pub const COMPAREPULSE: Self = Self(0x03);
8826 #[doc = "OC1REF signal is used as trigger output"]
8827 pub const COMPAREOC1: Self = Self(0x04);
8828 #[doc = "OC2REF signal is used as trigger output"]
8829 pub const COMPAREOC2: Self = Self(0x05);
8830 #[doc = "OC3REF signal is used as trigger output"]
8831 pub const COMPAREOC3: Self = Self(0x06);
8832 #[doc = "OC4REF signal is used as trigger output"]
8833 pub const COMPAREOC4: Self = Self(0x07);
8834 }
8835 #[repr(transparent)]
8836 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8837 pub struct Dir(pub u8);
8838 impl Dir {
8839 #[doc = "Counter used as upcounter"]
8840 pub const UP: Self = Self(0);
8841 #[doc = "Counter used as downcounter"]
8842 pub const DOWN: Self = Self(0x01);
8843 }
8844 #[repr(transparent)]
8845 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8846 pub struct Arpe(pub u8);
8847 impl Arpe {
8848 #[doc = "TIMx_APRR register is not buffered"]
8849 pub const DISABLED: Self = Self(0);
8850 #[doc = "TIMx_APRR register is buffered"]
8851 pub const ENABLED: Self = Self(0x01);
8852 }
8853 #[repr(transparent)]
8854 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8855 pub struct Sms(pub u8);
8856 impl Sms {
8857 #[doc = "Slave mode disabled - if CEN = ‘1 then the prescaler is clocked directly by the internal clock."]
8858 pub const DISABLED: Self = Self(0);
8859 #[doc = "Encoder mode 1 - Counter counts up/down on TI2FP1 edge depending on TI1FP2 level."]
8860 pub const ENCODER_MODE_1: Self = Self(0x01);
8861 #[doc = "Encoder mode 2 - Counter counts up/down on TI1FP2 edge depending on TI2FP1 level."]
8862 pub const ENCODER_MODE_2: Self = Self(0x02);
8863 #[doc = "Encoder mode 3 - Counter counts up/down on both TI1FP1 and TI2FP2 edges depending on the level of the other input."]
8864 pub const ENCODER_MODE_3: Self = Self(0x03);
8865 #[doc = "Reset Mode - Rising edge of the selected trigger input (TRGI) reinitializes the counter and generates an update of the registers."]
8866 pub const RESET_MODE: Self = Self(0x04);
8867 #[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."]
8868 pub const GATED_MODE: Self = Self(0x05);
8869 #[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."]
8870 pub const TRIGGER_MODE: Self = Self(0x06);
8871 #[doc = "External Clock Mode 1 - Rising edges of the selected trigger (TRGI) clock the counter."]
8872 pub const EXT_CLOCK_MODE: Self = Self(0x07);
8873 }
8874 #[repr(transparent)]
8875 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8876 pub struct Ocm(pub u8);
8877 impl Ocm {
8878 #[doc = "The comparison between the output compare register TIMx_CCRy and the counter TIMx_CNT has no effect on the outputs"]
8879 pub const FROZEN: Self = Self(0);
8880 #[doc = "Set channel to active level on match. OCyREF signal is forced high when the counter matches the capture/compare register"]
8881 pub const ACTIVEONMATCH: Self = Self(0x01);
8882 #[doc = "Set channel to inactive level on match. OCyREF signal is forced low when the counter matches the capture/compare register"]
8883 pub const INACTIVEONMATCH: Self = Self(0x02);
8884 #[doc = "OCyREF toggles when TIMx_CNT=TIMx_CCRy"]
8885 pub const TOGGLE: Self = Self(0x03);
8886 #[doc = "OCyREF is forced low"]
8887 pub const FORCEINACTIVE: Self = Self(0x04);
8888 #[doc = "OCyREF is forced high"]
8889 pub const FORCEACTIVE: Self = Self(0x05);
8890 #[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"]
8891 pub const PWMMODE1: Self = Self(0x06);
8892 #[doc = "Inversely to PwmMode1"]
8893 pub const PWMMODE2: Self = Self(0x07);
8894 }
8895 #[repr(transparent)]
8896 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8897 pub struct Ocpe(pub u8);
8898 impl Ocpe {
8899 #[doc = "Preload register on CCR2 disabled. New values written to CCR2 are taken into account immediately"]
8900 pub const DISABLED: Self = Self(0);
8901 #[doc = "Preload register on CCR2 enabled. Preload value is loaded into active register on each update event"]
8902 pub const ENABLED: Self = Self(0x01);
8903 }
8904 #[repr(transparent)]
8905 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8906 pub struct Ckd(pub u8);
8907 impl Ckd {
8908 #[doc = "t_DTS = t_CK_INT"]
8909 pub const DIV1: Self = Self(0);
8910 #[doc = "t_DTS = 2 × t_CK_INT"]
8911 pub const DIV2: Self = Self(0x01);
8912 #[doc = "t_DTS = 4 × t_CK_INT"]
8913 pub const DIV4: Self = Self(0x02);
8914 }
8915 #[repr(transparent)]
8916 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8917 pub struct Icf(pub u8);
8918 impl Icf {
8919 #[doc = "No filter, sampling is done at fDTS"]
8920 pub const NOFILTER: Self = Self(0);
8921 #[doc = "fSAMPLING=fCK_INT, N=2"]
8922 pub const FCK_INT_N2: Self = Self(0x01);
8923 #[doc = "fSAMPLING=fCK_INT, N=4"]
8924 pub const FCK_INT_N4: Self = Self(0x02);
8925 #[doc = "fSAMPLING=fCK_INT, N=8"]
8926 pub const FCK_INT_N8: Self = Self(0x03);
8927 #[doc = "fSAMPLING=fDTS/2, N=6"]
8928 pub const FDTS_DIV2_N6: Self = Self(0x04);
8929 #[doc = "fSAMPLING=fDTS/2, N=8"]
8930 pub const FDTS_DIV2_N8: Self = Self(0x05);
8931 #[doc = "fSAMPLING=fDTS/4, N=6"]
8932 pub const FDTS_DIV4_N6: Self = Self(0x06);
8933 #[doc = "fSAMPLING=fDTS/4, N=8"]
8934 pub const FDTS_DIV4_N8: Self = Self(0x07);
8935 #[doc = "fSAMPLING=fDTS/8, N=6"]
8936 pub const FDTS_DIV8_N6: Self = Self(0x08);
8937 #[doc = "fSAMPLING=fDTS/8, N=8"]
8938 pub const FDTS_DIV8_N8: Self = Self(0x09);
8939 #[doc = "fSAMPLING=fDTS/16, N=5"]
8940 pub const FDTS_DIV16_N5: Self = Self(0x0a);
8941 #[doc = "fSAMPLING=fDTS/16, N=6"]
8942 pub const FDTS_DIV16_N6: Self = Self(0x0b);
8943 #[doc = "fSAMPLING=fDTS/16, N=8"]
8944 pub const FDTS_DIV16_N8: Self = Self(0x0c);
8945 #[doc = "fSAMPLING=fDTS/32, N=5"]
8946 pub const FDTS_DIV32_N5: Self = Self(0x0d);
8947 #[doc = "fSAMPLING=fDTS/32, N=6"]
8948 pub const FDTS_DIV32_N6: Self = Self(0x0e);
8949 #[doc = "fSAMPLING=fDTS/32, N=8"]
8950 pub const FDTS_DIV32_N8: Self = Self(0x0f);
8951 }
8952 #[repr(transparent)]
8953 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8954 pub struct Urs(pub u8);
8955 impl Urs {
8956 #[doc = "Any of counter overflow/underflow, setting UG, or update through slave mode, generates an update interrupt or DMA request"]
8957 pub const ANYEVENT: Self = Self(0);
8958 #[doc = "Only counter overflow/underflow generates an update interrupt or DMA request"]
8959 pub const COUNTERONLY: Self = Self(0x01);
8960 }
8961 #[repr(transparent)]
8962 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8963 pub struct Ccds(pub u8);
8964 impl Ccds {
8965 #[doc = "CCx DMA request sent when CCx event occurs"]
8966 pub const ONCOMPARE: Self = Self(0);
8967 #[doc = "CCx DMA request sent when update event occurs"]
8968 pub const ONUPDATE: Self = Self(0x01);
8969 }
8970 #[repr(transparent)]
8971 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8972 pub struct CcmrInputCcs(pub u8);
8973 impl CcmrInputCcs {
8974 #[doc = "CCx channel is configured as input, normal mapping: ICx mapped to TIx"]
8975 pub const TI4: Self = Self(0x01);
8976 #[doc = "CCx channel is configured as input, alternate mapping (switches 1 with 2, 3 with 4)"]
8977 pub const TI3: Self = Self(0x02);
8978 #[doc = "CCx channel is configured as input, ICx is mapped on TRC"]
8979 pub const TRC: Self = Self(0x03);
8980 }
8981 #[repr(transparent)]
8982 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8983 pub struct Opm(pub u8);
8984 impl Opm {
8985 #[doc = "Counter is not stopped at update event"]
8986 pub const DISABLED: Self = Self(0);
8987 #[doc = "Counter stops counting at the next update event (clearing the CEN bit)"]
8988 pub const ENABLED: Self = Self(0x01);
8989 }
8990 #[repr(transparent)]
8991 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8992 pub struct CcmrOutputCcs(pub u8);
8993 impl CcmrOutputCcs {
8994 #[doc = "CCx channel is configured as output"]
8995 pub const OUTPUT: Self = Self(0);
8996 }
8997 #[repr(transparent)]
8998 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
8999 pub struct Ece(pub u8);
9000 impl Ece {
9001 #[doc = "External clock mode 2 disabled"]
9002 pub const DISABLED: Self = Self(0);
9003 #[doc = "External clock mode 2 enabled. The counter is clocked by any active edge on the ETRF signal."]
9004 pub const ENABLED: Self = Self(0x01);
9005 }
9006 #[repr(transparent)]
9007 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
9008 pub struct Etp(pub u8);
9009 impl Etp {
9010 #[doc = "ETR is noninverted, active at high level or rising edge"]
9011 pub const NOTINVERTED: Self = Self(0);
9012 #[doc = "ETR is inverted, active at low level or falling edge"]
9013 pub const INVERTED: Self = Self(0x01);
9014 }
9015 #[repr(transparent)]
9016 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
9017 pub struct Etf(pub u8);
9018 impl Etf {
9019 #[doc = "No filter, sampling is done at fDTS"]
9020 pub const NOFILTER: Self = Self(0);
9021 #[doc = "fSAMPLING=fCK_INT, N=2"]
9022 pub const FCK_INT_N2: Self = Self(0x01);
9023 #[doc = "fSAMPLING=fCK_INT, N=4"]
9024 pub const FCK_INT_N4: Self = Self(0x02);
9025 #[doc = "fSAMPLING=fCK_INT, N=8"]
9026 pub const FCK_INT_N8: Self = Self(0x03);
9027 #[doc = "fSAMPLING=fDTS/2, N=6"]
9028 pub const FDTS_DIV2_N6: Self = Self(0x04);
9029 #[doc = "fSAMPLING=fDTS/2, N=8"]
9030 pub const FDTS_DIV2_N8: Self = Self(0x05);
9031 #[doc = "fSAMPLING=fDTS/4, N=6"]
9032 pub const FDTS_DIV4_N6: Self = Self(0x06);
9033 #[doc = "fSAMPLING=fDTS/4, N=8"]
9034 pub const FDTS_DIV4_N8: Self = Self(0x07);
9035 #[doc = "fSAMPLING=fDTS/8, N=6"]
9036 pub const FDTS_DIV8_N6: Self = Self(0x08);
9037 #[doc = "fSAMPLING=fDTS/8, N=8"]
9038 pub const FDTS_DIV8_N8: Self = Self(0x09);
9039 #[doc = "fSAMPLING=fDTS/16, N=5"]
9040 pub const FDTS_DIV16_N5: Self = Self(0x0a);
9041 #[doc = "fSAMPLING=fDTS/16, N=6"]
9042 pub const FDTS_DIV16_N6: Self = Self(0x0b);
9043 #[doc = "fSAMPLING=fDTS/16, N=8"]
9044 pub const FDTS_DIV16_N8: Self = Self(0x0c);
9045 #[doc = "fSAMPLING=fDTS/32, N=5"]
9046 pub const FDTS_DIV32_N5: Self = Self(0x0d);
9047 #[doc = "fSAMPLING=fDTS/32, N=6"]
9048 pub const FDTS_DIV32_N6: Self = Self(0x0e);
9049 #[doc = "fSAMPLING=fDTS/32, N=8"]
9050 pub const FDTS_DIV32_N8: Self = Self(0x0f);
9051 }
9052 #[repr(transparent)]
9053 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
9054 pub struct Ts(pub u8);
9055 impl Ts {
9056 #[doc = "Internal Trigger 0 (ITR0)"]
9057 pub const ITR0: Self = Self(0);
9058 #[doc = "Internal Trigger 1 (ITR1)"]
9059 pub const ITR1: Self = Self(0x01);
9060 #[doc = "Internal Trigger 2 (ITR2)"]
9061 pub const ITR2: Self = Self(0x02);
9062 #[doc = "TI1 Edge Detector (TI1F_ED)"]
9063 pub const TI1F_ED: Self = Self(0x04);
9064 #[doc = "Filtered Timer Input 1 (TI1FP1)"]
9065 pub const TI1FP1: Self = Self(0x05);
9066 #[doc = "Filtered Timer Input 2 (TI2FP2)"]
9067 pub const TI2FP2: Self = Self(0x06);
9068 #[doc = "External Trigger input (ETRF)"]
9069 pub const ETRF: Self = Self(0x07);
9070 }
9071 #[repr(transparent)]
9072 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
9073 pub struct Ossr(pub u8);
9074 impl Ossr {
9075 #[doc = "When inactive, OC/OCN outputs are disabled"]
9076 pub const DISABLED: Self = Self(0);
9077 #[doc = "When inactive, OC/OCN outputs are enabled with their inactive level"]
9078 pub const IDLELEVEL: Self = Self(0x01);
9079 }
9080 #[repr(transparent)]
9081 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
9082 pub struct Etps(pub u8);
9083 impl Etps {
9084 #[doc = "Prescaler OFF"]
9085 pub const DIV1: Self = Self(0);
9086 #[doc = "ETRP frequency divided by 2"]
9087 pub const DIV2: Self = Self(0x01);
9088 #[doc = "ETRP frequency divided by 4"]
9089 pub const DIV4: Self = Self(0x02);
9090 #[doc = "ETRP frequency divided by 8"]
9091 pub const DIV8: Self = Self(0x03);
9092 }
9093 #[repr(transparent)]
9094 #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
9095 pub struct Ossi(pub u8);
9096 impl Ossi {
9097 #[doc = "When inactive, OC/OCN outputs are disabled"]
9098 pub const DISABLED: Self = Self(0);
9099 #[doc = "When inactive, OC/OCN outputs are forced to idle level"]
9100 pub const IDLELEVEL: Self = Self(0x01);
9101 } 9101 }
9102 } 9102 }
9103} 9103}
diff --git a/embassy-stm32/src/pac/stm32f429zi.rs b/embassy-stm32/src/pac/stm32f429zi.rs
index b76378e03..a1a3ab422 100644
--- a/embassy-stm32/src/pac/stm32f429zi.rs
+++ b/embassy-stm32/src/pac/stm32f429zi.rs
@@ -6,23 +6,23 @@ pub fn GPIO(n: usize) -> gpio::Gpio {
6 gpio::Gpio((0x40020000 + 0x400 * n) as _) 6 gpio::Gpio((0x40020000 + 0x400 * n) as _)
7} 7}
8pub const DMA1: dma::Dma = dma::Dma(0x40026000 as _); 8pub const DMA1: dma::Dma = dma::Dma(0x40026000 as _);
9impl_dma_channel!(DMA1_CH0, 1, 0); 9impl_dma_channel!(DMA1_CH0, DMA1, 0);
10impl_dma_channel!(DMA1_CH1, 1, 1); 10impl_dma_channel!(DMA1_CH1, DMA1, 1);
11impl_dma_channel!(DMA1_CH2, 1, 2); 11impl_dma_channel!(DMA1_CH2, DMA1, 2);
12impl_dma_channel!(DMA1_CH3, 1, 3); 12impl_dma_channel!(DMA1_CH3, DMA1, 3);
13impl_dma_channel!(DMA1_CH4, 1, 4); 13impl_dma_channel!(DMA1_CH4, DMA1, 4);
14impl_dma_channel!(DMA1_CH5, 1, 5); 14impl_dma_channel!(DMA1_CH5, DMA1, 5);
15impl_dma_channel!(DMA1_CH6, 1, 6); 15impl_dma_channel!(DMA1_CH6, DMA1, 6);
16impl_dma_channel!(DMA1_CH7, 1, 7); 16impl_dma_channel!(DMA1_CH7, DMA1, 7);
17pub const DMA2: dma::Dma = dma::Dma(0x40026400 as _); 17pub const DMA2: dma::Dma = dma::Dma(0x40026400 as _);
18impl_dma_channel!(DMA2_CH0, 2, 0); 18impl_dma_channel!(DMA2_CH0, DMA2, 0);
19impl_dma_channel!(DMA2_CH1, 2, 1); 19impl_dma_channel!(DMA2_CH1, DMA2, 1);
20impl_dma_channel!(DMA2_CH2, 2, 2); 20impl_dma_channel!(DMA2_CH2, DMA2, 2);
21impl_dma_channel!(DMA2_CH3, 2, 3); 21impl_dma_channel!(DMA2_CH3, DMA2, 3);
22impl_dma_channel!(DMA2_CH4, 2, 4); 22impl_dma_channel!(DMA2_CH4, DMA2, 4);
23impl_dma_channel!(DMA2_CH5, 2, 5); 23impl_dma_channel!(DMA2_CH5, DMA2, 5);
24impl_dma_channel!(DMA2_CH6, 2, 6); 24impl_dma_channel!(DMA2_CH6, DMA2, 6);
25impl_dma_channel!(DMA2_CH7, 2, 7); 25impl_dma_channel!(DMA2_CH7, DMA2, 7);
26pub const EXTI: exti::Exti = exti::Exti(0x40013c00 as _); 26pub const EXTI: exti::Exti = exti::Exti(0x40013c00 as _);
27pub const GPIOA: gpio::Gpio = gpio::Gpio(0x40020000 as _); 27pub const GPIOA: gpio::Gpio = gpio::Gpio(0x40020000 as _);
28impl_gpio_pin!(PA0, 0, 0, EXTI0); 28impl_gpio_pin!(PA0, 0, 0, EXTI0);
diff --git a/embassy-stm32/src/pac/stm32l431cb.rs b/embassy-stm32/src/pac/stm32l431cb.rs
index 4201a5308..ea00d69fa 100644
--- a/embassy-stm32/src/pac/stm32l431cb.rs
+++ b/embassy-stm32/src/pac/stm32l431cb.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l431cc.rs b/embassy-stm32/src/pac/stm32l431cc.rs
index 4201a5308..ea00d69fa 100644
--- a/embassy-stm32/src/pac/stm32l431cc.rs
+++ b/embassy-stm32/src/pac/stm32l431cc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l431kb.rs b/embassy-stm32/src/pac/stm32l431kb.rs
index 088aa0640..09ab12d6f 100644
--- a/embassy-stm32/src/pac/stm32l431kb.rs
+++ b/embassy-stm32/src/pac/stm32l431kb.rs
@@ -130,8 +130,26 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 145pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
134impl_spi!(SPI3); 146impl_spi!(SPI3);
147impl_spi_pin!(SPI3, Sck, PB3, 6);
148impl_spi_pin!(SPI3, Miso, PB4, 6);
149impl_spi_pin!(SPI3, Mosi, PB5, 6);
150impl_spi_pin!(SPI3, Sck, PC10, 6);
151impl_spi_pin!(SPI3, Miso, PC11, 6);
152impl_spi_pin!(SPI3, Mosi, PC12, 6);
135pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 153pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
136pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 154pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
137impl_usart!(USART1); 155impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l431kc.rs b/embassy-stm32/src/pac/stm32l431kc.rs
index 088aa0640..09ab12d6f 100644
--- a/embassy-stm32/src/pac/stm32l431kc.rs
+++ b/embassy-stm32/src/pac/stm32l431kc.rs
@@ -130,8 +130,26 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 145pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
134impl_spi!(SPI3); 146impl_spi!(SPI3);
147impl_spi_pin!(SPI3, Sck, PB3, 6);
148impl_spi_pin!(SPI3, Miso, PB4, 6);
149impl_spi_pin!(SPI3, Mosi, PB5, 6);
150impl_spi_pin!(SPI3, Sck, PC10, 6);
151impl_spi_pin!(SPI3, Miso, PC11, 6);
152impl_spi_pin!(SPI3, Mosi, PC12, 6);
135pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 153pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
136pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 154pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
137impl_usart!(USART1); 155impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l431rb.rs b/embassy-stm32/src/pac/stm32l431rb.rs
index 4201a5308..ea00d69fa 100644
--- a/embassy-stm32/src/pac/stm32l431rb.rs
+++ b/embassy-stm32/src/pac/stm32l431rb.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l431rc.rs b/embassy-stm32/src/pac/stm32l431rc.rs
index 4201a5308..ea00d69fa 100644
--- a/embassy-stm32/src/pac/stm32l431rc.rs
+++ b/embassy-stm32/src/pac/stm32l431rc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l431vc.rs b/embassy-stm32/src/pac/stm32l431vc.rs
index 4201a5308..ea00d69fa 100644
--- a/embassy-stm32/src/pac/stm32l431vc.rs
+++ b/embassy-stm32/src/pac/stm32l431vc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l432kb.rs b/embassy-stm32/src/pac/stm32l432kb.rs
index a9dd16c94..ac3b809c6 100644
--- a/embassy-stm32/src/pac/stm32l432kb.rs
+++ b/embassy-stm32/src/pac/stm32l432kb.rs
@@ -96,8 +96,23 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
96impl_rng!(RNG); 96impl_rng!(RNG);
97pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 97pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
98impl_spi!(SPI1); 98impl_spi!(SPI1);
99impl_spi_pin!(SPI1, Sck, PA1, 5);
100impl_spi_pin!(SPI1, Miso, PA11, 5);
101impl_spi_pin!(SPI1, Mosi, PA12, 5);
102impl_spi_pin!(SPI1, Sck, PA5, 5);
103impl_spi_pin!(SPI1, Miso, PA6, 5);
104impl_spi_pin!(SPI1, Mosi, PA7, 5);
105impl_spi_pin!(SPI1, Sck, PB3, 5);
106impl_spi_pin!(SPI1, Miso, PB4, 5);
107impl_spi_pin!(SPI1, Mosi, PB5, 5);
99pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 108pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
100impl_spi!(SPI3); 109impl_spi!(SPI3);
110impl_spi_pin!(SPI3, Sck, PB3, 6);
111impl_spi_pin!(SPI3, Miso, PB4, 6);
112impl_spi_pin!(SPI3, Mosi, PB5, 6);
113impl_spi_pin!(SPI3, Sck, PC10, 6);
114impl_spi_pin!(SPI3, Miso, PC11, 6);
115impl_spi_pin!(SPI3, Mosi, PC12, 6);
101pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 116pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
102pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 117pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
103impl_usart!(USART1); 118impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l432kc.rs b/embassy-stm32/src/pac/stm32l432kc.rs
index a9dd16c94..ac3b809c6 100644
--- a/embassy-stm32/src/pac/stm32l432kc.rs
+++ b/embassy-stm32/src/pac/stm32l432kc.rs
@@ -96,8 +96,23 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
96impl_rng!(RNG); 96impl_rng!(RNG);
97pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 97pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
98impl_spi!(SPI1); 98impl_spi!(SPI1);
99impl_spi_pin!(SPI1, Sck, PA1, 5);
100impl_spi_pin!(SPI1, Miso, PA11, 5);
101impl_spi_pin!(SPI1, Mosi, PA12, 5);
102impl_spi_pin!(SPI1, Sck, PA5, 5);
103impl_spi_pin!(SPI1, Miso, PA6, 5);
104impl_spi_pin!(SPI1, Mosi, PA7, 5);
105impl_spi_pin!(SPI1, Sck, PB3, 5);
106impl_spi_pin!(SPI1, Miso, PB4, 5);
107impl_spi_pin!(SPI1, Mosi, PB5, 5);
99pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 108pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
100impl_spi!(SPI3); 109impl_spi!(SPI3);
110impl_spi_pin!(SPI3, Sck, PB3, 6);
111impl_spi_pin!(SPI3, Miso, PB4, 6);
112impl_spi_pin!(SPI3, Mosi, PB5, 6);
113impl_spi_pin!(SPI3, Sck, PC10, 6);
114impl_spi_pin!(SPI3, Miso, PC11, 6);
115impl_spi_pin!(SPI3, Mosi, PC12, 6);
101pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 116pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
102pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 117pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
103impl_usart!(USART1); 118impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l433cb.rs b/embassy-stm32/src/pac/stm32l433cb.rs
index 3d3c1e40f..bcfd7f871 100644
--- a/embassy-stm32/src/pac/stm32l433cb.rs
+++ b/embassy-stm32/src/pac/stm32l433cb.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l433cc.rs b/embassy-stm32/src/pac/stm32l433cc.rs
index 3d3c1e40f..bcfd7f871 100644
--- a/embassy-stm32/src/pac/stm32l433cc.rs
+++ b/embassy-stm32/src/pac/stm32l433cc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l433rb.rs b/embassy-stm32/src/pac/stm32l433rb.rs
index 3d3c1e40f..bcfd7f871 100644
--- a/embassy-stm32/src/pac/stm32l433rb.rs
+++ b/embassy-stm32/src/pac/stm32l433rb.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l433rc.rs b/embassy-stm32/src/pac/stm32l433rc.rs
index 3d3c1e40f..bcfd7f871 100644
--- a/embassy-stm32/src/pac/stm32l433rc.rs
+++ b/embassy-stm32/src/pac/stm32l433rc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l433vc.rs b/embassy-stm32/src/pac/stm32l433vc.rs
index 3d3c1e40f..bcfd7f871 100644
--- a/embassy-stm32/src/pac/stm32l433vc.rs
+++ b/embassy-stm32/src/pac/stm32l433vc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l442kc.rs b/embassy-stm32/src/pac/stm32l442kc.rs
index b193e51e1..b54a36ae9 100644
--- a/embassy-stm32/src/pac/stm32l442kc.rs
+++ b/embassy-stm32/src/pac/stm32l442kc.rs
@@ -96,8 +96,23 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
96impl_rng!(RNG); 96impl_rng!(RNG);
97pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 97pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
98impl_spi!(SPI1); 98impl_spi!(SPI1);
99impl_spi_pin!(SPI1, Sck, PA1, 5);
100impl_spi_pin!(SPI1, Miso, PA11, 5);
101impl_spi_pin!(SPI1, Mosi, PA12, 5);
102impl_spi_pin!(SPI1, Sck, PA5, 5);
103impl_spi_pin!(SPI1, Miso, PA6, 5);
104impl_spi_pin!(SPI1, Mosi, PA7, 5);
105impl_spi_pin!(SPI1, Sck, PB3, 5);
106impl_spi_pin!(SPI1, Miso, PB4, 5);
107impl_spi_pin!(SPI1, Mosi, PB5, 5);
99pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 108pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
100impl_spi!(SPI3); 109impl_spi!(SPI3);
110impl_spi_pin!(SPI3, Sck, PB3, 6);
111impl_spi_pin!(SPI3, Miso, PB4, 6);
112impl_spi_pin!(SPI3, Mosi, PB5, 6);
113impl_spi_pin!(SPI3, Sck, PC10, 6);
114impl_spi_pin!(SPI3, Miso, PC11, 6);
115impl_spi_pin!(SPI3, Mosi, PC12, 6);
101pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 116pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
102pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 117pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
103impl_usart!(USART1); 118impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l443cc.rs b/embassy-stm32/src/pac/stm32l443cc.rs
index ed14584f6..434050d65 100644
--- a/embassy-stm32/src/pac/stm32l443cc.rs
+++ b/embassy-stm32/src/pac/stm32l443cc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l443rc.rs b/embassy-stm32/src/pac/stm32l443rc.rs
index ed14584f6..434050d65 100644
--- a/embassy-stm32/src/pac/stm32l443rc.rs
+++ b/embassy-stm32/src/pac/stm32l443rc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l443vc.rs b/embassy-stm32/src/pac/stm32l443vc.rs
index ed14584f6..434050d65 100644
--- a/embassy-stm32/src/pac/stm32l443vc.rs
+++ b/embassy-stm32/src/pac/stm32l443vc.rs
@@ -130,10 +130,37 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
130impl_rng!(RNG); 130impl_rng!(RNG);
131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 131pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
132impl_spi!(SPI1); 132impl_spi!(SPI1);
133impl_spi_pin!(SPI1, Sck, PA1, 5);
134impl_spi_pin!(SPI1, Miso, PA11, 5);
135impl_spi_pin!(SPI1, Mosi, PA12, 5);
136impl_spi_pin!(SPI1, Sck, PA5, 5);
137impl_spi_pin!(SPI1, Miso, PA6, 5);
138impl_spi_pin!(SPI1, Mosi, PA7, 5);
139impl_spi_pin!(SPI1, Sck, PB3, 5);
140impl_spi_pin!(SPI1, Miso, PB4, 5);
141impl_spi_pin!(SPI1, Mosi, PB5, 5);
142impl_spi_pin!(SPI1, Sck, PE13, 5);
143impl_spi_pin!(SPI1, Miso, PE14, 5);
144impl_spi_pin!(SPI1, Mosi, PE15, 5);
133pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 145pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
134impl_spi!(SPI2); 146impl_spi!(SPI2);
147impl_spi_pin!(SPI2, Sck, PB10, 5);
148impl_spi_pin!(SPI2, Sck, PB13, 5);
149impl_spi_pin!(SPI2, Miso, PB14, 5);
150impl_spi_pin!(SPI2, Mosi, PB15, 5);
151impl_spi_pin!(SPI2, Miso, PC2, 5);
152impl_spi_pin!(SPI2, Mosi, PC3, 5);
153impl_spi_pin!(SPI2, Sck, PD1, 5);
154impl_spi_pin!(SPI2, Miso, PD3, 5);
155impl_spi_pin!(SPI2, Mosi, PD4, 5);
135pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 156pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
136impl_spi!(SPI3); 157impl_spi!(SPI3);
158impl_spi_pin!(SPI3, Sck, PB3, 6);
159impl_spi_pin!(SPI3, Miso, PB4, 6);
160impl_spi_pin!(SPI3, Mosi, PB5, 6);
161impl_spi_pin!(SPI3, Sck, PC10, 6);
162impl_spi_pin!(SPI3, Miso, PC11, 6);
163impl_spi_pin!(SPI3, Mosi, PC12, 6);
137pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 164pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
138pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 165pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
139impl_usart!(USART1); 166impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496ae.rs b/embassy-stm32/src/pac/stm32l496ae.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496ae.rs
+++ b/embassy-stm32/src/pac/stm32l496ae.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496ag.rs b/embassy-stm32/src/pac/stm32l496ag.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496ag.rs
+++ b/embassy-stm32/src/pac/stm32l496ag.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496qe.rs b/embassy-stm32/src/pac/stm32l496qe.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496qe.rs
+++ b/embassy-stm32/src/pac/stm32l496qe.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496qg.rs b/embassy-stm32/src/pac/stm32l496qg.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496qg.rs
+++ b/embassy-stm32/src/pac/stm32l496qg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496re.rs b/embassy-stm32/src/pac/stm32l496re.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496re.rs
+++ b/embassy-stm32/src/pac/stm32l496re.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496rg.rs b/embassy-stm32/src/pac/stm32l496rg.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496rg.rs
+++ b/embassy-stm32/src/pac/stm32l496rg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496ve.rs b/embassy-stm32/src/pac/stm32l496ve.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496ve.rs
+++ b/embassy-stm32/src/pac/stm32l496ve.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496vg.rs b/embassy-stm32/src/pac/stm32l496vg.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496vg.rs
+++ b/embassy-stm32/src/pac/stm32l496vg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496wg.rs b/embassy-stm32/src/pac/stm32l496wg.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496wg.rs
+++ b/embassy-stm32/src/pac/stm32l496wg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496ze.rs b/embassy-stm32/src/pac/stm32l496ze.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496ze.rs
+++ b/embassy-stm32/src/pac/stm32l496ze.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l496zg.rs b/embassy-stm32/src/pac/stm32l496zg.rs
index 3f97aeec1..6e2a59f64 100644
--- a/embassy-stm32/src/pac/stm32l496zg.rs
+++ b/embassy-stm32/src/pac/stm32l496zg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l4a6ag.rs b/embassy-stm32/src/pac/stm32l4a6ag.rs
index 2fc3593f9..8ca5eca30 100644
--- a/embassy-stm32/src/pac/stm32l4a6ag.rs
+++ b/embassy-stm32/src/pac/stm32l4a6ag.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l4a6qg.rs b/embassy-stm32/src/pac/stm32l4a6qg.rs
index 2fc3593f9..8ca5eca30 100644
--- a/embassy-stm32/src/pac/stm32l4a6qg.rs
+++ b/embassy-stm32/src/pac/stm32l4a6qg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l4a6rg.rs b/embassy-stm32/src/pac/stm32l4a6rg.rs
index 2fc3593f9..8ca5eca30 100644
--- a/embassy-stm32/src/pac/stm32l4a6rg.rs
+++ b/embassy-stm32/src/pac/stm32l4a6rg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l4a6vg.rs b/embassy-stm32/src/pac/stm32l4a6vg.rs
index 2fc3593f9..8ca5eca30 100644
--- a/embassy-stm32/src/pac/stm32l4a6vg.rs
+++ b/embassy-stm32/src/pac/stm32l4a6vg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l4a6zg.rs b/embassy-stm32/src/pac/stm32l4a6zg.rs
index 2fc3593f9..8ca5eca30 100644
--- a/embassy-stm32/src/pac/stm32l4a6zg.rs
+++ b/embassy-stm32/src/pac/stm32l4a6zg.rs
@@ -181,10 +181,49 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Miso, PG10, 6);
225impl_spi_pin!(SPI3, Mosi, PG11, 6);
226impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 227pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub const USART1: usart::Usart = usart::Usart(0x40013800 as _); 228pub const USART1: usart::Usart = usart::Usart(0x40013800 as _);
190impl_usart!(USART1); 229impl_usart!(USART1);
diff --git a/embassy-stm32/src/pac/stm32l4p5ae.rs b/embassy-stm32/src/pac/stm32l4p5ae.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5ae.rs
+++ b/embassy-stm32/src/pac/stm32l4p5ae.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5ag.rs b/embassy-stm32/src/pac/stm32l4p5ag.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5ag.rs
+++ b/embassy-stm32/src/pac/stm32l4p5ag.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5ce.rs b/embassy-stm32/src/pac/stm32l4p5ce.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5ce.rs
+++ b/embassy-stm32/src/pac/stm32l4p5ce.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5cg.rs b/embassy-stm32/src/pac/stm32l4p5cg.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5cg.rs
+++ b/embassy-stm32/src/pac/stm32l4p5cg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5qe.rs b/embassy-stm32/src/pac/stm32l4p5qe.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5qe.rs
+++ b/embassy-stm32/src/pac/stm32l4p5qe.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5qg.rs b/embassy-stm32/src/pac/stm32l4p5qg.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5qg.rs
+++ b/embassy-stm32/src/pac/stm32l4p5qg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5re.rs b/embassy-stm32/src/pac/stm32l4p5re.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5re.rs
+++ b/embassy-stm32/src/pac/stm32l4p5re.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5rg.rs b/embassy-stm32/src/pac/stm32l4p5rg.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5rg.rs
+++ b/embassy-stm32/src/pac/stm32l4p5rg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5ve.rs b/embassy-stm32/src/pac/stm32l4p5ve.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5ve.rs
+++ b/embassy-stm32/src/pac/stm32l4p5ve.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5vg.rs b/embassy-stm32/src/pac/stm32l4p5vg.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5vg.rs
+++ b/embassy-stm32/src/pac/stm32l4p5vg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5ze.rs b/embassy-stm32/src/pac/stm32l4p5ze.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5ze.rs
+++ b/embassy-stm32/src/pac/stm32l4p5ze.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4p5zg.rs b/embassy-stm32/src/pac/stm32l4p5zg.rs
index ae3342f44..c406d194d 100644
--- a/embassy-stm32/src/pac/stm32l4p5zg.rs
+++ b/embassy-stm32/src/pac/stm32l4p5zg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4q5ag.rs b/embassy-stm32/src/pac/stm32l4q5ag.rs
index 2313edd87..d8552a719 100644
--- a/embassy-stm32/src/pac/stm32l4q5ag.rs
+++ b/embassy-stm32/src/pac/stm32l4q5ag.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4q5cg.rs b/embassy-stm32/src/pac/stm32l4q5cg.rs
index 2313edd87..d8552a719 100644
--- a/embassy-stm32/src/pac/stm32l4q5cg.rs
+++ b/embassy-stm32/src/pac/stm32l4q5cg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4q5qg.rs b/embassy-stm32/src/pac/stm32l4q5qg.rs
index 2313edd87..d8552a719 100644
--- a/embassy-stm32/src/pac/stm32l4q5qg.rs
+++ b/embassy-stm32/src/pac/stm32l4q5qg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4q5rg.rs b/embassy-stm32/src/pac/stm32l4q5rg.rs
index 2313edd87..d8552a719 100644
--- a/embassy-stm32/src/pac/stm32l4q5rg.rs
+++ b/embassy-stm32/src/pac/stm32l4q5rg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4q5vg.rs b/embassy-stm32/src/pac/stm32l4q5vg.rs
index 2313edd87..d8552a719 100644
--- a/embassy-stm32/src/pac/stm32l4q5vg.rs
+++ b/embassy-stm32/src/pac/stm32l4q5vg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4q5zg.rs b/embassy-stm32/src/pac/stm32l4q5zg.rs
index 2313edd87..d8552a719 100644
--- a/embassy-stm32/src/pac/stm32l4q5zg.rs
+++ b/embassy-stm32/src/pac/stm32l4q5zg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5ag.rs b/embassy-stm32/src/pac/stm32l4r5ag.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5ag.rs
+++ b/embassy-stm32/src/pac/stm32l4r5ag.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5ai.rs b/embassy-stm32/src/pac/stm32l4r5ai.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5ai.rs
+++ b/embassy-stm32/src/pac/stm32l4r5ai.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5qg.rs b/embassy-stm32/src/pac/stm32l4r5qg.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5qg.rs
+++ b/embassy-stm32/src/pac/stm32l4r5qg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5qi.rs b/embassy-stm32/src/pac/stm32l4r5qi.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5qi.rs
+++ b/embassy-stm32/src/pac/stm32l4r5qi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5vg.rs b/embassy-stm32/src/pac/stm32l4r5vg.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5vg.rs
+++ b/embassy-stm32/src/pac/stm32l4r5vg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5vi.rs b/embassy-stm32/src/pac/stm32l4r5vi.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5vi.rs
+++ b/embassy-stm32/src/pac/stm32l4r5vi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5zg.rs b/embassy-stm32/src/pac/stm32l4r5zg.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5zg.rs
+++ b/embassy-stm32/src/pac/stm32l4r5zg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r5zi.rs b/embassy-stm32/src/pac/stm32l4r5zi.rs
index c97414141..b739f4df7 100644
--- a/embassy-stm32/src/pac/stm32l4r5zi.rs
+++ b/embassy-stm32/src/pac/stm32l4r5zi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r7ai.rs b/embassy-stm32/src/pac/stm32l4r7ai.rs
index 62ec35673..6aa7197fc 100644
--- a/embassy-stm32/src/pac/stm32l4r7ai.rs
+++ b/embassy-stm32/src/pac/stm32l4r7ai.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r7vi.rs b/embassy-stm32/src/pac/stm32l4r7vi.rs
index 62ec35673..6aa7197fc 100644
--- a/embassy-stm32/src/pac/stm32l4r7vi.rs
+++ b/embassy-stm32/src/pac/stm32l4r7vi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r7zi.rs b/embassy-stm32/src/pac/stm32l4r7zi.rs
index 62ec35673..6aa7197fc 100644
--- a/embassy-stm32/src/pac/stm32l4r7zi.rs
+++ b/embassy-stm32/src/pac/stm32l4r7zi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r9ag.rs b/embassy-stm32/src/pac/stm32l4r9ag.rs
index dedc37886..cd85f5bfa 100644
--- a/embassy-stm32/src/pac/stm32l4r9ag.rs
+++ b/embassy-stm32/src/pac/stm32l4r9ag.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r9ai.rs b/embassy-stm32/src/pac/stm32l4r9ai.rs
index dedc37886..cd85f5bfa 100644
--- a/embassy-stm32/src/pac/stm32l4r9ai.rs
+++ b/embassy-stm32/src/pac/stm32l4r9ai.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r9vg.rs b/embassy-stm32/src/pac/stm32l4r9vg.rs
index dedc37886..cd85f5bfa 100644
--- a/embassy-stm32/src/pac/stm32l4r9vg.rs
+++ b/embassy-stm32/src/pac/stm32l4r9vg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r9vi.rs b/embassy-stm32/src/pac/stm32l4r9vi.rs
index dedc37886..cd85f5bfa 100644
--- a/embassy-stm32/src/pac/stm32l4r9vi.rs
+++ b/embassy-stm32/src/pac/stm32l4r9vi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r9zg.rs b/embassy-stm32/src/pac/stm32l4r9zg.rs
index dedc37886..cd85f5bfa 100644
--- a/embassy-stm32/src/pac/stm32l4r9zg.rs
+++ b/embassy-stm32/src/pac/stm32l4r9zg.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4r9zi.rs b/embassy-stm32/src/pac/stm32l4r9zi.rs
index dedc37886..cd85f5bfa 100644
--- a/embassy-stm32/src/pac/stm32l4r9zi.rs
+++ b/embassy-stm32/src/pac/stm32l4r9zi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s5ai.rs b/embassy-stm32/src/pac/stm32l4s5ai.rs
index 95c47ae1a..c101f5c55 100644
--- a/embassy-stm32/src/pac/stm32l4s5ai.rs
+++ b/embassy-stm32/src/pac/stm32l4s5ai.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s5qi.rs b/embassy-stm32/src/pac/stm32l4s5qi.rs
index 95c47ae1a..c101f5c55 100644
--- a/embassy-stm32/src/pac/stm32l4s5qi.rs
+++ b/embassy-stm32/src/pac/stm32l4s5qi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s5vi.rs b/embassy-stm32/src/pac/stm32l4s5vi.rs
index 95c47ae1a..c101f5c55 100644
--- a/embassy-stm32/src/pac/stm32l4s5vi.rs
+++ b/embassy-stm32/src/pac/stm32l4s5vi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s5zi.rs b/embassy-stm32/src/pac/stm32l4s5zi.rs
index 95c47ae1a..c101f5c55 100644
--- a/embassy-stm32/src/pac/stm32l4s5zi.rs
+++ b/embassy-stm32/src/pac/stm32l4s5zi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s7ai.rs b/embassy-stm32/src/pac/stm32l4s7ai.rs
index 6ff9debf6..c6cc8f7de 100644
--- a/embassy-stm32/src/pac/stm32l4s7ai.rs
+++ b/embassy-stm32/src/pac/stm32l4s7ai.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s7vi.rs b/embassy-stm32/src/pac/stm32l4s7vi.rs
index 6ff9debf6..c6cc8f7de 100644
--- a/embassy-stm32/src/pac/stm32l4s7vi.rs
+++ b/embassy-stm32/src/pac/stm32l4s7vi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s7zi.rs b/embassy-stm32/src/pac/stm32l4s7zi.rs
index 6ff9debf6..c6cc8f7de 100644
--- a/embassy-stm32/src/pac/stm32l4s7zi.rs
+++ b/embassy-stm32/src/pac/stm32l4s7zi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s9ai.rs b/embassy-stm32/src/pac/stm32l4s9ai.rs
index 7031b3ac5..7b93516a5 100644
--- a/embassy-stm32/src/pac/stm32l4s9ai.rs
+++ b/embassy-stm32/src/pac/stm32l4s9ai.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s9vi.rs b/embassy-stm32/src/pac/stm32l4s9vi.rs
index 7031b3ac5..7b93516a5 100644
--- a/embassy-stm32/src/pac/stm32l4s9vi.rs
+++ b/embassy-stm32/src/pac/stm32l4s9vi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/pac/stm32l4s9zi.rs b/embassy-stm32/src/pac/stm32l4s9zi.rs
index 7031b3ac5..7b93516a5 100644
--- a/embassy-stm32/src/pac/stm32l4s9zi.rs
+++ b/embassy-stm32/src/pac/stm32l4s9zi.rs
@@ -181,10 +181,50 @@ pub const RNG: rng::Rng = rng::Rng(0x50060800 as _);
181impl_rng!(RNG); 181impl_rng!(RNG);
182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _); 182pub const SPI1: spi::Spi = spi::Spi(0x40013000 as _);
183impl_spi!(SPI1); 183impl_spi!(SPI1);
184impl_spi_pin!(SPI1, Sck, PA1, 5);
185impl_spi_pin!(SPI1, Miso, PA11, 5);
186impl_spi_pin!(SPI1, Mosi, PA12, 5);
187impl_spi_pin!(SPI1, Sck, PA5, 5);
188impl_spi_pin!(SPI1, Miso, PA6, 5);
189impl_spi_pin!(SPI1, Mosi, PA7, 5);
190impl_spi_pin!(SPI1, Sck, PB3, 5);
191impl_spi_pin!(SPI1, Miso, PB4, 5);
192impl_spi_pin!(SPI1, Mosi, PB5, 5);
193impl_spi_pin!(SPI1, Sck, PE13, 5);
194impl_spi_pin!(SPI1, Miso, PE14, 5);
195impl_spi_pin!(SPI1, Mosi, PE15, 5);
196impl_spi_pin!(SPI1, Sck, PG2, 5);
197impl_spi_pin!(SPI1, Miso, PG3, 5);
198impl_spi_pin!(SPI1, Mosi, PG4, 5);
184pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _); 199pub const SPI2: spi::Spi = spi::Spi(0x40003800 as _);
185impl_spi!(SPI2); 200impl_spi!(SPI2);
201impl_spi_pin!(SPI2, Sck, PA9, 3);
202impl_spi_pin!(SPI2, Sck, PB10, 5);
203impl_spi_pin!(SPI2, Sck, PB13, 5);
204impl_spi_pin!(SPI2, Miso, PB14, 5);
205impl_spi_pin!(SPI2, Mosi, PB15, 5);
206impl_spi_pin!(SPI2, Mosi, PC1, 3);
207impl_spi_pin!(SPI2, Miso, PC2, 5);
208impl_spi_pin!(SPI2, Mosi, PC3, 5);
209impl_spi_pin!(SPI2, Sck, PD1, 5);
210impl_spi_pin!(SPI2, Sck, PD3, 3);
211impl_spi_pin!(SPI2, Miso, PD3, 5);
212impl_spi_pin!(SPI2, Mosi, PD4, 5);
213impl_spi_pin!(SPI2, Sck, PI1, 5);
214impl_spi_pin!(SPI2, Miso, PI2, 5);
215impl_spi_pin!(SPI2, Mosi, PI3, 5);
186pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _); 216pub const SPI3: spi::Spi = spi::Spi(0x40003c00 as _);
187impl_spi!(SPI3); 217impl_spi!(SPI3);
218impl_spi_pin!(SPI3, Sck, PB3, 6);
219impl_spi_pin!(SPI3, Miso, PB4, 6);
220impl_spi_pin!(SPI3, Mosi, PB5, 6);
221impl_spi_pin!(SPI3, Sck, PC10, 6);
222impl_spi_pin!(SPI3, Miso, PC11, 6);
223impl_spi_pin!(SPI3, Mosi, PC12, 6);
224impl_spi_pin!(SPI3, Mosi, PD6, 5);
225impl_spi_pin!(SPI3, Miso, PG10, 6);
226impl_spi_pin!(SPI3, Mosi, PG11, 6);
227impl_spi_pin!(SPI3, Sck, PG9, 6);
188pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _); 228pub const SYSCFG: syscfg::Syscfg = syscfg::Syscfg(0x40010000 as _);
189pub use regs::dma_v1 as dma; 229pub use regs::dma_v1 as dma;
190pub use regs::exti_v1 as exti; 230pub use regs::exti_v1 as exti;
diff --git a/embassy-stm32/src/spi.rs b/embassy-stm32/src/spi.rs
index 3eec77424..c581f1464 100644
--- a/embassy-stm32/src/spi.rs
+++ b/embassy-stm32/src/spi.rs
@@ -4,14 +4,56 @@ pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_
4use core::marker::PhantomData; 4use core::marker::PhantomData;
5use embassy::interrupt::Interrupt; 5use embassy::interrupt::Interrupt;
6use embedded_hal::blocking::spi::{Write, Transfer}; 6use embedded_hal::blocking::spi::{Write, Transfer};
7use embassy::util::Unborrow;
8use embassy_extras::{impl_unborrow, unborrow};
9use crate::gpio::{Pin, AnyPin};
10use crate::pac::gpio::vals::Afr;
11use crate::pac::gpio::Gpio;
7//use crate::pac::spi; 12//use crate::pac::spi;
8 13
9pub struct Spi<'d, T: Instance> { 14pub struct Spi<'d, T: Instance> {
10 peri: T, 15 peri: T,
16 sck: AnyPin,
17 mosi: AnyPin,
18 miso: AnyPin,
11 //irq: T::Interrupt, 19 //irq: T::Interrupt,
12 phantom: PhantomData<&'d mut T>, 20 phantom: PhantomData<&'d mut T>,
13} 21}
14 22
23impl<'d, T: Instance> Spi<'d, T> {
24 pub fn new(peri: impl Unborrow<Target=T> + 'd,
25 sck: impl Unborrow<Target=impl Sck<T>>,
26 mosi: impl Unborrow<Target=impl Mosi<T>>,
27 miso: impl Unborrow<Target=impl Miso<T>>,
28 ) -> Self {
29 unborrow!(peri);
30 unborrow!(sck, mosi, miso);
31
32 unsafe {
33 Self::configure_pin( sck.block(), sck.pin() as usize, sck.af() );
34 Self::configure_pin( mosi.block(), mosi.pin() as usize, mosi.af() );
35 Self::configure_pin( miso.block(), miso.pin() as usize, miso.af() );
36 }
37
38 let sck = sck.degrade();
39 let mosi = mosi.degrade();
40 let miso = miso.degrade();
41
42 Self {
43 peri,
44 sck,
45 mosi,
46 miso,
47 phantom: PhantomData,
48 }
49 }
50
51 unsafe fn configure_pin(block: Gpio, pin: usize, af_num: u8) {
52 let (afr, n_af) = if pin < 8 { (0, pin) } else { (1, pin - 8) };
53 block.afr(afr).modify(|w| w.set_afr(n_af, Afr(af_num)));
54 }
55}
56
15pub enum Error { 57pub enum Error {
16 Framing, 58 Framing,
17 Crc, 59 Crc,
@@ -111,12 +153,45 @@ pub(crate) mod sealed {
111 fn regs() -> &'static crate::pac::spi::Spi; 153 fn regs() -> &'static crate::pac::spi::Spi;
112 //fn state() -> &'static State; 154 //fn state() -> &'static State;
113 } 155 }
156
157 pub trait Sck<T: Instance> : Pin {
158 const AF: u8;
159 fn af(&self) -> u8 {
160 Self::AF
161 }
162 }
163
164 pub trait Mosi<T: Instance> : Pin {
165 const AF: u8;
166 fn af(&self) -> u8 {
167 Self::AF
168 }
169 }
170
171 pub trait Miso<T: Instance> : Pin {
172 const AF: u8;
173 fn af(&self) -> u8 {
174 Self::AF
175 }
176 }
114} 177}
115 178
116pub trait Instance: sealed::Instance + 'static { 179pub trait Instance: sealed::Instance + 'static {
117 //type Interrupt: Interrupt; 180 //type Interrupt: Interrupt;
118} 181}
119 182
183pub trait Sck<T:Instance>: sealed::Sck<T> + 'static {
184
185}
186
187pub trait Mosi<T:Instance>: sealed::Mosi<T> + 'static {
188
189}
190
191pub trait Miso<T:Instance>: sealed::Miso<T> + 'static {
192
193}
194
120macro_rules! impl_spi { 195macro_rules! impl_spi {
121 ($inst:ident) => { 196 ($inst:ident) => {
122 impl crate::spi::sealed::Instance for peripherals::$inst { 197 impl crate::spi::sealed::Instance for peripherals::$inst {
@@ -127,4 +202,15 @@ macro_rules! impl_spi {
127 202
128 impl crate::spi::Instance for peripherals::$inst {} 203 impl crate::spi::Instance for peripherals::$inst {}
129 }; 204 };
205}
206
207macro_rules! impl_spi_pin {
208 ($inst:ident, $pin_func:ident, $pin:ident, $af:expr) => {
209 impl crate::spi::$pin_func<peripherals::$inst> for peripherals::$pin {
210 }
211
212 impl crate::spi::sealed::$pin_func<peripherals::$inst> for peripherals::$pin {
213 const AF: u8 = $af;
214 }
215 }
130} \ No newline at end of file 216} \ No newline at end of file
diff --git a/embassy-stm32/stm32-data b/embassy-stm32/stm32-data
Subproject 10f86e022b297069c0da9069814e7b811f19d2e Subproject 2e55065013cda8b5836d74570530e7fdb75a76b