📄 mx31_usb.h
字号:
unsigned int ASPE:1; //Asynchronous Schedule Park Mode Enable (OPTIONAL) . Read/Write.
// If the Asynchronous Park Capability bit in the HCCPARAMS register is a one, then this bit defaults to a 1h and is R/W. Otherwise the bit must be a zero and is RO.
// Software uses this bit to enable or disable Park mode. When this bit is one, Park mode is enabled. When this bit is a zero, Park mode is disabled.
// This field is set to "1" in this implementation.
unsigned int ATDTW:1; //Add dTD TripWire – Read/Write. [device mode only]
// This bit is used as a semaphore to ensure the to proper addition of a new dTD to an active (primed)
// endpoint’s linked list. This bit is set and cleared by software. This bit shall also be cleared by hardware when is state machine is hazard region for which
// adding a dTD to a primed endpoint may go unrecognized. For more information on the use of this bit, see the Device Operational Model section of
// the ARC USB-HS OTG High-Speed USB On-The-Go DEV reference manual.
unsigned int SUTW:1; // Setup TripWire – Read/Write. [device mode only]
// This bit is used as a semaphore to ensure that the setup data payload of 8 bytes is extracted from
// a QH by the DCD without being corrupted. If the setup lockout mode is off (See USBMODE) then there exists a hazard when new setup data arrives while the
// DCD is copying the setup data payload from the QH for a previous setup packet. This bit is set and cleared by software and will be cleared by hardware
// when a hazard exists. For more information on the use of this bit, see the Device Operational Model section of the ARC USB-HS OTG High-Speed USB
// On-The-Go DEV reference manual.
unsigned int R2:1; //Reserved. These bits are reserved and should be set to zero.
unsigned int FS2:1; //
unsigned int ITC:8; //Interrupt Threshold Control —Read/Write. Default 08h.
//The system software uses this field to set the maximum rate at which the host/device
// controller will issue interrupts. ITC contains the maximum interrupt interval measured in micro-frames. Valid values are shown below.
// ValueMaximum Interrupt Interval
// 00h Immediate (no threshold)
// 01h 1 micro-frame
// 02h 2 micro-frames
// 04h 4 micro-frames
// 08h 8 micro-frames
// 10h 16 micro-frames
// 20h 32 micro-frames
// 40h 64 micro-frames
unsigned int RESERVED:8; //Reserved. These bits are reserved and should be set to zero.
}USB_USBCMD_T;
typedef struct _USB_USBSTS{
unsigned int UI:1; //USB Interrupt (USBINT) — R/WC.
// This bit is set by the Host/Device Controller when the cause of an interrupt is a completion of a USB transaction where the
// Transfer Descriptor (TD) has an interrupt on complete (IOC) bit set. This bit is also set by the Host/Device Controller when a short packet is
// detected. A short packet is when the actual number of bytes received was less than the expected number of bytes.
unsigned int UEI:1; //USB Error Interrupt (USBERRINT) — R/WC.
// When completion of a USB transaction results in an error condition, this bit is set by the Host/Device
// Controller. This bit is set along with the USBINT bit, if the TD on which the error interrupt occurred also had its interrupt on complete (IOC) bit set
// See Section (Reference Host Operation Model: Transfer/Transaction Based Interrupt – i.e. 4.15.1 in EHCI Enhanced Host Controller Interface Specification
// for Universal Serial Bus, Revision 0.95, November 2000, Intel Corporation. http://www.intel.com) for a complete list of host error interrupt conditions.
// See section Device Error Matrix in the ARC USB-HS OTG High-Speed USB On-The-Go DEV reference manual.
// The device controller detects resume signaling only.
unsigned int PCI:1; //Port Change Detect — R/WC.
// The Host Controller sets this bit to a one when on any port a Connect Status occurs, a Port Enable/Disable Change occurs, or
// the Force Port Resume bit is set as the result of a J-K transition on the suspended port.
// The Device Controller sets this bit to a one when the port controller enters the full or high-speed operational state. When the port controller exits the full or
// high-speed operation states due to Reset or Suspend events, the notification mechanisms are the USB Reset Received bit and the DCSuspend bits respectively.
// This bit is not EHCI compatible.
unsigned int FRI:1; // Frame List Rollover — R/WC.
// The Host Controller sets this bit to a one when the Frame List Index rolls over from its maximum value to zero. The exact value
// at which the rollover occurs depends on the frame list size. For example. If the frame list size (as programmed in the Frame List Size field of the USBCMD
// register) is 1024, the Frame Index Register rolls over every time FRINDEX [1 3] toggles. Similarly, if the size is 512, the Host Controller sets this bit to a one
// every time FHINDEX [12] toggles.
// Only used by the host controller.
unsigned int SEI:1; //System Error— R/WC.
// This bit is not used in this implementation and will always be set to "0".
unsigned int AAI:1; //Interrupt on Async Advance — R/WC. 0=Default.
// System software can force the host controller to issue an interrupt the next time the host controller
// advances the asynchronous schedule by writing a one to the Interrupt on Async Advance Doorbell bit in the USBCMD register. This status bit indicates the
// assertion of that interrupt source.
//Only used by the host controller.
unsigned int URI:1; // USB Reset Received – R/WC. 0=Default.
// When the device controller detects a USB Reset and enters the default state, this bit will be set to a one. Software
// can write a 1 to this bit to clear the USB Reset Received status bit.
// Only used by the device controller.
unsigned int SRI:1; //SOF Received – R/WC. 0=Default.
// When the device controller detects a Start Of (micro) Frame, this bit will be set to a one. When a SOF is extremely late, the
// device controller will automatically set this bit to indicate that an SOF was expected. Therefore, this bit will be set roughly every 1ms in device FS mode
// and every 125ms in HS mode and will be synchronized to the actual SOF that is received.
// Since the device controller is initialized to FS before connect, this bit will be set at an interval of 1ms during the prelude to connect and chirp.
// In host mode, this bit will be set every 125us and can be used by host controller driver as a time base.
// Software writes a 1 to this bit to clear it.
// This is a non-EHCI status bit.
unsigned int SLI:1; //DCSuspend – R/WC. 0=Default.
// When a device controller enters a suspend state from an active state, this bit will be set to a one. The device controller
// clears the bit upon exiting from a suspend state.
// Only used by the device controller.
unsigned int R1:1; //Reserved. These bits are reserved and should be set to zero.
unsigned int ULPII:1; //ULPI Interrupt – R/WC. 0=Default.
// When the ULPI Viewport is present in the design, an event completion will set this interrupt.
// Used by both host & device controller. Only present in designs where configuration constant VUSB_HS_PHY_ULPI = 1.
unsigned int R2:1; //Reserved. These bits are reserved and should be set to zero.
unsigned int HCH:1; // HCHaIted — Read Only. 1=Default.
// This bit is a zero whenever the Run/Stop bit is a one. The Host Controller sets this bit to one after it has stopped
// executing because of the Run/Stop bit being set to 0, either by software or by the Host Controller hardware (e.g. internal error).
// Only used by the host controller.
unsigned int RCL:1; // Reclamation — Read Only. 0=Default.
// This is a read-only status bit used to detect an empty asynchronous schedule.
// Only used by the host controller.
unsigned int PS:1; //Periodic Schedule Status — Read Only. 0=Default.
// This bit reports the current real status of the Periodic Schedule. When set to zero the periodic
// schedule is disabled, and if set to one the status is enabled. The Host Controller is not required to immediately disable or enable the Periodic
// Schedule when software transitions the Periodic Schedule Enable bit in the USBCMD register. When this bit and the Periodic Schedule Enable bit are the
// same value, the Periodic Schedule is either enabled (1) or disabled (0).
// Only used by the host controller.
unsigned int AS:1; //Asynchronous Schedule Status — Read Only. 0=Default.
// This bit reports the current real status of the Asynchronous Schedule. When set to zero the
// asynchronous schedule status is disabled and if set to one the status is enabled. The Host Controller is not required to immediately disable or enable
// the Asynchronous Schedule when software transitions the Asynchronous Schedule Enable bit in the USBCMD register. When this bit and the
// Asynchronous Schedule Enable bit are the same value, the Asynchronous Schedule is either enabled (1) or disabled (0).
// Only used by the host controller.
unsigned int RESERVED:16; //Reserved. These bits are reserved and should be set to zero.
}USB_USBSTS_T;
typedef struct _USB_USBINTR{
unsigned int UE:1; //USB Interrupt Enable
// When this bit is a one, and the USBINT bit in the USBSTS register is a one, the host/device controller will issue an
// interrupt at the next interrupt threshold. The interrupt is acknowledged by software clearing the USBINT bit.
unsigned int UEE:1; // USB Error Interrupt Enable
// When this bit is a one, and the USBERRINT bit in the USBSTS register is a one, the host controller will issue an interrupt at the
// next interrupt threshold. The interrupt is acknowledged by software clearing the USBERRINT bit in the USBSTS register.
unsigned int PCE:1; //Port Change Detect Enable
// When this bit is a one, and the Port Change Detect bit in the USBSTS register is a one, the host/device controller will issue
// an interrupt. The interrupt is acknowledged by software clearing the Port Change Detect bit.
unsigned int FRE:1; // Frame List Rollover Enable
// When this bit is a one, and the Frame List Rollover bit in the USBSTS register is a one, the host controller will issue an
// interrupt. The interrupt is acknowledged by software clearing the Frame List Rollover bit.
// Only used by the host controller.
unsigned int SEE:1; //System Error Enable
// When this bit is a one, and the System Error bit in the USBSTS register is a one, the host/device controller will issue an
// interrupt. The interrupt is acknowledged by software clearing the System Error bit.
unsigned int AAE:1; //Interrupt on Async Advance Enable
// When this bit is a one, and the Interrupt on Async Advance bit in the USBSTS register is a one, the host controller will issue
// an interrupt at the next interrupt threshold. The interrupt is acknowledged by software clearing the Interrupt on Async Advance bit.
// Only used by the host controller.
unsigned int URE:1; //USB Reset Enable
//When this bit is a one, and the USB Reset Received bit in the USBSTS register is a one, the device controller will issue an
// interrupt. The interrupt is acknowledged by software clearing the USB Reset Received bit.
//Only used by the device controller.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -