ht32f523x2/usb/
ep0csr.rs

1#[doc = "Register `EP0CSR` reader"]
2pub type R = crate::R<Ep0csrSpec>;
3#[doc = "Register `EP0CSR` writer"]
4pub type W = crate::W<Ep0csrSpec>;
5#[doc = "Field `DTGTX` reader - DTGTX"]
6pub type DtgtxR = crate::BitReader;
7#[doc = "Field `DTGTX` writer - DTGTX"]
8pub type DtgtxW<'a, REG> = crate::BitWriter<'a, REG>;
9#[doc = "Field `NAKTX` reader - NAKTX"]
10pub type NaktxR = crate::BitReader;
11#[doc = "Field `NAKTX` writer - NAKTX"]
12pub type NaktxW<'a, REG> = crate::BitWriter<'a, REG>;
13#[doc = "Field `STLTX` reader - STLTX"]
14pub type StltxR = crate::BitReader;
15#[doc = "Field `STLTX` writer - STLTX"]
16pub type StltxW<'a, REG> = crate::BitWriter<'a, REG>;
17#[doc = "Field `DTGRX` reader - DTGRX"]
18pub type DtgrxR = crate::BitReader;
19#[doc = "Field `DTGRX` writer - DTGRX"]
20pub type DtgrxW<'a, REG> = crate::BitWriter<'a, REG>;
21#[doc = "Field `NAKRX` reader - NAKRX"]
22pub type NakrxR = crate::BitReader;
23#[doc = "Field `NAKRX` writer - NAKRX"]
24pub type NakrxW<'a, REG> = crate::BitWriter<'a, REG>;
25#[doc = "Field `STLRX` reader - STLRX"]
26pub type StlrxR = crate::BitReader;
27#[doc = "Field `STLRX` writer - STLRX"]
28pub type StlrxW<'a, REG> = crate::BitWriter<'a, REG>;
29impl R {
30    #[doc = "Bit 0 - DTGTX"]
31    #[inline(always)]
32    pub fn dtgtx(&self) -> DtgtxR {
33        DtgtxR::new((self.bits & 1) != 0)
34    }
35    #[doc = "Bit 1 - NAKTX"]
36    #[inline(always)]
37    pub fn naktx(&self) -> NaktxR {
38        NaktxR::new(((self.bits >> 1) & 1) != 0)
39    }
40    #[doc = "Bit 2 - STLTX"]
41    #[inline(always)]
42    pub fn stltx(&self) -> StltxR {
43        StltxR::new(((self.bits >> 2) & 1) != 0)
44    }
45    #[doc = "Bit 3 - DTGRX"]
46    #[inline(always)]
47    pub fn dtgrx(&self) -> DtgrxR {
48        DtgrxR::new(((self.bits >> 3) & 1) != 0)
49    }
50    #[doc = "Bit 4 - NAKRX"]
51    #[inline(always)]
52    pub fn nakrx(&self) -> NakrxR {
53        NakrxR::new(((self.bits >> 4) & 1) != 0)
54    }
55    #[doc = "Bit 5 - STLRX"]
56    #[inline(always)]
57    pub fn stlrx(&self) -> StlrxR {
58        StlrxR::new(((self.bits >> 5) & 1) != 0)
59    }
60}
61impl W {
62    #[doc = "Bit 0 - DTGTX"]
63    #[inline(always)]
64    #[must_use]
65    pub fn dtgtx(&mut self) -> DtgtxW<Ep0csrSpec> {
66        DtgtxW::new(self, 0)
67    }
68    #[doc = "Bit 1 - NAKTX"]
69    #[inline(always)]
70    #[must_use]
71    pub fn naktx(&mut self) -> NaktxW<Ep0csrSpec> {
72        NaktxW::new(self, 1)
73    }
74    #[doc = "Bit 2 - STLTX"]
75    #[inline(always)]
76    #[must_use]
77    pub fn stltx(&mut self) -> StltxW<Ep0csrSpec> {
78        StltxW::new(self, 2)
79    }
80    #[doc = "Bit 3 - DTGRX"]
81    #[inline(always)]
82    #[must_use]
83    pub fn dtgrx(&mut self) -> DtgrxW<Ep0csrSpec> {
84        DtgrxW::new(self, 3)
85    }
86    #[doc = "Bit 4 - NAKRX"]
87    #[inline(always)]
88    #[must_use]
89    pub fn nakrx(&mut self) -> NakrxW<Ep0csrSpec> {
90        NakrxW::new(self, 4)
91    }
92    #[doc = "Bit 5 - STLRX"]
93    #[inline(always)]
94    #[must_use]
95    pub fn stlrx(&mut self) -> StlrxW<Ep0csrSpec> {
96        StlrxW::new(self, 5)
97    }
98}
99#[doc = "EP0CSR\n\nYou can [`read`](crate::generic::Reg::read) this register and get [`ep0csr::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 [`ep0csr::W`](W). You can also [`modify`](crate::generic::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api)."]
100pub struct Ep0csrSpec;
101impl crate::RegisterSpec for Ep0csrSpec {
102    type Ux = u32;
103}
104#[doc = "`read()` method returns [`ep0csr::R`](R) reader structure"]
105impl crate::Readable for Ep0csrSpec {}
106#[doc = "`write(|w| ..)` method takes [`ep0csr::W`](W) writer structure"]
107impl crate::Writable for Ep0csrSpec {
108    type Safety = crate::Unsafe;
109    const ZERO_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
110    const ONE_TO_MODIFY_FIELDS_BITMAP: u32 = 0;
111}
112#[doc = "`reset()` method sets EP0CSR to value 0"]
113impl crate::Resettable for Ep0csrSpec {
114    const RESET_VALUE: u32 = 0;
115}