ra2e2_pac/
elc.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.40.00, with svd2pac 0.6.0 on Thu, 24 Jul 2025 04:46:37 +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"Event Link Controller"]
28unsafe impl ::core::marker::Send for super::Elc {}
29unsafe impl ::core::marker::Sync for super::Elc {}
30impl super::Elc {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "Event Link Controller Register"]
38    #[inline(always)]
39    pub const fn elcr(&self) -> &'static crate::common::Reg<self::Elcr_SPEC, crate::common::RW> {
40        unsafe {
41            crate::common::Reg::<self::Elcr_SPEC, crate::common::RW>::from_ptr(
42                self._svd2pac_as_ptr().add(0usize),
43            )
44        }
45    }
46
47    #[doc = "Event Link Software Event Generation Register %s"]
48    #[inline(always)]
49    pub const fn elsegr(
50        &self,
51    ) -> &'static crate::common::ClusterRegisterArray<
52        crate::common::Reg<self::Elsegr_SPEC, crate::common::RW>,
53        2,
54        0x2,
55    > {
56        unsafe {
57            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x2usize))
58        }
59    }
60    #[inline(always)]
61    pub const fn elsegr0(
62        &self,
63    ) -> &'static crate::common::Reg<self::Elsegr_SPEC, crate::common::RW> {
64        unsafe {
65            crate::common::Reg::<self::Elsegr_SPEC, crate::common::RW>::from_ptr(
66                self._svd2pac_as_ptr().add(0x2usize),
67            )
68        }
69    }
70    #[inline(always)]
71    pub const fn elsegr1(
72        &self,
73    ) -> &'static crate::common::Reg<self::Elsegr_SPEC, crate::common::RW> {
74        unsafe {
75            crate::common::Reg::<self::Elsegr_SPEC, crate::common::RW>::from_ptr(
76                self._svd2pac_as_ptr().add(0x4usize),
77            )
78        }
79    }
80
81    #[doc = "Event Link Setting Register %s"]
82    #[inline(always)]
83    pub const fn elsr(
84        &self,
85    ) -> &'static crate::common::ClusterRegisterArray<
86        crate::common::Reg<self::Elsr_SPEC, crate::common::RW>,
87        2,
88        0x4,
89    > {
90        unsafe {
91            crate::common::ClusterRegisterArray::from_ptr(self._svd2pac_as_ptr().add(0x48usize))
92        }
93    }
94    #[inline(always)]
95    pub const fn elsr14(&self) -> &'static crate::common::Reg<self::Elsr_SPEC, crate::common::RW> {
96        unsafe {
97            crate::common::Reg::<self::Elsr_SPEC, crate::common::RW>::from_ptr(
98                self._svd2pac_as_ptr().add(0x48usize),
99            )
100        }
101    }
102    #[inline(always)]
103    pub const fn elsr15(&self) -> &'static crate::common::Reg<self::Elsr_SPEC, crate::common::RW> {
104        unsafe {
105            crate::common::Reg::<self::Elsr_SPEC, crate::common::RW>::from_ptr(
106                self._svd2pac_as_ptr().add(0x4cusize),
107            )
108        }
109    }
110}
111#[doc(hidden)]
112#[derive(Copy, Clone, Eq, PartialEq)]
113pub struct Elcr_SPEC;
114impl crate::sealed::RegSpec for Elcr_SPEC {
115    type DataType = u8;
116}
117
118#[doc = "Event Link Controller Register"]
119pub type Elcr = crate::RegValueT<Elcr_SPEC>;
120
121impl Elcr {
122    #[doc = "All Event Link Enable"]
123    #[inline(always)]
124    pub fn elcon(
125        self,
126    ) -> crate::common::RegisterField<
127        7,
128        0x1,
129        1,
130        0,
131        elcr::Elcon,
132        elcr::Elcon,
133        Elcr_SPEC,
134        crate::common::RW,
135    > {
136        crate::common::RegisterField::<
137            7,
138            0x1,
139            1,
140            0,
141            elcr::Elcon,
142            elcr::Elcon,
143            Elcr_SPEC,
144            crate::common::RW,
145        >::from_register(self, 0)
146    }
147}
148impl ::core::default::Default for Elcr {
149    #[inline(always)]
150    fn default() -> Elcr {
151        <crate::RegValueT<Elcr_SPEC> as RegisterValue<_>>::new(0)
152    }
153}
154pub mod elcr {
155
156    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
157    pub struct Elcon_SPEC;
158    pub type Elcon = crate::EnumBitfieldStruct<u8, Elcon_SPEC>;
159    impl Elcon {
160        #[doc = "ELC function is disabled."]
161        pub const _0: Self = Self::new(0);
162
163        #[doc = "ELC function is enabled."]
164        pub const _1: Self = Self::new(1);
165    }
166}
167#[doc(hidden)]
168#[derive(Copy, Clone, Eq, PartialEq)]
169pub struct Elsegr_SPEC;
170impl crate::sealed::RegSpec for Elsegr_SPEC {
171    type DataType = u8;
172}
173
174#[doc = "Event Link Software Event Generation Register %s"]
175pub type Elsegr = crate::RegValueT<Elsegr_SPEC>;
176
177impl Elsegr {
178    #[doc = "Software Event Generation"]
179    #[inline(always)]
180    pub fn seg(
181        self,
182    ) -> crate::common::RegisterField<
183        0,
184        0x1,
185        1,
186        0,
187        elsegr::Seg,
188        elsegr::Seg,
189        Elsegr_SPEC,
190        crate::common::W,
191    > {
192        crate::common::RegisterField::<
193            0,
194            0x1,
195            1,
196            0,
197            elsegr::Seg,
198            elsegr::Seg,
199            Elsegr_SPEC,
200            crate::common::W,
201        >::from_register(self, 0)
202    }
203
204    #[doc = "SEG Bit Write Enable"]
205    #[inline(always)]
206    pub fn we(
207        self,
208    ) -> crate::common::RegisterField<
209        6,
210        0x1,
211        1,
212        0,
213        elsegr::We,
214        elsegr::We,
215        Elsegr_SPEC,
216        crate::common::RW,
217    > {
218        crate::common::RegisterField::<
219            6,
220            0x1,
221            1,
222            0,
223            elsegr::We,
224            elsegr::We,
225            Elsegr_SPEC,
226            crate::common::RW,
227        >::from_register(self, 0)
228    }
229
230    #[doc = "ELSEGR Register Write Disable"]
231    #[inline(always)]
232    pub fn wi(
233        self,
234    ) -> crate::common::RegisterField<
235        7,
236        0x1,
237        1,
238        0,
239        elsegr::Wi,
240        elsegr::Wi,
241        Elsegr_SPEC,
242        crate::common::W,
243    > {
244        crate::common::RegisterField::<
245            7,
246            0x1,
247            1,
248            0,
249            elsegr::Wi,
250            elsegr::Wi,
251            Elsegr_SPEC,
252            crate::common::W,
253        >::from_register(self, 0)
254    }
255}
256impl ::core::default::Default for Elsegr {
257    #[inline(always)]
258    fn default() -> Elsegr {
259        <crate::RegValueT<Elsegr_SPEC> as RegisterValue<_>>::new(128)
260    }
261}
262pub mod elsegr {
263
264    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
265    pub struct Seg_SPEC;
266    pub type Seg = crate::EnumBitfieldStruct<u8, Seg_SPEC>;
267    impl Seg {
268        #[doc = "Normal operation"]
269        pub const _0: Self = Self::new(0);
270
271        #[doc = "Software event is generated."]
272        pub const _1: Self = Self::new(1);
273    }
274    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
275    pub struct We_SPEC;
276    pub type We = crate::EnumBitfieldStruct<u8, We_SPEC>;
277    impl We {
278        #[doc = "Write to SEG bit disabled."]
279        pub const _0: Self = Self::new(0);
280
281        #[doc = "Write to SEG bit enabled."]
282        pub const _1: Self = Self::new(1);
283    }
284    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
285    pub struct Wi_SPEC;
286    pub type Wi = crate::EnumBitfieldStruct<u8, Wi_SPEC>;
287    impl Wi {
288        #[doc = "Write to ELSEGR register enabled."]
289        pub const _0: Self = Self::new(0);
290
291        #[doc = "Write to ELSEGR register disabled."]
292        pub const _1: Self = Self::new(1);
293    }
294}
295#[doc(hidden)]
296#[derive(Copy, Clone, Eq, PartialEq)]
297pub struct Elsr_SPEC;
298impl crate::sealed::RegSpec for Elsr_SPEC {
299    type DataType = u16;
300}
301
302#[doc = "Event Link Setting Register %s"]
303pub type Elsr = crate::RegValueT<Elsr_SPEC>;
304
305impl Elsr {
306    #[doc = "Event Link Select"]
307    #[inline(always)]
308    pub fn els(
309        self,
310    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Elsr_SPEC, crate::common::RW> {
311        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Elsr_SPEC,crate::common::RW>::from_register(self,0)
312    }
313}
314impl ::core::default::Default for Elsr {
315    #[inline(always)]
316    fn default() -> Elsr {
317        <crate::RegValueT<Elsr_SPEC> as RegisterValue<_>>::new(0)
318    }
319}