ra2e2_pac/
iwdt.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"Independent Watchdog Timer"]
28unsafe impl ::core::marker::Send for super::Iwdt {}
29unsafe impl ::core::marker::Sync for super::Iwdt {}
30impl super::Iwdt {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "IWDT Refresh Register"]
38    #[inline(always)]
39    pub const fn iwdtrr(
40        &self,
41    ) -> &'static crate::common::Reg<self::Iwdtrr_SPEC, crate::common::RW> {
42        unsafe {
43            crate::common::Reg::<self::Iwdtrr_SPEC, crate::common::RW>::from_ptr(
44                self._svd2pac_as_ptr().add(0usize),
45            )
46        }
47    }
48
49    #[doc = "IWDT Status Register"]
50    #[inline(always)]
51    pub const fn iwdtsr(
52        &self,
53    ) -> &'static crate::common::Reg<self::Iwdtsr_SPEC, crate::common::RW> {
54        unsafe {
55            crate::common::Reg::<self::Iwdtsr_SPEC, crate::common::RW>::from_ptr(
56                self._svd2pac_as_ptr().add(4usize),
57            )
58        }
59    }
60}
61#[doc(hidden)]
62#[derive(Copy, Clone, Eq, PartialEq)]
63pub struct Iwdtrr_SPEC;
64impl crate::sealed::RegSpec for Iwdtrr_SPEC {
65    type DataType = u8;
66}
67
68#[doc = "IWDT Refresh Register"]
69pub type Iwdtrr = crate::RegValueT<Iwdtrr_SPEC>;
70
71impl NoBitfieldReg<Iwdtrr_SPEC> for Iwdtrr {}
72impl ::core::default::Default for Iwdtrr {
73    #[inline(always)]
74    fn default() -> Iwdtrr {
75        <crate::RegValueT<Iwdtrr_SPEC> as RegisterValue<_>>::new(255)
76    }
77}
78
79#[doc(hidden)]
80#[derive(Copy, Clone, Eq, PartialEq)]
81pub struct Iwdtsr_SPEC;
82impl crate::sealed::RegSpec for Iwdtsr_SPEC {
83    type DataType = u16;
84}
85
86#[doc = "IWDT Status Register"]
87pub type Iwdtsr = crate::RegValueT<Iwdtsr_SPEC>;
88
89impl Iwdtsr {
90    #[doc = "Down-counter Value"]
91    #[inline(always)]
92    pub fn cntval(
93        self,
94    ) -> crate::common::RegisterField<0, 0x3fff, 1, 0, u16, u16, Iwdtsr_SPEC, crate::common::R>
95    {
96        crate::common::RegisterField::<0,0x3fff,1,0,u16,u16,Iwdtsr_SPEC,crate::common::R>::from_register(self,0)
97    }
98
99    #[doc = "Underflow Flag"]
100    #[inline(always)]
101    pub fn undff(
102        self,
103    ) -> crate::common::RegisterField<
104        14,
105        0x1,
106        1,
107        0,
108        iwdtsr::Undff,
109        iwdtsr::Undff,
110        Iwdtsr_SPEC,
111        crate::common::RW,
112    > {
113        crate::common::RegisterField::<
114            14,
115            0x1,
116            1,
117            0,
118            iwdtsr::Undff,
119            iwdtsr::Undff,
120            Iwdtsr_SPEC,
121            crate::common::RW,
122        >::from_register(self, 0)
123    }
124
125    #[doc = "Refresh Error Flag"]
126    #[inline(always)]
127    pub fn refef(
128        self,
129    ) -> crate::common::RegisterField<
130        15,
131        0x1,
132        1,
133        0,
134        iwdtsr::Refef,
135        iwdtsr::Refef,
136        Iwdtsr_SPEC,
137        crate::common::RW,
138    > {
139        crate::common::RegisterField::<
140            15,
141            0x1,
142            1,
143            0,
144            iwdtsr::Refef,
145            iwdtsr::Refef,
146            Iwdtsr_SPEC,
147            crate::common::RW,
148        >::from_register(self, 0)
149    }
150}
151impl ::core::default::Default for Iwdtsr {
152    #[inline(always)]
153    fn default() -> Iwdtsr {
154        <crate::RegValueT<Iwdtsr_SPEC> as RegisterValue<_>>::new(0)
155    }
156}
157pub mod iwdtsr {
158
159    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
160    pub struct Undff_SPEC;
161    pub type Undff = crate::EnumBitfieldStruct<u8, Undff_SPEC>;
162    impl Undff {
163        #[doc = "No underflow occurred"]
164        pub const _0: Self = Self::new(0);
165
166        #[doc = "Underflow occurred"]
167        pub const _1: Self = Self::new(1);
168    }
169    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
170    pub struct Refef_SPEC;
171    pub type Refef = crate::EnumBitfieldStruct<u8, Refef_SPEC>;
172    impl Refef {
173        #[doc = "No refresh error occurred"]
174        pub const _0: Self = Self::new(0);
175
176        #[doc = "Refresh error occurred"]
177        pub const _1: Self = Self::new(1);
178    }
179}