rp235x_pac/inner/accessctrl/
ticks.rs

1#[doc = "Register `TICKS` reader"]
2pub type R = crate::R<TICKS_SPEC>;
3#[doc = "Register `TICKS` writer"]
4pub type W = crate::W<TICKS_SPEC>;
5#[doc = "Field `NSU` reader - If 1, and NSP is also set, TICKS can be accessed from a Non-secure, Unprivileged context. This bit is writable from a Non-secure, Privileged context, if and only if the NSP bit is set."]
6pub type NSU_R = crate::BitReader;
7#[doc = "Field `NSU` writer - If 1, and NSP is also set, TICKS can be accessed from a Non-secure, Unprivileged context. This bit is writable from a Non-secure, Privileged context, if and only if the NSP bit is set."]
8pub type NSU_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `NSP` reader - If 1, TICKS can be accessed from a Non-secure, Privileged context."]
10pub type NSP_R = crate::BitReader;
11#[doc = "Field `NSP` writer - If 1, TICKS can be accessed from a Non-secure, Privileged context."]
12pub type NSP_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SU` reader - If 1, and SP is also set, TICKS can be accessed from a Secure, Unprivileged context."]
14pub type SU_R = crate::BitReader;
15#[doc = "Field `SU` writer - If 1, and SP is also set, TICKS can be accessed from a Secure, Unprivileged context."]
16pub type SU_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SP` reader - If 1, TICKS can be accessed from a Secure, Privileged context."]
18pub type SP_R = crate::BitReader;
19#[doc = "Field `SP` writer - If 1, TICKS can be accessed from a Secure, Privileged context."]
20pub type SP_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `CORE0` reader - If 1, TICKS can be accessed by core 0, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
22pub type CORE0_R = crate::BitReader;
23#[doc = "Field `CORE0` writer - If 1, TICKS can be accessed by core 0, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
24pub type CORE0_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `CORE1` reader - If 1, TICKS can be accessed by core 1, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
26pub type CORE1_R = crate::BitReader;
27#[doc = "Field `CORE1` writer - If 1, TICKS can be accessed by core 1, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
28pub type CORE1_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `DMA` reader - If 1, TICKS can be accessed by the DMA, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
30pub type DMA_R = crate::BitReader;
31#[doc = "Field `DMA` writer - If 1, TICKS can be accessed by the DMA, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
32pub type DMA_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `DBG` reader - If 1, TICKS can be accessed by the debugger, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
34pub type DBG_R = crate::BitReader;
35#[doc = "Field `DBG` writer - If 1, TICKS can be accessed by the debugger, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
36pub type DBG_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bit 0 - If 1, and NSP is also set, TICKS can be accessed from a Non-secure, Unprivileged context. This bit is writable from a Non-secure, Privileged context, if and only if the NSP bit is set."]
39    #[inline(always)]
40    pub fn nsu(&self) -> NSU_R {
41        NSU_R::new((self.bits & 1) != 0)
42    }
43    #[doc = "Bit 1 - If 1, TICKS can be accessed from a Non-secure, Privileged context."]
44    #[inline(always)]
45    pub fn nsp(&self) -> NSP_R {
46        NSP_R::new(((self.bits >> 1) & 1) != 0)
47    }
48    #[doc = "Bit 2 - If 1, and SP is also set, TICKS can be accessed from a Secure, Unprivileged context."]
49    #[inline(always)]
50    pub fn su(&self) -> SU_R {
51        SU_R::new(((self.bits >> 2) & 1) != 0)
52    }
53    #[doc = "Bit 3 - If 1, TICKS can be accessed from a Secure, Privileged context."]
54    #[inline(always)]
55    pub fn sp(&self) -> SP_R {
56        SP_R::new(((self.bits >> 3) & 1) != 0)
57    }
58    #[doc = "Bit 4 - If 1, TICKS can be accessed by core 0, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
59    #[inline(always)]
60    pub fn core0(&self) -> CORE0_R {
61        CORE0_R::new(((self.bits >> 4) & 1) != 0)
62    }
63    #[doc = "Bit 5 - If 1, TICKS can be accessed by core 1, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
64    #[inline(always)]
65    pub fn core1(&self) -> CORE1_R {
66        CORE1_R::new(((self.bits >> 5) & 1) != 0)
67    }
68    #[doc = "Bit 6 - If 1, TICKS can be accessed by the DMA, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
69    #[inline(always)]
70    pub fn dma(&self) -> DMA_R {
71        DMA_R::new(((self.bits >> 6) & 1) != 0)
72    }
73    #[doc = "Bit 7 - If 1, TICKS can be accessed by the debugger, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
74    #[inline(always)]
75    pub fn dbg(&self) -> DBG_R {
76        DBG_R::new(((self.bits >> 7) & 1) != 0)
77    }
78}
79impl W {
80    #[doc = "Bit 0 - If 1, and NSP is also set, TICKS can be accessed from a Non-secure, Unprivileged context. This bit is writable from a Non-secure, Privileged context, if and only if the NSP bit is set."]
81    #[inline(always)]
82    #[must_use]
83    pub fn nsu(&mut self) -> NSU_W<TICKS_SPEC> {
84        NSU_W::new(self, 0)
85    }
86    #[doc = "Bit 1 - If 1, TICKS can be accessed from a Non-secure, Privileged context."]
87    #[inline(always)]
88    #[must_use]
89    pub fn nsp(&mut self) -> NSP_W<TICKS_SPEC> {
90        NSP_W::new(self, 1)
91    }
92    #[doc = "Bit 2 - If 1, and SP is also set, TICKS can be accessed from a Secure, Unprivileged context."]
93    #[inline(always)]
94    #[must_use]
95    pub fn su(&mut self) -> SU_W<TICKS_SPEC> {
96        SU_W::new(self, 2)
97    }
98    #[doc = "Bit 3 - If 1, TICKS can be accessed from a Secure, Privileged context."]
99    #[inline(always)]
100    #[must_use]
101    pub fn sp(&mut self) -> SP_W<TICKS_SPEC> {
102        SP_W::new(self, 3)
103    }
104    #[doc = "Bit 4 - If 1, TICKS can be accessed by core 0, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
105    #[inline(always)]
106    #[must_use]
107    pub fn core0(&mut self) -> CORE0_W<TICKS_SPEC> {
108        CORE0_W::new(self, 4)
109    }
110    #[doc = "Bit 5 - If 1, TICKS can be accessed by core 1, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
111    #[inline(always)]
112    #[must_use]
113    pub fn core1(&mut self) -> CORE1_W<TICKS_SPEC> {
114        CORE1_W::new(self, 5)
115    }
116    #[doc = "Bit 6 - If 1, TICKS can be accessed by the DMA, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
117    #[inline(always)]
118    #[must_use]
119    pub fn dma(&mut self) -> DMA_W<TICKS_SPEC> {
120        DMA_W::new(self, 6)
121    }
122    #[doc = "Bit 7 - If 1, TICKS can be accessed by the debugger, at security/privilege levels permitted by SP/NSP/SU/NSU in this register."]
123    #[inline(always)]
124    #[must_use]
125    pub fn dbg(&mut self) -> DBG_W<TICKS_SPEC> {
126        DBG_W::new(self, 7)
127    }
128}
129#[doc = "Control whether debugger, DMA, core 0 and core 1 can access TICKS, and at what security/privilege levels they can do so. Defaults to Secure, Privileged processor or debug access only. This register is writable only from a Secure, Privileged processor or debugger, with the exception of the NSU bit, which becomes Non-secure-Privileged-writable when the NSP bit is set.  
130
131You can [`read`](crate::Reg::read) this register and get [`ticks::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ticks::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
132pub struct TICKS_SPEC;
133impl crate::RegisterSpec for TICKS_SPEC {
134    type Ux = u32;
135}
136#[doc = "`read()` method returns [`ticks::R`](R) reader structure"]
137impl crate::Readable for TICKS_SPEC {}
138#[doc = "`write(|w| ..)` method takes [`ticks::W`](W) writer structure"]
139impl crate::Writable for TICKS_SPEC {
140    type Safety = crate::Unsafe;
141    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
142    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
143}
144#[doc = "`reset()` method sets TICKS to value 0xb8"]
145impl crate::Resettable for TICKS_SPEC {
146    const RESET_VALUE: u32 = 0xb8;
147}