xmc4400/scu_hibernate/
lpacth0.rs

1#[doc = "Register `LPACTH0` reader"]
2pub type R = crate::R<LPACTH0_SPEC>;
3#[doc = "Register `LPACTH0` writer"]
4pub type W = crate::W<LPACTH0_SPEC>;
5#[doc = "Field `VBATLO` reader - VBAT Lower Threshold Value"]
6pub type VBATLO_R = crate::FieldReader;
7#[doc = "Field `VBATLO` writer - VBAT Lower Threshold Value"]
8pub type VBATLO_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
9#[doc = "Field `VBATHI` reader - VBAT Upper Threshold Value"]
10pub type VBATHI_R = crate::FieldReader;
11#[doc = "Field `VBATHI` writer - VBAT Upper Threshold Value"]
12pub type VBATHI_W<'a, REG> = crate::FieldWriter<'a, REG, 6>;
13impl R {
14    #[doc = "Bits 0:5 - VBAT Lower Threshold Value"]
15    #[inline(always)]
16    pub fn vbatlo(&self) -> VBATLO_R {
17        VBATLO_R::new((self.bits & 0x3f) as u8)
18    }
19    #[doc = "Bits 8:13 - VBAT Upper Threshold Value"]
20    #[inline(always)]
21    pub fn vbathi(&self) -> VBATHI_R {
22        VBATHI_R::new(((self.bits >> 8) & 0x3f) as u8)
23    }
24}
25impl W {
26    #[doc = "Bits 0:5 - VBAT Lower Threshold Value"]
27    #[inline(always)]
28    pub fn vbatlo(&mut self) -> VBATLO_W<LPACTH0_SPEC> {
29        VBATLO_W::new(self, 0)
30    }
31    #[doc = "Bits 8:13 - VBAT Upper Threshold Value"]
32    #[inline(always)]
33    pub fn vbathi(&mut self) -> VBATHI_W<LPACTH0_SPEC> {
34        VBATHI_W::new(self, 8)
35    }
36}
37#[doc = "LPAC Threshold Register 0\n\nYou can [`read`](crate::Reg::read) this register and get [`lpacth0::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`lpacth0::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct LPACTH0_SPEC;
39impl crate::RegisterSpec for LPACTH0_SPEC {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [`lpacth0::R`](R) reader structure"]
43impl crate::Readable for LPACTH0_SPEC {}
44#[doc = "`write(|w| ..)` method takes [`lpacth0::W`](W) writer structure"]
45impl crate::Writable for LPACTH0_SPEC {
46    type Safety = crate::Unsafe;
47    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
48    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
49}
50#[doc = "`reset()` method sets LPACTH0 to value 0"]
51impl crate::Resettable for LPACTH0_SPEC {
52    const RESET_VALUE: u32 = 0;
53}