atsamd51g/rtc/
mode0.rs

1#[repr(C)]
2#[doc = "32-bit Counter with Single 32-bit Compare"]
3#[doc(alias = "MODE0")]
4pub struct Mode0 {
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    count: Count,
17    _reserved10: [u8; 0x04],
18    comp: [Comp; 2],
19    _reserved11: [u8; 0x18],
20    gp: [Gp; 4],
21    _reserved12: [u8; 0x10],
22    tampctrl: Tampctrl,
23    timestamp: Timestamp,
24    tampid: Tampid,
25    _reserved15: [u8; 0x14],
26    bkup: [Bkup; 8],
27}
28impl Mode0 {
29    #[doc = "0x00 - MODE0 Control A"]
30    #[inline(always)]
31    pub const fn ctrla(&self) -> &Ctrla {
32        &self.ctrla
33    }
34    #[doc = "0x02 - MODE0 Control B"]
35    #[inline(always)]
36    pub const fn ctrlb(&self) -> &Ctrlb {
37        &self.ctrlb
38    }
39    #[doc = "0x04 - MODE0 Event Control"]
40    #[inline(always)]
41    pub const fn evctrl(&self) -> &Evctrl {
42        &self.evctrl
43    }
44    #[doc = "0x08 - MODE0 Interrupt Enable Clear"]
45    #[inline(always)]
46    pub const fn intenclr(&self) -> &Intenclr {
47        &self.intenclr
48    }
49    #[doc = "0x0a - MODE0 Interrupt Enable Set"]
50    #[inline(always)]
51    pub const fn intenset(&self) -> &Intenset {
52        &self.intenset
53    }
54    #[doc = "0x0c - MODE0 Interrupt Flag Status and Clear"]
55    #[inline(always)]
56    pub const fn intflag(&self) -> &Intflag {
57        &self.intflag
58    }
59    #[doc = "0x0e - Debug Control"]
60    #[inline(always)]
61    pub const fn dbgctrl(&self) -> &Dbgctrl {
62        &self.dbgctrl
63    }
64    #[doc = "0x10 - MODE0 Synchronization Busy Status"]
65    #[inline(always)]
66    pub const fn syncbusy(&self) -> &Syncbusy {
67        &self.syncbusy
68    }
69    #[doc = "0x14 - Frequency Correction"]
70    #[inline(always)]
71    pub const fn freqcorr(&self) -> &Freqcorr {
72        &self.freqcorr
73    }
74    #[doc = "0x18 - MODE0 Counter Value"]
75    #[inline(always)]
76    pub const fn count(&self) -> &Count {
77        &self.count
78    }
79    #[doc = "0x20..0x28 - MODE0 Compare n Value"]
80    #[inline(always)]
81    pub const fn comp(&self, n: usize) -> &Comp {
82        &self.comp[n]
83    }
84    #[doc = "Iterator for array of:"]
85    #[doc = "0x20..0x28 - MODE0 Compare n Value"]
86    #[inline(always)]
87    pub fn comp_iter(&self) -> impl Iterator<Item = &Comp> {
88        self.comp.iter()
89    }
90    #[doc = "0x40..0x50 - General Purpose"]
91    #[inline(always)]
92    pub const fn gp(&self, n: usize) -> &Gp {
93        &self.gp[n]
94    }
95    #[doc = "Iterator for array of:"]
96    #[doc = "0x40..0x50 - General Purpose"]
97    #[inline(always)]
98    pub fn gp_iter(&self) -> impl Iterator<Item = &Gp> {
99        self.gp.iter()
100    }
101    #[doc = "0x60 - Tamper Control"]
102    #[inline(always)]
103    pub const fn tampctrl(&self) -> &Tampctrl {
104        &self.tampctrl
105    }
106    #[doc = "0x64 - MODE0 Timestamp"]
107    #[inline(always)]
108    pub const fn timestamp(&self) -> &Timestamp {
109        &self.timestamp
110    }
111    #[doc = "0x68 - Tamper ID"]
112    #[inline(always)]
113    pub const fn tampid(&self) -> &Tampid {
114        &self.tampid
115    }
116    #[doc = "0x80..0xa0 - Backup"]
117    #[inline(always)]
118    pub const fn bkup(&self, n: usize) -> &Bkup {
119        &self.bkup[n]
120    }
121    #[doc = "Iterator for array of:"]
122    #[doc = "0x80..0xa0 - Backup"]
123    #[inline(always)]
124    pub fn bkup_iter(&self) -> impl Iterator<Item = &Bkup> {
125        self.bkup.iter()
126    }
127}
128#[doc = "CTRLA (rw) register accessor: MODE0 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`]
129module"]
130#[doc(alias = "CTRLA")]
131pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
132#[doc = "MODE0 Control A"]
133pub mod ctrla;
134#[doc = "CTRLB (rw) register accessor: MODE0 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`]
135module"]
136#[doc(alias = "CTRLB")]
137pub type Ctrlb = crate::Reg<ctrlb::CtrlbSpec>;
138#[doc = "MODE0 Control B"]
139pub mod ctrlb;
140#[doc = "EVCTRL (rw) register accessor: MODE0 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`]
141module"]
142#[doc(alias = "EVCTRL")]
143pub type Evctrl = crate::Reg<evctrl::EvctrlSpec>;
144#[doc = "MODE0 Event Control"]
145pub mod evctrl;
146#[doc = "INTENCLR (rw) register accessor: MODE0 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`]
147module"]
148#[doc(alias = "INTENCLR")]
149pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
150#[doc = "MODE0 Interrupt Enable Clear"]
151pub mod intenclr;
152#[doc = "INTENSET (rw) register accessor: MODE0 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`]
153module"]
154#[doc(alias = "INTENSET")]
155pub type Intenset = crate::Reg<intenset::IntensetSpec>;
156#[doc = "MODE0 Interrupt Enable Set"]
157pub mod intenset;
158#[doc = "INTFLAG (rw) register accessor: MODE0 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`]
159module"]
160#[doc(alias = "INTFLAG")]
161pub type Intflag = crate::Reg<intflag::IntflagSpec>;
162#[doc = "MODE0 Interrupt Flag Status and Clear"]
163pub mod intflag;
164#[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`]
165module"]
166#[doc(alias = "DBGCTRL")]
167pub type Dbgctrl = crate::Reg<dbgctrl::DbgctrlSpec>;
168#[doc = "Debug Control"]
169pub mod dbgctrl;
170#[doc = "SYNCBUSY (r) register accessor: MODE0 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`]
171module"]
172#[doc(alias = "SYNCBUSY")]
173pub type Syncbusy = crate::Reg<syncbusy::SyncbusySpec>;
174#[doc = "MODE0 Synchronization Busy Status"]
175pub mod syncbusy;
176#[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`]
177module"]
178#[doc(alias = "FREQCORR")]
179pub type Freqcorr = crate::Reg<freqcorr::FreqcorrSpec>;
180#[doc = "Frequency Correction"]
181pub mod freqcorr;
182#[doc = "COUNT (rw) register accessor: MODE0 Counter Value\n\nYou can [`read`](crate::Reg::read) this register and get [`count::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`count::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@count`]
183module"]
184#[doc(alias = "COUNT")]
185pub type Count = crate::Reg<count::CountSpec>;
186#[doc = "MODE0 Counter Value"]
187pub mod count;
188#[doc = "COMP (rw) register accessor: MODE0 Compare n Value\n\nYou can [`read`](crate::Reg::read) this register and get [`comp::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`comp::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@comp`]
189module"]
190#[doc(alias = "COMP")]
191pub type Comp = crate::Reg<comp::CompSpec>;
192#[doc = "MODE0 Compare n Value"]
193pub mod comp;
194#[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`]
195module"]
196#[doc(alias = "GP")]
197pub type Gp = crate::Reg<gp::GpSpec>;
198#[doc = "General Purpose"]
199pub mod gp;
200#[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`]
201module"]
202#[doc(alias = "TAMPCTRL")]
203pub type Tampctrl = crate::Reg<tampctrl::TampctrlSpec>;
204#[doc = "Tamper Control"]
205pub mod tampctrl;
206#[doc = "TIMESTAMP (r) register accessor: MODE0 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`]
207module"]
208#[doc(alias = "TIMESTAMP")]
209pub type Timestamp = crate::Reg<timestamp::TimestampSpec>;
210#[doc = "MODE0 Timestamp"]
211pub mod timestamp;
212#[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`]
213module"]
214#[doc(alias = "TAMPID")]
215pub type Tampid = crate::Reg<tampid::TampidSpec>;
216#[doc = "Tamper ID"]
217pub mod tampid;
218#[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`]
219module"]
220#[doc(alias = "BKUP")]
221pub type Bkup = crate::Reg<bkup::BkupSpec>;
222#[doc = "Backup"]
223pub mod bkup;