atsamd21g/rtc/
mode1.rs

1#[repr(C)]
2#[doc = "16-bit Counter with Two 16-bit Compares"]
3#[doc(alias = "MODE1")]
4pub struct Mode1 {
5    ctrl: Ctrl,
6    readreq: Readreq,
7    evctrl: Evctrl,
8    intenclr: Intenclr,
9    intenset: Intenset,
10    intflag: Intflag,
11    _reserved6: [u8; 0x01],
12    status: Status,
13    dbgctrl: Dbgctrl,
14    freqcorr: Freqcorr,
15    _reserved9: [u8; 0x03],
16    count: Count,
17    _reserved10: [u8; 0x02],
18    per: Per,
19    _reserved11: [u8; 0x02],
20    comp: [Comp; 2],
21}
22impl Mode1 {
23    #[doc = "0x00 - MODE1 Control"]
24    #[inline(always)]
25    pub const fn ctrl(&self) -> &Ctrl {
26        &self.ctrl
27    }
28    #[doc = "0x02 - Read Request"]
29    #[inline(always)]
30    pub const fn readreq(&self) -> &Readreq {
31        &self.readreq
32    }
33    #[doc = "0x04 - MODE1 Event Control"]
34    #[inline(always)]
35    pub const fn evctrl(&self) -> &Evctrl {
36        &self.evctrl
37    }
38    #[doc = "0x06 - MODE1 Interrupt Enable Clear"]
39    #[inline(always)]
40    pub const fn intenclr(&self) -> &Intenclr {
41        &self.intenclr
42    }
43    #[doc = "0x07 - MODE1 Interrupt Enable Set"]
44    #[inline(always)]
45    pub const fn intenset(&self) -> &Intenset {
46        &self.intenset
47    }
48    #[doc = "0x08 - MODE1 Interrupt Flag Status and Clear"]
49    #[inline(always)]
50    pub const fn intflag(&self) -> &Intflag {
51        &self.intflag
52    }
53    #[doc = "0x0a - Status"]
54    #[inline(always)]
55    pub const fn status(&self) -> &Status {
56        &self.status
57    }
58    #[doc = "0x0b - Debug Control"]
59    #[inline(always)]
60    pub const fn dbgctrl(&self) -> &Dbgctrl {
61        &self.dbgctrl
62    }
63    #[doc = "0x0c - Frequency Correction"]
64    #[inline(always)]
65    pub const fn freqcorr(&self) -> &Freqcorr {
66        &self.freqcorr
67    }
68    #[doc = "0x10 - MODE1 Counter Value"]
69    #[inline(always)]
70    pub const fn count(&self) -> &Count {
71        &self.count
72    }
73    #[doc = "0x14 - MODE1 Counter Period"]
74    #[inline(always)]
75    pub const fn per(&self) -> &Per {
76        &self.per
77    }
78    #[doc = "0x18 - MODE1 Compare n Value"]
79    #[inline(always)]
80    pub const fn comp(&self, n: usize) -> &Comp {
81        &self.comp[n]
82    }
83    #[doc = "Iterator for array of:"]
84    #[doc = "0x18 - MODE1 Compare n Value"]
85    #[inline(always)]
86    pub fn comp_iter(&self) -> impl Iterator<Item = &Comp> {
87        self.comp.iter()
88    }
89}
90#[doc = "CTRL (rw) register accessor: MODE1 Control\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl::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@ctrl`]
91module"]
92#[doc(alias = "CTRL")]
93pub type Ctrl = crate::Reg<ctrl::CtrlSpec>;
94#[doc = "MODE1 Control"]
95pub mod ctrl;
96#[doc = "READREQ (rw) register accessor: Read Request\n\nYou can [`read`](crate::Reg::read) this register and get [`readreq::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`readreq::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@readreq`]
97module"]
98#[doc(alias = "READREQ")]
99pub type Readreq = crate::Reg<readreq::ReadreqSpec>;
100#[doc = "Read Request"]
101pub mod readreq;
102#[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`]
103module"]
104#[doc(alias = "EVCTRL")]
105pub type Evctrl = crate::Reg<evctrl::EvctrlSpec>;
106#[doc = "MODE1 Event Control"]
107pub mod evctrl;
108#[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`]
109module"]
110#[doc(alias = "INTENCLR")]
111pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
112#[doc = "MODE1 Interrupt Enable Clear"]
113pub mod intenclr;
114#[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`]
115module"]
116#[doc(alias = "INTENSET")]
117pub type Intenset = crate::Reg<intenset::IntensetSpec>;
118#[doc = "MODE1 Interrupt Enable Set"]
119pub mod intenset;
120#[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`]
121module"]
122#[doc(alias = "INTFLAG")]
123pub type Intflag = crate::Reg<intflag::IntflagSpec>;
124#[doc = "MODE1 Interrupt Flag Status and Clear"]
125pub mod intflag;
126#[doc = "STATUS (rw) register accessor: Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`status::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@status`]
127module"]
128#[doc(alias = "STATUS")]
129pub type Status = crate::Reg<status::StatusSpec>;
130#[doc = "Status"]
131pub mod status;
132#[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`]
133module"]
134#[doc(alias = "DBGCTRL")]
135pub type Dbgctrl = crate::Reg<dbgctrl::DbgctrlSpec>;
136#[doc = "Debug Control"]
137pub mod dbgctrl;
138#[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`]
139module"]
140#[doc(alias = "FREQCORR")]
141pub type Freqcorr = crate::Reg<freqcorr::FreqcorrSpec>;
142#[doc = "Frequency Correction"]
143pub mod freqcorr;
144#[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`]
145module"]
146#[doc(alias = "COUNT")]
147pub type Count = crate::Reg<count::CountSpec>;
148#[doc = "MODE1 Counter Value"]
149pub mod count;
150#[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`]
151module"]
152#[doc(alias = "PER")]
153pub type Per = crate::Reg<per::PerSpec>;
154#[doc = "MODE1 Counter Period"]
155pub mod per;
156#[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`]
157module"]
158#[doc(alias = "COMP")]
159pub type Comp = crate::Reg<comp::CompSpec>;
160#[doc = "MODE1 Compare n Value"]
161pub mod comp;