ht32f523x2/rstcu/
grsr.rs

1#[doc = "Register `GRSR` reader"]
2pub type R = crate::R<GrsrSpec>;
3#[doc = "Register `GRSR` writer"]
4pub type W = crate::W<GrsrSpec>;
5#[doc = "Field `NVICRSTF` reader - NVICRSTF"]
6pub type NvicrstfR = crate::BitReader;
7#[doc = "Field `NVICRSTF` writer - NVICRSTF"]
8pub type NvicrstfW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `EXTRSTF` reader - EXTRSTF"]
10pub type ExtrstfR = crate::BitReader;
11#[doc = "Field `EXTRSTF` writer - EXTRSTF"]
12pub type ExtrstfW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `WDTRSTF` reader - WDTRSTF"]
14pub type WdtrstfR = crate::BitReader;
15#[doc = "Field `WDTRSTF` writer - WDTRSTF"]
16pub type WdtrstfW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `PORSTF` reader - PORSTF"]
18pub type PorstfR = crate::BitReader;
19#[doc = "Field `PORSTF` writer - PORSTF"]
20pub type PorstfW<'a, REG> = crate::BitWriter<'a, REG>;
21impl R {
22    #[doc = "Bit 0 - NVICRSTF"]
23    #[inline(always)]
24    pub fn nvicrstf(&self) -> NvicrstfR {
25        NvicrstfR::new((self.bits & 1) != 0)
26    }
27    #[doc = "Bit 1 - EXTRSTF"]
28    #[inline(always)]
29    pub fn extrstf(&self) -> ExtrstfR {
30        ExtrstfR::new(((self.bits >> 1) & 1) != 0)
31    }
32    #[doc = "Bit 2 - WDTRSTF"]
33    #[inline(always)]
34    pub fn wdtrstf(&self) -> WdtrstfR {
35        WdtrstfR::new(((self.bits >> 2) & 1) != 0)
36    }
37    #[doc = "Bit 3 - PORSTF"]
38    #[inline(always)]
39    pub fn porstf(&self) -> PorstfR {
40        PorstfR::new(((self.bits >> 3) & 1) != 0)
41    }
42}
43impl W {
44    #[doc = "Bit 0 - NVICRSTF"]
45    #[inline(always)]
46    #[must_use]
47    pub fn nvicrstf(&mut self) -> NvicrstfW<GrsrSpec> {
48        NvicrstfW::new(self, 0)
49    }
50    #[doc = "Bit 1 - EXTRSTF"]
51    #[inline(always)]
52    #[must_use]
53    pub fn extrstf(&mut self) -> ExtrstfW<GrsrSpec> {
54        ExtrstfW::new(self, 1)
55    }
56    #[doc = "Bit 2 - WDTRSTF"]
57    #[inline(always)]
58    #[must_use]
59    pub fn wdtrstf(&mut self) -> WdtrstfW<GrsrSpec> {
60        WdtrstfW::new(self, 2)
61    }
62    #[doc = "Bit 3 - PORSTF"]
63    #[inline(always)]
64    #[must_use]
65    pub fn porstf(&mut self) -> PorstfW<GrsrSpec> {
66        PorstfW::new(self, 3)
67    }
68}
69#[doc = "GRSR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`grsr::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 [`grsr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
70pub struct GrsrSpec;
71impl crate::RegisterSpec for GrsrSpec {
72    type Ux = u32;
73}
74#[doc = "`read()` method returns [`grsr::R`](R) reader structure"]
75impl crate::Readable for GrsrSpec {}
76#[doc = "`write(|w| ..)` method takes [`grsr::W`](W) writer structure"]
77impl crate::Writable for GrsrSpec {
78    type Safety = crate::Unsafe;
79    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
80    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
81}
82#[doc = "`reset()` method sets GRSR to value 0"]
83impl crate::Resettable for GrsrSpec {
84    const RESET_VALUE: u32 = 0;
85}