stm32f3_staging/stm32f303/rtc.rs
1#[repr(C)]
2#[derive(Debug)]
3///Register block
4pub struct RegisterBlock {
5 tr: TR,
6 dr: DR,
7 cr: CR,
8 isr: ISR,
9 prer: PRER,
10 wutr: WUTR,
11 _reserved6: [u8; 0x04],
12 alrmr: [ALRMR; 2],
13 wpr: WPR,
14 ssr: SSR,
15 shiftr: SHIFTR,
16 tstr: TSTR,
17 tsdr: TSDR,
18 tsssr: TSSSR,
19 calr: CALR,
20 tafcr: TAFCR,
21 alrmssr: [ALRMSSR; 2],
22 _reserved16: [u8; 0x04],
23 bkpr: [BKPR; 32],
24}
25impl RegisterBlock {
26 ///0x00 - time register
27 #[inline(always)]
28 pub const fn tr(&self) -> &TR {
29 &self.tr
30 }
31 ///0x04 - date register
32 #[inline(always)]
33 pub const fn dr(&self) -> &DR {
34 &self.dr
35 }
36 ///0x08 - control register
37 #[inline(always)]
38 pub const fn cr(&self) -> &CR {
39 &self.cr
40 }
41 ///0x0c - initialization and status register
42 #[inline(always)]
43 pub const fn isr(&self) -> &ISR {
44 &self.isr
45 }
46 ///0x10 - prescaler register
47 #[inline(always)]
48 pub const fn prer(&self) -> &PRER {
49 &self.prer
50 }
51 ///0x14 - wakeup timer register
52 #[inline(always)]
53 pub const fn wutr(&self) -> &WUTR {
54 &self.wutr
55 }
56 ///0x1c..0x24 - Alarm %s register
57 ///
58 ///<div class="warning">`n` is the index of register in the array. `n == 0` corresponds to `ALRMAR` register.</div>
59 #[inline(always)]
60 pub const fn alrmr(&self, n: usize) -> &ALRMR {
61 &self.alrmr[n]
62 }
63 ///Iterator for array of:
64 ///0x1c..0x24 - Alarm %s register
65 #[inline(always)]
66 pub fn alrmr_iter(&self) -> impl Iterator<Item = &ALRMR> {
67 self.alrmr.iter()
68 }
69 ///0x1c - Alarm A register
70 #[inline(always)]
71 pub const fn alrmar(&self) -> &ALRMR {
72 self.alrmr(0)
73 }
74 ///0x20 - Alarm B register
75 #[inline(always)]
76 pub const fn alrmbr(&self) -> &ALRMR {
77 self.alrmr(1)
78 }
79 ///0x24 - write protection register
80 #[inline(always)]
81 pub const fn wpr(&self) -> &WPR {
82 &self.wpr
83 }
84 ///0x28 - sub second register
85 #[inline(always)]
86 pub const fn ssr(&self) -> &SSR {
87 &self.ssr
88 }
89 ///0x2c - shift control register
90 #[inline(always)]
91 pub const fn shiftr(&self) -> &SHIFTR {
92 &self.shiftr
93 }
94 ///0x30 - time stamp time register
95 #[inline(always)]
96 pub const fn tstr(&self) -> &TSTR {
97 &self.tstr
98 }
99 ///0x34 - time stamp date register
100 #[inline(always)]
101 pub const fn tsdr(&self) -> &TSDR {
102 &self.tsdr
103 }
104 ///0x38 - timestamp sub second register
105 #[inline(always)]
106 pub const fn tsssr(&self) -> &TSSSR {
107 &self.tsssr
108 }
109 ///0x3c - calibration register
110 #[inline(always)]
111 pub const fn calr(&self) -> &CALR {
112 &self.calr
113 }
114 ///0x40 - tamper and alternate function configuration register
115 #[inline(always)]
116 pub const fn tafcr(&self) -> &TAFCR {
117 &self.tafcr
118 }
119 ///0x44..0x4c - Alarm %s sub-second register
120 ///
121 ///<div class="warning">`n` is the index of register in the array. `n == 0` corresponds to `ALRMASSR` register.</div>
122 #[inline(always)]
123 pub const fn alrmssr(&self, n: usize) -> &ALRMSSR {
124 &self.alrmssr[n]
125 }
126 ///Iterator for array of:
127 ///0x44..0x4c - Alarm %s sub-second register
128 #[inline(always)]
129 pub fn alrmssr_iter(&self) -> impl Iterator<Item = &ALRMSSR> {
130 self.alrmssr.iter()
131 }
132 ///0x44 - Alarm A sub-second register
133 #[inline(always)]
134 pub const fn alrmassr(&self) -> &ALRMSSR {
135 self.alrmssr(0)
136 }
137 ///0x48 - Alarm B sub-second register
138 #[inline(always)]
139 pub const fn alrmbssr(&self) -> &ALRMSSR {
140 self.alrmssr(1)
141 }
142 ///0x50..0xd0 - backup register
143 #[inline(always)]
144 pub const fn bkpr(&self, n: usize) -> &BKPR {
145 &self.bkpr[n]
146 }
147 ///Iterator for array of:
148 ///0x50..0xd0 - backup register
149 #[inline(always)]
150 pub fn bkpr_iter(&self) -> impl Iterator<Item = &BKPR> {
151 self.bkpr.iter()
152 }
153 ///0x50 - backup register
154 #[inline(always)]
155 pub const fn bkp0r(&self) -> &BKPR {
156 self.bkpr(0)
157 }
158 ///0x54 - backup register
159 #[inline(always)]
160 pub const fn bkp1r(&self) -> &BKPR {
161 self.bkpr(1)
162 }
163 ///0x58 - backup register
164 #[inline(always)]
165 pub const fn bkp2r(&self) -> &BKPR {
166 self.bkpr(2)
167 }
168 ///0x5c - backup register
169 #[inline(always)]
170 pub const fn bkp3r(&self) -> &BKPR {
171 self.bkpr(3)
172 }
173 ///0x60 - backup register
174 #[inline(always)]
175 pub const fn bkp4r(&self) -> &BKPR {
176 self.bkpr(4)
177 }
178 ///0x64 - backup register
179 #[inline(always)]
180 pub const fn bkp5r(&self) -> &BKPR {
181 self.bkpr(5)
182 }
183 ///0x68 - backup register
184 #[inline(always)]
185 pub const fn bkp6r(&self) -> &BKPR {
186 self.bkpr(6)
187 }
188 ///0x6c - backup register
189 #[inline(always)]
190 pub const fn bkp7r(&self) -> &BKPR {
191 self.bkpr(7)
192 }
193 ///0x70 - backup register
194 #[inline(always)]
195 pub const fn bkp8r(&self) -> &BKPR {
196 self.bkpr(8)
197 }
198 ///0x74 - backup register
199 #[inline(always)]
200 pub const fn bkp9r(&self) -> &BKPR {
201 self.bkpr(9)
202 }
203 ///0x78 - backup register
204 #[inline(always)]
205 pub const fn bkp10r(&self) -> &BKPR {
206 self.bkpr(10)
207 }
208 ///0x7c - backup register
209 #[inline(always)]
210 pub const fn bkp11r(&self) -> &BKPR {
211 self.bkpr(11)
212 }
213 ///0x80 - backup register
214 #[inline(always)]
215 pub const fn bkp12r(&self) -> &BKPR {
216 self.bkpr(12)
217 }
218 ///0x84 - backup register
219 #[inline(always)]
220 pub const fn bkp13r(&self) -> &BKPR {
221 self.bkpr(13)
222 }
223 ///0x88 - backup register
224 #[inline(always)]
225 pub const fn bkp14r(&self) -> &BKPR {
226 self.bkpr(14)
227 }
228 ///0x8c - backup register
229 #[inline(always)]
230 pub const fn bkp15r(&self) -> &BKPR {
231 self.bkpr(15)
232 }
233 ///0x90 - backup register
234 #[inline(always)]
235 pub const fn bkp16r(&self) -> &BKPR {
236 self.bkpr(16)
237 }
238 ///0x94 - backup register
239 #[inline(always)]
240 pub const fn bkp17r(&self) -> &BKPR {
241 self.bkpr(17)
242 }
243 ///0x98 - backup register
244 #[inline(always)]
245 pub const fn bkp18r(&self) -> &BKPR {
246 self.bkpr(18)
247 }
248 ///0x9c - backup register
249 #[inline(always)]
250 pub const fn bkp19r(&self) -> &BKPR {
251 self.bkpr(19)
252 }
253 ///0xa0 - backup register
254 #[inline(always)]
255 pub const fn bkp20r(&self) -> &BKPR {
256 self.bkpr(20)
257 }
258 ///0xa4 - backup register
259 #[inline(always)]
260 pub const fn bkp21r(&self) -> &BKPR {
261 self.bkpr(21)
262 }
263 ///0xa8 - backup register
264 #[inline(always)]
265 pub const fn bkp22r(&self) -> &BKPR {
266 self.bkpr(22)
267 }
268 ///0xac - backup register
269 #[inline(always)]
270 pub const fn bkp23r(&self) -> &BKPR {
271 self.bkpr(23)
272 }
273 ///0xb0 - backup register
274 #[inline(always)]
275 pub const fn bkp24r(&self) -> &BKPR {
276 self.bkpr(24)
277 }
278 ///0xb4 - backup register
279 #[inline(always)]
280 pub const fn bkp25r(&self) -> &BKPR {
281 self.bkpr(25)
282 }
283 ///0xb8 - backup register
284 #[inline(always)]
285 pub const fn bkp26r(&self) -> &BKPR {
286 self.bkpr(26)
287 }
288 ///0xbc - backup register
289 #[inline(always)]
290 pub const fn bkp27r(&self) -> &BKPR {
291 self.bkpr(27)
292 }
293 ///0xc0 - backup register
294 #[inline(always)]
295 pub const fn bkp28r(&self) -> &BKPR {
296 self.bkpr(28)
297 }
298 ///0xc4 - backup register
299 #[inline(always)]
300 pub const fn bkp29r(&self) -> &BKPR {
301 self.bkpr(29)
302 }
303 ///0xc8 - backup register
304 #[inline(always)]
305 pub const fn bkp30r(&self) -> &BKPR {
306 self.bkpr(30)
307 }
308 ///0xcc - backup register
309 #[inline(always)]
310 pub const fn bkp31r(&self) -> &BKPR {
311 self.bkpr(31)
312 }
313}
314/**TR (rw) register accessor: time register
315
316You can [`read`](crate::Reg::read) this register and get [`tr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
317
318See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:TR)
319
320For information about available fields see [`mod@tr`]
321module*/
322pub type TR = crate::Reg<tr::TRrs>;
323///time register
324pub mod tr;
325/**DR (rw) register accessor: date register
326
327You can [`read`](crate::Reg::read) this register and get [`dr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
328
329See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:DR)
330
331For information about available fields see [`mod@dr`]
332module*/
333pub type DR = crate::Reg<dr::DRrs>;
334///date register
335pub mod dr;
336/**CR (rw) register accessor: control register
337
338You can [`read`](crate::Reg::read) this register and get [`cr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
339
340See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:CR)
341
342For information about available fields see [`mod@cr`]
343module*/
344pub type CR = crate::Reg<cr::CRrs>;
345///control register
346pub mod cr;
347/**ISR (rw) register accessor: initialization and status register
348
349You can [`read`](crate::Reg::read) this register and get [`isr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`isr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
350
351See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:ISR)
352
353For information about available fields see [`mod@isr`]
354module*/
355pub type ISR = crate::Reg<isr::ISRrs>;
356///initialization and status register
357pub mod isr;
358/**PRER (rw) register accessor: prescaler register
359
360You can [`read`](crate::Reg::read) this register and get [`prer::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`prer::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
361
362See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:PRER)
363
364For information about available fields see [`mod@prer`]
365module*/
366pub type PRER = crate::Reg<prer::PRERrs>;
367///prescaler register
368pub mod prer;
369/**WUTR (rw) register accessor: wakeup timer register
370
371You can [`read`](crate::Reg::read) this register and get [`wutr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wutr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
372
373See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:WUTR)
374
375For information about available fields see [`mod@wutr`]
376module*/
377pub type WUTR = crate::Reg<wutr::WUTRrs>;
378///wakeup timer register
379pub mod wutr;
380/**ALRMR (rw) register accessor: Alarm %s register
381
382You can [`read`](crate::Reg::read) this register and get [`alrmr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`alrmr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
383
384See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:ALRM[A]R)
385
386For information about available fields see [`mod@alrmr`]
387module*/
388pub type ALRMR = crate::Reg<alrmr::ALRMRrs>;
389///Alarm %s register
390pub mod alrmr;
391/**WPR (w) register accessor: write protection register
392
393You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`wpr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
394
395See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:WPR)
396
397For information about available fields see [`mod@wpr`]
398module*/
399pub type WPR = crate::Reg<wpr::WPRrs>;
400///write protection register
401pub mod wpr;
402/**SSR (r) register accessor: sub second register
403
404You can [`read`](crate::Reg::read) this register and get [`ssr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
405
406See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:SSR)
407
408For information about available fields see [`mod@ssr`]
409module*/
410pub type SSR = crate::Reg<ssr::SSRrs>;
411///sub second register
412pub mod ssr;
413/**SHIFTR (w) register accessor: shift control register
414
415You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`shiftr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
416
417See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:SHIFTR)
418
419For information about available fields see [`mod@shiftr`]
420module*/
421pub type SHIFTR = crate::Reg<shiftr::SHIFTRrs>;
422///shift control register
423pub mod shiftr;
424pub use dr as tsdr;
425pub use ssr as tsssr;
426pub use tr as tstr;
427pub use DR as TSDR;
428pub use SSR as TSSSR;
429pub use TR as TSTR;
430/**CALR (rw) register accessor: calibration register
431
432You can [`read`](crate::Reg::read) this register and get [`calr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`calr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
433
434See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:CALR)
435
436For information about available fields see [`mod@calr`]
437module*/
438pub type CALR = crate::Reg<calr::CALRrs>;
439///calibration register
440pub mod calr;
441/**TAFCR (rw) register accessor: tamper and alternate function configuration register
442
443You can [`read`](crate::Reg::read) this register and get [`tafcr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tafcr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
444
445See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:TAFCR)
446
447For information about available fields see [`mod@tafcr`]
448module*/
449pub type TAFCR = crate::Reg<tafcr::TAFCRrs>;
450///tamper and alternate function configuration register
451pub mod tafcr;
452/**ALRMSSR (rw) register accessor: Alarm %s sub-second register
453
454You can [`read`](crate::Reg::read) this register and get [`alrmssr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`alrmssr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
455
456See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:ALRM[A]SSR)
457
458For information about available fields see [`mod@alrmssr`]
459module*/
460pub type ALRMSSR = crate::Reg<alrmssr::ALRMSSRrs>;
461///Alarm %s sub-second register
462pub mod alrmssr;
463/**BKPR (rw) register accessor: backup register
464
465You can [`read`](crate::Reg::read) this register and get [`bkpr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`bkpr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
466
467See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F303.html#RTC:BKP[0]R)
468
469For information about available fields see [`mod@bkpr`]
470module*/
471pub type BKPR = crate::Reg<bkpr::BKPRrs>;
472///backup register
473pub mod bkpr;