bl702_pac/uart/
utx_config.rs

1#[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_lin_en` reader - "]
50pub type CR_UTX_LIN_EN_R = crate::BitReader<bool>;
51#[doc = "Field `cr_utx_lin_en` writer - "]
52pub type CR_UTX_LIN_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
53#[doc = "Field `cr_utx_prt_en` reader - "]
54pub type CR_UTX_PRT_EN_R = crate::BitReader<bool>;
55#[doc = "Field `cr_utx_prt_en` writer - "]
56pub type CR_UTX_PRT_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
57#[doc = "Field `cr_utx_prt_sel` reader - "]
58pub type CR_UTX_PRT_SEL_R = crate::BitReader<bool>;
59#[doc = "Field `cr_utx_prt_sel` writer - "]
60pub type CR_UTX_PRT_SEL_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
61#[doc = "Field `cr_utx_ir_en` reader - "]
62pub type CR_UTX_IR_EN_R = crate::BitReader<bool>;
63#[doc = "Field `cr_utx_ir_en` writer - "]
64pub type CR_UTX_IR_EN_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
65#[doc = "Field `cr_utx_ir_inv` reader - "]
66pub type CR_UTX_IR_INV_R = crate::BitReader<bool>;
67#[doc = "Field `cr_utx_ir_inv` writer - "]
68pub type CR_UTX_IR_INV_W<'a, const O: u8> = crate::BitWriter<'a, u32, UTX_CONFIG_SPEC, bool, O>;
69#[doc = "Field `cr_utx_bit_cnt_d` reader - "]
70pub type CR_UTX_BIT_CNT_D_R = crate::FieldReader<u8, u8>;
71#[doc = "Field `cr_utx_bit_cnt_d` writer - "]
72pub type CR_UTX_BIT_CNT_D_W<'a, const O: u8> =
73    crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u8, u8, 3, O>;
74#[doc = "Field `cr_utx_bit_cnt_p` reader - "]
75pub type CR_UTX_BIT_CNT_P_R = crate::FieldReader<u8, u8>;
76#[doc = "Field `cr_utx_bit_cnt_p` writer - "]
77pub type CR_UTX_BIT_CNT_P_W<'a, const O: u8> =
78    crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u8, u8, 2, O>;
79#[doc = "Field `cr_utx_bit_cnt_b` reader - "]
80pub type CR_UTX_BIT_CNT_B_R = crate::FieldReader<u8, u8>;
81#[doc = "Field `cr_utx_bit_cnt_b` writer - "]
82pub type CR_UTX_BIT_CNT_B_W<'a, const O: u8> =
83    crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u8, u8, 3, O>;
84#[doc = "Field `cr_utx_len` reader - "]
85pub type CR_UTX_LEN_R = crate::FieldReader<u16, u16>;
86#[doc = "Field `cr_utx_len` writer - "]
87pub type CR_UTX_LEN_W<'a, const O: u8> =
88    crate::FieldWriter<'a, u32, UTX_CONFIG_SPEC, u16, u16, 16, O>;
89impl R {
90    #[doc = "Bit 0"]
91    #[inline(always)]
92    pub fn cr_utx_en(&self) -> CR_UTX_EN_R {
93        CR_UTX_EN_R::new((self.bits & 1) != 0)
94    }
95    #[doc = "Bit 1"]
96    #[inline(always)]
97    pub fn cr_utx_cts_en(&self) -> CR_UTX_CTS_EN_R {
98        CR_UTX_CTS_EN_R::new(((self.bits >> 1) & 1) != 0)
99    }
100    #[doc = "Bit 2"]
101    #[inline(always)]
102    pub fn cr_utx_frm_en(&self) -> CR_UTX_FRM_EN_R {
103        CR_UTX_FRM_EN_R::new(((self.bits >> 2) & 1) != 0)
104    }
105    #[doc = "Bit 3"]
106    #[inline(always)]
107    pub fn cr_utx_lin_en(&self) -> CR_UTX_LIN_EN_R {
108        CR_UTX_LIN_EN_R::new(((self.bits >> 3) & 1) != 0)
109    }
110    #[doc = "Bit 4"]
111    #[inline(always)]
112    pub fn cr_utx_prt_en(&self) -> CR_UTX_PRT_EN_R {
113        CR_UTX_PRT_EN_R::new(((self.bits >> 4) & 1) != 0)
114    }
115    #[doc = "Bit 5"]
116    #[inline(always)]
117    pub fn cr_utx_prt_sel(&self) -> CR_UTX_PRT_SEL_R {
118        CR_UTX_PRT_SEL_R::new(((self.bits >> 5) & 1) != 0)
119    }
120    #[doc = "Bit 6"]
121    #[inline(always)]
122    pub fn cr_utx_ir_en(&self) -> CR_UTX_IR_EN_R {
123        CR_UTX_IR_EN_R::new(((self.bits >> 6) & 1) != 0)
124    }
125    #[doc = "Bit 7"]
126    #[inline(always)]
127    pub fn cr_utx_ir_inv(&self) -> CR_UTX_IR_INV_R {
128        CR_UTX_IR_INV_R::new(((self.bits >> 7) & 1) != 0)
129    }
130    #[doc = "Bits 8:10"]
131    #[inline(always)]
132    pub fn cr_utx_bit_cnt_d(&self) -> CR_UTX_BIT_CNT_D_R {
133        CR_UTX_BIT_CNT_D_R::new(((self.bits >> 8) & 7) as u8)
134    }
135    #[doc = "Bits 11:12"]
136    #[inline(always)]
137    pub fn cr_utx_bit_cnt_p(&self) -> CR_UTX_BIT_CNT_P_R {
138        CR_UTX_BIT_CNT_P_R::new(((self.bits >> 11) & 3) as u8)
139    }
140    #[doc = "Bits 13:15"]
141    #[inline(always)]
142    pub fn cr_utx_bit_cnt_b(&self) -> CR_UTX_BIT_CNT_B_R {
143        CR_UTX_BIT_CNT_B_R::new(((self.bits >> 13) & 7) as u8)
144    }
145    #[doc = "Bits 16:31"]
146    #[inline(always)]
147    pub fn cr_utx_len(&self) -> CR_UTX_LEN_R {
148        CR_UTX_LEN_R::new(((self.bits >> 16) & 0xffff) as u16)
149    }
150}
151impl W {
152    #[doc = "Bit 0"]
153    #[inline(always)]
154    #[must_use]
155    pub fn cr_utx_en(&mut self) -> CR_UTX_EN_W<0> {
156        CR_UTX_EN_W::new(self)
157    }
158    #[doc = "Bit 1"]
159    #[inline(always)]
160    #[must_use]
161    pub fn cr_utx_cts_en(&mut self) -> CR_UTX_CTS_EN_W<1> {
162        CR_UTX_CTS_EN_W::new(self)
163    }
164    #[doc = "Bit 2"]
165    #[inline(always)]
166    #[must_use]
167    pub fn cr_utx_frm_en(&mut self) -> CR_UTX_FRM_EN_W<2> {
168        CR_UTX_FRM_EN_W::new(self)
169    }
170    #[doc = "Bit 3"]
171    #[inline(always)]
172    #[must_use]
173    pub fn cr_utx_lin_en(&mut self) -> CR_UTX_LIN_EN_W<3> {
174        CR_UTX_LIN_EN_W::new(self)
175    }
176    #[doc = "Bit 4"]
177    #[inline(always)]
178    #[must_use]
179    pub fn cr_utx_prt_en(&mut self) -> CR_UTX_PRT_EN_W<4> {
180        CR_UTX_PRT_EN_W::new(self)
181    }
182    #[doc = "Bit 5"]
183    #[inline(always)]
184    #[must_use]
185    pub fn cr_utx_prt_sel(&mut self) -> CR_UTX_PRT_SEL_W<5> {
186        CR_UTX_PRT_SEL_W::new(self)
187    }
188    #[doc = "Bit 6"]
189    #[inline(always)]
190    #[must_use]
191    pub fn cr_utx_ir_en(&mut self) -> CR_UTX_IR_EN_W<6> {
192        CR_UTX_IR_EN_W::new(self)
193    }
194    #[doc = "Bit 7"]
195    #[inline(always)]
196    #[must_use]
197    pub fn cr_utx_ir_inv(&mut self) -> CR_UTX_IR_INV_W<7> {
198        CR_UTX_IR_INV_W::new(self)
199    }
200    #[doc = "Bits 8:10"]
201    #[inline(always)]
202    #[must_use]
203    pub fn cr_utx_bit_cnt_d(&mut self) -> CR_UTX_BIT_CNT_D_W<8> {
204        CR_UTX_BIT_CNT_D_W::new(self)
205    }
206    #[doc = "Bits 11:12"]
207    #[inline(always)]
208    #[must_use]
209    pub fn cr_utx_bit_cnt_p(&mut self) -> CR_UTX_BIT_CNT_P_W<11> {
210        CR_UTX_BIT_CNT_P_W::new(self)
211    }
212    #[doc = "Bits 13:15"]
213    #[inline(always)]
214    #[must_use]
215    pub fn cr_utx_bit_cnt_b(&mut self) -> CR_UTX_BIT_CNT_B_W<13> {
216        CR_UTX_BIT_CNT_B_W::new(self)
217    }
218    #[doc = "Bits 16:31"]
219    #[inline(always)]
220    #[must_use]
221    pub fn cr_utx_len(&mut self) -> CR_UTX_LEN_W<16> {
222        CR_UTX_LEN_W::new(self)
223    }
224    #[doc = "Writes raw bits to the register."]
225    #[inline(always)]
226    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
227        self.0.bits(bits);
228        self
229    }
230}
231#[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"]
232pub struct UTX_CONFIG_SPEC;
233impl crate::RegisterSpec for UTX_CONFIG_SPEC {
234    type Ux = u32;
235}
236#[doc = "`read()` method returns [utx_config::R](R) reader structure"]
237impl crate::Readable for UTX_CONFIG_SPEC {
238    type Reader = R;
239}
240#[doc = "`write(|w| ..)` method takes [utx_config::W](W) writer structure"]
241impl crate::Writable for UTX_CONFIG_SPEC {
242    type Writer = W;
243    const ZERO_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
244    const ONE_TO_MODIFY_FIELDS_BITMAP: Self::Ux = 0;
245}
246#[doc = "`reset()` method sets utx_config to value 0"]
247impl crate::Resettable for UTX_CONFIG_SPEC {
248    const RESET_VALUE: Self::Ux = 0;
249}