stm32f4_staging/stm32f401/otg_fs_global/
grxstsr_host.rs

1///Register `GRXSTSR_Host` reader
2pub type R = crate::R<GRXSTSR_HOSTrs>;
3///Field `CHNUM` reader - Channel number
4pub type CHNUM_R = crate::FieldReader;
5///Field `BCNT` reader - Byte count
6pub type BCNT_R = crate::FieldReader<u16>;
7///Field `DPID` reader - Data PID
8pub type DPID_R = crate::FieldReader;
9///Field `PKTSTS` reader - Packet status
10pub type PKTSTS_R = crate::FieldReader;
11impl R {
12    ///Bits 0:3 - Channel number
13    #[inline(always)]
14    pub fn chnum(&self) -> CHNUM_R {
15        CHNUM_R::new((self.bits & 0x0f) as u8)
16    }
17    ///Bits 4:14 - Byte count
18    #[inline(always)]
19    pub fn bcnt(&self) -> BCNT_R {
20        BCNT_R::new(((self.bits >> 4) & 0x07ff) as u16)
21    }
22    ///Bits 15:16 - Data PID
23    #[inline(always)]
24    pub fn dpid(&self) -> DPID_R {
25        DPID_R::new(((self.bits >> 15) & 3) as u8)
26    }
27    ///Bits 17:20 - Packet status
28    #[inline(always)]
29    pub fn pktsts(&self) -> PKTSTS_R {
30        PKTSTS_R::new(((self.bits >> 17) & 0x0f) as u8)
31    }
32}
33impl core::fmt::Debug for R {
34    fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
35        f.debug_struct("GRXSTSR_Host")
36            .field("chnum", &self.chnum())
37            .field("bcnt", &self.bcnt())
38            .field("dpid", &self.dpid())
39            .field("pktsts", &self.pktsts())
40            .finish()
41    }
42}
43/**OTG status debug read (host mode)
44
45You can [`read`](crate::Reg::read) this register and get [`grxstsr_host::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).
46
47See register [structure](https://stm32-rs.github.io/stm32-rs/STM32F401.html#OTG_FS_GLOBAL:GRXSTSR_Host)*/
48pub struct GRXSTSR_HOSTrs;
49impl crate::RegisterSpec for GRXSTSR_HOSTrs {
50    type Ux = u32;
51}
52///`read()` method returns [`grxstsr_host::R`](R) reader structure
53impl crate::Readable for GRXSTSR_HOSTrs {}
54///`reset()` method sets GRXSTSR_Host to value 0
55impl crate::Resettable for GRXSTSR_HOSTrs {}