Skip to main content

ra6m2_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.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"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 = "Detection Condition Select"]
113    #[inline(always)]
114    pub fn dcsel(
115        self,
116    ) -> crate::common::RegisterField<
117        2,
118        0x1,
119        1,
120        0,
121        docr::Dcsel,
122        docr::Dcsel,
123        Docr_SPEC,
124        crate::common::RW,
125    > {
126        crate::common::RegisterField::<
127            2,
128            0x1,
129            1,
130            0,
131            docr::Dcsel,
132            docr::Dcsel,
133            Docr_SPEC,
134            crate::common::RW,
135        >::from_register(self, 0)
136    }
137
138    #[doc = "Operating Mode Select"]
139    #[inline(always)]
140    pub fn oms(
141        self,
142    ) -> crate::common::RegisterField<
143        0,
144        0x3,
145        1,
146        0,
147        docr::Oms,
148        docr::Oms,
149        Docr_SPEC,
150        crate::common::RW,
151    > {
152        crate::common::RegisterField::<
153            0,
154            0x3,
155            1,
156            0,
157            docr::Oms,
158            docr::Oms,
159            Docr_SPEC,
160            crate::common::RW,
161        >::from_register(self, 0)
162    }
163}
164impl ::core::default::Default for Docr {
165    #[inline(always)]
166    fn default() -> Docr {
167        <crate::RegValueT<Docr_SPEC> as RegisterValue<_>>::new(0)
168    }
169}
170pub mod docr {
171
172    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
173    pub struct Dopcfcl_SPEC;
174    pub type Dopcfcl = crate::EnumBitfieldStruct<u8, Dopcfcl_SPEC>;
175    impl Dopcfcl {
176        #[doc = "Maintains the DOPCF flag state."]
177        pub const _0: Self = Self::new(0);
178
179        #[doc = "Clears the DOPCF flag."]
180        pub const _1: Self = Self::new(1);
181    }
182    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
183    pub struct Dcsel_SPEC;
184    pub type Dcsel = crate::EnumBitfieldStruct<u8, Dcsel_SPEC>;
185    impl Dcsel {
186        #[doc = "DOPCF is set when data mismatch is detected."]
187        pub const _0: Self = Self::new(0);
188
189        #[doc = "DOPCF is set when data match is detected."]
190        pub const _1: Self = Self::new(1);
191    }
192    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
193    pub struct Oms_SPEC;
194    pub type Oms = crate::EnumBitfieldStruct<u8, Oms_SPEC>;
195    impl Oms {
196        #[doc = "Data comparison mode"]
197        pub const _00: Self = Self::new(0);
198
199        #[doc = "Data addition mode"]
200        pub const _01: Self = Self::new(1);
201
202        #[doc = "Data subtraction mode"]
203        pub const _10: Self = Self::new(2);
204
205        #[doc = "Setting prohibited"]
206        pub const _11: Self = Self::new(3);
207    }
208}
209#[doc(hidden)]
210#[derive(Copy, Clone, Eq, PartialEq)]
211pub struct Dodir_SPEC;
212impl crate::sealed::RegSpec for Dodir_SPEC {
213    type DataType = u16;
214}
215
216#[doc = "DOC Data Input Register"]
217pub type Dodir = crate::RegValueT<Dodir_SPEC>;
218
219impl Dodir {
220    #[doc = "16-bit read-write register in which 16-bit data for use in the operations are stored."]
221    #[inline(always)]
222    pub fn dodir(
223        self,
224    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Dodir_SPEC, crate::common::RW>
225    {
226        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Dodir_SPEC,crate::common::RW>::from_register(self,0)
227    }
228}
229impl ::core::default::Default for Dodir {
230    #[inline(always)]
231    fn default() -> Dodir {
232        <crate::RegValueT<Dodir_SPEC> as RegisterValue<_>>::new(0)
233    }
234}
235
236#[doc(hidden)]
237#[derive(Copy, Clone, Eq, PartialEq)]
238pub struct Dodsr_SPEC;
239impl crate::sealed::RegSpec for Dodsr_SPEC {
240    type DataType = u16;
241}
242
243#[doc = "DOC Data Setting Register"]
244pub type Dodsr = crate::RegValueT<Dodsr_SPEC>;
245
246impl Dodsr {
247    #[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."]
248    #[inline(always)]
249    pub fn dodsr(
250        self,
251    ) -> crate::common::RegisterField<0, 0xffff, 1, 0, u16, u16, Dodsr_SPEC, crate::common::RW>
252    {
253        crate::common::RegisterField::<0,0xffff,1,0,u16,u16,Dodsr_SPEC,crate::common::RW>::from_register(self,0)
254    }
255}
256impl ::core::default::Default for Dodsr {
257    #[inline(always)]
258    fn default() -> Dodsr {
259        <crate::RegValueT<Dodsr_SPEC> as RegisterValue<_>>::new(0)
260    }
261}