stm32f7/stm32f733/
adc2.rs

1#[repr(C)]
2#[derive(Debug)]
3///Register block
4pub struct RegisterBlock {
5    sr: SR,
6    cr1: CR1,
7    cr2: CR2,
8    smpr1: SMPR1,
9    smpr2: SMPR2,
10    jofr: [JOFR; 4],
11    htr: HTR,
12    ltr: LTR,
13    sqr1: SQR1,
14    sqr2: SQR2,
15    sqr3: SQR3,
16    jsqr: JSQR,
17    jdr: [JDR; 4],
18    dr: DR,
19}
20impl RegisterBlock {
21    ///0x00 - status register
22    #[inline(always)]
23    pub const fn sr(&self) -> &SR {
24        &self.sr
25    }
26    ///0x04 - control register 1
27    #[inline(always)]
28    pub const fn cr1(&self) -> &CR1 {
29        &self.cr1
30    }
31    ///0x08 - control register 2
32    #[inline(always)]
33    pub const fn cr2(&self) -> &CR2 {
34        &self.cr2
35    }
36    ///0x0c - sample time register 1
37    #[inline(always)]
38    pub const fn smpr1(&self) -> &SMPR1 {
39        &self.smpr1
40    }
41    ///0x10 - sample time register 2
42    #[inline(always)]
43    pub const fn smpr2(&self) -> &SMPR2 {
44        &self.smpr2
45    }
46    ///0x14..0x24 - injected channel data offset register %s
47    ///
48    ///<div class="warning">`n` is the index of register in the array. `n == 0` corresponds to `JOFR1` register.</div>
49    #[inline(always)]
50    pub const fn jofr(&self, n: usize) -> &JOFR {
51        &self.jofr[n]
52    }
53    ///Iterator for array of:
54    ///0x14..0x24 - injected channel data offset register %s
55    #[inline(always)]
56    pub fn jofr_iter(&self) -> impl Iterator<Item = &JOFR> {
57        self.jofr.iter()
58    }
59    ///0x14 - injected channel data offset register 1
60    #[inline(always)]
61    pub const fn jofr1(&self) -> &JOFR {
62        self.jofr(0)
63    }
64    ///0x18 - injected channel data offset register 2
65    #[inline(always)]
66    pub const fn jofr2(&self) -> &JOFR {
67        self.jofr(1)
68    }
69    ///0x1c - injected channel data offset register 3
70    #[inline(always)]
71    pub const fn jofr3(&self) -> &JOFR {
72        self.jofr(2)
73    }
74    ///0x20 - injected channel data offset register 4
75    #[inline(always)]
76    pub const fn jofr4(&self) -> &JOFR {
77        self.jofr(3)
78    }
79    ///0x24 - watchdog higher threshold register
80    #[inline(always)]
81    pub const fn htr(&self) -> &HTR {
82        &self.htr
83    }
84    ///0x28 - watchdog lower threshold register
85    #[inline(always)]
86    pub const fn ltr(&self) -> &LTR {
87        &self.ltr
88    }
89    ///0x2c - regular sequence register 1
90    #[inline(always)]
91    pub const fn sqr1(&self) -> &SQR1 {
92        &self.sqr1
93    }
94    ///0x30 - regular sequence register 2
95    #[inline(always)]
96    pub const fn sqr2(&self) -> &SQR2 {
97        &self.sqr2
98    }
99    ///0x34 - regular sequence register 3
100    #[inline(always)]
101    pub const fn sqr3(&self) -> &SQR3 {
102        &self.sqr3
103    }
104    ///0x38 - injected sequence register
105    #[inline(always)]
106    pub const fn jsqr(&self) -> &JSQR {
107        &self.jsqr
108    }
109    ///0x3c..0x4c - injected data register x
110    ///
111    ///<div class="warning">`n` is the index of register in the array. `n == 0` corresponds to `JDR1` register.</div>
112    #[inline(always)]
113    pub const fn jdr(&self, n: usize) -> &JDR {
114        &self.jdr[n]
115    }
116    ///Iterator for array of:
117    ///0x3c..0x4c - injected data register x
118    #[inline(always)]
119    pub fn jdr_iter(&self) -> impl Iterator<Item = &JDR> {
120        self.jdr.iter()
121    }
122    ///0x3c - injected data register x
123    #[inline(always)]
124    pub const fn jdr1(&self) -> &JDR {
125        self.jdr(0)
126    }
127    ///0x40 - injected data register x
128    #[inline(always)]
129    pub const fn jdr2(&self) -> &JDR {
130        self.jdr(1)
131    }
132    ///0x44 - injected data register x
133    #[inline(always)]
134    pub const fn jdr3(&self) -> &JDR {
135        self.jdr(2)
136    }
137    ///0x48 - injected data register x
138    #[inline(always)]
139    pub const fn jdr4(&self) -> &JDR {
140        self.jdr(3)
141    }
142    ///0x4c - regular data register
143    #[inline(always)]
144    pub const fn dr(&self) -> &DR {
145        &self.dr
146    }
147}
148/**SR (rw) register accessor: status register
149
150You 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).
151
152See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:SR)
153
154For information about available fields see [`mod@sr`] module*/
155pub type SR = crate::Reg<sr::SRrs>;
156///status register
157pub mod sr;
158/**CR1 (rw) register accessor: control register 1
159
160You 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).
161
162See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:CR1)
163
164For information about available fields see [`mod@cr1`] module*/
165pub type CR1 = crate::Reg<cr1::CR1rs>;
166///control register 1
167pub mod cr1;
168/**CR2 (rw) register accessor: control register 2
169
170You can [`read`](crate::Reg::read) this register and get [`cr2::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cr2::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
171
172See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:CR2)
173
174For information about available fields see [`mod@cr2`] module*/
175pub type CR2 = crate::Reg<cr2::CR2rs>;
176///control register 2
177pub mod cr2;
178/**SMPR1 (rw) register accessor: sample time register 1
179
180You can [`read`](crate::Reg::read) this register and get [`smpr1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`smpr1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
181
182See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:SMPR1)
183
184For information about available fields see [`mod@smpr1`] module*/
185pub type SMPR1 = crate::Reg<smpr1::SMPR1rs>;
186///sample time register 1
187pub mod smpr1;
188/**SMPR2 (rw) register accessor: sample time register 2
189
190You can [`read`](crate::Reg::read) this register and get [`smpr2::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`smpr2::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
191
192See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:SMPR2)
193
194For information about available fields see [`mod@smpr2`] module*/
195pub type SMPR2 = crate::Reg<smpr2::SMPR2rs>;
196///sample time register 2
197pub mod smpr2;
198/**JOFR (rw) register accessor: injected channel data offset register %s
199
200You can [`read`](crate::Reg::read) this register and get [`jofr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`jofr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
201
202See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:JOFR[1])
203
204For information about available fields see [`mod@jofr`] module*/
205pub type JOFR = crate::Reg<jofr::JOFRrs>;
206///injected channel data offset register %s
207pub mod jofr;
208/**HTR (rw) register accessor: watchdog higher threshold register
209
210You can [`read`](crate::Reg::read) this register and get [`htr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`htr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
211
212See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:HTR)
213
214For information about available fields see [`mod@htr`] module*/
215pub type HTR = crate::Reg<htr::HTRrs>;
216///watchdog higher threshold register
217pub mod htr;
218/**LTR (rw) register accessor: watchdog lower threshold register
219
220You can [`read`](crate::Reg::read) this register and get [`ltr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ltr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
221
222See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:LTR)
223
224For information about available fields see [`mod@ltr`] module*/
225pub type LTR = crate::Reg<ltr::LTRrs>;
226///watchdog lower threshold register
227pub mod ltr;
228/**SQR1 (rw) register accessor: regular sequence register 1
229
230You can [`read`](crate::Reg::read) this register and get [`sqr1::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sqr1::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
231
232See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:SQR1)
233
234For information about available fields see [`mod@sqr1`] module*/
235pub type SQR1 = crate::Reg<sqr1::SQR1rs>;
236///regular sequence register 1
237pub mod sqr1;
238/**SQR2 (rw) register accessor: regular sequence register 2
239
240You can [`read`](crate::Reg::read) this register and get [`sqr2::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sqr2::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
241
242See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:SQR2)
243
244For information about available fields see [`mod@sqr2`] module*/
245pub type SQR2 = crate::Reg<sqr2::SQR2rs>;
246///regular sequence register 2
247pub mod sqr2;
248/**SQR3 (rw) register accessor: regular sequence register 3
249
250You can [`read`](crate::Reg::read) this register and get [`sqr3::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sqr3::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
251
252See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:SQR3)
253
254For information about available fields see [`mod@sqr3`] module*/
255pub type SQR3 = crate::Reg<sqr3::SQR3rs>;
256///regular sequence register 3
257pub mod sqr3;
258/**JSQR (rw) register accessor: injected sequence register
259
260You can [`read`](crate::Reg::read) this register and get [`jsqr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`jsqr::W`]. You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
261
262See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:JSQR)
263
264For information about available fields see [`mod@jsqr`] module*/
265pub type JSQR = crate::Reg<jsqr::JSQRrs>;
266///injected sequence register
267pub mod jsqr;
268/**JDR (r) register accessor: injected data register x
269
270You can [`read`](crate::Reg::read) this register and get [`jdr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
271
272See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:JDR[1])
273
274For information about available fields see [`mod@jdr`] module*/
275pub type JDR = crate::Reg<jdr::JDRrs>;
276///injected data register x
277pub mod jdr;
278/**DR (r) register accessor: regular data register
279
280You can [`read`](crate::Reg::read) this register and get [`dr::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
281
282See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F733.html#ADC2:DR)
283
284For information about available fields see [`mod@dr`] module*/
285pub type DR = crate::Reg<dr::DRrs>;
286///regular data register
287pub mod dr;