Altera SoCAL  16.0
The Altera SoC Abstraction Layer (SoCAL) API Reference Manual
 All Data Structures Variables Typedefs Groups
Register : Receive Status Debug Read Register - grxstsr

Description

A read to the Receive Status Read and Pop register additionally pops the: top data entry out of the RxFIFO. The receive status contents must be interpreted differently in Host and Device modes. The core ignores the receive status pop/read when the receive FIFO is empty and returns a value of 0. The application must only pop the Receive Status FIFO when the Receive FIFO Non- Empty bit of the Core Interrupt register (GINTSTS.RxFLvl) is asserted. Use of these fields vary based on whether the HS OTG core is functioning as a host or a device. Do not read this register's reset value before configuring the core because the read value is "X" in the simulation.

Register Layout

Bits Access Reset Description
[3:0] R 0x0 Channel Number
[14:4] R 0x0 Byte Count
[16:15] R 0x0 Data PID
[20:17] R 0x0 Packet Status
[31:21] ??? 0x0 UNDEFINED

Field : Channel Number - chnum

Indicates the endpoint number to which the current received packet belongs.

Field Access Macros:

#define ALT_USB_GLOB_GRXSTSR_CHNUM_LSB   0
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_MSB   3
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_WIDTH   4
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_SET_MSK   0x0000000f
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_CLR_MSK   0xfffffff0
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_RESET   0x0
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_GET(value)   (((value) & 0x0000000f) >> 0)
 
#define ALT_USB_GLOB_GRXSTSR_CHNUM_SET(value)   (((value) << 0) & 0x0000000f)
 

Field : Byte Count - bcnt

Indicates the byte count of the received data packet.

Field Access Macros:

#define ALT_USB_GLOB_GRXSTSR_BCNT_LSB   4
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_MSB   14
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_WIDTH   11
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_SET_MSK   0x00007ff0
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_CLR_MSK   0xffff800f
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_RESET   0x0
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_GET(value)   (((value) & 0x00007ff0) >> 4)
 
#define ALT_USB_GLOB_GRXSTSR_BCNT_SET(value)   (((value) << 4) & 0x00007ff0)
 

Field : Data PID - dpid

Indicates the Data PID of the received packet.

Field Enumeration Values:

Enum Value Description
ALT_USB_GLOB_GRXSTSR_DPID_E_DATA0 0x0 DATA0
ALT_USB_GLOB_GRXSTSR_DPID_E_DATA1 0x2 DATA1
ALT_USB_GLOB_GRXSTSR_DPID_E_DATA2 0x1 DATA2
ALT_USB_GLOB_GRXSTSR_DPID_E_MDATA 0x3 MDATA

Field Access Macros:

#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA0   0x0
 
#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA1   0x2
 
#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA2   0x1
 
#define ALT_USB_GLOB_GRXSTSR_DPID_E_MDATA   0x3
 
#define ALT_USB_GLOB_GRXSTSR_DPID_LSB   15
 
#define ALT_USB_GLOB_GRXSTSR_DPID_MSB   16
 
#define ALT_USB_GLOB_GRXSTSR_DPID_WIDTH   2
 
#define ALT_USB_GLOB_GRXSTSR_DPID_SET_MSK   0x00018000
 
#define ALT_USB_GLOB_GRXSTSR_DPID_CLR_MSK   0xfffe7fff
 
#define ALT_USB_GLOB_GRXSTSR_DPID_RESET   0x0
 
#define ALT_USB_GLOB_GRXSTSR_DPID_GET(value)   (((value) & 0x00018000) >> 15)
 
#define ALT_USB_GLOB_GRXSTSR_DPID_SET(value)   (((value) << 15) & 0x00018000)
 

Field : Packet Status - pktsts

Mode: Host only. Others: Reserved. Indicates the status of the received packet

Field Enumeration Values:

