esp32s3_ulp/sens/
sar_slave_addr1.rs

1#[doc = "Register `SAR_SLAVE_ADDR1` reader"]
2pub type R = crate::R<SAR_SLAVE_ADDR1_SPEC>;
3#[doc = "Register `SAR_SLAVE_ADDR1` writer"]
4pub type W = crate::W<SAR_SLAVE_ADDR1_SPEC>;
5#[doc = "Field `SAR_I2C_SLAVE_ADDR1` reader - configure i2c slave address1"]
6pub type SAR_I2C_SLAVE_ADDR1_R = crate::FieldReader<u16>;
7#[doc = "Field `SAR_I2C_SLAVE_ADDR1` writer - configure i2c slave address1"]
8pub type SAR_I2C_SLAVE_ADDR1_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
9#[doc = "Field `SAR_I2C_SLAVE_ADDR0` reader - configure i2c slave address0"]
10pub type SAR_I2C_SLAVE_ADDR0_R = crate::FieldReader<u16>;
11#[doc = "Field `SAR_I2C_SLAVE_ADDR0` writer - configure i2c slave address0"]
12pub type SAR_I2C_SLAVE_ADDR0_W<'a, REG> = crate::FieldWriter<'a, REG, 11, u16>;
13#[doc = "Field `SAR_SARADC_MEAS_STATUS` reader - no public"]
14pub type SAR_SARADC_MEAS_STATUS_R = crate::FieldReader;
15impl R {
16    #[doc = "Bits 0:10 - configure i2c slave address1"]
17    #[inline(always)]
18    pub fn sar_i2c_slave_addr1(&self) -> SAR_I2C_SLAVE_ADDR1_R {
19        SAR_I2C_SLAVE_ADDR1_R::new((self.bits & 0x07ff) as u16)
20    }
21    #[doc = "Bits 11:21 - configure i2c slave address0"]
22    #[inline(always)]
23    pub fn sar_i2c_slave_addr0(&self) -> SAR_I2C_SLAVE_ADDR0_R {
24        SAR_I2C_SLAVE_ADDR0_R::new(((self.bits >> 11) & 0x07ff) as u16)
25    }
26    #[doc = "Bits 22:29 - no public"]
27    #[inline(always)]
28    pub fn sar_saradc_meas_status(&self) -> SAR_SARADC_MEAS_STATUS_R {
29        SAR_SARADC_MEAS_STATUS_R::new(((self.bits >> 22) & 0xff) as u8)
30    }
31}
32#[cfg(feature = "impl-register-debug")]
33impl core::fmt::Debug for R {
34    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
35        f.debug_struct("SAR_SLAVE_ADDR1")
36            .field("sar_i2c_slave_addr1", &self.sar_i2c_slave_addr1())
37            .field("sar_i2c_slave_addr0", &self.sar_i2c_slave_addr0())
38            .field("sar_saradc_meas_status", &self.sar_saradc_meas_status())
39            .finish()
40    }
41}
42impl W {
43    #[doc = "Bits 0:10 - configure i2c slave address1"]
44    #[inline(always)]
45    #[must_use]
46    pub fn sar_i2c_slave_addr1(&mut self) -> SAR_I2C_SLAVE_ADDR1_W<SAR_SLAVE_ADDR1_SPEC> {
47        SAR_I2C_SLAVE_ADDR1_W::new(self, 0)
48    }
49    #[doc = "Bits 11:21 - configure i2c slave address0"]
50    #[inline(always)]
51    #[must_use]
52    pub fn sar_i2c_slave_addr0(&mut self) -> SAR_I2C_SLAVE_ADDR0_W<SAR_SLAVE_ADDR1_SPEC> {
53        SAR_I2C_SLAVE_ADDR0_W::new(self, 11)
54    }
55}
56#[doc = "configure i2c slave address\n\nYou can [`read`](crate::Reg::read) this register and get [`sar_slave_addr1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`sar_slave_addr1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
57pub struct SAR_SLAVE_ADDR1_SPEC;
58impl crate::RegisterSpec for SAR_SLAVE_ADDR1_SPEC {
59    type Ux = u32;
60}
61#[doc = "`read()` method returns [`sar_slave_addr1::R`](R) reader structure"]
62impl crate::Readable for SAR_SLAVE_ADDR1_SPEC {}
63#[doc = "`write(|w| ..)` method takes [`sar_slave_addr1::W`](W) writer structure"]
64impl crate::Writable for SAR_SLAVE_ADDR1_SPEC {
65    type Safety = crate::Unsafe;
66    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
67    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
68}
69#[doc = "`reset()` method sets SAR_SLAVE_ADDR1 to value 0"]
70impl crate::Resettable for SAR_SLAVE_ADDR1_SPEC {
71    const RESET_VALUE: u32 = 0;
72}