esp32h2/twai0/
eco_cfg.rs

1#[doc = "Register `ECO_CFG` reader"]
2pub type R = crate::R<ECO_CFG_SPEC>;
3#[doc = "Register `ECO_CFG` writer"]
4pub type W = crate::W<ECO_CFG_SPEC>;
5#[doc = "Field `RDN_ENA` reader - Enable eco module."]
6pub type RDN_ENA_R = crate::BitReader;
7#[doc = "Field `RDN_ENA` writer - Enable eco module."]
8pub type RDN_ENA_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `RDN_RESULT` reader - Output of eco module."]
10pub type RDN_RESULT_R = crate::BitReader;
11impl R {
12    #[doc = "Bit 0 - Enable eco module."]
13    #[inline(always)]
14    pub fn rdn_ena(&self) -> RDN_ENA_R {
15        RDN_ENA_R::new((self.bits & 1) != 0)
16    }
17    #[doc = "Bit 1 - Output of eco module."]
18    #[inline(always)]
19    pub fn rdn_result(&self) -> RDN_RESULT_R {
20        RDN_RESULT_R::new(((self.bits >> 1) & 1) != 0)
21    }
22}
23#[cfg(feature = "impl-register-debug")]
24impl core::fmt::Debug for R {
25    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
26        f.debug_struct("ECO_CFG")
27            .field("rdn_ena", &self.rdn_ena())
28            .field("rdn_result", &self.rdn_result())
29            .finish()
30    }
31}
32impl W {
33    #[doc = "Bit 0 - Enable eco module."]
34    #[inline(always)]
35    pub fn rdn_ena(&mut self) -> RDN_ENA_W<ECO_CFG_SPEC> {
36        RDN_ENA_W::new(self, 0)
37    }
38}
39#[doc = "ECO configuration register.\n\nYou can [`read`](crate::Reg::read) this register and get [`eco_cfg::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`eco_cfg::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct ECO_CFG_SPEC;
41impl crate::RegisterSpec for ECO_CFG_SPEC {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`eco_cfg::R`](R) reader structure"]
45impl crate::Readable for ECO_CFG_SPEC {}
46#[doc = "`write(|w| ..)` method takes [`eco_cfg::W`](W) writer structure"]
47impl crate::Writable for ECO_CFG_SPEC {
48    type Safety = crate::Unsafe;
49    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
50    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
51}
52#[doc = "`reset()` method sets ECO_CFG to value 0x02"]
53impl crate::Resettable for ECO_CFG_SPEC {
54    const RESET_VALUE: u32 = 0x02;
55}