bl602_pac/sf_ctrl/
sf_ctrl_1.rs

1#[doc = "Register `sf_ctrl_1` reader"]
2pub struct R(crate::R<SF_CTRL_1_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SF_CTRL_1_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SF_CTRL_1_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SF_CTRL_1_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `sf_ctrl_1` writer"]
17pub struct W(crate::W<SF_CTRL_1_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SF_CTRL_1_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<SF_CTRL_1_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SF_CTRL_1_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `sf_if_sr_pat_mask` reader - "]
38pub type SF_IF_SR_PAT_MASK_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `sf_if_sr_pat_mask` writer - "]
40pub type SF_IF_SR_PAT_MASK_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, SF_CTRL_1_SPEC, u8, u8, 8, O>;
42#[doc = "Field `sf_if_sr_pat` reader - "]
43pub type SF_IF_SR_PAT_R = crate::FieldReader<u8, u8>;
44#[doc = "Field `sf_if_sr_pat` writer - "]
45pub type SF_IF_SR_PAT_W<'a, const O: u8> =
46    crate::FieldWriter<'a, u32, SF_CTRL_1_SPEC, u8, u8, 8, O>;
47#[doc = "Field `sf_if_sr_int` reader - "]
48pub type SF_IF_SR_INT_R = crate::BitReader<bool>;
49#[doc = "Field `sf_if_sr_int_en` reader - "]
50pub type SF_IF_SR_INT_EN_R = crate::BitReader<bool>;
51#[doc = "Field `sf_if_sr_int_en` writer - "]
52pub type SF_IF_SR_INT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
53#[doc = "Field `sf_if_sr_int_set` reader - "]
54pub type SF_IF_SR_INT_SET_R = crate::BitReader<bool>;
55#[doc = "Field `sf_if_sr_int_set` writer - "]
56pub type SF_IF_SR_INT_SET_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
57#[doc = "Field `sf_if_0_ack_lat` reader - "]
58pub type SF_IF_0_ACK_LAT_R = crate::FieldReader<u8, u8>;
59#[doc = "Field `sf_if_0_ack_lat` writer - "]
60pub type SF_IF_0_ACK_LAT_W<'a, const O: u8> =
61    crate::FieldWriter<'a, u32, SF_CTRL_1_SPEC, u8, u8, 3, O>;
62#[doc = "Field `sf_if_reg_hold` reader - "]
63pub type SF_IF_REG_HOLD_R = crate::BitReader<bool>;
64#[doc = "Field `sf_if_reg_hold` writer - "]
65pub type SF_IF_REG_HOLD_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
66#[doc = "Field `sf_if_reg_wp` reader - "]
67pub type SF_IF_REG_WP_R = crate::BitReader<bool>;
68#[doc = "Field `sf_if_reg_wp` writer - "]
69pub type SF_IF_REG_WP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
70#[doc = "Field `sf_ahb2sif_stopped` reader - "]
71pub type SF_AHB2SIF_STOPPED_R = crate::BitReader<bool>;
72#[doc = "Field `sf_ahb2sif_stop` reader - "]
73pub type SF_AHB2SIF_STOP_R = crate::BitReader<bool>;
74#[doc = "Field `sf_ahb2sif_stop` writer - "]
75pub type SF_AHB2SIF_STOP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
76#[doc = "Field `sf_if_fn_sel` reader - "]
77pub type SF_IF_FN_SEL_R = crate::BitReader<bool>;
78#[doc = "Field `sf_if_fn_sel` writer - "]
79pub type SF_IF_FN_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
80#[doc = "Field `sf_if_en` reader - "]
81pub type SF_IF_EN_R = crate::BitReader<bool>;
82#[doc = "Field `sf_if_en` writer - "]
83pub type SF_IF_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
84#[doc = "Field `sf_ahb2sif_en` reader - "]
85pub type SF_AHB2SIF_EN_R = crate::BitReader<bool>;
86#[doc = "Field `sf_ahb2sif_en` writer - "]
87pub type SF_AHB2SIF_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
88#[doc = "Field `sf_ahb2sram_en` reader - "]
89pub type SF_AHB2SRAM_EN_R = crate::BitReader<bool>;
90#[doc = "Field `sf_ahb2sram_en` writer - "]
91pub type SF_AHB2SRAM_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_1_SPEC, bool, O>;
92impl R {
93    #[doc = "Bits 0:7"]
94    #[inline(always)]
95    pub fn sf_if_sr_pat_mask(&self) -> SF_IF_SR_PAT_MASK_R {
96        SF_IF_SR_PAT_MASK_R::new((self.bits & 0xff) as u8)
97    }
98    #[doc = "Bits 8:15"]
99    #[inline(always)]
100    pub fn sf_if_sr_pat(&self) -> SF_IF_SR_PAT_R {
101        SF_IF_SR_PAT_R::new(((self.bits >> 8) & 0xff) as u8)
102    }
103    #[doc = "Bit 16"]
104    #[inline(always)]
105    pub fn sf_if_sr_int(&self) -> SF_IF_SR_INT_R {
106        SF_IF_SR_INT_R::new(((self.bits >> 16) & 1) != 0)
107    }
108    #[doc = "Bit 17"]
109    #[inline(always)]
110    pub fn sf_if_sr_int_en(&self) -> SF_IF_SR_INT_EN_R {
111        SF_IF_SR_INT_EN_R::new(((self.bits >> 17) & 1) != 0)
112    }
113    #[doc = "Bit 18"]
114    #[inline(always)]
115    pub fn sf_if_sr_int_set(&self) -> SF_IF_SR_INT_SET_R {
116        SF_IF_SR_INT_SET_R::new(((self.bits >> 18) & 1) != 0)
117    }
118    #[doc = "Bits 20:22"]
119    #[inline(always)]
120    pub fn sf_if_0_ack_lat(&self) -> SF_IF_0_ACK_LAT_R {
121        SF_IF_0_ACK_LAT_R::new(((self.bits >> 20) & 7) as u8)
122    }
123    #[doc = "Bit 24"]
124    #[inline(always)]
125    pub fn sf_if_reg_hold(&self) -> SF_IF_REG_HOLD_R {
126        SF_IF_REG_HOLD_R::new(((self.bits >> 24) & 1) != 0)
127    }
128    #[doc = "Bit 25"]
129    #[inline(always)]
130    pub fn sf_if_reg_wp(&self) -> SF_IF_REG_WP_R {
131        SF_IF_REG_WP_R::new(((self.bits >> 25) & 1) != 0)
132    }
133    #[doc = "Bit 26"]
134    #[inline(always)]
135    pub fn sf_ahb2sif_stopped(&self) -> SF_AHB2SIF_STOPPED_R {
136        SF_AHB2SIF_STOPPED_R::new(((self.bits >> 26) & 1) != 0)
137    }
138    #[doc = "Bit 27"]
139    #[inline(always)]
140    pub fn sf_ahb2sif_stop(&self) -> SF_AHB2SIF_STOP_R {
141        SF_AHB2SIF_STOP_R::new(((self.bits >> 27) & 1) != 0)
142    }
143    #[doc = "Bit 28"]
144    #[inline(always)]
145    pub fn sf_if_fn_sel(&self) -> SF_IF_FN_SEL_R {
146        SF_IF_FN_SEL_R::new(((self.bits >> 28) & 1) != 0)
147    }
148    #[doc = "Bit 29"]
149    #[inline(always)]
150    pub fn sf_if_en(&self) -> SF_IF_EN_R {
151        SF_IF_EN_R::new(((self.bits >> 29) & 1) != 0)
152    }
153    #[doc = "Bit 30"]
154    #[inline(always)]
155    pub fn sf_ahb2sif_en(&self) -> SF_AHB2SIF_EN_R {
156        SF_AHB2SIF_EN_R::new(((self.bits >> 30) & 1) != 0)
157    }
158    #[doc = "Bit 31"]
159    #[inline(always)]
160    pub fn sf_ahb2sram_en(&self) -> SF_AHB2SRAM_EN_R {
161        SF_AHB2SRAM_EN_R::new(((self.bits >> 31) & 1) != 0)
162    }
163}
164impl W {
165    #[doc = "Bits 0:7"]
166    #[inline(always)]
167    #[must_use]
168    pub fn sf_if_sr_pat_mask(&mut self) -> SF_IF_SR_PAT_MASK_W<0> {
169        SF_IF_SR_PAT_MASK_W::new(self)
170    }
171    #[doc = "Bits 8:15"]
172    #[inline(always)]
173    #[must_use]
174    pub fn sf_if_sr_pat(&mut self) -> SF_IF_SR_PAT_W<8> {
175        SF_IF_SR_PAT_W::new(self)
176    }
177    #[doc = "Bit 17"]
178    #[inline(always)]
179    #[must_use]
180    pub fn sf_if_sr_int_en(&mut self) -> SF_IF_SR_INT_EN_W<17> {
181        SF_IF_SR_INT_EN_W::new(self)
182    }
183    #[doc = "Bit 18"]
184    #[inline(always)]
185    #[must_use]
186    pub fn sf_if_sr_int_set(&mut self) -> SF_IF_SR_INT_SET_W<18> {
187        SF_IF_SR_INT_SET_W::new(self)
188    }
189    #[doc = "Bits 20:22"]
190    #[inline(always)]
191    #[must_use]
192    pub fn sf_if_0_ack_lat(&mut self) -> SF_IF_0_ACK_LAT_W<20> {
193        SF_IF_0_ACK_LAT_W::new(self)
194    }
195    #[doc = "Bit 24"]
196    #[inline(always)]
197    #[must_use]
198    pub fn sf_if_reg_hold(&mut self) -> SF_IF_REG_HOLD_W<24> {
199        SF_IF_REG_HOLD_W::new(self)
200    }
201    #[doc = "Bit 25"]
202    #[inline(always)]
203    #[must_use]
204    pub fn sf_if_reg_wp(&mut self) -> SF_IF_REG_WP_W<25> {
205        SF_IF_REG_WP_W::new(self)
206    }
207    #[doc = "Bit 27"]
208    #[inline(always)]
209    #[must_use]
210    pub fn sf_ahb2sif_stop(&mut self) -> SF_AHB2SIF_STOP_W<27> {
211        SF_AHB2SIF_STOP_W::new(self)
212    }
213    #[doc = "Bit 28"]
214    #[inline(always)]
215    #[must_use]
216    pub fn sf_if_fn_sel(&mut self) -> SF_IF_FN_SEL_W<28> {
217        SF_IF_FN_SEL_W::new(self)
218    }
219    #[doc = "Bit 29"]
220    #[inline(always)]
221    #[must_use]
222    pub fn sf_if_en(&mut self) -> SF_IF_EN_W<29> {
223        SF_IF_EN_W::new(self)
224    }
225    #[doc = "Bit 30"]
226    #[inline(always)]
227    #[must_use]
228    pub fn sf_ahb2sif_en(&mut self) -> SF_AHB2SIF_EN_W<30> {
229        SF_AHB2SIF_EN_W::new(self)
230    }
231    #[doc = "Bit 31"]
232    #[inline(always)]
233    #[must_use]
234    pub fn sf_ahb2sram_en(&mut self) -> SF_AHB2SRAM_EN_W<31> {
235        SF_AHB2SRAM_EN_W::new(self)
236    }
237    #[doc = "Writes raw bits to the register."]
238    #[inline(always)]
239    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
240        self.0.bits(bits);
241        self
242    }
243}
244#[doc = "sf_ctrl_1.\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 [sf_ctrl_1](index.html) module"]
245pub struct SF_CTRL_1_SPEC;
246impl crate::RegisterSpec for SF_CTRL_1_SPEC {
247    type Ux = u32;
248}
249#[doc = "`read()` method returns [sf_ctrl_1::R](R) reader structure"]
250impl crate::Readable for SF_CTRL_1_SPEC {
251    type Reader = R;
252}
253#[doc = "`write(|w| ..)` method takes [sf_ctrl_1::W](W) writer structure"]
254impl crate::Writable for SF_CTRL_1_SPEC {
255    type Writer = W;
256    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
257    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
258}
259#[doc = "`reset()` method sets sf_ctrl_1 to value 0xf360_0000"]
260impl crate::Resettable for SF_CTRL_1_SPEC {
261    const RESET_VALUE: Self::Ux = 0xf360_0000;
262}