Skip to main content

ra2a1_pac/
dac8.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.1, with svd2pac 0.6.1 on Sun, 15 Mar 2026 07:00:31 +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"8-bit D/A converter"]
28unsafe impl ::core::marker::Send for super::Dac8 {}
29unsafe impl ::core::marker::Sync for super::Dac8 {}
30impl super::Dac8 {
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 Conversion Value Setting Register %s"]
38    #[inline(always)]
39    pub const fn dacs(
40        &self,
41    ) -> &'static crate::common::ClusterRegisterArray<
42        crate::common::Reg<self::Dacs_SPEC, crate::common::RW>,
43        2,
44        0x1,
45    > {
46        unsafe {
47            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x0usize))
48        }
49    }
50    #[inline(always)]
51    pub const fn dacs0(&self) -> &'static crate::common::Reg<self::Dacs_SPEC, crate::common::RW> {
52        unsafe {
53            crate::common::Reg::<self::Dacs_SPEC, crate::common::RW>::from_ptr(
54                self._svd2pac_as_ptr().add(0x0usize),
55            )
56        }
57    }
58    #[inline(always)]
59    pub const fn dacs1(&self) -> &'static crate::common::Reg<self::Dacs_SPEC, crate::common::RW> {
60        unsafe {
61            crate::common::Reg::<self::Dacs_SPEC, crate::common::RW>::from_ptr(
62                self._svd2pac_as_ptr().add(0x1usize),
63            )
64        }
65    }
66
67    #[doc = "D/A Converter Mode Register"]
68    #[inline(always)]
69    pub const fn dam(&self) -> &'static crate::common::Reg<self::Dam_SPEC, crate::common::RW> {
70        unsafe {
71            crate::common::Reg::<self::Dam_SPEC, crate::common::RW>::from_ptr(
72                self._svd2pac_as_ptr().add(3usize),
73            )
74        }
75    }
76
77    #[doc = "D/A A/D Synchronous Start Control Register"]
78    #[inline(always)]
79    pub const fn dacadscr(
80        &self,
81    ) -> &'static crate::common::Reg<self::Dacadscr_SPEC, crate::common::RW> {
82        unsafe {
83            crate::common::Reg::<self::Dacadscr_SPEC, crate::common::RW>::from_ptr(
84                self._svd2pac_as_ptr().add(6usize),
85            )
86        }
87    }
88
89    #[doc = "D/A SW Charge Pump Control Register"]
90    #[inline(always)]
91    pub const fn dacpc(&self) -> &'static crate::common::Reg<self::Dacpc_SPEC, crate::common::RW> {
92        unsafe {
93            crate::common::Reg::<self::Dacpc_SPEC, crate::common::RW>::from_ptr(
94                self._svd2pac_as_ptr().add(7usize),
95            )
96        }
97    }
98}
99#[doc(hidden)]
100#[derive(Copy, Clone, Eq, PartialEq)]
101pub struct Dacs_SPEC;
102impl crate::sealed::RegSpec for Dacs_SPEC {
103    type DataType = u8;
104}
105
106#[doc = "D/A Conversion Value Setting Register %s"]
107pub type Dacs = crate::RegValueT<Dacs_SPEC>;
108
109impl Dacs {
110    #[doc = "DACS D/A conversion store data"]
111    #[inline(always)]
112    pub fn dacs(
113        self,
114    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Dacs_SPEC, crate::common::RW> {
115        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Dacs_SPEC,crate::common::RW>::from_register(self,0)
116    }
117}
118impl ::core::default::Default for Dacs {
119    #[inline(always)]
120    fn default() -> Dacs {
121        <crate::RegValueT<Dacs_SPEC> as RegisterValue<_>>::new(0)
122    }
123}
124
125#[doc(hidden)]
126#[derive(Copy, Clone, Eq, PartialEq)]
127pub struct Dam_SPEC;
128impl crate::sealed::RegSpec for Dam_SPEC {
129    type DataType = u8;
130}
131
132#[doc = "D/A Converter Mode Register"]
133pub type Dam = crate::RegValueT<Dam_SPEC>;
134
135impl Dam {
136    #[doc = "D/A operation enable 1"]
137    #[inline(always)]
138    pub fn dace1(
139        self,
140    ) -> crate::common::RegisterField<
141        5,
142        0x1,
143        1,
144        0,
145        dam::Dace1,
146        dam::Dace1,
147        Dam_SPEC,
148        crate::common::RW,
149    > {
150        crate::common::RegisterField::<
151            5,
152            0x1,
153            1,
154            0,
155            dam::Dace1,
156            dam::Dace1,
157            Dam_SPEC,
158            crate::common::RW,
159        >::from_register(self, 0)
160    }
161
162    #[doc = "D/A operation enable 0"]
163    #[inline(always)]
164    pub fn dace0(
165        self,
166    ) -> crate::common::RegisterField<
167        4,
168        0x1,
169        1,
170        0,
171        dam::Dace0,
172        dam::Dace0,
173        Dam_SPEC,
174        crate::common::RW,
175    > {
176        crate::common::RegisterField::<
177            4,
178            0x1,
179            1,
180            0,
181            dam::Dace0,
182            dam::Dace0,
183            Dam_SPEC,
184            crate::common::RW,
185        >::from_register(self, 0)
186    }
187
188    #[doc = "This bit is read as 0. The write value should be 0."]
189    #[inline(always)]
190    pub fn reserved(
191        self,
192    ) -> crate::common::RegisterFieldBool<2, 1, 0, Dam_SPEC, crate::common::RW> {
193        crate::common::RegisterFieldBool::<2, 1, 0, Dam_SPEC, crate::common::RW>::from_register(
194            self, 0,
195        )
196    }
197
198    #[doc = "D/A operation mode select 1"]
199    #[inline(always)]
200    pub fn damd1(
201        self,
202    ) -> crate::common::RegisterField<
203        1,
204        0x1,
205        1,
206        0,
207        dam::Damd1,
208        dam::Damd1,
209        Dam_SPEC,
210        crate::common::RW,
211    > {
212        crate::common::RegisterField::<
213            1,
214            0x1,
215            1,
216            0,
217            dam::Damd1,
218            dam::Damd1,
219            Dam_SPEC,
220            crate::common::RW,
221        >::from_register(self, 0)
222    }
223
224    #[doc = "D/A operation mode select 0"]
225    #[inline(always)]
226    pub fn damd0(
227        self,
228    ) -> crate::common::RegisterField<
229        0,
230        0x1,
231        1,
232        0,
233        dam::Damd0,
234        dam::Damd0,
235        Dam_SPEC,
236        crate::common::RW,
237    > {
238        crate::common::RegisterField::<
239            0,
240            0x1,
241            1,
242            0,
243            dam::Damd0,
244            dam::Damd0,
245            Dam_SPEC,
246            crate::common::RW,
247        >::from_register(self, 0)
248    }
249}
250impl ::core::default::Default for Dam {
251    #[inline(always)]
252    fn default() -> Dam {
253        <crate::RegValueT<Dam_SPEC> as RegisterValue<_>>::new(0)
254    }
255}
256pub mod dam {
257
258    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
259    pub struct Dace1_SPEC;
260    pub type Dace1 = crate::EnumBitfieldStruct<u8, Dace1_SPEC>;
261    impl Dace1 {
262        #[doc = "D/A conversion disabled for channel 1"]
263        pub const _0: Self = Self::new(0);
264
265        #[doc = "D/A conversion enabled for channel 1"]
266        pub const _1: Self = Self::new(1);
267    }
268    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
269    pub struct Dace0_SPEC;
270    pub type Dace0 = crate::EnumBitfieldStruct<u8, Dace0_SPEC>;
271    impl Dace0 {
272        #[doc = "D/A conversion disabled for channel 0"]
273        pub const _0: Self = Self::new(0);
274
275        #[doc = "D/A conversion enabled for channel 0"]
276        pub const _1: Self = Self::new(1);
277    }
278    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
279    pub struct Damd1_SPEC;
280    pub type Damd1 = crate::EnumBitfieldStruct<u8, Damd1_SPEC>;
281    impl Damd1 {
282        #[doc = "Channel 1 for normal operation mode"]
283        pub const _0: Self = Self::new(0);
284
285        #[doc = "Channel 1 for real-time output mode(event link)"]
286        pub const _1: Self = Self::new(1);
287    }
288    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
289    pub struct Damd0_SPEC;
290    pub type Damd0 = crate::EnumBitfieldStruct<u8, Damd0_SPEC>;
291    impl Damd0 {
292        #[doc = "Channel 0 for normal operation mode"]
293        pub const _0: Self = Self::new(0);
294
295        #[doc = "Channel 0 for real-time output mode(event link)"]
296        pub const _1: Self = Self::new(1);
297    }
298}
299#[doc(hidden)]
300#[derive(Copy, Clone, Eq, PartialEq)]
301pub struct Dacadscr_SPEC;
302impl crate::sealed::RegSpec for Dacadscr_SPEC {
303    type DataType = u8;
304}
305
306#[doc = "D/A A/D Synchronous Start Control Register"]
307pub type Dacadscr = crate::RegValueT<Dacadscr_SPEC>;
308
309impl Dacadscr {
310    #[doc = "These bits are read as 0000000. The write value should be 0000000."]
311    #[inline(always)]
312    pub fn reserved(
313        self,
314    ) -> crate::common::RegisterField<1, 0x7f, 1, 0, u8, u8, Dacadscr_SPEC, crate::common::RW> {
315        crate::common::RegisterField::<1,0x7f,1,0,u8,u8,Dacadscr_SPEC,crate::common::RW>::from_register(self,0)
316    }
317
318    #[doc = "D/A A/D Synchronous Conversion"]
319    #[inline(always)]
320    pub fn dacadst(
321        self,
322    ) -> crate::common::RegisterField<
323        0,
324        0x1,
325        1,
326        0,
327        dacadscr::Dacadst,
328        dacadscr::Dacadst,
329        Dacadscr_SPEC,
330        crate::common::RW,
331    > {
332        crate::common::RegisterField::<
333            0,
334            0x1,
335            1,
336            0,
337            dacadscr::Dacadst,
338            dacadscr::Dacadst,
339            Dacadscr_SPEC,
340            crate::common::RW,
341        >::from_register(self, 0)
342    }
343}
344impl ::core::default::Default for Dacadscr {
345    #[inline(always)]
346    fn default() -> Dacadscr {
347        <crate::RegValueT<Dacadscr_SPEC> as RegisterValue<_>>::new(0)
348    }
349}
350pub mod dacadscr {
351
352    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
353    pub struct Dacadst_SPEC;
354    pub type Dacadst = crate::EnumBitfieldStruct<u8, Dacadst_SPEC>;
355    impl Dacadst {
356        #[doc = "Do not synchronize DAC8 with ADC16 operation (disable interference reduction between D/A and A/D conversion)"]
357        pub const _0: Self = Self::new(0);
358
359        #[doc = "Synchronize DAC8 with ADC16 operation (enable interference reduction between D/A and A/D conversion)."]
360        pub const _1: Self = Self::new(1);
361    }
362}
363#[doc(hidden)]
364#[derive(Copy, Clone, Eq, PartialEq)]
365pub struct Dacpc_SPEC;
366impl crate::sealed::RegSpec for Dacpc_SPEC {
367    type DataType = u8;
368}
369
370#[doc = "D/A SW Charge Pump Control Register"]
371pub type Dacpc = crate::RegValueT<Dacpc_SPEC>;
372
373impl Dacpc {
374    #[doc = "These bits are read as 0000000. The write value should be 0000000."]
375    #[inline(always)]
376    pub fn reserved(
377        self,
378    ) -> crate::common::RegisterField<1, 0x7f, 1, 0, u8, u8, Dacpc_SPEC, crate::common::RW> {
379        crate::common::RegisterField::<1,0x7f,1,0,u8,u8,Dacpc_SPEC,crate::common::RW>::from_register(self,0)
380    }
381
382    #[doc = "Charge pump enable"]
383    #[inline(always)]
384    pub fn pumpen(
385        self,
386    ) -> crate::common::RegisterField<
387        0,
388        0x1,
389        1,
390        0,
391        dacpc::Pumpen,
392        dacpc::Pumpen,
393        Dacpc_SPEC,
394        crate::common::RW,
395    > {
396        crate::common::RegisterField::<
397            0,
398            0x1,
399            1,
400            0,
401            dacpc::Pumpen,
402            dacpc::Pumpen,
403            Dacpc_SPEC,
404            crate::common::RW,
405        >::from_register(self, 0)
406    }
407}
408impl ::core::default::Default for Dacpc {
409    #[inline(always)]
410    fn default() -> Dacpc {
411        <crate::RegValueT<Dacpc_SPEC> as RegisterValue<_>>::new(0)
412    }
413}
414pub mod dacpc {
415
416    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
417    pub struct Pumpen_SPEC;
418    pub type Pumpen = crate::EnumBitfieldStruct<u8, Pumpen_SPEC>;
419    impl Pumpen {
420        #[doc = "Charge pump disable"]
421        pub const _0: Self = Self::new(0);
422
423        #[doc = "Charge pump enable"]
424        pub const _1: Self = Self::new(1);
425    }
426}