Skip to main content

ra6m2_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.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"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 Iwdtrr {
72    #[doc = "The counter is refreshed by writing 0x00 and then writing 0xFF to this register."]
73    #[inline(always)]
74    pub fn iwdtrr(
75        self,
76    ) -> crate::common::RegisterField<0, 0xff, 1, 0, u8, u8, Iwdtrr_SPEC, crate::common::RW> {
77        crate::common::RegisterField::<0,0xff,1,0,u8,u8,Iwdtrr_SPEC,crate::common::RW>::from_register(self,0)
78    }
79}
80impl ::core::default::Default for Iwdtrr {
81    #[inline(always)]
82    fn default() -> Iwdtrr {
83        <crate::RegValueT<Iwdtrr_SPEC> as RegisterValue<_>>::new(255)
84    }
85}
86
87#[doc(hidden)]
88#[derive(Copy, Clone, Eq, PartialEq)]
89pub struct Iwdtsr_SPEC;
90impl crate::sealed::RegSpec for Iwdtsr_SPEC {
91    type DataType = u16;
92}
93
94#[doc = "IWDT Status Register"]
95pub type Iwdtsr = crate::RegValueT<Iwdtsr_SPEC>;
96
97impl Iwdtsr {
98    #[doc = "Refresh Error Flag"]
99    #[inline(always)]
100    pub fn refef(
101        self,
102    ) -> crate::common::RegisterField<
103        15,
104        0x1,
105        1,
106        0,
107        iwdtsr::Refef,
108        iwdtsr::Refef,
109        Iwdtsr_SPEC,
110        crate::common::RW,
111    > {
112        crate::common::RegisterField::<
113            15,
114            0x1,
115            1,
116            0,
117            iwdtsr::Refef,
118            iwdtsr::Refef,
119            Iwdtsr_SPEC,
120            crate::common::RW,
121        >::from_register(self, 0)
122    }
123
124    #[doc = "Underflow Flag"]
125    #[inline(always)]
126    pub fn undff(
127        self,
128    ) -> crate::common::RegisterField<
129        14,
130        0x1,
131        1,
132        0,
133        iwdtsr::Undff,
134        iwdtsr::Undff,
135        Iwdtsr_SPEC,
136        crate::common::RW,
137    > {
138        crate::common::RegisterField::<
139            14,
140            0x1,
141            1,
142            0,
143            iwdtsr::Undff,
144            iwdtsr::Undff,
145            Iwdtsr_SPEC,
146            crate::common::RW,
147        >::from_register(self, 0)
148    }
149
150    #[doc = "Counter ValueValue counted by the counter"]
151    #[inline(always)]
152    pub fn cntval(
153        self,
154    ) -> crate::common::RegisterField<0, 0x3fff, 1, 0, u16, u16, Iwdtsr_SPEC, crate::common::R>
155    {
156        crate::common::RegisterField::<0,0x3fff,1,0,u16,u16,Iwdtsr_SPEC,crate::common::R>::from_register(self,0)
157    }
158}
159impl ::core::default::Default for Iwdtsr {
160    #[inline(always)]
161    fn default() -> Iwdtsr {
162        <crate::RegValueT<Iwdtsr_SPEC> as RegisterValue<_>>::new(0)
163    }
164}
165pub mod iwdtsr {
166
167    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
168    pub struct Refef_SPEC;
169    pub type Refef = crate::EnumBitfieldStruct<u8, Refef_SPEC>;
170    impl Refef {
171        #[doc = "Refresh error not occurred"]
172        pub const _0: Self = Self::new(0);
173
174        #[doc = "Refresh error occurred"]
175        pub const _1: Self = Self::new(1);
176    }
177    #[derive(Clone, Copy, Eq, PartialEq, Ord, PartialOrd)]
178    pub struct Undff_SPEC;
179    pub type Undff = crate::EnumBitfieldStruct<u8, Undff_SPEC>;
180    impl Undff {
181        #[doc = "Underflow not occurred"]
182        pub const _0: Self = Self::new(0);
183
184        #[doc = "Underflow occurred"]
185        pub const _1: Self = Self::new(1);
186    }
187}