atsamd21g/
adc.rs

1#[repr(C)]
2#[doc = "Register block"]
3pub struct RegisterBlock {
4    ctrla: Ctrla,
5    refctrl: Refctrl,
6    avgctrl: Avgctrl,
7    sampctrl: Sampctrl,
8    ctrlb: Ctrlb,
9    _reserved5: [u8; 0x02],
10    winctrl: Winctrl,
11    _reserved6: [u8; 0x03],
12    swtrig: Swtrig,
13    _reserved7: [u8; 0x03],
14    inputctrl: Inputctrl,
15    evctrl: Evctrl,
16    _reserved9: [u8; 0x01],
17    intenclr: Intenclr,
18    intenset: Intenset,
19    intflag: Intflag,
20    status: Status,
21    result: Result,
22    winlt: Winlt,
23    _reserved15: [u8; 0x02],
24    winut: Winut,
25    _reserved16: [u8; 0x02],
26    gaincorr: Gaincorr,
27    offsetcorr: Offsetcorr,
28    calib: Calib,
29    dbgctrl: Dbgctrl,
30}
31impl RegisterBlock {
32    #[doc = "0x00 - Control A"]
33    #[inline(always)]
34    pub const fn ctrla(&self) -> &Ctrla {
35        &self.ctrla
36    }
37    #[doc = "0x01 - Reference Control"]
38    #[inline(always)]
39    pub const fn refctrl(&self) -> &Refctrl {
40        &self.refctrl
41    }
42    #[doc = "0x02 - Average Control"]
43    #[inline(always)]
44    pub const fn avgctrl(&self) -> &Avgctrl {
45        &self.avgctrl
46    }
47    #[doc = "0x03 - Sampling Time Control"]
48    #[inline(always)]
49    pub const fn sampctrl(&self) -> &Sampctrl {
50        &self.sampctrl
51    }
52    #[doc = "0x04 - Control B"]
53    #[inline(always)]
54    pub const fn ctrlb(&self) -> &Ctrlb {
55        &self.ctrlb
56    }
57    #[doc = "0x08 - Window Monitor Control"]
58    #[inline(always)]
59    pub const fn winctrl(&self) -> &Winctrl {
60        &self.winctrl
61    }
62    #[doc = "0x0c - Software Trigger"]
63    #[inline(always)]
64    pub const fn swtrig(&self) -> &Swtrig {
65        &self.swtrig
66    }
67    #[doc = "0x10 - Input Control"]
68    #[inline(always)]
69    pub const fn inputctrl(&self) -> &Inputctrl {
70        &self.inputctrl
71    }
72    #[doc = "0x14 - Event Control"]
73    #[inline(always)]
74    pub const fn evctrl(&self) -> &Evctrl {
75        &self.evctrl
76    }
77    #[doc = "0x16 - Interrupt Enable Clear"]
78    #[inline(always)]
79    pub const fn intenclr(&self) -> &Intenclr {
80        &self.intenclr
81    }
82    #[doc = "0x17 - Interrupt Enable Set"]
83    #[inline(always)]
84    pub const fn intenset(&self) -> &Intenset {
85        &self.intenset
86    }
87    #[doc = "0x18 - Interrupt Flag Status and Clear"]
88    #[inline(always)]
89    pub const fn intflag(&self) -> &Intflag {
90        &self.intflag
91    }
92    #[doc = "0x19 - Status"]
93    #[inline(always)]
94    pub const fn status(&self) -> &Status {
95        &self.status
96    }
97    #[doc = "0x1a - Result"]
98    #[inline(always)]
99    pub const fn result(&self) -> &Result {
100        &self.result
101    }
102    #[doc = "0x1c - Window Monitor Lower Threshold"]
103    #[inline(always)]
104    pub const fn winlt(&self) -> &Winlt {
105        &self.winlt
106    }
107    #[doc = "0x20 - Window Monitor Upper Threshold"]
108    #[inline(always)]
109    pub const fn winut(&self) -> &Winut {
110        &self.winut
111    }
112    #[doc = "0x24 - Gain Correction"]
113    #[inline(always)]
114    pub const fn gaincorr(&self) -> &Gaincorr {
115        &self.gaincorr
116    }
117    #[doc = "0x26 - Offset Correction"]
118    #[inline(always)]
119    pub const fn offsetcorr(&self) -> &Offsetcorr {
120        &self.offsetcorr
121    }
122    #[doc = "0x28 - Calibration"]
123    #[inline(always)]
124    pub const fn calib(&self) -> &Calib {
125        &self.calib
126    }
127    #[doc = "0x2a - Debug Control"]
128    #[inline(always)]
129    pub const fn dbgctrl(&self) -> &Dbgctrl {
130        &self.dbgctrl
131    }
132}
133#[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`]
134module"]
135#[doc(alias = "CTRLA")]
136pub type Ctrla = crate::Reg<ctrla::CtrlaSpec>;
137#[doc = "Control A"]
138pub mod ctrla;
139#[doc = "REFCTRL (rw) register accessor: Reference Control\n\nYou can [`read`](crate::Reg::read) this register and get [`refctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`refctrl::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@refctrl`]
140module"]
141#[doc(alias = "REFCTRL")]
142pub type Refctrl = crate::Reg<refctrl::RefctrlSpec>;
143#[doc = "Reference Control"]
144pub mod refctrl;
145#[doc = "AVGCTRL (rw) register accessor: Average Control\n\nYou can [`read`](crate::Reg::read) this register and get [`avgctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`avgctrl::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@avgctrl`]
146module"]
147#[doc(alias = "AVGCTRL")]
148pub type Avgctrl = crate::Reg<avgctrl::AvgctrlSpec>;
149#[doc = "Average Control"]
150pub mod avgctrl;
151#[doc = "SAMPCTRL (rw) register accessor: Sampling Time Control\n\nYou can [`read`](crate::Reg::read) this register and get [`sampctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sampctrl::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@sampctrl`]
152module"]
153#[doc(alias = "SAMPCTRL")]
154pub type Sampctrl = crate::Reg<sampctrl::SampctrlSpec>;
155#[doc = "Sampling Time Control"]
156pub mod sampctrl;
157#[doc = "CTRLB (rw) register accessor: Control B\n\nYou can [`read`](crate::Reg::read) this register and get [`ctrlb::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ctrlb::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@ctrlb`]
158module"]
159#[doc(alias = "CTRLB")]
160pub type Ctrlb = crate::Reg<ctrlb::CtrlbSpec>;
161#[doc = "Control B"]
162pub mod ctrlb;
163#[doc = "WINCTRL (rw) register accessor: Window Monitor Control\n\nYou can [`read`](crate::Reg::read) this register and get [`winctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`winctrl::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@winctrl`]
164module"]
165#[doc(alias = "WINCTRL")]
166pub type Winctrl = crate::Reg<winctrl::WinctrlSpec>;
167#[doc = "Window Monitor Control"]
168pub mod winctrl;
169#[doc = "SWTRIG (rw) register accessor: Software Trigger\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`]
170module"]
171#[doc(alias = "SWTRIG")]
172pub type Swtrig = crate::Reg<swtrig::SwtrigSpec>;
173#[doc = "Software Trigger"]
174pub mod swtrig;
175#[doc = "INPUTCTRL (rw) register accessor: Input Control\n\nYou can [`read`](crate::Reg::read) this register and get [`inputctrl::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`inputctrl::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@inputctrl`]
176module"]
177#[doc(alias = "INPUTCTRL")]
178pub type Inputctrl = crate::Reg<inputctrl::InputctrlSpec>;
179#[doc = "Input Control"]
180pub mod inputctrl;
181#[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`]
182module"]
183#[doc(alias = "EVCTRL")]
184pub type Evctrl = crate::Reg<evctrl::EvctrlSpec>;
185#[doc = "Event Control"]
186pub mod evctrl;
187#[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`]
188module"]
189#[doc(alias = "INTENCLR")]
190pub type Intenclr = crate::Reg<intenclr::IntenclrSpec>;
191#[doc = "Interrupt Enable Clear"]
192pub mod intenclr;
193#[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`]
194module"]
195#[doc(alias = "INTENSET")]
196pub type Intenset = crate::Reg<intenset::IntensetSpec>;
197#[doc = "Interrupt Enable Set"]
198pub mod intenset;
199#[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`]
200module"]
201#[doc(alias = "INTFLAG")]
202pub type Intflag = crate::Reg<intflag::IntflagSpec>;
203#[doc = "Interrupt Flag Status and Clear"]
204pub mod intflag;
205#[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`]
206module"]
207#[doc(alias = "STATUS")]
208pub type Status = crate::Reg<status::StatusSpec>;
209#[doc = "Status"]
210pub mod status;
211#[doc = "RESULT (r) register accessor: Result\n\nYou can [`read`](crate::Reg::read) this register and get [`result::R`]. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [`mod@result`]
212module"]
213#[doc(alias = "RESULT")]
214pub type Result = crate::Reg<result::ResultSpec>;
215#[doc = "Result"]
216pub mod result;
217#[doc = "WINLT (rw) register accessor: Window Monitor Lower Threshold\n\nYou can [`read`](crate::Reg::read) this register and get [`winlt::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`winlt::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@winlt`]
218module"]
219#[doc(alias = "WINLT")]
220pub type Winlt = crate::Reg<winlt::WinltSpec>;
221#[doc = "Window Monitor Lower Threshold"]
222pub mod winlt;
223#[doc = "WINUT (rw) register accessor: Window Monitor Upper Threshold\n\nYou can [`read`](crate::Reg::read) this register and get [`winut::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`winut::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@winut`]
224module"]
225#[doc(alias = "WINUT")]
226pub type Winut = crate::Reg<winut::WinutSpec>;
227#[doc = "Window Monitor Upper Threshold"]
228pub mod winut;
229#[doc = "GAINCORR (rw) register accessor: Gain Correction\n\nYou can [`read`](crate::Reg::read) this register and get [`gaincorr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`gaincorr::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@gaincorr`]
230module"]
231#[doc(alias = "GAINCORR")]
232pub type Gaincorr = crate::Reg<gaincorr::GaincorrSpec>;
233#[doc = "Gain Correction"]
234pub mod gaincorr;
235#[doc = "OFFSETCORR (rw) register accessor: Offset Correction\n\nYou can [`read`](crate::Reg::read) this register and get [`offsetcorr::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`offsetcorr::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@offsetcorr`]
236module"]
237#[doc(alias = "OFFSETCORR")]
238pub type Offsetcorr = crate::Reg<offsetcorr::OffsetcorrSpec>;
239#[doc = "Offset Correction"]
240pub mod offsetcorr;
241#[doc = "CALIB (rw) register accessor: Calibration\n\nYou can [`read`](crate::Reg::read) this register and get [`calib::R`]. You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`calib::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@calib`]
242module"]
243#[doc(alias = "CALIB")]
244pub type Calib = crate::Reg<calib::CalibSpec>;
245#[doc = "Calibration"]
246pub mod calib;
247#[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`]
248module"]
249#[doc(alias = "DBGCTRL")]
250pub type Dbgctrl = crate::Reg<dbgctrl::DbgctrlSpec>;
251#[doc = "Debug Control"]
252pub mod dbgctrl;