da14682_pac/
systick.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.0 on Thu, 24 Jul 2025 04:45:10 +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"Cortex M0 SysTick registers"]
28unsafe impl ::core::marker::Send for super::SysTick {}
29unsafe impl ::core::marker::Sync for super::SysTick {}
30impl super::SysTick {
31    #[allow(unused)]
32    #[inline(always)]
33    pub(crate) const fn _svd2pac_as_ptr(&self) -> *mut u8 {
34        self.ptr
35    }
36
37    #[doc = "SysTick Control and Status register"]
38    #[inline(always)]
39    pub const fn ctrl(&self) -> &'static crate::common::Reg<self::Ctrl_SPEC, crate::common::RW> {
40        unsafe {
41            crate::common::Reg::<self::Ctrl_SPEC, crate::common::RW>::from_ptr(
42                self._svd2pac_as_ptr().add(0usize),
43            )
44        }
45    }
46
47    #[doc = "SysTick Reload value register"]
48    #[inline(always)]
49    pub const fn load(&self) -> &'static crate::common::Reg<self::Load_SPEC, crate::common::RW> {
50        unsafe {
51            crate::common::Reg::<self::Load_SPEC, crate::common::RW>::from_ptr(
52                self._svd2pac_as_ptr().add(4usize),
53            )
54        }
55    }
56
57    #[doc = "SysTick Current value register"]
58    #[inline(always)]
59    pub const fn val(&self) -> &'static crate::common::Reg<self::Val_SPEC, crate::common::RW> {
60        unsafe {
61            crate::common::Reg::<self::Val_SPEC, crate::common::RW>::from_ptr(
62                self._svd2pac_as_ptr().add(8usize),
63            )
64        }
65    }
66
67    #[doc = "SysTick Calibration value register"]
68    #[inline(always)]
69    pub const fn calib(&self) -> &'static crate::common::Reg<self::Calib_SPEC, crate::common::R> {
70        unsafe {
71            crate::common::Reg::<self::Calib_SPEC, crate::common::R>::from_ptr(
72                self._svd2pac_as_ptr().add(12usize),
73            )
74        }
75    }
76}
77#[doc(hidden)]
78#[derive(Copy, Clone, Eq, PartialEq)]
79pub struct Ctrl_SPEC;
80impl crate::sealed::RegSpec for Ctrl_SPEC {
81    type DataType = u32;
82}
83
84#[doc = "SysTick Control and Status register"]
85pub type Ctrl = crate::RegValueT<Ctrl_SPEC>;
86
87impl Ctrl {
88    #[doc = "SysTick Counter enable"]
89    #[inline(always)]
90    pub fn enable(self) -> crate::common::RegisterFieldBool<0, 1, 0, Ctrl_SPEC, crate::common::RW> {
91        crate::common::RegisterFieldBool::<0, 1, 0, Ctrl_SPEC, crate::common::RW>::from_register(
92            self, 0,
93        )
94    }
95
96    #[doc = "SysTick exception request enable"]
97    #[inline(always)]
98    pub fn tickint(
99        self,
100    ) -> crate::common::RegisterFieldBool<1, 1, 0, Ctrl_SPEC, crate::common::RW> {
101        crate::common::RegisterFieldBool::<1, 1, 0, Ctrl_SPEC, crate::common::RW>::from_register(
102            self, 0,
103        )
104    }
105
106    #[doc = "Clock source selection"]
107    #[inline(always)]
108    pub fn clksource(
109        self,
110    ) -> crate::common::RegisterFieldBool<2, 1, 0, Ctrl_SPEC, crate::common::RW> {
111        crate::common::RegisterFieldBool::<2, 1, 0, Ctrl_SPEC, crate::common::RW>::from_register(
112            self, 0,
113        )
114    }
115
116    #[doc = "Timer counted to 0 since last time this was read"]
117    #[inline(always)]
118    pub fn countflag(
119        self,
120    ) -> crate::common::RegisterFieldBool<16, 1, 0, Ctrl_SPEC, crate::common::RW> {
121        crate::common::RegisterFieldBool::<16, 1, 0, Ctrl_SPEC, crate::common::RW>::from_register(
122            self, 0,
123        )
124    }
125}
126impl ::core::default::Default for Ctrl {
127    #[inline(always)]
128    fn default() -> Ctrl {
129        <crate::RegValueT<Ctrl_SPEC> as RegisterValue<_>>::new(4)
130    }
131}
132
133#[doc(hidden)]
134#[derive(Copy, Clone, Eq, PartialEq)]
135pub struct Load_SPEC;
136impl crate::sealed::RegSpec for Load_SPEC {
137    type DataType = u32;
138}
139
140#[doc = "SysTick Reload value register"]
141pub type Load = crate::RegValueT<Load_SPEC>;
142
143impl Load {
144    #[doc = "RELOAD\\[23:0\\] bits (Reload value)"]
145    #[inline(always)]
146    pub fn reload(
147        self,
148    ) -> crate::common::RegisterField<0, 0xffffff, 1, 0, u32, u32, Load_SPEC, crate::common::RW>
149    {
150        crate::common::RegisterField::<0,0xffffff,1,0,u32,u32,Load_SPEC,crate::common::RW>::from_register(self,0)
151    }
152}
153impl ::core::default::Default for Load {
154    #[inline(always)]
155    fn default() -> Load {
156        <crate::RegValueT<Load_SPEC> as RegisterValue<_>>::new(0)
157    }
158}
159
160#[doc(hidden)]
161#[derive(Copy, Clone, Eq, PartialEq)]
162pub struct Val_SPEC;
163impl crate::sealed::RegSpec for Val_SPEC {
164    type DataType = u32;
165}
166
167#[doc = "SysTick Current value register"]
168pub type Val = crate::RegValueT<Val_SPEC>;
169
170impl Val {
171    #[doc = "CURRENT\\[23:0\\] bits (Current counter value)"]
172    #[inline(always)]
173    pub fn current(
174        self,
175    ) -> crate::common::RegisterField<0, 0xffffff, 1, 0, u32, u32, Val_SPEC, crate::common::RW>
176    {
177        crate::common::RegisterField::<0,0xffffff,1,0,u32,u32,Val_SPEC,crate::common::RW>::from_register(self,0)
178    }
179}
180impl ::core::default::Default for Val {
181    #[inline(always)]
182    fn default() -> Val {
183        <crate::RegValueT<Val_SPEC> as RegisterValue<_>>::new(0)
184    }
185}
186
187#[doc(hidden)]
188#[derive(Copy, Clone, Eq, PartialEq)]
189pub struct Calib_SPEC;
190impl crate::sealed::RegSpec for Calib_SPEC {
191    type DataType = u32;
192}
193
194#[doc = "SysTick Calibration value register"]
195pub type Calib = crate::RegValueT<Calib_SPEC>;
196
197impl Calib {
198    #[doc = "TENMS\\[23:0\\] bits (Calibration value)"]
199    #[inline(always)]
200    pub fn tenms(
201        self,
202    ) -> crate::common::RegisterField<0, 0xffffff, 1, 0, u32, u32, Calib_SPEC, crate::common::R>
203    {
204        crate::common::RegisterField::<0,0xffffff,1,0,u32,u32,Calib_SPEC,crate::common::R>::from_register(self,0)
205    }
206
207    #[doc = "Indicates whether the TENMS value is exact"]
208    #[inline(always)]
209    pub fn skew(self) -> crate::common::RegisterFieldBool<30, 1, 0, Calib_SPEC, crate::common::R> {
210        crate::common::RegisterFieldBool::<30, 1, 0, Calib_SPEC, crate::common::R>::from_register(
211            self, 0,
212        )
213    }
214
215    #[doc = "Indicates that a separate reference clock is provided"]
216    #[inline(always)]
217    pub fn noref(self) -> crate::common::RegisterFieldBool<31, 1, 0, Calib_SPEC, crate::common::R> {
218        crate::common::RegisterFieldBool::<31, 1, 0, Calib_SPEC, crate::common::R>::from_register(
219            self, 0,
220        )
221    }
222}
223impl ::core::default::Default for Calib {
224    #[inline(always)]
225    fn default() -> Calib {
226        <crate::RegValueT<Calib_SPEC> as RegisterValue<_>>::new(9000)
227    }
228}