ht32f523x2/exti/
cfgr4.rs

1#[doc = "Register `CFGR4` reader"]
2pub type R = crate::R<Cfgr4Spec>;
3#[doc = "Register `CFGR4` writer"]
4pub type W = crate::W<Cfgr4Spec>;
5#[doc = "Field `DBCNT` reader - DBCNT"]
6pub type DbcntR = crate::FieldReader<u16>;
7#[doc = "Field `DBCNT` writer - DBCNT"]
8pub type DbcntW<'a, REG> = crate::FieldWriter<'a, REG, 16, u16>;
9#[doc = "Field `SRCTYPE` reader - SRCTYPE"]
10pub type SrctypeR = crate::FieldReader;
11#[doc = "Field `SRCTYPE` writer - SRCTYPE"]
12pub type SrctypeW<'a, REG> = crate::FieldWriter<'a, REG, 3>;
13#[doc = "Field `DBEN` reader - DBEN"]
14pub type DbenR = crate::BitReader;
15#[doc = "Field `DBEN` writer - DBEN"]
16pub type DbenW<'a, REG> = crate::BitWriter<'a, REG>;
17impl R {
18    #[doc = "Bits 0:15 - DBCNT"]
19    #[inline(always)]
20    pub fn dbcnt(&self) -> DbcntR {
21        DbcntR::new((self.bits & 0xffff) as u16)
22    }
23    #[doc = "Bits 28:30 - SRCTYPE"]
24    #[inline(always)]
25    pub fn srctype(&self) -> SrctypeR {
26        SrctypeR::new(((self.bits >> 28) & 7) as u8)
27    }
28    #[doc = "Bit 31 - DBEN"]
29    #[inline(always)]
30    pub fn dben(&self) -> DbenR {
31        DbenR::new(((self.bits >> 31) & 1) != 0)
32    }
33}
34impl W {
35    #[doc = "Bits 0:15 - DBCNT"]
36    #[inline(always)]
37    #[must_use]
38    pub fn dbcnt(&mut self) -> DbcntW<Cfgr4Spec> {
39        DbcntW::new(self, 0)
40    }
41    #[doc = "Bits 28:30 - SRCTYPE"]
42    #[inline(always)]
43    #[must_use]
44    pub fn srctype(&mut self) -> SrctypeW<Cfgr4Spec> {
45        SrctypeW::new(self, 28)
46    }
47    #[doc = "Bit 31 - DBEN"]
48    #[inline(always)]
49    #[must_use]
50    pub fn dben(&mut self) -> DbenW<Cfgr4Spec> {
51        DbenW::new(self, 31)
52    }
53}
54#[doc = "CFGR4\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`cfgr4::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 [`cfgr4::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
55pub struct Cfgr4Spec;
56impl crate::RegisterSpec for Cfgr4Spec {
57    type Ux = u32;
58}
59#[doc = "`read()` method returns [`cfgr4::R`](R) reader structure"]
60impl crate::Readable for Cfgr4Spec {}
61#[doc = "`write(|w| ..)` method takes [`cfgr4::W`](W) writer structure"]
62impl crate::Writable for Cfgr4Spec {
63    type Safety = crate::Unsafe;
64    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
65    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
66}
67#[doc = "`reset()` method sets CFGR4 to value 0"]
68impl crate::Resettable for Cfgr4Spec {
69    const RESET_VALUE: u32 = 0;
70}