usb
Vitis Drivers API Documentation
|
This file contains the constants, typedefs, variables and functions prototypes related to the USB chapter 9 related code.
MODIFICATION HISTORY:
Ver Who Date Changes
1.00a hvm 2/22/07 First release 1.01a hvm 5/30/07 Moved the USB class specific command processing to application files. 4.02a bss 4/5/12 Made changes so that the flag LITTLE_ENDIAN gets defined when compiled with ARM CodeSourcery toolchain.
Functions | |
void | EP0ProcessOutToken (XUsb *InstancePtr) |
This routine is called when an OUT transaction for Endpoint Zero is received. More... | |
void | EP0ProcessInToken (XUsb *InstancePtr) |
This routine is called when IN transaction for Endpoint Zero is received. More... | |
int | Chapter9 (XUsb *InstancePtr) |
This routine is called when a chapter 9 command is received. More... | |
int | ExecuteCommand (XUsb *InstancePtr) |
This function executes the chapter 9 command processing. More... | |
void | GetInterface (XUsb *InstancePtr) |
This function responds to the GET_INTERFACE command. More... | |
void | SetInterface (XUsb *InstancePtr) |
This function responds to the SET_INTERFACE command. More... | |
void | SetupControlWriteStatusStage (XUsb *InstancePtr) |
This function sets the basic Control status words. More... | |
void | GetStatus (XUsb *InstancePtr) |
This routine is called when a GET_STATUS command is received. More... | |
void | GetDescriptor (XUsb *InstancePtr) |
This routine is called when a GET_DESCRIPTOR command is received. More... | |
void | SetDescriptor (XUsb *InstancePtr) |
This routine is called when a SET_DESCRIPTOR command is received. More... | |
void | GetConfiguration (XUsb *InstancePtr) |
This routine is called when a GET_CONFIGURATION command is received. More... | |
void | SetConfiguration (XUsb *InstancePtr) |
This routine is called when a SET_CONFIGURATION command is received. More... | |
void | SetClearFeature (XUsb *InstancePtr, int flag) |
This routine is called when a SET_FEATURE or a CLEAR_FEATURE command is received. More... | |
void | LoadEP0 (XUsb *InstancePtr) |
This routine copies the EP0 related data to the DPRAM. More... | |
void | InitUsbInterface (XUsb *InstancePtr) |
This is the USB initialization function. More... | |
int Chapter9 | ( | XUsb * | InstancePtr | ) |
This routine is called when a chapter 9 command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb::Config, ExecuteCommand(), and XUSB_SETUP_PKT_ADDR_OFFSET.
Referenced by Ep0IntrHandler().
void EP0ProcessInToken | ( | XUsb * | InstancePtr | ) |
This routine is called when IN transaction for Endpoint Zero is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb::Config, XUsb::DeviceConfig, XUsb::EndPointOffset, XUsb_DeviceConfig::Ep, LoadEP0(), TEST_J, XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, XUSB_EP_CFG_DATA_TOGGLE_MASK, XUsb_ReadReg, XUsb_SetDeviceAddress(), XUsb_SetTestMode(), and XUsb_WriteReg.
Referenced by Ep0IntrHandler().
void EP0ProcessOutToken | ( | XUsb * | InstancePtr | ) |
This routine is called when an OUT transaction for Endpoint Zero is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb::Config, XUsb::DeviceConfig, XUsb_DeviceConfig::Ep, ExecuteCommand(), XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, XUsb_ReadReg, and XUsb_WriteReg.
Referenced by Ep0IntrHandler().
int ExecuteCommand | ( | XUsb * | InstancePtr | ) |
This function executes the chapter 9 command processing.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References GetConfiguration(), GetDescriptor(), GetInterface(), GetStatus(), SetClearFeature(), SetConfiguration(), SetDescriptor(), SetInterface(), SetupControlWriteStatusStage(), and XUsb_EpStall().
Referenced by Chapter9(), and EP0ProcessOutToken().
void GetConfiguration | ( | XUsb * | InstancePtr | ) |
This routine is called when a GET_CONFIGURATION command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb::Config, XUsb_DeviceConfig::CurrentConfiguration, XUsb::DeviceConfig, XUsb::EndPointOffset, XUsb_DeviceConfig::Ep, XUsb_EpConfig::RamBase, XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, and XUsb_WriteReg.
Referenced by ExecuteCommand().
void GetDescriptor | ( | XUsb * | InstancePtr | ) |
This routine is called when a GET_DESCRIPTOR command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_DeviceConfig::CurrentSpeed, XUsb::DeviceConfig, LoadEP0(), XUSB_EP_HIGH_SPEED, and XUsb_EpStall().
Referenced by ExecuteCommand().
void GetInterface | ( | XUsb * | InstancePtr | ) |
This function responds to the GET_INTERFACE command.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb::Config, XUsb::DeviceConfig, XUsb::EndPointOffset, XUsb_DeviceConfig::Ep, XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, XUsb_EpStall(), and XUsb_WriteReg.
Referenced by ExecuteCommand().
void GetStatus | ( | XUsb * | InstancePtr | ) |
This routine is called when a GET_STATUS command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb::Config, XUsb::DeviceConfig, XUsb::EndPointOffset, XUsb_DeviceConfig::Ep, XUsb_EpConfig::RamBase, XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, XUSB_EP_CFG_STALL_MASK, XUSB_EP_CFG_STALL_SHIFT, XUsb_EpStall(), XUsb_ReadReg, and XUsb_WriteReg.
Referenced by ExecuteCommand().
void InitUsbInterface | ( | XUsb * | InstancePtr | ) |
This is the USB initialization function.
This example initializes the device for Mass Storage Application. The following configuration is done.
InstancePtr | is a pointer to the XUsb instance. |
This is the USB initialization function.
The following is the configuration.
InstancePtr | is a pointer to the XUsb instance. |
This example initializes the device for Microphone Application. The following configuration is done.
InstancePtr | is a pointer to the XUsb instance. |
This example initializes the USB device for USB mouse example. The following configuration is done.
InstancePtr | is a pointer to the XUsb instance. |
Referenced by main(), SetConfiguration(), UsbIfIntrHandler(), UsbKbdExample(), and UsbMouseExample().
void LoadEP0 | ( | XUsb * | InstancePtr | ) |
This routine copies the EP0 related data to the DPRAM.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb::Config, XUsb::DeviceConfig, XUsb_DeviceConfig::Ep, XUsb_EpConfig::RamBase, XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, and XUsb_WriteReg.
Referenced by EP0ProcessInToken(), and GetDescriptor().
void SetClearFeature | ( | XUsb * | InstancePtr, |
int | flag | ||
) |
This routine is called when a SET_FEATURE or a CLEAR_FEATURE command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
flag | specifies whether it is a SET_FEATURE (TRUE)or a CLEAR_FEATURE (FALSE) command. |
References XUsb::Config, XUsb::DeviceConfig, XUsb_DeviceConfig::Ep, XUsb_EpConfig::OutIn, SetupControlWriteStatusStage(), XUSB_EP_CFG_DATA_TOGGLE_MASK, XUsb_EpStall(), XUsb_EpUnstall(), XUsb_ReadReg, and XUsb_WriteReg.
Referenced by ExecuteCommand().
void SetConfiguration | ( | XUsb * | InstancePtr | ) |
This routine is called when a SET_CONFIGURATION command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Ready, XUsb_EpConfig::Buffer1Ready, XUsb::Config, XUsb_DeviceConfig::CurrentConfiguration, XUsb::DeviceConfig, XUsb_DeviceConfig::Ep, InitUsbInterface(), XUsb_DeviceConfig::NumEndpoints, XUsb_EpConfig::OutIn, SetupControlWriteStatusStage(), XUSB_BUFFREADY_OFFSET, XUSB_EP_DIRECTION_OUT, XUsb_EpStall(), XUSB_STATUS_EP_BUFF2_SHIFT, and XUsb_WriteReg.
Referenced by ExecuteCommand().
void SetDescriptor | ( | XUsb * | InstancePtr | ) |
This routine is called when a SET_DESCRIPTOR command is received.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_EpStall().
Referenced by ExecuteCommand().
void SetInterface | ( | XUsb * | InstancePtr | ) |
This function responds to the SET_INTERFACE command.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References SetupControlWriteStatusStage(), and XUsb_EpStall().
Referenced by ExecuteCommand().
void SetupControlWriteStatusStage | ( | XUsb * | InstancePtr | ) |
This function sets the basic Control status words.
InstancePtr | is a pointer to the XUsb instance of the controller. |
References XUsb_Config::BaseAddress, XUsb_EpConfig::Buffer0Count, XUsb::Config, XUsb::DeviceConfig, XUsb::EndPointOffset, XUsb_DeviceConfig::Ep, XUSB_BUFFREADY_OFFSET, XUSB_EP_BUF0COUNT_OFFSET, XUSB_EP_CFG_DATA_TOGGLE_MASK, XUsb_ReadReg, and XUsb_WriteReg.
Referenced by ExecuteCommand(), MassStorageReset(), SetClearFeature(), SetConfiguration(), and SetInterface().