Skip to main content

ra6m2_pac/
dac12.rs

1/*
2DISCLAIMER
3This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
4No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
5applicable laws, including copyright laws.
6THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
7OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
8NON-INFRINGEMENT.  ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
9LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
10INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
11ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
12Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
13of this software. By using this software, you agree to the additional terms and conditions found by accessing the
14following link:
15http://www.renesas.com/disclaimer
16
17*/
18// Generated from SVD 1.2, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:11:44 +0000
19
20#![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
37    #[doc = "D/A Data Register %s"]
38    #[inline(always)]
39    pub const fn dadr(
40        &self,
41    ) -> &'static crate::common::ClusterRegisterArray<
42        crate::common::Reg<self::Dadr_SPEC, crate::common::RW>,
43        2,
44        0x2,
45    > {
46        unsafe {
47            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x0usize))
48        }
49    }
50    #[inline(always)]
51    pub const fn dadr0(&self) -> &'static crate::common::Reg<self::Dadr_SPEC, crate::common::RW> {
52        unsafe {
53            crate::common::Reg::<self::Dadr_SPEC, crate::common::RW>::from_ptr(
54                self._svd2pac_as_ptr().add(0x0usize),
55            )
56        }
57    }
58    #[inline(always)]
59    pub const fn dadr1(&self) -> &'static crate::common::Reg<self::Dadr_SPEC, crate::common::RW> {
60        unsafe {
61            crate::common::Reg::<self::Dadr_SPEC, crate::common::RW>::from_ptr(
62                self._svd2pac_as_ptr().add(0x2usize),
63            )
64        }
65    }
66
67    #[doc = "D/A Control Register"]
68    #[inline(always)]
69    pub const fn dacr(&self) -> &'static crate::common::Reg<self::Dacr_SPEC, crate::common::RW> {
70        unsafe {
71            crate::common::Reg::<self::Dacr_SPEC, crate::common::RW>::from_ptr(
72                self._svd2pac_as_ptr().add(4usize),
73            )
74        }
75    }
76
77    #[doc = "DADRm  Format Select Register"]
78    #[inline(always)]
79    pub const fn dadpr(&self) -> &'static crate::common::Reg<self::Dadpr_SPEC, crate::common::RW> {
80        unsafe {
81            crate::common::Reg::<self::Dadpr_SPEC, crate::common::RW>::from_ptr(
82                self._svd2pac_as_ptr().add(5usize),
83            )
84        }
85    }
86
87    #[doc = "D/A-A/D Synchronous Start Control Register"]
88    #[inline(always)]
89    pub const fn daadscr(
90        &self,
91    ) -> &'static crate::common::Reg<self::Daadscr_SPEC, crate::common::RW> {
92        unsafe {
93            crate::common::Reg::<self::Daadscr_SPEC, crate::common::RW>::from_ptr(
94                self._svd2pac_as_ptr().add(6usize),
95            )
96        }
97    }
98
99    #[doc = "D/A Output Amplifier Control Register"]
100    #[inline(always)]
101    pub const fn daampcr(
102        &self,
103    ) -> &'static crate::common::Reg<self::Daampcr_SPEC, crate::common::RW> {
104        unsafe {
105            crate::common::Reg::<self::Daampcr_SPEC, crate::common::RW>::from_ptr(
106                self._svd2pac_as_ptr().add(8usize),
107            )
108        }
109    }
110
111    #[doc = "D/A Amplifier Stabilization Wait Control Register"]
112    #[inline(always)]
113    pub const fn daaswcr(
114        &self,
115    ) -> &'static crate::common::Reg<self::Daaswcr_SPEC, crate::common::RW> {
116        unsafe {
117            crate::common::Reg::<self::Daaswcr_SPEC, crate::common::RW>::from_ptr(
118                self._svd2pac_as_ptr().add(4124usize),
119            )
120        }
121    }
122}
123#[doc(hidden)]
124#[derive(Copy, Clone, Eq, PartialEq)]
125pub struct Dadr_SPEC;
126impl crate::sealed::RegSpec for Dadr_SPEC {
127    type DataType = u16;
128}
129
130#[doc = "D/A Data Register %s"]
131pub type Dadr = crate::RegValueT<Dadr_SPEC>;
132
133impl Dadr {
134    #[doc = "D/A Data RegisterNOTE: When DADPR.DPSEL = 0, the high-order 4 bits are fixed to 0: right justified format. When DADPR.DPSEL = 1, the low-order 4 bits are fixed to 0: left justified format."]
135    #[inline(always)]
136    pub fn dadr(
137        self,
138    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Dadr_SPEC, crate::common::RW> {
139        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Dadr_SPEC,crate::common::RW>::from_register(self,0)
140    }
141}
142impl ::core::default::Default for Dadr {
143    #[inline(always)]
144    fn default() -> Dadr {
145        <crate::RegValueT<Dadr_SPEC> as RegisterValue<_>>::new(0)
146    }
147}
148
149#[doc(hidden)]
150#[derive(Copy, Clone, Eq, PartialEq)]
151pub struct Dacr_SPEC;
152impl crate::sealed::RegSpec for Dacr_SPEC {
153    type DataType = u8;
154}
155
156#[doc = "D/A Control Register"]
157pub type Dacr = crate::RegValueT<Dacr_SPEC>;
158
159impl Dacr {
160    #[doc = "D/A Output Enable 1"]
161    #[inline(always)]
162    pub fn daoe1(
163        self,
164    ) -> crate::common::RegisterField<
165        7,
166        0x1,
167        1,
168        0,
169        dacr::Daoe1,
170        dacr::Daoe1,
171        Dacr_SPEC,
172        crate::common::RW,
173    > {
174        crate::common::RegisterField::<
175            7,
176            0x1,
177            1,
178            0,
179            dacr::Daoe1,
180            dacr::Daoe1,
181            Dacr_SPEC,
182            crate::common::RW,
183        >::from_register(self, 0)
184    }
185
186    #[doc = "D/A Output Enable 0"]
187    #[inline(always)]
188    pub fn daoe0(
189        self,
190    ) -> crate::common::RegisterField<
191        6,
192        0x1,
193        1,
194        0,
195        dacr::Daoe0,
196        dacr::Daoe0,
197        Dacr_SPEC,
198        crate::common::RW,
199    > {
200        crate::common::RegisterField::<
201            6,
202            0x1,
203            1,
204            0,
205            dacr::Daoe0,
206            dacr::Daoe0,
207            Dacr_SPEC,
208            crate::common::RW,
209        >::from_register(self, 0)
210    }
211
212    #[doc = "D/A Enable"]
213    #[inline(always)]
214    pub fn dae(
215        self,
216    ) -> crate::common::RegisterField<
217        5,
218        0x1,
219        1,
220        0,
221        dacr::Dae,
222        dacr::Dae,
223        Dacr_SPEC,
224        crate::common::RW,
225    > {
226        crate::common::RegisterField::<
227            5,
228            0x1,
229            1,
230            0,
231            dacr::Dae,
232            dacr::Dae,
233            Dacr_SPEC,
234            crate::common::RW,
235        >::from_register(self, 0)
236    }
237}
238impl ::core::default::Default for Dacr {
239    #[inline(always)]
240    fn default() -> Dacr {
241        <crate::RegValueT<Dacr_SPEC> as RegisterValue<_>>::new(31)
242    }
243}
244pub mod dacr {
245
246    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
247    pub struct Daoe1_SPEC;
248    pub type Daoe1 = crate::EnumBitfieldStruct<u8, Daoe1_SPEC>;
249    impl Daoe1 {
250        #[doc = "Analog output of channel 1 (DA1) is disabled."]
251        pub const _0: Self = Self::new(0);
252
253        #[doc = "D/A conversion of channel 1 is enabled. Analog output of channel 1 (DA1) is enabled."]
254        pub const _1: Self = Self::new(1);
255    }
256    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
257    pub struct Daoe0_SPEC;
258    pub type Daoe0 = crate::EnumBitfieldStruct<u8, Daoe0_SPEC>;
259    impl Daoe0 {
260        #[doc = "Analog output of channel 0 (DA0) is disabled."]
261        pub const _0: Self = Self::new(0);
262
263        #[doc = "D/A conversion of channel 0 is enabled. Analog output of channel 0 (DA0) is enabled."]
264        pub const _1: Self = Self::new(1);
265    }
266    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
267    pub struct Dae_SPEC;
268    pub type Dae = crate::EnumBitfieldStruct<u8, Dae_SPEC>;
269    impl Dae {
270        #[doc = "D/A conversion is independently controlled on channels 0 and 1."]
271        pub const _0: Self = Self::new(0);
272
273        #[doc = "D/A conversion on channels 0 and 1 is controlled as a single whole."]
274        pub const _1: Self = Self::new(1);
275    }
276}
277#[doc(hidden)]
278#[derive(Copy, Clone, Eq, PartialEq)]
279pub struct Dadpr_SPEC;
280impl crate::sealed::RegSpec for Dadpr_SPEC {
281    type DataType = u8;
282}
283
284#[doc = "DADRm  Format Select Register"]
285pub type Dadpr = crate::RegValueT<Dadpr_SPEC>;
286
287impl Dadpr {
288    #[doc = "DADRm Format Select"]
289    #[inline(always)]
290    pub fn dpsel(
291        self,
292    ) -> crate::common::RegisterField<
293        7,
294        0x1,
295        1,
296        0,
297        dadpr::Dpsel,
298        dadpr::Dpsel,
299        Dadpr_SPEC,
300        crate::common::RW,
301    > {
302        crate::common::RegisterField::<
303            7,
304            0x1,
305            1,
306            0,
307            dadpr::Dpsel,
308            dadpr::Dpsel,
309            Dadpr_SPEC,
310            crate::common::RW,
311        >::from_register(self, 0)
312    }
313}
314impl ::core::default::Default for Dadpr {
315    #[inline(always)]
316    fn default() -> Dadpr {
317        <crate::RegValueT<Dadpr_SPEC> as RegisterValue<_>>::new(0)
318    }
319}
320pub mod dadpr {
321
322    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
323    pub struct Dpsel_SPEC;
324    pub type Dpsel = crate::EnumBitfieldStruct<u8, Dpsel_SPEC>;
325    impl Dpsel {
326        #[doc = "Right justified format."]
327        pub const _0: Self = Self::new(0);
328
329        #[doc = "Left justified format."]
330        pub const _1: Self = Self::new(1);
331    }
332}
333#[doc(hidden)]
334#[derive(Copy, Clone, Eq, PartialEq)]
335pub struct Daadscr_SPEC;
336impl crate::sealed::RegSpec for Daadscr_SPEC {
337    type DataType = u8;
338}
339
340#[doc = "D/A-A/D Synchronous Start Control Register"]
341pub type Daadscr = crate::RegValueT<Daadscr_SPEC>;
342
343impl Daadscr {
344    #[doc = "D/A-A/D Synchronous Conversion"]
345    #[inline(always)]
346    pub fn daadst(
347        self,
348    ) -> crate::common::RegisterField<
349        7,
350        0x1,
351        1,
352        0,
353        daadscr::Daadst,
354        daadscr::Daadst,
355        Daadscr_SPEC,
356        crate::common::RW,
357    > {
358        crate::common::RegisterField::<
359            7,
360            0x1,
361            1,
362            0,
363            daadscr::Daadst,
364            daadscr::Daadst,
365            Daadscr_SPEC,
366            crate::common::RW,
367        >::from_register(self, 0)
368    }
369}
370impl ::core::default::Default for Daadscr {
371    #[inline(always)]
372    fn default() -> Daadscr {
373        <crate::RegValueT<Daadscr_SPEC> as RegisterValue<_>>::new(0)
374    }
375}
376pub mod daadscr {
377
378    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
379    pub struct Daadst_SPEC;
380    pub type Daadst = crate::EnumBitfieldStruct<u8, Daadst_SPEC>;
381    impl Daadst {
382        #[doc = "D/A converter operation does not synchronize with A/D converter operation (unit 1) (countermeasure against interference between D/A and A/D conversions is disabled)."]
383        pub const _0: Self = Self::new(0);
384
385        #[doc = "D/A converter operation synchronizes with A/D converter operation (unit 1) (countermeasure against interference between D/A and A/D conversions is enabled)."]
386        pub const _1: Self = Self::new(1);
387    }
388}
389#[doc(hidden)]
390#[derive(Copy, Clone, Eq, PartialEq)]
391pub struct Daampcr_SPEC;
392impl crate::sealed::RegSpec for Daampcr_SPEC {
393    type DataType = u8;
394}
395
396#[doc = "D/A Output Amplifier Control Register"]
397pub type Daampcr = crate::RegValueT<Daampcr_SPEC>;
398
399impl Daampcr {
400    #[doc = "Amplifier Control 1"]
401    #[inline(always)]
402    pub fn daamp1(
403        self,
404    ) -> crate::common::RegisterField<
405        7,
406        0x1,
407        1,
408        0,
409        daampcr::Daamp1,
410        daampcr::Daamp1,
411        Daampcr_SPEC,
412        crate::common::RW,
413    > {
414        crate::common::RegisterField::<
415            7,
416            0x1,
417            1,
418            0,
419            daampcr::Daamp1,
420            daampcr::Daamp1,
421            Daampcr_SPEC,
422            crate::common::RW,
423        >::from_register(self, 0)
424    }
425
426    #[doc = "Amplifier Control 0"]
427    #[inline(always)]
428    pub fn daamp0(
429        self,
430    ) -> crate::common::RegisterField<
431        6,
432        0x1,
433        1,
434        0,
435        daampcr::Daamp0,
436        daampcr::Daamp0,
437        Daampcr_SPEC,
438        crate::common::RW,
439    > {
440        crate::common::RegisterField::<
441            6,
442            0x1,
443            1,
444            0,
445            daampcr::Daamp0,
446            daampcr::Daamp0,
447            Daampcr_SPEC,
448            crate::common::RW,
449        >::from_register(self, 0)
450    }
451}
452impl ::core::default::Default for Daampcr {
453    #[inline(always)]
454    fn default() -> Daampcr {
455        <crate::RegValueT<Daampcr_SPEC> as RegisterValue<_>>::new(0)
456    }
457}
458pub mod daampcr {
459
460    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
461    pub struct Daamp1_SPEC;
462    pub type Daamp1 = crate::EnumBitfieldStruct<u8, Daamp1_SPEC>;
463    impl Daamp1 {
464        #[doc = "Output amplifier of channel 1 is not used."]
465        pub const _0: Self = Self::new(0);
466
467        #[doc = "Output amplifier of channel 1 is used."]
468        pub const _1: Self = Self::new(1);
469    }
470    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
471    pub struct Daamp0_SPEC;
472    pub type Daamp0 = crate::EnumBitfieldStruct<u8, Daamp0_SPEC>;
473    impl Daamp0 {
474        #[doc = "Output amplifier of channel 0 is not used."]
475        pub const _0: Self = Self::new(0);
476
477        #[doc = "Output amplifier of channel 0 is used."]
478        pub const _1: Self = Self::new(1);
479    }
480}
481#[doc(hidden)]
482#[derive(Copy, Clone, Eq, PartialEq)]
483pub struct Daaswcr_SPEC;
484impl crate::sealed::RegSpec for Daaswcr_SPEC {
485    type DataType = u8;
486}
487
488#[doc = "D/A Amplifier Stabilization Wait Control Register"]
489pub type Daaswcr = crate::RegValueT<Daaswcr_SPEC>;
490
491impl Daaswcr {
492    #[doc = "D/A Amplifier Stabilization Wait 1"]
493    #[inline(always)]
494    pub fn daasw1(
495        self,
496    ) -> crate::common::RegisterField<
497        7,
498        0x1,
499        1,
500        0,
501        daaswcr::Daasw1,
502        daaswcr::Daasw1,
503        Daaswcr_SPEC,
504        crate::common::RW,
505    > {
506        crate::common::RegisterField::<
507            7,
508            0x1,
509            1,
510            0,
511            daaswcr::Daasw1,
512            daaswcr::Daasw1,
513            Daaswcr_SPEC,
514            crate::common::RW,
515        >::from_register(self, 0)
516    }
517
518    #[doc = "D/A Amplifier Stabilization Wait 0"]
519    #[inline(always)]
520    pub fn daasw0(
521        self,
522    ) -> crate::common::RegisterField<
523        6,
524        0x1,
525        1,
526        0,
527        daaswcr::Daasw0,
528        daaswcr::Daasw0,
529        Daaswcr_SPEC,
530        crate::common::RW,
531    > {
532        crate::common::RegisterField::<
533            6,
534            0x1,
535            1,
536            0,
537            daaswcr::Daasw0,
538            daaswcr::Daasw0,
539            Daaswcr_SPEC,
540            crate::common::RW,
541        >::from_register(self, 0)
542    }
543}
544impl ::core::default::Default for Daaswcr {
545    #[inline(always)]
546    fn default() -> Daaswcr {
547        <crate::RegValueT<Daaswcr_SPEC> as RegisterValue<_>>::new(0)
548    }
549}
550pub mod daaswcr {
551
552    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
553    pub struct Daasw1_SPEC;
554    pub type Daasw1 = crate::EnumBitfieldStruct<u8, Daasw1_SPEC>;
555    impl Daasw1 {
556        #[doc = "Amplifier stabilization wait off (output) for channel 1"]
557        pub const _0: Self = Self::new(0);
558
559        #[doc = "Amplifier stabilization wait on (high-Z) for channel 1."]
560        pub const _1: Self = Self::new(1);
561    }
562    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
563    pub struct Daasw0_SPEC;
564    pub type Daasw0 = crate::EnumBitfieldStruct<u8, Daasw0_SPEC>;
565    impl Daasw0 {
566        #[doc = "Amplifier stabilization wait off (output) for channel 0"]
567        pub const _0: Self = Self::new(0);
568
569        #[doc = "Amplifier stabilization wait on (high-Z) for channel 0."]
570        pub const _1: Self = Self::new(1);
571    }
572}