esp32p4/trace0/
trigger.rs

1#[doc = "Register `TRIGGER` reader"]
2pub type R = crate::R<TRIGGER_SPEC>;
3#[doc = "Register `TRIGGER` writer"]
4pub type W = crate::W<TRIGGER_SPEC>;
5#[doc = "Field `ON` writer - Configure whether or not start trace.\\\\1: start trace \\\\0: invalid\\\\"]
6pub type ON_W<'a, REG> = crate::BitWriter<'a, REG>;
7#[doc = "Field `OFF` writer - Configure whether or not stop trace.\\\\1: stop trace \\\\0: invalid\\\\"]
8pub type OFF_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `MEM_LOOP` reader - Configure memory loop mode. \\\\1: trace will loop wrtie trace_mem. \\\\0: when mem_current_addr at mem_end_addr, it will stop at the mem_end_addr\\\\"]
10pub type MEM_LOOP_R = crate::BitReader;
11#[doc = "Field `MEM_LOOP` writer - Configure memory loop mode. \\\\1: trace will loop wrtie trace_mem. \\\\0: when mem_current_addr at mem_end_addr, it will stop at the mem_end_addr\\\\"]
12pub type MEM_LOOP_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `RESTART_ENA` reader - Configure whether or not enable auto-restart.\\\\1: enable\\\\0: disable\\\\"]
14pub type RESTART_ENA_R = crate::BitReader;
15#[doc = "Field `RESTART_ENA` writer - Configure whether or not enable auto-restart.\\\\1: enable\\\\0: disable\\\\"]
16pub type RESTART_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bit 2 - Configure memory loop mode. \\\\1: trace will loop wrtie trace_mem. \\\\0: when mem_current_addr at mem_end_addr, it will stop at the mem_end_addr\\\\"]
19    #[inline(always)]
20    pub fn mem_loop(&self) -> MEM_LOOP_R {
21        MEM_LOOP_R::new(((self.bits >> 2) & 1) != 0)
22    }
23    #[doc = "Bit 3 - Configure whether or not enable auto-restart.\\\\1: enable\\\\0: disable\\\\"]
24    #[inline(always)]
25    pub fn restart_ena(&self) -> RESTART_ENA_R {
26        RESTART_ENA_R::new(((self.bits >> 3) & 1) != 0)
27    }
28}
29#[cfg(feature = "impl-register-debug")]
30impl core::fmt::Debug for R {
31    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
32        f.debug_struct("TRIGGER")
33            .field("mem_loop", &format_args!("{}", self.mem_loop().bit()))
34            .field("restart_ena", &format_args!("{}", self.restart_ena().bit()))
35            .finish()
36    }
37}
38#[cfg(feature = "impl-register-debug")]
39impl core::fmt::Debug for crate::generic::Reg<TRIGGER_SPEC> {
40    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
41        core::fmt::Debug::fmt(&self.read(), f)
42    }
43}
44impl W {
45    #[doc = "Bit 0 - Configure whether or not start trace.\\\\1: start trace \\\\0: invalid\\\\"]
46    #[inline(always)]
47    #[must_use]
48    pub fn on(&mut self) -> ON_W<TRIGGER_SPEC> {
49        ON_W::new(self, 0)
50    }
51    #[doc = "Bit 1 - Configure whether or not stop trace.\\\\1: stop trace \\\\0: invalid\\\\"]
52    #[inline(always)]
53    #[must_use]
54    pub fn off(&mut self) -> OFF_W<TRIGGER_SPEC> {
55        OFF_W::new(self, 1)
56    }
57    #[doc = "Bit 2 - Configure memory loop mode. \\\\1: trace will loop wrtie trace_mem. \\\\0: when mem_current_addr at mem_end_addr, it will stop at the mem_end_addr\\\\"]
58    #[inline(always)]
59    #[must_use]
60    pub fn mem_loop(&mut self) -> MEM_LOOP_W<TRIGGER_SPEC> {
61        MEM_LOOP_W::new(self, 2)
62    }
63    #[doc = "Bit 3 - Configure whether or not enable auto-restart.\\\\1: enable\\\\0: disable\\\\"]
64    #[inline(always)]
65    #[must_use]
66    pub fn restart_ena(&mut self) -> RESTART_ENA_W<TRIGGER_SPEC> {
67        RESTART_ENA_W::new(self, 3)
68    }
69}
70#[doc = "trigger register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`trigger::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 [`trigger::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
71pub struct TRIGGER_SPEC;
72impl crate::RegisterSpec for TRIGGER_SPEC {
73    type Ux = u32;
74}
75#[doc = "`read()` method returns [`trigger::R`](R) reader structure"]
76impl crate::Readable for TRIGGER_SPEC {}
77#[doc = "`write(|w| ..)` method takes [`trigger::W`](W) writer structure"]
78impl crate::Writable for TRIGGER_SPEC {
79    type Safety = crate::Unsafe;
80    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
82}
83#[doc = "`reset()` method sets TRIGGER to value 0x0c"]
84impl crate::Resettable for TRIGGER_SPEC {
85    const RESET_VALUE: u32 = 0x0c;
86}