atsamd21g/tc3/
count32.rs

1#[repr(C)]
2#[doc = "32-bit Counter Mode"]
3#[doc(alias = "COUNT32")]
4pub struct Count32 {
5    ctrla: Ctrla,
6    readreq: Readreq,
7    ctrlbclr: Ctrlbclr,
8    ctrlbset: Ctrlbset,
9    ctrlc: Ctrlc,
10    _reserved5: [u8; 0x01],
11    dbgctrl: Dbgctrl,
12    _reserved6: [u8; 0x01],
13    evctrl: Evctrl,
14    intenclr: Intenclr,
15    intenset: Intenset,
16    intflag: Intflag,
17    status: Status,
18    count: Count,
19    _reserved12: [u8; 0x04],
20    cc: [Cc; 2],
21}
22impl Count32 {
23    #[doc = "0x00 - Control A"]
24    #[inline(always)]
25    pub const fn ctrla(&self) -> &Ctrla {
26        &self.ctrla
27    }
28    #[doc = "0x02 - Read Request"]
29    #[inline(always)]
30    pub const fn readreq(&self) -> &Readreq {
31        &self.readreq
32    }
33    #[doc = "0x04 - Control B Clear"]
34    #[inline(always)]
35    pub const fn ctrlbclr(&self) -> &Ctrlbclr {
36        &self.ctrlbclr
37    }
38    #[doc = "0x05 - Control B Set"]
39    #[inline(always)]
40    pub const fn ctrlbset(&self) -> &Ctrlbset {
41        &self.ctrlbset
42    }
43    #[doc = "0x06 - Control C"]
44    #[inline(always)]
45    pub const fn ctrlc(&self) -> &Ctrlc {
46        &self.ctrlc
47    }
48    #[doc = "0x08 - Debug Control"]
49    #[inline(always)]
50    pub const fn dbgctrl(&self) -> &Dbgctrl {
51        &self.dbgctrl
52    }
53    #[doc = "0x0a - Event Control"]
54    #[inline(always)]
55    pub const fn evctrl(&self) -> &Evctrl {
56        &self.evctrl
57    }
58    #[doc = "0x0c - Interrupt Enable Clear"]
59    #[inline(always)]
60    pub const fn intenclr(&self) -> &Intenclr {
61        &self.intenclr
62    }
63    #[doc = "0x0d - Interrupt Enable Set"]
64    #[inline(always)]
65    pub const fn intenset(&self) -> &Intenset {
66        &self.intenset
67    }
68    #[doc = "0x0e - Interrupt Flag Status and Clear"]
69    #[inline(always)]
70    pub const fn intflag(&self) -> &Intflag {
71        &self.intflag
72    }
73    #[doc = "0x0f - Status"]
74    #[inline(always)]
75    pub const fn status(&self) -> &Status {
76        &self.status
77    }
78    #[doc = "0x10 - COUNT32 Counter Value"]
79    #[inline(always)]
80    pub const fn count(&self) -> &Count {
81        &self.count
82    }
83    #[doc = "0x18..0x20 - COUNT32 Compare/Capture"]
84    #[inline(always)]
85    pub const fn cc(&self, n: usize) -> &Cc {
86        &self.cc[n]
87    }
88    #[doc = "Iterator for array of:"]
89    #[doc = "0x18..0x20 - COUNT32 Compare/Capture"]
90    #[inline(always)]
91    pub fn cc_iter(&self) -> impl Iterator<Item = &Cc> {
92        self.cc.iter()
93    }
94}
95#[doc = "CTRLA (rw) register accessor: 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`]
96module"]
97#[doc(alias = "CTRLA")]
98pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
99#[doc = "Control A"]
100pub mod ctrla;
101#[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`]
102module"]
103#[doc(alias = "READREQ")]
104pub type Readreq = crate::Reg<readreq::ReadreqSpec>;
105#[doc = "Read Request"]
106pub mod readreq;
107#[doc = "CTRLBCLR (rw) register accessor: Control B Clear\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlbclr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlbclr::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@ctrlbclr`]
108module"]
109#[doc(alias = "CTRLBCLR")]
110pub type Ctrlbclr = crate::Reg<ctrlbclr::CtrlbclrSpec>;
111#[doc = "Control B Clear"]
112pub mod ctrlbclr;
113#[doc = "CTRLBSET (rw) register accessor: Control B Set\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlbset::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlbset::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@ctrlbset`]
114module"]
115#[doc(alias = "CTRLBSET")]
116pub type Ctrlbset = crate::Reg<ctrlbset::CtrlbsetSpec>;
117#[doc = "Control B Set"]
118pub mod ctrlbset;
119#[doc = "CTRLC (rw) register accessor: Control C\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlc::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlc::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@ctrlc`]
120module"]
121#[doc(alias = "CTRLC")]
122pub type Ctrlc = crate::Reg<ctrlc::CtrlcSpec>;
123#[doc = "Control C"]
124pub mod ctrlc;
125#[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`]
126module"]
127#[doc(alias = "DBGCTRL")]
128pub type Dbgctrl = crate::Reg<dbgctrl::DbgctrlSpec>;
129#[doc = "Debug Control"]
130pub mod dbgctrl;
131#[doc = "EVCTRL (rw) register accessor: 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`]
132module"]
133#[doc(alias = "EVCTRL")]
134pub type Evctrl = crate::Reg<evctrl::EvctrlSpec>;
135#[doc = "Event Control"]
136pub mod evctrl;
137#[doc = "INTENCLR (rw) register accessor: 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`]
138module"]
139#[doc(alias = "INTENCLR")]
140pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
141#[doc = "Interrupt Enable Clear"]
142pub mod intenclr;
143#[doc = "INTENSET (rw) register accessor: 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`]
144module"]
145#[doc(alias = "INTENSET")]
146pub type Intenset = crate::Reg<intenset::IntensetSpec>;
147#[doc = "Interrupt Enable Set"]
148pub mod intenset;
149#[doc = "INTFLAG (rw) register accessor: 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`]
150module"]
151#[doc(alias = "INTFLAG")]
152pub type Intflag = crate::Reg<intflag::IntflagSpec>;
153#[doc = "Interrupt Flag Status and Clear"]
154pub mod intflag;
155#[doc = "STATUS (r) register accessor: Status\n\nYou can [`read`](crate::Reg::read) this register and get [`status::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@status`]
156module"]
157#[doc(alias = "STATUS")]
158pub type Status = crate::Reg<status::StatusSpec>;
159#[doc = "Status"]
160pub mod status;
161#[doc = "COUNT (rw) register accessor: COUNT32 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`]
162module"]
163#[doc(alias = "COUNT")]
164pub type Count = crate::Reg<count::CountSpec>;
165#[doc = "COUNT32 Counter Value"]
166pub mod count;
167#[doc = "CC (rw) register accessor: COUNT32 Compare/Capture\n\nYou can [`read`](crate::Reg::read) this register and get [`cc::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cc::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@cc`]
168module"]
169#[doc(alias = "CC")]
170pub type Cc = crate::Reg<cc::CcSpec>;
171#[doc = "COUNT32 Compare/Capture"]
172pub mod cc;