stm32f1_staging/stm32f101/otg_fs_device/doep0/
tsiz.rs1pub type R = crate::R<TSIZrs>;
3pub type W = crate::W<TSIZrs>;
5pub type XFRSIZ_R = crate::FieldReader;
7pub type XFRSIZ_W<'a, REG> = crate::FieldWriter<'a, REG, 7>;
9pub type PKTCNT_R = crate::BitReader;
11pub type PKTCNT_W<'a, REG> = crate::BitWriter<'a, REG>;
13pub type STUPCNT_R = crate::FieldReader;
15pub type STUPCNT_W<'a, REG> = crate::FieldWriter<'a, REG, 2>;
17impl R {
18 #[inline(always)]
20 pub fn xfrsiz(&self) -> XFRSIZ_R {
21 XFRSIZ_R::new((self.bits & 0x7f) as u8)
22 }
23 #[inline(always)]
25 pub fn pktcnt(&self) -> PKTCNT_R {
26 PKTCNT_R::new(((self.bits >> 19) & 1) != 0)
27 }
28 #[inline(always)]
30 pub fn stupcnt(&self) -> STUPCNT_R {
31 STUPCNT_R::new(((self.bits >> 29) & 3) as u8)
32 }
33}
34impl core::fmt::Debug for R {
35 fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
36 f.debug_struct("TSIZ")
37 .field("stupcnt", &self.stupcnt())
38 .field("pktcnt", &self.pktcnt())
39 .field("xfrsiz", &self.xfrsiz())
40 .finish()
41 }
42}
43impl W {
44 #[inline(always)]
46 pub fn xfrsiz(&mut self) -> XFRSIZ_W<TSIZrs> {
47 XFRSIZ_W::new(self, 0)
48 }
49 #[inline(always)]
51 pub fn pktcnt(&mut self) -> PKTCNT_W<TSIZrs> {
52 PKTCNT_W::new(self, 19)
53 }
54 #[inline(always)]
56 pub fn stupcnt(&mut self) -> STUPCNT_W<TSIZrs> {
57 STUPCNT_W::new(self, 29)
58 }
59}
60pub struct TSIZrs;
64impl crate::RegisterSpec for TSIZrs {
65 type Ux = u32;
66}
67impl crate::Readable for TSIZrs {}
69impl crate::Writable for TSIZrs {
71 type Safety = crate::Unsafe;
72}
73impl crate::Resettable for TSIZrs {}