esp32c3/assist_debug/
log_setting.rs

1#[doc = "Register `LOG_SETTING` reader"]
2pub type R = crate::R<LOG_SETTING_SPEC>;
3#[doc = "Register `LOG_SETTING` writer"]
4pub type W = crate::W<LOG_SETTING_SPEC>;
5#[doc = "Field `LOG_ENA` reader - reg_log_ena"]
6pub type LOG_ENA_R = crate::FieldReader;
7#[doc = "Field `LOG_ENA` writer - reg_log_ena"]
8pub type LOG_ENA_W<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `LOG_MODE` reader - reg_log_mode"]
10pub type LOG_MODE_R = crate::FieldReader;
11#[doc = "Field `LOG_MODE` writer - reg_log_mode"]
12pub type LOG_MODE_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
13#[doc = "Field `LOG_MEM_LOOP_ENABLE` reader - reg_log_mem_loop_enable"]
14pub type LOG_MEM_LOOP_ENABLE_R = crate::BitReader;
15#[doc = "Field `LOG_MEM_LOOP_ENABLE` writer - reg_log_mem_loop_enable"]
16pub type LOG_MEM_LOOP_ENABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bits 0:2 - reg_log_ena"]
19    #[inline(always)]
20    pub fn log_ena(&self) -> LOG_ENA_R {
21        LOG_ENA_R::new((self.bits & 7) as u8)
22    }
23    #[doc = "Bits 3:6 - reg_log_mode"]
24    #[inline(always)]
25    pub fn log_mode(&self) -> LOG_MODE_R {
26        LOG_MODE_R::new(((self.bits >> 3) & 0x0f) as u8)
27    }
28    #[doc = "Bit 7 - reg_log_mem_loop_enable"]
29    #[inline(always)]
30    pub fn log_mem_loop_enable(&self) -> LOG_MEM_LOOP_ENABLE_R {
31        LOG_MEM_LOOP_ENABLE_R::new(((self.bits >> 7) & 1) != 0)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("LOG_SETTING")
38            .field("log_ena", &self.log_ena())
39            .field("log_mode", &self.log_mode())
40            .field("log_mem_loop_enable", &self.log_mem_loop_enable())
41            .finish()
42    }
43}
44impl W {
45    #[doc = "Bits 0:2 - reg_log_ena"]
46    #[inline(always)]
47    pub fn log_ena(&mut self) -> LOG_ENA_W<LOG_SETTING_SPEC> {
48        LOG_ENA_W::new(self, 0)
49    }
50    #[doc = "Bits 3:6 - reg_log_mode"]
51    #[inline(always)]
52    pub fn log_mode(&mut self) -> LOG_MODE_W<LOG_SETTING_SPEC> {
53        LOG_MODE_W::new(self, 3)
54    }
55    #[doc = "Bit 7 - reg_log_mem_loop_enable"]
56    #[inline(always)]
57    pub fn log_mem_loop_enable(&mut self) -> LOG_MEM_LOOP_ENABLE_W<LOG_SETTING_SPEC> {
58        LOG_MEM_LOOP_ENABLE_W::new(self, 7)
59    }
60}
61#[doc = "ASSIST_DEBUG_LOG_SETTING\n\nYou can [`read`](crate::Reg::read) this register and get [`log_setting::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`log_setting::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
62pub struct LOG_SETTING_SPEC;
63impl crate::RegisterSpec for LOG_SETTING_SPEC {
64    type Ux = u32;
65}
66#[doc = "`read()` method returns [`log_setting::R`](R) reader structure"]
67impl crate::Readable for LOG_SETTING_SPEC {}
68#[doc = "`write(|w| ..)` method takes [`log_setting::W`](W) writer structure"]
69impl crate::Writable for LOG_SETTING_SPEC {
70    type Safety = crate::Unsafe;
71    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
72    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
73}
74#[doc = "`reset()` method sets LOG_SETTING to value 0x80"]
75impl crate::Resettable for LOG_SETTING_SPEC {
76    const RESET_VALUE: u32 = 0x80;
77}