Skip to main content

ra2a1_pac/
doc.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"Data Operation Circuit"]
28unsafe impl ::core::marker::Send for super::Doc {}
29unsafe impl ::core::marker::Sync for super::Doc {}
30impl super::Doc {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "DOC Control Register"]
38    #[inline(always)]
39    pub const fn docr(&self) -> &'static crate::common::Reg<self::Docr_SPEC, crate::common::RW> {
40        unsafe {
41            crate::common::Reg::<self::Docr_SPEC, crate::common::RW>::from_ptr(
42                self._svd2pac_as_ptr().add(0usize),
43            )
44        }
45    }
46
47    #[doc = "DOC Data Input Register"]
48    #[inline(always)]
49    pub const fn dodir(&self) -> &'static crate::common::Reg<self::Dodir_SPEC, crate::common::RW> {
50        unsafe {
51            crate::common::Reg::<self::Dodir_SPEC, crate::common::RW>::from_ptr(
52                self._svd2pac_as_ptr().add(2usize),
53            )
54        }
55    }
56
57    #[doc = "DOC Data Setting Register"]
58    #[inline(always)]
59    pub const fn dodsr(&self) -> &'static crate::common::Reg<self::Dodsr_SPEC, crate::common::RW> {
60        unsafe {
61            crate::common::Reg::<self::Dodsr_SPEC, crate::common::RW>::from_ptr(
62                self._svd2pac_as_ptr().add(4usize),
63            )
64        }
65    }
66}
67#[doc(hidden)]
68#[derive(Copy, Clone, Eq, PartialEq)]
69pub struct Docr_SPEC;
70impl crate::sealed::RegSpec for Docr_SPEC {
71    type DataType = u8;
72}
73
74#[doc = "DOC Control Register"]
75pub type Docr = crate::RegValueT<Docr_SPEC>;
76
77impl Docr {
78    #[doc = "DOPCF Clear"]
79    #[inline(always)]
80    pub fn dopcfcl(
81        self,
82    ) -> crate::common::RegisterField<
83        6,
84        0x1,
85        1,
86        0,
87        docr::Dopcfcl,
88        docr::Dopcfcl,
89        Docr_SPEC,
90        crate::common::RW,
91    > {
92        crate::common::RegisterField::<
93            6,
94            0x1,
95            1,
96            0,
97            docr::Dopcfcl,
98            docr::Dopcfcl,
99            Docr_SPEC,
100            crate::common::RW,
101        >::from_register(self, 0)
102    }
103
104    #[doc = "Data Operation Circuit FlagIndicates the result of an operation."]
105    #[inline(always)]
106    pub fn dopcf(self) -> crate::common::RegisterFieldBool<5, 1, 0, Docr_SPEC, crate::common::R> {
107        crate::common::RegisterFieldBool::<5, 1, 0, Docr_SPEC, crate::common::R>::from_register(
108            self, 0,
109        )
110    }
111
112    #[doc = "These bits are read as 00. The write value should be 00."]
113    #[inline(always)]
114    pub fn reserved(
115        self,
116    ) -> crate::common::RegisterField<3, 0x3, 1, 0, u8, u8, Docr_SPEC, crate::common::RW> {
117        crate::common::RegisterField::<3,0x3,1,0,u8,u8,Docr_SPEC,crate::common::RW>::from_register(self,0)
118    }
119
120    #[doc = "Detection Condition Select"]
121    #[inline(always)]
122    pub fn dcsel(
123        self,
124    ) -> crate::common::RegisterField<
125        2,
126        0x1,
127        1,
128        0,
129        docr::Dcsel,
130        docr::Dcsel,
131        Docr_SPEC,
132        crate::common::RW,
133    > {
134        crate::common::RegisterField::<
135            2,
136            0x1,
137            1,
138            0,
139            docr::Dcsel,
140            docr::Dcsel,
141            Docr_SPEC,
142            crate::common::RW,
143        >::from_register(self, 0)
144    }
145
146    #[doc = "Operating Mode Select"]
147    #[inline(always)]
148    pub fn oms(
149        self,
150    ) -> crate::common::RegisterField<
151        0,
152        0x3,
153        1,
154        0,
155        docr::Oms,
156        docr::Oms,
157        Docr_SPEC,
158        crate::common::RW,
159    > {
160        crate::common::RegisterField::<
161            0,
162            0x3,
163            1,
164            0,
165            docr::Oms,
166            docr::Oms,
167            Docr_SPEC,
168            crate::common::RW,
169        >::from_register(self, 0)
170    }
171}
172impl ::core::default::Default for Docr {
173    #[inline(always)]
174    fn default() -> Docr {
175        <crate::RegValueT<Docr_SPEC> as RegisterValue<_>>::new(0)
176    }
177}
178pub mod docr {
179
180    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
181    pub struct Dopcfcl_SPEC;
182    pub type Dopcfcl = crate::EnumBitfieldStruct<u8, Dopcfcl_SPEC>;
183    impl Dopcfcl {
184        #[doc = "Maintains the DOPCF flag state."]
185        pub const _0: Self = Self::new(0);
186
187        #[doc = "Clears the DOPCF flag."]
188        pub const _1: Self = Self::new(1);
189    }
190    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
191    pub struct Dcsel_SPEC;
192    pub type Dcsel = crate::EnumBitfieldStruct<u8, Dcsel_SPEC>;
193    impl Dcsel {
194        #[doc = "DOPCF is set when data mismatch is detected."]
195        pub const _0: Self = Self::new(0);
196
197        #[doc = "DOPCF is set when data match is detected."]
198        pub const _1: Self = Self::new(1);
199    }
200    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
201    pub struct Oms_SPEC;
202    pub type Oms = crate::EnumBitfieldStruct<u8, Oms_SPEC>;
203    impl Oms {
204        #[doc = "Data comparison mode"]
205        pub const _00: Self = Self::new(0);
206
207        #[doc = "Data addition mode"]
208        pub const _01: Self = Self::new(1);
209
210        #[doc = "Data subtraction mode"]
211        pub const _10: Self = Self::new(2);
212
213        #[doc = "Setting prohibited"]
214        pub const _11: Self = Self::new(3);
215    }
216}
217#[doc(hidden)]
218#[derive(Copy, Clone, Eq, PartialEq)]
219pub struct Dodir_SPEC;
220impl crate::sealed::RegSpec for Dodir_SPEC {
221    type DataType = u16;
222}
223
224#[doc = "DOC Data Input Register"]
225pub type Dodir = crate::RegValueT<Dodir_SPEC>;
226
227impl Dodir {
228    #[doc = "16-bit read-write register in which 16-bit data for use in the operations are stored."]
229    #[inline(always)]
230    pub fn dodir(
231        self,
232    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Dodir_SPEC, crate::common::RW>
233    {
234        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Dodir_SPEC,crate::common::RW>::from_register(self,0)
235    }
236}
237impl ::core::default::Default for Dodir {
238    #[inline(always)]
239    fn default() -> Dodir {
240        <crate::RegValueT<Dodir_SPEC> as RegisterValue<_>>::new(0)
241    }
242}
243
244#[doc(hidden)]
245#[derive(Copy, Clone, Eq, PartialEq)]
246pub struct Dodsr_SPEC;
247impl crate::sealed::RegSpec for Dodsr_SPEC {
248    type DataType = u16;
249}
250
251#[doc = "DOC Data Setting Register"]
252pub type Dodsr = crate::RegValueT<Dodsr_SPEC>;
253
254impl Dodsr {
255    #[doc = "This register stores 16-bit data for use as a reference in data comparison mode. This register also stores the results of operations in data addition and data subtraction modes."]
256    #[inline(always)]
257    pub fn dodsr(
258        self,
259    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Dodsr_SPEC, crate::common::RW>
260    {
261        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Dodsr_SPEC,crate::common::RW>::from_register(self,0)
262    }
263}
264impl ::core::default::Default for Dodsr {
265    #[inline(always)]
266    fn default() -> Dodsr {
267        <crate::RegValueT<Dodsr_SPEC> as RegisterValue<_>>::new(0)
268    }
269}