xmc4300/usb0/
pcgcctl.rs

1#[doc = "Register `PCGCCTL` reader"]
2pub type R = crate::R<PCGCCTL_SPEC>;
3#[doc = "Register `PCGCCTL` writer"]
4pub type W = crate::W<PCGCCTL_SPEC>;
5#[doc = "Field `StopPclk` reader - Stop Pclk"]
6pub type STOP_PCLK_R = crate::BitReader;
7#[doc = "Field `StopPclk` writer - Stop Pclk"]
8pub type STOP_PCLK_W<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `GateHclk` reader - Gate Hclk"]
10pub type GATE_HCLK_R = crate::BitReader;
11#[doc = "Field `GateHclk` writer - Gate Hclk"]
12pub type GATE_HCLK_W<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - Stop Pclk"]
15    #[inline(always)]
16    pub fn stop_pclk(&self) -> STOP_PCLK_R {
17        STOP_PCLK_R::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - Gate Hclk"]
20    #[inline(always)]
21    pub fn gate_hclk(&self) -> GATE_HCLK_R {
22        GATE_HCLK_R::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25impl W {
26    #[doc = "Bit 0 - Stop Pclk"]
27    #[inline(always)]
28    pub fn stop_pclk(&mut self) -> STOP_PCLK_W<PCGCCTL_SPEC> {
29        STOP_PCLK_W::new(self, 0)
30    }
31    #[doc = "Bit 1 - Gate Hclk"]
32    #[inline(always)]
33    pub fn gate_hclk(&mut self) -> GATE_HCLK_W<PCGCCTL_SPEC> {
34        GATE_HCLK_W::new(self, 1)
35    }
36}
37#[doc = "Power and Clock Gating Control Register\n\nYou can [`read`](crate::Reg::read) this register and get [`pcgcctl::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`pcgcctl::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
38pub struct PCGCCTL_SPEC;
39impl crate::RegisterSpec for PCGCCTL_SPEC {
40    type Ux = u32;
41}
42#[doc = "`read()` method returns [`pcgcctl::R`](R) reader structure"]
43impl crate::Readable for PCGCCTL_SPEC {}
44#[doc = "`write(|w| ..)` method takes [`pcgcctl::W`](W) writer structure"]
45impl crate::Writable for PCGCCTL_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 PCGCCTL to value 0x0100"]
51impl crate::Resettable for PCGCCTL_SPEC {
52    const RESET_VALUE: u32 = 0x0100;
53}