esp32p4/adc/
arb_ctrl.rs

1#[doc = "Register `ARB_CTRL` reader"]
2pub type R = crate::R<ARB_CTRL_SPEC>;
3#[doc = "Register `ARB_CTRL` writer"]
4pub type W = crate::W<ARB_CTRL_SPEC>;
5#[doc = "Field `ARB_APB_FORCE` reader - adc2 arbiter force to enableapb controller"]
6pub type ARB_APB_FORCE_R = crate::BitReader;
7#[doc = "Field `ARB_APB_FORCE` writer - adc2 arbiter force to enableapb controller"]
8pub type ARB_APB_FORCE_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `ARB_RTC_FORCE` reader - adc2 arbiter force to enable rtc controller"]
10pub type ARB_RTC_FORCE_R = crate::BitReader;
11#[doc = "Field `ARB_RTC_FORCE` writer - adc2 arbiter force to enable rtc controller"]
12pub type ARB_RTC_FORCE_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `ARB_WIFI_FORCE` reader - adc2 arbiter force to enable wifi controller"]
14pub type ARB_WIFI_FORCE_R = crate::BitReader;
15#[doc = "Field `ARB_WIFI_FORCE` writer - adc2 arbiter force to enable wifi controller"]
16pub type ARB_WIFI_FORCE_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `ARB_GRANT_FORCE` reader - adc2 arbiter force grant"]
18pub type ARB_GRANT_FORCE_R = crate::BitReader;
19#[doc = "Field `ARB_GRANT_FORCE` writer - adc2 arbiter force grant"]
20pub type ARB_GRANT_FORCE_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `ARB_APB_PRIORITY` reader - Set adc2 arbiterapb priority"]
22pub type ARB_APB_PRIORITY_R = crate::FieldReader;
23#[doc = "Field `ARB_APB_PRIORITY` writer - Set adc2 arbiterapb priority"]
24pub type ARB_APB_PRIORITY_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
25#[doc = "Field `ARB_RTC_PRIORITY` reader - Set adc2 arbiter rtc priority"]
26pub type ARB_RTC_PRIORITY_R = crate::FieldReader;
27#[doc = "Field `ARB_RTC_PRIORITY` writer - Set adc2 arbiter rtc priority"]
28pub type ARB_RTC_PRIORITY_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
29#[doc = "Field `ARB_WIFI_PRIORITY` reader - Set adc2 arbiter wifi priority"]
30pub type ARB_WIFI_PRIORITY_R = crate::FieldReader;
31#[doc = "Field `ARB_WIFI_PRIORITY` writer - Set adc2 arbiter wifi priority"]
32pub type ARB_WIFI_PRIORITY_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
33#[doc = "Field `ARB_FIX_PRIORITY` reader - adc2 arbiter uses fixed priority"]
34pub type ARB_FIX_PRIORITY_R = crate::BitReader;
35#[doc = "Field `ARB_FIX_PRIORITY` writer - adc2 arbiter uses fixed priority"]
36pub type ARB_FIX_PRIORITY_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bit 2 - adc2 arbiter force to enableapb controller"]
39    #[inline(always)]
40    pub fn arb_apb_force(&self) -> ARB_APB_FORCE_R {
41        ARB_APB_FORCE_R::new(((self.bits >> 2) & 1) != 0)
42    }
43    #[doc = "Bit 3 - adc2 arbiter force to enable rtc controller"]
44    #[inline(always)]
45    pub fn arb_rtc_force(&self) -> ARB_RTC_FORCE_R {
46        ARB_RTC_FORCE_R::new(((self.bits >> 3) & 1) != 0)
47    }
48    #[doc = "Bit 4 - adc2 arbiter force to enable wifi controller"]
49    #[inline(always)]
50    pub fn arb_wifi_force(&self) -> ARB_WIFI_FORCE_R {
51        ARB_WIFI_FORCE_R::new(((self.bits >> 4) & 1) != 0)
52    }
53    #[doc = "Bit 5 - adc2 arbiter force grant"]
54    #[inline(always)]
55    pub fn arb_grant_force(&self) -> ARB_GRANT_FORCE_R {
56        ARB_GRANT_FORCE_R::new(((self.bits >> 5) & 1) != 0)
57    }
58    #[doc = "Bits 6:7 - Set adc2 arbiterapb priority"]
59    #[inline(always)]
60    pub fn arb_apb_priority(&self) -> ARB_APB_PRIORITY_R {
61        ARB_APB_PRIORITY_R::new(((self.bits >> 6) & 3) as u8)
62    }
63    #[doc = "Bits 8:9 - Set adc2 arbiter rtc priority"]
64    #[inline(always)]
65    pub fn arb_rtc_priority(&self) -> ARB_RTC_PRIORITY_R {
66        ARB_RTC_PRIORITY_R::new(((self.bits >> 8) & 3) as u8)
67    }
68    #[doc = "Bits 10:11 - Set adc2 arbiter wifi priority"]
69    #[inline(always)]
70    pub fn arb_wifi_priority(&self) -> ARB_WIFI_PRIORITY_R {
71        ARB_WIFI_PRIORITY_R::new(((self.bits >> 10) & 3) as u8)
72    }
73    #[doc = "Bit 12 - adc2 arbiter uses fixed priority"]
74    #[inline(always)]
75    pub fn arb_fix_priority(&self) -> ARB_FIX_PRIORITY_R {
76        ARB_FIX_PRIORITY_R::new(((self.bits >> 12) & 1) != 0)
77    }
78}
79#[cfg(feature = "impl-register-debug")]
80impl core::fmt::Debug for R {
81    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
82        f.debug_struct("ARB_CTRL")
83            .field(
84                "arb_apb_force",
85                &format_args!("{}", self.arb_apb_force().bit()),
86            )
87            .field(
88                "arb_rtc_force",
89                &format_args!("{}", self.arb_rtc_force().bit()),
90            )
91            .field(
92                "arb_wifi_force",
93                &format_args!("{}", self.arb_wifi_force().bit()),
94            )
95            .field(
96                "arb_grant_force",
97                &format_args!("{}", self.arb_grant_force().bit()),
98            )
99            .field(
100                "arb_apb_priority",
101                &format_args!("{}", self.arb_apb_priority().bits()),
102            )
103            .field(
104                "arb_rtc_priority",
105                &format_args!("{}", self.arb_rtc_priority().bits()),
106            )
107            .field(
108                "arb_wifi_priority",
109                &format_args!("{}", self.arb_wifi_priority().bits()),
110            )
111            .field(
112                "arb_fix_priority",
113                &format_args!("{}", self.arb_fix_priority().bit()),
114            )
115            .finish()
116    }
117}
118#[cfg(feature = "impl-register-debug")]
119impl core::fmt::Debug for crate::generic::Reg<ARB_CTRL_SPEC> {
120    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
121        core::fmt::Debug::fmt(&self.read(), f)
122    }
123}
124impl W {
125    #[doc = "Bit 2 - adc2 arbiter force to enableapb controller"]
126    #[inline(always)]
127    #[must_use]
128    pub fn arb_apb_force(&mut self) -> ARB_APB_FORCE_W<ARB_CTRL_SPEC> {
129        ARB_APB_FORCE_W::new(self, 2)
130    }
131    #[doc = "Bit 3 - adc2 arbiter force to enable rtc controller"]
132    #[inline(always)]
133    #[must_use]
134    pub fn arb_rtc_force(&mut self) -> ARB_RTC_FORCE_W<ARB_CTRL_SPEC> {
135        ARB_RTC_FORCE_W::new(self, 3)
136    }
137    #[doc = "Bit 4 - adc2 arbiter force to enable wifi controller"]
138    #[inline(always)]
139    #[must_use]
140    pub fn arb_wifi_force(&mut self) -> ARB_WIFI_FORCE_W<ARB_CTRL_SPEC> {
141        ARB_WIFI_FORCE_W::new(self, 4)
142    }
143    #[doc = "Bit 5 - adc2 arbiter force grant"]
144    #[inline(always)]
145    #[must_use]
146    pub fn arb_grant_force(&mut self) -> ARB_GRANT_FORCE_W<ARB_CTRL_SPEC> {
147        ARB_GRANT_FORCE_W::new(self, 5)
148    }
149    #[doc = "Bits 6:7 - Set adc2 arbiterapb priority"]
150    #[inline(always)]
151    #[must_use]
152    pub fn arb_apb_priority(&mut self) -> ARB_APB_PRIORITY_W<ARB_CTRL_SPEC> {
153        ARB_APB_PRIORITY_W::new(self, 6)
154    }
155    #[doc = "Bits 8:9 - Set adc2 arbiter rtc priority"]
156    #[inline(always)]
157    #[must_use]
158    pub fn arb_rtc_priority(&mut self) -> ARB_RTC_PRIORITY_W<ARB_CTRL_SPEC> {
159        ARB_RTC_PRIORITY_W::new(self, 8)
160    }
161    #[doc = "Bits 10:11 - Set adc2 arbiter wifi priority"]
162    #[inline(always)]
163    #[must_use]
164    pub fn arb_wifi_priority(&mut self) -> ARB_WIFI_PRIORITY_W<ARB_CTRL_SPEC> {
165        ARB_WIFI_PRIORITY_W::new(self, 10)
166    }
167    #[doc = "Bit 12 - adc2 arbiter uses fixed priority"]
168    #[inline(always)]
169    #[must_use]
170    pub fn arb_fix_priority(&mut self) -> ARB_FIX_PRIORITY_W<ARB_CTRL_SPEC> {
171        ARB_FIX_PRIORITY_W::new(self, 12)
172    }
173}
174#[doc = "Register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`arb_ctrl::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 [`arb_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
175pub struct ARB_CTRL_SPEC;
176impl crate::RegisterSpec for ARB_CTRL_SPEC {
177    type Ux = u32;
178}
179#[doc = "`read()` method returns [`arb_ctrl::R`](R) reader structure"]
180impl crate::Readable for ARB_CTRL_SPEC {}
181#[doc = "`write(|w| ..)` method takes [`arb_ctrl::W`](W) writer structure"]
182impl crate::Writable for ARB_CTRL_SPEC {
183    type Safety = crate::Unsafe;
184    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
185    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
186}
187#[doc = "`reset()` method sets ARB_CTRL to value 0x0900"]
188impl crate::Resettable for ARB_CTRL_SPEC {
189    const RESET_VALUE: u32 = 0x0900;
190}