esp32p4/isp/
ae_ctrl.rs

1#[doc = "Register `AE_CTRL` reader"]
2pub type R = crate::R<AE_CTRL_SPEC>;
3#[doc = "Register `AE_CTRL` writer"]
4pub type W = crate::W<AE_CTRL_SPEC>;
5#[doc = "Field `AE_UPDATE` writer - write 1 to this bit triggers one statistic event"]
6pub type AE_UPDATE_W<'a, REG> = crate::BitWriter<'a, REG>;
7#[doc = "Field `AE_SELECT` reader - this field configures ae input data source, 0: data from median, 1: data from gama"]
8pub type AE_SELECT_R = crate::BitReader;
9#[doc = "Field `AE_SELECT` writer - this field configures ae input data source, 0: data from median, 1: data from gama"]
10pub type AE_SELECT_W<'a, REG> = crate::BitWriter<'a, REG>;
11impl R {
12    #[doc = "Bit 1 - this field configures ae input data source, 0: data from median, 1: data from gama"]
13    #[inline(always)]
14    pub fn ae_select(&self) -> AE_SELECT_R {
15        AE_SELECT_R::new(((self.bits >> 1) & 1) != 0)
16    }
17}
18#[cfg(feature = "impl-register-debug")]
19impl core::fmt::Debug for R {
20    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
21        f.debug_struct("AE_CTRL")
22            .field("ae_select", &format_args!("{}", self.ae_select().bit()))
23            .finish()
24    }
25}
26#[cfg(feature = "impl-register-debug")]
27impl core::fmt::Debug for crate::generic::Reg<AE_CTRL_SPEC> {
28    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
29        core::fmt::Debug::fmt(&self.read(), f)
30    }
31}
32impl W {
33    #[doc = "Bit 0 - write 1 to this bit triggers one statistic event"]
34    #[inline(always)]
35    #[must_use]
36    pub fn ae_update(&mut self) -> AE_UPDATE_W<AE_CTRL_SPEC> {
37        AE_UPDATE_W::new(self, 0)
38    }
39    #[doc = "Bit 1 - this field configures ae input data source, 0: data from median, 1: data from gama"]
40    #[inline(always)]
41    #[must_use]
42    pub fn ae_select(&mut self) -> AE_SELECT_W<AE_CTRL_SPEC> {
43        AE_SELECT_W::new(self, 1)
44    }
45}
46#[doc = "ae control register\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ae_ctrl::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_ctrl::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
47pub struct AE_CTRL_SPEC;
48impl crate::RegisterSpec for AE_CTRL_SPEC {
49    type Ux = u32;
50}
51#[doc = "`read()` method returns [`ae_ctrl::R`](R) reader structure"]
52impl crate::Readable for AE_CTRL_SPEC {}
53#[doc = "`write(|w| ..)` method takes [`ae_ctrl::W`](W) writer structure"]
54impl crate::Writable for AE_CTRL_SPEC {
55    type Safety = crate::Unsafe;
56    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
57    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
58}
59#[doc = "`reset()` method sets AE_CTRL to value 0"]
60impl crate::Resettable for AE_CTRL_SPEC {
61    const RESET_VALUE: u32 = 0;
62}