esp32c6/ieee802154/
ifs.rs

1#[doc = "Register `IFS` reader"]
2pub type R = crate::R<IFS_SPEC>;
3#[doc = "Register `IFS` writer"]
4pub type W = crate::W<IFS_SPEC>;
5#[doc = "Field `SIFS` reader - "]
6pub type SIFS_R = crate::FieldReader;
7#[doc = "Field `SIFS` writer - "]
8pub type SIFS_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `LIFS` reader - "]
10pub type LIFS_R = crate::FieldReader<u16>;
11#[doc = "Field `LIFS` writer - "]
12pub type LIFS_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
13impl R {
14    #[doc = "Bits 0:7"]
15    #[inline(always)]
16    pub fn sifs(&self) -> SIFS_R {
17        SIFS_R::new((self.bits & 0xff) as u8)
18    }
19    #[doc = "Bits 16:25"]
20    #[inline(always)]
21    pub fn lifs(&self) -> LIFS_R {
22        LIFS_R::new(((self.bits >> 16) & 0x03ff) as u16)
23    }
24}
25#[cfg(feature = "impl-register-debug")]
26impl core::fmt::Debug for R {
27    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
28        f.debug_struct("IFS")
29            .field("sifs", &self.sifs())
30            .field("lifs", &self.lifs())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:7"]
36    #[inline(always)]
37    pub fn sifs(&mut self) -> SIFS_W<IFS_SPEC> {
38        SIFS_W::new(self, 0)
39    }
40    #[doc = "Bits 16:25"]
41    #[inline(always)]
42    pub fn lifs(&mut self) -> LIFS_W<IFS_SPEC> {
43        LIFS_W::new(self, 16)
44    }
45}
46#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`ifs::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`ifs::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct IFS_SPEC;
48impl crate::RegisterSpec for IFS_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`ifs::R`](R) reader structure"]
52impl crate::Readable for IFS_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`ifs::W`](W) writer structure"]
54impl crate::Writable for IFS_SPEC {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets IFS to value 0"]
58impl crate::Resettable for IFS_SPEC {}