eos_s3/cru/
ffe_sw_reset.rs

1#[doc = "Register `FFE_SW_RESET` reader"]
2pub struct R(crate::R<FFE_SW_RESET_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FFE_SW_RESET_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FFE_SW_RESET_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FFE_SW_RESET_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `FFE_SW_RESET` writer"]
17pub struct W(crate::W<FFE_SW_RESET_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FFE_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<FFE_SW_RESET_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FFE_SW_RESET_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)\n\nValue on reset: 0"]
38#[derive(Clone, Copy, Debug, PartialEq)]
39pub enum FFE_0_X1_SW_RESET_A {
40    #[doc = "1: Enable the software reset. FW need to disable it manually. (R01_P3_FFE as well)"]
41    ENABLE = 1,
42}
43impl From<FFE_0_X1_SW_RESET_A> for bool {
44    #[inline(always)]
45    fn from(variant: FFE_0_X1_SW_RESET_A) -> Self {
46        variant as u8 != 0
47    }
48}
49#[doc = "Field `FFE_0_X1_SW_Reset` reader - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
50pub struct FFE_0_X1_SW_RESET_R(crate::FieldReader<bool, FFE_0_X1_SW_RESET_A>);
51impl FFE_0_X1_SW_RESET_R {
52    #[inline(always)]
53    pub(crate) fn new(bits: bool) -> Self {
54        FFE_0_X1_SW_RESET_R(crate::FieldReader::new(bits))
55    }
56    #[doc = r"Get enumerated values variant"]
57    #[inline(always)]
58    pub fn variant(&self) -> Option<FFE_0_X1_SW_RESET_A> {
59        match self.bits {
60            true => Some(FFE_0_X1_SW_RESET_A::ENABLE),
61            _ => None,
62        }
63    }
64    #[doc = "Checks if the value of the field is `ENABLE`"]
65    #[inline(always)]
66    pub fn is_enable(&self) -> bool {
67        **self == FFE_0_X1_SW_RESET_A::ENABLE
68    }
69}
70impl core::ops::Deref for FFE_0_X1_SW_RESET_R {
71    type Target = crate::FieldReader<bool, FFE_0_X1_SW_RESET_A>;
72    #[inline(always)]
73    fn deref(&self) -> &Self::Target {
74        &self.0
75    }
76}
77#[doc = "Field `FFE_0_X1_SW_Reset` writer - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
78pub struct FFE_0_X1_SW_RESET_W<'a> {
79    w: &'a mut W,
80}
81impl<'a> FFE_0_X1_SW_RESET_W<'a> {
82    #[doc = r"Writes `variant` to the field"]
83    #[inline(always)]
84    pub fn variant(self, variant: FFE_0_X1_SW_RESET_A) -> &'a mut W {
85        self.bit(variant.into())
86    }
87    #[doc = "Enable the software reset. FW need to disable it manually. (R01_P3_FFE as well)"]
88    #[inline(always)]
89    pub fn enable(self) -> &'a mut W {
90        self.variant(FFE_0_X1_SW_RESET_A::ENABLE)
91    }
92    #[doc = r"Sets the field bit"]
93    #[inline(always)]
94    pub fn set_bit(self) -> &'a mut W {
95        self.bit(true)
96    }
97    #[doc = r"Clears the field bit"]
98    #[inline(always)]
99    pub fn clear_bit(self) -> &'a mut W {
100        self.bit(false)
101    }
102    #[doc = r"Writes raw bits to the field"]
103    #[inline(always)]
104    pub fn bit(self, value: bool) -> &'a mut W {
105        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
106        self.w
107    }
108}
109#[doc = "1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)\n\nValue on reset: 0"]
110#[derive(Clone, Copy, Debug, PartialEq)]
111pub enum FFE_0_X4_SW_RESET_A {
112    #[doc = "1: Enable the software reset. FW need to disable it manually. (R01_P3_FFE as well)"]
113    ENABLE = 1,
114}
115impl From<FFE_0_X4_SW_RESET_A> for bool {
116    #[inline(always)]
117    fn from(variant: FFE_0_X4_SW_RESET_A) -> Self {
118        variant as u8 != 0
119    }
120}
121#[doc = "Field `FFE_0_X4_SW_Reset` reader - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
122pub struct FFE_0_X4_SW_RESET_R(crate::FieldReader<bool, FFE_0_X4_SW_RESET_A>);
123impl FFE_0_X4_SW_RESET_R {
124    #[inline(always)]
125    pub(crate) fn new(bits: bool) -> Self {
126        FFE_0_X4_SW_RESET_R(crate::FieldReader::new(bits))
127    }
128    #[doc = r"Get enumerated values variant"]
129    #[inline(always)]
130    pub fn variant(&self) -> Option<FFE_0_X4_SW_RESET_A> {
131        match self.bits {
132            true => Some(FFE_0_X4_SW_RESET_A::ENABLE),
133            _ => None,
134        }
135    }
136    #[doc = "Checks if the value of the field is `ENABLE`"]
137    #[inline(always)]
138    pub fn is_enable(&self) -> bool {
139        **self == FFE_0_X4_SW_RESET_A::ENABLE
140    }
141}
142impl core::ops::Deref for FFE_0_X4_SW_RESET_R {
143    type Target = crate::FieldReader<bool, FFE_0_X4_SW_RESET_A>;
144    #[inline(always)]
145    fn deref(&self) -> &Self::Target {
146        &self.0
147    }
148}
149#[doc = "Field `FFE_0_X4_SW_Reset` writer - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
150pub struct FFE_0_X4_SW_RESET_W<'a> {
151    w: &'a mut W,
152}
153impl<'a> FFE_0_X4_SW_RESET_W<'a> {
154    #[doc = r"Writes `variant` to the field"]
155    #[inline(always)]
156    pub fn variant(self, variant: FFE_0_X4_SW_RESET_A) -> &'a mut W {
157        self.bit(variant.into())
158    }
159    #[doc = "Enable the software reset. FW need to disable it manually. (R01_P3_FFE as well)"]
160    #[inline(always)]
161    pub fn enable(self) -> &'a mut W {
162        self.variant(FFE_0_X4_SW_RESET_A::ENABLE)
163    }
164    #[doc = r"Sets the field bit"]
165    #[inline(always)]
166    pub fn set_bit(self) -> &'a mut W {
167        self.bit(true)
168    }
169    #[doc = r"Clears the field bit"]
170    #[inline(always)]
171    pub fn clear_bit(self) -> &'a mut W {
172        self.bit(false)
173    }
174    #[doc = r"Writes raw bits to the field"]
175    #[inline(always)]
176    pub fn bit(self, value: bool) -> &'a mut W {
177        self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01);
178        self.w
179    }
180}
181impl R {
182    #[doc = "Bit 0 - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
183    #[inline(always)]
184    pub fn ffe_0_x1_sw_reset(&self) -> FFE_0_X1_SW_RESET_R {
185        FFE_0_X1_SW_RESET_R::new((self.bits & 0x01) != 0)
186    }
187    #[doc = "Bit 0 - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
188    #[inline(always)]
189    pub fn ffe_0_x4_sw_reset(&self) -> FFE_0_X4_SW_RESET_R {
190        FFE_0_X4_SW_RESET_R::new((self.bits & 0x01) != 0)
191    }
192}
193impl W {
194    #[doc = "Bit 0 - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
195    #[inline(always)]
196    pub fn ffe_0_x1_sw_reset(&mut self) -> FFE_0_X1_SW_RESET_W {
197        FFE_0_X1_SW_RESET_W { w: self }
198    }
199    #[doc = "Bit 0 - 1'b1 : Enable the Software Reset. FW need to disable it manually. (R01_P3_FFE as well)"]
200    #[inline(always)]
201    pub fn ffe_0_x4_sw_reset(&mut self) -> FFE_0_X4_SW_RESET_W {
202        FFE_0_X4_SW_RESET_W { w: self }
203    }
204    #[doc = "Writes raw bits to the register."]
205    #[inline(always)]
206    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
207        self.0.bits(bits);
208        self
209    }
210}
211#[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 [ffe_sw_reset](index.html) module"]
212pub struct FFE_SW_RESET_SPEC;
213impl crate::RegisterSpec for FFE_SW_RESET_SPEC {
214    type Ux = u32;
215}
216#[doc = "`read()` method returns [ffe_sw_reset::R](R) reader structure"]
217impl crate::Readable for FFE_SW_RESET_SPEC {
218    type Reader = R;
219}
220#[doc = "`write(|w| ..)` method takes [ffe_sw_reset::W](W) writer structure"]
221impl crate::Writable for FFE_SW_RESET_SPEC {
222    type Writer = W;
223}
224#[doc = "`reset()` method sets FFE_SW_RESET to value 0"]
225impl crate::Resettable for FFE_SW_RESET_SPEC {
226    #[inline(always)]
227    fn reset_value() -> Self::Ux {
228        0
229    }
230}