esp32s2/rtc_cntl/
timer3.rs

1#[doc = "Register `TIMER3` reader"]
2pub type R = crate::R<TIMER3_SPEC>;
3#[doc = "Register `TIMER3` writer"]
4pub type W = crate::W<TIMER3_SPEC>;
5#[doc = "Field `WIFI_WAIT_TIMER` reader - "]
6pub type WIFI_WAIT_TIMER_R = crate::FieldReader<u16>;
7#[doc = "Field `WIFI_WAIT_TIMER` writer - "]
8pub type WIFI_WAIT_TIMER_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>;
9#[doc = "Field `WIFI_POWERUP_TIMER` reader - "]
10pub type WIFI_POWERUP_TIMER_R = crate::FieldReader;
11#[doc = "Field `WIFI_POWERUP_TIMER` writer - "]
12pub type WIFI_POWERUP_TIMER_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
13#[doc = "Field `ROM_RAM_WAIT_TIMER` reader - "]
14pub type ROM_RAM_WAIT_TIMER_R = crate::FieldReader<u16>;
15#[doc = "Field `ROM_RAM_WAIT_TIMER` writer - "]
16pub type ROM_RAM_WAIT_TIMER_W<'a, REG> = crate::FieldWriter<'a, REG, 9, u16>;
17#[doc = "Field `ROM_RAM_POWERUP_TIMER` reader - "]
18pub type ROM_RAM_POWERUP_TIMER_R = crate::FieldReader;
19#[doc = "Field `ROM_RAM_POWERUP_TIMER` writer - "]
20pub type ROM_RAM_POWERUP_TIMER_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
21impl R {
22    #[doc = "Bits 0:8"]
23    #[inline(always)]
24    pub fn wifi_wait_timer(&self) -> WIFI_WAIT_TIMER_R {
25        WIFI_WAIT_TIMER_R::new((self.bits & 0x01ff) as u16)
26    }
27    #[doc = "Bits 9:15"]
28    #[inline(always)]
29    pub fn wifi_powerup_timer(&self) -> WIFI_POWERUP_TIMER_R {
30        WIFI_POWERUP_TIMER_R::new(((self.bits >> 9) & 0x7f) as u8)
31    }
32    #[doc = "Bits 16:24"]
33    #[inline(always)]
34    pub fn rom_ram_wait_timer(&self) -> ROM_RAM_WAIT_TIMER_R {
35        ROM_RAM_WAIT_TIMER_R::new(((self.bits >> 16) & 0x01ff) as u16)
36    }
37    #[doc = "Bits 25:31"]
38    #[inline(always)]
39    pub fn rom_ram_powerup_timer(&self) -> ROM_RAM_POWERUP_TIMER_R {
40        ROM_RAM_POWERUP_TIMER_R::new(((self.bits >> 25) & 0x7f) as u8)
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("TIMER3")
47            .field("wifi_wait_timer", &self.wifi_wait_timer())
48            .field("wifi_powerup_timer", &self.wifi_powerup_timer())
49            .field("rom_ram_wait_timer", &self.rom_ram_wait_timer())
50            .field("rom_ram_powerup_timer", &self.rom_ram_powerup_timer())
51            .finish()
52    }
53}
54impl W {
55    #[doc = "Bits 0:8"]
56    #[inline(always)]
57    pub fn wifi_wait_timer(&mut self) -> WIFI_WAIT_TIMER_W<TIMER3_SPEC> {
58        WIFI_WAIT_TIMER_W::new(self, 0)
59    }
60    #[doc = "Bits 9:15"]
61    #[inline(always)]
62    pub fn wifi_powerup_timer(&mut self) -> WIFI_POWERUP_TIMER_W<TIMER3_SPEC> {
63        WIFI_POWERUP_TIMER_W::new(self, 9)
64    }
65    #[doc = "Bits 16:24"]
66    #[inline(always)]
67    pub fn rom_ram_wait_timer(&mut self) -> ROM_RAM_WAIT_TIMER_W<TIMER3_SPEC> {
68        ROM_RAM_WAIT_TIMER_W::new(self, 16)
69    }
70    #[doc = "Bits 25:31"]
71    #[inline(always)]
72    pub fn rom_ram_powerup_timer(&mut self) -> ROM_RAM_POWERUP_TIMER_W<TIMER3_SPEC> {
73        ROM_RAM_POWERUP_TIMER_W::new(self, 25)
74    }
75}
76#[doc = "configure some wait time for power on\n\nYou can [`read`](crate::Reg::read) this register and get [`timer3::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`timer3::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
77pub struct TIMER3_SPEC;
78impl crate::RegisterSpec for TIMER3_SPEC {
79    type Ux = u32;
80}
81#[doc = "`read()` method returns [`timer3::R`](R) reader structure"]
82impl crate::Readable for TIMER3_SPEC {}
83#[doc = "`write(|w| ..)` method takes [`timer3::W`](W) writer structure"]
84impl crate::Writable for TIMER3_SPEC {
85    type Safety = crate::Unsafe;
86    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
87    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
88}
89#[doc = "`reset()` method sets TIMER3 to value 0x1416_0a08"]
90impl crate::Resettable for TIMER3_SPEC {
91    const RESET_VALUE: u32 = 0x1416_0a08;
92}