esp32p4/trace0/
filter_control.rs

1#[doc = "Register `FILTER_CONTROL` reader"]
2pub type R = crate::R<FILTER_CONTROL_SPEC>;
3#[doc = "Register `FILTER_CONTROL` writer"]
4pub type W = crate::W<FILTER_CONTROL_SPEC>;
5#[doc = "Field `FILTER_EN` reader - Configure whether or not enable filter unit. \\\\1: enable filter.\\\\ 0: always match"]
6pub type FILTER_EN_R = crate::BitReader;
7#[doc = "Field `FILTER_EN` writer - Configure whether or not enable filter unit. \\\\1: enable filter.\\\\ 0: always match"]
8pub type FILTER_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `MATCH_COMP` reader - when set, the comparator must be high in order for the filter to match"]
10pub type MATCH_COMP_R = crate::BitReader;
11#[doc = "Field `MATCH_COMP` writer - when set, the comparator must be high in order for the filter to match"]
12pub type MATCH_COMP_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `MATCH_PRIVILEGE` reader - when set, match privilege levels specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEPRIVILEGE\\]{TRACE_MATCH_CHOICE_PRIVILEGE}."]
14pub type MATCH_PRIVILEGE_R = crate::BitReader;
15#[doc = "Field `MATCH_PRIVILEGE` writer - when set, match privilege levels specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEPRIVILEGE\\]{TRACE_MATCH_CHOICE_PRIVILEGE}."]
16pub type MATCH_PRIVILEGE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `MATCH_ECAUSE` reader - when set, start matching from exception cause codes specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEECAUSE\\]{TRACE_MATCH_CHOICE_ECAUSE}, and stop matching upon return from the 1st matching exception."]
18pub type MATCH_ECAUSE_R = crate::BitReader;
19#[doc = "Field `MATCH_ECAUSE` writer - when set, start matching from exception cause codes specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEECAUSE\\]{TRACE_MATCH_CHOICE_ECAUSE}, and stop matching upon return from the 1st matching exception."]
20pub type MATCH_ECAUSE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `MATCH_INTERRUPT` reader - when set, start matching from a trap with the interrupt level codes specified by \\hyperref\\[fielddesc:TRACEMATCHVALUEINTERRUPT\\]{TRACE_MATCH_VALUE_INTERRUPT}, and stop matching upon return from the 1st matching trap."]
22pub type MATCH_INTERRUPT_R = crate::BitReader;
23#[doc = "Field `MATCH_INTERRUPT` writer - when set, start matching from a trap with the interrupt level codes specified by \\hyperref\\[fielddesc:TRACEMATCHVALUEINTERRUPT\\]{TRACE_MATCH_VALUE_INTERRUPT}, and stop matching upon return from the 1st matching trap."]
24pub type MATCH_INTERRUPT_W<'a, REG> = crate::BitWriter<'a, REG>;
25impl R {
26    #[doc = "Bit 0 - Configure whether or not enable filter unit. \\\\1: enable filter.\\\\ 0: always match"]
27    #[inline(always)]
28    pub fn filter_en(&self) -> FILTER_EN_R {
29        FILTER_EN_R::new((self.bits & 1) != 0)
30    }
31    #[doc = "Bit 1 - when set, the comparator must be high in order for the filter to match"]
32    #[inline(always)]
33    pub fn match_comp(&self) -> MATCH_COMP_R {
34        MATCH_COMP_R::new(((self.bits >> 1) & 1) != 0)
35    }
36    #[doc = "Bit 2 - when set, match privilege levels specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEPRIVILEGE\\]{TRACE_MATCH_CHOICE_PRIVILEGE}."]
37    #[inline(always)]
38    pub fn match_privilege(&self) -> MATCH_PRIVILEGE_R {
39        MATCH_PRIVILEGE_R::new(((self.bits >> 2) & 1) != 0)
40    }
41    #[doc = "Bit 3 - when set, start matching from exception cause codes specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEECAUSE\\]{TRACE_MATCH_CHOICE_ECAUSE}, and stop matching upon return from the 1st matching exception."]
42    #[inline(always)]
43    pub fn match_ecause(&self) -> MATCH_ECAUSE_R {
44        MATCH_ECAUSE_R::new(((self.bits >> 3) & 1) != 0)
45    }
46    #[doc = "Bit 4 - when set, start matching from a trap with the interrupt level codes specified by \\hyperref\\[fielddesc:TRACEMATCHVALUEINTERRUPT\\]{TRACE_MATCH_VALUE_INTERRUPT}, and stop matching upon return from the 1st matching trap."]
47    #[inline(always)]
48    pub fn match_interrupt(&self) -> MATCH_INTERRUPT_R {
49        MATCH_INTERRUPT_R::new(((self.bits >> 4) & 1) != 0)
50    }
51}
52#[cfg(feature = "impl-register-debug")]
53impl core::fmt::Debug for R {
54    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
55        f.debug_struct("FILTER_CONTROL")
56            .field("filter_en", &format_args!("{}", self.filter_en().bit()))
57            .field("match_comp", &format_args!("{}", self.match_comp().bit()))
58            .field(
59                "match_privilege",
60                &format_args!("{}", self.match_privilege().bit()),
61            )
62            .field(
63                "match_ecause",
64                &format_args!("{}", self.match_ecause().bit()),
65            )
66            .field(
67                "match_interrupt",
68                &format_args!("{}", self.match_interrupt().bit()),
69            )
70            .finish()
71    }
72}
73#[cfg(feature = "impl-register-debug")]
74impl core::fmt::Debug for crate::generic::Reg<FILTER_CONTROL_SPEC> {
75    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
76        core::fmt::Debug::fmt(&self.read(), f)
77    }
78}
79impl W {
80    #[doc = "Bit 0 - Configure whether or not enable filter unit. \\\\1: enable filter.\\\\ 0: always match"]
81    #[inline(always)]
82    #[must_use]
83    pub fn filter_en(&mut self) -> FILTER_EN_W<FILTER_CONTROL_SPEC> {
84        FILTER_EN_W::new(self, 0)
85    }
86    #[doc = "Bit 1 - when set, the comparator must be high in order for the filter to match"]
87    #[inline(always)]
88    #[must_use]
89    pub fn match_comp(&mut self) -> MATCH_COMP_W<FILTER_CONTROL_SPEC> {
90        MATCH_COMP_W::new(self, 1)
91    }
92    #[doc = "Bit 2 - when set, match privilege levels specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEPRIVILEGE\\]{TRACE_MATCH_CHOICE_PRIVILEGE}."]
93    #[inline(always)]
94    #[must_use]
95    pub fn match_privilege(&mut self) -> MATCH_PRIVILEGE_W<FILTER_CONTROL_SPEC> {
96        MATCH_PRIVILEGE_W::new(self, 2)
97    }
98    #[doc = "Bit 3 - when set, start matching from exception cause codes specified by \\hyperref\\[fielddesc:TRACEMATCHCHOICEECAUSE\\]{TRACE_MATCH_CHOICE_ECAUSE}, and stop matching upon return from the 1st matching exception."]
99    #[inline(always)]
100    #[must_use]
101    pub fn match_ecause(&mut self) -> MATCH_ECAUSE_W<FILTER_CONTROL_SPEC> {
102        MATCH_ECAUSE_W::new(self, 3)
103    }
104    #[doc = "Bit 4 - when set, start matching from a trap with the interrupt level codes specified by \\hyperref\\[fielddesc:TRACEMATCHVALUEINTERRUPT\\]{TRACE_MATCH_VALUE_INTERRUPT}, and stop matching upon return from the 1st matching trap."]
105    #[inline(always)]
106    #[must_use]
107    pub fn match_interrupt(&mut self) -> MATCH_INTERRUPT_W<FILTER_CONTROL_SPEC> {
108        MATCH_INTERRUPT_W::new(self, 4)
109    }
110}
111#[doc = "filter control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`filter_control::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 [`filter_control::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
112pub struct FILTER_CONTROL_SPEC;
113impl crate::RegisterSpec for FILTER_CONTROL_SPEC {
114    type Ux = u32;
115}
116#[doc = "`read()` method returns [`filter_control::R`](R) reader structure"]
117impl crate::Readable for FILTER_CONTROL_SPEC {}
118#[doc = "`write(|w| ..)` method takes [`filter_control::W`](W) writer structure"]
119impl crate::Writable for FILTER_CONTROL_SPEC {
120    type Safety = crate::Unsafe;
121    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
122    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
123}
124#[doc = "`reset()` method sets FILTER_CONTROL to value 0"]
125impl crate::Resettable for FILTER_CONTROL_SPEC {
126    const RESET_VALUE: u32 = 0;
127}