mcxa_pac/
ctimer0.rs

1#[repr(C)]
2#[cfg_attr(feature = "debug", derive(Debug))]
3#[doc = "Register block"]
4pub struct RegisterBlock {
5    ir: Ir,
6    tcr: Tcr,
7    tc: Tc,
8    pr: Pr,
9    pc: Pc,
10    mcr: Mcr,
11    mr: [Mr; 4],
12    ccr: Ccr,
13    cr: [Cr; 4],
14    emr: Emr,
15    _reserved10: [u8; 0x30],
16    ctcr: Ctcr,
17    pwmc: Pwmc,
18    msr: [Msr; 4],
19}
20impl RegisterBlock {
21    #[doc = "0x00 - Interrupt"]
22    #[inline(always)]
23    pub const fn ir(&self) -> &Ir {
24        &self.ir
25    }
26    #[doc = "0x04 - Timer Control"]
27    #[inline(always)]
28    pub const fn tcr(&self) -> &Tcr {
29        &self.tcr
30    }
31    #[doc = "0x08 - Timer Counter"]
32    #[inline(always)]
33    pub const fn tc(&self) -> &Tc {
34        &self.tc
35    }
36    #[doc = "0x0c - Prescale"]
37    #[inline(always)]
38    pub const fn pr(&self) -> &Pr {
39        &self.pr
40    }
41    #[doc = "0x10 - Prescale Counter"]
42    #[inline(always)]
43    pub const fn pc(&self) -> &Pc {
44        &self.pc
45    }
46    #[doc = "0x14 - Match Control"]
47    #[inline(always)]
48    pub const fn mcr(&self) -> &Mcr {
49        &self.mcr
50    }
51    #[doc = "0x18..0x28 - Match"]
52    #[inline(always)]
53    pub const fn mr(&self, n: usize) -> &Mr {
54        &self.mr[n]
55    }
56    #[doc = "Iterator for array of:"]
57    #[doc = "0x18..0x28 - Match"]
58    #[inline(always)]
59    pub fn mr_iter(&self) -> impl Iterator<Item = &Mr> {
60        self.mr.iter()
61    }
62    #[doc = "0x28 - Capture Control"]
63    #[inline(always)]
64    pub const fn ccr(&self) -> &Ccr {
65        &self.ccr
66    }
67    #[doc = "0x2c..0x3c - Capture"]
68    #[inline(always)]
69    pub const fn cr(&self, n: usize) -> &Cr {
70        &self.cr[n]
71    }
72    #[doc = "Iterator for array of:"]
73    #[doc = "0x2c..0x3c - Capture"]
74    #[inline(always)]
75    pub fn cr_iter(&self) -> impl Iterator<Item = &Cr> {
76        self.cr.iter()
77    }
78    #[doc = "0x3c - External Match"]
79    #[inline(always)]
80    pub const fn emr(&self) -> &Emr {
81        &self.emr
82    }
83    #[doc = "0x70 - Count Control"]
84    #[inline(always)]
85    pub const fn ctcr(&self) -> &Ctcr {
86        &self.ctcr
87    }
88    #[doc = "0x74 - PWM Control"]
89    #[inline(always)]
90    pub const fn pwmc(&self) -> &Pwmc {
91        &self.pwmc
92    }
93    #[doc = "0x78..0x88 - Match Shadow"]
94    #[inline(always)]
95    pub const fn msr(&self, n: usize) -> &Msr {
96        &self.msr[n]
97    }
98    #[doc = "Iterator for array of:"]
99    #[doc = "0x78..0x88 - Match Shadow"]
100    #[inline(always)]
101    pub fn msr_iter(&self) -> impl Iterator<Item = &Msr> {
102        self.msr.iter()
103    }
104}
105#[doc = "IR (rw) register accessor: Interrupt\n\nYou can [`read`](crate::Reg::read) this register and get [`ir::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ir::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@ir`] module"]
106#[doc(alias = "IR")]
107pub type Ir = crate::Reg<ir::IrSpec>;
108#[doc = "Interrupt"]
109pub mod ir;
110#[doc = "TCR (rw) register accessor: Timer Control\n\nYou can [`read`](crate::Reg::read) this register and get [`tcr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tcr::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@tcr`] module"]
111#[doc(alias = "TCR")]
112pub type Tcr = crate::Reg<tcr::TcrSpec>;
113#[doc = "Timer Control"]
114pub mod tcr;
115#[doc = "TC (rw) register accessor: Timer Counter\n\nYou can [`read`](crate::Reg::read) this register and get [`tc::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tc::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@tc`] module"]
116#[doc(alias = "TC")]
117pub type Tc = crate::Reg<tc::TcSpec>;
118#[doc = "Timer Counter"]
119pub mod tc;
120#[doc = "PR (rw) register accessor: Prescale\n\nYou can [`read`](crate::Reg::read) this register and get [`pr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pr::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@pr`] module"]
121#[doc(alias = "PR")]
122pub type Pr = crate::Reg<pr::PrSpec>;
123#[doc = "Prescale"]
124pub mod pr;
125#[doc = "PC (rw) register accessor: Prescale Counter\n\nYou can [`read`](crate::Reg::read) this register and get [`pc::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pc::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@pc`] module"]
126#[doc(alias = "PC")]
127pub type Pc = crate::Reg<pc::PcSpec>;
128#[doc = "Prescale Counter"]
129pub mod pc;
130#[doc = "MCR (rw) register accessor: Match Control\n\nYou can [`read`](crate::Reg::read) this register and get [`mcr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mcr::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@mcr`] module"]
131#[doc(alias = "MCR")]
132pub type Mcr = crate::Reg<mcr::McrSpec>;
133#[doc = "Match Control"]
134pub mod mcr;
135#[doc = "MR (rw) register accessor: Match\n\nYou can [`read`](crate::Reg::read) this register and get [`mr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`mr::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@mr`] module"]
136#[doc(alias = "MR")]
137pub type Mr = crate::Reg<mr::MrSpec>;
138#[doc = "Match"]
139pub mod mr;
140#[doc = "CCR (rw) register accessor: Capture Control\n\nYou can [`read`](crate::Reg::read) this register and get [`ccr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccr::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@ccr`] module"]
141#[doc(alias = "CCR")]
142pub type Ccr = crate::Reg<ccr::CcrSpec>;
143#[doc = "Capture Control"]
144pub mod ccr;
145#[doc = "CR (r) register accessor: Capture\n\nYou can [`read`](crate::Reg::read) this register and get [`cr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@cr`] module"]
146#[doc(alias = "CR")]
147pub type Cr = crate::Reg<cr::CrSpec>;
148#[doc = "Capture"]
149pub mod cr;
150#[doc = "EMR (rw) register accessor: External Match\n\nYou can [`read`](crate::Reg::read) this register and get [`emr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`emr::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@emr`] module"]
151#[doc(alias = "EMR")]
152pub type Emr = crate::Reg<emr::EmrSpec>;
153#[doc = "External Match"]
154pub mod emr;
155#[doc = "CTCR (rw) register accessor: Count Control\n\nYou can [`read`](crate::Reg::read) this register and get [`ctcr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctcr::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@ctcr`] module"]
156#[doc(alias = "CTCR")]
157pub type Ctcr = crate::Reg<ctcr::CtcrSpec>;
158#[doc = "Count Control"]
159pub mod ctcr;
160#[doc = "PWMC (rw) register accessor: PWM Control\n\nYou can [`read`](crate::Reg::read) this register and get [`pwmc::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pwmc::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@pwmc`] module"]
161#[doc(alias = "PWMC")]
162pub type Pwmc = crate::Reg<pwmc::PwmcSpec>;
163#[doc = "PWM Control"]
164pub mod pwmc;
165#[doc = "MSR (rw) register accessor: Match Shadow\n\nYou can [`read`](crate::Reg::read) this register and get [`msr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`msr::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@msr`] module"]
166#[doc(alias = "MSR")]
167pub type Msr = crate::Reg<msr::MsrSpec>;
168#[doc = "Match Shadow"]
169pub mod msr;