xmc4700/scu_power/
pwrmon.rs1#[doc = "Register `PWRMON` reader"]
2pub type R = crate::R<PWRMON_SPEC>;
3#[doc = "Register `PWRMON` writer"]
4pub type W = crate::W<PWRMON_SPEC>;
5#[doc = "Field `THRS` reader - Threshold"]
6pub type THRS_R = crate::FieldReader;
7#[doc = "Field `THRS` writer - Threshold"]
8pub type THRS_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
9#[doc = "Field `INTV` reader - Interval"]
10pub type INTV_R = crate::FieldReader;
11#[doc = "Field `INTV` writer - Interval"]
12pub type INTV_W<'a, REG> = crate::FieldWriter<'a, REG, 8>;
13#[doc = "Field `ENB` reader - Enable"]
14pub type ENB_R = crate::BitReader;
15#[doc = "Field `ENB` writer - Enable"]
16pub type ENB_W<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18 #[doc = "Bits 0:7 - Threshold"]
19 #[inline(always)]
20 pub fn thrs(&self) -> THRS_R {
21 THRS_R::new((self.bits & 0xff) as u8)
22 }
23 #[doc = "Bits 8:15 - Interval"]
24 #[inline(always)]
25 pub fn intv(&self) -> INTV_R {
26 INTV_R::new(((self.bits >> 8) & 0xff) as u8)
27 }
28 #[doc = "Bit 16 - Enable"]
29 #[inline(always)]
30 pub fn enb(&self) -> ENB_R {
31 ENB_R::new(((self.bits >> 16) & 1) != 0)
32 }
33}
34impl W {
35 #[doc = "Bits 0:7 - Threshold"]
36 #[inline(always)]
37 pub fn thrs(&mut self) -> THRS_W<PWRMON_SPEC> {
38 THRS_W::new(self, 0)
39 }
40 #[doc = "Bits 8:15 - Interval"]
41 #[inline(always)]
42 pub fn intv(&mut self) -> INTV_W<PWRMON_SPEC> {
43 INTV_W::new(self, 8)
44 }
45 #[doc = "Bit 16 - Enable"]
46 #[inline(always)]
47 pub fn enb(&mut self) -> ENB_W<PWRMON_SPEC> {
48 ENB_W::new(self, 16)
49 }
50}
51#[doc = "Power Monitor Control\n\nYou can [`read`](crate::Reg::read) this register and get [`pwrmon::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pwrmon::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
52pub struct PWRMON_SPEC;
53impl crate::RegisterSpec for PWRMON_SPEC {
54 type Ux = u32;
55}
56#[doc = "`read()` method returns [`pwrmon::R`](R) reader structure"]
57impl crate::Readable for PWRMON_SPEC {}
58#[doc = "`write(|w| ..)` method takes [`pwrmon::W`](W) writer structure"]
59impl crate::Writable for PWRMON_SPEC {
60 type Safety = crate::Unsafe;
61 const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
62 const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
63}
64#[doc = "`reset()` method sets PWRMON to value 0"]
65impl crate::Resettable for PWRMON_SPEC {
66 const RESET_VALUE: u32 = 0;
67}