bl702_pac/uart/
urx_config.rs1#[doc = "Register `urx_config` reader"]
2pub struct R(crate::R<URX_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<URX_CONFIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<URX_CONFIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<URX_CONFIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `urx_config` writer"]
17pub struct W(crate::W<URX_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<URX_CONFIG_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<URX_CONFIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<URX_CONFIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `cr_urx_en` reader - "]
38pub type CR_URX_EN_R = crate::BitReader<bool>;
39#[doc = "Field `cr_urx_en` writer - "]
40pub type CR_URX_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
41#[doc = "Field `cr_urx_abr_en` reader - "]
42pub type CR_URX_ABR_EN_R = crate::BitReader<bool>;
43#[doc = "Field `cr_urx_abr_en` writer - "]
44pub type CR_URX_ABR_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
45#[doc = "Field `cr_urx_lin_en` reader - "]
46pub type CR_URX_LIN_EN_R = crate::BitReader<bool>;
47#[doc = "Field `cr_urx_lin_en` writer - "]
48pub type CR_URX_LIN_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
49#[doc = "Field `cr_urx_prt_en` reader - "]
50pub type CR_URX_PRT_EN_R = crate::BitReader<bool>;
51#[doc = "Field `cr_urx_prt_en` writer - "]
52pub type CR_URX_PRT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
53#[doc = "Field `cr_urx_prt_sel` reader - "]
54pub type CR_URX_PRT_SEL_R = crate::BitReader<bool>;
55#[doc = "Field `cr_urx_prt_sel` writer - "]
56pub type CR_URX_PRT_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
57#[doc = "Field `cr_urx_ir_en` reader - "]
58pub type CR_URX_IR_EN_R = crate::BitReader<bool>;
59#[doc = "Field `cr_urx_ir_en` writer - "]
60pub type CR_URX_IR_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
61#[doc = "Field `cr_urx_ir_inv` reader - "]
62pub type CR_URX_IR_INV_R = crate::BitReader<bool>;
63#[doc = "Field `cr_urx_ir_inv` writer - "]
64pub type CR_URX_IR_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
65#[doc = "Field `cr_urx_bit_cnt_d` reader - "]
66pub type CR_URX_BIT_CNT_D_R = crate::FieldReader<u8, u8>;
67#[doc = "Field `cr_urx_bit_cnt_d` writer - "]
68pub type CR_URX_BIT_CNT_D_W<'a, const O: u8> =
69 crate::FieldWriter<'a, u32, URX_CONFIG_SPEC, u8, u8, 3, O>;
70#[doc = "Field `cr_urx_deg_en` reader - "]
71pub type CR_URX_DEG_EN_R = crate::BitReader<bool>;
72#[doc = "Field `cr_urx_deg_en` writer - "]
73pub type CR_URX_DEG_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, URX_CONFIG_SPEC, bool, O>;
74#[doc = "Field `cr_urx_deg_cnt` reader - "]
75pub type CR_URX_DEG_CNT_R = crate::FieldReader<u8, u8>;
76#[doc = "Field `cr_urx_deg_cnt` writer - "]
77pub type CR_URX_DEG_CNT_W<'a, const O: u8> =
78 crate::FieldWriter<'a, u32, URX_CONFIG_SPEC, u8, u8, 4, O>;
79#[doc = "Field `cr_urx_len` reader - "]
80pub type CR_URX_LEN_R = crate::FieldReader<u16, u16>;
81#[doc = "Field `cr_urx_len` writer - "]
82pub type CR_URX_LEN_W<'a, const O: u8> =
83 crate::FieldWriter<'a, u32, URX_CONFIG_SPEC, u16, u16, 16, O>;
84impl R {
85 #[doc = "Bit 0"]
86 #[inline(always)]
87 pub fn cr_urx_en(&self) -> CR_URX_EN_R {
88 CR_URX_EN_R::new((self.bits & 1) != 0)
89 }
90 #[doc = "Bit 1"]
91 #[inline(always)]
92 pub fn cr_urx_abr_en(&self) -> CR_URX_ABR_EN_R {
93 CR_URX_ABR_EN_R::new(((self.bits >> 1) & 1) != 0)
94 }
95 #[doc = "Bit 3"]
96 #[inline(always)]
97 pub fn cr_urx_lin_en(&self) -> CR_URX_LIN_EN_R {
98 CR_URX_LIN_EN_R::new(((self.bits >> 3) & 1) != 0)
99 }
100 #[doc = "Bit 4"]
101 #[inline(always)]
102 pub fn cr_urx_prt_en(&self) -> CR_URX_PRT_EN_R {
103 CR_URX_PRT_EN_R::new(((self.bits >> 4) & 1) != 0)
104 }
105 #[doc = "Bit 5"]
106 #[inline(always)]
107 pub fn cr_urx_prt_sel(&self) -> CR_URX_PRT_SEL_R {
108 CR_URX_PRT_SEL_R::new(((self.bits >> 5) & 1) != 0)
109 }
110 #[doc = "Bit 6"]
111 #[inline(always)]
112 pub fn cr_urx_ir_en(&self) -> CR_URX_IR_EN_R {
113 CR_URX_IR_EN_R::new(((self.bits >> 6) & 1) != 0)
114 }
115 #[doc = "Bit 7"]
116 #[inline(always)]
117 pub fn cr_urx_ir_inv(&self) -> CR_URX_IR_INV_R {
118 CR_URX_IR_INV_R::new(((self.bits >> 7) & 1) != 0)
119 }
120 #[doc = "Bits 8:10"]
121 #[inline(always)]
122 pub fn cr_urx_bit_cnt_d(&self) -> CR_URX_BIT_CNT_D_R {
123 CR_URX_BIT_CNT_D_R::new(((self.bits >> 8) & 7) as u8)
124 }
125 #[doc = "Bit 11"]
126 #[inline(always)]
127 pub fn cr_urx_deg_en(&self) -> CR_URX_DEG_EN_R {
128 CR_URX_DEG_EN_R::new(((self.bits >> 11) & 1) != 0)
129 }
130 #[doc = "Bits 12:15"]
131 #[inline(always)]
132 pub fn cr_urx_deg_cnt(&self) -> CR_URX_DEG_CNT_R {
133 CR_URX_DEG_CNT_R::new(((self.bits >> 12) & 0x0f) as u8)
134 }
135 #[doc = "Bits 16:31"]
136 #[inline(always)]
137 pub fn cr_urx_len(&self) -> CR_URX_LEN_R {
138 CR_URX_LEN_R::new(((self.bits >> 16) & 0xffff) as u16)
139 }
140}
141impl W {
142 #[doc = "Bit 0"]
143 #[inline(always)]
144 #[must_use]
145 pub fn cr_urx_en(&mut self) -> CR_URX_EN_W<0> {
146 CR_URX_EN_W::new(self)
147 }
148 #[doc = "Bit 1"]
149 #[inline(always)]
150 #[must_use]
151 pub fn cr_urx_abr_en(&mut self) -> CR_URX_ABR_EN_W<1> {
152 CR_URX_ABR_EN_W::new(self)
153 }
154 #[doc = "Bit 3"]
155 #[inline(always)]
156 #[must_use]
157 pub fn cr_urx_lin_en(&mut self) -> CR_URX_LIN_EN_W<3> {
158 CR_URX_LIN_EN_W::new(self)
159 }
160 #[doc = "Bit 4"]
161 #[inline(always)]
162 #[must_use]
163 pub fn cr_urx_prt_en(&mut self) -> CR_URX_PRT_EN_W<4> {
164 CR_URX_PRT_EN_W::new(self)
165 }
166 #[doc = "Bit 5"]
167 #[inline(always)]
168 #[must_use]
169 pub fn cr_urx_prt_sel(&mut self) -> CR_URX_PRT_SEL_W<5> {
170 CR_URX_PRT_SEL_W::new(self)
171 }
172 #[doc = "Bit 6"]
173 #[inline(always)]
174 #[must_use]
175 pub fn cr_urx_ir_en(&mut self) -> CR_URX_IR_EN_W<6> {
176 CR_URX_IR_EN_W::new(self)
177 }
178 #[doc = "Bit 7"]
179 #[inline(always)]
180 #[must_use]
181 pub fn cr_urx_ir_inv(&mut self) -> CR_URX_IR_INV_W<7> {
182 CR_URX_IR_INV_W::new(self)
183 }
184 #[doc = "Bits 8:10"]
185 #[inline(always)]
186 #[must_use]
187 pub fn cr_urx_bit_cnt_d(&mut self) -> CR_URX_BIT_CNT_D_W<8> {
188 CR_URX_BIT_CNT_D_W::new(self)
189 }
190 #[doc = "Bit 11"]
191 #[inline(always)]
192 #[must_use]
193 pub fn cr_urx_deg_en(&mut self) -> CR_URX_DEG_EN_W<11> {
194 CR_URX_DEG_EN_W::new(self)
195 }
196 #[doc = "Bits 12:15"]
197 #[inline(always)]
198 #[must_use]
199 pub fn cr_urx_deg_cnt(&mut self) -> CR_URX_DEG_CNT_W<12> {
200 CR_URX_DEG_CNT_W::new(self)
201 }
202 #[doc = "Bits 16:31"]
203 #[inline(always)]
204 #[must_use]
205 pub fn cr_urx_len(&mut self) -> CR_URX_LEN_W<16> {
206 CR_URX_LEN_W::new(self)
207 }
208 #[doc = "Writes raw bits to the register."]
209 #[inline(always)]
210 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
211 self.0.bits(bits);
212 self
213 }
214}
215#[doc = "urx_config.\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 [urx_config](index.html) module"]
216pub struct URX_CONFIG_SPEC;
217impl crate::RegisterSpec for URX_CONFIG_SPEC {
218 type Ux = u32;
219}
220#[doc = "`read()` method returns [urx_config::R](R) reader structure"]
221impl crate::Readable for URX_CONFIG_SPEC {
222 type Reader = R;
223}
224#[doc = "`write(|w| ..)` method takes [urx_config::W](W) writer structure"]
225impl crate::Writable for URX_CONFIG_SPEC {
226 type Writer = W;
227 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
228 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
229}
230#[doc = "`reset()` method sets urx_config to value 0"]
231impl crate::Resettable for URX_CONFIG_SPEC {
232 const RESET_VALUE: Self::Ux = 0;
233}