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

Description

Receive Status Debug Read Register

Register Layout

Bits Access Reset Description
[3:0] R 0x0 ALT_USB_GLOB_GRXSTSR_CHNUM
[14:4] R 0x0 ALT_USB_GLOB_GRXSTSR_BCNT
[16:15] R 0x0 ALT_USB_GLOB_GRXSTSR_DPID
[20:17] R 0x0 ALT_USB_GLOB_GRXSTSR_PKTSTS
[24:21] R 0x0 ALT_USB_GLOB_GRXSTSR_FN
[31:25] ??? 0x0 UNDEFINED

Field : chnum

Mode: Host only

Channel Number (ChNum)

Indicates the channel number to which the current received

packet belongs.

Mode: Device only

Endpoint Number (EPNum)

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 : bcnt

Mode: Host only

Byte Count (BCnt)

Indicates the byte count of the received IN data packet.

Mode: Device only

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 : dpid

Mode: Host only

Data PID (DPID)

Indicates the Data PID of the received packet

2'b00: DATA0

2'b10: DATA1

2'b01: DATA2

2'b11: MDATA

Mode: Device only

Data PID (DPID)

Indicates the Data PID of the received OUT data packet

2'b00: DATA0

2'b10: DATA1

2'b01: DATA2

2'b11: MDATA

Field Enumeration Values:

Enum Value Description
ALT_USB_GLOB_GRXSTSR_DPID_E_DATA0 0x0 DATA0
ALT_USB_GLOB_GRXSTSR_DPID_E_DATA2 0x1 DATA2
ALT_USB_GLOB_GRXSTSR_DPID_E_DATA1 0x2 DATA1
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_DATA2   0x1
 
#define ALT_USB_GLOB_GRXSTSR_DPID_E_DATA1   0x2
 
#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 : pktsts

Mode: Host only

Packet Status (PktSts)

Indicates the status of the received packet

4'b0010: IN data packet received

4'b0011: IN transfer completed (triggers an interrupt)

4'b0101: Data toggle error (triggers an interrupt)

4'b0111: Channel halted (triggers an interrupt)

Others: Reserved

Mode: Device only

Packet Status (PktSts)

Indicates the status of the received packet

4'b0001: Global OUT NAK (triggers an interrupt)

4'b0010: OUT data packet received

4'b0011: OUT transfer completed (triggers an interrupt)

4'b0100: SETUP transaction completed (triggers an

interrupt)

4'b0110: SETUP data packet received

Others: Reserved

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)
 

Field : fn

Mode: Device only

Frame Number (FN)

This is the least significant 4 bits of the (micro)Frame number in

which the packet is received on the USB. This field is supported

only when isochronous OUT endpoints are supported.

Field Access Macros:

#define ALT_USB_GLOB_GRXSTSR_FN_LSB   21
 
#define ALT_USB_GLOB_GRXSTSR_FN_MSB   24
 
#define ALT_USB_GLOB_GRXSTSR_FN_WIDTH   4
 
#define ALT_USB_GLOB_GRXSTSR_FN_SET_MSK   0x01e00000
 
#define ALT_USB_GLOB_GRXSTSR_FN_CLR_MSK   0xfe1fffff
 
#define ALT_USB_GLOB_GRXSTSR_FN_RESET   0x0
 
#define ALT_USB_GLOB_GRXSTSR_FN_GET(value)   (((value) & 0x01e00000) >> 21)
 
#define ALT_USB_GLOB_GRXSTSR_FN_SET(value)   (((value) << 21) & 0x01e00000)
 

Data Structures

struct  ALT_USB_GLOB_GRXSTSR_s
 

Macros

#define ALT_USB_GLOB_GRXSTSR_RESET   0x00000000
 
#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 ALT_USB_GLOB_GRXSTSR_CHNUM
const uint32_t bcnt: 11 ALT_USB_GLOB_GRXSTSR_BCNT
const uint32_t dpid: 2 ALT_USB_GLOB_GRXSTSR_DPID
const uint32_t pktsts: 4 ALT_USB_GLOB_GRXSTSR_PKTSTS
const uint32_t fn: 4 ALT_USB_GLOB_GRXSTSR_FN
uint32_t __pad0__: 7 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_DATA2   0x1

Enumerated value for register field ALT_USB_GLOB_GRXSTSR_DPID

DATA2

#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_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_FN_LSB   21

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

#define ALT_USB_GLOB_GRXSTSR_FN_MSB   24

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

#define ALT_USB_GLOB_GRXSTSR_FN_WIDTH   4

The width in bits of the ALT_USB_GLOB_GRXSTSR_FN register field.

#define ALT_USB_GLOB_GRXSTSR_FN_SET_MSK   0x01e00000

The mask used to set the ALT_USB_GLOB_GRXSTSR_FN register field value.

#define ALT_USB_GLOB_GRXSTSR_FN_CLR_MSK   0xfe1fffff

The mask used to clear the ALT_USB_GLOB_GRXSTSR_FN register field value.

#define ALT_USB_GLOB_GRXSTSR_FN_RESET   0x0

The reset value of the ALT_USB_GLOB_GRXSTSR_FN register field.

#define ALT_USB_GLOB_GRXSTSR_FN_GET (   value)    (((value) & 0x01e00000) >> 21)

Extracts the ALT_USB_GLOB_GRXSTSR_FN field value from a register.

#define ALT_USB_GLOB_GRXSTSR_FN_SET (   value)    (((value) << 21) & 0x01e00000)

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

#define ALT_USB_GLOB_GRXSTSR_RESET   0x00000000

The reset value of the ALT_USB_GLOB_GRXSTSR 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.