atsamd51g/rtc/
mode2.rs

1#[repr(C)]
2#[doc = "Clock/Calendar with Alarm"]
3#[doc(alias = "MODE2")]
4pub struct Mode2 {
5    ctrla: Ctrla,
6    ctrlb: Ctrlb,
7    evctrl: Evctrl,
8    intenclr: Intenclr,
9    intenset: Intenset,
10    intflag: Intflag,
11    dbgctrl: Dbgctrl,
12    _reserved7: [u8; 0x01],
13    syncbusy: Syncbusy,
14    freqcorr: Freqcorr,
15    _reserved9: [u8; 0x03],
16    clock: Clock,
17    _reserved10: [u8; 0x04],
18    alarm0: Alarm0,
19    mask0: Mask0,
20    _reserved12: [u8; 0x03],
21    alarm1: Alarm1,
22    mask1: Mask1,
23    _reserved14: [u8; 0x13],
24    gp: [Gp; 4],
25    _reserved15: [u8; 0x10],
26    tampctrl: Tampctrl,
27    timestamp: Timestamp,
28    tampid: Tampid,
29    _reserved18: [u8; 0x14],
30    bkup: [Bkup; 8],
31}
32impl Mode2 {
33    #[doc = "0x00 - MODE2 Control A"]
34    #[inline(always)]
35    pub const fn ctrla(&self) -> &Ctrla {
36        &self.ctrla
37    }
38    #[doc = "0x02 - MODE2 Control B"]
39    #[inline(always)]
40    pub const fn ctrlb(&self) -> &Ctrlb {
41        &self.ctrlb
42    }
43    #[doc = "0x04 - MODE2 Event Control"]
44    #[inline(always)]
45    pub const fn evctrl(&self) -> &Evctrl {
46        &self.evctrl
47    }
48    #[doc = "0x08 - MODE2 Interrupt Enable Clear"]
49    #[inline(always)]
50    pub const fn intenclr(&self) -> &Intenclr {
51        &self.intenclr
52    }
53    #[doc = "0x0a - MODE2 Interrupt Enable Set"]
54    #[inline(always)]
55    pub const fn intenset(&self) -> &Intenset {
56        &self.intenset
57    }
58    #[doc = "0x0c - MODE2 Interrupt Flag Status and Clear"]
59    #[inline(always)]
60    pub const fn intflag(&self) -> &Intflag {
61        &self.intflag
62    }
63    #[doc = "0x0e - Debug Control"]
64    #[inline(always)]
65    pub const fn dbgctrl(&self) -> &Dbgctrl {
66        &self.dbgctrl
67    }
68    #[doc = "0x10 - MODE2 Synchronization Busy Status"]
69    #[inline(always)]
70    pub const fn syncbusy(&self) -> &Syncbusy {
71        &self.syncbusy
72    }
73    #[doc = "0x14 - Frequency Correction"]
74    #[inline(always)]
75    pub const fn freqcorr(&self) -> &Freqcorr {
76        &self.freqcorr
77    }
78    #[doc = "0x18 - MODE2 Clock Value"]
79    #[inline(always)]
80    pub const fn clock(&self) -> &Clock {
81        &self.clock
82    }
83    #[doc = "0x20 - MODE2_ALARM Alarm n Value"]
84    #[inline(always)]
85    pub const fn alarm0(&self) -> &Alarm0 {
86        &self.alarm0
87    }
88    #[doc = "0x24 - MODE2_ALARM Alarm n Mask"]
89    #[inline(always)]
90    pub const fn mask0(&self) -> &Mask0 {
91        &self.mask0
92    }
93    #[doc = "0x28 - MODE2_ALARM Alarm n Value"]
94    #[inline(always)]
95    pub const fn alarm1(&self) -> &Alarm1 {
96        &self.alarm1
97    }
98    #[doc = "0x2c - MODE2_ALARM Alarm n Mask"]
99    #[inline(always)]
100    pub const fn mask1(&self) -> &Mask1 {
101        &self.mask1
102    }
103    #[doc = "0x40..0x50 - General Purpose"]
104    #[inline(always)]
105    pub const fn gp(&self, n: usize) -> &Gp {
106        &self.gp[n]
107    }
108    #[doc = "Iterator for array of:"]
109    #[doc = "0x40..0x50 - General Purpose"]
110    #[inline(always)]
111    pub fn gp_iter(&self) -> impl Iterator<Item = &Gp> {
112        self.gp.iter()
113    }
114    #[doc = "0x60 - Tamper Control"]
115    #[inline(always)]
116    pub const fn tampctrl(&self) -> &Tampctrl {
117        &self.tampctrl
118    }
119    #[doc = "0x64 - MODE2 Timestamp"]
120    #[inline(always)]
121    pub const fn timestamp(&self) -> &Timestamp {
122        &self.timestamp
123    }
124    #[doc = "0x68 - Tamper ID"]
125    #[inline(always)]
126    pub const fn tampid(&self) -> &Tampid {
127        &self.tampid
128    }
129    #[doc = "0x80..0xa0 - Backup"]
130    #[inline(always)]
131    pub const fn bkup(&self, n: usize) -> &Bkup {
132        &self.bkup[n]
133    }
134    #[doc = "Iterator for array of:"]
135    #[doc = "0x80..0xa0 - Backup"]
136    #[inline(always)]
137    pub fn bkup_iter(&self) -> impl Iterator<Item = &Bkup> {
138        self.bkup.iter()
139    }
140}
141#[doc = "CTRLA (rw) register accessor: MODE2 Control A\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrla::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrla::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctrla`]
142module"]
143#[doc(alias = "CTRLA")]
144pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
145#[doc = "MODE2 Control A"]
146pub mod ctrla;
147#[doc = "CTRLB (rw) register accessor: MODE2 Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlb::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlb::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@ctrlb`]
148module"]
149#[doc(alias = "CTRLB")]
150pub type Ctrlb = crate::Reg<ctrlb::CtrlbSpec>;
151#[doc = "MODE2 Control B"]
152pub mod ctrlb;
153#[doc = "EVCTRL (rw) register accessor: MODE2 Event Control\n\nYou can [`read`](crate::Reg::read) this register and get [`evctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`evctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@evctrl`]
154module"]
155#[doc(alias = "EVCTRL")]
156pub type Evctrl = crate::Reg<evctrl::EvctrlSpec>;
157#[doc = "MODE2 Event Control"]
158pub mod evctrl;
159#[doc = "INTENCLR (rw) register accessor: MODE2 Interrupt Enable Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`intenclr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intenclr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@intenclr`]
160module"]
161#[doc(alias = "INTENCLR")]
162pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
163#[doc = "MODE2 Interrupt Enable Clear"]
164pub mod intenclr;
165#[doc = "INTENSET (rw) register accessor: MODE2 Interrupt Enable Set\n\nYou can [`read`](crate::Reg::read) this register and get [`intenset::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intenset::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@intenset`]
166module"]
167#[doc(alias = "INTENSET")]
168pub type Intenset = crate::Reg<intenset::IntensetSpec>;
169#[doc = "MODE2 Interrupt Enable Set"]
170pub mod intenset;
171#[doc = "INTFLAG (rw) register accessor: MODE2 Interrupt Flag Status and Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`intflag::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`intflag::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@intflag`]
172module"]
173#[doc(alias = "INTFLAG")]
174pub type Intflag = crate::Reg<intflag::IntflagSpec>;
175#[doc = "MODE2 Interrupt Flag Status and Clear"]
176pub mod intflag;
177#[doc = "DBGCTRL (rw) register accessor: Debug Control\n\nYou can [`read`](crate::Reg::read) this register and get [`dbgctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dbgctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@dbgctrl`]
178module"]
179#[doc(alias = "DBGCTRL")]
180pub type Dbgctrl = crate::Reg<dbgctrl::DbgctrlSpec>;
181#[doc = "Debug Control"]
182pub mod dbgctrl;
183#[doc = "SYNCBUSY (r) register accessor: MODE2 Synchronization Busy Status\n\nYou can [`read`](crate::Reg::read) this register and get [`syncbusy::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@syncbusy`]
184module"]
185#[doc(alias = "SYNCBUSY")]
186pub type Syncbusy = crate::Reg<syncbusy::SyncbusySpec>;
187#[doc = "MODE2 Synchronization Busy Status"]
188pub mod syncbusy;
189#[doc = "FREQCORR (rw) register accessor: Frequency Correction\n\nYou can [`read`](crate::Reg::read) this register and get [`freqcorr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`freqcorr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@freqcorr`]
190module"]
191#[doc(alias = "FREQCORR")]
192pub type Freqcorr = crate::Reg<freqcorr::FreqcorrSpec>;
193#[doc = "Frequency Correction"]
194pub mod freqcorr;
195#[doc = "CLOCK (rw) register accessor: MODE2 Clock Value\n\nYou can [`read`](crate::Reg::read) this register and get [`clock::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`clock::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@clock`]
196module"]
197#[doc(alias = "CLOCK")]
198pub type Clock = crate::Reg<clock::ClockSpec>;
199#[doc = "MODE2 Clock Value"]
200pub mod clock;
201#[doc = "GP (rw) register accessor: General Purpose\n\nYou can [`read`](crate::Reg::read) this register and get [`gp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gp::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@gp`]
202module"]
203#[doc(alias = "GP")]
204pub type Gp = crate::Reg<gp::GpSpec>;
205#[doc = "General Purpose"]
206pub mod gp;
207#[doc = "ALARM0 (rw) register accessor: MODE2_ALARM Alarm n Value\n\nYou can [`read`](crate::Reg::read) this register and get [`alarm0::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`alarm0::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@alarm0`]
208module"]
209#[doc(alias = "ALARM0")]
210pub type Alarm0 = crate::Reg<alarm0::Alarm0Spec>;
211#[doc = "MODE2_ALARM Alarm n Value"]
212pub mod alarm0;
213#[doc = "MASK0 (rw) register accessor: MODE2_ALARM Alarm n Mask\n\nYou can [`read`](crate::Reg::read) this register and get [`mask0::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mask0::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mask0`]
214module"]
215#[doc(alias = "MASK0")]
216pub type Mask0 = crate::Reg<mask0::Mask0Spec>;
217#[doc = "MODE2_ALARM Alarm n Mask"]
218pub mod mask0;
219#[doc = "ALARM1 (rw) register accessor: MODE2_ALARM Alarm n Value\n\nYou can [`read`](crate::Reg::read) this register and get [`alarm1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`alarm1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@alarm1`]
220module"]
221#[doc(alias = "ALARM1")]
222pub type Alarm1 = crate::Reg<alarm1::Alarm1Spec>;
223#[doc = "MODE2_ALARM Alarm n Value"]
224pub mod alarm1;
225#[doc = "MASK1 (rw) register accessor: MODE2_ALARM Alarm n Mask\n\nYou can [`read`](crate::Reg::read) this register and get [`mask1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mask1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@mask1`]
226module"]
227#[doc(alias = "MASK1")]
228pub type Mask1 = crate::Reg<mask1::Mask1Spec>;
229#[doc = "MODE2_ALARM Alarm n Mask"]
230pub mod mask1;
231#[doc = "TAMPCTRL (rw) register accessor: Tamper Control\n\nYou can [`read`](crate::Reg::read) this register and get [`tampctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tampctrl::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tampctrl`]
232module"]
233#[doc(alias = "TAMPCTRL")]
234pub type Tampctrl = crate::Reg<tampctrl::TampctrlSpec>;
235#[doc = "Tamper Control"]
236pub mod tampctrl;
237#[doc = "TIMESTAMP (r) register accessor: MODE2 Timestamp\n\nYou can [`read`](crate::Reg::read) this register and get [`timestamp::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@timestamp`]
238module"]
239#[doc(alias = "TIMESTAMP")]
240pub type Timestamp = crate::Reg<timestamp::TimestampSpec>;
241#[doc = "MODE2 Timestamp"]
242pub mod timestamp;
243#[doc = "TAMPID (rw) register accessor: Tamper ID\n\nYou can [`read`](crate::Reg::read) this register and get [`tampid::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tampid::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@tampid`]
244module"]
245#[doc(alias = "TAMPID")]
246pub type Tampid = crate::Reg<tampid::TampidSpec>;
247#[doc = "Tamper ID"]
248pub mod tampid;
249#[doc = "BKUP (rw) register accessor: Backup\n\nYou can [`read`](crate::Reg::read) this register and get [`bkup::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`bkup::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@bkup`]
250module"]
251#[doc(alias = "BKUP")]
252pub type Bkup = crate::Reg<bkup::BkupSpec>;
253#[doc = "Backup"]
254pub mod bkup;