stm32f3_staging/stm32f373/tim12.rs
1#[repr(C)]
2#[derive(Debug)]
3///Register block
4pub struct RegisterBlock {
5 cr1: CR1,
6 _reserved1: [u8; 0x04],
7 smcr: SMCR,
8 dier: DIER,
9 sr: SR,
10 egr: EGR,
11 _reserved_5_ccmr1: [u8; 0x04],
12 _reserved6: [u8; 0x04],
13 ccer: CCER,
14 cnt: CNT,
15 psc: PSC,
16 arr: ARR,
17 _reserved10: [u8; 0x04],
18 ccr: [CCR; 2],
19}
20impl RegisterBlock {
21 ///0x00 - control register 1
22 #[inline(always)]
23 pub const fn cr1(&self) -> &CR1 {
24 &self.cr1
25 }
26 ///0x08 - slave mode control register
27 #[inline(always)]
28 pub const fn smcr(&self) -> &SMCR {
29 &self.smcr
30 }
31 ///0x0c - DMA/Interrupt enable register
32 #[inline(always)]
33 pub const fn dier(&self) -> &DIER {
34 &self.dier
35 }
36 ///0x10 - status register
37 #[inline(always)]
38 pub const fn sr(&self) -> &SR {
39 &self.sr
40 }
41 ///0x14 - event generation register
42 #[inline(always)]
43 pub const fn egr(&self) -> &EGR {
44 &self.egr
45 }
46 ///0x18 - capture/compare mode register 1 (input mode)
47 #[inline(always)]
48 pub const fn ccmr1_input(&self) -> &CCMR1_INPUT {
49 unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(24).cast() }
50 }
51 ///0x18 - capture/compare mode register (output mode)
52 #[inline(always)]
53 pub const fn ccmr1_output(&self) -> &CCMR1_OUTPUT {
54 unsafe { &*core::ptr::from_ref(self).cast::<u8>().add(24).cast() }
55 }
56 ///0x20 - capture/compare enable register
57 #[inline(always)]
58 pub const fn ccer(&self) -> &CCER {
59 &self.ccer
60 }
61 ///0x24 - counter
62 #[inline(always)]
63 pub const fn cnt(&self) -> &CNT {
64 &self.cnt
65 }
66 ///0x28 - prescaler
67 #[inline(always)]
68 pub const fn psc(&self) -> &PSC {
69 &self.psc
70 }
71 ///0x2c - auto-reload register
72 #[inline(always)]
73 pub const fn arr(&self) -> &ARR {
74 &self.arr
75 }
76 ///0x34..0x3c - capture/compare register
77 ///
78 ///<div class="warning">`n` is the index of register in the array. `n == 0` corresponds to `CCR1` register.</div>
79 #[inline(always)]
80 pub const fn ccr(&self, n: usize) -> &CCR {
81 &self.ccr[n]
82 }
83 ///Iterator for array of:
84 ///0x34..0x3c - capture/compare register
85 #[inline(always)]
86 pub fn ccr_iter(&self) -> impl Iterator<Item = &CCR> {
87 self.ccr.iter()
88 }
89 ///0x34 - capture/compare register
90 #[inline(always)]
91 pub const fn ccr1(&self) -> &CCR {
92 self.ccr(0)
93 }
94 ///0x38 - capture/compare register
95 #[inline(always)]
96 pub const fn ccr2(&self) -> &CCR {
97 self.ccr(1)
98 }
99}
100/**CR1 (rw) register accessor: control register 1
101
102You can [`read`](crate::Reg::read) this register and get [`cr1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
103
104See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:CR1)
105
106For information about available fields see [`mod@cr1`]
107module*/
108pub type CR1 = crate::Reg<cr1::CR1rs>;
109///control register 1
110pub mod cr1;
111/**SMCR (rw) register accessor: slave mode control register
112
113You can [`read`](crate::Reg::read) this register and get [`smcr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`smcr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
114
115See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:SMCR)
116
117For information about available fields see [`mod@smcr`]
118module*/
119pub type SMCR = crate::Reg<smcr::SMCRrs>;
120///slave mode control register
121pub mod smcr;
122/**DIER (rw) register accessor: DMA/Interrupt enable register
123
124You can [`read`](crate::Reg::read) this register and get [`dier::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`dier::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
125
126See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:DIER)
127
128For information about available fields see [`mod@dier`]
129module*/
130pub type DIER = crate::Reg<dier::DIERrs>;
131///DMA/Interrupt enable register
132pub mod dier;
133/**SR (rw) register accessor: status register
134
135You can [`read`](crate::Reg::read) this register and get [`sr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
136
137See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:SR)
138
139For information about available fields see [`mod@sr`]
140module*/
141pub type SR = crate::Reg<sr::SRrs>;
142///status register
143pub mod sr;
144/**EGR (w) register accessor: event generation register
145
146You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`egr::W`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
147
148See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:EGR)
149
150For information about available fields see [`mod@egr`]
151module*/
152pub type EGR = crate::Reg<egr::EGRrs>;
153///event generation register
154pub mod egr;
155/**CCMR1_Output (rw) register accessor: capture/compare mode register (output mode)
156
157You can [`read`](crate::Reg::read) this register and get [`ccmr1_output::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccmr1_output::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
158
159See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:CCMR1_Output)
160
161For information about available fields see [`mod@ccmr1_output`]
162module*/
163#[doc(alias = "CCMR1_Output")]
164pub type CCMR1_OUTPUT = crate::Reg<ccmr1_output::CCMR1_OUTPUTrs>;
165///capture/compare mode register (output mode)
166pub mod ccmr1_output;
167/**CCMR1_Input (rw) register accessor: capture/compare mode register 1 (input mode)
168
169You can [`read`](crate::Reg::read) this register and get [`ccmr1_input::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccmr1_input::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
170
171See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:CCMR1_Input)
172
173For information about available fields see [`mod@ccmr1_input`]
174module*/
175#[doc(alias = "CCMR1_Input")]
176pub type CCMR1_INPUT = crate::Reg<ccmr1_input::CCMR1_INPUTrs>;
177///capture/compare mode register 1 (input mode)
178pub mod ccmr1_input;
179/**CCER (rw) register accessor: capture/compare enable register
180
181You can [`read`](crate::Reg::read) this register and get [`ccer::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ccer::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
182
183See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:CCER)
184
185For information about available fields see [`mod@ccer`]
186module*/
187pub type CCER = crate::Reg<ccer::CCERrs>;
188///capture/compare enable register
189pub mod ccer;
190/**CNT (rw) register accessor: counter
191
192You can [`read`](crate::Reg::read) this register and get [`cnt::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cnt::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
193
194See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:CNT)
195
196For information about available fields see [`mod@cnt`]
197module*/
198pub type CNT = crate::Reg<cnt::CNTrs>;
199///counter
200pub mod cnt;
201/**PSC (rw) register accessor: prescaler
202
203You can [`read`](crate::Reg::read) this register and get [`psc::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`psc::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
204
205See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:PSC)
206
207For information about available fields see [`mod@psc`]
208module*/
209pub type PSC = crate::Reg<psc::PSCrs>;
210///prescaler
211pub mod psc;
212/**ARR (rw) register accessor: auto-reload register
213
214You can [`read`](crate::Reg::read) this register and get [`arr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`arr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
215
216See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:ARR)
217
218For information about available fields see [`mod@arr`]
219module*/
220pub type ARR = crate::Reg<arr::ARRrs>;
221///auto-reload register
222pub mod arr;
223/**CCR (rw) register accessor: capture/compare register
224
225You 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).
226
227See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F373.html#TIM12:CCR[1])
228
229For information about available fields see [`mod@ccr`]
230module*/
231pub type CCR = crate::Reg<ccr::CCRrs>;
232///capture/compare register
233pub mod ccr;