bl602_pac/rf/
singen_ctrl0.rs1#[doc = "Register `singen_ctrl0` reader"]
2pub struct R(crate::R<SINGEN_CTRL0_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<SINGEN_CTRL0_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<SINGEN_CTRL0_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<SINGEN_CTRL0_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `singen_ctrl0` writer"]
17pub struct W(crate::W<SINGEN_CTRL0_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<SINGEN_CTRL0_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<SINGEN_CTRL0_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<SINGEN_CTRL0_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `singen_inc_step1` reader - "]
38pub type SINGEN_INC_STEP1_R = crate::FieldReader<u16, u16>;
39#[doc = "Field `singen_inc_step1` writer - "]
40pub type SINGEN_INC_STEP1_W<'a, const O: u8> =
41 crate::FieldWriter<'a, u32, SINGEN_CTRL0_SPEC, u16, u16, 10, O>;
42#[doc = "Field `singen_inc_step0` reader - "]
43pub type SINGEN_INC_STEP0_R = crate::FieldReader<u16, u16>;
44#[doc = "Field `singen_inc_step0` writer - "]
45pub type SINGEN_INC_STEP0_W<'a, const O: u8> =
46 crate::FieldWriter<'a, u32, SINGEN_CTRL0_SPEC, u16, u16, 10, O>;
47#[doc = "Field `singen_unsign_en` reader - "]
48pub type SINGEN_UNSIGN_EN_R = crate::BitReader<bool>;
49#[doc = "Field `singen_unsign_en` writer - "]
50pub type SINGEN_UNSIGN_EN_W<'a, const O: u8> =
51 crate::BitWriter<'a, u32, SINGEN_CTRL0_SPEC, bool, O>;
52#[doc = "Field `singen_clkdiv_n` reader - "]
53pub type SINGEN_CLKDIV_N_R = crate::FieldReader<u8, u8>;
54#[doc = "Field `singen_clkdiv_n` writer - "]
55pub type SINGEN_CLKDIV_N_W<'a, const O: u8> =
56 crate::FieldWriter<'a, u32, SINGEN_CTRL0_SPEC, u8, u8, 2, O>;
57#[doc = "Field `singen_en` reader - "]
58pub type SINGEN_EN_R = crate::BitReader<bool>;
59#[doc = "Field `singen_en` writer - "]
60pub type SINGEN_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, SINGEN_CTRL0_SPEC, bool, O>;
61impl R {
62 #[doc = "Bits 0:9"]
63 #[inline(always)]
64 pub fn singen_inc_step1(&self) -> SINGEN_INC_STEP1_R {
65 SINGEN_INC_STEP1_R::new((self.bits & 0x03ff) as u16)
66 }
67 #[doc = "Bits 16:25"]
68 #[inline(always)]
69 pub fn singen_inc_step0(&self) -> SINGEN_INC_STEP0_R {
70 SINGEN_INC_STEP0_R::new(((self.bits >> 16) & 0x03ff) as u16)
71 }
72 #[doc = "Bit 28"]
73 #[inline(always)]
74 pub fn singen_unsign_en(&self) -> SINGEN_UNSIGN_EN_R {
75 SINGEN_UNSIGN_EN_R::new(((self.bits >> 28) & 1) != 0)
76 }
77 #[doc = "Bits 29:30"]
78 #[inline(always)]
79 pub fn singen_clkdiv_n(&self) -> SINGEN_CLKDIV_N_R {
80 SINGEN_CLKDIV_N_R::new(((self.bits >> 29) & 3) as u8)
81 }
82 #[doc = "Bit 31"]
83 #[inline(always)]
84 pub fn singen_en(&self) -> SINGEN_EN_R {
85 SINGEN_EN_R::new(((self.bits >> 31) & 1) != 0)
86 }
87}
88impl W {
89 #[doc = "Bits 0:9"]
90 #[inline(always)]
91 #[must_use]
92 pub fn singen_inc_step1(&mut self) -> SINGEN_INC_STEP1_W<0> {
93 SINGEN_INC_STEP1_W::new(self)
94 }
95 #[doc = "Bits 16:25"]
96 #[inline(always)]
97 #[must_use]
98 pub fn singen_inc_step0(&mut self) -> SINGEN_INC_STEP0_W<16> {
99 SINGEN_INC_STEP0_W::new(self)
100 }
101 #[doc = "Bit 28"]
102 #[inline(always)]
103 #[must_use]
104 pub fn singen_unsign_en(&mut self) -> SINGEN_UNSIGN_EN_W<28> {
105 SINGEN_UNSIGN_EN_W::new(self)
106 }
107 #[doc = "Bits 29:30"]
108 #[inline(always)]
109 #[must_use]
110 pub fn singen_clkdiv_n(&mut self) -> SINGEN_CLKDIV_N_W<29> {
111 SINGEN_CLKDIV_N_W::new(self)
112 }
113 #[doc = "Bit 31"]
114 #[inline(always)]
115 #[must_use]
116 pub fn singen_en(&mut self) -> SINGEN_EN_W<31> {
117 SINGEN_EN_W::new(self)
118 }
119 #[doc = "Writes raw bits to the register."]
120 #[inline(always)]
121 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
122 self.0.bits(bits);
123 self
124 }
125}
126#[doc = "singen_ctrl0.\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 [singen_ctrl0](index.html) module"]
127pub struct SINGEN_CTRL0_SPEC;
128impl crate::RegisterSpec for SINGEN_CTRL0_SPEC {
129 type Ux = u32;
130}
131#[doc = "`read()` method returns [singen_ctrl0::R](R) reader structure"]
132impl crate::Readable for SINGEN_CTRL0_SPEC {
133 type Reader = R;
134}
135#[doc = "`write(|w| ..)` method takes [singen_ctrl0::W](W) writer structure"]
136impl crate::Writable for SINGEN_CTRL0_SPEC {
137 type Writer = W;
138 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
139 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
140}
141#[doc = "`reset()` method sets singen_ctrl0 to value 0"]
142impl crate::Resettable for SINGEN_CTRL0_SPEC {
143 const RESET_VALUE: Self::Ux = 0;
144}