esp32c6_lp/lp_uart/
swfc_conf0_sync.rs

1#[doc = "Register `SWFC_CONF0_SYNC` reader"]
2pub type R = crate::R<SWFC_CONF0_SYNC_SPEC>;
3#[doc = "Register `SWFC_CONF0_SYNC` writer"]
4pub type W = crate::W<SWFC_CONF0_SYNC_SPEC>;
5#[doc = "Field `XON_CHAR` reader - This register stores the Xon flow control char."]
6pub type XON_CHAR_R = crate::FieldReader;
7#[doc = "Field `XON_CHAR` writer - This register stores the Xon flow control char."]
8pub type XON_CHAR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `XOFF_CHAR` reader - This register stores the Xoff flow control char."]
10pub type XOFF_CHAR_R = crate::FieldReader;
11#[doc = "Field `XOFF_CHAR` writer - This register stores the Xoff flow control char."]
12pub type XOFF_CHAR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `XON_XOFF_STILL_SEND` reader - In software flow control mode, UART Tx is disabled once UART Rx receives XOFF. In this status, UART Tx can not transmit XOFF even the received data number is larger than UART_XOFF_THRESHOLD. Set this bit to enable UART Tx can transmit XON/XOFF when UART Tx is disabled."]
14pub type XON_XOFF_STILL_SEND_R = crate::BitReader;
15#[doc = "Field `XON_XOFF_STILL_SEND` writer - In software flow control mode, UART Tx is disabled once UART Rx receives XOFF. In this status, UART Tx can not transmit XOFF even the received data number is larger than UART_XOFF_THRESHOLD. Set this bit to enable UART Tx can transmit XON/XOFF when UART Tx is disabled."]
16pub type XON_XOFF_STILL_SEND_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[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."]
18pub type SW_FLOW_CON_EN_R = crate::BitReader;
19#[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."]
20pub type SW_FLOW_CON_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `XONOFF_DEL` reader - Set this bit to remove flow control char from the received data."]
22pub type XONOFF_DEL_R = crate::BitReader;
23#[doc = "Field `XONOFF_DEL` writer - Set this bit to remove flow control char from the received data."]
24pub type XONOFF_DEL_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `FORCE_XON` reader - Set this bit to enable the transmitter to go on sending data."]
26pub type FORCE_XON_R = crate::BitReader;
27#[doc = "Field `FORCE_XON` writer - Set this bit to enable the transmitter to go on sending data."]
28pub type FORCE_XON_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `FORCE_XOFF` reader - Set this bit to stop the transmitter from sending data."]
30pub type FORCE_XOFF_R = crate::BitReader;
31#[doc = "Field `FORCE_XOFF` writer - Set this bit to stop the transmitter from sending data."]
32pub type FORCE_XOFF_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `SEND_XON` reader - Set this bit to send Xon char. It is cleared by hardware automatically."]
34pub type SEND_XON_R = crate::BitReader;
35#[doc = "Field `SEND_XON` writer - Set this bit to send Xon char. It is cleared by hardware automatically."]
36pub type SEND_XON_W<'a, REG> = crate::BitWriter<'a, REG>;
37#[doc = "Field `SEND_XOFF` reader - Set this bit to send Xoff char. It is cleared by hardware automatically."]
38pub type SEND_XOFF_R = crate::BitReader;
39#[doc = "Field `SEND_XOFF` writer - Set this bit to send Xoff char. It is cleared by hardware automatically."]
40pub type SEND_XOFF_W<'a, REG> = crate::BitWriter<'a, REG>;
41impl R {
42    #[doc = "Bits 0:7 - This register stores the Xon flow control char."]
43    #[inline(always)]
44    pub fn xon_char(&self) -> XON_CHAR_R {
45        XON_CHAR_R::new((self.bits & 0xff) as u8)
46    }
47    #[doc = "Bits 8:15 - This register stores the Xoff flow control char."]
48    #[inline(always)]
49    pub fn xoff_char(&self) -> XOFF_CHAR_R {
50        XOFF_CHAR_R::new(((self.bits >> 8) & 0xff) as u8)
51    }
52    #[doc = "Bit 16 - In software flow control mode, UART Tx is disabled once UART Rx receives XOFF. In this status, UART Tx can not transmit XOFF even the received data number is larger than UART_XOFF_THRESHOLD. Set this bit to enable UART Tx can transmit XON/XOFF when UART Tx is disabled."]
53    #[inline(always)]
54    pub fn xon_xoff_still_send(&self) -> XON_XOFF_STILL_SEND_R {
55        XON_XOFF_STILL_SEND_R::new(((self.bits >> 16) & 1) != 0)
56    }
57    #[doc = "Bit 17 - Set this bit to enable software flow control. It is used with register sw_xon or sw_xoff."]
58    #[inline(always)]
59    pub fn sw_flow_con_en(&self) -> SW_FLOW_CON_EN_R {
60        SW_FLOW_CON_EN_R::new(((self.bits >> 17) & 1) != 0)
61    }
62    #[doc = "Bit 18 - Set this bit to remove flow control char from the received data."]
63    #[inline(always)]
64    pub fn xonoff_del(&self) -> XONOFF_DEL_R {
65        XONOFF_DEL_R::new(((self.bits >> 18) & 1) != 0)
66    }
67    #[doc = "Bit 19 - Set this bit to enable the transmitter to go on sending data."]
68    #[inline(always)]
69    pub fn force_xon(&self) -> FORCE_XON_R {
70        FORCE_XON_R::new(((self.bits >> 19) & 1) != 0)
71    }
72    #[doc = "Bit 20 - Set this bit to stop the transmitter from sending data."]
73    #[inline(always)]
74    pub fn force_xoff(&self) -> FORCE_XOFF_R {
75        FORCE_XOFF_R::new(((self.bits >> 20) & 1) != 0)
76    }
77    #[doc = "Bit 21 - Set this bit to send Xon char. It is cleared by hardware automatically."]
78    #[inline(always)]
79    pub fn send_xon(&self) -> SEND_XON_R {
80        SEND_XON_R::new(((self.bits >> 21) & 1) != 0)
81    }
82    #[doc = "Bit 22 - Set this bit to send Xoff char. It is cleared by hardware automatically."]
83    #[inline(always)]
84    pub fn send_xoff(&self) -> SEND_XOFF_R {
85        SEND_XOFF_R::new(((self.bits >> 22) & 1) != 0)
86    }
87}
88#[cfg(feature = "impl-register-debug")]
89impl core::fmt::Debug for R {
90    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
91        f.debug_struct("SWFC_CONF0_SYNC")
92            .field("xon_char", &self.xon_char())
93            .field("xoff_char", &self.xoff_char())
94            .field("xon_xoff_still_send", &self.xon_xoff_still_send())
95            .field("sw_flow_con_en", &self.sw_flow_con_en())
96            .field("xonoff_del", &self.xonoff_del())
97            .field("force_xon", &self.force_xon())
98            .field("force_xoff", &self.force_xoff())
99            .field("send_xon", &self.send_xon())
100            .field("send_xoff", &self.send_xoff())
101            .finish()
102    }
103}
104impl W {
105    #[doc = "Bits 0:7 - This register stores the Xon flow control char."]
106    #[inline(always)]
107    #[must_use]
108    pub fn xon_char(&mut self) -> XON_CHAR_W<SWFC_CONF0_SYNC_SPEC> {
109        XON_CHAR_W::new(self, 0)
110    }
111    #[doc = "Bits 8:15 - This register stores the Xoff flow control char."]
112    #[inline(always)]
113    #[must_use]
114    pub fn xoff_char(&mut self) -> XOFF_CHAR_W<SWFC_CONF0_SYNC_SPEC> {
115        XOFF_CHAR_W::new(self, 8)
116    }
117    #[doc = "Bit 16 - In software flow control mode, UART Tx is disabled once UART Rx receives XOFF. In this status, UART Tx can not transmit XOFF even the received data number is larger than UART_XOFF_THRESHOLD. Set this bit to enable UART Tx can transmit XON/XOFF when UART Tx is disabled."]
118    #[inline(always)]
119    #[must_use]
120    pub fn xon_xoff_still_send(&mut self) -> XON_XOFF_STILL_SEND_W<SWFC_CONF0_SYNC_SPEC> {
121        XON_XOFF_STILL_SEND_W::new(self, 16)
122    }
123    #[doc = "Bit 17 - Set this bit to enable software flow control. It is used with register sw_xon or sw_xoff."]
124    #[inline(always)]
125    #[must_use]
126    pub fn sw_flow_con_en(&mut self) -> SW_FLOW_CON_EN_W<SWFC_CONF0_SYNC_SPEC> {
127        SW_FLOW_CON_EN_W::new(self, 17)
128    }
129    #[doc = "Bit 18 - Set this bit to remove flow control char from the received data."]
130    #[inline(always)]
131    #[must_use]
132    pub fn xonoff_del(&mut self) -> XONOFF_DEL_W<SWFC_CONF0_SYNC_SPEC> {
133        XONOFF_DEL_W::new(self, 18)
134    }
135    #[doc = "Bit 19 - Set this bit to enable the transmitter to go on sending data."]
136    #[inline(always)]
137    #[must_use]
138    pub fn force_xon(&mut self) -> FORCE_XON_W<SWFC_CONF0_SYNC_SPEC> {
139        FORCE_XON_W::new(self, 19)
140    }
141    #[doc = "Bit 20 - Set this bit to stop the transmitter from sending data."]
142    #[inline(always)]
143    #[must_use]
144    pub fn force_xoff(&mut self) -> FORCE_XOFF_W<SWFC_CONF0_SYNC_SPEC> {
145        FORCE_XOFF_W::new(self, 20)
146    }
147    #[doc = "Bit 21 - Set this bit to send Xon char. It is cleared by hardware automatically."]
148    #[inline(always)]
149    #[must_use]
150    pub fn send_xon(&mut self) -> SEND_XON_W<SWFC_CONF0_SYNC_SPEC> {
151        SEND_XON_W::new(self, 21)
152    }
153    #[doc = "Bit 22 - Set this bit to send Xoff char. It is cleared by hardware automatically."]
154    #[inline(always)]
155    #[must_use]
156    pub fn send_xoff(&mut self) -> SEND_XOFF_W<SWFC_CONF0_SYNC_SPEC> {
157        SEND_XOFF_W::new(self, 22)
158    }
159}
160#[doc = "Software flow-control character configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`swfc_conf0_sync::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swfc_conf0_sync::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
161pub struct SWFC_CONF0_SYNC_SPEC;
162impl crate::RegisterSpec for SWFC_CONF0_SYNC_SPEC {
163    type Ux = u32;
164}
165#[doc = "`read()` method returns [`swfc_conf0_sync::R`](R) reader structure"]
166impl crate::Readable for SWFC_CONF0_SYNC_SPEC {}
167#[doc = "`write(|w| ..)` method takes [`swfc_conf0_sync::W`](W) writer structure"]
168impl crate::Writable for SWFC_CONF0_SYNC_SPEC {
169    type Safety = crate::Unsafe;
170    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
171    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
172}
173#[doc = "`reset()` method sets SWFC_CONF0_SYNC to value 0x1311"]
174impl crate::Resettable for SWFC_CONF0_SYNC_SPEC {
175    const RESET_VALUE: u32 = 0x1311;
176}