esp32c6_lp/lp_wdt/
swd_config.rs

1#[doc = "Register `SWD_CONFIG` reader"]
2pub type R = crate::R<SWD_CONFIG_SPEC>;
3#[doc = "Register `SWD_CONFIG` writer"]
4pub type W = crate::W<SWD_CONFIG_SPEC>;
5#[doc = "Field `SWD_RESET_FLAG` reader - need_des"]
6pub type SWD_RESET_FLAG_R = crate::BitReader;
7#[doc = "Field `SWD_AUTO_FEED_EN` reader - need_des"]
8pub type SWD_AUTO_FEED_EN_R = crate::BitReader;
9#[doc = "Field `SWD_AUTO_FEED_EN` writer - need_des"]
10pub type SWD_AUTO_FEED_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `SWD_RST_FLAG_CLR` writer - need_des"]
12pub type SWD_RST_FLAG_CLR_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `SWD_SIGNAL_WIDTH` reader - need_des"]
14pub type SWD_SIGNAL_WIDTH_R = crate::FieldReader<u16>;
15#[doc = "Field `SWD_SIGNAL_WIDTH` writer - need_des"]
16pub type SWD_SIGNAL_WIDTH_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
17#[doc = "Field `SWD_DISABLE` reader - need_des"]
18pub type SWD_DISABLE_R = crate::BitReader;
19#[doc = "Field `SWD_DISABLE` writer - need_des"]
20pub type SWD_DISABLE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SWD_FEED` writer - need_des"]
22pub type SWD_FEED_W<'a, REG> = crate::BitWriter<'a, REG>;
23impl R {
24    #[doc = "Bit 0 - need_des"]
25    #[inline(always)]
26    pub fn swd_reset_flag(&self) -> SWD_RESET_FLAG_R {
27        SWD_RESET_FLAG_R::new((self.bits & 1) != 0)
28    }
29    #[doc = "Bit 18 - need_des"]
30    #[inline(always)]
31    pub fn swd_auto_feed_en(&self) -> SWD_AUTO_FEED_EN_R {
32        SWD_AUTO_FEED_EN_R::new(((self.bits >> 18) & 1) != 0)
33    }
34    #[doc = "Bits 20:29 - need_des"]
35    #[inline(always)]
36    pub fn swd_signal_width(&self) -> SWD_SIGNAL_WIDTH_R {
37        SWD_SIGNAL_WIDTH_R::new(((self.bits >> 20) & 0x03ff) as u16)
38    }
39    #[doc = "Bit 30 - need_des"]
40    #[inline(always)]
41    pub fn swd_disable(&self) -> SWD_DISABLE_R {
42        SWD_DISABLE_R::new(((self.bits >> 30) & 1) != 0)
43    }
44}
45#[cfg(feature = "impl-register-debug")]
46impl core::fmt::Debug for R {
47    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
48        f.debug_struct("SWD_CONFIG")
49            .field("swd_reset_flag", &self.swd_reset_flag())
50            .field("swd_auto_feed_en", &self.swd_auto_feed_en())
51            .field("swd_signal_width", &self.swd_signal_width())
52            .field("swd_disable", &self.swd_disable())
53            .finish()
54    }
55}
56impl W {
57    #[doc = "Bit 18 - need_des"]
58    #[inline(always)]
59    #[must_use]
60    pub fn swd_auto_feed_en(&mut self) -> SWD_AUTO_FEED_EN_W<SWD_CONFIG_SPEC> {
61        SWD_AUTO_FEED_EN_W::new(self, 18)
62    }
63    #[doc = "Bit 19 - need_des"]
64    #[inline(always)]
65    #[must_use]
66    pub fn swd_rst_flag_clr(&mut self) -> SWD_RST_FLAG_CLR_W<SWD_CONFIG_SPEC> {
67        SWD_RST_FLAG_CLR_W::new(self, 19)
68    }
69    #[doc = "Bits 20:29 - need_des"]
70    #[inline(always)]
71    #[must_use]
72    pub fn swd_signal_width(&mut self) -> SWD_SIGNAL_WIDTH_W<SWD_CONFIG_SPEC> {
73        SWD_SIGNAL_WIDTH_W::new(self, 20)
74    }
75    #[doc = "Bit 30 - need_des"]
76    #[inline(always)]
77    #[must_use]
78    pub fn swd_disable(&mut self) -> SWD_DISABLE_W<SWD_CONFIG_SPEC> {
79        SWD_DISABLE_W::new(self, 30)
80    }
81    #[doc = "Bit 31 - need_des"]
82    #[inline(always)]
83    #[must_use]
84    pub fn swd_feed(&mut self) -> SWD_FEED_W<SWD_CONFIG_SPEC> {
85        SWD_FEED_W::new(self, 31)
86    }
87}
88#[doc = "need_des\n\nYou can [`read`](crate::Reg::read) this register and get [`swd_config::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swd_config::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
89pub struct SWD_CONFIG_SPEC;
90impl crate::RegisterSpec for SWD_CONFIG_SPEC {
91    type Ux = u32;
92}
93#[doc = "`read()` method returns [`swd_config::R`](R) reader structure"]
94impl crate::Readable for SWD_CONFIG_SPEC {}
95#[doc = "`write(|w| ..)` method takes [`swd_config::W`](W) writer structure"]
96impl crate::Writable for SWD_CONFIG_SPEC {
97    type Safety = crate::Unsafe;
98    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
99    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
100}
101#[doc = "`reset()` method sets SWD_CONFIG to value 0x12c0_0000"]
102impl crate::Resettable for SWD_CONFIG_SPEC {
103    const RESET_VALUE: u32 = 0x12c0_0000;
104}