esp32s2/usb0/
hfir.rs

1#[doc = "Register `HFIR` reader"]
2pub type R = crate::R<HFIR_SPEC>;
3#[doc = "Register `HFIR` writer"]
4pub type W = crate::W<HFIR_SPEC>;
5#[doc = "Field `FRINT` reader - "]
6pub type FRINT_R = crate::FieldReader<u16>;
7#[doc = "Field `FRINT` writer - "]
8pub type FRINT_W<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `HFIRRLDCTRL` reader - "]
10pub type HFIRRLDCTRL_R = crate::BitReader;
11#[doc = "Field `HFIRRLDCTRL` writer - "]
12pub type HFIRRLDCTRL_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bits 0:15"]
15    #[inline(always)]
16    pub fn frint(&self) -> FRINT_R {
17        FRINT_R::new((self.bits & 0xffff) as u16)
18    }
19    #[doc = "Bit 16"]
20    #[inline(always)]
21    pub fn hfirrldctrl(&self) -> HFIRRLDCTRL_R {
22        HFIRRLDCTRL_R::new(((self.bits >> 16) & 1) != 0)
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("HFIR")
29            .field("frint", &self.frint())
30            .field("hfirrldctrl", &self.hfirrldctrl())
31            .finish()
32    }
33}
34impl W {
35    #[doc = "Bits 0:15"]
36    #[inline(always)]
37    pub fn frint(&mut self) -> FRINT_W<HFIR_SPEC> {
38        FRINT_W::new(self, 0)
39    }
40    #[doc = "Bit 16"]
41    #[inline(always)]
42    pub fn hfirrldctrl(&mut self) -> HFIRRLDCTRL_W<HFIR_SPEC> {
43        HFIRRLDCTRL_W::new(self, 16)
44    }
45}
46#[doc = "\n\nYou can [`read`](crate::Reg::read) this register and get [`hfir::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hfir::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct HFIR_SPEC;
48impl crate::RegisterSpec for HFIR_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`hfir::R`](R) reader structure"]
52impl crate::Readable for HFIR_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`hfir::W`](W) writer structure"]
54impl crate::Writable for HFIR_SPEC {
55    type Safety = crate::Unsafe;
56}
57#[doc = "`reset()` method sets HFIR to value 0x17d7"]
58impl crate::Resettable for HFIR_SPEC {
59    const RESET_VALUE: u32 = 0x17d7;
60}