esp32c6_lp/lp_uart/
conf1.rs

1#[doc = "Register `CONF1` reader"]
2pub type R = crate::R<CONF1_SPEC>;
3#[doc = "Register `CONF1` writer"]
4pub type W = crate::W<CONF1_SPEC>;
5#[doc = "Field `RXFIFO_FULL_THRHD` reader - It will produce rxfifo_full_int interrupt when receiver receives more data than this register value."]
6pub type RXFIFO_FULL_THRHD_R = crate::FieldReader;
7#[doc = "Field `RXFIFO_FULL_THRHD` writer - It will produce rxfifo_full_int interrupt when receiver receives more data than this register value."]
8pub type RXFIFO_FULL_THRHD_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
9#[doc = "Field `TXFIFO_EMPTY_THRHD` reader - It will produce txfifo_empty_int interrupt when the data amount in Tx-FIFO is less than this register value."]
10pub type TXFIFO_EMPTY_THRHD_R = crate::FieldReader;
11#[doc = "Field `TXFIFO_EMPTY_THRHD` writer - It will produce txfifo_empty_int interrupt when the data amount in Tx-FIFO is less than this register value."]
12pub type TXFIFO_EMPTY_THRHD_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
13#[doc = "Field `CTS_INV` reader - Set this bit to inverse the level value of uart cts signal."]
14pub type CTS_INV_R = crate::BitReader;
15#[doc = "Field `CTS_INV` writer - Set this bit to inverse the level value of uart cts signal."]
16pub type CTS_INV_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DSR_INV` reader - Set this bit to inverse the level value of uart dsr signal."]
18pub type DSR_INV_R = crate::BitReader;
19#[doc = "Field `DSR_INV` writer - Set this bit to inverse the level value of uart dsr signal."]
20pub type DSR_INV_W<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `RTS_INV` reader - Set this bit to inverse the level value of uart rts signal."]
22pub type RTS_INV_R = crate::BitReader;
23#[doc = "Field `RTS_INV` writer - Set this bit to inverse the level value of uart rts signal."]
24pub type RTS_INV_W<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `DTR_INV` reader - Set this bit to inverse the level value of uart dtr signal."]
26pub type DTR_INV_R = crate::BitReader;
27#[doc = "Field `DTR_INV` writer - Set this bit to inverse the level value of uart dtr signal."]
28pub type DTR_INV_W<'a, REG> = crate::BitWriter<'a, REG>;
29#[doc = "Field `SW_DTR` reader - This register is used to configure the software dtr signal which is used in software flow control."]
30pub type SW_DTR_R = crate::BitReader;
31#[doc = "Field `SW_DTR` writer - This register is used to configure the software dtr signal which is used in software flow control."]
32pub type SW_DTR_W<'a, REG> = crate::BitWriter<'a, REG>;
33#[doc = "Field `CLK_EN` reader - 1'h1: Force clock on for register. 1'h0: Support clock only when application writes registers."]
34pub type CLK_EN_R = crate::BitReader;
35#[doc = "Field `CLK_EN` writer - 1'h1: Force clock on for register. 1'h0: Support clock only when application writes registers."]
36pub type CLK_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
37impl R {
38    #[doc = "Bits 3:7 - It will produce rxfifo_full_int interrupt when receiver receives more data than this register value."]
39    #[inline(always)]
40    pub fn rxfifo_full_thrhd(&self) -> RXFIFO_FULL_THRHD_R {
41        RXFIFO_FULL_THRHD_R::new(((self.bits >> 3) & 0x1f) as u8)
42    }
43    #[doc = "Bits 11:15 - It will produce txfifo_empty_int interrupt when the data amount in Tx-FIFO is less than this register value."]
44    #[inline(always)]
45    pub fn txfifo_empty_thrhd(&self) -> TXFIFO_EMPTY_THRHD_R {
46        TXFIFO_EMPTY_THRHD_R::new(((self.bits >> 11) & 0x1f) as u8)
47    }
48    #[doc = "Bit 16 - Set this bit to inverse the level value of uart cts signal."]
49    #[inline(always)]
50    pub fn cts_inv(&self) -> CTS_INV_R {
51        CTS_INV_R::new(((self.bits >> 16) & 1) != 0)
52    }
53    #[doc = "Bit 17 - Set this bit to inverse the level value of uart dsr signal."]
54    #[inline(always)]
55    pub fn dsr_inv(&self) -> DSR_INV_R {
56        DSR_INV_R::new(((self.bits >> 17) & 1) != 0)
57    }
58    #[doc = "Bit 18 - Set this bit to inverse the level value of uart rts signal."]
59    #[inline(always)]
60    pub fn rts_inv(&self) -> RTS_INV_R {
61        RTS_INV_R::new(((self.bits >> 18) & 1) != 0)
62    }
63    #[doc = "Bit 19 - Set this bit to inverse the level value of uart dtr signal."]
64    #[inline(always)]
65    pub fn dtr_inv(&self) -> DTR_INV_R {
66        DTR_INV_R::new(((self.bits >> 19) & 1) != 0)
67    }
68    #[doc = "Bit 20 - This register is used to configure the software dtr signal which is used in software flow control."]
69    #[inline(always)]
70    pub fn sw_dtr(&self) -> SW_DTR_R {
71        SW_DTR_R::new(((self.bits >> 20) & 1) != 0)
72    }
73    #[doc = "Bit 21 - 1'h1: Force clock on for register. 1'h0: Support clock only when application writes registers."]
74    #[inline(always)]
75    pub fn clk_en(&self) -> CLK_EN_R {
76        CLK_EN_R::new(((self.bits >> 21) & 1) != 0)
77    }
78}
79#[cfg(feature = "impl-register-debug")]
80impl core::fmt::Debug for R {
81    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
82        f.debug_struct("CONF1")
83            .field("rxfifo_full_thrhd", &self.rxfifo_full_thrhd())
84            .field("txfifo_empty_thrhd", &self.txfifo_empty_thrhd())
85            .field("cts_inv", &self.cts_inv())
86            .field("dsr_inv", &self.dsr_inv())
87            .field("rts_inv", &self.rts_inv())
88            .field("dtr_inv", &self.dtr_inv())
89            .field("sw_dtr", &self.sw_dtr())
90            .field("clk_en", &self.clk_en())
91            .finish()
92    }
93}
94impl W {
95    #[doc = "Bits 3:7 - It will produce rxfifo_full_int interrupt when receiver receives more data than this register value."]
96    #[inline(always)]
97    #[must_use]
98    pub fn rxfifo_full_thrhd(&mut self) -> RXFIFO_FULL_THRHD_W<CONF1_SPEC> {
99        RXFIFO_FULL_THRHD_W::new(self, 3)
100    }
101    #[doc = "Bits 11:15 - It will produce txfifo_empty_int interrupt when the data amount in Tx-FIFO is less than this register value."]
102    #[inline(always)]
103    #[must_use]
104    pub fn txfifo_empty_thrhd(&mut self) -> TXFIFO_EMPTY_THRHD_W<CONF1_SPEC> {
105        TXFIFO_EMPTY_THRHD_W::new(self, 11)
106    }
107    #[doc = "Bit 16 - Set this bit to inverse the level value of uart cts signal."]
108    #[inline(always)]
109    #[must_use]
110    pub fn cts_inv(&mut self) -> CTS_INV_W<CONF1_SPEC> {
111        CTS_INV_W::new(self, 16)
112    }
113    #[doc = "Bit 17 - Set this bit to inverse the level value of uart dsr signal."]
114    #[inline(always)]
115    #[must_use]
116    pub fn dsr_inv(&mut self) -> DSR_INV_W<CONF1_SPEC> {
117        DSR_INV_W::new(self, 17)
118    }
119    #[doc = "Bit 18 - Set this bit to inverse the level value of uart rts signal."]
120    #[inline(always)]
121    #[must_use]
122    pub fn rts_inv(&mut self) -> RTS_INV_W<CONF1_SPEC> {
123        RTS_INV_W::new(self, 18)
124    }
125    #[doc = "Bit 19 - Set this bit to inverse the level value of uart dtr signal."]
126    #[inline(always)]
127    #[must_use]
128    pub fn dtr_inv(&mut self) -> DTR_INV_W<CONF1_SPEC> {
129        DTR_INV_W::new(self, 19)
130    }
131    #[doc = "Bit 20 - This register is used to configure the software dtr signal which is used in software flow control."]
132    #[inline(always)]
133    #[must_use]
134    pub fn sw_dtr(&mut self) -> SW_DTR_W<CONF1_SPEC> {
135        SW_DTR_W::new(self, 20)
136    }
137    #[doc = "Bit 21 - 1'h1: Force clock on for register. 1'h0: Support clock only when application writes registers."]
138    #[inline(always)]
139    #[must_use]
140    pub fn clk_en(&mut self) -> CLK_EN_W<CONF1_SPEC> {
141        CLK_EN_W::new(self, 21)
142    }
143}
144#[doc = "Configuration register 1\n\nYou can [`read`](crate::Reg::read) this register and get [`conf1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`conf1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
145pub struct CONF1_SPEC;
146impl crate::RegisterSpec for CONF1_SPEC {
147    type Ux = u32;
148}
149#[doc = "`read()` method returns [`conf1::R`](R) reader structure"]
150impl crate::Readable for CONF1_SPEC {}
151#[doc = "`write(|w| ..)` method takes [`conf1::W`](W) writer structure"]
152impl crate::Writable for CONF1_SPEC {
153    type Safety = crate::Unsafe;
154    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
155    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
156}
157#[doc = "`reset()` method sets CONF1 to value 0x6060"]
158impl crate::Resettable for CONF1_SPEC {
159    const RESET_VALUE: u32 = 0x6060;
160}