bl602_pac/uart/
utx_config.rs1#[doc = "Register `utx_config` reader"]
2pub struct R(crate::R<UTX_CONFIG_SPEC>);
3impl core::ops::Deref for R {
4 type Target = crate::R<UTX_CONFIG_SPEC>;
5 #[inline(always)]
6 fn deref(&self) -> &Self::Target {
7 &self.0
8 }
9}
10impl From<crate::R<UTX_CONFIG_SPEC>> for R {
11 #[inline(always)]
12 fn from(reader: crate::R<UTX_CONFIG_SPEC>) -> Self {
13 R(reader)
14 }
15}
16#[doc = "Register `utx_config` writer"]
17pub struct W(crate::W<UTX_CONFIG_SPEC>);
18impl core::ops::Deref for W {
19 type Target = crate::W<UTX_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<UTX_CONFIG_SPEC>> for W {
32 #[inline(always)]
33 fn from(writer: crate::W<UTX_CONFIG_SPEC>) -> Self {
34 W(writer)
35 }
36}
37#[doc = "Field `cr_utx_en` reader - "]
38pub type CR_UTX_EN_R = crate::BitReader<bool>;
39#[doc = "Field `cr_utx_en` writer - "]
40pub type CR_UTX_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
41#[doc = "Field `cr_utx_cts_en` reader - "]
42pub type CR_UTX_CTS_EN_R = crate::BitReader<bool>;
43#[doc = "Field `cr_utx_cts_en` writer - "]
44pub type CR_UTX_CTS_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
45#[doc = "Field `cr_utx_frm_en` reader - "]
46pub type CR_UTX_FRM_EN_R = crate::BitReader<bool>;
47#[doc = "Field `cr_utx_frm_en` writer - "]
48pub type CR_UTX_FRM_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
49#[doc = "Field `cr_utx_prt_en` reader - "]
50pub type CR_UTX_PRT_EN_R = crate::BitReader<bool>;
51#[doc = "Field `cr_utx_prt_en` writer - "]
52pub type CR_UTX_PRT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
53#[doc = "Field `cr_utx_prt_sel` reader - "]
54pub type CR_UTX_PRT_SEL_R = crate::BitReader<bool>;
55#[doc = "Field `cr_utx_prt_sel` writer - "]
56pub type CR_UTX_PRT_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
57#[doc = "Field `cr_utx_ir_en` reader - "]
58pub type CR_UTX_IR_EN_R = crate::BitReader<bool>;
59#[doc = "Field `cr_utx_ir_en` writer - "]
60pub type CR_UTX_IR_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
61#[doc = "Field `cr_utx_ir_inv` reader - "]
62pub type CR_UTX_IR_INV_R = crate::BitReader<bool>;
63#[doc = "Field `cr_utx_ir_inv` writer - "]
64pub type CR_UTX_IR_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
65#[doc = "Field `cr_utx_bit_cnt_d` reader - "]
66pub type CR_UTX_BIT_CNT_D_R = crate::FieldReader<u8, u8>;
67#[doc = "Field `cr_utx_bit_cnt_d` writer - "]
68pub type CR_UTX_BIT_CNT_D_W<'a, const O: u8> =
69 crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u8, u8, 3, O>;
70#[doc = "Field `cr_utx_bit_cnt_p` reader - "]
71pub type CR_UTX_BIT_CNT_P_R = crate::FieldReader<u8, u8>;
72#[doc = "Field `cr_utx_bit_cnt_p` writer - "]
73pub type CR_UTX_BIT_CNT_P_W<'a, const O: u8> =
74 crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u8, u8, 2, O>;
75#[doc = "Field `cr_utx_len` reader - "]
76pub type CR_UTX_LEN_R = crate::FieldReader<u16, u16>;
77#[doc = "Field `cr_utx_len` writer - "]
78pub type CR_UTX_LEN_W<'a, const O: u8> =
79 crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u16, u16, 16, O>;
80impl R {
81 #[doc = "Bit 0"]
82 #[inline(always)]
83 pub fn cr_utx_en(&self) -> CR_UTX_EN_R {
84 CR_UTX_EN_R::new((self.bits & 1) != 0)
85 }
86 #[doc = "Bit 1"]
87 #[inline(always)]
88 pub fn cr_utx_cts_en(&self) -> CR_UTX_CTS_EN_R {
89 CR_UTX_CTS_EN_R::new(((self.bits >> 1) & 1) != 0)
90 }
91 #[doc = "Bit 2"]
92 #[inline(always)]
93 pub fn cr_utx_frm_en(&self) -> CR_UTX_FRM_EN_R {
94 CR_UTX_FRM_EN_R::new(((self.bits >> 2) & 1) != 0)
95 }
96 #[doc = "Bit 4"]
97 #[inline(always)]
98 pub fn cr_utx_prt_en(&self) -> CR_UTX_PRT_EN_R {
99 CR_UTX_PRT_EN_R::new(((self.bits >> 4) & 1) != 0)
100 }
101 #[doc = "Bit 5"]
102 #[inline(always)]
103 pub fn cr_utx_prt_sel(&self) -> CR_UTX_PRT_SEL_R {
104 CR_UTX_PRT_SEL_R::new(((self.bits >> 5) & 1) != 0)
105 }
106 #[doc = "Bit 6"]
107 #[inline(always)]
108 pub fn cr_utx_ir_en(&self) -> CR_UTX_IR_EN_R {
109 CR_UTX_IR_EN_R::new(((self.bits >> 6) & 1) != 0)
110 }
111 #[doc = "Bit 7"]
112 #[inline(always)]
113 pub fn cr_utx_ir_inv(&self) -> CR_UTX_IR_INV_R {
114 CR_UTX_IR_INV_R::new(((self.bits >> 7) & 1) != 0)
115 }
116 #[doc = "Bits 8:10"]
117 #[inline(always)]
118 pub fn cr_utx_bit_cnt_d(&self) -> CR_UTX_BIT_CNT_D_R {
119 CR_UTX_BIT_CNT_D_R::new(((self.bits >> 8) & 7) as u8)
120 }
121 #[doc = "Bits 12:13"]
122 #[inline(always)]
123 pub fn cr_utx_bit_cnt_p(&self) -> CR_UTX_BIT_CNT_P_R {
124 CR_UTX_BIT_CNT_P_R::new(((self.bits >> 12) & 3) as u8)
125 }
126 #[doc = "Bits 16:31"]
127 #[inline(always)]
128 pub fn cr_utx_len(&self) -> CR_UTX_LEN_R {
129 CR_UTX_LEN_R::new(((self.bits >> 16) & 0xffff) as u16)
130 }
131}
132impl W {
133 #[doc = "Bit 0"]
134 #[inline(always)]
135 #[must_use]
136 pub fn cr_utx_en(&mut self) -> CR_UTX_EN_W<0> {
137 CR_UTX_EN_W::new(self)
138 }
139 #[doc = "Bit 1"]
140 #[inline(always)]
141 #[must_use]
142 pub fn cr_utx_cts_en(&mut self) -> CR_UTX_CTS_EN_W<1> {
143 CR_UTX_CTS_EN_W::new(self)
144 }
145 #[doc = "Bit 2"]
146 #[inline(always)]
147 #[must_use]
148 pub fn cr_utx_frm_en(&mut self) -> CR_UTX_FRM_EN_W<2> {
149 CR_UTX_FRM_EN_W::new(self)
150 }
151 #[doc = "Bit 4"]
152 #[inline(always)]
153 #[must_use]
154 pub fn cr_utx_prt_en(&mut self) -> CR_UTX_PRT_EN_W<4> {
155 CR_UTX_PRT_EN_W::new(self)
156 }
157 #[doc = "Bit 5"]
158 #[inline(always)]
159 #[must_use]
160 pub fn cr_utx_prt_sel(&mut self) -> CR_UTX_PRT_SEL_W<5> {
161 CR_UTX_PRT_SEL_W::new(self)
162 }
163 #[doc = "Bit 6"]
164 #[inline(always)]
165 #[must_use]
166 pub fn cr_utx_ir_en(&mut self) -> CR_UTX_IR_EN_W<6> {
167 CR_UTX_IR_EN_W::new(self)
168 }
169 #[doc = "Bit 7"]
170 #[inline(always)]
171 #[must_use]
172 pub fn cr_utx_ir_inv(&mut self) -> CR_UTX_IR_INV_W<7> {
173 CR_UTX_IR_INV_W::new(self)
174 }
175 #[doc = "Bits 8:10"]
176 #[inline(always)]
177 #[must_use]
178 pub fn cr_utx_bit_cnt_d(&mut self) -> CR_UTX_BIT_CNT_D_W<8> {
179 CR_UTX_BIT_CNT_D_W::new(self)
180 }
181 #[doc = "Bits 12:13"]
182 #[inline(always)]
183 #[must_use]
184 pub fn cr_utx_bit_cnt_p(&mut self) -> CR_UTX_BIT_CNT_P_W<12> {
185 CR_UTX_BIT_CNT_P_W::new(self)
186 }
187 #[doc = "Bits 16:31"]
188 #[inline(always)]
189 #[must_use]
190 pub fn cr_utx_len(&mut self) -> CR_UTX_LEN_W<16> {
191 CR_UTX_LEN_W::new(self)
192 }
193 #[doc = "Writes raw bits to the register."]
194 #[inline(always)]
195 pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
196 self.0.bits(bits);
197 self
198 }
199}
200#[doc = "utx_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 [utx_config](index.html) module"]
201pub struct UTX_CONFIG_SPEC;
202impl crate::RegisterSpec for UTX_CONFIG_SPEC {
203 type Ux = u32;
204}
205#[doc = "`read()` method returns [utx_config::R](R) reader structure"]
206impl crate::Readable for UTX_CONFIG_SPEC {
207 type Reader = R;
208}
209#[doc = "`write(|w| ..)` method takes [utx_config::W](W) writer structure"]
210impl crate::Writable for UTX_CONFIG_SPEC {
211 type Writer = W;
212 const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
213 const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
214}
215#[doc = "`reset()` method sets utx_config to value 0x1700"]
216impl crate::Resettable for UTX_CONFIG_SPEC {
217 const RESET_VALUE: Self::Ux = 0x1700;
218}