mimxrt685s_pac/
adc0.rs

1#[repr(C)]
2#[cfg_attr(feature = "debug", derive(Debug))]
3#[doc = "Register block"]
4pub struct RegisterBlock {
5    verid: Verid,
6    param: Param,
7    _reserved2: [u8; 0x08],
8    ctrl: Ctrl,
9    stat: Stat,
10    ie: Ie,
11    de: De,
12    cfg: Cfg,
13    pause: Pause,
14    _reserved8: [u8; 0x08],
15    fctrl: Fctrl,
16    swtrig: Swtrig,
17    _reserved10: [u8; 0x88],
18    tctrl: [Tctrl; 16],
19    cmdl: (),
20    _reserved12: [u8; 0x04],
21    cmdh: (),
22    _reserved13: [u8; 0xfc],
23    cv: [Cv; 4],
24    _reserved14: [u8; 0xf0],
25    resfifo: Resfifo,
26}
27impl RegisterBlock {
28    #[doc = "0x00 - Version ID Register"]
29    #[inline(always)]
30    pub const fn verid(&self) -> &Verid {
31        &self.verid
32    }
33    #[doc = "0x04 - Parameter Register"]
34    #[inline(always)]
35    pub const fn param(&self) -> &Param {
36        &self.param
37    }
38    #[doc = "0x10 - ADC Control Register"]
39    #[inline(always)]
40    pub const fn ctrl(&self) -> &Ctrl {
41        &self.ctrl
42    }
43    #[doc = "0x14 - ADC Status Register"]
44    #[inline(always)]
45    pub const fn stat(&self) -> &Stat {
46        &self.stat
47    }
48    #[doc = "0x18 - Interrupt Enable Register"]
49    #[inline(always)]
50    pub const fn ie(&self) -> &Ie {
51        &self.ie
52    }
53    #[doc = "0x1c - DMA Enable Register"]
54    #[inline(always)]
55    pub const fn de(&self) -> &De {
56        &self.de
57    }
58    #[doc = "0x20 - ADC Configuration Register"]
59    #[inline(always)]
60    pub const fn cfg(&self) -> &Cfg {
61        &self.cfg
62    }
63    #[doc = "0x24 - ADC Pause Register"]
64    #[inline(always)]
65    pub const fn pause(&self) -> &Pause {
66        &self.pause
67    }
68    #[doc = "0x30 - ADC FIFO Control Register"]
69    #[inline(always)]
70    pub const fn fctrl(&self) -> &Fctrl {
71        &self.fctrl
72    }
73    #[doc = "0x34 - Software Trigger Register"]
74    #[inline(always)]
75    pub const fn swtrig(&self) -> &Swtrig {
76        &self.swtrig
77    }
78    #[doc = "0xc0..0x100 - Trigger Control Register"]
79    #[inline(always)]
80    pub const fn tctrl(&self, n: usize) -> &Tctrl {
81        &self.tctrl[n]
82    }
83    #[doc = "Iterator for array of:"]
84    #[doc = "0xc0..0x100 - Trigger Control Register"]
85    #[inline(always)]
86    pub fn tctrl_iter(&self) -> impl Iterator<Item = &Tctrl> {
87        self.tctrl.iter()
88    }
89    #[doc = "0x100..0x13c - ADC Command Low Buffer Register"]
90    #[doc = ""]
91    #[doc = "<div class=\"warning\">`n` is the index of register in the array. `n == 0` corresponds to `CMDL1` register.</div>"]
92    #[inline(always)]
93    pub const fn cmdl(&self, n: usize) -> &Cmdl {
94        #[allow(clippy::no_effect)]
95        [(); 15][n];
96        unsafe {
97            &*core::ptr::from_ref(self)
98                .cast::<u8>()
99                .add(256)
100                .add(8 * n)
101                .cast()
102        }
103    }
104    #[doc = "Iterator for array of:"]
105    #[doc = "0x100..0x13c - ADC Command Low Buffer Register"]
106    #[inline(always)]
107    pub fn cmdl_iter(&self) -> impl Iterator<Item = &Cmdl> {
108        (0..15).map(move |n| unsafe {
109            &*core::ptr::from_ref(self)
110                .cast::<u8>()
111                .add(256)
112                .add(8 * n)
113                .cast()
114        })
115    }
116    #[doc = "0x100 - ADC Command Low Buffer Register"]
117    #[inline(always)]
118    pub const fn cmdl1(&self) -> &Cmdl {
119        self.cmdl(0)
120    }
121    #[doc = "0x108 - ADC Command Low Buffer Register"]
122    #[inline(always)]
123    pub const fn cmdl2(&self) -> &Cmdl {
124        self.cmdl(1)
125    }
126    #[doc = "0x110 - ADC Command Low Buffer Register"]
127    #[inline(always)]
128    pub const fn cmdl3(&self) -> &Cmdl {
129        self.cmdl(2)
130    }
131    #[doc = "0x118 - ADC Command Low Buffer Register"]
132    #[inline(always)]
133    pub const fn cmdl4(&self) -> &Cmdl {
134        self.cmdl(3)
135    }
136    #[doc = "0x120 - ADC Command Low Buffer Register"]
137    #[inline(always)]
138    pub const fn cmdl5(&self) -> &Cmdl {
139        self.cmdl(4)
140    }
141    #[doc = "0x128 - ADC Command Low Buffer Register"]
142    #[inline(always)]
143    pub const fn cmdl6(&self) -> &Cmdl {
144        self.cmdl(5)
145    }
146    #[doc = "0x130 - ADC Command Low Buffer Register"]
147    #[inline(always)]
148    pub const fn cmdl7(&self) -> &Cmdl {
149        self.cmdl(6)
150    }
151    #[doc = "0x138 - ADC Command Low Buffer Register"]
152    #[inline(always)]
153    pub const fn cmdl8(&self) -> &Cmdl {
154        self.cmdl(7)
155    }
156    #[doc = "0x140 - ADC Command Low Buffer Register"]
157    #[inline(always)]
158    pub const fn cmdl9(&self) -> &Cmdl {
159        self.cmdl(8)
160    }
161    #[doc = "0x148 - ADC Command Low Buffer Register"]
162    #[inline(always)]
163    pub const fn cmdl10(&self) -> &Cmdl {
164        self.cmdl(9)
165    }
166    #[doc = "0x150 - ADC Command Low Buffer Register"]
167    #[inline(always)]
168    pub const fn cmdl11(&self) -> &Cmdl {
169        self.cmdl(10)
170    }
171    #[doc = "0x158 - ADC Command Low Buffer Register"]
172    #[inline(always)]
173    pub const fn cmdl12(&self) -> &Cmdl {
174        self.cmdl(11)
175    }
176    #[doc = "0x160 - ADC Command Low Buffer Register"]
177    #[inline(always)]
178    pub const fn cmdl13(&self) -> &Cmdl {
179        self.cmdl(12)
180    }
181    #[doc = "0x168 - ADC Command Low Buffer Register"]
182    #[inline(always)]
183    pub const fn cmdl14(&self) -> &Cmdl {
184        self.cmdl(13)
185    }
186    #[doc = "0x170 - ADC Command Low Buffer Register"]
187    #[inline(always)]
188    pub const fn cmdl15(&self) -> &Cmdl {
189        self.cmdl(14)
190    }
191    #[doc = "0x104..0x140 - ADC Command High Buffer Register"]
192    #[doc = ""]
193    #[doc = "<div class=\"warning\">`n` is the index of register in the array. `n == 0` corresponds to `CMDH1` register.</div>"]
194    #[inline(always)]
195    pub const fn cmdh(&self, n: usize) -> &Cmdh {
196        #[allow(clippy::no_effect)]
197        [(); 15][n];
198        unsafe {
199            &*core::ptr::from_ref(self)
200                .cast::<u8>()
201                .add(260)
202                .add(8 * n)
203                .cast()
204        }
205    }
206    #[doc = "Iterator for array of:"]
207    #[doc = "0x104..0x140 - ADC Command High Buffer Register"]
208    #[inline(always)]
209    pub fn cmdh_iter(&self) -> impl Iterator<Item = &Cmdh> {
210        (0..15).map(move |n| unsafe {
211            &*core::ptr::from_ref(self)
212                .cast::<u8>()
213                .add(260)
214                .add(8 * n)
215                .cast()
216        })
217    }
218    #[doc = "0x104 - ADC Command High Buffer Register"]
219    #[inline(always)]
220    pub const fn cmdh1(&self) -> &Cmdh {
221        self.cmdh(0)
222    }
223    #[doc = "0x10c - ADC Command High Buffer Register"]
224    #[inline(always)]
225    pub const fn cmdh2(&self) -> &Cmdh {
226        self.cmdh(1)
227    }
228    #[doc = "0x114 - ADC Command High Buffer Register"]
229    #[inline(always)]
230    pub const fn cmdh3(&self) -> &Cmdh {
231        self.cmdh(2)
232    }
233    #[doc = "0x11c - ADC Command High Buffer Register"]
234    #[inline(always)]
235    pub const fn cmdh4(&self) -> &Cmdh {
236        self.cmdh(3)
237    }
238    #[doc = "0x124 - ADC Command High Buffer Register"]
239    #[inline(always)]
240    pub const fn cmdh5(&self) -> &Cmdh {
241        self.cmdh(4)
242    }
243    #[doc = "0x12c - ADC Command High Buffer Register"]
244    #[inline(always)]
245    pub const fn cmdh6(&self) -> &Cmdh {
246        self.cmdh(5)
247    }
248    #[doc = "0x134 - ADC Command High Buffer Register"]
249    #[inline(always)]
250    pub const fn cmdh7(&self) -> &Cmdh {
251        self.cmdh(6)
252    }
253    #[doc = "0x13c - ADC Command High Buffer Register"]
254    #[inline(always)]
255    pub const fn cmdh8(&self) -> &Cmdh {
256        self.cmdh(7)
257    }
258    #[doc = "0x144 - ADC Command High Buffer Register"]
259    #[inline(always)]
260    pub const fn cmdh9(&self) -> &Cmdh {
261        self.cmdh(8)
262    }
263    #[doc = "0x14c - ADC Command High Buffer Register"]
264    #[inline(always)]
265    pub const fn cmdh10(&self) -> &Cmdh {
266        self.cmdh(9)
267    }
268    #[doc = "0x154 - ADC Command High Buffer Register"]
269    #[inline(always)]
270    pub const fn cmdh11(&self) -> &Cmdh {
271        self.cmdh(10)
272    }
273    #[doc = "0x15c - ADC Command High Buffer Register"]
274    #[inline(always)]
275    pub const fn cmdh12(&self) -> &Cmdh {
276        self.cmdh(11)
277    }
278    #[doc = "0x164 - ADC Command High Buffer Register"]
279    #[inline(always)]
280    pub const fn cmdh13(&self) -> &Cmdh {
281        self.cmdh(12)
282    }
283    #[doc = "0x16c - ADC Command High Buffer Register"]
284    #[inline(always)]
285    pub const fn cmdh14(&self) -> &Cmdh {
286        self.cmdh(13)
287    }
288    #[doc = "0x174 - ADC Command High Buffer Register"]
289    #[inline(always)]
290    pub const fn cmdh15(&self) -> &Cmdh {
291        self.cmdh(14)
292    }
293    #[doc = "0x200..0x210 - Compare Value Register"]
294    #[doc = ""]
295    #[doc = "<div class=\"warning\">`n` is the index of register in the array. `n == 0` corresponds to `CV1` register.</div>"]
296    #[inline(always)]
297    pub const fn cv(&self, n: usize) -> &Cv {
298        &self.cv[n]
299    }
300    #[doc = "Iterator for array of:"]
301    #[doc = "0x200..0x210 - Compare Value Register"]
302    #[inline(always)]
303    pub fn cv_iter(&self) -> impl Iterator<Item = &Cv> {
304        self.cv.iter()
305    }
306    #[doc = "0x200 - Compare Value Register"]
307    #[inline(always)]
308    pub const fn cv1(&self) -> &Cv {
309        self.cv(0)
310    }
311    #[doc = "0x204 - Compare Value Register"]
312    #[inline(always)]
313    pub const fn cv2(&self) -> &Cv {
314        self.cv(1)
315    }
316    #[doc = "0x208 - Compare Value Register"]
317    #[inline(always)]
318    pub const fn cv3(&self) -> &Cv {
319        self.cv(2)
320    }
321    #[doc = "0x20c - Compare Value Register"]
322    #[inline(always)]
323    pub const fn cv4(&self) -> &Cv {
324        self.cv(3)
325    }
326    #[doc = "0x300 - ADC Data Result FIFO Register"]
327    #[inline(always)]
328    pub const fn resfifo(&self) -> &Resfifo {
329        &self.resfifo
330    }
331}
332#[doc = "VERID (r) register accessor: Version ID Register\n\nYou can [`read`](crate::Reg::read) this register and get [`verid::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@verid`]
333module"]
334#[doc(alias = "VERID")]
335pub type Verid = crate::Reg<verid::VeridSpec>;
336#[doc = "Version ID Register"]
337pub mod verid;
338#[doc = "PARAM (r) register accessor: Parameter Register\n\nYou can [`read`](crate::Reg::read) this register and get [`param::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@param`]
339module"]
340#[doc(alias = "PARAM")]
341pub type Param = crate::Reg<param::ParamSpec>;
342#[doc = "Parameter Register"]
343pub mod param;
344#[doc = "CTRL (rw) register accessor: ADC Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrl::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@ctrl`]
345module"]
346#[doc(alias = "CTRL")]
347pub type Ctrl = crate::Reg<ctrl::CtrlSpec>;
348#[doc = "ADC Control Register"]
349pub mod ctrl;
350#[doc = "STAT (rw) register accessor: ADC Status Register\n\nYou can [`read`](crate::Reg::read) this register and get [`stat::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`stat::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@stat`]
351module"]
352#[doc(alias = "STAT")]
353pub type Stat = crate::Reg<stat::StatSpec>;
354#[doc = "ADC Status Register"]
355pub mod stat;
356#[doc = "IE (rw) register accessor: Interrupt Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`ie::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ie::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@ie`]
357module"]
358#[doc(alias = "IE")]
359pub type Ie = crate::Reg<ie::IeSpec>;
360#[doc = "Interrupt Enable Register"]
361pub mod ie;
362#[doc = "DE (rw) register accessor: DMA Enable Register\n\nYou can [`read`](crate::Reg::read) this register and get [`de::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`de::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@de`]
363module"]
364#[doc(alias = "DE")]
365pub type De = crate::Reg<de::DeSpec>;
366#[doc = "DMA Enable Register"]
367pub mod de;
368#[doc = "CFG (rw) register accessor: ADC Configuration Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cfg::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cfg::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@cfg`]
369module"]
370#[doc(alias = "CFG")]
371pub type Cfg = crate::Reg<cfg::CfgSpec>;
372#[doc = "ADC Configuration Register"]
373pub mod cfg;
374#[doc = "PAUSE (rw) register accessor: ADC Pause Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pause::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pause::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@pause`]
375module"]
376#[doc(alias = "PAUSE")]
377pub type Pause = crate::Reg<pause::PauseSpec>;
378#[doc = "ADC Pause Register"]
379pub mod pause;
380#[doc = "FCTRL (rw) register accessor: ADC FIFO Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`fctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`fctrl::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@fctrl`]
381module"]
382#[doc(alias = "FCTRL")]
383pub type Fctrl = crate::Reg<fctrl::FctrlSpec>;
384#[doc = "ADC FIFO Control Register"]
385pub mod fctrl;
386#[doc = "SWTRIG (rw) register accessor: Software Trigger Register\n\nYou can [`read`](crate::Reg::read) this register and get [`swtrig::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swtrig::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@swtrig`]
387module"]
388#[doc(alias = "SWTRIG")]
389pub type Swtrig = crate::Reg<swtrig::SwtrigSpec>;
390#[doc = "Software Trigger Register"]
391pub mod swtrig;
392#[doc = "TCTRL (rw) register accessor: Trigger Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`tctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`tctrl::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@tctrl`]
393module"]
394#[doc(alias = "TCTRL")]
395pub type Tctrl = crate::Reg<tctrl::TctrlSpec>;
396#[doc = "Trigger Control Register"]
397pub mod tctrl;
398#[doc = "CMDL (rw) register accessor: ADC Command Low Buffer Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmdl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmdl::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@cmdl`]
399module"]
400#[doc(alias = "CMDL")]
401pub type Cmdl = crate::Reg<cmdl::CmdlSpec>;
402#[doc = "ADC Command Low Buffer Register"]
403pub mod cmdl;
404#[doc = "CMDH (rw) register accessor: ADC Command High Buffer Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cmdh::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cmdh::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@cmdh`]
405module"]
406#[doc(alias = "CMDH")]
407pub type Cmdh = crate::Reg<cmdh::CmdhSpec>;
408#[doc = "ADC Command High Buffer Register"]
409pub mod cmdh;
410#[doc = "CV (rw) register accessor: Compare Value Register\n\nYou can [`read`](crate::Reg::read) this register and get [`cv::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`cv::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@cv`]
411module"]
412#[doc(alias = "CV")]
413pub type Cv = crate::Reg<cv::CvSpec>;
414#[doc = "Compare Value Register"]
415pub mod cv;
416#[doc = "RESFIFO (r) register accessor: ADC Data Result FIFO Register\n\nYou can [`read`](crate::Reg::read) this register and get [`resfifo::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@resfifo`]
417module"]
418#[doc(alias = "RESFIFO")]
419pub type Resfifo = crate::Reg<resfifo::ResfifoSpec>;
420#[doc = "ADC Data Result FIFO Register"]
421pub mod resfifo;