#[doc = "Register `TPR` reader"]
pub type R = crate::R<TprSpec>;
#[doc = "Register `TPR` writer"]
pub type W = crate::W<TprSpec>;
#[doc = "Field `PRIVMASK` reader - 3:0\\]
Bit mask to enable unprivileged (User) access to ITM stimulus ports: Bit \\[0\\]
enables stimulus ports 0, 1, ..., and 7. Bit \\[1\\]
enables stimulus ports 8, 9, ..., and 15. Bit \\[2\\]
enables stimulus ports 16, 17, ..., and 23. Bit \\[3\\]
enables stimulus ports 24, 25, ..., and 31. 0: User access allowed to stimulus ports 1: Privileged access only to stimulus ports"]
pub type PrivmaskR = crate::FieldReader;
#[doc = "Field `PRIVMASK` writer - 3:0\\]
Bit mask to enable unprivileged (User) access to ITM stimulus ports: Bit \\[0\\]
enables stimulus ports 0, 1, ..., and 7. Bit \\[1\\]
enables stimulus ports 8, 9, ..., and 15. Bit \\[2\\]
enables stimulus ports 16, 17, ..., and 23. Bit \\[3\\]
enables stimulus ports 24, 25, ..., and 31. 0: User access allowed to stimulus ports 1: Privileged access only to stimulus ports"]
pub type PrivmaskW<'a, REG> = crate::FieldWriter<'a, REG, 4>;
#[doc = "Field `RESERVED4` reader - 31:4\\]
Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
pub type Reserved4R = crate::FieldReader<u32>;
#[doc = "Field `RESERVED4` writer - 31:4\\]
Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
pub type Reserved4W<'a, REG> = crate::FieldWriter<'a, REG, 28, u32>;
impl R {
#[doc = "Bits 0:3 - 3:0\\]
Bit mask to enable unprivileged (User) access to ITM stimulus ports: Bit \\[0\\]
enables stimulus ports 0, 1, ..., and 7. Bit \\[1\\]
enables stimulus ports 8, 9, ..., and 15. Bit \\[2\\]
enables stimulus ports 16, 17, ..., and 23. Bit \\[3\\]
enables stimulus ports 24, 25, ..., and 31. 0: User access allowed to stimulus ports 1: Privileged access only to stimulus ports"]
#[inline(always)]
pub fn privmask(&self) -> PrivmaskR {
PrivmaskR::new((self.bits & 0x0f) as u8)
}
#[doc = "Bits 4:31 - 31:4\\]
Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
#[inline(always)]
pub fn reserved4(&self) -> Reserved4R {
Reserved4R::new((self.bits >> 4) & 0x0fff_ffff)
}
}
impl W {
#[doc = "Bits 0:3 - 3:0\\]
Bit mask to enable unprivileged (User) access to ITM stimulus ports: Bit \\[0\\]
enables stimulus ports 0, 1, ..., and 7. Bit \\[1\\]
enables stimulus ports 8, 9, ..., and 15. Bit \\[2\\]
enables stimulus ports 16, 17, ..., and 23. Bit \\[3\\]
enables stimulus ports 24, 25, ..., and 31. 0: User access allowed to stimulus ports 1: Privileged access only to stimulus ports"]
#[inline(always)]
#[must_use]
pub fn privmask(&mut self) -> PrivmaskW<TprSpec> {
PrivmaskW::new(self, 0)
}
#[doc = "Bits 4:31 - 31:4\\]
Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."]
#[inline(always)]
#[must_use]
pub fn reserved4(&mut self) -> Reserved4W<TprSpec> {
Reserved4W::new(self, 4)
}
}
#[doc = "Trace Privilege This register is used to enable an operating system to control which stimulus ports are accessible by user code. This register can only be used in privileged mode.\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`tpr::R`](R). You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`tpr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
pub struct TprSpec;
impl crate::RegisterSpec for TprSpec {
type Ux = u32;
}
#[doc = "`read()` method returns [`tpr::R`](R) reader structure"]
impl crate::Readable for TprSpec {}
#[doc = "`write(|w| ..)` method takes [`tpr::W`](W) writer structure"]
impl crate::Writable for TprSpec {
type Safety = crate::Unsafe;
const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
}
#[doc = "`reset()` method sets TPR to value 0"]
impl crate::Resettable for TprSpec {
const RESET_VALUE: u32 = 0;
}