1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
///Register `HCTSIZ1` reader
pub type R = crate::R<HCTSIZ1rs>;
///Register `HCTSIZ1` writer
pub type W = crate::W<HCTSIZ1rs>;
///Field `XFRSIZ` reader - XFRSIZ
pub type XFRSIZ_R = crate::FieldReader<u32>;
///Field `XFRSIZ` writer - XFRSIZ
pub type XFRSIZ_W<'a, REG> = crate::FieldWriter<'a, REG, 19, u32>;
///Field `PKTCNT` reader - PKTCNT
pub type PKTCNT_R = crate::FieldReader<u16>;
///Field `PKTCNT` writer - PKTCNT
pub type PKTCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 10, u16>;
///Field `DPID` reader - DPID
pub type DPID_R = crate::FieldReader;
///Field `DPID` writer - DPID
pub type DPID_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
impl R {
///Bits 0:18 - XFRSIZ
#[inline(always)]
pub fn xfrsiz(&self) -> XFRSIZ_R {
XFRSIZ_R::new(self.bits & 0x0007_ffff)
}
///Bits 19:28 - PKTCNT
#[inline(always)]
pub fn pktcnt(&self) -> PKTCNT_R {
PKTCNT_R::new(((self.bits >> 19) & 0x03ff) as u16)
}
///Bits 29:30 - DPID
#[inline(always)]
pub fn dpid(&self) -> DPID_R {
DPID_R::new(((self.bits >> 29) & 3) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("HCTSIZ1")
.field("xfrsiz", &self.xfrsiz())
.field("pktcnt", &self.pktcnt())
.field("dpid", &self.dpid())
.finish()
}
}
impl W {
///Bits 0:18 - XFRSIZ
#[inline(always)]
pub fn xfrsiz(&mut self) -> XFRSIZ_W<HCTSIZ1rs> {
XFRSIZ_W::new(self, 0)
}
///Bits 19:28 - PKTCNT
#[inline(always)]
pub fn pktcnt(&mut self) -> PKTCNT_W<HCTSIZ1rs> {
PKTCNT_W::new(self, 19)
}
///Bits 29:30 - DPID
#[inline(always)]
pub fn dpid(&mut self) -> DPID_W<HCTSIZ1rs> {
DPID_W::new(self, 29)
}
}
/**OTG host channel 1 transfer size register
You can [`read`](crate::Reg::read) this register and get [`hctsiz1::R`](R). You can [`reset`](crate::Reg::reset), [`write`](crate::Reg::write), [`write_with_zero`](crate::Reg::write_with_zero) this register using [`hctsiz1::W`](W). You can also [`modify`](crate::Reg::modify) this register. See [API](https://docs.rs/svd2rust/#read--modify--write-api).
See register [structure](https://stm32-rs.github.io/stm32-rs/STM32MP153.html#OTG:HCTSIZ1)*/
pub struct HCTSIZ1rs;
impl crate::RegisterSpec for HCTSIZ1rs {
type Ux = u32;
}
///`read()` method returns [`hctsiz1::R`](R) reader structure
impl crate::Readable for HCTSIZ1rs {}
///`write(|w| ..)` method takes [`hctsiz1::W`](W) writer structure
impl crate::Writable for HCTSIZ1rs {
type Safety = crate::Unsafe;
}
///`reset()` method sets HCTSIZ1 to value 0
impl crate::Resettable for HCTSIZ1rs {}