bl702_pac/sf_ctrl/
sf_ctrl_2.rs

1#[doc = "Register `sf_ctrl_2` reader"]
2pub struct R(crate::R<SF_CTRL_2_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SF_CTRL_2_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SF_CTRL_2_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SF_CTRL_2_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `sf_ctrl_2` writer"]
17pub struct W(crate::W<SF_CTRL_2_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SF_CTRL_2_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_2_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SF_CTRL_2_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `sf_if_pad_sel` reader - "]
38pub type SF_IF_PAD_SEL_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `sf_if_pad_sel` writer - "]
40pub type SF_IF_PAD_SEL_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, SF_CTRL_2_SPEC, u8, u8, 2, O>;
42#[doc = "Field `sf_if_pad_sel_lock` reader - "]
43pub type SF_IF_PAD_SEL_LOCK_R = crate::BitReader<bool>;
44#[doc = "Field `sf_if_pad_sel_lock` writer - "]
45pub type SF_IF_PAD_SEL_LOCK_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
46#[doc = "Field `sf_if_dtr_en` reader - "]
47pub type SF_IF_DTR_EN_R = crate::BitReader<bool>;
48#[doc = "Field `sf_if_dtr_en` writer - "]
49pub type SF_IF_DTR_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
50#[doc = "Field `sf_if_dqs_en` reader - "]
51pub type SF_IF_DQS_EN_R = crate::BitReader<bool>;
52#[doc = "Field `sf_if_dqs_en` writer - "]
53pub type SF_IF_DQS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
54#[doc = "Field `sf_if_bk_swap` reader - "]
55pub type SF_IF_BK_SWAP_R = crate::BitReader<bool>;
56#[doc = "Field `sf_if_bk_swap` writer - "]
57pub type SF_IF_BK_SWAP_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
58#[doc = "Field `sf_if_bk2_mode` reader - "]
59pub type SF_IF_BK2_MODE_R = crate::BitReader<bool>;
60#[doc = "Field `sf_if_bk2_mode` writer - "]
61pub type SF_IF_BK2_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
62#[doc = "Field `sf_if_bk2_en` reader - "]
63pub type SF_IF_BK2_EN_R = crate::BitReader<bool>;
64#[doc = "Field `sf_if_bk2_en` writer - "]
65pub type SF_IF_BK2_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
66#[doc = "Field `sf_if_0_bk_sel` reader - "]
67pub type SF_IF_0_BK_SEL_R = crate::BitReader<bool>;
68#[doc = "Field `sf_if_0_bk_sel` writer - "]
69pub type SF_IF_0_BK_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_2_SPEC, bool, O>;
70impl R {
71    #[doc = "Bits 0:1"]
72    #[inline(always)]
73    pub fn sf_if_pad_sel(&self) -> SF_IF_PAD_SEL_R {
74        SF_IF_PAD_SEL_R::new((self.bits & 3) as u8)
75    }
76    #[doc = "Bit 3"]
77    #[inline(always)]
78    pub fn sf_if_pad_sel_lock(&self) -> SF_IF_PAD_SEL_LOCK_R {
79        SF_IF_PAD_SEL_LOCK_R::new(((self.bits >> 3) & 1) != 0)
80    }
81    #[doc = "Bit 4"]
82    #[inline(always)]
83    pub fn sf_if_dtr_en(&self) -> SF_IF_DTR_EN_R {
84        SF_IF_DTR_EN_R::new(((self.bits >> 4) & 1) != 0)
85    }
86    #[doc = "Bit 5"]
87    #[inline(always)]
88    pub fn sf_if_dqs_en(&self) -> SF_IF_DQS_EN_R {
89        SF_IF_DQS_EN_R::new(((self.bits >> 5) & 1) != 0)
90    }
91    #[doc = "Bit 28"]
92    #[inline(always)]
93    pub fn sf_if_bk_swap(&self) -> SF_IF_BK_SWAP_R {
94        SF_IF_BK_SWAP_R::new(((self.bits >> 28) & 1) != 0)
95    }
96    #[doc = "Bit 29"]
97    #[inline(always)]
98    pub fn sf_if_bk2_mode(&self) -> SF_IF_BK2_MODE_R {
99        SF_IF_BK2_MODE_R::new(((self.bits >> 29) & 1) != 0)
100    }
101    #[doc = "Bit 30"]
102    #[inline(always)]
103    pub fn sf_if_bk2_en(&self) -> SF_IF_BK2_EN_R {
104        SF_IF_BK2_EN_R::new(((self.bits >> 30) & 1) != 0)
105    }
106    #[doc = "Bit 31"]
107    #[inline(always)]
108    pub fn sf_if_0_bk_sel(&self) -> SF_IF_0_BK_SEL_R {
109        SF_IF_0_BK_SEL_R::new(((self.bits >> 31) & 1) != 0)
110    }
111}
112impl W {
113    #[doc = "Bits 0:1"]
114    #[inline(always)]
115    #[must_use]
116    pub fn sf_if_pad_sel(&mut self) -> SF_IF_PAD_SEL_W<0> {
117        SF_IF_PAD_SEL_W::new(self)
118    }
119    #[doc = "Bit 3"]
120    #[inline(always)]
121    #[must_use]
122    pub fn sf_if_pad_sel_lock(&mut self) -> SF_IF_PAD_SEL_LOCK_W<3> {
123        SF_IF_PAD_SEL_LOCK_W::new(self)
124    }
125    #[doc = "Bit 4"]
126    #[inline(always)]
127    #[must_use]
128    pub fn sf_if_dtr_en(&mut self) -> SF_IF_DTR_EN_W<4> {
129        SF_IF_DTR_EN_W::new(self)
130    }
131    #[doc = "Bit 5"]
132    #[inline(always)]
133    #[must_use]
134    pub fn sf_if_dqs_en(&mut self) -> SF_IF_DQS_EN_W<5> {
135        SF_IF_DQS_EN_W::new(self)
136    }
137    #[doc = "Bit 28"]
138    #[inline(always)]
139    #[must_use]
140    pub fn sf_if_bk_swap(&mut self) -> SF_IF_BK_SWAP_W<28> {
141        SF_IF_BK_SWAP_W::new(self)
142    }
143    #[doc = "Bit 29"]
144    #[inline(always)]
145    #[must_use]
146    pub fn sf_if_bk2_mode(&mut self) -> SF_IF_BK2_MODE_W<29> {
147        SF_IF_BK2_MODE_W::new(self)
148    }
149    #[doc = "Bit 30"]
150    #[inline(always)]
151    #[must_use]
152    pub fn sf_if_bk2_en(&mut self) -> SF_IF_BK2_EN_W<30> {
153        SF_IF_BK2_EN_W::new(self)
154    }
155    #[doc = "Bit 31"]
156    #[inline(always)]
157    #[must_use]
158    pub fn sf_if_0_bk_sel(&mut self) -> SF_IF_0_BK_SEL_W<31> {
159        SF_IF_0_BK_SEL_W::new(self)
160    }
161    #[doc = "Writes raw bits to the register."]
162    #[inline(always)]
163    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
164        self.0.bits(bits);
165        self
166    }
167}
168#[doc = "sf_ctrl_2.\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_2](index.html) module"]
169pub struct SF_CTRL_2_SPEC;
170impl crate::RegisterSpec for SF_CTRL_2_SPEC {
171    type Ux = u32;
172}
173#[doc = "`read()` method returns [sf_ctrl_2::R](R) reader structure"]
174impl crate::Readable for SF_CTRL_2_SPEC {
175    type Reader = R;
176}
177#[doc = "`write(|w| ..)` method takes [sf_ctrl_2::W](W) writer structure"]
178impl crate::Writable for SF_CTRL_2_SPEC {
179    type Writer = W;
180    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
181    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
182}
183#[doc = "`reset()` method sets sf_ctrl_2 to value 0"]
184impl crate::Resettable for SF_CTRL_2_SPEC {
185    const RESET_VALUE: Self::Ux = 0;
186}