esp32c6_lp/lp_uart/
swfc_conf1.rs1#[doc = "Register `SWFC_CONF1` reader"]
2pub type R = crate::R<SWFC_CONF1_SPEC>;
3#[doc = "Register `SWFC_CONF1` writer"]
4pub type W = crate::W<SWFC_CONF1_SPEC>;
5#[doc = "Field `XON_THRESHOLD` reader - When the data amount in Rx-FIFO is less than this register value with uart_sw_flow_con_en set to 1 it will send a Xon char."]
6pub type XON_THRESHOLD_R = crate::FieldReader;
7#[doc = "Field `XON_THRESHOLD` writer - When the data amount in Rx-FIFO is less than this register value with uart_sw_flow_con_en set to 1 it will send a Xon char."]
8pub type XON_THRESHOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `XOFF_THRESHOLD` reader - When the data amount in Rx-FIFO is more than this register value with uart_sw_flow_con_en set to 1 it will send a Xoff char."]
10pub type XOFF_THRESHOLD_R = crate::FieldReader;
11#[doc = "Field `XOFF_THRESHOLD` writer - When the data amount in Rx-FIFO is more than this register value with uart_sw_flow_con_en set to 1 it will send a Xoff char."]
12pub type XOFF_THRESHOLD_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
13impl R {
14 #[doc = "Bits 3:7 - When the data amount in Rx-FIFO is less than this register value with uart_sw_flow_con_en set to 1 it will send a Xon char."]
15 #[inline(always)]
16 pub fn xon_threshold(&self) -> XON_THRESHOLD_R {
17 XON_THRESHOLD_R::new(((self.bits >> 3) & 0x1f) as u8)
18 }
19 #[doc = "Bits 11:15 - When the data amount in Rx-FIFO is more than this register value with uart_sw_flow_con_en set to 1 it will send a Xoff char."]
20 #[inline(always)]
21 pub fn xoff_threshold(&self) -> XOFF_THRESHOLD_R {
22 XOFF_THRESHOLD_R::new(((self.bits >> 11) & 0x1f) as u8)
23 }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28 f.debug_struct("SWFC_CONF1")
29 .field("xon_threshold", &self.xon_threshold())
30 .field("xoff_threshold", &self.xoff_threshold())
31 .finish()
32 }
33}
34impl W {
35 #[doc = "Bits 3:7 - When the data amount in Rx-FIFO is less than this register value with uart_sw_flow_con_en set to 1 it will send a Xon char."]
36 #[inline(always)]
37 #[must_use]
38 pub fn xon_threshold(&mut self) -> XON_THRESHOLD_W<SWFC_CONF1_SPEC> {
39 XON_THRESHOLD_W::new(self, 3)
40 }
41 #[doc = "Bits 11:15 - When the data amount in Rx-FIFO is more than this register value with uart_sw_flow_con_en set to 1 it will send a Xoff char."]
42 #[inline(always)]
43 #[must_use]
44 pub fn xoff_threshold(&mut self) -> XOFF_THRESHOLD_W<SWFC_CONF1_SPEC> {
45 XOFF_THRESHOLD_W::new(self, 11)
46 }
47}
48#[doc = "Software flow-control character configuration\n\nYou can [`read`](crate::Reg::read) this register and get [`swfc_conf1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`swfc_conf1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
49pub struct SWFC_CONF1_SPEC;
50impl crate::RegisterSpec for SWFC_CONF1_SPEC {
51 type Ux = u32;
52}
53#[doc = "`read()` method returns [`swfc_conf1::R`](R) reader structure"]
54impl crate::Readable for SWFC_CONF1_SPEC {}
55#[doc = "`write(|w| ..)` method takes [`swfc_conf1::W`](W) writer structure"]
56impl crate::Writable for SWFC_CONF1_SPEC {
57 type Safety = crate::Unsafe;
58 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
59 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
60}
61#[doc = "`reset()` method sets SWFC_CONF1 to value 0x6000"]
62impl crate::Resettable for SWFC_CONF1_SPEC {
63 const RESET_VALUE: u32 = 0x6000;
64}