Enum Value Description
ALT_USB_GLOB_GRXSTSR_PKTSTS_E_INDPRX 0x2 IN data packet received
ALT_USB_GLOB_GRXSTSR_PKTSTS_E_INTRCOM 0x3 IN transfer completed (triggers an interrupt
ALT_USB_GLOB_GRXSTSR_PKTSTS_E_DTTOG 0x5 Data toggle error (triggers an interrupt)
ALT_USB_GLOB_GRXSTSR_PKTSTS_E_CHHALT 0x7 Channel halted (triggers an interrupt)

Field Access Macros:

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_INDPRX   0x2
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_INTRCOM   0x3
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_DTTOG   0x5
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_CHHALT   0x7
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_LSB   17
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_MSB   20
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_WIDTH   4
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_SET_MSK   0x001e0000
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_CLR_MSK   0xffe1ffff
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_RESET   0x0
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_GET(value)   (((value) & 0x001e0000) >> 17)
 
#define ALT_USB_GLOB_GRXSTSR_PKTSTS_SET(value)   (((value) << 17) & 0x001e0000)
 

Data Structures

struct  ALT_USB_GLOB_GRXSTSR_s
 

Macros

#define ALT_USB_GLOB_GRXSTSR_OFST   0x1c
 
#define ALT_USB_GLOB_GRXSTSR_ADDR(base)   ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_USB_GLOB_GRXSTSR_OFST))
 

Typedefs

typedef struct
ALT_USB_GLOB_GRXSTSR_s 
ALT_USB_GLOB_GRXSTSR_t
 

Data Structure Documentation

struct ALT_USB_GLOB_GRXSTSR_s

WARNING: The C register and register group struct declarations are provided for convenience and illustrative purposes. They should, however, be used with caution as the C language standard provides no guarantees about the alignment or atomicity of device memory accesses. The recommended practice for writing hardware drivers is to use the SoCAL access macros and alt_read_word() and alt_write_word() functions.

The struct declaration for register ALT_USB_GLOB_GRXSTSR.

Data Fields
const uint32_t chnum: 4 Channel Number
const uint32_t bcnt: 11 Byte Count
const uint32_t dpid: 2 Data PID
const uint32_t pktsts: 4 Packet Status
uint32_t __pad0__: 11 UNDEFINED

Macro Definitions

#define ALT_USB_GLOB_GRXSTSR_CHNUM_LSB   0

The Least Significant Bit (LSB) position of the ALT_USB_GLOB_GRXSTSR_CHNUM register field.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_MSB   3

The Most Significant Bit (MSB) position of the ALT_USB_GLOB_GRXSTSR_CHNUM register field.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_WIDTH   4

The width in bits of the ALT_USB_GLOB_GRXSTSR_CHNUM register field.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_SET_MSK   0x0000000f

The mask used to set the ALT_USB_GLOB_GRXSTSR_CHNUM register field value.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_CLR_MSK   0xfffffff0

The mask used to clear the ALT_USB_GLOB_GRXSTSR_CHNUM register field value.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_RESET   0x0

The reset value of the ALT_USB_GLOB_GRXSTSR_CHNUM register field.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_GET (   value)    (((value) & 0x0000000f) >> 0)

Extracts the ALT_USB_GLOB_GRXSTSR_CHNUM field value from a register.

#define ALT_USB_GLOB_GRXSTSR_CHNUM_SET (   value)    (((value) << 0) & 0x0000000f)

Produces a ALT_USB_GLOB_GRXSTSR_CHNUM register field value suitable for setting the register.

#define ALT_USB_GLOB_GRXSTSR_BCNT_LSB   4

The Least Significant Bit (LSB) position of the ALT_USB_GLOB_GRXSTSR_BCNT register field.

#define ALT_USB_GLOB_GRXSTSR_BCNT_MSB   14

The Most Significant Bit (MSB) position of the ALT_USB_GLOB_GRXSTSR_BCNT register field.

#define ALT_USB_GLOB_GRXSTSR_BCNT_WIDTH   11

The width in bits of the ALT_USB_GLOB_GRXSTSR_BCNT register field.

#define ALT_USB_GLOB_GRXSTSR_BCNT_SET_MSK   0x00007ff0

The mask used to set the ALT_USB_GLOB_GRXSTSR_BCNT register field value.

#define ALT_USB_GLOB_GRXSTSR_BCNT_CLR_MSK   0xffff800f

The mask used to clear the ALT_USB_GLOB_GRXSTSR_BCNT register field value.

#define ALT_USB_GLOB_GRXSTSR_BCNT_RESET   0x0

The reset value of the ALT_USB_GLOB_GRXSTSR_BCNT register field.

#define ALT_USB_GLOB_GRXSTSR_BCNT_GET (   value)    (((value) & 0x00007ff0) >> 4)

Extracts the ALT_USB_GLOB_GRXSTSR_BCNT field value from a register.

#define ALT_USB_GLOB_GRXSTSR_BCNT_SET (   value)    (((value) << 4) & 0x00007ff0)

Produces a ALT_USB_GLOB_GRXSTSR_BCNT register field value suitable for setting the register.

#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA0   0x0

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_DPID

DATA0

#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA1   0x2

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_DPID

DATA1

#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA2   0x1

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_DPID

DATA2

#define ALT_USB_GLOB_GRXSTSR_DPID_E_MDATA   0x3

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_DPID

MDATA

#define ALT_USB_GLOB_GRXSTSR_DPID_LSB   15

The Least Significant Bit (LSB) position of the ALT_USB_GLOB_GRXSTSR_DPID register field.

#define ALT_USB_GLOB_GRXSTSR_DPID_MSB   16

The Most Significant Bit (MSB) position of the ALT_USB_GLOB_GRXSTSR_DPID register field.

#define ALT_USB_GLOB_GRXSTSR_DPID_WIDTH   2

The width in bits of the ALT_USB_GLOB_GRXSTSR_DPID register field.

#define ALT_USB_GLOB_GRXSTSR_DPID_SET_MSK   0x00018000

The mask used to set the ALT_USB_GLOB_GRXSTSR_DPID register field value.

#define ALT_USB_GLOB_GRXSTSR_DPID_CLR_MSK   0xfffe7fff

The mask used to clear the ALT_USB_GLOB_GRXSTSR_DPID register field value.

#define ALT_USB_GLOB_GRXSTSR_DPID_RESET   0x0

The reset value of the ALT_USB_GLOB_GRXSTSR_DPID register field.

#define ALT_USB_GLOB_GRXSTSR_DPID_GET (   value)    (((value) & 0x00018000) >> 15)

Extracts the ALT_USB_GLOB_GRXSTSR_DPID field value from a register.

#define ALT_USB_GLOB_GRXSTSR_DPID_SET (   value)    (((value) << 15) & 0x00018000)

Produces a ALT_USB_GLOB_GRXSTSR_DPID register field value suitable for setting the register.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_INDPRX   0x2

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_PKTSTS

IN data packet received

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_INTRCOM   0x3

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_PKTSTS

IN transfer completed (triggers an interrupt

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_DTTOG   0x5

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_PKTSTS

Data toggle error (triggers an interrupt)

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_E_CHHALT   0x7

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_PKTSTS

Channel halted (triggers an interrupt)

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_LSB   17

The Least Significant Bit (LSB) position of the ALT_USB_GLOB_GRXSTSR_PKTSTS register field.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_MSB   20

The Most Significant Bit (MSB) position of the ALT_USB_GLOB_GRXSTSR_PKTSTS register field.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_WIDTH   4

The width in bits of the ALT_USB_GLOB_GRXSTSR_PKTSTS register field.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_SET_MSK   0x001e0000

The mask used to set the ALT_USB_GLOB_GRXSTSR_PKTSTS register field value.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_CLR_MSK   0xffe1ffff

The mask used to clear the ALT_USB_GLOB_GRXSTSR_PKTSTS register field value.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_RESET   0x0

The reset value of the ALT_USB_GLOB_GRXSTSR_PKTSTS register field.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_GET (   value)    (((value) & 0x001e0000) >> 17)

Extracts the ALT_USB_GLOB_GRXSTSR_PKTSTS field value from a register.

#define ALT_USB_GLOB_GRXSTSR_PKTSTS_SET (   value)    (((value) << 17) & 0x001e0000)

Produces a ALT_USB_GLOB_GRXSTSR_PKTSTS register field value suitable for setting the register.

#define ALT_USB_GLOB_GRXSTSR_OFST   0x1c

The byte offset of the ALT_USB_GLOB_GRXSTSR register from the beginning of the component.

#define ALT_USB_GLOB_GRXSTSR_ADDR (   base)    ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_USB_GLOB_GRXSTSR_OFST))

The address of the ALT_USB_GLOB_GRXSTSR register.

Typedef Documentation

The typedef declaration for register ALT_USB_GLOB_GRXSTSR.