bl602_pac/rf/
fbdv.rs

1#[doc = "Register `fbdv` reader"]
2pub struct R(crate::R<FBDV_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<FBDV_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<FBDV_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<FBDV_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `fbdv` writer"]
17pub struct W(crate::W<FBDV_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<FBDV_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<FBDV_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<FBDV_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `lo_fbdv_halfstep_en_hw` reader - "]
38pub type LO_FBDV_HALFSTEP_EN_HW_R = crate::BitReader<bool>;
39#[doc = "Field `lo_fbdv_halfstep_en_hw` writer - "]
40pub type LO_FBDV_HALFSTEP_EN_HW_W<'a, const O: u8> = crate::BitWriter<'a, u32, FBDV_SPEC, bool, O>;
41#[doc = "Field `lo_fbdv_halfstep_en` reader - "]
42pub type LO_FBDV_HALFSTEP_EN_R = crate::BitReader<bool>;
43#[doc = "Field `lo_fbdv_halfstep_en` writer - "]
44pub type LO_FBDV_HALFSTEP_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, FBDV_SPEC, bool, O>;
45#[doc = "Field `lo_fbdv_sel_sample_clk` reader - "]
46pub type LO_FBDV_SEL_SAMPLE_CLK_R = crate::FieldReader<u8, u8>;
47#[doc = "Field `lo_fbdv_sel_sample_clk` writer - "]
48pub type LO_FBDV_SEL_SAMPLE_CLK_W<'a, const O: u8> =
49    crate::FieldWriter<'a, u32, FBDV_SPEC, u8, u8, 2, O>;
50#[doc = "Field `lo_fbdv_sel_fb_clk` reader - "]
51pub type LO_FBDV_SEL_FB_CLK_R = crate::FieldReader<u8, u8>;
52#[doc = "Field `lo_fbdv_sel_fb_clk` writer - "]
53pub type LO_FBDV_SEL_FB_CLK_W<'a, const O: u8> =
54    crate::FieldWriter<'a, u32, FBDV_SPEC, u8, u8, 2, O>;
55#[doc = "Field `lo_fbdv_rst` reader - "]
56pub type LO_FBDV_RST_R = crate::BitReader<bool>;
57#[doc = "Field `lo_fbdv_rst` writer - "]
58pub type LO_FBDV_RST_W<'a, const O: u8> = crate::BitWriter<'a, u32, FBDV_SPEC, bool, O>;
59#[doc = "Field `lo_fbdv_rst_hw` reader - "]
60pub type LO_FBDV_RST_HW_R = crate::BitReader<bool>;
61#[doc = "Field `lo_fbdv_rst_hw` writer - "]
62pub type LO_FBDV_RST_HW_W<'a, const O: u8> = crate::BitWriter<'a, u32, FBDV_SPEC, bool, O>;
63impl R {
64    #[doc = "Bit 0"]
65    #[inline(always)]
66    pub fn lo_fbdv_halfstep_en_hw(&self) -> LO_FBDV_HALFSTEP_EN_HW_R {
67        LO_FBDV_HALFSTEP_EN_HW_R::new((self.bits & 1) != 0)
68    }
69    #[doc = "Bit 4"]
70    #[inline(always)]
71    pub fn lo_fbdv_halfstep_en(&self) -> LO_FBDV_HALFSTEP_EN_R {
72        LO_FBDV_HALFSTEP_EN_R::new(((self.bits >> 4) & 1) != 0)
73    }
74    #[doc = "Bits 8:9"]
75    #[inline(always)]
76    pub fn lo_fbdv_sel_sample_clk(&self) -> LO_FBDV_SEL_SAMPLE_CLK_R {
77        LO_FBDV_SEL_SAMPLE_CLK_R::new(((self.bits >> 8) & 3) as u8)
78    }
79    #[doc = "Bits 12:13"]
80    #[inline(always)]
81    pub fn lo_fbdv_sel_fb_clk(&self) -> LO_FBDV_SEL_FB_CLK_R {
82        LO_FBDV_SEL_FB_CLK_R::new(((self.bits >> 12) & 3) as u8)
83    }
84    #[doc = "Bit 16"]
85    #[inline(always)]
86    pub fn lo_fbdv_rst(&self) -> LO_FBDV_RST_R {
87        LO_FBDV_RST_R::new(((self.bits >> 16) & 1) != 0)
88    }
89    #[doc = "Bit 20"]
90    #[inline(always)]
91    pub fn lo_fbdv_rst_hw(&self) -> LO_FBDV_RST_HW_R {
92        LO_FBDV_RST_HW_R::new(((self.bits >> 20) & 1) != 0)
93    }
94}
95impl W {
96    #[doc = "Bit 0"]
97    #[inline(always)]
98    #[must_use]
99    pub fn lo_fbdv_halfstep_en_hw(&mut self) -> LO_FBDV_HALFSTEP_EN_HW_W<0> {
100        LO_FBDV_HALFSTEP_EN_HW_W::new(self)
101    }
102    #[doc = "Bit 4"]
103    #[inline(always)]
104    #[must_use]
105    pub fn lo_fbdv_halfstep_en(&mut self) -> LO_FBDV_HALFSTEP_EN_W<4> {
106        LO_FBDV_HALFSTEP_EN_W::new(self)
107    }
108    #[doc = "Bits 8:9"]
109    #[inline(always)]
110    #[must_use]
111    pub fn lo_fbdv_sel_sample_clk(&mut self) -> LO_FBDV_SEL_SAMPLE_CLK_W<8> {
112        LO_FBDV_SEL_SAMPLE_CLK_W::new(self)
113    }
114    #[doc = "Bits 12:13"]
115    #[inline(always)]
116    #[must_use]
117    pub fn lo_fbdv_sel_fb_clk(&mut self) -> LO_FBDV_SEL_FB_CLK_W<12> {
118        LO_FBDV_SEL_FB_CLK_W::new(self)
119    }
120    #[doc = "Bit 16"]
121    #[inline(always)]
122    #[must_use]
123    pub fn lo_fbdv_rst(&mut self) -> LO_FBDV_RST_W<16> {
124        LO_FBDV_RST_W::new(self)
125    }
126    #[doc = "Bit 20"]
127    #[inline(always)]
128    #[must_use]
129    pub fn lo_fbdv_rst_hw(&mut self) -> LO_FBDV_RST_HW_W<20> {
130        LO_FBDV_RST_HW_W::new(self)
131    }
132    #[doc = "Writes raw bits to the register."]
133    #[inline(always)]
134    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
135        self.0.bits(bits);
136        self
137    }
138}
139#[doc = "fbdv.\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 [fbdv](index.html) module"]
140pub struct FBDV_SPEC;
141impl crate::RegisterSpec for FBDV_SPEC {
142    type Ux = u32;
143}
144#[doc = "`read()` method returns [fbdv::R](R) reader structure"]
145impl crate::Readable for FBDV_SPEC {
146    type Reader = R;
147}
148#[doc = "`write(|w| ..)` method takes [fbdv::W](W) writer structure"]
149impl crate::Writable for FBDV_SPEC {
150    type Writer = W;
151    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
152    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
153}
154#[doc = "`reset()` method sets fbdv to value 0"]
155impl crate::Resettable for FBDV_SPEC {
156    const RESET_VALUE: Self::Ux = 0;
157}