d1_pac/iommu/
iommu_bypass.rs1#[doc = "Register `iommu_bypass` reader"]
2pub type R = crate::R<IOMMU_BYPASS_SPEC>;
3#[doc = "Register `iommu_bypass` writer"]
4pub type W = crate::W<IOMMU_BYPASS_SPEC>;
5#[doc = "Field `m_bp[0-6]` reader - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
6pub type M_BP_R = crate::BitReader<M_BP_A>;
7#[doc = "Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address.\n\nValue on reset: 1"]
8#[derive(Clone, Copy, Debug, PartialEq, Eq)]
9pub enum M_BP_A {
10 #[doc = "0: Disable bypass function"]
11 DISABLE = 0,
12 #[doc = "1: Enable bypass function"]
13 ENABLE = 1,
14}
15impl From<M_BP_A> for bool {
16 #[inline(always)]
17 fn from(variant: M_BP_A) -> Self {
18 variant as u8 != 0
19 }
20}
21impl M_BP_R {
22 #[doc = "Get enumerated values variant"]
23 #[inline(always)]
24 pub const fn variant(&self) -> M_BP_A {
25 match self.bits {
26 false => M_BP_A::DISABLE,
27 true => M_BP_A::ENABLE,
28 }
29 }
30 #[doc = "Disable bypass function"]
31 #[inline(always)]
32 pub fn is_disable(&self) -> bool {
33 *self == M_BP_A::DISABLE
34 }
35 #[doc = "Enable bypass function"]
36 #[inline(always)]
37 pub fn is_enable(&self) -> bool {
38 *self == M_BP_A::ENABLE
39 }
40}
41#[doc = "Field `m_bp[0-6]` writer - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
42pub type M_BP_W<'a, REG> = crate::BitWriter<'a, REG, M_BP_A>;
43impl<'a, REG> M_BP_W<'a, REG>
44where
45 REG: crate::Writable + crate::RegisterSpec,
46{
47 #[doc = "Disable bypass function"]
48 #[inline(always)]
49 pub fn disable(self) -> &'a mut crate::W<REG> {
50 self.variant(M_BP_A::DISABLE)
51 }
52 #[doc = "Enable bypass function"]
53 #[inline(always)]
54 pub fn enable(self) -> &'a mut crate::W<REG> {
55 self.variant(M_BP_A::ENABLE)
56 }
57}
58impl R {
59 #[doc = "Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address.\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `m0_bp` field"]
60 #[inline(always)]
61 pub fn m_bp(&self, n: u8) -> M_BP_R {
62 #[allow(clippy::no_effect)]
63 [(); 7][n as usize];
64 M_BP_R::new(((self.bits >> n) & 1) != 0)
65 }
66 #[doc = "Bit 0 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
67 #[inline(always)]
68 pub fn m0_bp(&self) -> M_BP_R {
69 M_BP_R::new((self.bits & 1) != 0)
70 }
71 #[doc = "Bit 1 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
72 #[inline(always)]
73 pub fn m1_bp(&self) -> M_BP_R {
74 M_BP_R::new(((self.bits >> 1) & 1) != 0)
75 }
76 #[doc = "Bit 2 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
77 #[inline(always)]
78 pub fn m2_bp(&self) -> M_BP_R {
79 M_BP_R::new(((self.bits >> 2) & 1) != 0)
80 }
81 #[doc = "Bit 3 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
82 #[inline(always)]
83 pub fn m3_bp(&self) -> M_BP_R {
84 M_BP_R::new(((self.bits >> 3) & 1) != 0)
85 }
86 #[doc = "Bit 4 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
87 #[inline(always)]
88 pub fn m4_bp(&self) -> M_BP_R {
89 M_BP_R::new(((self.bits >> 4) & 1) != 0)
90 }
91 #[doc = "Bit 5 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
92 #[inline(always)]
93 pub fn m5_bp(&self) -> M_BP_R {
94 M_BP_R::new(((self.bits >> 5) & 1) != 0)
95 }
96 #[doc = "Bit 6 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
97 #[inline(always)]
98 pub fn m6_bp(&self) -> M_BP_R {
99 M_BP_R::new(((self.bits >> 6) & 1) != 0)
100 }
101}
102impl W {
103 #[doc = "Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address.\n\nNOTE: `n` is number of field in register. `n == 0` corresponds to `m0_bp` field"]
104 #[inline(always)]
105 #[must_use]
106 pub fn m_bp(&mut self, n: u8) -> M_BP_W<IOMMU_BYPASS_SPEC> {
107 #[allow(clippy::no_effect)]
108 [(); 7][n as usize];
109 M_BP_W::new(self, n)
110 }
111 #[doc = "Bit 0 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
112 #[inline(always)]
113 #[must_use]
114 pub fn m0_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
115 M_BP_W::new(self, 0)
116 }
117 #[doc = "Bit 1 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
118 #[inline(always)]
119 #[must_use]
120 pub fn m1_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
121 M_BP_W::new(self, 1)
122 }
123 #[doc = "Bit 2 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
124 #[inline(always)]
125 #[must_use]
126 pub fn m2_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
127 M_BP_W::new(self, 2)
128 }
129 #[doc = "Bit 3 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
130 #[inline(always)]
131 #[must_use]
132 pub fn m3_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
133 M_BP_W::new(self, 3)
134 }
135 #[doc = "Bit 4 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
136 #[inline(always)]
137 #[must_use]
138 pub fn m4_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
139 M_BP_W::new(self, 4)
140 }
141 #[doc = "Bit 5 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
142 #[inline(always)]
143 #[must_use]
144 pub fn m5_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
145 M_BP_W::new(self, 5)
146 }
147 #[doc = "Bit 6 - Master\\[i\\] bypass switch\n\nAfter bypass function is opened, IOMMU can not map the address of Master6 sending, and directly output the virtual address to MBUS as physical address."]
148 #[inline(always)]
149 #[must_use]
150 pub fn m6_bp(&mut self) -> M_BP_W<IOMMU_BYPASS_SPEC> {
151 M_BP_W::new(self, 6)
152 }
153 #[doc = r" Writes raw bits to the register."]
154 #[doc = r""]
155 #[doc = r" # Safety"]
156 #[doc = r""]
157 #[doc = r" Passing incorrect value can cause undefined behaviour. See reference manual"]
158 #[inline(always)]
159 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
160 self.bits = bits;
161 self
162 }
163}
164#[doc = "IOMMU Bypass Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`iommu_bypass::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 [`iommu_bypass::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
165pub struct IOMMU_BYPASS_SPEC;
166impl crate::RegisterSpec for IOMMU_BYPASS_SPEC {
167 type Ux = u32;
168}
169#[doc = "`read()` method returns [`iommu_bypass::R`](R) reader structure"]
170impl crate::Readable for IOMMU_BYPASS_SPEC {}
171#[doc = "`write(|w| ..)` method takes [`iommu_bypass::W`](W) writer structure"]
172impl crate::Writable for IOMMU_BYPASS_SPEC {
173 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
174 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
175}
176#[doc = "`reset()` method sets iommu_bypass to value 0x7f"]
177impl crate::Resettable for IOMMU_BYPASS_SPEC {
178 const RESET_VALUE: Self::Ux = 0x7f;
179}