esp8266/uart1/
uart_conf0.rs

1#[doc = "Register `UART_CONF0` reader"]
2pub struct R(crate::R<UART_CONF0_SPEC>);
3impl core::ops::Deref for R {
4    type Target = crate::R<UART_CONF0_SPEC>;
5    #[inline(always)]
6    fn deref(&self) -> &Self::Target {
7        &self.0
8    }
9}
10impl From<crate::R<UART_CONF0_SPEC>> for R {
11    #[inline(always)]
12    fn from(reader: crate::R<UART_CONF0_SPEC>) -> Self {
13        R(reader)
14    }
15}
16#[doc = "Register `UART_CONF0` writer"]
17pub struct W(crate::W<UART_CONF0_SPEC>);
18impl core::ops::Deref for W {
19    type Target = crate::W<UART_CONF0_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<UART_CONF0_SPEC>> for W {
32    #[inline(always)]
33    fn from(writer: crate::W<UART_CONF0_SPEC>) -> Self {
34        W(writer)
35    }
36}
37#[doc = "Field `uart_dtr_inv` reader - Set this bit to inverse uart dtr level"]
38pub struct UART_DTR_INV_R(crate::FieldReader<bool, bool>);
39impl UART_DTR_INV_R {
40    #[inline(always)]
41    pub(crate) fn new(bits: bool) -> Self {
42        UART_DTR_INV_R(crate::FieldReader::new(bits))
43    }
44}
45impl core::ops::Deref for UART_DTR_INV_R {
46    type Target = crate::FieldReader<bool, bool>;
47    #[inline(always)]
48    fn deref(&self) -> &Self::Target {
49        &self.0
50    }
51}
52#[doc = "Field `uart_dtr_inv` writer - Set this bit to inverse uart dtr level"]
53pub struct UART_DTR_INV_W<'a> {
54    w: &'a mut W,
55}
56impl<'a> UART_DTR_INV_W<'a> {
57    #[doc = r"Sets the field bit"]
58    #[inline(always)]
59    pub fn set_bit(self) -> &'a mut W {
60        self.bit(true)
61    }
62    #[doc = r"Clears the field bit"]
63    #[inline(always)]
64    pub fn clear_bit(self) -> &'a mut W {
65        self.bit(false)
66    }
67    #[doc = r"Writes raw bits to the field"]
68    #[inline(always)]
69    pub fn bit(self, value: bool) -> &'a mut W {
70        self.w.bits = (self.w.bits & !(1 << 24)) | ((value as u32 & 1) << 24);
71        self.w
72    }
73}
74#[doc = "Field `uart_rts_inv` reader - Set this bit to inverse uart rts level"]
75pub struct UART_RTS_INV_R(crate::FieldReader<bool, bool>);
76impl UART_RTS_INV_R {
77    #[inline(always)]
78    pub(crate) fn new(bits: bool) -> Self {
79        UART_RTS_INV_R(crate::FieldReader::new(bits))
80    }
81}
82impl core::ops::Deref for UART_RTS_INV_R {
83    type Target = crate::FieldReader<bool, bool>;
84    #[inline(always)]
85    fn deref(&self) -> &Self::Target {
86        &self.0
87    }
88}
89#[doc = "Field `uart_rts_inv` writer - Set this bit to inverse uart rts level"]
90pub struct UART_RTS_INV_W<'a> {
91    w: &'a mut W,
92}
93impl<'a> UART_RTS_INV_W<'a> {
94    #[doc = r"Sets the field bit"]
95    #[inline(always)]
96    pub fn set_bit(self) -> &'a mut W {
97        self.bit(true)
98    }
99    #[doc = r"Clears the field bit"]
100    #[inline(always)]
101    pub fn clear_bit(self) -> &'a mut W {
102        self.bit(false)
103    }
104    #[doc = r"Writes raw bits to the field"]
105    #[inline(always)]
106    pub fn bit(self, value: bool) -> &'a mut W {
107        self.w.bits = (self.w.bits & !(1 << 23)) | ((value as u32 & 1) << 23);
108        self.w
109    }
110}
111#[doc = "Field `uart_txd_inv` reader - Set this bit to inverse uart txd level"]
112pub struct UART_TXD_INV_R(crate::FieldReader<bool, bool>);
113impl UART_TXD_INV_R {
114    #[inline(always)]
115    pub(crate) fn new(bits: bool) -> Self {
116        UART_TXD_INV_R(crate::FieldReader::new(bits))
117    }
118}
119impl core::ops::Deref for UART_TXD_INV_R {
120    type Target = crate::FieldReader<bool, bool>;
121    #[inline(always)]
122    fn deref(&self) -> &Self::Target {
123        &self.0
124    }
125}
126#[doc = "Field `uart_txd_inv` writer - Set this bit to inverse uart txd level"]
127pub struct UART_TXD_INV_W<'a> {
128    w: &'a mut W,
129}
130impl<'a> UART_TXD_INV_W<'a> {
131    #[doc = r"Sets the field bit"]
132    #[inline(always)]
133    pub fn set_bit(self) -> &'a mut W {
134        self.bit(true)
135    }
136    #[doc = r"Clears the field bit"]
137    #[inline(always)]
138    pub fn clear_bit(self) -> &'a mut W {
139        self.bit(false)
140    }
141    #[doc = r"Writes raw bits to the field"]
142    #[inline(always)]
143    pub fn bit(self, value: bool) -> &'a mut W {
144        self.w.bits = (self.w.bits & !(1 << 22)) | ((value as u32 & 1) << 22);
145        self.w
146    }
147}
148#[doc = "Field `uart_dsr_inv` reader - Set this bit to inverse uart dsr level"]
149pub struct UART_DSR_INV_R(crate::FieldReader<bool, bool>);
150impl UART_DSR_INV_R {
151    #[inline(always)]
152    pub(crate) fn new(bits: bool) -> Self {
153        UART_DSR_INV_R(crate::FieldReader::new(bits))
154    }
155}
156impl core::ops::Deref for UART_DSR_INV_R {
157    type Target = crate::FieldReader<bool, bool>;
158    #[inline(always)]
159    fn deref(&self) -> &Self::Target {
160        &self.0
161    }
162}
163#[doc = "Field `uart_dsr_inv` writer - Set this bit to inverse uart dsr level"]
164pub struct UART_DSR_INV_W<'a> {
165    w: &'a mut W,
166}
167impl<'a> UART_DSR_INV_W<'a> {
168    #[doc = r"Sets the field bit"]
169    #[inline(always)]
170    pub fn set_bit(self) -> &'a mut W {
171        self.bit(true)
172    }
173    #[doc = r"Clears the field bit"]
174    #[inline(always)]
175    pub fn clear_bit(self) -> &'a mut W {
176        self.bit(false)
177    }
178    #[doc = r"Writes raw bits to the field"]
179    #[inline(always)]
180    pub fn bit(self, value: bool) -> &'a mut W {
181        self.w.bits = (self.w.bits & !(1 << 21)) | ((value as u32 & 1) << 21);
182        self.w
183    }
184}
185#[doc = "Field `uart_cts_inv` reader - Set this bit to inverse uart cts level"]
186pub struct UART_CTS_INV_R(crate::FieldReader<bool, bool>);
187impl UART_CTS_INV_R {
188    #[inline(always)]
189    pub(crate) fn new(bits: bool) -> Self {
190        UART_CTS_INV_R(crate::FieldReader::new(bits))
191    }
192}
193impl core::ops::Deref for UART_CTS_INV_R {
194    type Target = crate::FieldReader<bool, bool>;
195    #[inline(always)]
196    fn deref(&self) -> &Self::Target {
197        &self.0
198    }
199}
200#[doc = "Field `uart_cts_inv` writer - Set this bit to inverse uart cts level"]
201pub struct UART_CTS_INV_W<'a> {
202    w: &'a mut W,
203}
204impl<'a> UART_CTS_INV_W<'a> {
205    #[doc = r"Sets the field bit"]
206    #[inline(always)]
207    pub fn set_bit(self) -> &'a mut W {
208        self.bit(true)
209    }
210    #[doc = r"Clears the field bit"]
211    #[inline(always)]
212    pub fn clear_bit(self) -> &'a mut W {
213        self.bit(false)
214    }
215    #[doc = r"Writes raw bits to the field"]
216    #[inline(always)]
217    pub fn bit(self, value: bool) -> &'a mut W {
218        self.w.bits = (self.w.bits & !(1 << 20)) | ((value as u32 & 1) << 20);
219        self.w
220    }
221}
222#[doc = "Field `uart_rxd_inv` reader - Set this bit to inverse uart rxd level"]
223pub struct UART_RXD_INV_R(crate::FieldReader<bool, bool>);
224impl UART_RXD_INV_R {
225    #[inline(always)]
226    pub(crate) fn new(bits: bool) -> Self {
227        UART_RXD_INV_R(crate::FieldReader::new(bits))
228    }
229}
230impl core::ops::Deref for UART_RXD_INV_R {
231    type Target = crate::FieldReader<bool, bool>;
232    #[inline(always)]
233    fn deref(&self) -> &Self::Target {
234        &self.0
235    }
236}
237#[doc = "Field `uart_rxd_inv` writer - Set this bit to inverse uart rxd level"]
238pub struct UART_RXD_INV_W<'a> {
239    w: &'a mut W,
240}
241impl<'a> UART_RXD_INV_W<'a> {
242    #[doc = r"Sets the field bit"]
243    #[inline(always)]
244    pub fn set_bit(self) -> &'a mut W {
245        self.bit(true)
246    }
247    #[doc = r"Clears the field bit"]
248    #[inline(always)]
249    pub fn clear_bit(self) -> &'a mut W {
250        self.bit(false)
251    }
252    #[doc = r"Writes raw bits to the field"]
253    #[inline(always)]
254    pub fn bit(self, value: bool) -> &'a mut W {
255        self.w.bits = (self.w.bits & !(1 << 19)) | ((value as u32 & 1) << 19);
256        self.w
257    }
258}
259#[doc = "Field `txfifo_rst` reader - Set this bit to reset uart tx fifo"]
260pub struct TXFIFO_RST_R(crate::FieldReader<bool, bool>);
261impl TXFIFO_RST_R {
262    #[inline(always)]
263    pub(crate) fn new(bits: bool) -> Self {
264        TXFIFO_RST_R(crate::FieldReader::new(bits))
265    }
266}
267impl core::ops::Deref for TXFIFO_RST_R {
268    type Target = crate::FieldReader<bool, bool>;
269    #[inline(always)]
270    fn deref(&self) -> &Self::Target {
271        &self.0
272    }
273}
274#[doc = "Field `txfifo_rst` writer - Set this bit to reset uart tx fifo"]
275pub struct TXFIFO_RST_W<'a> {
276    w: &'a mut W,
277}
278impl<'a> TXFIFO_RST_W<'a> {
279    #[doc = r"Sets the field bit"]
280    #[inline(always)]
281    pub fn set_bit(self) -> &'a mut W {
282        self.bit(true)
283    }
284    #[doc = r"Clears the field bit"]
285    #[inline(always)]
286    pub fn clear_bit(self) -> &'a mut W {
287        self.bit(false)
288    }
289    #[doc = r"Writes raw bits to the field"]
290    #[inline(always)]
291    pub fn bit(self, value: bool) -> &'a mut W {
292        self.w.bits = (self.w.bits & !(1 << 18)) | ((value as u32 & 1) << 18);
293        self.w
294    }
295}
296#[doc = "Field `rxfifo_rst` reader - Set this bit to reset uart rx fifo"]
297pub struct RXFIFO_RST_R(crate::FieldReader<bool, bool>);
298impl RXFIFO_RST_R {
299    #[inline(always)]
300    pub(crate) fn new(bits: bool) -> Self {
301        RXFIFO_RST_R(crate::FieldReader::new(bits))
302    }
303}
304impl core::ops::Deref for RXFIFO_RST_R {
305    type Target = crate::FieldReader<bool, bool>;
306    #[inline(always)]
307    fn deref(&self) -> &Self::Target {
308        &self.0
309    }
310}
311#[doc = "Field `rxfifo_rst` writer - Set this bit to reset uart rx fifo"]
312pub struct RXFIFO_RST_W<'a> {
313    w: &'a mut W,
314}
315impl<'a> RXFIFO_RST_W<'a> {
316    #[doc = r"Sets the field bit"]
317    #[inline(always)]
318    pub fn set_bit(self) -> &'a mut W {
319        self.bit(true)
320    }
321    #[doc = r"Clears the field bit"]
322    #[inline(always)]
323    pub fn clear_bit(self) -> &'a mut W {
324        self.bit(false)
325    }
326    #[doc = r"Writes raw bits to the field"]
327    #[inline(always)]
328    pub fn bit(self, value: bool) -> &'a mut W {
329        self.w.bits = (self.w.bits & !(1 << 17)) | ((value as u32 & 1) << 17);
330        self.w
331    }
332}
333#[doc = "Field `tx_flow_en` reader - Set this bit to enable uart tx hardware flow control"]
334pub struct TX_FLOW_EN_R(crate::FieldReader<bool, bool>);
335impl TX_FLOW_EN_R {
336    #[inline(always)]
337    pub(crate) fn new(bits: bool) -> Self {
338        TX_FLOW_EN_R(crate::FieldReader::new(bits))
339    }
340}
341impl core::ops::Deref for TX_FLOW_EN_R {
342    type Target = crate::FieldReader<bool, bool>;
343    #[inline(always)]
344    fn deref(&self) -> &Self::Target {
345        &self.0
346    }
347}
348#[doc = "Field `tx_flow_en` writer - Set this bit to enable uart tx hardware flow control"]
349pub struct TX_FLOW_EN_W<'a> {
350    w: &'a mut W,
351}
352impl<'a> TX_FLOW_EN_W<'a> {
353    #[doc = r"Sets the field bit"]
354    #[inline(always)]
355    pub fn set_bit(self) -> &'a mut W {
356        self.bit(true)
357    }
358    #[doc = r"Clears the field bit"]
359    #[inline(always)]
360    pub fn clear_bit(self) -> &'a mut W {
361        self.bit(false)
362    }
363    #[doc = r"Writes raw bits to the field"]
364    #[inline(always)]
365    pub fn bit(self, value: bool) -> &'a mut W {
366        self.w.bits = (self.w.bits & !(1 << 15)) | ((value as u32 & 1) << 15);
367        self.w
368    }
369}
370#[doc = "Field `uart_loopback` reader - Set this bit to enable uart loopback test mode"]
371pub struct UART_LOOPBACK_R(crate::FieldReader<bool, bool>);
372impl UART_LOOPBACK_R {
373    #[inline(always)]
374    pub(crate) fn new(bits: bool) -> Self {
375        UART_LOOPBACK_R(crate::FieldReader::new(bits))
376    }
377}
378impl core::ops::Deref for UART_LOOPBACK_R {
379    type Target = crate::FieldReader<bool, bool>;
380    #[inline(always)]
381    fn deref(&self) -> &Self::Target {
382        &self.0
383    }
384}
385#[doc = "Field `uart_loopback` writer - Set this bit to enable uart loopback test mode"]
386pub struct UART_LOOPBACK_W<'a> {
387    w: &'a mut W,
388}
389impl<'a> UART_LOOPBACK_W<'a> {
390    #[doc = r"Sets the field bit"]
391    #[inline(always)]
392    pub fn set_bit(self) -> &'a mut W {
393        self.bit(true)
394    }
395    #[doc = r"Clears the field bit"]
396    #[inline(always)]
397    pub fn clear_bit(self) -> &'a mut W {
398        self.bit(false)
399    }
400    #[doc = r"Writes raw bits to the field"]
401    #[inline(always)]
402    pub fn bit(self, value: bool) -> &'a mut W {
403        self.w.bits = (self.w.bits & !(1 << 14)) | ((value as u32 & 1) << 14);
404        self.w
405    }
406}
407#[doc = "Field `txd_brk` reader - RESERVED, DO NOT CHANGE THIS BIT"]
408pub struct TXD_BRK_R(crate::FieldReader<bool, bool>);
409impl TXD_BRK_R {
410    #[inline(always)]
411    pub(crate) fn new(bits: bool) -> Self {
412        TXD_BRK_R(crate::FieldReader::new(bits))
413    }
414}
415impl core::ops::Deref for TXD_BRK_R {
416    type Target = crate::FieldReader<bool, bool>;
417    #[inline(always)]
418    fn deref(&self) -> &Self::Target {
419        &self.0
420    }
421}
422#[doc = "Field `txd_brk` writer - RESERVED, DO NOT CHANGE THIS BIT"]
423pub struct TXD_BRK_W<'a> {
424    w: &'a mut W,
425}
426impl<'a> TXD_BRK_W<'a> {
427    #[doc = r"Sets the field bit"]
428    #[inline(always)]
429    pub fn set_bit(self) -> &'a mut W {
430        self.bit(true)
431    }
432    #[doc = r"Clears the field bit"]
433    #[inline(always)]
434    pub fn clear_bit(self) -> &'a mut W {
435        self.bit(false)
436    }
437    #[doc = r"Writes raw bits to the field"]
438    #[inline(always)]
439    pub fn bit(self, value: bool) -> &'a mut W {
440        self.w.bits = (self.w.bits & !(1 << 8)) | ((value as u32 & 1) << 8);
441        self.w
442    }
443}
444#[doc = "Field `sw_dtr` reader - sw dtr"]
445pub struct SW_DTR_R(crate::FieldReader<bool, bool>);
446impl SW_DTR_R {
447    #[inline(always)]
448    pub(crate) fn new(bits: bool) -> Self {
449        SW_DTR_R(crate::FieldReader::new(bits))
450    }
451}
452impl core::ops::Deref for SW_DTR_R {
453    type Target = crate::FieldReader<bool, bool>;
454    #[inline(always)]
455    fn deref(&self) -> &Self::Target {
456        &self.0
457    }
458}
459#[doc = "Field `sw_dtr` writer - sw dtr"]
460pub struct SW_DTR_W<'a> {
461    w: &'a mut W,
462}
463impl<'a> SW_DTR_W<'a> {
464    #[doc = r"Sets the field bit"]
465    #[inline(always)]
466    pub fn set_bit(self) -> &'a mut W {
467        self.bit(true)
468    }
469    #[doc = r"Clears the field bit"]
470    #[inline(always)]
471    pub fn clear_bit(self) -> &'a mut W {
472        self.bit(false)
473    }
474    #[doc = r"Writes raw bits to the field"]
475    #[inline(always)]
476    pub fn bit(self, value: bool) -> &'a mut W {
477        self.w.bits = (self.w.bits & !(1 << 7)) | ((value as u32 & 1) << 7);
478        self.w
479    }
480}
481#[doc = "Field `sw_rts` reader - sw rts"]
482pub struct SW_RTS_R(crate::FieldReader<bool, bool>);
483impl SW_RTS_R {
484    #[inline(always)]
485    pub(crate) fn new(bits: bool) -> Self {
486        SW_RTS_R(crate::FieldReader::new(bits))
487    }
488}
489impl core::ops::Deref for SW_RTS_R {
490    type Target = crate::FieldReader<bool, bool>;
491    #[inline(always)]
492    fn deref(&self) -> &Self::Target {
493        &self.0
494    }
495}
496#[doc = "Field `sw_rts` writer - sw rts"]
497pub struct SW_RTS_W<'a> {
498    w: &'a mut W,
499}
500impl<'a> SW_RTS_W<'a> {
501    #[doc = r"Sets the field bit"]
502    #[inline(always)]
503    pub fn set_bit(self) -> &'a mut W {
504        self.bit(true)
505    }
506    #[doc = r"Clears the field bit"]
507    #[inline(always)]
508    pub fn clear_bit(self) -> &'a mut W {
509        self.bit(false)
510    }
511    #[doc = r"Writes raw bits to the field"]
512    #[inline(always)]
513    pub fn bit(self, value: bool) -> &'a mut W {
514        self.w.bits = (self.w.bits & !(1 << 6)) | ((value as u32 & 1) << 6);
515        self.w
516    }
517}
518#[doc = "Field `stop_bit_num` reader - Set stop bit: 1:1bit 2:1.5bits 3:2bits"]
519pub struct STOP_BIT_NUM_R(crate::FieldReader<u8, u8>);
520impl STOP_BIT_NUM_R {
521    #[inline(always)]
522    pub(crate) fn new(bits: u8) -> Self {
523        STOP_BIT_NUM_R(crate::FieldReader::new(bits))
524    }
525}
526impl core::ops::Deref for STOP_BIT_NUM_R {
527    type Target = crate::FieldReader<u8, u8>;
528    #[inline(always)]
529    fn deref(&self) -> &Self::Target {
530        &self.0
531    }
532}
533#[doc = "Field `stop_bit_num` writer - Set stop bit: 1:1bit 2:1.5bits 3:2bits"]
534pub struct STOP_BIT_NUM_W<'a> {
535    w: &'a mut W,
536}
537impl<'a> STOP_BIT_NUM_W<'a> {
538    #[doc = r"Writes raw bits to the field"]
539    #[inline(always)]
540    pub unsafe fn bits(self, value: u8) -> &'a mut W {
541        self.w.bits = (self.w.bits & !(3 << 4)) | ((value as u32 & 3) << 4);
542        self.w
543    }
544}
545#[doc = "Field `bit_num` reader - Set bit num: 0:5bits 1:6bits 2:7bits 3:8bits"]
546pub struct BIT_NUM_R(crate::FieldReader<u8, u8>);
547impl BIT_NUM_R {
548    #[inline(always)]
549    pub(crate) fn new(bits: u8) -> Self {
550        BIT_NUM_R(crate::FieldReader::new(bits))
551    }
552}
553impl core::ops::Deref for BIT_NUM_R {
554    type Target = crate::FieldReader<u8, u8>;
555    #[inline(always)]
556    fn deref(&self) -> &Self::Target {
557        &self.0
558    }
559}
560#[doc = "Field `bit_num` writer - Set bit num: 0:5bits 1:6bits 2:7bits 3:8bits"]
561pub struct BIT_NUM_W<'a> {
562    w: &'a mut W,
563}
564impl<'a> BIT_NUM_W<'a> {
565    #[doc = r"Writes raw bits to the field"]
566    #[inline(always)]
567    pub unsafe fn bits(self, value: u8) -> &'a mut W {
568        self.w.bits = (self.w.bits & !(3 << 2)) | ((value as u32 & 3) << 2);
569        self.w
570    }
571}
572#[doc = "Field `parity_en` reader - Set this bit to enable uart parity check"]
573pub struct PARITY_EN_R(crate::FieldReader<bool, bool>);
574impl PARITY_EN_R {
575    #[inline(always)]
576    pub(crate) fn new(bits: bool) -> Self {
577        PARITY_EN_R(crate::FieldReader::new(bits))
578    }
579}
580impl core::ops::Deref for PARITY_EN_R {
581    type Target = crate::FieldReader<bool, bool>;
582    #[inline(always)]
583    fn deref(&self) -> &Self::Target {
584        &self.0
585    }
586}
587#[doc = "Field `parity_en` writer - Set this bit to enable uart parity check"]
588pub struct PARITY_EN_W<'a> {
589    w: &'a mut W,
590}
591impl<'a> PARITY_EN_W<'a> {
592    #[doc = r"Sets the field bit"]
593    #[inline(always)]
594    pub fn set_bit(self) -> &'a mut W {
595        self.bit(true)
596    }
597    #[doc = r"Clears the field bit"]
598    #[inline(always)]
599    pub fn clear_bit(self) -> &'a mut W {
600        self.bit(false)
601    }
602    #[doc = r"Writes raw bits to the field"]
603    #[inline(always)]
604    pub fn bit(self, value: bool) -> &'a mut W {
605        self.w.bits = (self.w.bits & !(1 << 1)) | ((value as u32 & 1) << 1);
606        self.w
607    }
608}
609#[doc = "Field `parity` reader - Set parity check: 0:even 1:odd, UART CONFIG1"]
610pub struct PARITY_R(crate::FieldReader<bool, bool>);
611impl PARITY_R {
612    #[inline(always)]
613    pub(crate) fn new(bits: bool) -> Self {
614        PARITY_R(crate::FieldReader::new(bits))
615    }
616}
617impl core::ops::Deref for PARITY_R {
618    type Target = crate::FieldReader<bool, bool>;
619    #[inline(always)]
620    fn deref(&self) -> &Self::Target {
621        &self.0
622    }
623}
624#[doc = "Field `parity` writer - Set parity check: 0:even 1:odd, UART CONFIG1"]
625pub struct PARITY_W<'a> {
626    w: &'a mut W,
627}
628impl<'a> PARITY_W<'a> {
629    #[doc = r"Sets the field bit"]
630    #[inline(always)]
631    pub fn set_bit(self) -> &'a mut W {
632        self.bit(true)
633    }
634    #[doc = r"Clears the field bit"]
635    #[inline(always)]
636    pub fn clear_bit(self) -> &'a mut W {
637        self.bit(false)
638    }
639    #[doc = r"Writes raw bits to the field"]
640    #[inline(always)]
641    pub fn bit(self, value: bool) -> &'a mut W {
642        self.w.bits = (self.w.bits & !1) | (value as u32 & 1);
643        self.w
644    }
645}
646impl R {
647    #[doc = "Bit 24 - Set this bit to inverse uart dtr level"]
648    #[inline(always)]
649    pub fn uart_dtr_inv(&self) -> UART_DTR_INV_R {
650        UART_DTR_INV_R::new(((self.bits >> 24) & 1) != 0)
651    }
652    #[doc = "Bit 23 - Set this bit to inverse uart rts level"]
653    #[inline(always)]
654    pub fn uart_rts_inv(&self) -> UART_RTS_INV_R {
655        UART_RTS_INV_R::new(((self.bits >> 23) & 1) != 0)
656    }
657    #[doc = "Bit 22 - Set this bit to inverse uart txd level"]
658    #[inline(always)]
659    pub fn uart_txd_inv(&self) -> UART_TXD_INV_R {
660        UART_TXD_INV_R::new(((self.bits >> 22) & 1) != 0)
661    }
662    #[doc = "Bit 21 - Set this bit to inverse uart dsr level"]
663    #[inline(always)]
664    pub fn uart_dsr_inv(&self) -> UART_DSR_INV_R {
665        UART_DSR_INV_R::new(((self.bits >> 21) & 1) != 0)
666    }
667    #[doc = "Bit 20 - Set this bit to inverse uart cts level"]
668    #[inline(always)]
669    pub fn uart_cts_inv(&self) -> UART_CTS_INV_R {
670        UART_CTS_INV_R::new(((self.bits >> 20) & 1) != 0)
671    }
672    #[doc = "Bit 19 - Set this bit to inverse uart rxd level"]
673    #[inline(always)]
674    pub fn uart_rxd_inv(&self) -> UART_RXD_INV_R {
675        UART_RXD_INV_R::new(((self.bits >> 19) & 1) != 0)
676    }
677    #[doc = "Bit 18 - Set this bit to reset uart tx fifo"]
678    #[inline(always)]
679    pub fn txfifo_rst(&self) -> TXFIFO_RST_R {
680        TXFIFO_RST_R::new(((self.bits >> 18) & 1) != 0)
681    }
682    #[doc = "Bit 17 - Set this bit to reset uart rx fifo"]
683    #[inline(always)]
684    pub fn rxfifo_rst(&self) -> RXFIFO_RST_R {
685        RXFIFO_RST_R::new(((self.bits >> 17) & 1) != 0)
686    }
687    #[doc = "Bit 15 - Set this bit to enable uart tx hardware flow control"]
688    #[inline(always)]
689    pub fn tx_flow_en(&self) -> TX_FLOW_EN_R {
690        TX_FLOW_EN_R::new(((self.bits >> 15) & 1) != 0)
691    }
692    #[doc = "Bit 14 - Set this bit to enable uart loopback test mode"]
693    #[inline(always)]
694    pub fn uart_loopback(&self) -> UART_LOOPBACK_R {
695        UART_LOOPBACK_R::new(((self.bits >> 14) & 1) != 0)
696    }
697    #[doc = "Bit 8 - RESERVED, DO NOT CHANGE THIS BIT"]
698    #[inline(always)]
699    pub fn txd_brk(&self) -> TXD_BRK_R {
700        TXD_BRK_R::new(((self.bits >> 8) & 1) != 0)
701    }
702    #[doc = "Bit 7 - sw dtr"]
703    #[inline(always)]
704    pub fn sw_dtr(&self) -> SW_DTR_R {
705        SW_DTR_R::new(((self.bits >> 7) & 1) != 0)
706    }
707    #[doc = "Bit 6 - sw rts"]
708    #[inline(always)]
709    pub fn sw_rts(&self) -> SW_RTS_R {
710        SW_RTS_R::new(((self.bits >> 6) & 1) != 0)
711    }
712    #[doc = "Bits 4:5 - Set stop bit: 1:1bit 2:1.5bits 3:2bits"]
713    #[inline(always)]
714    pub fn stop_bit_num(&self) -> STOP_BIT_NUM_R {
715        STOP_BIT_NUM_R::new(((self.bits >> 4) & 3) as u8)
716    }
717    #[doc = "Bits 2:3 - Set bit num: 0:5bits 1:6bits 2:7bits 3:8bits"]
718    #[inline(always)]
719    pub fn bit_num(&self) -> BIT_NUM_R {
720        BIT_NUM_R::new(((self.bits >> 2) & 3) as u8)
721    }
722    #[doc = "Bit 1 - Set this bit to enable uart parity check"]
723    #[inline(always)]
724    pub fn parity_en(&self) -> PARITY_EN_R {
725        PARITY_EN_R::new(((self.bits >> 1) & 1) != 0)
726    }
727    #[doc = "Bit 0 - Set parity check: 0:even 1:odd, UART CONFIG1"]
728    #[inline(always)]
729    pub fn parity(&self) -> PARITY_R {
730        PARITY_R::new((self.bits & 1) != 0)
731    }
732}
733impl W {
734    #[doc = "Bit 24 - Set this bit to inverse uart dtr level"]
735    #[inline(always)]
736    pub fn uart_dtr_inv(&mut self) -> UART_DTR_INV_W {
737        UART_DTR_INV_W { w: self }
738    }
739    #[doc = "Bit 23 - Set this bit to inverse uart rts level"]
740    #[inline(always)]
741    pub fn uart_rts_inv(&mut self) -> UART_RTS_INV_W {
742        UART_RTS_INV_W { w: self }
743    }
744    #[doc = "Bit 22 - Set this bit to inverse uart txd level"]
745    #[inline(always)]
746    pub fn uart_txd_inv(&mut self) -> UART_TXD_INV_W {
747        UART_TXD_INV_W { w: self }
748    }
749    #[doc = "Bit 21 - Set this bit to inverse uart dsr level"]
750    #[inline(always)]
751    pub fn uart_dsr_inv(&mut self) -> UART_DSR_INV_W {
752        UART_DSR_INV_W { w: self }
753    }
754    #[doc = "Bit 20 - Set this bit to inverse uart cts level"]
755    #[inline(always)]
756    pub fn uart_cts_inv(&mut self) -> UART_CTS_INV_W {
757        UART_CTS_INV_W { w: self }
758    }
759    #[doc = "Bit 19 - Set this bit to inverse uart rxd level"]
760    #[inline(always)]
761    pub fn uart_rxd_inv(&mut self) -> UART_RXD_INV_W {
762        UART_RXD_INV_W { w: self }
763    }
764    #[doc = "Bit 18 - Set this bit to reset uart tx fifo"]
765    #[inline(always)]
766    pub fn txfifo_rst(&mut self) -> TXFIFO_RST_W {
767        TXFIFO_RST_W { w: self }
768    }
769    #[doc = "Bit 17 - Set this bit to reset uart rx fifo"]
770    #[inline(always)]
771    pub fn rxfifo_rst(&mut self) -> RXFIFO_RST_W {
772        RXFIFO_RST_W { w: self }
773    }
774    #[doc = "Bit 15 - Set this bit to enable uart tx hardware flow control"]
775    #[inline(always)]
776    pub fn tx_flow_en(&mut self) -> TX_FLOW_EN_W {
777        TX_FLOW_EN_W { w: self }
778    }
779    #[doc = "Bit 14 - Set this bit to enable uart loopback test mode"]
780    #[inline(always)]
781    pub fn uart_loopback(&mut self) -> UART_LOOPBACK_W {
782        UART_LOOPBACK_W { w: self }
783    }
784    #[doc = "Bit 8 - RESERVED, DO NOT CHANGE THIS BIT"]
785    #[inline(always)]
786    pub fn txd_brk(&mut self) -> TXD_BRK_W {
787        TXD_BRK_W { w: self }
788    }
789    #[doc = "Bit 7 - sw dtr"]
790    #[inline(always)]
791    pub fn sw_dtr(&mut self) -> SW_DTR_W {
792        SW_DTR_W { w: self }
793    }
794    #[doc = "Bit 6 - sw rts"]
795    #[inline(always)]
796    pub fn sw_rts(&mut self) -> SW_RTS_W {
797        SW_RTS_W { w: self }
798    }
799    #[doc = "Bits 4:5 - Set stop bit: 1:1bit 2:1.5bits 3:2bits"]
800    #[inline(always)]
801    pub fn stop_bit_num(&mut self) -> STOP_BIT_NUM_W {
802        STOP_BIT_NUM_W { w: self }
803    }
804    #[doc = "Bits 2:3 - Set bit num: 0:5bits 1:6bits 2:7bits 3:8bits"]
805    #[inline(always)]
806    pub fn bit_num(&mut self) -> BIT_NUM_W {
807        BIT_NUM_W { w: self }
808    }
809    #[doc = "Bit 1 - Set this bit to enable uart parity check"]
810    #[inline(always)]
811    pub fn parity_en(&mut self) -> PARITY_EN_W {
812        PARITY_EN_W { w: self }
813    }
814    #[doc = "Bit 0 - Set parity check: 0:even 1:odd, UART CONFIG1"]
815    #[inline(always)]
816    pub fn parity(&mut self) -> PARITY_W {
817        PARITY_W { w: self }
818    }
819    #[doc = "Writes raw bits to the register."]
820    #[inline(always)]
821    pub unsafe fn bits(&mut self, bits: u32) -> &mut Self {
822        self.0.bits(bits);
823        self
824    }
825}
826#[doc = "UART CONFIG0(UART0 and UART1)\n\nThis register you can [`read`]
827(crate::generic::Reg::read), [`write_with_zero`]
828(crate::generic::Reg::write_with_zero), [`reset`]
829(crate::generic::Reg::reset), [`write`]
830(crate::generic::Reg::write), [`modify`]
831(crate::generic::Reg::modify). See [API]
832(https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [uart_conf0]
833(index.html) module"]
834pub struct UART_CONF0_SPEC;
835impl crate::RegisterSpec for UART_CONF0_SPEC {
836    type Ux = u32;
837}
838#[doc = "`read()` method returns [uart_conf0::R]
839(R) reader structure"]
840impl crate::Readable for UART_CONF0_SPEC {
841    type Reader = R;
842}
843#[doc = "`write(|w| ..)` method takes [uart_conf0::W]
844(W) writer structure"]
845impl crate::Writable for UART_CONF0_SPEC {
846    type Writer = W;
847}
848#[doc = "`reset()` method sets UART_CONF0 to value 0"]
849impl crate::Resettable for UART_CONF0_SPEC {
850    #[inline(always)]
851    fn reset_value() -> Self::Ux {
852        0
853    }
854}