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