bl602_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>;
54impl R {
55    #[doc = "Bits 0:1"]
56    #[inline(always)]
57    pub fn sf_if_pad_sel(&self) -> SF_IF_PAD_SEL_R {
58        SF_IF_PAD_SEL_R::new((self.bits & 3) as u8)
59    }
60    #[doc = "Bit 3"]
61    #[inline(always)]
62    pub fn sf_if_pad_sel_lock(&self) -> SF_IF_PAD_SEL_LOCK_R {
63        SF_IF_PAD_SEL_LOCK_R::new(((self.bits >> 3) & 1) != 0)
64    }
65    #[doc = "Bit 4"]
66    #[inline(always)]
67    pub fn sf_if_dtr_en(&self) -> SF_IF_DTR_EN_R {
68        SF_IF_DTR_EN_R::new(((self.bits >> 4) & 1) != 0)
69    }
70    #[doc = "Bit 5"]
71    #[inline(always)]
72    pub fn sf_if_dqs_en(&self) -> SF_IF_DQS_EN_R {
73        SF_IF_DQS_EN_R::new(((self.bits >> 5) & 1) != 0)
74    }
75}
76impl W {
77    #[doc = "Bits 0:1"]
78    #[inline(always)]
79    #[must_use]
80    pub fn sf_if_pad_sel(&mut self) -> SF_IF_PAD_SEL_W<0> {
81        SF_IF_PAD_SEL_W::new(self)
82    }
83    #[doc = "Bit 3"]
84    #[inline(always)]
85    #[must_use]
86    pub fn sf_if_pad_sel_lock(&mut self) -> SF_IF_PAD_SEL_LOCK_W<3> {
87        SF_IF_PAD_SEL_LOCK_W::new(self)
88    }
89    #[doc = "Bit 4"]
90    #[inline(always)]
91    #[must_use]
92    pub fn sf_if_dtr_en(&mut self) -> SF_IF_DTR_EN_W<4> {
93        SF_IF_DTR_EN_W::new(self)
94    }
95    #[doc = "Bit 5"]
96    #[inline(always)]
97    #[must_use]
98    pub fn sf_if_dqs_en(&mut self) -> SF_IF_DQS_EN_W<5> {
99        SF_IF_DQS_EN_W::new(self)
100    }
101    #[doc = "Writes raw bits to the register."]
102    #[inline(always)]
103    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
104        self.0.bits(bits);
105        self
106    }
107}
108#[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"]
109pub struct SF_CTRL_2_SPEC;
110impl crate::RegisterSpec for SF_CTRL_2_SPEC {
111    type Ux = u32;
112}
113#[doc = "`read()` method returns [sf_ctrl_2::R](R) reader structure"]
114impl crate::Readable for SF_CTRL_2_SPEC {
115    type Reader = R;
116}
117#[doc = "`write(|w| ..)` method takes [sf_ctrl_2::W](W) writer structure"]
118impl crate::Writable for SF_CTRL_2_SPEC {
119    type Writer = W;
120    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
121    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
122}
123#[doc = "`reset()` method sets sf_ctrl_2 to value 0"]
124impl crate::Resettable for SF_CTRL_2_SPEC {
125    const RESET_VALUE: Self::Ux = 0;
126}