rp2040_pac/syscfg/
dbgforce.rs

1#[doc = "Register `DBGFORCE` reader"]
2pub type R = crate::R<DBGFORCE_SPEC>;
3#[doc = "Register `DBGFORCE` writer"]
4pub type W = crate::W<DBGFORCE_SPEC>;
5#[doc = "Field `PROC0_SWDO` reader - Observe the value of processor 0 SWDIO output."]
6pub type PROC0_SWDO_R = crate::BitReader;
7#[doc = "Field `PROC0_SWDI` reader - Directly drive processor 0 SWDIO input, if PROC0_ATTACH is set"]
8pub type PROC0_SWDI_R = crate::BitReader;
9#[doc = "Field `PROC0_SWDI` writer - Directly drive processor 0 SWDIO input, if PROC0_ATTACH is set"]
10pub type PROC0_SWDI_W<'a, REG> = crate::BitWriter<'a, REG>;
11#[doc = "Field `PROC0_SWCLK` reader - Directly drive processor 0 SWCLK, if PROC0_ATTACH is set"]
12pub type PROC0_SWCLK_R = crate::BitReader;
13#[doc = "Field `PROC0_SWCLK` writer - Directly drive processor 0 SWCLK, if PROC0_ATTACH is set"]
14pub type PROC0_SWCLK_W<'a, REG> = crate::BitWriter<'a, REG>;
15#[doc = "Field `PROC0_ATTACH` reader - Attach processor 0 debug port to syscfg controls, and disconnect it from external SWD pads."]
16pub type PROC0_ATTACH_R = crate::BitReader;
17#[doc = "Field `PROC0_ATTACH` writer - Attach processor 0 debug port to syscfg controls, and disconnect it from external SWD pads."]
18pub type PROC0_ATTACH_W<'a, REG> = crate::BitWriter<'a, REG>;
19#[doc = "Field `PROC1_SWDO` reader - Observe the value of processor 1 SWDIO output."]
20pub type PROC1_SWDO_R = crate::BitReader;
21#[doc = "Field `PROC1_SWDI` reader - Directly drive processor 1 SWDIO input, if PROC1_ATTACH is set"]
22pub type PROC1_SWDI_R = crate::BitReader;
23#[doc = "Field `PROC1_SWDI` writer - Directly drive processor 1 SWDIO input, if PROC1_ATTACH is set"]
24pub type PROC1_SWDI_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `PROC1_SWCLK` reader - Directly drive processor 1 SWCLK, if PROC1_ATTACH is set"]
26pub type PROC1_SWCLK_R = crate::BitReader;
27#[doc = "Field `PROC1_SWCLK` writer - Directly drive processor 1 SWCLK, if PROC1_ATTACH is set"]
28pub type PROC1_SWCLK_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `PROC1_ATTACH` reader - Attach processor 1 debug port to syscfg controls, and disconnect it from external SWD pads."]
30pub type PROC1_ATTACH_R = crate::BitReader;
31#[doc = "Field `PROC1_ATTACH` writer - Attach processor 1 debug port to syscfg controls, and disconnect it from external SWD pads."]
32pub type PROC1_ATTACH_W<'a, REG> = crate::BitWriter<'a, REG>;
33impl R {
34    #[doc = "Bit 0 - Observe the value of processor 0 SWDIO output."]
35    #[inline(always)]
36    pub fn proc0_swdo(&self) -> PROC0_SWDO_R {
37        PROC0_SWDO_R::new((self.bits & 1) != 0)
38    }
39    #[doc = "Bit 1 - Directly drive processor 0 SWDIO input, if PROC0_ATTACH is set"]
40    #[inline(always)]
41    pub fn proc0_swdi(&self) -> PROC0_SWDI_R {
42        PROC0_SWDI_R::new(((self.bits >> 1) & 1) != 0)
43    }
44    #[doc = "Bit 2 - Directly drive processor 0 SWCLK, if PROC0_ATTACH is set"]
45    #[inline(always)]
46    pub fn proc0_swclk(&self) -> PROC0_SWCLK_R {
47        PROC0_SWCLK_R::new(((self.bits >> 2) & 1) != 0)
48    }
49    #[doc = "Bit 3 - Attach processor 0 debug port to syscfg controls, and disconnect it from external SWD pads."]
50    #[inline(always)]
51    pub fn proc0_attach(&self) -> PROC0_ATTACH_R {
52        PROC0_ATTACH_R::new(((self.bits >> 3) & 1) != 0)
53    }
54    #[doc = "Bit 4 - Observe the value of processor 1 SWDIO output."]
55    #[inline(always)]
56    pub fn proc1_swdo(&self) -> PROC1_SWDO_R {
57        PROC1_SWDO_R::new(((self.bits >> 4) & 1) != 0)
58    }
59    #[doc = "Bit 5 - Directly drive processor 1 SWDIO input, if PROC1_ATTACH is set"]
60    #[inline(always)]
61    pub fn proc1_swdi(&self) -> PROC1_SWDI_R {
62        PROC1_SWDI_R::new(((self.bits >> 5) & 1) != 0)
63    }
64    #[doc = "Bit 6 - Directly drive processor 1 SWCLK, if PROC1_ATTACH is set"]
65    #[inline(always)]
66    pub fn proc1_swclk(&self) -> PROC1_SWCLK_R {
67        PROC1_SWCLK_R::new(((self.bits >> 6) & 1) != 0)
68    }
69    #[doc = "Bit 7 - Attach processor 1 debug port to syscfg controls, and disconnect it from external SWD pads."]
70    #[inline(always)]
71    pub fn proc1_attach(&self) -> PROC1_ATTACH_R {
72        PROC1_ATTACH_R::new(((self.bits >> 7) & 1) != 0)
73    }
74}
75impl W {
76    #[doc = "Bit 1 - Directly drive processor 0 SWDIO input, if PROC0_ATTACH is set"]
77    #[inline(always)]
78    #[must_use]
79    pub fn proc0_swdi(&mut self) -> PROC0_SWDI_W<DBGFORCE_SPEC> {
80        PROC0_SWDI_W::new(self, 1)
81    }
82    #[doc = "Bit 2 - Directly drive processor 0 SWCLK, if PROC0_ATTACH is set"]
83    #[inline(always)]
84    #[must_use]
85    pub fn proc0_swclk(&mut self) -> PROC0_SWCLK_W<DBGFORCE_SPEC> {
86        PROC0_SWCLK_W::new(self, 2)
87    }
88    #[doc = "Bit 3 - Attach processor 0 debug port to syscfg controls, and disconnect it from external SWD pads."]
89    #[inline(always)]
90    #[must_use]
91    pub fn proc0_attach(&mut self) -> PROC0_ATTACH_W<DBGFORCE_SPEC> {
92        PROC0_ATTACH_W::new(self, 3)
93    }
94    #[doc = "Bit 5 - Directly drive processor 1 SWDIO input, if PROC1_ATTACH is set"]
95    #[inline(always)]
96    #[must_use]
97    pub fn proc1_swdi(&mut self) -> PROC1_SWDI_W<DBGFORCE_SPEC> {
98        PROC1_SWDI_W::new(self, 5)
99    }
100    #[doc = "Bit 6 - Directly drive processor 1 SWCLK, if PROC1_ATTACH is set"]
101    #[inline(always)]
102    #[must_use]
103    pub fn proc1_swclk(&mut self) -> PROC1_SWCLK_W<DBGFORCE_SPEC> {
104        PROC1_SWCLK_W::new(self, 6)
105    }
106    #[doc = "Bit 7 - Attach processor 1 debug port to syscfg controls, and disconnect it from external SWD pads."]
107    #[inline(always)]
108    #[must_use]
109    pub fn proc1_attach(&mut self) -> PROC1_ATTACH_W<DBGFORCE_SPEC> {
110        PROC1_ATTACH_W::new(self, 7)
111    }
112    #[doc = r" Writes raw bits to the register."]
113    #[doc = r""]
114    #[doc = r" # Safety"]
115    #[doc = r""]
116    #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
117    #[inline(always)]
118    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
119        self.bits = bits;
120        self
121    }
122}
123#[doc = "Directly control the SWD debug port of either processor  
124
125You can [`read`](crate::generic::Reg::read) this register and get [`dbgforce::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 [`dbgforce::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
126pub struct DBGFORCE_SPEC;
127impl crate::RegisterSpec for DBGFORCE_SPEC {
128    type Ux = u32;
129}
130#[doc = "`read()` method returns [`dbgforce::R`](R) reader structure"]
131impl crate::Readable for DBGFORCE_SPEC {}
132#[doc = "`write(|w| ..)` method takes [`dbgforce::W`](W) writer structure"]
133impl crate::Writable for DBGFORCE_SPEC {
134    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
135    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
136}
137#[doc = "`reset()` method sets DBGFORCE to value 0x66"]
138impl crate::Resettable for DBGFORCE_SPEC {
139    const RESET_VALUE: u32 = 0x66;
140}