efm32gg12b830_pac/qspi0/
writecompletionctrl.rs1#[doc = "Register `WRITECOMPLETIONCTRL` reader"]
2pub struct R(crate::R<WRITECOMPLETIONCTRL_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<WRITECOMPLETIONCTRL_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<WRITECOMPLETIONCTRL_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<WRITECOMPLETIONCTRL_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `WRITECOMPLETIONCTRL` writer"]
17pub struct W(crate::W<WRITECOMPLETIONCTRL_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<WRITECOMPLETIONCTRL_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<WRITECOMPLETIONCTRL_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<WRITECOMPLETIONCTRL_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `OPCODE` reader - Opcode"]
38pub type OPCODE_R = crate::FieldReader<u8, u8>;
39#[doc = "Field `OPCODE` writer - Opcode"]
40pub type OPCODE_W<'a> = crate::FieldWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, u8, u8, 8, 0>;
41#[doc = "Field `POLLINGBITINDEX` reader - Polling Bit Index"]
42pub type POLLINGBITINDEX_R = crate::FieldReader<u8, u8>;
43#[doc = "Field `POLLINGBITINDEX` writer - Polling Bit Index"]
44pub type POLLINGBITINDEX_W<'a> =
45 crate::FieldWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, u8, u8, 3, 8>;
46#[doc = "Field `POLLINGPOLARITY` reader - Polling Polarity"]
47pub type POLLINGPOLARITY_R = crate::BitReader<bool>;
48#[doc = "Field `POLLINGPOLARITY` writer - Polling Polarity"]
49pub type POLLINGPOLARITY_W<'a> = crate::BitWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, bool, 13>;
50#[doc = "Field `DISABLEPOLLING` reader - Disable Polling"]
51pub type DISABLEPOLLING_R = crate::BitReader<bool>;
52#[doc = "Field `DISABLEPOLLING` writer - Disable Polling"]
53pub type DISABLEPOLLING_W<'a> = crate::BitWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, bool, 14>;
54#[doc = "Field `ENABLEPOLLINGEXP` reader - Enable Polling Expiration"]
55pub type ENABLEPOLLINGEXP_R = crate::BitReader<bool>;
56#[doc = "Field `ENABLEPOLLINGEXP` writer - Enable Polling Expiration"]
57pub type ENABLEPOLLINGEXP_W<'a> = crate::BitWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, bool, 15>;
58#[doc = "Field `POLLCOUNT` reader - Poll Count"]
59pub type POLLCOUNT_R = crate::FieldReader<u8, u8>;
60#[doc = "Field `POLLCOUNT` writer - Poll Count"]
61pub type POLLCOUNT_W<'a> = crate::FieldWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, u8, u8, 8, 16>;
62#[doc = "Field `POLLREPDELAY` reader - Poll Repetition Delay"]
63pub type POLLREPDELAY_R = crate::FieldReader<u8, u8>;
64#[doc = "Field `POLLREPDELAY` writer - Poll Repetition Delay"]
65pub type POLLREPDELAY_W<'a> = crate::FieldWriter<'a, u32, WRITECOMPLETIONCTRL_SPEC, u8, u8, 8, 24>;
66impl R {
67 #[doc = "Bits 0:7 - Opcode"]
68 #[inline(always)]
69 pub fn opcode(&self) -> OPCODE_R {
70 OPCODE_R::new((self.bits & 0xff) as u8)
71 }
72 #[doc = "Bits 8:10 - Polling Bit Index"]
73 #[inline(always)]
74 pub fn pollingbitindex(&self) -> POLLINGBITINDEX_R {
75 POLLINGBITINDEX_R::new(((self.bits >> 8) & 7) as u8)
76 }
77 #[doc = "Bit 13 - Polling Polarity"]
78 #[inline(always)]
79 pub fn pollingpolarity(&self) -> POLLINGPOLARITY_R {
80 POLLINGPOLARITY_R::new(((self.bits >> 13) & 1) != 0)
81 }
82 #[doc = "Bit 14 - Disable Polling"]
83 #[inline(always)]
84 pub fn disablepolling(&self) -> DISABLEPOLLING_R {
85 DISABLEPOLLING_R::new(((self.bits >> 14) & 1) != 0)
86 }
87 #[doc = "Bit 15 - Enable Polling Expiration"]
88 #[inline(always)]
89 pub fn enablepollingexp(&self) -> ENABLEPOLLINGEXP_R {
90 ENABLEPOLLINGEXP_R::new(((self.bits >> 15) & 1) != 0)
91 }
92 #[doc = "Bits 16:23 - Poll Count"]
93 #[inline(always)]
94 pub fn pollcount(&self) -> POLLCOUNT_R {
95 POLLCOUNT_R::new(((self.bits >> 16) & 0xff) as u8)
96 }
97 #[doc = "Bits 24:31 - Poll Repetition Delay"]
98 #[inline(always)]
99 pub fn pollrepdelay(&self) -> POLLREPDELAY_R {
100 POLLREPDELAY_R::new(((self.bits >> 24) & 0xff) as u8)
101 }
102}
103impl W {
104 #[doc = "Bits 0:7 - Opcode"]
105 #[inline(always)]
106 pub fn opcode(&mut self) -> OPCODE_W {
107 OPCODE_W::new(self)
108 }
109 #[doc = "Bits 8:10 - Polling Bit Index"]
110 #[inline(always)]
111 pub fn pollingbitindex(&mut self) -> POLLINGBITINDEX_W {
112 POLLINGBITINDEX_W::new(self)
113 }
114 #[doc = "Bit 13 - Polling Polarity"]
115 #[inline(always)]
116 pub fn pollingpolarity(&mut self) -> POLLINGPOLARITY_W {
117 POLLINGPOLARITY_W::new(self)
118 }
119 #[doc = "Bit 14 - Disable Polling"]
120 #[inline(always)]
121 pub fn disablepolling(&mut self) -> DISABLEPOLLING_W {
122 DISABLEPOLLING_W::new(self)
123 }
124 #[doc = "Bit 15 - Enable Polling Expiration"]
125 #[inline(always)]
126 pub fn enablepollingexp(&mut self) -> ENABLEPOLLINGEXP_W {
127 ENABLEPOLLINGEXP_W::new(self)
128 }
129 #[doc = "Bits 16:23 - Poll Count"]
130 #[inline(always)]
131 pub fn pollcount(&mut self) -> POLLCOUNT_W {
132 POLLCOUNT_W::new(self)
133 }
134 #[doc = "Bits 24:31 - Poll Repetition Delay"]
135 #[inline(always)]
136 pub fn pollrepdelay(&mut self) -> POLLREPDELAY_W {
137 POLLREPDELAY_W::new(self)
138 }
139 #[doc = "Writes raw bits to the register."]
140 #[inline(always)]
141 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
142 self.0.bits(bits);
143 self
144 }
145}
146#[doc = "Write Completion Control Register\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 [writecompletionctrl](index.html) module"]
147pub struct WRITECOMPLETIONCTRL_SPEC;
148impl crate::RegisterSpec for WRITECOMPLETIONCTRL_SPEC {
149 type Ux = u32;
150}
151#[doc = "`read()` method returns [writecompletionctrl::R](R) reader structure"]
152impl crate::Readable for WRITECOMPLETIONCTRL_SPEC {
153 type Reader = R;
154}
155#[doc = "`write(|w| ..)` method takes [writecompletionctrl::W](W) writer structure"]
156impl crate::Writable for WRITECOMPLETIONCTRL_SPEC {
157 type Writer = W;
158}
159#[doc = "`reset()` method sets WRITECOMPLETIONCTRL to value 0x0001_0005"]
160impl crate::Resettable for WRITECOMPLETIONCTRL_SPEC {
161 #[inline(always)]
162 fn reset_value() -> Self::Ux {
163 0x0001_0005
164 }
165}