atsamd21j/tc3/
count8.rs

1#[repr(C)]
2#[doc = "8-bit Counter Mode"]
3#[doc(alias = "COUNT8")]
4pub struct Count8 {
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; 0x03],
20    per: Per,
21    _reserved13: [u8; 0x03],
22    cc: [Cc; 2],
23}
24impl Count8 {
25    #[doc = "0x00 - Control A"]
26    #[inline(always)]
27    pub const fn ctrla(&self) -> &Ctrla {
28        &self.ctrla
29    }
30    #[doc = "0x02 - Read Request"]
31    #[inline(always)]
32    pub const fn readreq(&self) -> &Readreq {
33        &self.readreq
34    }
35    #[doc = "0x04 - Control B Clear"]
36    #[inline(always)]
37    pub const fn ctrlbclr(&self) -> &Ctrlbclr {
38        &self.ctrlbclr
39    }
40    #[doc = "0x05 - Control B Set"]
41    #[inline(always)]
42    pub const fn ctrlbset(&self) -> &Ctrlbset {
43        &self.ctrlbset
44    }
45    #[doc = "0x06 - Control C"]
46    #[inline(always)]
47    pub const fn ctrlc(&self) -> &Ctrlc {
48        &self.ctrlc
49    }
50    #[doc = "0x08 - Debug Control"]
51    #[inline(always)]
52    pub const fn dbgctrl(&self) -> &Dbgctrl {
53        &self.dbgctrl
54    }
55    #[doc = "0x0a - Event Control"]
56    #[inline(always)]
57    pub const fn evctrl(&self) -> &Evctrl {
58        &self.evctrl
59    }
60    #[doc = "0x0c - Interrupt Enable Clear"]
61    #[inline(always)]
62    pub const fn intenclr(&self) -> &Intenclr {
63        &self.intenclr
64    }
65    #[doc = "0x0d - Interrupt Enable Set"]
66    #[inline(always)]
67    pub const fn intenset(&self) -> &Intenset {
68        &self.intenset
69    }
70    #[doc = "0x0e - Interrupt Flag Status and Clear"]
71    #[inline(always)]
72    pub const fn intflag(&self) -> &Intflag {
73        &self.intflag
74    }
75    #[doc = "0x0f - Status"]
76    #[inline(always)]
77    pub const fn status(&self) -> &Status {
78        &self.status
79    }
80    #[doc = "0x10 - COUNT8 Counter Value"]
81    #[inline(always)]
82    pub const fn count(&self) -> &Count {
83        &self.count
84    }
85    #[doc = "0x14 - COUNT8 Period Value"]
86    #[inline(always)]
87    pub const fn per(&self) -> &Per {
88        &self.per
89    }
90    #[doc = "0x18 - COUNT8 Compare/Capture"]
91    #[inline(always)]
92    pub const fn cc(&self, n: usize) -> &Cc {
93        &self.cc[n]
94    }
95    #[doc = "Iterator for array of:"]
96    #[doc = "0x18 - COUNT8 Compare/Capture"]
97    #[inline(always)]
98    pub fn cc_iter(&self) -> impl Iterator<Item = &Cc> {
99        self.cc.iter()
100    }
101}
102#[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`]
103module"]
104#[doc(alias = "CTRLA")]
105pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
106#[doc = "Control A"]
107pub mod ctrla;
108#[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`]
109module"]
110#[doc(alias = "READREQ")]
111pub type Readreq = crate::Reg<readreq::ReadreqSpec>;
112#[doc = "Read Request"]
113pub mod readreq;
114#[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`]
115module"]
116#[doc(alias = "CTRLBCLR")]
117pub type Ctrlbclr = crate::Reg<ctrlbclr::CtrlbclrSpec>;
118#[doc = "Control B Clear"]
119pub mod ctrlbclr;
120#[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`]
121module"]
122#[doc(alias = "CTRLBSET")]
123pub type Ctrlbset = crate::Reg<ctrlbset::CtrlbsetSpec>;
124#[doc = "Control B Set"]
125pub mod ctrlbset;
126#[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`]
127module"]
128#[doc(alias = "CTRLC")]
129pub type Ctrlc = crate::Reg<ctrlc::CtrlcSpec>;
130#[doc = "Control C"]
131pub mod ctrlc;
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 = "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`]
139module"]
140#[doc(alias = "EVCTRL")]
141pub type Evctrl = crate::Reg<evctrl::EvctrlSpec>;
142#[doc = "Event Control"]
143pub mod evctrl;
144#[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`]
145module"]
146#[doc(alias = "INTENCLR")]
147pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
148#[doc = "Interrupt Enable Clear"]
149pub mod intenclr;
150#[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`]
151module"]
152#[doc(alias = "INTENSET")]
153pub type Intenset = crate::Reg<intenset::IntensetSpec>;
154#[doc = "Interrupt Enable Set"]
155pub mod intenset;
156#[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`]
157module"]
158#[doc(alias = "INTFLAG")]
159pub type Intflag = crate::Reg<intflag::IntflagSpec>;
160#[doc = "Interrupt Flag Status and Clear"]
161pub mod intflag;
162#[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`]
163module"]
164#[doc(alias = "STATUS")]
165pub type Status = crate::Reg<status::StatusSpec>;
166#[doc = "Status"]
167pub mod status;
168#[doc = "COUNT (rw) register accessor: COUNT8 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`]
169module"]
170#[doc(alias = "COUNT")]
171pub type Count = crate::Reg<count::CountSpec>;
172#[doc = "COUNT8 Counter Value"]
173pub mod count;
174#[doc = "PER (rw) register accessor: COUNT8 Period Value\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`]
175module"]
176#[doc(alias = "PER")]
177pub type Per = crate::Reg<per::PerSpec>;
178#[doc = "COUNT8 Period Value"]
179pub mod per;
180#[doc = "CC (rw) register accessor: COUNT8 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`]
181module"]
182#[doc(alias = "CC")]
183pub type Cc = crate::Reg<cc::CcSpec>;
184#[doc = "COUNT8 Compare/Capture"]
185pub mod cc;