esp32p4/isp/
ae_monitor.rs

1#[doc = "Register `AE_MONITOR` reader"]
2pub type R = crate::R<AE_MONITOR_SPEC>;
3#[doc = "Register `AE_MONITOR` writer"]
4pub type W = crate::W<AE_MONITOR_SPEC>;
5#[doc = "Field `TL` reader - this field configures the lower lum threshold of ae monitor"]
6pub type TL_R = crate::FieldReader;
7#[doc = "Field `TL` writer - this field configures the lower lum threshold of ae monitor"]
8pub type TL_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `TH` reader - this field configures the higher lum threshold of ae monitor"]
10pub type TH_R = crate::FieldReader;
11#[doc = "Field `TH` writer - this field configures the higher lum threshold of ae monitor"]
12pub type TH_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `PERIOD` reader - this field cnfigures ae monitor frame period"]
14pub type PERIOD_R = crate::FieldReader;
15#[doc = "Field `PERIOD` writer - this field cnfigures ae monitor frame period"]
16pub type PERIOD_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
17impl R {
18    #[doc = "Bits 0:7 - this field configures the lower lum threshold of ae monitor"]
19    #[inline(always)]
20    pub fn tl(&self) -> TL_R {
21        TL_R::new((self.bits & 0xff) as u8)
22    }
23    #[doc = "Bits 8:15 - this field configures the higher lum threshold of ae monitor"]
24    #[inline(always)]
25    pub fn th(&self) -> TH_R {
26        TH_R::new(((self.bits >> 8) & 0xff) as u8)
27    }
28    #[doc = "Bits 16:21 - this field cnfigures ae monitor frame period"]
29    #[inline(always)]
30    pub fn period(&self) -> PERIOD_R {
31        PERIOD_R::new(((self.bits >> 16) & 0x3f) as u8)
32    }
33}
34#[cfg(feature = "impl-register-debug")]
35impl core::fmt::Debug for R {
36    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
37        f.debug_struct("AE_MONITOR")
38            .field("tl", &format_args!("{}", self.tl().bits()))
39            .field("th", &format_args!("{}", self.th().bits()))
40            .field("period", &format_args!("{}", self.period().bits()))
41            .finish()
42    }
43}
44#[cfg(feature = "impl-register-debug")]
45impl core::fmt::Debug for crate::generic::Reg<AE_MONITOR_SPEC> {
46    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
47        core::fmt::Debug::fmt(&self.read(), f)
48    }
49}
50impl W {
51    #[doc = "Bits 0:7 - this field configures the lower lum threshold of ae monitor"]
52    #[inline(always)]
53    #[must_use]
54    pub fn tl(&mut self) -> TL_W<AE_MONITOR_SPEC> {
55        TL_W::new(self, 0)
56    }
57    #[doc = "Bits 8:15 - this field configures the higher lum threshold of ae monitor"]
58    #[inline(always)]
59    #[must_use]
60    pub fn th(&mut self) -> TH_W<AE_MONITOR_SPEC> {
61        TH_W::new(self, 8)
62    }
63    #[doc = "Bits 16:21 - this field cnfigures ae monitor frame period"]
64    #[inline(always)]
65    #[must_use]
66    pub fn period(&mut self) -> PERIOD_W<AE_MONITOR_SPEC> {
67        PERIOD_W::new(self, 16)
68    }
69}
70#[doc = "ae monitor control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ae_monitor::R`](R).  You can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero) this register using [`ae_monitor::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
71pub struct AE_MONITOR_SPEC;
72impl crate::RegisterSpec for AE_MONITOR_SPEC {
73    type Ux = u32;
74}
75#[doc = "`read()` method returns [`ae_monitor::R`](R) reader structure"]
76impl crate::Readable for AE_MONITOR_SPEC {}
77#[doc = "`write(|w| ..)` method takes [`ae_monitor::W`](W) writer structure"]
78impl crate::Writable for AE_MONITOR_SPEC {
79    type Safety = crate::Unsafe;
80    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
82}
83#[doc = "`reset()` method sets AE_MONITOR to value 0"]
84impl crate::Resettable for AE_MONITOR_SPEC {
85    const RESET_VALUE: u32 = 0;
86}