eos_s3/misc/
a0_dbg_mon_sel.rs

1#[doc = "Register `A0_DBG_MON_SEL` reader"]
2pub struct R(crate::R<A0_DBG_MON_SEL_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<A0_DBG_MON_SEL_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<A0_DBG_MON_SEL_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<A0_DBG_MON_SEL_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `A0_DBG_MON_SEL` writer"]
17pub struct W(crate::W<A0_DBG_MON_SEL_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<A0_DBG_MON_SEL_SPEC>;
20    #[inline(always)]
21    fn deref(&self) -> &Self::Target {
22        &self.0
23    }
24}
25impl core::ops::DerefMut for W {
26    #[inline(always)]
27    fn deref_mut(&mut self) -> &mut Self::Target {
28        &mut self.0
29    }
30}
31impl From<crate::W<A0_DBG_MON_SEL_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<A0_DBG_MON_SEL_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Select debug monitors\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39#[repr(u8)]
40pub enum A0_DEBUG_MON_SEL_A {
41    #[doc = "0: Selects the PMU monitor as the monitor for the A0 subsystem"]
42    USE_PMU_MONITOR = 0,
43    #[doc = "1: Selects the CRU monitor as the monitor for the A0 subsystem"]
44    USE_CRU_MONITOR = 1,
45}
46impl From<A0_DEBUG_MON_SEL_A> for u8 {
47    #[inline(always)]
48    fn from(variant: A0_DEBUG_MON_SEL_A) -> Self {
49        variant as _
50    }
51}
52#[doc = "Field `A0_DEBUG_MON_SEL` reader - Select debug monitors"]
53pub struct A0_DEBUG_MON_SEL_R(crate::FieldReader<u8, A0_DEBUG_MON_SEL_A>);
54impl A0_DEBUG_MON_SEL_R {
55    #[inline(always)]
56    pub(crate) fn new(bits: u8) -> Self {
57        A0_DEBUG_MON_SEL_R(crate::FieldReader::new(bits))
58    }
59    #[doc = r"Get enumerated values variant"]
60    #[inline(always)]
61    pub fn variant(&self) -> Option<A0_DEBUG_MON_SEL_A> {
62        match self.bits {
63            0 => Some(A0_DEBUG_MON_SEL_A::USE_PMU_MONITOR),
64            1 => Some(A0_DEBUG_MON_SEL_A::USE_CRU_MONITOR),
65            _ => None,
66        }
67    }
68    #[doc = "Checks if the value of the field is `USE_PMU_MONITOR`"]
69    #[inline(always)]
70    pub fn is_use_pmu_monitor(&self) -> bool {
71        **self == A0_DEBUG_MON_SEL_A::USE_PMU_MONITOR
72    }
73    #[doc = "Checks if the value of the field is `USE_CRU_MONITOR`"]
74    #[inline(always)]
75    pub fn is_use_cru_monitor(&self) -> bool {
76        **self == A0_DEBUG_MON_SEL_A::USE_CRU_MONITOR
77    }
78}
79impl core::ops::Deref for A0_DEBUG_MON_SEL_R {
80    type Target = crate::FieldReader<u8, A0_DEBUG_MON_SEL_A>;
81    #[inline(always)]
82    fn deref(&self) -> &Self::Target {
83        &self.0
84    }
85}
86#[doc = "Field `A0_DEBUG_MON_SEL` writer - Select debug monitors"]
87pub struct A0_DEBUG_MON_SEL_W<'a> {
88    w: &'a mut W,
89}
90impl<'a> A0_DEBUG_MON_SEL_W<'a> {
91    #[doc = r"Writes `variant` to the field"]
92    #[inline(always)]
93    pub fn variant(self, variant: A0_DEBUG_MON_SEL_A) -> &'a mut W {
94        unsafe { self.bits(variant.into()) }
95    }
96    #[doc = "Selects the PMU monitor as the monitor for the A0 subsystem"]
97    #[inline(always)]
98    pub fn use_pmu_monitor(self) -> &'a mut W {
99        self.variant(A0_DEBUG_MON_SEL_A::USE_PMU_MONITOR)
100    }
101    #[doc = "Selects the CRU monitor as the monitor for the A0 subsystem"]
102    #[inline(always)]
103    pub fn use_cru_monitor(self) -> &'a mut W {
104        self.variant(A0_DEBUG_MON_SEL_A::USE_CRU_MONITOR)
105    }
106    #[doc = r"Writes raw bits to the field"]
107    #[inline(always)]
108    pub unsafe fn bits(self, value: u8) -> &'a mut W {
109        self.w.bits = (self.w.bits & !0x07) | (value as u32 & 0x07);
110        self.w
111    }
112}
113impl R {
114    #[doc = "Bits 0:2 - Select debug monitors"]
115    #[inline(always)]
116    pub fn a0_debug_mon_sel(&self) -> A0_DEBUG_MON_SEL_R {
117        A0_DEBUG_MON_SEL_R::new((self.bits & 0x07) as u8)
118    }
119}
120impl W {
121    #[doc = "Bits 0:2 - Select debug monitors"]
122    #[inline(always)]
123    pub fn a0_debug_mon_sel(&mut self) -> A0_DEBUG_MON_SEL_W {
124        A0_DEBUG_MON_SEL_W { w: self }
125    }
126    #[doc = "Writes raw bits to the register."]
127    #[inline(always)]
128    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
129        self.0.bits(bits);
130        self
131    }
132}
133#[doc = "Select A0 debug monitors\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [a0_dbg_mon_sel](index.html) module"]
134pub struct A0_DBG_MON_SEL_SPEC;
135impl crate::RegisterSpec for A0_DBG_MON_SEL_SPEC {
136    type Ux = u32;
137}
138#[doc = "`read()` method returns [a0_dbg_mon_sel::R](R) reader structure"]
139impl crate::Readable for A0_DBG_MON_SEL_SPEC {
140    type Reader = R;
141}
142#[doc = "`write(|w| ..)` method takes [a0_dbg_mon_sel::W](W) writer structure"]
143impl crate::Writable for A0_DBG_MON_SEL_SPEC {
144    type Writer = W;
145}
146#[doc = "`reset()` method sets A0_DBG_MON_SEL to value 0"]
147impl crate::Resettable for A0_DBG_MON_SEL_SPEC {
148    #[inline(always)]
149    fn reset_value() -> Self::Ux {
150        0
151    }
152}