eos_s3/cru/
fb_sw_reset.rs

1#[doc = "Register `FB_SW_RESET` reader"]
2pub struct R(crate::R<FB_SW_RESET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FB_SW_RESET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FB_SW_RESET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FB_SW_RESET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FB_SW_RESET` writer"]
17pub struct W(crate::W<FB_SW_RESET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FB_SW_RESET_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<FB_SW_RESET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FB_SW_RESET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "1'b1 : Enable the Software Reset. FW need to disable it manually.\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum FB_C02_DOMAIN_SW_RESET_A {
40    #[doc = "1: Enable the software reset. FW need to disable it manually"]
41    ENABLE = 1,
42}
43impl From<FB_C02_DOMAIN_SW_RESET_A> for bool {
44    #[inline(always)]
45    fn from(variant: FB_C02_DOMAIN_SW_RESET_A) -> Self {
46        variant as u8 != 0
47    }
48}
49#[doc = "Field `FB_C02_Domain_SW_Reset` reader - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
50pub struct FB_C02_DOMAIN_SW_RESET_R(
51    crate::FieldReader<bool, FB_C02_DOMAIN_SW_RESET_A>,
52);
53impl FB_C02_DOMAIN_SW_RESET_R {
54    #[inline(always)]
55    pub(crate) fn new(bits: bool) -> Self {
56        FB_C02_DOMAIN_SW_RESET_R(crate::FieldReader::new(bits))
57    }
58    #[doc = r"Get enumerated values variant"]
59    #[inline(always)]
60    pub fn variant(&self) -> Option<FB_C02_DOMAIN_SW_RESET_A> {
61        match self.bits {
62            true => Some(FB_C02_DOMAIN_SW_RESET_A::ENABLE),
63            _ => None,
64        }
65    }
66    #[doc = "Checks if the value of the field is `ENABLE`"]
67    #[inline(always)]
68    pub fn is_enable(&self) -> bool {
69        **self == FB_C02_DOMAIN_SW_RESET_A::ENABLE
70    }
71}
72impl core::ops::Deref for FB_C02_DOMAIN_SW_RESET_R {
73    type Target = crate::FieldReader<bool, FB_C02_DOMAIN_SW_RESET_A>;
74    #[inline(always)]
75    fn deref(&self) -> &Self::Target {
76        &self.0
77    }
78}
79#[doc = "Field `FB_C02_Domain_SW_Reset` writer - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
80pub struct FB_C02_DOMAIN_SW_RESET_W<'a> {
81    w: &'a mut W,
82}
83impl<'a> FB_C02_DOMAIN_SW_RESET_W<'a> {
84    #[doc = r"Writes `variant` to the field"]
85    #[inline(always)]
86    pub fn variant(self, variant: FB_C02_DOMAIN_SW_RESET_A) -> &'a mut W {
87        self.bit(variant.into())
88    }
89    #[doc = "Enable the software reset. FW need to disable it manually"]
90    #[inline(always)]
91    pub fn enable(self) -> &'a mut W {
92        self.variant(FB_C02_DOMAIN_SW_RESET_A::ENABLE)
93    }
94    #[doc = r"Sets the field bit"]
95    #[inline(always)]
96    pub fn set_bit(self) -> &'a mut W {
97        self.bit(true)
98    }
99    #[doc = r"Clears the field bit"]
100    #[inline(always)]
101    pub fn clear_bit(self) -> &'a mut W {
102        self.bit(false)
103    }
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub fn bit(self, value: bool) -> &'a mut W {
107        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
108        self.w
109    }
110}
111#[doc = "1'b1 : Enable the Software Reset. FW need to disable it manually."]
112pub type FB_C09_DOMAIN_SW_RESET_A = FB_C02_DOMAIN_SW_RESET_A;
113#[doc = "Field `FB_C09_Domain_SW_Reset` reader - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
114pub type FB_C09_DOMAIN_SW_RESET_R = FB_C02_DOMAIN_SW_RESET_R;
115#[doc = "Field `FB_C09_Domain_SW_Reset` writer - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
116pub struct FB_C09_DOMAIN_SW_RESET_W<'a> {
117    w: &'a mut W,
118}
119impl<'a> FB_C09_DOMAIN_SW_RESET_W<'a> {
120    #[doc = r"Writes `variant` to the field"]
121    #[inline(always)]
122    pub fn variant(self, variant: FB_C09_DOMAIN_SW_RESET_A) -> &'a mut W {
123        self.bit(variant.into())
124    }
125    #[doc = "Enable the software reset. FW need to disable it manually"]
126    #[inline(always)]
127    pub fn enable(self) -> &'a mut W {
128        self.variant(FB_C09_DOMAIN_SW_RESET_A::ENABLE)
129    }
130    #[doc = r"Sets the field bit"]
131    #[inline(always)]
132    pub fn set_bit(self) -> &'a mut W {
133        self.bit(true)
134    }
135    #[doc = r"Clears the field bit"]
136    #[inline(always)]
137    pub fn clear_bit(self) -> &'a mut W {
138        self.bit(false)
139    }
140    #[doc = r"Writes raw bits to the field"]
141    #[inline(always)]
142    pub fn bit(self, value: bool) -> &'a mut W {
143        self.w.bits =
144            (self.w.bits & !(0x01 << 2)) | ((value as u32 & 0x01) << 2);
145        self.w
146    }
147}
148#[doc = "1'b1 : Enable the Software Reset. FW need to disable it manually."]
149pub type FB_C16_DOMAIN_SW_RESET_A = FB_C02_DOMAIN_SW_RESET_A;
150#[doc = "Field `FB_C16_Domain_SW_Reset` reader - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
151pub type FB_C16_DOMAIN_SW_RESET_R = FB_C02_DOMAIN_SW_RESET_R;
152#[doc = "Field `FB_C16_Domain_SW_Reset` writer - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
153pub struct FB_C16_DOMAIN_SW_RESET_W<'a> {
154    w: &'a mut W,
155}
156impl<'a> FB_C16_DOMAIN_SW_RESET_W<'a> {
157    #[doc = r"Writes `variant` to the field"]
158    #[inline(always)]
159    pub fn variant(self, variant: FB_C16_DOMAIN_SW_RESET_A) -> &'a mut W {
160        self.bit(variant.into())
161    }
162    #[doc = "Enable the software reset. FW need to disable it manually"]
163    #[inline(always)]
164    pub fn enable(self) -> &'a mut W {
165        self.variant(FB_C16_DOMAIN_SW_RESET_A::ENABLE)
166    }
167    #[doc = r"Sets the field bit"]
168    #[inline(always)]
169    pub fn set_bit(self) -> &'a mut W {
170        self.bit(true)
171    }
172    #[doc = r"Clears the field bit"]
173    #[inline(always)]
174    pub fn clear_bit(self) -> &'a mut W {
175        self.bit(false)
176    }
177    #[doc = r"Writes raw bits to the field"]
178    #[inline(always)]
179    pub fn bit(self, value: bool) -> &'a mut W {
180        self.w.bits =
181            (self.w.bits & !(0x01 << 4)) | ((value as u32 & 0x01) << 4);
182        self.w
183    }
184}
185#[doc = "1'b1 : Enable the Software Reset. FW need to disable it manually."]
186pub type FB_C21_DOMAIN_SW_RESET_A = FB_C02_DOMAIN_SW_RESET_A;
187#[doc = "Field `FB_C21_Domain_SW_Reset` reader - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
188pub type FB_C21_DOMAIN_SW_RESET_R = FB_C02_DOMAIN_SW_RESET_R;
189#[doc = "Field `FB_C21_Domain_SW_Reset` writer - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
190pub struct FB_C21_DOMAIN_SW_RESET_W<'a> {
191    w: &'a mut W,
192}
193impl<'a> FB_C21_DOMAIN_SW_RESET_W<'a> {
194    #[doc = r"Writes `variant` to the field"]
195    #[inline(always)]
196    pub fn variant(self, variant: FB_C21_DOMAIN_SW_RESET_A) -> &'a mut W {
197        self.bit(variant.into())
198    }
199    #[doc = "Enable the software reset. FW need to disable it manually"]
200    #[inline(always)]
201    pub fn enable(self) -> &'a mut W {
202        self.variant(FB_C21_DOMAIN_SW_RESET_A::ENABLE)
203    }
204    #[doc = r"Sets the field bit"]
205    #[inline(always)]
206    pub fn set_bit(self) -> &'a mut W {
207        self.bit(true)
208    }
209    #[doc = r"Clears the field bit"]
210    #[inline(always)]
211    pub fn clear_bit(self) -> &'a mut W {
212        self.bit(false)
213    }
214    #[doc = r"Writes raw bits to the field"]
215    #[inline(always)]
216    pub fn bit(self, value: bool) -> &'a mut W {
217        self.w.bits =
218            (self.w.bits & !(0x01 << 5)) | ((value as u32 & 0x01) << 5);
219        self.w
220    }
221}
222impl R {
223    #[doc = "Bit 0 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
224    #[inline(always)]
225    pub fn fb_c02_domain_sw_reset(&self) -> FB_C02_DOMAIN_SW_RESET_R {
226        FB_C02_DOMAIN_SW_RESET_R::new((self.bits & 0x01) != 0)
227    }
228    #[doc = "Bit 2 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
229    #[inline(always)]
230    pub fn fb_c09_domain_sw_reset(&self) -> FB_C09_DOMAIN_SW_RESET_R {
231        FB_C09_DOMAIN_SW_RESET_R::new(((self.bits >> 2) & 0x01) != 0)
232    }
233    #[doc = "Bit 4 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
234    #[inline(always)]
235    pub fn fb_c16_domain_sw_reset(&self) -> FB_C16_DOMAIN_SW_RESET_R {
236        FB_C16_DOMAIN_SW_RESET_R::new(((self.bits >> 4) & 0x01) != 0)
237    }
238    #[doc = "Bit 5 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
239    #[inline(always)]
240    pub fn fb_c21_domain_sw_reset(&self) -> FB_C21_DOMAIN_SW_RESET_R {
241        FB_C21_DOMAIN_SW_RESET_R::new(((self.bits >> 5) & 0x01) != 0)
242    }
243}
244impl W {
245    #[doc = "Bit 0 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
246    #[inline(always)]
247    pub fn fb_c02_domain_sw_reset(&mut self) -> FB_C02_DOMAIN_SW_RESET_W {
248        FB_C02_DOMAIN_SW_RESET_W { w: self }
249    }
250    #[doc = "Bit 2 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
251    #[inline(always)]
252    pub fn fb_c09_domain_sw_reset(&mut self) -> FB_C09_DOMAIN_SW_RESET_W {
253        FB_C09_DOMAIN_SW_RESET_W { w: self }
254    }
255    #[doc = "Bit 4 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
256    #[inline(always)]
257    pub fn fb_c16_domain_sw_reset(&mut self) -> FB_C16_DOMAIN_SW_RESET_W {
258        FB_C16_DOMAIN_SW_RESET_W { w: self }
259    }
260    #[doc = "Bit 5 - 1'b1 : Enable the Software Reset. FW need to disable it manually."]
261    #[inline(always)]
262    pub fn fb_c21_domain_sw_reset(&mut self) -> FB_C21_DOMAIN_SW_RESET_W {
263        FB_C21_DOMAIN_SW_RESET_W { w: self }
264    }
265    #[doc = "Writes raw bits to the register."]
266    #[inline(always)]
267    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
268        self.0.bits(bits);
269        self
270    }
271}
272#[doc = "Once Program the SW Reset Bit to 1, the corresponding reset will be asserted immediately. Once Program the SW Reset Bit to 0, the corresponding reset will be de-asserted synchronous even the corresponding clock is not running. (Turn off by Clock gating cell)\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 [fb_sw_reset](index.html) module"]
273pub struct FB_SW_RESET_SPEC;
274impl crate::RegisterSpec for FB_SW_RESET_SPEC {
275    type Ux = u32;
276}
277#[doc = "`read()` method returns [fb_sw_reset::R](R) reader structure"]
278impl crate::Readable for FB_SW_RESET_SPEC {
279    type Reader = R;
280}
281#[doc = "`write(|w| ..)` method takes [fb_sw_reset::W](W) writer structure"]
282impl crate::Writable for FB_SW_RESET_SPEC {
283    type Writer = W;
284}
285#[doc = "`reset()` method sets FB_SW_RESET to value 0"]
286impl crate::Resettable for FB_SW_RESET_SPEC {
287    #[inline(always)]
288    fn reset_value() -> Self::Ux {
289        0
290    }
291}