1#![allow(clippy::identity_op)]
21#![allow(clippy::module_inception)]
22#![allow(clippy::derivable_impls)]
23#[allow(unused_imports)]
24use crate::common::sealed;
25#[allow(unused_imports)]
26use crate::common::*;
27#[doc = r"12-bit D/A converter"]
28unsafe impl ::core::marker::Send for super::Dac12 {}
29unsafe impl ::core::marker::Sync for super::Dac12 {}
30impl super::Dac12 {
31 #[allow(unused)]
32 #[inline(always)]
33 pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34 self.ptr
35 }
36 #[doc = "D/A Data Register 0"]
37 #[inline(always)]
38 pub const fn dadr0(&self) -> &'static crate::common::Reg<self::Dadr0_SPEC, crate::common::RW> {
39 unsafe {
40 crate::common::Reg::<self::Dadr0_SPEC, crate::common::RW>::from_ptr(
41 self._svd2pac_as_ptr().add(0usize),
42 )
43 }
44 }
45
46 #[doc = "D/A Control Register"]
47 #[inline(always)]
48 pub const fn dacr(&self) -> &'static crate::common::Reg<self::Dacr_SPEC, crate::common::RW> {
49 unsafe {
50 crate::common::Reg::<self::Dacr_SPEC, crate::common::RW>::from_ptr(
51 self._svd2pac_as_ptr().add(4usize),
52 )
53 }
54 }
55
56 #[doc = "DADR0 Format Select Register"]
57 #[inline(always)]
58 pub const fn dadpr(&self) -> &'static crate::common::Reg<self::Dadpr_SPEC, crate::common::RW> {
59 unsafe {
60 crate::common::Reg::<self::Dadpr_SPEC, crate::common::RW>::from_ptr(
61 self._svd2pac_as_ptr().add(5usize),
62 )
63 }
64 }
65
66 #[doc = "D/A A/D Synchronous Start Control Register"]
67 #[inline(always)]
68 pub const fn daadscr(
69 &self,
70 ) -> &'static crate::common::Reg<self::Daadscr_SPEC, crate::common::RW> {
71 unsafe {
72 crate::common::Reg::<self::Daadscr_SPEC, crate::common::RW>::from_ptr(
73 self._svd2pac_as_ptr().add(6usize),
74 )
75 }
76 }
77
78 #[doc = "D/A Output Amplifier Control Register"]
79 #[inline(always)]
80 pub const fn daampcr(
81 &self,
82 ) -> &'static crate::common::Reg<self::Daampcr_SPEC, crate::common::RW> {
83 unsafe {
84 crate::common::Reg::<self::Daampcr_SPEC, crate::common::RW>::from_ptr(
85 self._svd2pac_as_ptr().add(8usize),
86 )
87 }
88 }
89
90 #[doc = "D/A Amplifier Stabilization Wait Control Register"]
91 #[inline(always)]
92 pub const fn daaswcr(
93 &self,
94 ) -> &'static crate::common::Reg<self::Daaswcr_SPEC, crate::common::RW> {
95 unsafe {
96 crate::common::Reg::<self::Daaswcr_SPEC, crate::common::RW>::from_ptr(
97 self._svd2pac_as_ptr().add(28usize),
98 )
99 }
100 }
101
102 #[doc = "D/A A/D Synchronous Unit Select Register"]
103 #[inline(always)]
104 pub const fn daadusr(
105 &self,
106 ) -> &'static crate::common::Reg<self::Daadusr_SPEC, crate::common::RW> {
107 unsafe {
108 crate::common::Reg::<self::Daadusr_SPEC, crate::common::RW>::from_ptr(
109 self._svd2pac_as_ptr().add(4288usize),
110 )
111 }
112 }
113}
114#[doc(hidden)]
115#[derive(Copy, Clone, Eq, PartialEq)]
116pub struct Dadr0_SPEC;
117impl crate::sealed::RegSpec for Dadr0_SPEC {
118 type DataType = u16;
119}
120#[doc = "D/A Data Register 0"]
121pub type Dadr0 = crate::RegValueT<Dadr0_SPEC>;
122
123impl NoBitfieldReg<Dadr0_SPEC> for Dadr0 {}
124impl ::core::default::Default for Dadr0 {
125 #[inline(always)]
126 fn default() -> Dadr0 {
127 <crate::RegValueT<Dadr0_SPEC> as RegisterValue<_>>::new(0)
128 }
129}
130
131#[doc(hidden)]
132#[derive(Copy, Clone, Eq, PartialEq)]
133pub struct Dacr_SPEC;
134impl crate::sealed::RegSpec for Dacr_SPEC {
135 type DataType = u8;
136}
137#[doc = "D/A Control Register"]
138pub type Dacr = crate::RegValueT<Dacr_SPEC>;
139
140impl Dacr {
141 #[doc = "D/A Output Enable 0"]
142 #[inline(always)]
143 pub fn daoe0(
144 self,
145 ) -> crate::common::RegisterField<6, 0x1, 1, 0, dacr::Daoe0, Dacr_SPEC, crate::common::RW> {
146 crate::common::RegisterField::<6,0x1,1,0,dacr::Daoe0, Dacr_SPEC,crate::common::RW>::from_register(self,0)
147 }
148}
149impl ::core::default::Default for Dacr {
150 #[inline(always)]
151 fn default() -> Dacr {
152 <crate::RegValueT<Dacr_SPEC> as RegisterValue<_>>::new(31)
153 }
154}
155pub mod dacr {
156
157 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
158 pub struct Daoe0_SPEC;
159 pub type Daoe0 = crate::EnumBitfieldStruct<u8, Daoe0_SPEC>;
160 impl Daoe0 {
161 #[doc = "Disable D/A conversion and analog output of channel 0 (DA0)"]
162 pub const _0: Self = Self::new(0);
163 #[doc = "Enable D/A conversion and analog output of channel 0 (DA0)"]
164 pub const _1: Self = Self::new(1);
165 }
166}
167#[doc(hidden)]
168#[derive(Copy, Clone, Eq, PartialEq)]
169pub struct Dadpr_SPEC;
170impl crate::sealed::RegSpec for Dadpr_SPEC {
171 type DataType = u8;
172}
173#[doc = "DADR0 Format Select Register"]
174pub type Dadpr = crate::RegValueT<Dadpr_SPEC>;
175
176impl Dadpr {
177 #[doc = "DADR0 Format Select"]
178 #[inline(always)]
179 pub fn dpsel(
180 self,
181 ) -> crate::common::RegisterField<7, 0x1, 1, 0, dadpr::Dpsel, Dadpr_SPEC, crate::common::RW>
182 {
183 crate::common::RegisterField::<7,0x1,1,0,dadpr::Dpsel, Dadpr_SPEC,crate::common::RW>::from_register(self,0)
184 }
185}
186impl ::core::default::Default for Dadpr {
187 #[inline(always)]
188 fn default() -> Dadpr {
189 <crate::RegValueT<Dadpr_SPEC> as RegisterValue<_>>::new(0)
190 }
191}
192pub mod dadpr {
193
194 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
195 pub struct Dpsel_SPEC;
196 pub type Dpsel = crate::EnumBitfieldStruct<u8, Dpsel_SPEC>;
197 impl Dpsel {
198 #[doc = "Right-justified format"]
199 pub const _0: Self = Self::new(0);
200 #[doc = "Left-justified format"]
201 pub const _1: Self = Self::new(1);
202 }
203}
204#[doc(hidden)]
205#[derive(Copy, Clone, Eq, PartialEq)]
206pub struct Daadscr_SPEC;
207impl crate::sealed::RegSpec for Daadscr_SPEC {
208 type DataType = u8;
209}
210#[doc = "D/A A/D Synchronous Start Control Register"]
211pub type Daadscr = crate::RegValueT<Daadscr_SPEC>;
212
213impl Daadscr {
214 #[doc = "D/A A/D Synchronous Conversion"]
215 #[inline(always)]
216 pub fn daadst(
217 self,
218 ) -> crate::common::RegisterField<7, 0x1, 1, 0, daadscr::Daadst, Daadscr_SPEC, crate::common::RW>
219 {
220 crate::common::RegisterField::<7,0x1,1,0,daadscr::Daadst, Daadscr_SPEC,crate::common::RW>::from_register(self,0)
221 }
222}
223impl ::core::default::Default for Daadscr {
224 #[inline(always)]
225 fn default() -> Daadscr {
226 <crate::RegValueT<Daadscr_SPEC> as RegisterValue<_>>::new(0)
227 }
228}
229pub mod daadscr {
230
231 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
232 pub struct Daadst_SPEC;
233 pub type Daadst = crate::EnumBitfieldStruct<u8, Daadst_SPEC>;
234 impl Daadst {
235 #[doc = "Do not synchronize DAC12 with ADC12 operation (disable interference reduction between D/A and A/D conversion)."]
236 pub const _0: Self = Self::new(0);
237 #[doc = "Synchronize DAC12 with ADC12 operation (enable interference reduction between D/A and A/D conversion)."]
238 pub const _1: Self = Self::new(1);
239 }
240}
241#[doc(hidden)]
242#[derive(Copy, Clone, Eq, PartialEq)]
243pub struct Daampcr_SPEC;
244impl crate::sealed::RegSpec for Daampcr_SPEC {
245 type DataType = u8;
246}
247#[doc = "D/A Output Amplifier Control Register"]
248pub type Daampcr = crate::RegValueT<Daampcr_SPEC>;
249
250impl Daampcr {
251 #[doc = "Amplifier Control 0"]
252 #[inline(always)]
253 pub fn daamp0(
254 self,
255 ) -> crate::common::RegisterField<6, 0x1, 1, 0, daampcr::Daamp0, Daampcr_SPEC, crate::common::RW>
256 {
257 crate::common::RegisterField::<6,0x1,1,0,daampcr::Daamp0, Daampcr_SPEC,crate::common::RW>::from_register(self,0)
258 }
259}
260impl ::core::default::Default for Daampcr {
261 #[inline(always)]
262 fn default() -> Daampcr {
263 <crate::RegValueT<Daampcr_SPEC> as RegisterValue<_>>::new(0)
264 }
265}
266pub mod daampcr {
267
268 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
269 pub struct Daamp0_SPEC;
270 pub type Daamp0 = crate::EnumBitfieldStruct<u8, Daamp0_SPEC>;
271 impl Daamp0 {
272 #[doc = "Do not use channel 0 output amplifier"]
273 pub const _0: Self = Self::new(0);
274 #[doc = "Use channel 0 output amplifier"]
275 pub const _1: Self = Self::new(1);
276 }
277}
278#[doc(hidden)]
279#[derive(Copy, Clone, Eq, PartialEq)]
280pub struct Daaswcr_SPEC;
281impl crate::sealed::RegSpec for Daaswcr_SPEC {
282 type DataType = u8;
283}
284#[doc = "D/A Amplifier Stabilization Wait Control Register"]
285pub type Daaswcr = crate::RegValueT<Daaswcr_SPEC>;
286
287impl Daaswcr {
288 #[doc = "D/A Amplifier Stabilization Wait 0"]
289 #[inline(always)]
290 pub fn daasw0(
291 self,
292 ) -> crate::common::RegisterField<6, 0x1, 1, 0, daaswcr::Daasw0, Daaswcr_SPEC, crate::common::RW>
293 {
294 crate::common::RegisterField::<6,0x1,1,0,daaswcr::Daasw0, Daaswcr_SPEC,crate::common::RW>::from_register(self,0)
295 }
296}
297impl ::core::default::Default for Daaswcr {
298 #[inline(always)]
299 fn default() -> Daaswcr {
300 <crate::RegValueT<Daaswcr_SPEC> as RegisterValue<_>>::new(0)
301 }
302}
303pub mod daaswcr {
304
305 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
306 pub struct Daasw0_SPEC;
307 pub type Daasw0 = crate::EnumBitfieldStruct<u8, Daasw0_SPEC>;
308 impl Daasw0 {
309 #[doc = "Amplifier stabilization wait off (output) for channel 0"]
310 pub const _0: Self = Self::new(0);
311 #[doc = "Amplifier stabilization wait on (high-Z) for channel 0"]
312 pub const _1: Self = Self::new(1);
313 }
314}
315#[doc(hidden)]
316#[derive(Copy, Clone, Eq, PartialEq)]
317pub struct Daadusr_SPEC;
318impl crate::sealed::RegSpec for Daadusr_SPEC {
319 type DataType = u8;
320}
321#[doc = "D/A A/D Synchronous Unit Select Register"]
322pub type Daadusr = crate::RegValueT<Daadusr_SPEC>;
323
324impl Daadusr {
325 #[doc = "A/D Unit 0 Select"]
326 #[inline(always)]
327 pub fn amadsel0(
328 self,
329 ) -> crate::common::RegisterField<
330 0,
331 0x1,
332 1,
333 0,
334 daadusr::Amadsel0,
335 Daadusr_SPEC,
336 crate::common::RW,
337 > {
338 crate::common::RegisterField::<
339 0,
340 0x1,
341 1,
342 0,
343 daadusr::Amadsel0,
344 Daadusr_SPEC,
345 crate::common::RW,
346 >::from_register(self, 0)
347 }
348}
349impl ::core::default::Default for Daadusr {
350 #[inline(always)]
351 fn default() -> Daadusr {
352 <crate::RegValueT<Daadusr_SPEC> as RegisterValue<_>>::new(0)
353 }
354}
355pub mod daadusr {
356
357 #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
358 pub struct Amadsel0_SPEC;
359 pub type Amadsel0 = crate::EnumBitfieldStruct<u8, Amadsel0_SPEC>;
360 impl Amadsel0 {
361 #[doc = "Do not select unit 0"]
362 pub const _0: Self = Self::new(0);
363 #[doc = "Select unit 0"]
364 pub const _1: Self = Self::new(1);
365 }
366}