esp32p4/i3c_mst_mem/
dev_addr_table6_loc.rs

1#[doc = "Register `DEV_ADDR_TABLE6_LOC` reader"]
2pub type R = crate::R<DEV_ADDR_TABLE6_LOC_SPEC>;
3#[doc = "Register `DEV_ADDR_TABLE6_LOC` writer"]
4pub type W = crate::W<DEV_ADDR_TABLE6_LOC_SPEC>;
5#[doc = "Field `REG_DAT_DEV6_STATIC_ADDR` reader - NA"]
6pub type REG_DAT_DEV6_STATIC_ADDR_R = crate::FieldReader;
7#[doc = "Field `REG_DAT_DEV6_STATIC_ADDR` writer - NA"]
8pub type REG_DAT_DEV6_STATIC_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
9#[doc = "Field `REG_DAT_DEV6_DYNAMIC_ADDR` reader - Device Dynamic Address with parity, The MSB,bit\\[23\\], should be programmed with parity of dynamic address."]
10pub type REG_DAT_DEV6_DYNAMIC_ADDR_R = crate::FieldReader;
11#[doc = "Field `REG_DAT_DEV6_DYNAMIC_ADDR` writer - Device Dynamic Address with parity, The MSB,bit\\[23\\], should be programmed with parity of dynamic address."]
12pub type REG_DAT_DEV6_DYNAMIC_ADDR_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `REG_DAT_DEV6_NACK_RETRY_CNT` reader - This field is used to set the Device NACK Retry count for the particular device. If the Device NACK's for the device address, the controller automatically retries the same device until this count expires. If the Slave does not ACK for the mentioned number of retries, then controller generates an error response and move to the Halt state."]
14pub type REG_DAT_DEV6_NACK_RETRY_CNT_R = crate::FieldReader;
15#[doc = "Field `REG_DAT_DEV6_NACK_RETRY_CNT` writer - This field is used to set the Device NACK Retry count for the particular device. If the Device NACK's for the device address, the controller automatically retries the same device until this count expires. If the Slave does not ACK for the mentioned number of retries, then controller generates an error response and move to the Halt state."]
16pub type REG_DAT_DEV6_NACK_RETRY_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17#[doc = "Field `REG_DAT_DEV6_I2C` reader - Legacy I2C device or not. This bit should be set to 1 if the device is a legacy I2C device."]
18pub type REG_DAT_DEV6_I2C_R = crate::BitReader;
19#[doc = "Field `REG_DAT_DEV6_I2C` writer - Legacy I2C device or not. This bit should be set to 1 if the device is a legacy I2C device."]
20pub type REG_DAT_DEV6_I2C_W<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bits 0:6 - NA"]
23    #[inline(always)]
24    pub fn reg_dat_dev6_static_addr(&self) -> REG_DAT_DEV6_STATIC_ADDR_R {
25        REG_DAT_DEV6_STATIC_ADDR_R::new((self.bits & 0x7f) as u8)
26    }
27    #[doc = "Bits 16:23 - Device Dynamic Address with parity, The MSB,bit\\[23\\], should be programmed with parity of dynamic address."]
28    #[inline(always)]
29    pub fn reg_dat_dev6_dynamic_addr(&self) -> REG_DAT_DEV6_DYNAMIC_ADDR_R {
30        REG_DAT_DEV6_DYNAMIC_ADDR_R::new(((self.bits >> 16) & 0xff) as u8)
31    }
32    #[doc = "Bits 29:30 - This field is used to set the Device NACK Retry count for the particular device. If the Device NACK's for the device address, the controller automatically retries the same device until this count expires. If the Slave does not ACK for the mentioned number of retries, then controller generates an error response and move to the Halt state."]
33    #[inline(always)]
34    pub fn reg_dat_dev6_nack_retry_cnt(&self) -> REG_DAT_DEV6_NACK_RETRY_CNT_R {
35        REG_DAT_DEV6_NACK_RETRY_CNT_R::new(((self.bits >> 29) & 3) as u8)
36    }
37    #[doc = "Bit 31 - Legacy I2C device or not. This bit should be set to 1 if the device is a legacy I2C device."]
38    #[inline(always)]
39    pub fn reg_dat_dev6_i2c(&self) -> REG_DAT_DEV6_I2C_R {
40        REG_DAT_DEV6_I2C_R::new(((self.bits >> 31) & 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("DEV_ADDR_TABLE6_LOC")
47            .field(
48                "reg_dat_dev6_static_addr",
49                &format_args!("{}", self.reg_dat_dev6_static_addr().bits()),
50            )
51            .field(
52                "reg_dat_dev6_dynamic_addr",
53                &format_args!("{}", self.reg_dat_dev6_dynamic_addr().bits()),
54            )
55            .field(
56                "reg_dat_dev6_nack_retry_cnt",
57                &format_args!("{}", self.reg_dat_dev6_nack_retry_cnt().bits()),
58            )
59            .field(
60                "reg_dat_dev6_i2c",
61                &format_args!("{}", self.reg_dat_dev6_i2c().bit()),
62            )
63            .finish()
64    }
65}
66#[cfg(feature = "impl-register-debug")]
67impl core::fmt::Debug for crate::generic::Reg<DEV_ADDR_TABLE6_LOC_SPEC> {
68    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
69        core::fmt::Debug::fmt(&self.read(), f)
70    }
71}
72impl W {
73    #[doc = "Bits 0:6 - NA"]
74    #[inline(always)]
75    #[must_use]
76    pub fn reg_dat_dev6_static_addr(
77        &mut self,
78    ) -> REG_DAT_DEV6_STATIC_ADDR_W<DEV_ADDR_TABLE6_LOC_SPEC> {
79        REG_DAT_DEV6_STATIC_ADDR_W::new(self, 0)
80    }
81    #[doc = "Bits 16:23 - Device Dynamic Address with parity, The MSB,bit\\[23\\], should be programmed with parity of dynamic address."]
82    #[inline(always)]
83    #[must_use]
84    pub fn reg_dat_dev6_dynamic_addr(
85        &mut self,
86    ) -> REG_DAT_DEV6_DYNAMIC_ADDR_W<DEV_ADDR_TABLE6_LOC_SPEC> {
87        REG_DAT_DEV6_DYNAMIC_ADDR_W::new(self, 16)
88    }
89    #[doc = "Bits 29:30 - This field is used to set the Device NACK Retry count for the particular device. If the Device NACK's for the device address, the controller automatically retries the same device until this count expires. If the Slave does not ACK for the mentioned number of retries, then controller generates an error response and move to the Halt state."]
90    #[inline(always)]
91    #[must_use]
92    pub fn reg_dat_dev6_nack_retry_cnt(
93        &mut self,
94    ) -> REG_DAT_DEV6_NACK_RETRY_CNT_W<DEV_ADDR_TABLE6_LOC_SPEC> {
95        REG_DAT_DEV6_NACK_RETRY_CNT_W::new(self, 29)
96    }
97    #[doc = "Bit 31 - Legacy I2C device or not. This bit should be set to 1 if the device is a legacy I2C device."]
98    #[inline(always)]
99    #[must_use]
100    pub fn reg_dat_dev6_i2c(&mut self) -> REG_DAT_DEV6_I2C_W<DEV_ADDR_TABLE6_LOC_SPEC> {
101        REG_DAT_DEV6_I2C_W::new(self, 31)
102    }
103}
104#[doc = "NA\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`dev_addr_table6_loc::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`dev_addr_table6_loc::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
105pub struct DEV_ADDR_TABLE6_LOC_SPEC;
106impl crate::RegisterSpec for DEV_ADDR_TABLE6_LOC_SPEC {
107    type Ux = u32;
108}
109#[doc = "`read()` method returns [`dev_addr_table6_loc::R`](R) reader structure"]
110impl crate::Readable for DEV_ADDR_TABLE6_LOC_SPEC {}
111#[doc = "`write(|w| ..)` method takes [`dev_addr_table6_loc::W`](W) writer structure"]
112impl crate::Writable for DEV_ADDR_TABLE6_LOC_SPEC {
113    type Safety = crate::Unsafe;
114    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
115    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
116}
117#[doc = "`reset()` method sets DEV_ADDR_TABLE6_LOC to value 0"]
118impl crate::Resettable for DEV_ADDR_TABLE6_LOC_SPEC {
119    const RESET_VALUE: u32 = 0;
120}