esp32c3/uart0/
flow_conf.rs1#[doc = "Register `FLOW_CONF` reader"]
2pub type R = crate::R<FLOW_CONF_SPEC>;
3#[doc = "Register `FLOW_CONF` writer"]
4pub type W = crate::W<FLOW_CONF_SPEC>;
5#[doc = "Field `SW_FLOW_CON_EN` reader - Set this bit to enable software flow control. It is used with register sw_xon or sw_xoff."]
6pub type SW_FLOW_CON_EN_R = crate::BitReader;
7#[doc = "Field `SW_FLOW_CON_EN` writer - Set this bit to enable software flow control. It is used with register sw_xon or sw_xoff."]
8pub type SW_FLOW_CON_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `XONOFF_DEL` reader - Set this bit to remove flow control char from the received data."]
10pub type XONOFF_DEL_R = crate::BitReader;
11#[doc = "Field `XONOFF_DEL` writer - Set this bit to remove flow control char from the received data."]
12pub type XONOFF_DEL_W<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `FORCE_XON` reader - Set this bit to enable the transmitter to go on sending data."]
14pub type FORCE_XON_R = crate::BitReader;
15#[doc = "Field `FORCE_XON` writer - Set this bit to enable the transmitter to go on sending data."]
16pub type FORCE_XON_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `FORCE_XOFF` reader - Set this bit to stop the transmitter from sending data."]
18pub type FORCE_XOFF_R = crate::BitReader;
19#[doc = "Field `FORCE_XOFF` writer - Set this bit to stop the transmitter from sending data."]
20pub type FORCE_XOFF_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `SEND_XON` reader - Set this bit to send Xon char. It is cleared by hardware automatically."]
22pub type SEND_XON_R = crate::BitReader;
23#[doc = "Field `SEND_XON` writer - Set this bit to send Xon char. It is cleared by hardware automatically."]
24pub type SEND_XON_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `SEND_XOFF` reader - Set this bit to send Xoff char. It is cleared by hardware automatically."]
26pub type SEND_XOFF_R = crate::BitReader;
27#[doc = "Field `SEND_XOFF` writer - Set this bit to send Xoff char. It is cleared by hardware automatically."]
28pub type SEND_XOFF_W<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30 #[doc = "Bit 0 - Set this bit to enable software flow control. It is used with register sw_xon or sw_xoff."]
31 #[inline(always)]
32 pub fn sw_flow_con_en(&self) -> SW_FLOW_CON_EN_R {
33 SW_FLOW_CON_EN_R::new((self.bits & 1) != 0)
34 }
35 #[doc = "Bit 1 - Set this bit to remove flow control char from the received data."]
36 #[inline(always)]
37 pub fn xonoff_del(&self) -> XONOFF_DEL_R {
38 XONOFF_DEL_R::new(((self.bits >> 1) & 1) != 0)
39 }
40 #[doc = "Bit 2 - Set this bit to enable the transmitter to go on sending data."]
41 #[inline(always)]
42 pub fn force_xon(&self) -> FORCE_XON_R {
43 FORCE_XON_R::new(((self.bits >> 2) & 1) != 0)
44 }
45 #[doc = "Bit 3 - Set this bit to stop the transmitter from sending data."]
46 #[inline(always)]
47 pub fn force_xoff(&self) -> FORCE_XOFF_R {
48 FORCE_XOFF_R::new(((self.bits >> 3) & 1) != 0)
49 }
50 #[doc = "Bit 4 - Set this bit to send Xon char. It is cleared by hardware automatically."]
51 #[inline(always)]
52 pub fn send_xon(&self) -> SEND_XON_R {
53 SEND_XON_R::new(((self.bits >> 4) & 1) != 0)
54 }
55 #[doc = "Bit 5 - Set this bit to send Xoff char. It is cleared by hardware automatically."]
56 #[inline(always)]
57 pub fn send_xoff(&self) -> SEND_XOFF_R {
58 SEND_XOFF_R::new(((self.bits >> 5) & 1) != 0)
59 }
60}
61#[cfg(feature = "impl-register-debug")]
62impl core::fmt::Debug for R {
63 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
64 f.debug_struct("FLOW_CONF")
65 .field("sw_flow_con_en", &self.sw_flow_con_en())
66 .field("xonoff_del", &self.xonoff_del())
67 .field("force_xon", &self.force_xon())
68 .field("force_xoff", &self.force_xoff())
69 .field("send_xon", &self.send_xon())
70 .field("send_xoff", &self.send_xoff())
71 .finish()
72 }
73}
74impl W {
75 #[doc = "Bit 0 - Set this bit to enable software flow control. It is used with register sw_xon or sw_xoff."]
76 #[inline(always)]
77 pub fn sw_flow_con_en(&mut self) -> SW_FLOW_CON_EN_W<FLOW_CONF_SPEC> {
78 SW_FLOW_CON_EN_W::new(self, 0)
79 }
80 #[doc = "Bit 1 - Set this bit to remove flow control char from the received data."]
81 #[inline(always)]
82 pub fn xonoff_del(&mut self) -> XONOFF_DEL_W<FLOW_CONF_SPEC> {
83 XONOFF_DEL_W::new(self, 1)
84 }
85 #[doc = "Bit 2 - Set this bit to enable the transmitter to go on sending data."]
86 #[inline(always)]
87 pub fn force_xon(&mut self) -> FORCE_XON_W<FLOW_CONF_SPEC> {
88 FORCE_XON_W::new(self, 2)
89 }
90 #[doc = "Bit 3 - Set this bit to stop the transmitter from sending data."]
91 #[inline(always)]
92 pub fn force_xoff(&mut self) -> FORCE_XOFF_W<FLOW_CONF_SPEC> {
93 FORCE_XOFF_W::new(self, 3)
94 }
95 #[doc = "Bit 4 - Set this bit to send Xon char. It is cleared by hardware automatically."]
96 #[inline(always)]
97 pub fn send_xon(&mut self) -> SEND_XON_W<FLOW_CONF_SPEC> {
98 SEND_XON_W::new(self, 4)
99 }
100 #[doc = "Bit 5 - Set this bit to send Xoff char. It is cleared by hardware automatically."]
101 #[inline(always)]
102 pub fn send_xoff(&mut self) -> SEND_XOFF_W<FLOW_CONF_SPEC> {
103 SEND_XOFF_W::new(self, 5)
104 }
105}
106#[doc = "Software flow-control configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`flow_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`flow_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
107pub struct FLOW_CONF_SPEC;
108impl crate::RegisterSpec for FLOW_CONF_SPEC {
109 type Ux = u32;
110}
111#[doc = "`read()` method returns [`flow_conf::R`](R) reader structure"]
112impl crate::Readable for FLOW_CONF_SPEC {}
113#[doc = "`write(|w| ..)` method takes [`flow_conf::W`](W) writer structure"]
114impl crate::Writable for FLOW_CONF_SPEC {
115 type Safety = crate::Unsafe;
116 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
117 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
118}
119#[doc = "`reset()` method sets FLOW_CONF to value 0"]
120impl crate::Resettable for FLOW_CONF_SPEC {
121 const RESET_VALUE: u32 = 0;
122}