Skip to main content

mcxa_pac/i3c0/
ibiext1.rs

1#[doc = "Register `IBIEXT1` reader"]
2pub type R = crate::R<Ibiext1Spec>;
3#[doc = "Register `IBIEXT1` writer"]
4pub type W = crate::W<Ibiext1Spec>;
5#[doc = "Field `CNT` reader - Count"]
6pub type CntR = crate::FieldReader;
7#[doc = "Field `CNT` writer - Count"]
8pub type CntW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
9#[doc = "Field `MAX` reader - Maximum"]
10pub type MaxR = crate::FieldReader;
11#[doc = "Field `EXT1` reader - Extra Byte 1"]
12pub type Ext1R = crate::FieldReader;
13#[doc = "Field `EXT1` writer - Extra Byte 1"]
14pub type Ext1W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
15#[doc = "Field `EXT2` reader - Extra Byte 2"]
16pub type Ext2R = crate::FieldReader;
17#[doc = "Field `EXT2` writer - Extra Byte 2"]
18pub type Ext2W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
19#[doc = "Field `EXT3` reader - Extra Byte 3"]
20pub type Ext3R = crate::FieldReader;
21#[doc = "Field `EXT3` writer - Extra Byte 3"]
22pub type Ext3W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
23impl R {
24    #[doc = "Bits 0:2 - Count"]
25    #[inline(always)]
26    pub fn cnt(&self) -> CntR {
27        CntR::new((self.bits & 7) as u8)
28    }
29    #[doc = "Bits 4:6 - Maximum"]
30    #[inline(always)]
31    pub fn max(&self) -> MaxR {
32        MaxR::new(((self.bits >> 4) & 7) as u8)
33    }
34    #[doc = "Bits 8:15 - Extra Byte 1"]
35    #[inline(always)]
36    pub fn ext1(&self) -> Ext1R {
37        Ext1R::new(((self.bits >> 8) & 0xff) as u8)
38    }
39    #[doc = "Bits 16:23 - Extra Byte 2"]
40    #[inline(always)]
41    pub fn ext2(&self) -> Ext2R {
42        Ext2R::new(((self.bits >> 16) & 0xff) as u8)
43    }
44    #[doc = "Bits 24:31 - Extra Byte 3"]
45    #[inline(always)]
46    pub fn ext3(&self) -> Ext3R {
47        Ext3R::new(((self.bits >> 24) & 0xff) as u8)
48    }
49}
50#[cfg(feature = "debug")]
51impl core::fmt::Debug for R {
52    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
53        f.debug_struct("IBIEXT1")
54            .field("cnt", &self.cnt())
55            .field("max", &self.max())
56            .field("ext1", &self.ext1())
57            .field("ext2", &self.ext2())
58            .field("ext3", &self.ext3())
59            .finish()
60    }
61}
62impl W {
63    #[doc = "Bits 0:2 - Count"]
64    #[inline(always)]
65    pub fn cnt(&mut self) -> CntW<'_, Ibiext1Spec> {
66        CntW::new(self, 0)
67    }
68    #[doc = "Bits 8:15 - Extra Byte 1"]
69    #[inline(always)]
70    pub fn ext1(&mut self) -> Ext1W<'_, Ibiext1Spec> {
71        Ext1W::new(self, 8)
72    }
73    #[doc = "Bits 16:23 - Extra Byte 2"]
74    #[inline(always)]
75    pub fn ext2(&mut self) -> Ext2W<'_, Ibiext1Spec> {
76        Ext2W::new(self, 16)
77    }
78    #[doc = "Bits 24:31 - Extra Byte 3"]
79    #[inline(always)]
80    pub fn ext3(&mut self) -> Ext3W<'_, Ibiext1Spec> {
81        Ext3W::new(self, 24)
82    }
83}
84#[doc = "Extended IBI Data 1\n\nYou can [`read`](crate::Reg::read) this register and get [`ibiext1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ibiext1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
85pub struct Ibiext1Spec;
86impl crate::RegisterSpec for Ibiext1Spec {
87    type Ux = u32;
88}
89#[doc = "`read()` method returns [`ibiext1::R`](R) reader structure"]
90impl crate::Readable for Ibiext1Spec {}
91#[doc = "`write(|w| ..)` method takes [`ibiext1::W`](W) writer structure"]
92impl crate::Writable for Ibiext1Spec {
93    type Safety = crate::Unsafe;
94}
95#[doc = "`reset()` method sets IBIEXT1 to value 0x70"]
96impl crate::Resettable for Ibiext1Spec {
97    const RESET_VALUE: u32 = 0x70;
98}