EasyManuals Logo

Cypress EZ-USB FX3 User Manual

Cypress EZ-USB FX3
660 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #118 background imageLoading...
Page #118 background image
EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 118
Universal Serial Bus (USB)
CyU3PBusyWait (100);
/* Reset and enable the PHY. */
UIB->phy_clk_and_test = (CY_U3P_UIB_DATABUS16_8 | CY_U3P_UIB_VLOAD |
CY_U3P_UIB_RESET | CY_U3P_UIB_EN_SWITCH);
CyU3PBusyWait (10);
UIB->phy_clk_and_test &= ~CY_U3P_UIB_RESET;
UIB->phy_clk_and_test |= CY_U3P_UIB_SUSPEND_N;
CyU3PBusyWait (100);
/* Switch EPM clock to 120MHz. */
GCTL->uib_core_clk &= ~CY_U3P_GCTL_UIBCLK_EPMCLK_SRC_MASK;
CyU3PBusyWait (10);
UIB->otg_ctrl &= ~CY_U3P_UIB_DEV_ENABLE;
}
}
CyU3PReturnStatus_t
CyU3POtgSrpStart (uint32_t repeatInterval)
{
if (!glIsOtgEnable)
{
return CY_U3P_ERROR_NOT_STARTED;
}
if ((repeatInterval > CY_U3P_OTG_SRP_MAX_REPEAT_INTERVAL) ||
(repeatInterval == 0))
{
return CY_U3P_ERROR_BAD_ARGUMENT;
}
/* Check if device mode is enabled. */
if ((!CyU3POtgIsDeviceMode ()) || (CyU3PUsbIsStarted ()) || (CyU3PUsbHostIsStarted ()))
{
return CY_U3P_ERROR_INVALID_SEQUENCE;
}
/* Check if there is any valid session. */
if (GCTL->iopower & glUibDeviceInfo.vbusDetectMode)
{
return CY_U3P_ERROR_INVALID_SEQUENCE;
}
CyU3POtgSetupPhy ();
/* Update the required timer period value. */
glOtgTimerPeriod = (uint32_t)(repeatInterval * 32);
/* Initialize the OTG timer with the corresponding repeat period. */
UIB->otg_timer = glOtgTimerPeriod;
return CY_U3P_SUCCESS;
}
6.10.2.3 Host Negotiation Protocol
An OTG A-device acts as the host initially in a USB session. To allow a peripheral to assume the role of a host, the initial host
must first configure the peripheral to enable HNP support through USB commands (SetFeature(b_hnp_enable)). To start the

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cypress EZ-USB FX3 and is the answer not in the manual?

Cypress EZ-USB FX3 Specifications

General IconGeneral
BrandCypress
ModelEZ-USB FX3
CategoryController
LanguageEnglish

Related product manuals