rp2040_pac/xip_ssi/
mwcr.rs
1#[doc = "Register `MWCR` reader"]
2pub type R = crate::R<MWCR_SPEC>;
3#[doc = "Register `MWCR` writer"]
4pub type W = crate::W<MWCR_SPEC>;
5#[doc = "Field `MWMOD` reader - Microwire transfer mode"]
6pub type MWMOD_R = crate::BitReader;
7#[doc = "Field `MWMOD` writer - Microwire transfer mode"]
8pub type MWMOD_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `MDD` reader - Microwire control"]
10pub type MDD_R = crate::BitReader;
11#[doc = "Field `MDD` writer - Microwire control"]
12pub type MDD_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `MHS` reader - Microwire handshaking"]
14pub type MHS_R = crate::BitReader;
15#[doc = "Field `MHS` writer - Microwire handshaking"]
16pub type MHS_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bit 0 - Microwire transfer mode"]
19 #[inline(always)]
20 pub fn mwmod(&self) -> MWMOD_R {
21 MWMOD_R::new((self.bits & 1) != 0)
22 }
23 #[doc = "Bit 1 - Microwire control"]
24 #[inline(always)]
25 pub fn mdd(&self) -> MDD_R {
26 MDD_R::new(((self.bits >> 1) & 1) != 0)
27 }
28 #[doc = "Bit 2 - Microwire handshaking"]
29 #[inline(always)]
30 pub fn mhs(&self) -> MHS_R {
31 MHS_R::new(((self.bits >> 2) & 1) != 0)
32 }
33}
34impl W {
35 #[doc = "Bit 0 - Microwire transfer mode"]
36 #[inline(always)]
37 #[must_use]
38 pub fn mwmod(&mut self) -> MWMOD_W<MWCR_SPEC> {
39 MWMOD_W::new(self, 0)
40 }
41 #[doc = "Bit 1 - Microwire control"]
42 #[inline(always)]
43 #[must_use]
44 pub fn mdd(&mut self) -> MDD_W<MWCR_SPEC> {
45 MDD_W::new(self, 1)
46 }
47 #[doc = "Bit 2 - Microwire handshaking"]
48 #[inline(always)]
49 #[must_use]
50 pub fn mhs(&mut self) -> MHS_W<MWCR_SPEC> {
51 MHS_W::new(self, 2)
52 }
53 #[doc = r" Writes raw bits to the register."]
54 #[doc = r""]
55 #[doc = r" # Safety"]
56 #[doc = r""]
57 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
58 #[inline(always)]
59 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
60 self.bits = bits;
61 self
62 }
63}
64#[doc = "Microwire Control
65
66You can [`read`](crate::generic::Reg::read) this register and get [`mwcr::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 [`mwcr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
67pub struct MWCR_SPEC;
68impl crate::RegisterSpec for MWCR_SPEC {
69 type Ux = u32;
70}
71#[doc = "`read()` method returns [`mwcr::R`](R) reader structure"]
72impl crate::Readable for MWCR_SPEC {}
73#[doc = "`write(|w| ..)` method takes [`mwcr::W`](W) writer structure"]
74impl crate::Writable for MWCR_SPEC {
75 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
76 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
77}
78#[doc = "`reset()` method sets MWCR to value 0"]
79impl crate::Resettable for MWCR_SPEC {
80 const RESET_VALUE: u32 = 0;
81}