ht32f523x2/wdt/
sr.rs

1#[doc = "Register `SR` reader"]
2pub type R = crate::R<SrSpec>;
3#[doc = "Register `SR` writer"]
4pub type W = crate::W<SrSpec>;
5#[doc = "Field `WDTUF` reader - WDTUF"]
6pub type WdtufR = crate::BitReader;
7#[doc = "Field `WDTUF` writer - WDTUF"]
8pub type WdtufW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `WDTERR` reader - WDTERR"]
10pub type WdterrR = crate::BitReader;
11#[doc = "Field `WDTERR` writer - WDTERR"]
12pub type WdterrW<'a, REG> = crate::BitWriter<'a, REG>;
13impl R {
14    #[doc = "Bit 0 - WDTUF"]
15    #[inline(always)]
16    pub fn wdtuf(&self) -> WdtufR {
17        WdtufR::new((self.bits & 1) != 0)
18    }
19    #[doc = "Bit 1 - WDTERR"]
20    #[inline(always)]
21    pub fn wdterr(&self) -> WdterrR {
22        WdterrR::new(((self.bits >> 1) & 1) != 0)
23    }
24}
25impl W {
26    #[doc = "Bit 0 - WDTUF"]
27    #[inline(always)]
28    #[must_use]
29    pub fn wdtuf(&mut self) -> WdtufW<SrSpec> {
30        WdtufW::new(self, 0)
31    }
32    #[doc = "Bit 1 - WDTERR"]
33    #[inline(always)]
34    #[must_use]
35    pub fn wdterr(&mut self) -> WdterrW<SrSpec> {
36        WdterrW::new(self, 1)
37    }
38}
39#[doc = "SR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`sr::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 [`sr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
40pub struct SrSpec;
41impl crate::RegisterSpec for SrSpec {
42    type Ux = u32;
43}
44#[doc = "`read()` method returns [`sr::R`](R) reader structure"]
45impl crate::Readable for SrSpec {}
46#[doc = "`write(|w| ..)` method takes [`sr::W`](W) writer structure"]
47impl crate::Writable for SrSpec {
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 SR to value 0"]
53impl crate::Resettable for SrSpec {
54    const RESET_VALUE: u32 = 0;
55}