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