bl602_pac/sf_ctrl/
sf_ctrl_3.rs

1#[doc = "Register `sf_ctrl_3` reader"]
2pub struct R(crate::R<SF_CTRL_3_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<SF_CTRL_3_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<SF_CTRL_3_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<SF_CTRL_3_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `sf_ctrl_3` writer"]
17pub struct W(crate::W<SF_CTRL_3_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<SF_CTRL_3_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_3_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<SF_CTRL_3_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `sf_cmds_wrap_len` reader - "]
38pub type SF_CMDS_WRAP_LEN_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `sf_cmds_wrap_len` writer - "]
40pub type SF_CMDS_WRAP_LEN_W<'a, const O: u8> =
41    crate::FieldWriter<'a, u32, SF_CTRL_3_SPEC, u8, u8, 4, O>;
42#[doc = "Field `sf_cmds_en` reader - "]
43pub type SF_CMDS_EN_R = crate::BitReader<bool>;
44#[doc = "Field `sf_cmds_en` writer - "]
45pub type SF_CMDS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_3_SPEC, bool, O>;
46#[doc = "Field `sf_cmds_bt_dly` reader - "]
47pub type SF_CMDS_BT_DLY_R = crate::FieldReader<u8, u8>;
48#[doc = "Field `sf_cmds_bt_dly` writer - "]
49pub type SF_CMDS_BT_DLY_W<'a, const O: u8> =
50    crate::FieldWriter<'a, u32, SF_CTRL_3_SPEC, u8, u8, 3, O>;
51#[doc = "Field `sf_cmds_bt_en` reader - "]
52pub type SF_CMDS_BT_EN_R = crate::BitReader<bool>;
53#[doc = "Field `sf_cmds_bt_en` writer - "]
54pub type SF_CMDS_BT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_3_SPEC, bool, O>;
55#[doc = "Field `sf_cmds_wrap_q_ini` reader - "]
56pub type SF_CMDS_WRAP_Q_INI_R = crate::BitReader<bool>;
57#[doc = "Field `sf_cmds_wrap_q_ini` writer - "]
58pub type SF_CMDS_WRAP_Q_INI_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_3_SPEC, bool, O>;
59#[doc = "Field `sf_cmds_wrap_mode` reader - "]
60pub type SF_CMDS_WRAP_MODE_R = crate::BitReader<bool>;
61#[doc = "Field `sf_cmds_wrap_mode` writer - "]
62pub type SF_CMDS_WRAP_MODE_W<'a, const O: u8> = crate::BitWriter<'a, u32, SF_CTRL_3_SPEC, bool, O>;
63#[doc = "Field `sf_if_1_ack_lat` reader - "]
64pub type SF_IF_1_ACK_LAT_R = crate::FieldReader<u8, u8>;
65#[doc = "Field `sf_if_1_ack_lat` writer - "]
66pub type SF_IF_1_ACK_LAT_W<'a, const O: u8> =
67    crate::FieldWriter<'a, u32, SF_CTRL_3_SPEC, u8, u8, 3, O>;
68impl R {
69    #[doc = "Bits 0:3"]
70    #[inline(always)]
71    pub fn sf_cmds_wrap_len(&self) -> SF_CMDS_WRAP_LEN_R {
72        SF_CMDS_WRAP_LEN_R::new((self.bits & 0x0f) as u8)
73    }
74    #[doc = "Bit 4"]
75    #[inline(always)]
76    pub fn sf_cmds_en(&self) -> SF_CMDS_EN_R {
77        SF_CMDS_EN_R::new(((self.bits >> 4) & 1) != 0)
78    }
79    #[doc = "Bits 5:7"]
80    #[inline(always)]
81    pub fn sf_cmds_bt_dly(&self) -> SF_CMDS_BT_DLY_R {
82        SF_CMDS_BT_DLY_R::new(((self.bits >> 5) & 7) as u8)
83    }
84    #[doc = "Bit 8"]
85    #[inline(always)]
86    pub fn sf_cmds_bt_en(&self) -> SF_CMDS_BT_EN_R {
87        SF_CMDS_BT_EN_R::new(((self.bits >> 8) & 1) != 0)
88    }
89    #[doc = "Bit 9"]
90    #[inline(always)]
91    pub fn sf_cmds_wrap_q_ini(&self) -> SF_CMDS_WRAP_Q_INI_R {
92        SF_CMDS_WRAP_Q_INI_R::new(((self.bits >> 9) & 1) != 0)
93    }
94    #[doc = "Bit 10"]
95    #[inline(always)]
96    pub fn sf_cmds_wrap_mode(&self) -> SF_CMDS_WRAP_MODE_R {
97        SF_CMDS_WRAP_MODE_R::new(((self.bits >> 10) & 1) != 0)
98    }
99    #[doc = "Bits 29:31"]
100    #[inline(always)]
101    pub fn sf_if_1_ack_lat(&self) -> SF_IF_1_ACK_LAT_R {
102        SF_IF_1_ACK_LAT_R::new(((self.bits >> 29) & 7) as u8)
103    }
104}
105impl W {
106    #[doc = "Bits 0:3"]
107    #[inline(always)]
108    #[must_use]
109    pub fn sf_cmds_wrap_len(&mut self) -> SF_CMDS_WRAP_LEN_W<0> {
110        SF_CMDS_WRAP_LEN_W::new(self)
111    }
112    #[doc = "Bit 4"]
113    #[inline(always)]
114    #[must_use]
115    pub fn sf_cmds_en(&mut self) -> SF_CMDS_EN_W<4> {
116        SF_CMDS_EN_W::new(self)
117    }
118    #[doc = "Bits 5:7"]
119    #[inline(always)]
120    #[must_use]
121    pub fn sf_cmds_bt_dly(&mut self) -> SF_CMDS_BT_DLY_W<5> {
122        SF_CMDS_BT_DLY_W::new(self)
123    }
124    #[doc = "Bit 8"]
125    #[inline(always)]
126    #[must_use]
127    pub fn sf_cmds_bt_en(&mut self) -> SF_CMDS_BT_EN_W<8> {
128        SF_CMDS_BT_EN_W::new(self)
129    }
130    #[doc = "Bit 9"]
131    #[inline(always)]
132    #[must_use]
133    pub fn sf_cmds_wrap_q_ini(&mut self) -> SF_CMDS_WRAP_Q_INI_W<9> {
134        SF_CMDS_WRAP_Q_INI_W::new(self)
135    }
136    #[doc = "Bit 10"]
137    #[inline(always)]
138    #[must_use]
139    pub fn sf_cmds_wrap_mode(&mut self) -> SF_CMDS_WRAP_MODE_W<10> {
140        SF_CMDS_WRAP_MODE_W::new(self)
141    }
142    #[doc = "Bits 29:31"]
143    #[inline(always)]
144    #[must_use]
145    pub fn sf_if_1_ack_lat(&mut self) -> SF_IF_1_ACK_LAT_W<29> {
146        SF_IF_1_ACK_LAT_W::new(self)
147    }
148    #[doc = "Writes raw bits to the register."]
149    #[inline(always)]
150    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
151        self.0.bits(bits);
152        self
153    }
154}
155#[doc = "sf_ctrl_3.\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_3](index.html) module"]
156pub struct SF_CTRL_3_SPEC;
157impl crate::RegisterSpec for SF_CTRL_3_SPEC {
158    type Ux = u32;
159}
160#[doc = "`read()` method returns [sf_ctrl_3::R](R) reader structure"]
161impl crate::Readable for SF_CTRL_3_SPEC {
162    type Reader = R;
163}
164#[doc = "`write(|w| ..)` method takes [sf_ctrl_3::W](W) writer structure"]
165impl crate::Writable for SF_CTRL_3_SPEC {
166    type Writer = W;
167    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
168    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
169}
170#[doc = "`reset()` method sets sf_ctrl_3 to value 0x2000_0046"]
171impl crate::Resettable for SF_CTRL_3_SPEC {
172    const RESET_VALUE: Self::Ux = 0x2000_0046;
173}