esp32s3/timg0/
rtccalicfg2.rs1#[doc = "Register `RTCCALICFG2` reader"]
2pub type R = crate::R<RTCCALICFG2_SPEC>;
3#[doc = "Register `RTCCALICFG2` writer"]
4pub type W = crate::W<RTCCALICFG2_SPEC>;
5#[doc = "Field `RTC_CALI_TIMEOUT` reader - RTC calibration timeout indicator"]
6pub type RTC_CALI_TIMEOUT_R = crate::BitReader;
7#[doc = "Field `RTC_CALI_TIMEOUT_RST_CNT` reader - Cycles that release calibration timeout reset"]
8pub type RTC_CALI_TIMEOUT_RST_CNT_R = crate::FieldReader;
9#[doc = "Field `RTC_CALI_TIMEOUT_RST_CNT` writer - Cycles that release calibration timeout reset"]
10pub type RTC_CALI_TIMEOUT_RST_CNT_W<'a, REG> = crate::FieldWriter<'a, REG, 4>;
11#[doc = "Field `RTC_CALI_TIMEOUT_THRES` reader - Threshold value for the RTC calibration timer. If the calibration timer's value exceeds this threshold, a timeout is triggered."]
12pub type RTC_CALI_TIMEOUT_THRES_R = crate::FieldReader<u32>;
13#[doc = "Field `RTC_CALI_TIMEOUT_THRES` writer - Threshold value for the RTC calibration timer. If the calibration timer's value exceeds this threshold, a timeout is triggered."]
14pub type RTC_CALI_TIMEOUT_THRES_W<'a, REG> = crate::FieldWriter<'a, REG, 25, u32>;
15impl R {
16 #[doc = "Bit 0 - RTC calibration timeout indicator"]
17 #[inline(always)]
18 pub fn rtc_cali_timeout(&self) -> RTC_CALI_TIMEOUT_R {
19 RTC_CALI_TIMEOUT_R::new((self.bits & 1) != 0)
20 }
21 #[doc = "Bits 3:6 - Cycles that release calibration timeout reset"]
22 #[inline(always)]
23 pub fn rtc_cali_timeout_rst_cnt(&self) -> RTC_CALI_TIMEOUT_RST_CNT_R {
24 RTC_CALI_TIMEOUT_RST_CNT_R::new(((self.bits >> 3) & 0x0f) as u8)
25 }
26 #[doc = "Bits 7:31 - Threshold value for the RTC calibration timer. If the calibration timer's value exceeds this threshold, a timeout is triggered."]
27 #[inline(always)]
28 pub fn rtc_cali_timeout_thres(&self) -> RTC_CALI_TIMEOUT_THRES_R {
29 RTC_CALI_TIMEOUT_THRES_R::new((self.bits >> 7) & 0x01ff_ffff)
30 }
31}
32#[cfg(feature = "impl-register-debug")]
33impl core::fmt::Debug for R {
34 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
35 f.debug_struct("RTCCALICFG2")
36 .field("rtc_cali_timeout", &self.rtc_cali_timeout())
37 .field("rtc_cali_timeout_rst_cnt", &self.rtc_cali_timeout_rst_cnt())
38 .field("rtc_cali_timeout_thres", &self.rtc_cali_timeout_thres())
39 .finish()
40 }
41}
42impl W {
43 #[doc = "Bits 3:6 - Cycles that release calibration timeout reset"]
44 #[inline(always)]
45 pub fn rtc_cali_timeout_rst_cnt(&mut self) -> RTC_CALI_TIMEOUT_RST_CNT_W<RTCCALICFG2_SPEC> {
46 RTC_CALI_TIMEOUT_RST_CNT_W::new(self, 3)
47 }
48 #[doc = "Bits 7:31 - Threshold value for the RTC calibration timer. If the calibration timer's value exceeds this threshold, a timeout is triggered."]
49 #[inline(always)]
50 pub fn rtc_cali_timeout_thres(&mut self) -> RTC_CALI_TIMEOUT_THRES_W<RTCCALICFG2_SPEC> {
51 RTC_CALI_TIMEOUT_THRES_W::new(self, 7)
52 }
53}
54#[doc = "Timer group calibration register\n\nYou can [`read`](crate::Reg::read) this register and get [`rtccalicfg2::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`rtccalicfg2::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct RTCCALICFG2_SPEC;
56impl crate::RegisterSpec for RTCCALICFG2_SPEC {
57 type Ux = u32;
58}
59#[doc = "`read()` method returns [`rtccalicfg2::R`](R) reader structure"]
60impl crate::Readable for RTCCALICFG2_SPEC {}
61#[doc = "`write(|w| ..)` method takes [`rtccalicfg2::W`](W) writer structure"]
62impl crate::Writable for RTCCALICFG2_SPEC {
63 type Safety = crate::Unsafe;
64}
65#[doc = "`reset()` method sets RTCCALICFG2 to value 0xffff_ff98"]
66impl crate::Resettable for RTCCALICFG2_SPEC {
67 const RESET_VALUE: u32 = 0xffff_ff98;
68}