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
///Register `GRXSTSP_HOST` reader
pub type R = crate::R<GRXSTSP_HOSTrs>;
///Field `CHNUM` reader - Channel number Indicates the channel number to which the current received packet belongs.
pub type CHNUM_R = crate::FieldReader;
///Field `BCNT` reader - Byte count Indicates the byte count of the received IN data packet.
pub type BCNT_R = crate::FieldReader<u16>;
///Field `DPID` reader - Data PID Indicates the data PID of the received packet
pub type DPID_R = crate::FieldReader;
///Field `PKTSTS` reader - Packet status Indicates the status of the received packet Others: Reserved
pub type PKTSTS_R = crate::FieldReader;
impl R {
///Bits 0:3 - Channel number Indicates the channel number to which the current received packet belongs.
#[inline(always)]
pub fn chnum(&self) -> CHNUM_R {
CHNUM_R::new((self.bits & 0x0f) as u8)
}
///Bits 4:14 - Byte count Indicates the byte count of the received IN data packet.
#[inline(always)]
pub fn bcnt(&self) -> BCNT_R {
BCNT_R::new(((self.bits >> 4) & 0x07ff) as u16)
}
///Bits 15:16 - Data PID Indicates the data PID of the received packet
#[inline(always)]
pub fn dpid(&self) -> DPID_R {
DPID_R::new(((self.bits >> 15) & 3) as u8)
}
///Bits 17:20 - Packet status Indicates the status of the received packet Others: Reserved
#[inline(always)]
pub fn pktsts(&self) -> PKTSTS_R {
PKTSTS_R::new(((self.bits >> 17) & 0x0f) as u8)
}
}
impl core::fmt::Debug for R {
fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result {
f.debug_struct("GRXSTSP_HOST")
.field("chnum", &self.chnum())
.field("bcnt", &self.bcnt())
.field("dpid", &self.dpid())
.field("pktsts", &self.pktsts())
.finish()
}
}
/**OTG status read and pop registers
You can [`read`](crate::Reg::read) this register and get [`grxstsp_host::R`](R). See [API](https://docs.rs/svd2rust/#read--modify--write-api).*/
pub struct GRXSTSP_HOSTrs;
impl crate::RegisterSpec for GRXSTSP_HOSTrs {
type Ux = u32;
}
///`read()` method returns [`grxstsp_host::R`](R) reader structure
impl crate::Readable for GRXSTSP_HOSTrs {}
///`reset()` method sets GRXSTSP_HOST to value 0
impl crate::Resettable for GRXSTSP_HOSTrs {}