bl702_pac/aon/
acomp_ctrl.rs1#[doc = "Register `acomp_ctrl` reader"]
2pub struct R(crate::R<ACOMP_CTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<ACOMP_CTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<ACOMP_CTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<ACOMP_CTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `acomp_ctrl` writer"]
17pub struct W(crate::W<ACOMP_CTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<ACOMP_CTRL_SPEC>;
20 #[inline(always)]
21 fn deref(&self) -> &Self::Target {
22 &self.0
23 }
24}
25impl core::ops::DerefMut for W {
26 #[inline(always)]
27 fn deref_mut(&mut self) -> &mut Self::Target {
28 &mut self.0
29 }
30}
31impl From<crate::W<ACOMP_CTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<ACOMP_CTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `acomp1_rstn_ana` reader - "]
38pub type ACOMP1_RSTN_ANA_R = crate::BitReader<bool>;
39#[doc = "Field `acomp1_rstn_ana` writer - "]
40pub type ACOMP1_RSTN_ANA_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACOMP_CTRL_SPEC, bool, O>;
41#[doc = "Field `acomp0_rstn_ana` reader - "]
42pub type ACOMP0_RSTN_ANA_R = crate::BitReader<bool>;
43#[doc = "Field `acomp0_rstn_ana` writer - "]
44pub type ACOMP0_RSTN_ANA_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACOMP_CTRL_SPEC, bool, O>;
45#[doc = "Field `acomp1_test_en` reader - "]
46pub type ACOMP1_TEST_EN_R = crate::BitReader<bool>;
47#[doc = "Field `acomp1_test_en` writer - "]
48pub type ACOMP1_TEST_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACOMP_CTRL_SPEC, bool, O>;
49#[doc = "Field `acomp0_test_en` reader - "]
50pub type ACOMP0_TEST_EN_R = crate::BitReader<bool>;
51#[doc = "Field `acomp0_test_en` writer - "]
52pub type ACOMP0_TEST_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACOMP_CTRL_SPEC, bool, O>;
53#[doc = "Field `acomp1_test_sel` reader - "]
54pub type ACOMP1_TEST_SEL_R = crate::FieldReader<u8, u8>;
55#[doc = "Field `acomp1_test_sel` writer - "]
56pub type ACOMP1_TEST_SEL_W<'a, const O: u8> =
57 crate::FieldWriter<'a, u32, ACOMP_CTRL_SPEC, u8, u8, 2, O>;
58#[doc = "Field `acomp0_test_sel` reader - "]
59pub type ACOMP0_TEST_SEL_R = crate::FieldReader<u8, u8>;
60#[doc = "Field `acomp0_test_sel` writer - "]
61pub type ACOMP0_TEST_SEL_W<'a, const O: u8> =
62 crate::FieldWriter<'a, u32, ACOMP_CTRL_SPEC, u8, u8, 2, O>;
63#[doc = "Field `acomp1_out_raw` reader - "]
64pub type ACOMP1_OUT_RAW_R = crate::BitReader<bool>;
65#[doc = "Field `acomp1_out_raw` writer - "]
66pub type ACOMP1_OUT_RAW_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACOMP_CTRL_SPEC, bool, O>;
67#[doc = "Field `acomp0_out_raw` reader - "]
68pub type ACOMP0_OUT_RAW_R = crate::BitReader<bool>;
69#[doc = "Field `acomp0_out_raw` writer - "]
70pub type ACOMP0_OUT_RAW_W<'a, const O: u8> = crate::BitWriter<'a, u32, ACOMP_CTRL_SPEC, bool, O>;
71#[doc = "Field `acomp_reserved` reader - "]
72pub type ACOMP_RESERVED_R = crate::FieldReader<u8, u8>;
73#[doc = "Field `acomp_reserved` writer - "]
74pub type ACOMP_RESERVED_W<'a, const O: u8> =
75 crate::FieldWriter<'a, u32, ACOMP_CTRL_SPEC, u8, u8, 8, O>;
76impl R {
77 #[doc = "Bit 0"]
78 #[inline(always)]
79 pub fn acomp1_rstn_ana(&self) -> ACOMP1_RSTN_ANA_R {
80 ACOMP1_RSTN_ANA_R::new((self.bits & 1) != 0)
81 }
82 #[doc = "Bit 1"]
83 #[inline(always)]
84 pub fn acomp0_rstn_ana(&self) -> ACOMP0_RSTN_ANA_R {
85 ACOMP0_RSTN_ANA_R::new(((self.bits >> 1) & 1) != 0)
86 }
87 #[doc = "Bit 8"]
88 #[inline(always)]
89 pub fn acomp1_test_en(&self) -> ACOMP1_TEST_EN_R {
90 ACOMP1_TEST_EN_R::new(((self.bits >> 8) & 1) != 0)
91 }
92 #[doc = "Bit 9"]
93 #[inline(always)]
94 pub fn acomp0_test_en(&self) -> ACOMP0_TEST_EN_R {
95 ACOMP0_TEST_EN_R::new(((self.bits >> 9) & 1) != 0)
96 }
97 #[doc = "Bits 10:11"]
98 #[inline(always)]
99 pub fn acomp1_test_sel(&self) -> ACOMP1_TEST_SEL_R {
100 ACOMP1_TEST_SEL_R::new(((self.bits >> 10) & 3) as u8)
101 }
102 #[doc = "Bits 12:13"]
103 #[inline(always)]
104 pub fn acomp0_test_sel(&self) -> ACOMP0_TEST_SEL_R {
105 ACOMP0_TEST_SEL_R::new(((self.bits >> 12) & 3) as u8)
106 }
107 #[doc = "Bit 17"]
108 #[inline(always)]
109 pub fn acomp1_out_raw(&self) -> ACOMP1_OUT_RAW_R {
110 ACOMP1_OUT_RAW_R::new(((self.bits >> 17) & 1) != 0)
111 }
112 #[doc = "Bit 19"]
113 #[inline(always)]
114 pub fn acomp0_out_raw(&self) -> ACOMP0_OUT_RAW_R {
115 ACOMP0_OUT_RAW_R::new(((self.bits >> 19) & 1) != 0)
116 }
117 #[doc = "Bits 24:31"]
118 #[inline(always)]
119 pub fn acomp_reserved(&self) -> ACOMP_RESERVED_R {
120 ACOMP_RESERVED_R::new(((self.bits >> 24) & 0xff) as u8)
121 }
122}
123impl W {
124 #[doc = "Bit 0"]
125 #[inline(always)]
126 #[must_use]
127 pub fn acomp1_rstn_ana(&mut self) -> ACOMP1_RSTN_ANA_W<0> {
128 ACOMP1_RSTN_ANA_W::new(self)
129 }
130 #[doc = "Bit 1"]
131 #[inline(always)]
132 #[must_use]
133 pub fn acomp0_rstn_ana(&mut self) -> ACOMP0_RSTN_ANA_W<1> {
134 ACOMP0_RSTN_ANA_W::new(self)
135 }
136 #[doc = "Bit 8"]
137 #[inline(always)]
138 #[must_use]
139 pub fn acomp1_test_en(&mut self) -> ACOMP1_TEST_EN_W<8> {
140 ACOMP1_TEST_EN_W::new(self)
141 }
142 #[doc = "Bit 9"]
143 #[inline(always)]
144 #[must_use]
145 pub fn acomp0_test_en(&mut self) -> ACOMP0_TEST_EN_W<9> {
146 ACOMP0_TEST_EN_W::new(self)
147 }
148 #[doc = "Bits 10:11"]
149 #[inline(always)]
150 #[must_use]
151 pub fn acomp1_test_sel(&mut self) -> ACOMP1_TEST_SEL_W<10> {
152 ACOMP1_TEST_SEL_W::new(self)
153 }
154 #[doc = "Bits 12:13"]
155 #[inline(always)]
156 #[must_use]
157 pub fn acomp0_test_sel(&mut self) -> ACOMP0_TEST_SEL_W<12> {
158 ACOMP0_TEST_SEL_W::new(self)
159 }
160 #[doc = "Bit 17"]
161 #[inline(always)]
162 #[must_use]
163 pub fn acomp1_out_raw(&mut self) -> ACOMP1_OUT_RAW_W<17> {
164 ACOMP1_OUT_RAW_W::new(self)
165 }
166 #[doc = "Bit 19"]
167 #[inline(always)]
168 #[must_use]
169 pub fn acomp0_out_raw(&mut self) -> ACOMP0_OUT_RAW_W<19> {
170 ACOMP0_OUT_RAW_W::new(self)
171 }
172 #[doc = "Bits 24:31"]
173 #[inline(always)]
174 #[must_use]
175 pub fn acomp_reserved(&mut self) -> ACOMP_RESERVED_W<24> {
176 ACOMP_RESERVED_W::new(self)
177 }
178 #[doc = "Writes raw bits to the register."]
179 #[inline(always)]
180 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
181 self.0.bits(bits);
182 self
183 }
184}
185#[doc = "acomp_ctrl.\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [acomp_ctrl](index.html) module"]
186pub struct ACOMP_CTRL_SPEC;
187impl crate::RegisterSpec for ACOMP_CTRL_SPEC {
188 type Ux = u32;
189}
190#[doc = "`read()` method returns [acomp_ctrl::R](R) reader structure"]
191impl crate::Readable for ACOMP_CTRL_SPEC {
192 type Reader = R;
193}
194#[doc = "`write(|w| ..)` method takes [acomp_ctrl::W](W) writer structure"]
195impl crate::Writable for ACOMP_CTRL_SPEC {
196 type Writer = W;
197 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
198 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
199}
200#[doc = "`reset()` method sets acomp_ctrl to value 0"]
201impl crate::Resettable for ACOMP_CTRL_SPEC {
202 const RESET_VALUE: Self::Ux = 0;
203}