esp32c3/i2c0/
scl_sp_conf.rs1#[doc = "Register `SCL_SP_CONF` reader"]
2pub type R = crate::R<SCL_SP_CONF_SPEC>;
3#[doc = "Register `SCL_SP_CONF` writer"]
4pub type W = crate::W<SCL_SP_CONF_SPEC>;
5#[doc = "Field `SCL_RST_SLV_EN` reader - reg_scl_rst_slv_en"]
6pub type SCL_RST_SLV_EN_R = crate::BitReader;
7#[doc = "Field `SCL_RST_SLV_EN` writer - reg_scl_rst_slv_en"]
8pub type SCL_RST_SLV_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `SCL_RST_SLV_NUM` reader - reg_scl_rst_slv_num"]
10pub type SCL_RST_SLV_NUM_R = crate::FieldReader;
11#[doc = "Field `SCL_RST_SLV_NUM` writer - reg_scl_rst_slv_num"]
12pub type SCL_RST_SLV_NUM_W<'a, REG> = crate::FieldWriter<'a, REG, 5>;
13#[doc = "Field `SCL_PD_EN` reader - reg_scl_pd_en"]
14pub type SCL_PD_EN_R = crate::BitReader;
15#[doc = "Field `SCL_PD_EN` writer - reg_scl_pd_en"]
16pub type SCL_PD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `SDA_PD_EN` reader - reg_sda_pd_en"]
18pub type SDA_PD_EN_R = crate::BitReader;
19#[doc = "Field `SDA_PD_EN` writer - reg_sda_pd_en"]
20pub type SDA_PD_EN_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - reg_scl_rst_slv_en"]
23    #[inline(always)]
24    pub fn scl_rst_slv_en(&self) -> SCL_RST_SLV_EN_R {
25        SCL_RST_SLV_EN_R::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bits 1:5 - reg_scl_rst_slv_num"]
28    #[inline(always)]
29    pub fn scl_rst_slv_num(&self) -> SCL_RST_SLV_NUM_R {
30        SCL_RST_SLV_NUM_R::new(((self.bits >> 1) & 0x1f) as u8)
31    }
32    #[doc = "Bit 6 - reg_scl_pd_en"]
33    #[inline(always)]
34    pub fn scl_pd_en(&self) -> SCL_PD_EN_R {
35        SCL_PD_EN_R::new(((self.bits >> 6) & 1) != 0)
36    }
37    #[doc = "Bit 7 - reg_sda_pd_en"]
38    #[inline(always)]
39    pub fn sda_pd_en(&self) -> SDA_PD_EN_R {
40        SDA_PD_EN_R::new(((self.bits >> 7) & 1) != 0)
41    }
42}
43#[cfg(feature = "impl-register-debug")]
44impl core::fmt::Debug for R {
45    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
46        f.debug_struct("SCL_SP_CONF")
47            .field("scl_rst_slv_en", &self.scl_rst_slv_en())
48            .field("scl_rst_slv_num", &self.scl_rst_slv_num())
49            .field("scl_pd_en", &self.scl_pd_en())
50            .field("sda_pd_en", &self.sda_pd_en())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bit 0 - reg_scl_rst_slv_en"]
56    #[inline(always)]
57    pub fn scl_rst_slv_en(&mut self) -> SCL_RST_SLV_EN_W<SCL_SP_CONF_SPEC> {
58        SCL_RST_SLV_EN_W::new(self, 0)
59    }
60    #[doc = "Bits 1:5 - reg_scl_rst_slv_num"]
61    #[inline(always)]
62    pub fn scl_rst_slv_num(&mut self) -> SCL_RST_SLV_NUM_W<SCL_SP_CONF_SPEC> {
63        SCL_RST_SLV_NUM_W::new(self, 1)
64    }
65    #[doc = "Bit 6 - reg_scl_pd_en"]
66    #[inline(always)]
67    pub fn scl_pd_en(&mut self) -> SCL_PD_EN_W<SCL_SP_CONF_SPEC> {
68        SCL_PD_EN_W::new(self, 6)
69    }
70    #[doc = "Bit 7 - reg_sda_pd_en"]
71    #[inline(always)]
72    pub fn sda_pd_en(&mut self) -> SDA_PD_EN_W<SCL_SP_CONF_SPEC> {
73        SDA_PD_EN_W::new(self, 7)
74    }
75}
76#[doc = "I2C_SCL_SP_CONF_REG\n\nYou can [`read`](crate::Reg::read) this register and get [`scl_sp_conf::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`scl_sp_conf::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct SCL_SP_CONF_SPEC;
78impl crate::RegisterSpec for SCL_SP_CONF_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`scl_sp_conf::R`](R) reader structure"]
82impl crate::Readable for SCL_SP_CONF_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`scl_sp_conf::W`](W) writer structure"]
84impl crate::Writable for SCL_SP_CONF_SPEC {
85    type Safety = crate::Unsafe;
86}
87#[doc = "`reset()` method sets SCL_SP_CONF to value 0"]
88impl crate::Resettable for SCL_SP_CONF_SPEC {}